feat: update refund
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user