Skip to content

Commit

Permalink
FEATURE: Add support for CHF currency (#254)
Browse files Browse the repository at this point in the history
Stripe supports the Swiss Franc so we can add support for it.

https://meta.discourse.org/t/316003
  • Loading branch information
oblakeerickson authored Dec 5, 2024
1 parent d82b340 commit 1811b59
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/serializers/discourse_subscriptions/payment_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ def currency_unit
"S$"
when "zar"
"R"
when "chf"
"CHF"
else
"$"
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export default class AdminPluginsDiscourseSubscriptionsProductsShowPlansShowCont
{ id: "SGD", name: "SGD" },
{ id: "JPY", name: "JPY" },
{ id: "ZAR", name: "ZAR" },
{ id: "CHF", name: "CHF" },
];
}

Expand Down
3 changes: 3 additions & 0 deletions assets/javascripts/discourse/helpers/format-currency.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ export function formatCurrency([currency, amount]) {
case "ZAR":
currencySign = "R";
break;
case "CHF":
currencySign = "CHF";
break;
default:
currencySign = "$";
}
Expand Down
1 change: 1 addition & 0 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ discourse_subscriptions:
- DKK
- SGD
- ZAR
- CHF
discourse_subscriptions_campaign_enabled:
client: true
default: false
Expand Down

0 comments on commit 1811b59

Please sign in to comment.