From c0724d335637feaf83fd72f32fbd9e2b51d9281b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=BF=8A=E5=AE=8F?= <389838709@qq.com> Date: Tue, 20 Aug 2024 11:26:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E9=80=80=E6=AC=BE=EF=BC=8C?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E5=8E=9F=E8=AE=A2=E5=8D=95=E6=80=BB=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/third/paymentService/payment_service.go | 1 + app/third/paymentService/wechat_service.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/third/paymentService/payment_service.go b/app/third/paymentService/payment_service.go index 4d53f72..f8cbc42 100644 --- a/app/third/paymentService/payment_service.go +++ b/app/third/paymentService/payment_service.go @@ -165,6 +165,7 @@ type OrderRefundRequest struct { RefundOrderId int64 `json:"refund_order_id"` // 退款订单号 RefundReason string `json:"refund_reason"` // 退款原因 RefundAmount int64 `json:"refund_amount"` // 退款金额,单位分 + TotalAmount int64 `json:"total_amount"` // 订单总额 PayChannel int `json:"pay_channel"` // 支付渠道类型 1:wx,2:zfb Wx WxPay `json:"wx"` Ali AliPay `json:"ali"` diff --git a/app/third/paymentService/wechat_service.go b/app/third/paymentService/wechat_service.go index 8f2fd9e..07a0ef1 100644 --- a/app/third/paymentService/wechat_service.go +++ b/app/third/paymentService/wechat_service.go @@ -229,8 +229,8 @@ func WxOrderRefund(ctx context.Context, orderRefundRequest OrderRefundRequest) ( SetBodyMap("amount", func(bm gopay.BodyMap) { // 退款金额:单位是分 bm.Set("refund", orderRefundRequest.RefundAmount). //实际退款金额 - Set("total", orderRefundRequest.RefundAmount). // 折扣前总金额(不是实际退款数) - Set("currency", "CNY") + Set("total", orderRefundRequest.TotalAmount). // 折扣前总金额(不是实际退款数) + Set("currency", "CNY") }) // body:参数Body refund, err := wxClient.V3Refund(ctx, bm)