tl 支付兼容

This commit is contained in:
richboo111
2022-08-19 14:46:11 +08:00
parent 7e93a1fbe8
commit 6062df98cc

View File

@@ -34,7 +34,7 @@ func pay4OrderByTT(ctx *jxcontext.Context, order *model.GoodsOrder, vendorPayTyp
} else {
param.AppID = api.TiktokApi.GetAppID()
}
ttOrderId, orderToken, err := api.TiktokApi.CreateOrderByTicktock(param)
ttOrderId, orderToken, err := getTikTok(subAppID).CreateOrderByTicktock(param)
if err == nil {
orderPay = &model.OrderPay{
PayOrderID: ttOrderId, // 抖音订单id
@@ -52,7 +52,13 @@ func pay4OrderByTT(ctx *jxcontext.Context, order *model.GoodsOrder, vendorPayTyp
}
return orderPay, err
}
func getTikTok(appID string) (TikTokMini *tiktok.API) {
TikTokMini = api.TiktokApi
if len(appID) > 0 && appID == api.TiktokJXDJApiID {
TikTokMini = api.TiktokJXDJApi
}
return TikTokMini
}
func OnTTPayCallback(msg *tiktok.DetailCallBackMessage, refund *tiktok.DetailCallBackMessage2Refund, payType string) (err error) {
globals.SugarLogger.Debugf("OnTTPayCallback msg:%s", utils.Format4Output(msg, true))
switch payType {