#chewie_api

1 messages · Page 1 of 1 (latest)

pastel canopyBOT
#

👋 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/1310924337435512933

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

merry saffron
#

hi there!

#

are you trying to compute the Tax before redirecting the user to the Checkout Session?

tawdry bronze
#

Yeah that's right 🙂 I'm trying to calculate it identically to what the stripe checkout page displays so the prices are consistent between both pages

merry saffron
#

got it. but if the total is £5, and there's a 10% tax, then it's expected that the tax is £0.50, no? why did you expect £0.49?

tawdry bronze
#

My understanding was tax is calculated on a per line item basis, rounded down, and then summed:

+--------------+-----------------+---------------------------------+
| Ticket price | Tax value (%10) | After rounding to smallest unit |
+--------------+-----------------+---------------------------------+
| £0.01        | £0.001          | £0.00                           |
| £4.99        | £0.499          | £0.49                           |
+--------------+-----------------+---------------------------------+
|              |  Total tax      | £0.49                           |
+--------------+-----------------+---------------------------------+
#

But it seems like my understanding is wrong?

#

Is it just done on the subtotal value, and never looks at the line items? So it's a simple £5.00 * 10%?

merry saffron
#

no I think we compute the tax on the total, and then "distribute" it across each line item

tawdry bronze
#

I see 🙂 ok no worries I'm not worried about the distribution to be honest, just about how the value is calculated

#

If it's purely done on the subtotal, that makes my life a lot easier. Thanks