diff --git a/app/services/thirdpay/api/api_res_data.go b/app/services/thirdpay/api/api_res_data.go index 0c39b38..e8ff44d 100644 --- a/app/services/thirdpay/api/api_res_data.go +++ b/app/services/thirdpay/api/api_res_data.go @@ -5,6 +5,7 @@ type OrdersResp struct { OrderType int `json:"order_type"` OutTradeNo string `json:"out_trade_no"` Amount int `json:"amount"` + PayerTotal int `json:"payer_total"` Desc string `json:"desc"` Status int `json:"status"` diff --git a/app/services/thirdpay/do/pay.go b/app/services/thirdpay/do/pay.go index 8f23025..6249fec 100644 --- a/app/services/thirdpay/do/pay.go +++ b/app/services/thirdpay/do/pay.go @@ -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 diff --git a/app/services/thirdpay/do/refund_way.go b/app/services/thirdpay/do/refund_way.go index b43e4b9..4ccb9f5 100644 --- a/app/services/thirdpay/do/refund_way.go +++ b/app/services/thirdpay/do/refund_way.go @@ -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 diff --git a/app/services/thirdpay/pay.go b/app/services/thirdpay/pay.go index 70efe63..111f67e 100644 --- a/app/services/thirdpay/pay.go +++ b/app/services/thirdpay/pay.go @@ -27,6 +27,7 @@ func NewOrdersResp(db *ordersmodel.Orders) *api.OrdersResp { Status: db.Status, OrderType: db.OrderType, Amount: db.Amount, + PayerTotal: db.PayerTotal, Desc: db.Desc, CreateTime: db.CreateTime.Format("2006-01-02 15:04:05"), } diff --git a/app/services/thirdpay/thirdpay_notify/notify.go b/app/services/thirdpay/thirdpay_notify/notify.go index 5a69010..977f31a 100644 --- a/app/services/thirdpay/thirdpay_notify/notify.go +++ b/app/services/thirdpay/thirdpay_notify/notify.go @@ -151,6 +151,7 @@ func (o *OrderNotify) updateOrder() { return } o.order.Status = o.Status + o.order.PayerTotal = o.ActualAmount o.Code = services.OrderUpdate(o.order, "status") return }