diff --git a/src/Modules/OrchardCore.Commerce.Payment.Stripe/Constants/CurrencyCollectionConstants.cs b/src/Modules/OrchardCore.Commerce.Payment.Stripe/Constants/CurrencyCollectionConstants.cs new file mode 100644 index 000000000..4a5d1d635 --- /dev/null +++ b/src/Modules/OrchardCore.Commerce.Payment.Stripe/Constants/CurrencyCollectionConstants.cs @@ -0,0 +1,30 @@ +using System.Collections.Generic; + +namespace OrchardCore.Commerce.Payment.Stripe.Constants; + +public static class CurrencyCollectionConstants +{ + public static readonly IEnumerable 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 ZeroDecimalCurrencies = + [ + "BIF", + "CLP", + "DJF", + "GNF", + "JPY", + "KMF", + "KRW", + "MGA", + "PYG", + "RWF", + "VND", + "VUV", + "XAF", + "XOF", + "XPF", + ]; +} diff --git a/src/Modules/OrchardCore.Commerce.Payment.Stripe/Helpers/AmountHelpers.cs b/src/Modules/OrchardCore.Commerce.Payment.Stripe/Helpers/AmountHelpers.cs index 767298bbb..f627fd6b4 100644 --- a/src/Modules/OrchardCore.Commerce.Payment.Stripe/Helpers/AmountHelpers.cs +++ b/src/Modules/OrchardCore.Commerce.Payment.Stripe/Helpers/AmountHelpers.cs @@ -1,6 +1,6 @@ using OrchardCore.Commerce.MoneyDataType; using System.Linq; -using static OrchardCore.Commerce.Payment.Constants.CurrencyCollectionConstants; +using static OrchardCore.Commerce.Payment.Stripe.Constants.CurrencyCollectionConstants; namespace OrchardCore.Commerce.Payment.Stripe.Helpers; diff --git a/src/Modules/OrchardCore.Commerce.Payment/Constants/CurrencyCollectionConstants.cs b/src/Modules/OrchardCore.Commerce.Payment/Constants/CurrencyCollectionConstants.cs index de963821d..7cd8465d2 100644 --- a/src/Modules/OrchardCore.Commerce.Payment/Constants/CurrencyCollectionConstants.cs +++ b/src/Modules/OrchardCore.Commerce.Payment/Constants/CurrencyCollectionConstants.cs @@ -1,13 +1,17 @@ +using System; using System.Collections.Generic; namespace OrchardCore.Commerce.Payment.Constants; + public static class CurrencyCollectionConstants { + [Obsolete("This is a Stripe-specific property, use the equivalent in the OrchardCore.Commerce.Payment.Stripe project.")] public static readonly IEnumerable 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. + [Obsolete("This is a Stripe-specific property, use the equivalent in the OrchardCore.Commerce.Payment.Stripe project.")] public static readonly IEnumerable ZeroDecimalCurrencies = [ "BIF",