This commit is contained in:
unknown
2026-02-04 20:27:13 +08:00
commit 3b042d1dad
9410 changed files with 1488147 additions and 0 deletions

View File

@@ -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()
}