我已经实施了新的Stripe Checkout
on my NodeJS server
,但我无法指定Tax Rate用于发票。
据我的理解税率应指定在支付意向API https://stripe.com/docs/api/payment_intents/object#payment_intent_object-invoice。事实是,新Checkout
自动创建一个Payment Intent
通过其创建会话 https://stripe.com/docs/api/checkout/sessions/create (see payment_intent_data
),但我无法插入Tax Rate在其创建时。
如何才能做到这一点?我想要实现的是让用户知道税收百分比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)