新的Stripe Checkout中的税率

r4i*_*id4 12 checkout stripe-payments


我已经在上实现了新Stripe Checkout功能NodeJS server,但无法指定发票的税率

根据我的理解,应在“ 付款意图” API中指定税率。事实是,新产品通过其CreateSession(请参阅参考资料)自动创建了一个,但我无法在其创建时插入税率CheckoutPayment Intentpayment_intent_data

如何才能做到这一点?我要实现的是让用户在Checkout UI和最后都知道Tax%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)
Run Code Online (Sandbox Code Playgroud)