fix(payment): 同时启用易支付和 Stripe 时显示 Stripe 按钮

VISIBLE_METHOD_ALIASES 漏了 stripe,导致 getVisibleMethods 把后端返回
的 stripe 过滤掉。点 Stripe 按钮时省略 method 查询参数,让落地页渲染
完整的 Payment Element。
This commit is contained in:
shaw
2026-04-25 09:46:27 +08:00
parent 7424c73b05
commit 8f28a834f8
3 changed files with 29 additions and 5 deletions

View File

@@ -693,14 +693,18 @@ async function createOrder(orderAmount: number, orderType: OrderType, planId?: n
}
}
const visibleMethod = normalizeVisibleMethod(requestType) || requestType
const stripeMethod = visibleMethod === 'wxpay' ? 'wechat_pay' : 'alipay'
// When user clicks the dedicated Stripe button, leave method blank so the
// landing page renders Stripe's full Payment Element (card/link/alipay/wxpay).
const stripeMethod = visibleMethod === 'stripe'
? ''
: visibleMethod === 'wxpay' ? 'wechat_pay' : 'alipay'
const stripeRouteUrl = result.client_secret
? router.resolve({
path: '/payment/stripe',
query: {
order_id: String(result.order_id),
client_secret: result.client_secret,
method: stripeMethod,
method: stripeMethod || undefined,
resume_token: result.resume_token || undefined,
},
}).href