#hargisss-pricing-passonfees
1 messages · Page 1 of 1 (latest)
Hi Koopajah
Here's the code I'm using right now: $price_amount = ceil(($price_amount + 100) * 1.0298661174) + 30;
hargisss-pricing-passonfees
But this only works for amounts above about $50
It's my best attempt to implement the information on that page, but getting it to work out right for a wide range of amounts is proving difficult.
it works for all amounts, it's math so it's a recurring formula
Nevertheless, something seems to be going wrong with the rounding. It's exact for amounts above $50, but for small amounts it ends up being one cent off.
There's also the added issue that we have an additional 1$ fee.
But basically the only way to do this is to make an equation and tweak it until it's right for all values?
👋 hopping in here since koopajah has to head out soon
Cool thanks Karbi
Yes, really the only way to handle this is by using that equation to calculate it (and tweaking it to account for edge cases like the addition feels you mentioned)
Okay, I guess that's what I wanted to know - But in theory it should get it possible to make it work for all amounts?
In theory yes
One thing I want to call out - you seem to be using ceil to do your rounding which may not be whwat you want. I believe we just round to the nearest cent (https://support.stripe.com/questions/rounding-rules-for-stripe-fees), we don't always round up
So I should be using the round function?
Okay I'll just try it - no point in wasting any more time for you.
The only thing for it is to see if it works.
Though- the total amount in this case ending up being too low
by one cent
so the ceil function could not have been the issue.
Thanks!