f
This commit is contained in:
@@ -561,8 +561,12 @@ func (r *GetPaymentURLResponse) GetCodeInt() int {
|
||||
|
||||
// PaymentURLData 支付链接数据
|
||||
type PaymentURLData struct {
|
||||
PayURL string `json:"payUrl,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
PayURL string `json:"payUrl,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
Path string `json:"path,omitempty"` // 支付宝小程序链接路径
|
||||
QrCode string `json:"qrCode,omitempty"` // 二维码链接
|
||||
AppSameFlag string `json:"appSameFlag,omitempty"` // 是否同应用标识
|
||||
AppID interface{} `json:"appId,omitempty"` // 应用ID
|
||||
}
|
||||
|
||||
// GetPaymentURL 获取支付链接
|
||||
@@ -633,11 +637,19 @@ func (y *YunYinSignPayService) GetPaymentURL(ctx context.Context, accessToken, u
|
||||
return "", fmt.Errorf("支付链接数据为空")
|
||||
}
|
||||
|
||||
// 优先返回 PayURL,如果没有则返回 URL
|
||||
// 优先返回 PayURL,如果没有则返回 URL,再没有则返回 Path(支付宝小程序链接)
|
||||
payURL := paymentURLResp.Data.PayURL
|
||||
if payURL == "" {
|
||||
payURL = paymentURLResp.Data.URL
|
||||
logx.Infof("[云印签API] GetPaymentURL: PayURL为空,使用URL字段: %s", payURL)
|
||||
if payURL != "" {
|
||||
logx.Infof("[云印签API] GetPaymentURL: PayURL为空,使用URL字段: %s", payURL)
|
||||
}
|
||||
}
|
||||
if payURL == "" {
|
||||
payURL = paymentURLResp.Data.Path
|
||||
if payURL != "" {
|
||||
logx.Infof("[云印签API] GetPaymentURL: PayURL和URL为空,使用Path字段: %s", payURL)
|
||||
}
|
||||
}
|
||||
|
||||
if payURL == "" {
|
||||
|
||||
Reference in New Issue
Block a user