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).
|
OutTradeNo(order.OrderNo).
|
||||||
TransactionID(order.TransactionID).
|
TransactionID(order.TransactionID).
|
||||||
CNYRefundAmount(refundTotal, refundTotal).
|
CNYRefundAmount(refundTotal, refundTotal).
|
||||||
RefundReason("管理员退款").
|
RefundReason(fmt.Sprintf("%s 退款", post.Title))
|
||||||
RefundGoods([]wepay.RefundGoodsInfo{
|
|
||||||
{
|
|
||||||
MerchantGoodsID: fmt.Sprintf("%d", order.PostID),
|
|
||||||
GoodsName: post.Title,
|
|
||||||
RefundQuantity: 1,
|
|
||||||
RefundAmount: refundTotal,
|
|
||||||
UnitPrice: order.Price,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package http
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
_ "embed"
|
_ "embed"
|
||||||
"fmt"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -280,15 +279,7 @@ func (ctl *posts) Buy(ctx fiber.Ctx, id int64, user *model.Users) (*wechat.JSAPI
|
|||||||
Description(post.Title).
|
Description(post.Title).
|
||||||
OutTradeNo(order.OrderNo).
|
OutTradeNo(order.OrderNo).
|
||||||
Payer(user.OpenID).
|
Payer(user.OpenID).
|
||||||
CNYAmount(payPrice).
|
CNYAmount(payPrice)
|
||||||
Detail([]wepay.GoodsInfo{
|
|
||||||
{
|
|
||||||
GoodsName: post.Title,
|
|
||||||
UnitPrice: payPrice,
|
|
||||||
MerchantGoodsID: fmt.Sprintf("%d", post.ID),
|
|
||||||
Quantity: 1,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("wepay.V3TransactionJsapi err: %v", err)
|
log.Errorf("wepay.V3TransactionJsapi err: %v", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user