feat(main): fix prepayId
This commit is contained in:
parent
98d21d5ab9
commit
217ddad2a1
@ -14,6 +14,7 @@ type (
|
||||
}
|
||||
PaymentResp {
|
||||
prepayData interface{} `json:"prepay_data"`
|
||||
prepayId string `json:"prepay_id"`
|
||||
OrderID int64 `json:"order_id"`
|
||||
}
|
||||
)
|
||||
|
@ -132,6 +132,11 @@ func (l *PaymentLogic) Payment(req *types.PaymentReq) (resp *types.PaymentResp,
|
||||
if transErr != nil {
|
||||
return nil, transErr
|
||||
}
|
||||
|
||||
return &types.PaymentResp{PrepayData: prepayData, OrderID: orderID}, nil
|
||||
switch v := prepayData.(type) {
|
||||
case string:
|
||||
// 如果 prepayData 是字符串类型,直接返回
|
||||
return &types.PaymentResp{PrepayId: v, OrderID: orderID}, nil
|
||||
default:
|
||||
return &types.PaymentResp{PrepayData: prepayData, OrderID: orderID}, nil
|
||||
}
|
||||
}
|
||||
|
@ -72,6 +72,7 @@ type PaymentReq struct {
|
||||
|
||||
type PaymentResp struct {
|
||||
PrepayData interface{} `json:"prepay_data"`
|
||||
PrepayId string `json:"prepay_id"`
|
||||
OrderID int64 `json:"order_id"`
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user