fix(supplier):修复支付订单号获取逻辑
-从PayURL路径中提取订单号用于支付请求 - 添加订单号为空时的错误处理- 更新表单数据中的payOrderId字段来源
This commit is contained in:
@@ -1 +1 @@
|
||||
golang 1.24.4
|
||||
golang 1.25.2
|
||||
|
||||
@@ -106,6 +106,16 @@ func (s *SendCardTaskTypeWtr) HandleSendCardTask(ctx context.Context, orderItem
|
||||
attribute.String("orderId", orderItem.OrderID),
|
||||
))
|
||||
defer span.End()
|
||||
queryOrderId := ""
|
||||
|
||||
pathSchemas := strings.Split(orderItem.PayURL, "/")
|
||||
if len(pathSchemas) == 0 {
|
||||
return errors.New("获取订单号失败")
|
||||
}
|
||||
queryOrderId = pathSchemas[len(pathSchemas)-1]
|
||||
if queryOrderId == "" {
|
||||
return errors.New("获取订单号失败")
|
||||
}
|
||||
|
||||
// 创建resty客户端
|
||||
client := resty.New().
|
||||
@@ -137,7 +147,7 @@ func (s *SendCardTaskTypeWtr) HandleSendCardTask(ctx context.Context, orderItem
|
||||
}
|
||||
// 准备表单数据
|
||||
formData := map[string]string{
|
||||
"payOrderId": orderItem.RemoteOrderID,
|
||||
"payOrderId": queryOrderId,
|
||||
"cardAccount": task.CardInfo.CardNo,
|
||||
"cardPassword": task.CardInfo.Data,
|
||||
"key": key,
|
||||
|
||||
Reference in New Issue
Block a user