Merge branch 'dev-lwl/yop' into test

This commit is contained in:
lwl0608 2024-05-30 11:10:03 +08:00
commit 1a4140c32a
5 changed files with 10 additions and 0 deletions

View File

@ -56,6 +56,7 @@ type CreateOrderReq struct {
Operator string `json:"operator"` // 操作人
CustomCoins int64 `json:"custom_coins"` // 自定义金币数product_id:"h5_custom_coin"
WechatAuthCode string `json:"wechat_auth_code"` // 微信auth_code
RedirectUrl string `json:"redirect_url"` // redirect_url
CalcPrice int64 // 计算价格
Uid int64 // 关联mid
@ -149,6 +150,7 @@ type H5DirectUnlockWechatReq struct {
Uid int64 `json:"uid"` // 主播id
PayType string `json:"pay_type"` // 支付类型
WechatAuthCode string `json:"wechat_auth_code"` // 微信auth_code
RedirectUrl string `json:"redirect_url"` // redirect_url
}
type H5DirectUnlockWechatData struct {

View File

@ -159,6 +159,7 @@ type ZoneCreateOrderReq struct {
PayType string `json:"pay_type"` // 支付方式
From string `json:"from"` // 来源
WechatAuthCode string `json:"wechat_auth_code"` // 微信auth_code
RedirectUrl string `json:"redirect_url"` // redirect_url
}
type ZoneCreateOrderData struct {

View File

@ -306,6 +306,7 @@ func (v *Vas) CreateOrder(ctx *gin.Context, req *vasproto.CreateOrderReq) (data
Description: product.Subject,
OutTradeNo: orderId,
TotalAmount: product.RealPrice,
RedirectUrl: req.RedirectUrl,
PayWay: yeepaycli.YeepayWayH5,
PayChannel: yeepaycli.YeepayChannelAlipay,
Ip: ctx.ClientIP(),
@ -328,6 +329,7 @@ func (v *Vas) CreateOrder(ctx *gin.Context, req *vasproto.CreateOrderReq) (data
Description: product.Subject,
OutTradeNo: orderId,
TotalAmount: product.RealPrice,
RedirectUrl: req.RedirectUrl,
PayWay: yeepaycli.YeepayWayH5,
PayChannel: yeepaycli.YeepayChannelWxpay,
Ip: ctx.ClientIP(),
@ -1261,6 +1263,7 @@ func (v *Vas) H5DirectUnlockWechat(ctx *gin.Context, req *vasproto.H5DirectUnloc
CalcPrice: uVas.GetH5WechatCoinPrice() * 10,
Uid: uid,
ReturnUrl: "https://tiefen.fun/purchased",
RedirectUrl: req.RedirectUrl,
})
if err != nil {
logger.Error("CreateOrder fail, req: %v, err: %v", util.ToJson(req), err)

View File

@ -251,6 +251,7 @@ func (v *Vas) ZoneCreateOrder(ctx *gin.Context, req *vasproto.ZoneCreateOrderReq
Uid: uid,
Oid1: fmt.Sprintf("%d", req.Zid),
Oid2: oid2,
RedirectUrl: req.RedirectUrl,
}
createOrderData, err := v.CreateOrder(ctx, createOrderReq)
if err != nil {

View File

@ -139,6 +139,9 @@ func (c *YeepayClient) AggPay(ctx context.Context, param *AggPayParam) (resp *Ag
req.AddParam("channel", param.PayChannel)
req.AddParam("scene", "OFFLINE")
req.AddParam("userIp", param.Ip)
if len(param.RedirectUrl) > 0 {
req.AddParam("redirectUrl", param.RedirectUrl)
}
respMeta, err := c.client.Request(req)
if err != nil {