feat: 微信退款fix

This commit is contained in:
wolter 2024-12-06 22:06:05 +08:00
parent 24c0c6d36a
commit cacfbccbcf
1 changed files with 13 additions and 2 deletions

View File

@ -8,8 +8,9 @@ import (
)
var RefundWayList = map[int]func(commonRefundInfo *paymentService.OrderRefundRequest, channel *paychannelmodel.PayChannel) error{
common.PAY_CHANNEL_WECHAT_H5: WechatH5Refund,
common.PAY_CHANNEL_ALIPAY_WEB: AlipayWebRefund,
common.PAY_CHANNEL_WECHAT_H5: WechatH5Refund,
common.PAY_CHANNEL_ALIPAY_WEB: AlipayWebRefund,
common.PAY_CHANNEL_WECHAT_JSAPI: WechatJSAPIRefund,
}
func WechatH5Refund(commonRefundInfo *paymentService.OrderRefundRequest, channel *paychannelmodel.PayChannel) error {
@ -31,3 +32,13 @@ func AlipayWebRefund(commonRefundInfo *paymentService.OrderRefundRequest, channe
commonRefundInfo.Ali.AppId = channel.AppId
return nil
}
func WechatJSAPIRefund(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
}
commonRefundInfo.Wx.AppId = channel.AppId
return nil
}