mirror of
https://github.com/discourse/discourse-subscriptions.git
synced 2025-03-06 09:39:51 +00:00
rename some settings
This commit is contained in:
parent
b397ba5a68
commit
80b721ddd8
@ -5,7 +5,7 @@ module DiscourseSubscriptions
|
|||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
def set_api_key
|
def set_api_key
|
||||||
::Stripe.api_key = SiteSetting.discourse_patrons_secret_key
|
::Stripe.api_key = SiteSetting.discourse_subscriptions_secret_key
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -22,7 +22,7 @@ module DiscourseSubscriptions
|
|||||||
|
|
||||||
response = ::Stripe::PaymentIntent.create(
|
response = ::Stripe::PaymentIntent.create(
|
||||||
amount: param_currency_to_number,
|
amount: param_currency_to_number,
|
||||||
currency: SiteSetting.discourse_patrons_currency,
|
currency: SiteSetting.discourse_subscriptions_currency,
|
||||||
payment_method_types: ['card'],
|
payment_method_types: ['card'],
|
||||||
payment_method: params[:payment_method_id],
|
payment_method: params[:payment_method_id],
|
||||||
description: SiteSetting.discourse_patrons_payment_description,
|
description: SiteSetting.discourse_patrons_payment_description,
|
||||||
|
@ -8,7 +8,7 @@ export default Ember.Component.extend({
|
|||||||
cardError: false,
|
cardError: false,
|
||||||
color: jQuery("body").css("color"),
|
color: jQuery("body").css("color"),
|
||||||
backgroundColor: jQuery("body").css("background-color"),
|
backgroundColor: jQuery("body").css("background-color"),
|
||||||
stripe: Stripe(settings.discourse_patrons_public_key)
|
stripe: Stripe(settings.discourse_subscriptions_public_key)
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ export default Ember.Controller.extend({
|
|||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
this.set(
|
this.set(
|
||||||
"stripe",
|
"stripe",
|
||||||
Stripe(Discourse.SiteSettings.discourse_patrons_public_key)
|
Stripe(Discourse.SiteSettings.discourse_subscriptions_public_key)
|
||||||
);
|
);
|
||||||
const elements = this.get("stripe").elements();
|
const elements = this.get("stripe").elements();
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
export default Ember.Helper.helper(function(params) {
|
export default Ember.Helper.helper(function(params) {
|
||||||
let currencySign;
|
let currencySign;
|
||||||
|
|
||||||
switch (Discourse.SiteSettings.discourse_patrons_currency) {
|
switch (Discourse.SiteSettings.discourse_subscriptions_currency) {
|
||||||
case "EUR":
|
case "EUR":
|
||||||
currencySign = "€";
|
currencySign = "€";
|
||||||
break;
|
break;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { registerUnbound } from "discourse-common/lib/helpers";
|
import { registerUnbound } from "discourse-common/lib/helpers";
|
||||||
|
|
||||||
export default registerUnbound("show-extra-nav", function() {
|
export default registerUnbound("show-extra-nav", function() {
|
||||||
return Discourse.SiteSettings.discourse_patrons_extra_nav_subscribe;
|
return Discourse.SiteSettings.discourse_subscriptions_extra_nav_subscribe;
|
||||||
});
|
});
|
||||||
|
@ -13,7 +13,7 @@ export default Discourse.Route.extend({
|
|||||||
plan = AdminPlan.create({
|
plan = AdminPlan.create({
|
||||||
active: true,
|
active: true,
|
||||||
isNew: true,
|
isNew: true,
|
||||||
currency: Discourse.SiteSettings.discourse_patrons_currency,
|
currency: Discourse.SiteSettings.discourse_subscriptions_currency,
|
||||||
product: product.get("id")
|
product: product.get("id")
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
en:
|
en:
|
||||||
site_settings:
|
site_settings:
|
||||||
discourse_patrons_enabled: Enable the Discourse Subscriptions plugin.
|
discourse_subscriptions_enabled: Enable the Discourse Subscriptions plugin.
|
||||||
discourse_patrons_extra_nav_subscribe: Show the subscribe button in the primary navigation
|
discourse_subscriptions_extra_nav_subscribe: Show the subscribe button in the primary navigation
|
||||||
discourse_patrons_public_key: Stripe Publishable Key
|
discourse_subscriptions_public_key: Stripe Publishable Key
|
||||||
discourse_patrons_secret_key: Stripe Secret Key
|
discourse_subscriptions_secret_key: Stripe Secret Key
|
||||||
discourse_patrons_currency: Default Currency Code. This can be overridden when creating a subscription plan
|
discourse_subscriptions_currency: Default Currency Code. This can be overridden when creating a subscription plan
|
||||||
discourse_patrons_zip_code: "Show Zip Code"
|
discourse_patrons_zip_code: "Show Zip Code"
|
||||||
discourse_patrons_billing_address: "Collect billing address"
|
discourse_patrons_billing_address: "Collect billing address"
|
||||||
discourse_patrons_payment_page: "Text to be added to enter payments page. Markdown is supported."
|
discourse_patrons_payment_page: "Text to be added to enter payments page. Markdown is supported."
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
plugins:
|
plugins:
|
||||||
discourse_patrons_enabled:
|
discourse_subscriptions_enabled:
|
||||||
default: false
|
default: false
|
||||||
discourse_patrons_extra_nav_subscribe:
|
discourse_subscriptions_extra_nav_subscribe:
|
||||||
default: false
|
default: false
|
||||||
client: true
|
client: true
|
||||||
discourse_patrons_public_key:
|
discourse_subscriptions_public_key:
|
||||||
default: ''
|
default: ''
|
||||||
client: true
|
client: true
|
||||||
discourse_patrons_secret_key:
|
discourse_subscriptions_secret_key:
|
||||||
default: ''
|
default: ''
|
||||||
client: false
|
client: false
|
||||||
discourse_patrons_payment_page:
|
discourse_patrons_payment_page:
|
||||||
@ -25,7 +25,7 @@ plugins:
|
|||||||
default: '1.00|2.00|5.00|10.00|20.00|50.00|100.00'
|
default: '1.00|2.00|5.00|10.00|20.00|50.00|100.00'
|
||||||
regex: "^([0-9]+.[0-9]{2}\\|)+[0-9]+.[0-9]{2}$"
|
regex: "^([0-9]+.[0-9]{2}\\|)+[0-9]+.[0-9]{2}$"
|
||||||
regex_error: "site_settings.errors.discourse_patrons_amount_must_be_currency"
|
regex_error: "site_settings.errors.discourse_patrons_amount_must_be_currency"
|
||||||
discourse_patrons_currency:
|
discourse_subscriptions_currency:
|
||||||
client: true
|
client: true
|
||||||
default: "USD"
|
default: "USD"
|
||||||
type: enum
|
type: enum
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
# url: https://github.com/rimian/discourse-subscriptions
|
# url: https://github.com/rimian/discourse-subscriptions
|
||||||
# authors: Rimian Perkins
|
# authors: Rimian Perkins
|
||||||
|
|
||||||
enabled_site_setting :discourse_patrons_enabled
|
enabled_site_setting :discourse_subscriptions_enabled
|
||||||
|
|
||||||
gem 'stripe', '5.11.0'
|
gem 'stripe', '5.11.0'
|
||||||
|
|
||||||
|
@ -42,8 +42,8 @@ module DiscourseSubscriptions
|
|||||||
end
|
end
|
||||||
|
|
||||||
before do
|
before do
|
||||||
SiteSetting.stubs(:discourse_patrons_currency).returns('AUD')
|
SiteSetting.stubs(:discourse_subscriptions_currency).returns('AUD')
|
||||||
SiteSetting.stubs(:discourse_patrons_secret_key).returns('xyz-678')
|
SiteSetting.stubs(:discourse_subscriptions_secret_key).returns('xyz-678')
|
||||||
controller.stubs(:current_user).returns(current_user)
|
controller.stubs(:current_user).returns(current_user)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import { acceptance } from "helpers/qunit-helpers";
|
|||||||
|
|
||||||
acceptance("Discourse Patrons", {
|
acceptance("Discourse Patrons", {
|
||||||
settings: {
|
settings: {
|
||||||
discourse_patrons_extra_nav_subscribe: true
|
discourse_subscriptions_extra_nav_subscribe: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user