我有 2 个关于付款的流程:
在第一个流程中,我遵循以下步骤:
const paymentIntent = await stripeKey.paymentIntents.create({
customer: customerId,
setup_future_usage: 'off_session',
amount: amount,
currency: 'usd',
metadata : {
tenantId : tenantId,
customerId : customerId,
transaction_from : transaction_from,
},
automatic_payment_methods: {
enabled: true,
allow_redirects: 'always'
}
});
const appearance = {
theme: 'stripe',
};
const options = {
clientSecret: paymentIntent.client_secret,
appearance,
};
elements = stripe.elements(options);
paymentElement = elements.create("payment");
paymentElement.mount("#payment");
在第二个流程中,我遵循以下步骤:
const setupIntent = await stripe.setupIntents.create({
customer: customerId,
metadata: {clientid : tenantId},
automatic_payment_methods: {
enabled: true,
allow_redirects: 'always'
}
});
const appearance = {
theme: 'stripe',
};
const options = {
clientSecret: setupIntent.client_secret,
appearance,
};
elements = stripe.elements(options);
const paymentElement = elements.create("payment");
paymentElement.mount("#paymentMethod");
这里的问题是两个支付元素没有显示相同的支付方式,这导致不一致。我需要采取哪些额外步骤才能在两个付款元素上显示相同的付款方式?
此行为是预期的,因为某些付款方式指定用于付款用途,而不是用于设置用途。例如,“立即购买,稍后付款”等付款方式(例如 Klarna)等某些选项可能无法用于安装程序。