修改申请退款
This commit is contained in:
@@ -21,6 +21,7 @@ const (
|
||||
VendorIDPurchaseEnd = 11
|
||||
VendorIDJX = 9 // 这是一个假的京西VendorID
|
||||
VendorGoMei = 12 // 国美
|
||||
VendorIDTT = 13 // 抖音平台小程序
|
||||
|
||||
VendorIDWXPay = 51 // 微信支付
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ func onTTPayFinished(msg *tiktok.DetailCallBackMessage) (err error) {
|
||||
db := dao.GetDB()
|
||||
if err = dao.GetEntity(db, orderPay, "PayOrderID", "PayType", "DeletedAt"); err == nil {
|
||||
loc, _ := time.LoadLocation("Local")
|
||||
t1, _ := time.ParseInLocation("20060102150405", time.Unix(msg.PaidAt,0).Format("20060102150405"), loc)
|
||||
t1, _ := time.ParseInLocation("20060102150405", time.Unix(msg.PaidAt, 0).Format("20060102150405"), loc)
|
||||
orderPay.PayFinishedAt = utils.Time2Pointer(t1)
|
||||
orderPay.TransactionID = msg.ChannelNo
|
||||
orderPay.OriginalData = utils.Format4Output(msg, true)
|
||||
@@ -79,7 +79,7 @@ func onTTPayFinished(msg *tiktok.DetailCallBackMessage) (err error) {
|
||||
} else {
|
||||
orderPay.Status = model.PayStatusFailed
|
||||
}
|
||||
dao.UpdateEntity(db, orderPay)
|
||||
dao.UpdateEntity(db, &orderPay)
|
||||
if msg.Status == tiktok.ResponseCodeSuccess {
|
||||
err = OnPayFinished(orderPay)
|
||||
}
|
||||
@@ -89,7 +89,6 @@ func onTTPayFinished(msg *tiktok.DetailCallBackMessage) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
func onTTPayRefund(msg *tiktok.DetailCallBackMessage2Refund) (err error) {
|
||||
globals.SugarLogger.Debugf("退款回调==================2")
|
||||
orderPayRefund := &model.OrderPayRefund{
|
||||
@@ -133,6 +132,8 @@ func RefundOrderByTT(ctx *jxcontext.Context, orderPay *model.OrderPay, refundID
|
||||
CpExtra: "msg",
|
||||
NotifyURL: globals.TictokpayNotifyURL,
|
||||
})
|
||||
globals.SugarLogger.Debug("申请退款============",err)
|
||||
globals.SugarLogger.Debug("申请退款============",result)
|
||||
if err == nil {
|
||||
orderPayRefund = &model.OrderPayRefund{
|
||||
RefundID: refundID,
|
||||
|
||||
@@ -64,6 +64,8 @@ func (a *APIManager) GetAPI(vendorID int, appOrgCode string) (pfAPI interface{})
|
||||
pfAPI = api.JdShopAPI
|
||||
case model.VendorGoMei:
|
||||
pfAPI = api.GuoMeiApi
|
||||
case model.VendorIDTT:
|
||||
pfAPI = api.TiktokApi
|
||||
}
|
||||
return pfAPI
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user