activemerchant / active_merchant

Active Merchant is a simple payment abstraction library extracted from Shopify. The aim of the project is to feel natural to Ruby users and to abstract as many parts as possible away from the user to offer a consistent interface across all supported gateways.
http://activemerchant.org
MIT License
4.55k stars 2.5k forks source link

Stripe application_fee amount is not localized the same way as amount for JPY #2013

Open nspady opened 8 years ago

nspady commented 8 years ago

When processing a Stripe transaction for currencies with no decimal while also including an application fee. Let's say something like this: E.g. ¥50 with a fee of ¥3 The amount is multiplied by 100 before being sent to ActiveMerchant so that the intended amount of ¥50 is charged see #1794. However, if the application_fee is passed in the same way, multiplying by 100, the fee is amount is never run through the same localized_amount function, so a fee of ¥300 is applied.

The way that Stripe handles this is by subtracting their own fee from the amount first and then subtracting the rest of the payment total to cover the 100X application fee.

bpollack commented 6 years ago

Thanks for the report, @nspady ! I can't promise to get to this any time soon, but it looks as if this is still the current behavior. In the meantime, we'd happily accept a PR.