Skip to content

Commit

Permalink
Treat UGX as a decimal based currency. (#1320)
Browse files Browse the repository at this point in the history
Stripe documents several currencies as Zero-decimal currencies, these currencies should be charged as “$1 = 1” in the stripe API.

https://docs.stripe.com/currencies#zero-decimal

However, for backwards compatibility, specific zero-decimal currencies must be treated as decimal currencies, this includes UGX and ISK (which is not documented as a zero-decimal in the above documentation)

This means that when we've attempted to charge `1,000 UGX` we've actually charged `10.00 UGX = 10 UGX`.
  • Loading branch information
dd32 authored May 16, 2024
1 parent ddc9cad commit 97c1d78
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public static function get_fractional_unit_amount( $order_currency, $base_unit_a
$currency_multipliers = array(
// Zero-decimal currencies.
1 => array(
'BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF',
'BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF',
'XOF', 'XPF',
),
100 => array(
Expand All @@ -204,7 +204,7 @@ public static function get_fractional_unit_amount( $order_currency, $base_unit_a
'MXN', 'MYR', 'MZN', 'NAD', 'NGN', 'NIO', 'NOK', 'NPR', 'NZD', 'PAB', 'PEN', 'PGK', 'PHP', 'PKR',
'PLN', 'QAR', 'RON', 'RSD', 'RUB', 'SAR', 'SBD', 'SCR', 'SEK', 'SGD', 'SHP', 'SLL',
'SOS', 'SRD', 'STD', 'SZL', 'THB', 'TJS', 'TOP', 'TRY', 'TTD', 'TWD',
'TZS', 'UAH', 'USD', 'UYU', 'UZS', 'WST', 'XCD', 'YER', 'ZAR', 'ZMW',
'TZS', 'UAH', 'UGX', 'USD', 'UYU', 'UZS', 'WST', 'XCD', 'YER', 'ZAR', 'ZMW',
),
);

Expand Down

0 comments on commit 97c1d78

Please sign in to comment.