#mehdi_ece-tax-calculations
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/1289263005141303326
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- mehdi_code, 1 day ago, 21 messages
Hi ๐
What type of Tax calculations are you attempting to perform? The Express Checkout Element does not natively support tax calculations at the moment. You need to provide the full amount you intend to charge the customer up front.
hmmmm
we're charging for a saas service
in the US there is no tax but in the UK, there is a 20% tax for instance
is there no way to update the express checkout amount after we have determined the billing address from onConfirm?
Actually our integration guide kind of covers this.
If you review the steps on the "collect shipping information" section: https://docs.stripe.com/elements/express-checkout-element/accept-a-payment?client=html#collect-shipping
We show how you can update the line items and amount in response to user selections
hmm that's only for shipping though
we're charging for a saas product and don't need to collect the shipping address
Unfortunately we don't expose an event for changes in billing address
ahh okay, so there is no way to handle this with express checkout?
or actually, if i create a payment intent on the server with the correct amount
and then call confirmPayment on the client side
will that pop up apple pay/google pay requesting for the new amount?
I ... don't think so. I think it will either error or charge an amount that is different from what was displayed to the user. The Apple/Google Pay modal window is used to collect the payment method and, at that point, we already have it.
ahhhh
hmm okay, maybe we'll just use this for our tax inclusive products then
seems like it will be perfect there
If you can collect the billing address earlier in the flow and pre-calculate the tax amounbt you can include the tax as a line item like we show in this code snippet
expressCheckoutElement.on('click', (event) => {
const options = {
lineItems: [
{
name: 'Sample item',
amount: 1000
},
{
name: 'Tax',
amount: 100
},
{
name: 'Shipping cost',
amount: 1000
}
]
};
event.resolve(options);
});
ahhh yeah but then when we do express payment, we'll get a new billing address?
and wouldn't that be the one we are actually charged for by stripe tax
That is the billing address associated with the payment method used. I cannot say whether that would be different than any other billing address you collect.
ahhh yeah true
alright thanks for the clarification
i think we'll punt on adopting this until we can add tax calculation into the flow
I would recommend you add some test listeners in your JavaScript code to any and all events that we document here: https://docs.stripe.com/js/elements_object/express_checkout_element_click_event
I do this often to test things out. I simply add a console.log(event) line and any resolve function that is required. This way I can see what information is available at each step