feat: update refund

This commit is contained in:
Rogee
2025-05-06 21:22:14 +08:00
parent 811ed3a41f
commit 1f8f2b0e96
2 changed files with 2 additions and 20 deletions

View File

@@ -52,16 +52,7 @@ func (ctl *orders) Refund(ctx fiber.Ctx, id int64) error {
OutTradeNo(order.OrderNo).
TransactionID(order.TransactionID).
CNYRefundAmount(refundTotal, refundTotal).
RefundReason("管理员退款").
RefundGoods([]wepay.RefundGoodsInfo{
{
MerchantGoodsID: fmt.Sprintf("%d", order.PostID),
GoodsName: post.Title,
RefundQuantity: 1,
RefundAmount: refundTotal,
UnitPrice: order.Price,
},
})
RefundReason(fmt.Sprintf("%s 退款", post.Title))
})
if err != nil {
return err

View File

@@ -2,7 +2,6 @@ package http
import (
_ "embed"
"fmt"
"strconv"
"time"
@@ -280,15 +279,7 @@ func (ctl *posts) Buy(ctx fiber.Ctx, id int64, user *model.Users) (*wechat.JSAPI
Description(post.Title).
OutTradeNo(order.OrderNo).
Payer(user.OpenID).
CNYAmount(payPrice).
Detail([]wepay.GoodsInfo{
{
GoodsName: post.Title,
UnitPrice: payPrice,
MerchantGoodsID: fmt.Sprintf("%d", post.ID),
Quantity: 1,
},
})
CNYAmount(payPrice)
})
if err != nil {
log.Errorf("wepay.V3TransactionJsapi err: %v", err)