新的条纹结账中的税率 [英] Tax Rate in new Stripe Checkout
本文介绍了新的条纹结账中的税率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已在我的NodeJS server
上实现了新的Stripe Checkout
,但我无法指定开票的税率。
根据我的理解,税率应在Payment Intent API中指定。事实上,新的Checkout
会通过其CreateSession自动创建Payment Intent
(请参阅payment_intent_data
),但我无法在创建时插入税率。
如何做到这一点?我想要实现的是让用户知道Checkout UI
和最终email invoice
中的税率。
这是我的代码:
return stripe.checkout.sessions.create({
payment_method_types: [paymentMethod],
line_items: [{
name: name,
description: description,
images: [imageUrl],
amount: amount,
currency: currency,
quantity: 1
}],
success_url: successUrl,
cancel_url: cancelUrl,
customer: stripeId,
payment_intent_data: {
receipt_email: email,
metadata: {
userId: userId,
amount: amount,
currency: currency,
ref: ref,
stripeId: stripeId,
details: details
}
}
}).then(session => {
return res.send(session)
推荐答案
在回答此问题时,条纹结账不支持税率。
一种替代方法是使用"Setup"模式Checkout[1]收集付款详细信息,然后使用Checkout中收集的PaymentMethod和您要使用的税率从您的服务器创建一个PaymentIntent[2]。
[1]https://stripe.com/docs/payments/checkout/collecting
[2]https://stripe.com/docs/api/payment_intents/create
这篇关于新的条纹结账中的税率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文