tl 支付兼容
This commit is contained in:
@@ -334,7 +334,7 @@ func Pay4Order(ctx *jxcontext.Context, orderID int64, payType int, vendorPayType
|
|||||||
err = dao.CreateEntity(dao.GetDB(), orderPay)
|
err = dao.CreateEntity(dao.GetDB(), orderPay)
|
||||||
}
|
}
|
||||||
case model.PayTypeTicTok:
|
case model.PayTypeTicTok:
|
||||||
if orderPay, err = pay4OrderByTT(ctx, order, vendorPayType); err == nil && orderPay != nil {
|
if orderPay, err = pay4OrderByTT(ctx, order, vendorPayType, subAppID); err == nil && orderPay != nil {
|
||||||
dao.WrapAddIDCULDEntity(orderPay, ctx.GetUserName())
|
dao.WrapAddIDCULDEntity(orderPay, ctx.GetUserName())
|
||||||
err = dao.CreateEntity(dao.GetDB(), orderPay)
|
err = dao.CreateEntity(dao.GetDB(), orderPay)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ func getOrderBriefTt(order *model.GoodsOrder) string {
|
|||||||
return fmt.Sprintf("%s等共%d件商品", order.Skus[0].SkuName, order.GoodsCount)
|
return fmt.Sprintf("%s等共%d件商品", order.Skus[0].SkuName, order.GoodsCount)
|
||||||
}
|
}
|
||||||
|
|
||||||
func pay4OrderByTT(ctx *jxcontext.Context, order *model.GoodsOrder, vendorPayType string) (orderPay *model.OrderPay, err error) {
|
func pay4OrderByTT(ctx *jxcontext.Context, order *model.GoodsOrder, vendorPayType, subAppID string) (orderPay *model.OrderPay, err error) {
|
||||||
param := &tiktok.TickTokCreateOrder{
|
param := &tiktok.TickTokCreateOrder{
|
||||||
AppID: api.TiktokApi.GetAppID(),
|
//AppID: api.TiktokApi.GetAppID(),
|
||||||
OutOrderNo: utils.Int64ToStr(GenPayOrderID(order)),
|
OutOrderNo: utils.Int64ToStr(GenPayOrderID(order)),
|
||||||
TotalAmount: int(order.ActualPayPrice),
|
TotalAmount: int(order.ActualPayPrice),
|
||||||
Subject: "蔬菜水果日用品",
|
Subject: "蔬菜水果日用品",
|
||||||
@@ -29,7 +29,15 @@ func pay4OrderByTT(ctx *jxcontext.Context, order *model.GoodsOrder, vendorPayTyp
|
|||||||
CpExtra: "msg",
|
CpExtra: "msg",
|
||||||
NotifyURL: globals.TictokpayNotifyURL,
|
NotifyURL: globals.TictokpayNotifyURL,
|
||||||
}
|
}
|
||||||
|
if subAppID == tiktok.TiktokJXDJAppID {
|
||||||
|
param = &tiktok.TickTokCreateOrder{
|
||||||
|
AppID: api.TiktokJXDJApi.GetAppID(),
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
param = &tiktok.TickTokCreateOrder{
|
||||||
|
AppID: api.TiktokApi.GetAppID(),
|
||||||
|
}
|
||||||
|
}
|
||||||
ttOrderId, orderToken, err := api.TiktokApi.CreateOrderByTicktock(param)
|
ttOrderId, orderToken, err := api.TiktokApi.CreateOrderByTicktock(param)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
orderPay = &model.OrderPay{
|
orderPay = &model.OrderPay{
|
||||||
|
|||||||
Reference in New Issue
Block a user