#yoshevski-paymentintent-fee
1 messages · Page 1 of 1 (latest)
@frail tide no there is no such feature in the API. You have to calculate this yourself
yoshevski-paymentintent-fee
hmm but then lets say the product cost: 100$ the fee from stripe would be 3,2$ in total for that amount.
If I change the amount to include this fee where new amount would be 103,2 then stripe will collect a processing fee on 103,2 not on 100.. meaning I will always get less than 100$
yeah if you look at the article closely you should see that it explains how to do that, you have to do this in a recursive way
so basically you have to say I want to charge $100 so the fee is $3.2 so really you want to charge $103.2 but the fee will now be say $3.4, so really you want to charge $103.6, etc. until the difference in fee is 0
there is a straight-up algebraic solution to the issue... it doesn't have to be recursive
that's a bit of a drive by comment though with 0 context on what to fix. Recursive or loop is a lot easier to reason about
@full perch yes that is what I've did for the calculation, but it always end up to either have customer to pay more than needed or I get some amount less than the original product price..
ok , anyhow if there is no such property to be set, we are okay, I will seek for another option.
Thanks
sorry, typing it out:
result = (charge - charge*rate - flat)
result + flat = charge*(1 - rate)
charge = (result + flat)/(1 - rate)
result - what you want your final take to be
charge - what to charge the customer
flat - the flat-fee part of the charge
rate -the % rate of fee
You may want to add a cent or two to the flat fee so you always get enough even when rounding.