1.4.5.2
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
|
||||
|
||||
package alipay
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/userconfigs"
|
||||
"github.com/TeaOSLab/EdgeUser/internal/remotelogs"
|
||||
"github.com/TeaOSLab/EdgeUser/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeUser/internal/web/actions/default/login/loginutils"
|
||||
)
|
||||
|
||||
// NotifyAction TODO 防止cc攻击
|
||||
type NotifyAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *NotifyAction) RunPost(params struct{}) {
|
||||
formData, err := json.Marshal(this.Request.Form)
|
||||
if err != nil {
|
||||
// 提示中加入IP方便调试
|
||||
remotelogs.Error("ALIPAY", "["+loginutils.RemoteIP(&this.ActionObject)+"]NotifyAction: encode form failed: "+err.Error())
|
||||
this.Fail(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// 接口会自动根据传输的订单号决定使用哪种支付方式验证
|
||||
_, err = this.RPC().UserOrderRPC().NotifyUserOrderPayment(this.UserContext(), &pb.NotifyUserOrderPaymentRequest{
|
||||
PayMethod: userconfigs.PayMethodAlipay,
|
||||
FormData: formData,
|
||||
})
|
||||
if err != nil {
|
||||
// 提示中加入IP方便调试
|
||||
remotelogs.Error("ALIPAY", "["+loginutils.RemoteIP(&this.ActionObject)+"]NotifyAction: verify failed: "+err.Error())
|
||||
this.Fail(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
this.Success()
|
||||
}
|
||||
Reference in New Issue
Block a user