This commit is contained in:
邹宗楠
2022-05-28 11:30:15 +08:00
parent 700b5c39e4
commit b673ac24c4
4 changed files with 26 additions and 7 deletions

View File

@@ -41,9 +41,19 @@ func pay4OrderByTL(ctx *jxcontext.Context, order *model.GoodsOrder, payType int,
if vendorPayType == tonglianpayapi.PayTypeWxXcx {
param.SubAppID = subAppID
authInfo, err := ctx.GetV2AuthInfo()
// 微信小程序支付
if err == nil && authInfo.GetAuthType() == weixin.AuthTypeMini && authInfo.GetAuthTypeID() == subAppID {
param.Acct = authInfo.GetAuthID()
}
// 抖音小程序,调起微信支付界面
//if err == nil && authInfo.GetAuthType() == douyin.AuthTypeTiktokMini {
// appID, jsCode := weixin.SplitJsCode(subAppID)
// appID = auth2.WeCartAppID
// sessionInfo, err := weixin.GetWxApp(appID).SNSCode2Session(jsCode)
// if err == nil {
// param.Acct = sessionInfo.OpenID
// }
//}
}
if vendorPayType == tonglianpayapi.PayTypeZfbJS || vendorPayType == tonglianpayapi.PayTypeZfbApp {
if authInfo, err := ctx.GetV2AuthInfo(); err == nil {

View File

@@ -40,11 +40,8 @@ func pay4OrderByWX(ctx *jxcontext.Context, order *model.GoodsOrder, vendorPayTyp
if authInfo, err := ctx.GetV2AuthInfo(); err == nil && authInfo.GetAuthType() == weixin.AuthTypeMini {
param.OpenID = authInfo.GetAuthID()
}
globals.SugarLogger.Debug("err1=====================", err)
result, err := api.WxpayAPI.CreateUnifiedOrder(param)
globals.SugarLogger.Debug("err2=====================", err)
globals.SugarLogger.Debug("err3=====================", fmt.Sprintf("%+v", result))
if err == nil {
orderPay = &model.OrderPay{
PayOrderID: param.OutTradeNo,