fix: EasyPay支付回调缺少access_token导致结果页显示"凭证缺失"
EasyPay provider未将动态returnUrl传递给底层client, 导致return_url使用静态环境变量,不含order_id和access_token参数。
This commit is contained in:
@@ -8,6 +8,7 @@ export interface CreatePaymentOptions {
|
|||||||
paymentType: string;
|
paymentType: string;
|
||||||
clientIp: string;
|
clientIp: string;
|
||||||
productName: string;
|
productName: string;
|
||||||
|
returnUrl?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
function normalizeCidList(cid?: string): string | undefined {
|
function normalizeCidList(cid?: string): string | undefined {
|
||||||
@@ -56,7 +57,7 @@ export async function createPayment(opts: CreatePaymentOptions): Promise<EasyPay
|
|||||||
type: opts.paymentType,
|
type: opts.paymentType,
|
||||||
out_trade_no: opts.outTradeNo,
|
out_trade_no: opts.outTradeNo,
|
||||||
notify_url: env.EASY_PAY_NOTIFY_URL,
|
notify_url: env.EASY_PAY_NOTIFY_URL,
|
||||||
return_url: env.EASY_PAY_RETURN_URL,
|
return_url: opts.returnUrl || env.EASY_PAY_RETURN_URL,
|
||||||
name: opts.productName,
|
name: opts.productName,
|
||||||
money: opts.amount,
|
money: opts.amount,
|
||||||
clientip: opts.clientIp,
|
clientip: opts.clientIp,
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ export class EasyPayProvider implements PaymentProvider {
|
|||||||
paymentType: request.paymentType as 'alipay' | 'wxpay',
|
paymentType: request.paymentType as 'alipay' | 'wxpay',
|
||||||
clientIp: request.clientIp || '127.0.0.1',
|
clientIp: request.clientIp || '127.0.0.1',
|
||||||
productName: request.subject,
|
productName: request.subject,
|
||||||
|
returnUrl: request.returnUrl,
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user