From 312b1182b9314998408adca25a8e4a2ef2629358 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brian=20B=C3=B8nk?= Date: Tue, 6 Apr 2021 16:59:27 +0200 Subject: [PATCH] FEATURE: Add DKK as supported currency --- app/serializers/discourse_subscriptions/payment_serializer.rb | 2 ++ ...ns-discourse-subscriptions-products-show-plans-show.js.es6 | 1 + assets/javascripts/discourse/helpers/format-currency.js.es6 | 4 ++++ config/settings.yml | 1 + 4 files changed, 8 insertions(+) diff --git a/app/serializers/discourse_subscriptions/payment_serializer.rb b/app/serializers/discourse_subscriptions/payment_serializer.rb index 8716a40..c3a4ffd 100644 --- a/app/serializers/discourse_subscriptions/payment_serializer.rb +++ b/app/serializers/discourse_subscriptions/payment_serializer.rb @@ -47,6 +47,8 @@ module DiscourseSubscriptions "₹" when "brl" "R$" + when "dkk" + "KR" else "$" end diff --git a/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-products-show-plans-show.js.es6 b/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-products-show-plans-show.js.es6 index 4843657..5abf7e2 100644 --- a/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-products-show-plans-show.js.es6 +++ b/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-products-show-plans-show.js.es6 @@ -37,6 +37,7 @@ export default Controller.extend({ { id: "USD", name: "USD" }, { id: "INR", name: "INR" }, { id: "BRL", name: "BRL" }, + { id: "DKK", name: "DKK" }, ]; }, diff --git a/assets/javascripts/discourse/helpers/format-currency.js.es6 b/assets/javascripts/discourse/helpers/format-currency.js.es6 index a4b637c..59c9be8 100644 --- a/assets/javascripts/discourse/helpers/format-currency.js.es6 +++ b/assets/javascripts/discourse/helpers/format-currency.js.es6 @@ -20,6 +20,10 @@ export default Helper.helper(function (params) { case "brl": currencySign = "R$"; break; + case "DKK": + case "dkk": + currencySign = "DKK"; + break; default: currencySign = "$"; } diff --git a/config/settings.yml b/config/settings.yml index 1e4ce95..d63c31a 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -26,3 +26,4 @@ plugins: - INR - NZD - USD + - DKK