Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
@@ -0,0 +1,30 @@
using System.Collections.Generic;

namespace OrchardCore.Commerce.Payment.Stripe.Constants;

public static class CurrencyCollectionConstants
{
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",
"CLP",
"DJF",
"GNF",
"JPY",
"KMF",
"KRW",
"MGA",
"PYG",
"RWF",
"VND",
"VUV",
"XAF",
"XOF",
"XPF",
];
}
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
Original file line number Diff line number Diff line change
@@ -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<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.
[Obsolete("This is a Stripe-specific property, use the equivalent in the OrchardCore.Commerce.Payment.Stripe project.")]
public static readonly IEnumerable<string> ZeroDecimalCurrencies =
[
"BIF",
Expand Down
Loading