#anthony_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1356452777257074849
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
https://docs.stripe.com/tax/custom#calculate-tax you can use this API to calculate the tax amount based on the customer's address, and update the paymentIntent amount accordingly
thanks. my question is more, how do we call that API from within the apple pay component?
No you can't, you can only call the tax calculation API from your server.
to confirm, there is no way then to preview the tax in the apple pay component โ unless we use address data from elsewhere and call the tax preview before?
Yes you are right. You'll want to collect the billing address from your customer first, calculate the tax before presenting the Apple Pay paymentsheet to your customer.
for shipping address, can i use the onshippingaddresschange to trigger a tax preview API call?
You can, but you won't be able to update the new payment amount on the already opened Apple Pay paymentsheet.
got it. thanks so much for your help, this question can be closed!