#axelvaindal-checkout-rounding

1 messages ยท Page 1 of 1 (latest)

tropic pike
#

I don't believe there's any way to customize the rounding behavior in Checkout - do you have an example of what specifically you're trying to do (a checkout session ID would be helpful here)

fresh rivet
#

Actually, we are billing our customers based on the number of characters of their document for a correction service.
The price is 2.6โ‚ฌ per 1000 characters. Basically, I'd like the price to not be 5.20 if they enter 1234 character, but rather, 1234 * 2.60 / 1000 = 3.2084 = 3.21โ‚ฌ.

Not sure if this session might help but here it is: cs_test_a1go3o3pay1lPI3TK6HkNNXJW5LyKCRWhDi5dxIiBEpQzAMuFccsk4roHg

tropic pike
fresh rivet
#

My understanding was that using this would round down, so it would use 2.60โ‚ฌ pricing in this case ๐Ÿค”
Am I getting this wrong?
Historically, we were computing price information manually, but it generated receipt only and no invoice so I wanted to use package pricing to fix this problem

tropic pike
#

Actually let's back up for a second - in that Checkout Session you provided It has a quantity of 123,456. The math goes like this:
123,456 / 1000 = 123.456 -> round that up to 124. 124 * 2.6 = 322.40.

What is the amount you actually want to be charging for a quantity of 123,456?

fresh rivet
#

For the Checkout session I provided, it should be 123,456 * 2,6 -> 320985.6 / 1000 = 320,985 -> either 320,98โ‚ฌ or 320,99โ‚ฌ

tropic pike
#

In that case, I think you can change your pricing model to something much simpler. If you were just to charge .0026 per word, you'd get exactly what you want

fresh rivet
#

Something like that ?
It doesn't seem to be allowed

tropic pike
fresh rivet
#

Alright, really clear.
Unrelated bt, this is amazing getting to have developper support like that on a dedicated thread, thanks a lot! ๐Ÿ™‡

tropic pike
#

๐Ÿ™‚ happy to help!