rename some settings

This commit is contained in:
Rimian Perkins 2019-12-04 11:53:05 +11:00
parent b397ba5a68
commit 80b721ddd8
12 changed files with 21 additions and 21 deletions

View File

@ -5,7 +5,7 @@ module DiscourseSubscriptions
extend ActiveSupport::Concern
def set_api_key
::Stripe.api_key = SiteSetting.discourse_patrons_secret_key
::Stripe.api_key = SiteSetting.discourse_subscriptions_secret_key
end
end
end

View File

@ -22,7 +22,7 @@ module DiscourseSubscriptions
response = ::Stripe::PaymentIntent.create(
amount: param_currency_to_number,
currency: SiteSetting.discourse_patrons_currency,
currency: SiteSetting.discourse_subscriptions_currency,
payment_method_types: ['card'],
payment_method: params[:payment_method_id],
description: SiteSetting.discourse_patrons_payment_description,

View File

@ -8,7 +8,7 @@ export default Ember.Component.extend({
cardError: false,
color: jQuery("body").css("color"),
backgroundColor: jQuery("body").css("background-color"),
stripe: Stripe(settings.discourse_patrons_public_key)
stripe: Stripe(settings.discourse_subscriptions_public_key)
});
},

View File

@ -5,7 +5,7 @@ export default Ember.Controller.extend({
this._super(...arguments);
this.set(
"stripe",
Stripe(Discourse.SiteSettings.discourse_patrons_public_key)
Stripe(Discourse.SiteSettings.discourse_subscriptions_public_key)
);
const elements = this.get("stripe").elements();

View File

@ -2,7 +2,7 @@
export default Ember.Helper.helper(function(params) {
let currencySign;
switch (Discourse.SiteSettings.discourse_patrons_currency) {
switch (Discourse.SiteSettings.discourse_subscriptions_currency) {
case "EUR":
currencySign = "€";
break;

View File

@ -1,5 +1,5 @@
import { registerUnbound } from "discourse-common/lib/helpers";
export default registerUnbound("show-extra-nav", function() {
return Discourse.SiteSettings.discourse_patrons_extra_nav_subscribe;
return Discourse.SiteSettings.discourse_subscriptions_extra_nav_subscribe;
});

View File

@ -13,7 +13,7 @@ export default Discourse.Route.extend({
plan = AdminPlan.create({
active: true,
isNew: true,
currency: Discourse.SiteSettings.discourse_patrons_currency,
currency: Discourse.SiteSettings.discourse_subscriptions_currency,
product: product.get("id")
});
} else {

View File

@ -1,10 +1,10 @@
en:
site_settings:
discourse_patrons_enabled: Enable the Discourse Subscriptions plugin.
discourse_patrons_extra_nav_subscribe: Show the subscribe button in the primary navigation
discourse_patrons_public_key: Stripe Publishable Key
discourse_patrons_secret_key: Stripe Secret Key
discourse_patrons_currency: Default Currency Code. This can be overridden when creating a subscription plan
discourse_subscriptions_enabled: Enable the Discourse Subscriptions plugin.
discourse_subscriptions_extra_nav_subscribe: Show the subscribe button in the primary navigation
discourse_subscriptions_public_key: Stripe Publishable Key
discourse_subscriptions_secret_key: Stripe Secret Key
discourse_subscriptions_currency: Default Currency Code. This can be overridden when creating a subscription plan
discourse_patrons_zip_code: "Show Zip Code"
discourse_patrons_billing_address: "Collect billing address"
discourse_patrons_payment_page: "Text to be added to enter payments page. Markdown is supported."

View File

@ -1,13 +1,13 @@
plugins:
discourse_patrons_enabled:
discourse_subscriptions_enabled:
default: false
discourse_patrons_extra_nav_subscribe:
discourse_subscriptions_extra_nav_subscribe:
default: false
client: true
discourse_patrons_public_key:
discourse_subscriptions_public_key:
default: ''
client: true
discourse_patrons_secret_key:
discourse_subscriptions_secret_key:
default: ''
client: false
discourse_patrons_payment_page:
@ -25,7 +25,7 @@ plugins:
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_error: "site_settings.errors.discourse_patrons_amount_must_be_currency"
discourse_patrons_currency:
discourse_subscriptions_currency:
client: true
default: "USD"
type: enum

View File

@ -6,7 +6,7 @@
# url: https://github.com/rimian/discourse-subscriptions
# authors: Rimian Perkins
enabled_site_setting :discourse_patrons_enabled
enabled_site_setting :discourse_subscriptions_enabled
gem 'stripe', '5.11.0'

View File

@ -42,8 +42,8 @@ module DiscourseSubscriptions
end
before do
SiteSetting.stubs(:discourse_patrons_currency).returns('AUD')
SiteSetting.stubs(:discourse_patrons_secret_key).returns('xyz-678')
SiteSetting.stubs(:discourse_subscriptions_currency).returns('AUD')
SiteSetting.stubs(:discourse_subscriptions_secret_key).returns('xyz-678')
controller.stubs(:current_user).returns(current_user)
end

View File

@ -2,7 +2,7 @@ import { acceptance } from "helpers/qunit-helpers";
acceptance("Discourse Patrons", {
settings: {
discourse_patrons_extra_nav_subscribe: true
discourse_subscriptions_extra_nav_subscribe: true
}
});