fix(payment): 修正扫呗签名并自动查询支付结果

This commit is contained in:
yml
2026-11-11 16:32:22 +08:00
parent d403ffc734
commit 0963e58fa3
6 changed files with 125 additions and 14 deletions
@@ -497,6 +497,13 @@ func (c saobeiChannel) CreatePayment(ctx context.Context, req channelCreatePayme
Attach: req.Attach,
})
if err != nil {
if resp != nil {
return &channelCreatePaymentResponse{
ErrorMessage: resp.ErrorMessage,
RawRequest: resp.RawRequest,
Raw: resp.Raw,
}, err
}
return nil, err
}
return &channelCreatePaymentResponse{
@@ -68,11 +68,15 @@ func (r *Repository) StartMohong(ctx context.Context, userID uint64, orderID uin
NotifyURL: runtimeConfig.NotifyURL,
JumpURL: runtimeConfig.JumpURL,
ClientIP: clientIP,
Body: "撞车订单 " + orderRow.OrderNo,
Body: "撞车订单-" + orderRow.OrderNo,
Attach: orderRow.OrderNo,
})
if err != nil {
_ = r.markPaymentFailed(ctx, payment.ID, nil, err.Error())
var raw map[string]string
if resp != nil {
raw = resp.Raw
}
_ = r.markPaymentFailed(ctx, payment.ID, raw, err.Error())
r.log().Warn("魔哄支付下单失败", paymentLogFields(ctx, appendFields(
paymentOrderFields(payment),
runtimeConfigFields(runtimeConfig),
@@ -64,11 +64,15 @@ func (r *Repository) Start(ctx context.Context, userID uint64, orderID uint64, r
NotifyURL: runtimeConfig.NotifyURL,
JumpURL: runtimeConfig.JumpURL,
ClientIP: clientIP,
Body: "租号订单 " + orderRow.OrderNo,
Body: "租号订单-" + orderRow.OrderNo,
Attach: orderRow.OrderNo,
})
if err != nil {
_ = r.markPaymentFailed(ctx, payment.ID, nil, err.Error())
var raw map[string]string
if resp != nil {
raw = resp.Raw
}
_ = r.markPaymentFailed(ctx, payment.ID, raw, err.Error())
r.log().Warn("支付下单请求失败", paymentLogFields(ctx, appendFields(
paymentOrderFields(payment),
runtimeConfigFields(runtimeConfig),