fix:支付

This commit is contained in:
momo 2023-09-27 17:40:44 +08:00
parent 39efb7eefb
commit f68032c8ea

View File

@ -287,7 +287,6 @@ func (d *defaultOrder) PaymentSuccessful(ctx context.Context, in *PaymentSuccess
StatusTitle: constants.PayStatusMessage[constants.PAY_STATUS_PAID],
}
payInfo.StatusLink = append(ress.OrderDetailOriginal.OrderAmount.Deposit.StatusLink, payInfo.Status)
payStatusLink = payInfo.StatusLink
orderAmount["deposit"] = payInfo
}
if payStage == "remaining_balance" {
@ -329,10 +328,11 @@ func (d *defaultOrder) PaymentSuccessful(ctx context.Context, in *PaymentSuccess
}
payInfo.StatusLink = append(ress.OrderDetailOriginal.OrderAmount.RemainingBalance.StatusLink, payInfo.Status)
payStatusLink = payInfo.StatusLink
orderAmount["remaining_balance"] = payInfo
}
payStatusLink = append(ress.OrderDetailOriginal.PayStatusLink, payInfo.Status)
orderAmountByte, err := json.Marshal(orderAmount)
if err != nil {
logc.Errorf(ctx, "PaymentSuccessful failed Marshal orderAmount,eventId:%s, err: %v", in.EventId, err)
@ -1173,10 +1173,10 @@ func (d *defaultOrder) OrderDetailHandler(ctx context.Context, orderInfo *gmodel
if original == 1 {
orderDetail.DeliveryAddress = orderAddress
orderDetail.OrderAmount = orderAmount
orderDetail.OrderAmount.Deposit.PayAmount = order.GetAmountInfoFormat(&orderDetail.OrderAmount.Deposit.PayAmount)
orderDetail.OrderAmount.RemainingBalance.PayAmount = order.GetAmountInfoFormat(&orderDetail.OrderAmount.RemainingBalance.PayAmount)
orderDetail.OrderAmount.Subtotal = order.GetAmountInfoFormat(&orderDetail.OrderAmount.Subtotal)
orderDetail.OrderAmount.Total = order.GetAmountInfoFormat(&orderDetail.OrderAmount.Total)
orderDetail.OrderAmount.Deposit.PayAmount = order.GetAmountInfoFormat(&orderAmount.Deposit.PayAmount)
orderDetail.OrderAmount.RemainingBalance.PayAmount = order.GetAmountInfoFormat(&orderAmount.RemainingBalance.PayAmount)
orderDetail.OrderAmount.Subtotal = order.GetAmountInfoFormat(&orderAmount.Subtotal)
orderDetail.OrderAmount.Total = order.GetAmountInfoFormat(&orderAmount.Total)
orderDetail.PayStatus = constants.OrderPayStatusCode(*orderInfo.PayStatus)
orderDetail.PayTimeout = time.Duration(orderInfo.Ctime.Add(30*time.Minute).UTC().Unix() - time.Now().UTC().Unix())
orderDetail.OrderInfo = gmodel.OrderInfo{
@ -1186,7 +1186,7 @@ func (d *defaultOrder) OrderDetailHandler(ctx context.Context, orderInfo *gmodel
Ctime: orderInfo.Ctime,
Utime: orderInfo.Utime,
Status: status,
StatusLink: order.GetOrderStatusLinkUser(orderDetail.OrderInfo.DeliveryMethod, statusLink),
StatusLink: order.GetOrderStatusLinkUser(*orderInfo.DeliveryMethod, statusLink),
Metadata: orderMetadata,
}