Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCC-310: Fix problems related to UGX in Stripe and update SpecialCases list #526

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ public static ICurrency Euro
public static ICurrency TurkishLira => _defaultProvider.GetCurrency("TRY");
public static ICurrency TrinidadAndTobagoDollar => _defaultProvider.GetCurrency("TTD");
public static ICurrency NewTaiwanDollar => _defaultProvider.GetCurrency("TWD");
public static ICurrency UgandanShilling => _defaultProvider.GetCurrency("UGX");
public static ICurrency UkrainianHryvnia => _defaultProvider.GetCurrency("UAH");
public static ICurrency UsDollar => _defaultProvider.GetCurrency("USD");
public static ICurrency UruguayanPeso => _defaultProvider.GetCurrency("UYU");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
namespace OrchardCore.Commerce.Payment.Constants;
public static class CurrencyCollectionConstants
{
public static readonly IEnumerable<string> SpecialCases = ["HUF", "TWD", "UGX"];
public static readonly IEnumerable<string> SpecialCases = ["ISK", "HUF", "TWD", "UGX"];

// Note that https://docs.stripe.com/currencies#zero-decimal contains UGX on the list as well, however this is a
// mistake because https://docs.stripe.com/currencies#special-cases explicitly states that UGX is a special case
// (see above) where it's effectively zero-decimal but uses the two-decimal format for backwards compatibility.
public static readonly IEnumerable<string> ZeroDecimalCurrencies =
[
"BIF",
Expand All @@ -16,7 +20,6 @@ public static class CurrencyCollectionConstants
"MGA",
"PYG",
"RWF",
"UGX",
"VND",
"VUV",
"XAF",
Expand Down
Loading