1
This commit is contained in:
@@ -62,14 +62,14 @@ func OnTTPayCallback(msg *tiktok.DetailCallBackMessage, refund *tiktok.DetailCal
|
|||||||
}
|
}
|
||||||
|
|
||||||
func onTTPayFinished(msg *tiktok.DetailCallBackMessage) (err error) {
|
func onTTPayFinished(msg *tiktok.DetailCallBackMessage) (err error) {
|
||||||
globals.SugarLogger.Debugf("支付回调==================1")
|
globals.SugarLogger.Debugf("退款回调==================1")
|
||||||
orderPay := &model.OrderPay{
|
orderPay := &model.OrderPay{
|
||||||
PayOrderID: msg.CpOrderno,
|
PayOrderID: msg.CpOrderno,
|
||||||
PayType: model.PayTypeWX,
|
PayType: model.PayTypeTicTok,
|
||||||
}
|
}
|
||||||
orderPay.DeletedAt = utils.DefaultTimeValue
|
orderPay.DeletedAt = utils.DefaultTimeValue
|
||||||
db := dao.GetDB()
|
db := dao.GetDB()
|
||||||
if err = dao.GetEntity(db, orderPay); err == nil {
|
if err = dao.GetEntity(db, orderPay, "PayOrderID", "PayType", "DeletedAt"); err == nil {
|
||||||
orderPay.PayFinishedAt = utils.Time2Pointer(wxpayapi.PayTime2Time(utils.Int64ToStr(msg.PaidAt)))
|
orderPay.PayFinishedAt = utils.Time2Pointer(wxpayapi.PayTime2Time(utils.Int64ToStr(msg.PaidAt)))
|
||||||
orderPay.TransactionID = msg.ChannelNo
|
orderPay.TransactionID = msg.ChannelNo
|
||||||
orderPay.OriginalData = utils.Format4Output(msg, true)
|
orderPay.OriginalData = utils.Format4Output(msg, true)
|
||||||
@@ -94,7 +94,7 @@ func onTTPayRefund(msg *tiktok.DetailCallBackMessage2Refund) (err error) {
|
|||||||
RefundID: msg.CpRefundno,
|
RefundID: msg.CpRefundno,
|
||||||
}
|
}
|
||||||
db := dao.GetDB()
|
db := dao.GetDB()
|
||||||
if err = dao.GetEntity(db, orderPayRefund); err == nil {
|
if err = dao.GetEntity(db, orderPayRefund, "RefundID"); err == nil {
|
||||||
if msg.Status == tiktok.ResponseCodeSuccess {
|
if msg.Status == tiktok.ResponseCodeSuccess {
|
||||||
orderPayRefund.Status = model.RefundStatusYes
|
orderPayRefund.Status = model.RefundStatusYes
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user