This commit is contained in:
2026-01-16 19:09:58 +08:00
parent 625207e013
commit 84e88c61c2

View File

@@ -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 == "" {