-
- Downloads
[FIX] payment: use iso 4217 currency minor units in payments
Steps to reproduce: 1- install ecommerce - payment_stripe 2- configure stripe testing credentials 3- edit main currency to have more decimal places (assume 4 instead of 2 for USD) 4- add product p to cart (assume p.price = 100 USD) 5- checkout with stripe 6- the price is 10,000 USD instead of 100 USD Bug: Stripe expects the amount in the smallest unit possible for the currency. https://stripe.com/docs/currencies#zero-decimal This differs from a currency to another according to https://en.wikipedia.org/wiki/ISO_4217#Minor_unit_fractions `to_minor_currency_units` uses the decimal places of the currency by default which will produce wrong values Fix: use currency exponent table built from https://en.wikipedia.org/wiki/ISO_4217#Minor_unit_fractions default behavior (for a currency that is not available) is not changed OPW-3058173 closes odoo/odoo#106928 X-original-commit: 703ed2b4 Signed-off-by:Antoine Vandevenne (anv) <anv@odoo.com>
Loading
Please register or sign in to comment