#MadMac
1 messages · Page 1 of 1 (latest)
Hi there, you can't set a tax_rate to a PaymentIntent directly, but you can create an invoice with tax_rate, and use the clientSecret of the invoice's PaymentIntent to render the Stripe elements in your mobile app.
Hmmm that seems like a bit of a change to the way I am doing things so would require quite a bit of testing. Is there no other way?
Is it best practice to create an invoice for a single payment rather than a direct paymentIntent?
As there seems to be quite a few limitations with paymentIntents
PaymentIntents API is a low-level API, so a PaymentIntent object doesn't carry the necessary information required for tax calculation, and that's why you need to use the high-level API/products such as invoicing, checkout, paymentLink or subscription to work with tax.
Ok that makes sense. So if I am creating a single payment creating an invoice is probably a better method?
As that creates the payment intent in the background anyway
Yes, when an invoice is finalized, Stripe will automatically create a PaymentIntent and attach it to the invoice.
Ok thanks I will look into that. Unfortunately a bit of a rewrite to a live platform to be able to get tax rates working!
Welcome!