京西商城售后单

This commit is contained in:
苏尹岚
2020-06-27 09:41:36 +08:00
parent 9b3c9496f7
commit 6a91db0adc
4 changed files with 73 additions and 17 deletions

View File

@@ -1024,7 +1024,7 @@ func CancelOrder(ctx *jxcontext.Context, order *model.GoodsOrder, reason string)
errList.AddErr(err)
}
} else if orderPay.PayType == model.PayTypeTL {
orderPayRefund, err = refundOrderByTL(ctx, orderPay, refundID, orderPay.TotalFee, reason)
orderPayRefund, err = RefundOrderByTL(ctx, orderPay, refundID, orderPay.TotalFee, reason)
if err != nil {
errList.AddErr(err)
}

View File

@@ -147,11 +147,10 @@ func onTLpayRefund(call *tonglianpayapi.CallBackResult) (err error) {
return err
}
func refundOrderByTL(ctx *jxcontext.Context, orderPay *model.OrderPay, refundID string, refundFee int, refundDesc string) (orderPayRefund *model.OrderPayRefund, err error) {
func RefundOrderByTL(ctx *jxcontext.Context, orderPay *model.OrderPay, refundID string, refundFee int, refundDesc string) (orderPayRefund *model.OrderPayRefund, err error) {
result, err := api.TLpayAPI.PayRefund(&tonglianpayapi.PayRefundParam{
Trxamt: orderPay.TotalFee,
Reqsn: utils.GetUUID(),
// OldReqsn: orderPay.VendorOrderID,
Trxamt: refundFee,
Reqsn: utils.GetUUID(),
Remark: refundDesc,
OldTrxID: orderPay.TransactionID,
})
@@ -163,7 +162,7 @@ func refundOrderByTL(ctx *jxcontext.Context, orderPay *model.OrderPay, refundID
VendorID: orderPay.VendorID,
Status: model.RefundStatusNo,
TransactionID: orderPay.TransactionID,
RefundFee: orderPay.TotalFee,
RefundFee: refundFee,
RefundCreatedAt: time.Now(),
}
dao.WrapAddIDCULDEntity(orderPayRefund, ctx.GetUserName())