feat(currency-inr): inr added to supported currencies
This commit is contained in:
parent
125cdab24e
commit
f91b257198
|
@ -29,11 +29,9 @@ class PaymentSerializer < ApplicationSerializer
|
||||||
private
|
private
|
||||||
|
|
||||||
def user
|
def user
|
||||||
begin
|
User.find(object.user_id)
|
||||||
User.find(object.user_id)
|
rescue StandardError
|
||||||
rescue
|
nil
|
||||||
nil
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def currency_unit
|
def currency_unit
|
||||||
|
@ -42,6 +40,8 @@ class PaymentSerializer < ApplicationSerializer
|
||||||
"€"
|
"€"
|
||||||
when "gbp"
|
when "gbp"
|
||||||
"£"
|
"£"
|
||||||
|
when "inr"
|
||||||
|
"₹"
|
||||||
else
|
else
|
||||||
"$"
|
"$"
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,7 +3,7 @@ import DiscourseURL from "discourse/lib/url";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Ember.Controller.extend({
|
||||||
// Also defined in settings.
|
// Also defined in settings.
|
||||||
currencies: ["AUD", "CAD", "EUR", "GBP", "USD"],
|
currencies: ["AUD", "CAD", "EUR", "GBP", "USD", "INR"],
|
||||||
|
|
||||||
@computed("model.plan.isNew")
|
@computed("model.plan.isNew")
|
||||||
planFieldDisabled(isNew) {
|
planFieldDisabled(isNew) {
|
||||||
|
|
|
@ -1,17 +1,20 @@
|
||||||
// TODO: typo in this helper name: currency not curency.
|
// TODO: typo in this helper name: currency not curency.
|
||||||
export default Ember.Helper.helper(function(params) {
|
export default Ember.Helper.helper(function (params) {
|
||||||
let currencySign;
|
let currencySign
|
||||||
|
|
||||||
switch (Discourse.SiteSettings.discourse_subscriptions_currency) {
|
switch (Discourse.SiteSettings.discourse_subscriptions_currency) {
|
||||||
case "EUR":
|
case 'EUR':
|
||||||
currencySign = "€";
|
currencySign = '€'
|
||||||
break;
|
break
|
||||||
case "GBP":
|
case 'GBP':
|
||||||
currencySign = "£";
|
currencySign = '£'
|
||||||
break;
|
break
|
||||||
|
case 'INR':
|
||||||
|
currencySign = '₹'
|
||||||
|
break
|
||||||
default:
|
default:
|
||||||
currencySign = "$";
|
currencySign = '$'
|
||||||
}
|
}
|
||||||
|
|
||||||
return [currencySign, params[0]].join("");
|
return [currencySign, params[0]].join('')
|
||||||
});
|
})
|
||||||
|
|
|
@ -1,18 +1,22 @@
|
||||||
export default Ember.Helper.helper(function(params) {
|
export default Ember.Helper.helper(function (params) {
|
||||||
let currencySign;
|
let currencySign
|
||||||
|
|
||||||
switch (params[0]) {
|
switch (params[0]) {
|
||||||
case "EUR":
|
case 'EUR':
|
||||||
case "eur":
|
case 'eur':
|
||||||
currencySign = "€";
|
currencySign = '€'
|
||||||
break;
|
break
|
||||||
case "GBP":
|
case 'GBP':
|
||||||
case "gbp":
|
case 'gbp':
|
||||||
currencySign = "£";
|
currencySign = '£'
|
||||||
break;
|
break
|
||||||
|
case 'INR':
|
||||||
|
case 'inr':
|
||||||
|
currencySign = '₹'
|
||||||
|
break
|
||||||
default:
|
default:
|
||||||
currencySign = "$";
|
currencySign = '$'
|
||||||
}
|
}
|
||||||
|
|
||||||
return currencySign + params.map(p => p.toUpperCase()).join(" ");
|
return currencySign + params.map((p) => p.toUpperCase()).join(' ')
|
||||||
});
|
})
|
||||||
|
|
|
@ -5,13 +5,13 @@ plugins:
|
||||||
default: false
|
default: false
|
||||||
client: true
|
client: true
|
||||||
discourse_subscriptions_public_key:
|
discourse_subscriptions_public_key:
|
||||||
default: ''
|
default: ""
|
||||||
client: true
|
client: true
|
||||||
discourse_subscriptions_secret_key:
|
discourse_subscriptions_secret_key:
|
||||||
default: ''
|
default: ""
|
||||||
client: false
|
client: false
|
||||||
discourse_subscriptions_webhook_secret:
|
discourse_subscriptions_webhook_secret:
|
||||||
default: ''
|
default: ""
|
||||||
client: false
|
client: false
|
||||||
discourse_subscriptions_allow_payments:
|
discourse_subscriptions_allow_payments:
|
||||||
default: false
|
default: false
|
||||||
|
@ -27,3 +27,4 @@ plugins:
|
||||||
- GBP
|
- GBP
|
||||||
- USD
|
- USD
|
||||||
- NZD
|
- NZD
|
||||||
|
- INR
|
||||||
|
|
Loading…
Reference in New Issue