<feat>退款

This commit is contained in:
Rzy 2024-08-09 17:49:41 +08:00
parent a54212d38c
commit c13634ed08
2 changed files with 3 additions and 1 deletions

View File

@ -121,7 +121,6 @@ func (w *Pay) Refund() {
RefundOrderId: w.RelationOrder.Id,
RefundReason: w.PayParam.Desc,
RefundAmount: int64(w.PayParam.Amount),
PayChannel: w.PayParam.Channel.ChannelType,
}
if refundFunc, ok = RefundWayList[w.PayParam.Channel.ChannelType]; !ok {
w.PayCode = errorcode.PayChannelNotBuild
@ -138,6 +137,7 @@ func (w *Pay) Refund() {
code := services.OrderUpdate(w.Order, "status")
if code != errorcode.Success {
w.PayCode = code
return
}
} else {
w.PayCode = errorcode.PreRefundFail

View File

@ -13,6 +13,7 @@ var RefundWayList = map[int]func(commonRefundInfo *paymentService.OrderRefundReq
}
func WechatH5Refund(commonRefundInfo *paymentService.OrderRefundRequest, channel *paychannelmodel.PayChannel) error {
commonRefundInfo.PayChannel = common.PAY_CHANNLE_TYPE_WECHAT
err := sonic.Unmarshal([]byte(channel.ExtJson), &commonRefundInfo.Wx)
if err != nil {
return err
@ -22,6 +23,7 @@ func WechatH5Refund(commonRefundInfo *paymentService.OrderRefundRequest, channel
}
func AlipayWebRefund(commonRefundInfo *paymentService.OrderRefundRequest, channel *paychannelmodel.PayChannel) error {
commonRefundInfo.PayChannel = common.PAY_CHANNLE_TYPE_ZFB
err := sonic.Unmarshal([]byte(channel.ExtJson), &commonRefundInfo.Ali)
if err != nil {
return err