f
This commit is contained in:
@@ -563,6 +563,10 @@ func (r *GetPaymentURLResponse) GetCodeInt() int {
|
|||||||
type PaymentURLData struct {
|
type PaymentURLData struct {
|
||||||
PayURL string `json:"payUrl,omitempty"`
|
PayURL string `json:"payUrl,omitempty"`
|
||||||
URL string `json:"url,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 获取支付链接
|
// GetPaymentURL 获取支付链接
|
||||||
@@ -633,12 +637,20 @@ func (y *YunYinSignPayService) GetPaymentURL(ctx context.Context, accessToken, u
|
|||||||
return "", fmt.Errorf("支付链接数据为空")
|
return "", fmt.Errorf("支付链接数据为空")
|
||||||
}
|
}
|
||||||
|
|
||||||
// 优先返回 PayURL,如果没有则返回 URL
|
// 优先返回 PayURL,如果没有则返回 URL,再没有则返回 Path(支付宝小程序链接)
|
||||||
payURL := paymentURLResp.Data.PayURL
|
payURL := paymentURLResp.Data.PayURL
|
||||||
if payURL == "" {
|
if payURL == "" {
|
||||||
payURL = paymentURLResp.Data.URL
|
payURL = paymentURLResp.Data.URL
|
||||||
|
if payURL != "" {
|
||||||
logx.Infof("[云印签API] GetPaymentURL: PayURL为空,使用URL字段: %s", 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 == "" {
|
if payURL == "" {
|
||||||
logx.Errorf("[云印签API] GetPaymentURL: 支付链接为空,响应数据: %+v", paymentURLResp.Data)
|
logx.Errorf("[云印签API] GetPaymentURL: 支付链接为空,响应数据: %+v", paymentURLResp.Data)
|
||||||
|
|||||||
Reference in New Issue
Block a user