Merge branch 'dev/dev1.0' into feature_413_cjh

This commit is contained in:
陈俊宏 2024-08-09 17:59:41 +08:00
commit f24a725cef
5 changed files with 6 additions and 1 deletions

View File

@ -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"`

View File

@ -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

View File

@ -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

View File

@ -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"),
}

View File

@ -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
}