admin管理员组文章数量:1332360
When I create a checkout.session with stripe the returned data.payment_intent is null I filled in every required field and the payment works. But without the payment_intent.
const url = await stripe.checkout.sessions
.create(
{
line_items: [
{
price_data: {
product_data: {
name: productName,
description: productDescription,
images: [
'randomimage-url',
],
},
currency: 'eur',
unit_amount: priceInCents,
},
quantity: 1,
},
],
payment_intent_data: {
application_fee_amount: feeAmount,
setup_future_usage: 'on_session'
},
mode: 'payment',
success_url: 'http://localhost:3000/payment',
cancel_url: 'http://localhost:3000',
},
{
stripeAccount: stripeExpressUserId,
}
)
When I create a checkout.session with stripe the returned data.payment_intent is null I filled in every required field and the payment works. But without the payment_intent.
const url = await stripe.checkout.sessions
.create(
{
line_items: [
{
price_data: {
product_data: {
name: productName,
description: productDescription,
images: [
'randomimage-url',
],
},
currency: 'eur',
unit_amount: priceInCents,
},
quantity: 1,
},
],
payment_intent_data: {
application_fee_amount: feeAmount,
setup_future_usage: 'on_session'
},
mode: 'payment',
success_url: 'http://localhost:3000/payment',
cancel_url: 'http://localhost:3000',
},
{
stripeAccount: stripeExpressUserId,
}
)
Share
Improve this question
asked Aug 17, 2022 at 18:19
KaanDevKaanDev
791 silver badge8 bronze badges
1
- used apiVersion: '2022-08-01', – KaanDev Commented Aug 17, 2022 at 18:22
1 Answer
Reset to default 10This is expected behavior with API version 2022-08-01
.
A change was made with this API version so that a Payment Intent is not created when a Checkout Session is initially created, but is instead created when the Checkout Session is confirmed.
You can read more about this and the other changes introduced with this API version here: https://stripe./docs/upgrades#2022-08-01
本文标签: javascriptstripe checkoutsession returned datapaymentintent is nullStack Overflow
版权声明:本文标题:javascript - stripe checkout.session returned data.payment_intent is null - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742317354a2452085.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论