Skip to content

A platform for community discussion. Free, open, simple.

DEV: Move discourse-subscriptions to core (#33570)

Jarek Radoszff7a0f239135
diff --git a/.github/labeler.yml b/.github/labeler.yml
index c69ee474443..b6475277e8a 100644
--- a/.github/labeler.yml
+++ b/.github/labeler.yml
@@ -94,6 +94,10 @@ discourse-assign:
- changed-files:
- any-glob-to-any-file: plugins/discourse-assign/**/*
+discourse-subscriptions:
+ - changed-files:
+ - any-glob-to-any-file: plugins/discourse-subscriptions/**/*
+
footnote:
- changed-files:
- any-glob-to-any-file: plugins/footnote/**/*
diff --git a/.gitignore b/.gitignore
index 448a631a8d8..72b8f7725cf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -66,6 +66,7 @@
!/plugins/discourse-post-voting
!/plugins/discourse-user-notes
!/plugins/discourse-assign
+!/plugins/discourse-subscriptions
/plugins/*/auto_generated
/spec/fixtures/plugins/my_plugin/auto_generated
diff --git a/Gemfile b/Gemfile
index 284e2565222..dac33b674f2 100644
--- a/Gemfile
+++ b/Gemfile
@@ -287,3 +287,6 @@ gem "inflection", "1.0.0", require: false
gem "multipart-post", "2.2.3", require: false
gem "faraday-multipart", "1.0.4", require: false
gem "zendesk_api", "1.38.0.rc1", require: false
+
+# for discourse-subscriptions
+gem "stripe", "11.1.0", require: false
diff --git a/Gemfile.lock b/Gemfile.lock
index 9949c4b518a..4fcaa5afc85 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -613,6 +613,7 @@ GEM
sshkey (3.0.0)
stackprof (0.2.27)
stringio (3.1.7)
+ stripe (11.1.0)
syntax_tree (6.2.0)
prettier_print (>= 1.2.0)
test-prof (1.4.4)
@@ -803,6 +804,7 @@ DEPENDENCIES
sqlite3
sshkey
stackprof
+ stripe (= 11.1.0)
syntax_tree
test-prof
thor
@@ -1101,6 +1103,7 @@ CHECKSUMS
sshkey (3.0.0) sha256=655ba351d6e01a48dfe59d65530af8975c777b8cc57a061770de3228ff2d11cd
stackprof (0.2.27) sha256=aff6d28656c852e74cf632cc2046f849033dc1dedffe7cb8c030d61b5745e80c
stringio (3.1.7) sha256=5b78b7cb242a315fb4fca61a8255d62ec438f58da2b90be66048546ade4507fa
+ stripe (11.1.0) sha256=a76e82cc7e4d2433803ca5fbe9453d019df376236f0b9fbcb7f36e6dd327f98d
syntax_tree (6.2.0) sha256=a50a01c246601af3c258edbb6b12e44373d17966ab3bebd1f7224b3b994a343d
test-prof (1.4.4) sha256=1a59513ed9d33a1f5ca17c0b89da4e70f60a91c83ec62e9a873dbb99141353ef
thor (1.3.2) sha256=eef0293b9e24158ccad7ab383ae83534b7ad4ed99c09f96f1a6b036550abbeda
diff --git a/plugins/discourse-subscriptions/README.md b/plugins/discourse-subscriptions/README.md
new file mode 100644
index 00000000000..757c6265ac0
--- /dev/null
+++ b/plugins/discourse-subscriptions/README.md
@@ -0,0 +1,5 @@
+# Discourse Subscriptions Plugin
+
+Discourse Subscriptions allows site owners to sell recurring and one-time purchase subscriptions that grant access to a group on a Discourse instance.
+
+For more information, please see: https://meta.discourse.org/t/discourse-subscriptions-plugin/140818
diff --git a/plugins/discourse-subscriptions/app/controllers/concerns/group.rb b/plugins/discourse-subscriptions/app/controllers/concerns/group.rb
new file mode 100644
index 00000000000..eb6345342d6
--- /dev/null
+++ b/plugins/discourse-subscriptions/app/controllers/concerns/group.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+module DiscourseSubscriptions
+ module Group
+ extend ActiveSupport::Concern
+
+ def plan_group(plan)
+ ::Group.find_by_name(plan[:metadata][:group_name])
+ end
+ end
+end
diff --git a/plugins/discourse-subscriptions/app/controllers/concerns/stripe.rb b/plugins/discourse-subscriptions/app/controllers/concerns/stripe.rb
new file mode 100644
index 00000000000..bbe8bbecfd2
--- /dev/null
+++ b/plugins/discourse-subscriptions/app/controllers/concerns/stripe.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+module DiscourseSubscriptions
+ module Stripe
+ extend ActiveSupport::Concern
+
+ def set_api_key
+ ::Stripe.api_key = SiteSetting.discourse_subscriptions_secret_key
+ end
+
+ def is_stripe_configured?
+ SiteSetting.discourse_subscriptions_public_key.present? &&
+ SiteSetting.discourse_subscriptions_secret_key.present?
+ end
+ end
+end
diff --git a/plugins/discourse-subscriptions/app/controllers/discourse_subscriptions/admin/coupons_controller.rb b/plugins/discourse-subscriptions/app/controllers/discourse_subscriptions/admin/coupons_controller.rb
new file mode 100644
index 00000000000..1ef1d5f0aba
--- /dev/null
+++ b/plugins/discourse-subscriptions/app/controllers/discourse_subscriptions/admin/coupons_controller.rb
@@ -0,0 +1,71 @@
+# frozen_string_literal: true
+
+module DiscourseSubscriptions
+ module Admin
+ class CouponsController < ::Admin::AdminController
+ include DiscourseSubscriptions::Stripe
+ include DiscourseSubscriptions::Group
+
+ requires_plugin DiscourseSubscriptions::PLUGIN_NAME
+
+ before_action :set_api_key
+
+ def index
+ begin
+ promo_codes = ::Stripe::PromotionCode.list({ limit: 100 })[:data]
+ promo_codes = promo_codes.select { |code| code[:coupon][:valid] == true }
+ render_json_dump promo_codes
+ rescue ::Stripe::InvalidRequestError => e
+ render_json_error e.message
+ end
+ end
+
+ def create
+ params.require(%i[promo discount_type discount active])
+ begin
+ coupon_params = { duration: "forever" }
+
+ case params[:discount_type]
+ when "amount"
+ coupon_params[:amount_off] = params[:discount].to_i * 100
+ coupon_params[:currency] = SiteSetting.discourse_subscriptions_currency
+ when "percent"
+ coupon_params[:percent_off] = params[:discount]
+ end
+
+ coupon = ::Stripe::Coupon.create(coupon_params)
+
+ promo_code =
+ ::Stripe::PromotionCode.create(
+ { coupon: coupon[:id], code: params[:promo] },
+ ) if coupon.present?
+
+ render_json_dump promo_code
+ rescue ::Stripe::InvalidRequestError => e
+ render_json_error e.message
+ end
+ end
+
+ def update
+ params.require(%i[id active])
+ begin
+ promo_code = ::Stripe::PromotionCode.update(params[:id], { active: params[:active] })
+
+ render_json_dump promo_code
+ rescue ::Stripe::InvalidRequestError => e
+ render_json_error e.message
+ end
+ end
+
+ def destroy
+ params.require(:coupon_id)
+ begin
+ coupon = ::Stripe::Coupon.delete(params[:coupon_id])
+ render_json_dump coupon
+ rescue ::Stripe::InvalidRequestError => e
+ render_json_error e.message
+ end
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-subscriptions/app/controllers/discourse_subscriptions/admin/plans_controller.rb b/plugins/discourse-subscriptions/app/controllers/discourse_subscriptions/admin/plans_controller.rb
new file mode 100644
index 00000000000..7867581d2aa
--- /dev/null
+++ b/plugins/discourse-subscriptions/app/controllers/discourse_subscriptions/admin/plans_controller.rb
@@ -0,0 +1,98 @@
+# frozen_string_literal: true
+
+module DiscourseSubscriptions
+ module Admin
+ class PlansController < ::Admin::AdminController
+ include DiscourseSubscriptions::Stripe
+
+ requires_plugin DiscourseSubscriptions::PLUGIN_NAME
+
+ before_action :set_api_key
+
+ def index
+ begin
+ plans = ::Stripe::Price.list(product_params)
+
+ render_json_dump plans.data
+ rescue ::Stripe::InvalidRequestError => e
+ render_json_error e.message
+ end
+ end
+
+ def create
+ begin
+ price_object = {
+ nickname: params[:nickname],
+ unit_amount: params[:amount],
+ product: params[:product],
+ currency: params[:currency],
+ active: params[:active],
+ metadata: {
+ group_name: params[:metadata][:group_name],
+ trial_period_days: params[:trial_period_days],
+ },
+ }
+
+ price_object[:recurring] = { interval: params[:interval] } if params[:type] == "recurring"
+
+ plan = ::Stripe::Price.create(price_object)
+
+ render_json_dump plan
+ rescue ::Stripe::InvalidRequestError => e
+ render_json_error e.message
+ end
+ end
+
+ def show
+ begin
+ plan = ::Stripe::Price.retrieve(params[:id])
+
+ if plan[:metadata] && plan[:metadata][:trial_period_days]
+ trial_days = plan[:metadata][:trial_period_days]
+ elsif plan[:recurring] && plan[:recurring][:trial_period_days]
+ trial_days = plan[:recurring][:trial_period_days]
+ end
+
+ interval = nil
+ interval = plan[:recurring][:interval] if plan[:recurring] && plan[:recurring][:interval]
+
+ serialized =
+ plan.to_h.merge(
+ trial_period_days: trial_days,
+ currency: plan[:currency].upcase,
+ interval: interval,
+ )
+
+ render_json_dump serialized
+ rescue ::Stripe::InvalidRequestError => e
+ render_json_error e.message
+ end
+ end
+
+ def update
+ begin
+ plan =
+ ::Stripe::Price.update(
+ params[:id],
+ nickname: params[:nickname],
+ active: params[:active],
+ metadata: {
+ group_name: params[:metadata][:group_name],
+ trial_period_days: params[:trial_period_days],
+ },
+ )
+
+ render_json_dump plan
+ rescue ::Stripe::InvalidRequestError => e
+ render_json_error e.message
+ end
+ end
+
+ private
+
+ def product_params
+ { product: params[:product_id] } if params[:product_id]
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-subscriptions/app/controllers/discourse_subscriptions/admin/products_controller.rb b/plugins/discourse-subscriptions/app/controllers/discourse_subscriptions/admin/products_controller.rb
new file mode 100644
index 00000000000..d2d21fbb475
--- /dev/null
+++ b/plugins/discourse-subscriptions/app/controllers/discourse_subscriptions/admin/products_controller.rb
@@ -0,0 +1,95 @@
+# frozen_string_literal: true
+
+module DiscourseSubscriptions
+ module Admin
+ class ProductsController < ::Admin::AdminController
+ include DiscourseSubscriptions::Stripe
+
+ requires_plugin DiscourseSubscriptions::PLUGIN_NAME
+
+ before_action :set_api_key
+
+ def index
+ begin
+ product_ids = Product.all.pluck(:external_id)
+ products = []
+
+ if product_ids.present? && is_stripe_configured?
+ products = ::Stripe::Product.list({ ids: product_ids, limit: 100 })
+ products = products[:data]
+ elsif !is_stripe_configured?
+ products = nil
+ end
+
+ render_json_dump products
+ rescue ::Stripe::InvalidRequestError => e
+ render_json_error e.message
+ end
+ end
+
+ def create
+ begin
+ create_params = product_params.merge!(type: "service")
+
+ create_params.except!(:statement_descriptor) if params[:statement_descriptor].blank?
+
+ product = ::Stripe::Product.create(create_params)
+
+ Product.create(external_id: product[:id])
+
+ render_json_dump product
+ rescue ::Stripe::InvalidRequestError => e
+ render_json_error e.message
+ end
+ end
+
+ def show
+ begin
+ product = ::Stripe::Product.retrieve(params[:id])
+
+ render_json_dump product
+ rescue ::Stripe::InvalidRequestError => e
+ render_json_error e.message
+ end
+ end
+
+ def update
+ begin
+ product = ::Stripe::Product.update(params[:id], product_params)
+
+ render_json_dump product
+ rescue ::Stripe::InvalidRequestError => e
+ render_json_error e.message
+ end
+ end
+
+ def destroy
+ begin
+ product = ::Stripe::Product.delete(params[:id])
+
+ Product.delete_by(external_id: params[:id])
+
+ render_json_dump product
+ rescue ::Stripe::InvalidRequestError => e
+ render_json_error e.message
+ end
+ end
+
+ private
+
+ def product_params
+ params.permit!
+
+ {
+ name: params[:name],
+ active: params[:active],
+ statement_descriptor: params[:statement_descriptor],
+ metadata: {
+ description: params.dig(:metadata, :description),
+ repurchaseable: params.dig(:metadata, :repurchaseable),
+ },
+ }
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-subscriptions/app/controllers/discourse_subscriptions/admin/subscriptions_controller.rb b/plugins/discourse-subscriptions/app/controllers/discourse_subscriptions/admin/subscriptions_controller.rb
new file mode 100644
index 00000000000..5e0b0756968
--- /dev/null
+++ b/plugins/discourse-subscriptions/app/controllers/discourse_subscriptions/admin/subscriptions_controller.rb
@@ -0,0 +1,103 @@
+# frozen_string_literal: true
+
+module DiscourseSubscriptions
+ module Admin
+ class SubscriptionsController < ::Admin::AdminController
+ requires_plugin DiscourseSubscriptions::PLUGIN_NAME
+
+ include DiscourseSubscriptions::Stripe
+ include DiscourseSubscriptions::Group
+ before_action :set_api_key
+
+ PAGE_LIMIT = 10
+
+ def index
+ begin
+ subscription_ids = Subscription.all.pluck(:external_id)
+ subscriptions = {
+ has_more: false,
+ data: [],
+ length: 0,
+ last_record: params[:last_record],
+ }
+
+ if subscription_ids.present? && is_stripe_configured?
+ while subscriptions[:length] < PAGE_LIMIT
+ current_set = get_subscriptions(subscriptions[:last_record])
+
+ until valid_subscriptions =
+ find_valid_subscriptions(current_set[:data], subscription_ids)
+ current_set = get_subscriptions(current_set[:data].last)
+ break if current_set[:has_more] == false
+ end
+
+ subscriptions[:data] = subscriptions[:data].concat(valid_subscriptions.to_a)
+ subscriptions[:last_record] = current_set[:data].last[:id] if current_set[
+ :data
+ ].present?
+ subscriptions[:length] = subscriptions[:data].length
+ subscriptions[:has_more] = current_set[:has_more]
+ break if subscriptions[:has_more] == false
+ end
+ elsif !is_stripe_configured?
+ subscriptions = nil
+ end
+
+ render_json_dump subscriptions
+ rescue ::Stripe::InvalidRequestError => e
+ render_json_error e.message
+ end
+ end
+
+ def destroy
+ params.require(:id)
+ begin
+ refund_subscription(params[:id]) if params[:refund]
+ subscription = ::Stripe::Subscription.cancel(params[:id])
+
+ customer =
+ Customer.find_by(
+ product_id: subscription[:plan][:product],
+ customer_id: subscription[:customer],
+ )
+
+ if customer
+ user = ::User.find(customer.user_id)
+ group = plan_group(subscription[:plan])
+ group.remove(user) if group
+ end
+
+ render_json_dump subscription
+ rescue ::Stripe::InvalidRequestError => e
+ render_json_error e.message
+ end
+ end
+
+ private
+
+ def get_subscriptions(start)
+ ::Stripe::Subscription.list(
+ expand: ["data.plan.product"],
+ limit: PAGE_LIMIT,
+ starting_after: start,
+ status: "all",
+ )
+ end
+
+ def find_valid_subscriptions(data, ids)
+ valid = data.select { |sub| ids.include?(sub[:id]) }
+ valid.empty? ? nil : valid
+ end
+
+ # this will only refund the most recent subscription payment
+ def refund_subscription(subscription_id)
+ subscription = ::Stripe::Subscription.retrieve(subscription_id)
+ invoice = ::Stripe::Invoice.retrieve(subscription[:latest_invoice]) if subscription[
+ :latest_invoice
+ ]
+ payment_intent = invoice[:payment_intent] if invoice[:payment_intent]
+ refund = ::Stripe::Refund.create({ payment_intent: payment_intent })
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-subscriptions/app/controllers/discourse_subscriptions/admin_controller.rb b/plugins/discourse-subscriptions/app/controllers/discourse_subscriptions/admin_controller.rb
new file mode 100644
index 00000000000..4efa4240d0a
--- /dev/null
+++ b/plugins/discourse-subscriptions/app/controllers/discourse_subscriptions/admin_controller.rb
@@ -0,0 +1,25 @@
+# frozen_string_literal: true
+
+module DiscourseSubscriptions
+ class AdminController < ::Admin::AdminController
+ requires_plugin DiscourseSubscriptions::PLUGIN_NAME
+
+ def index
+ head 200
+ end
+
+ def refresh_campaign
+ Jobs.enqueue(:manually_update_campaign_data)
+ render json: success_json
+ end
+
+ def create_campaign
+ begin
+ DiscourseSubscriptions::Campaign.new.create_campaign
+ render json: success_json
+ rescue => e
+ render_json_error e.message
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-subscriptions/app/controllers/discourse_subscriptions/hooks_controller.rb b/plugins/discourse-subscriptions/app/controllers/discourse_subscriptions/hooks_controller.rb
new file mode 100644
index 00000000000..15a9d7b4b93
--- /dev/null
+++ b/plugins/discourse-subscriptions/app/controllers/discourse_subscriptions/hooks_controller.rb
@@ -0,0 +1,148 @@
+# frozen_string_literal: true
+
+module DiscourseSubscriptions
+ class HooksController < ::ApplicationController
+ include DiscourseSubscriptions::Group
+ include DiscourseSubscriptions::Stripe
+
+ requires_plugin DiscourseSubscriptions::PLUGIN_NAME
+
+ layout false
+
+ before_action :set_api_key
+ skip_before_action :check_xhr
+ skip_before_action :redirect_to_login_if_required
+ skip_before_action :verify_authenticity_token, only: [:create]
+
+ def create
+ begin
+ payload = request.body.read
+ sig_header = request.env["HTTP_STRIPE_SIGNATURE"]
+ webhook_secret = SiteSetting.discourse_subscriptions_webhook_secret
+
+ event = ::Stripe::Webhook.construct_event(payload, sig_header, webhook_secret)
+ rescue JSON::ParserError => e
+ return render_json_error e.message
+ rescue ::Stripe::SignatureVerificationError => e
+ return render_json_error e.message
+ end
+
+ case event[:type]
+ when "checkout.session.completed"
+ checkout_session = event[:data][:object]
+
+ if SiteSetting.discourse_subscriptions_enable_verbose_logging
+ Rails.logger.warn("checkout.session.completed data: #{checkout_session}")
+ end
+ email = checkout_session[:customer_email]
+
+ return head 200 if checkout_session[:status] != "complete"
+ return render_json_error "email not found" if !email
+
+ if checkout_session[:customer].nil?
+ customer = ::Stripe::Customer.create({ email: email })
+ customer_id = customer[:id]
+ else
+ customer_id = checkout_session[:customer]
+ end
+
+ if SiteSetting.discourse_subscriptions_enable_verbose_logging
+ Rails.logger.warn("Looking up user with email: #{email}")
+ end
+
+ user = ::User.find_by_username_or_email(email)
+
+ return render_json_error "user not found" if !user
+
+ discourse_customer = Customer.create(user_id: user.id, customer_id: customer_id)
+
+ subscription = checkout_session[:subscription]
+
+ if subscription.present?
+ Subscription.create(customer_id: discourse_customer.id, external_id: subscription)
+ end
+
+ line_items =
+ ::Stripe::Checkout::Session.list_line_items(checkout_session[:id], { limit: 1 })
+ item = line_items[:data].first
+
+ group = plan_group(item[:price])
+ group.add(user) unless group.nil?
+
+ if SiteSetting.discourse_subscriptions_enable_verbose_logging
+ Rails.logger.warn("Line item with group name meta data: #{item[:price]}")
+ if group.nil?
+ Rails.logger.warn("Group not found or not listed in metadata!")
+ else
+ Rails.logger.warn("Group: #{group.name}")
+ end
+ end
+
+ discourse_customer.product_id = item[:price][:product]
+ discourse_customer.save!
+
+ if !subscription.nil?
+ ::Stripe::Subscription.update(
+ subscription,
+ { metadata: { user_id: user.id, username: user.username } },
+ )
+ end
+ when "customer.subscription.created"
+ when "customer.subscription.updated"
+ subscription = event[:data][:object]
+ status = subscription[:status]
+ return head 200 if !%w[complete active].include?(status)
+
+ customer = find_active_customer(subscription[:customer], subscription[:plan][:product])
+
+ return render_json_error "customer not found" if !customer
+
+ update_status(customer.id, subscription[:id], status)
+
+ user = ::User.find_by(id: customer.user_id)
+ return render_json_error "user not found" if !user
+
+ if group = plan_group(subscription[:plan])
+ group.add(user)
+ end
+ when "customer.subscription.deleted"
+ subscription = event[:data][:object]
+
+ customer = find_active_customer(subscription[:customer], subscription[:plan][:product])
+
+ return render_json_error "customer not found" if !customer
+
+ update_status(customer.id, subscription[:id], subscription[:status])
+
+ user = ::User.find(customer.user_id)
+ return render_json_error "user not found" if !user
+
+ if group = plan_group(subscription[:plan])
+ group.remove(user)
+ end
+ end
+
+ head 200
+ end
+
+ private
+
+ def update_status(customer_id, subscription_id, status)
+ discourse_subscription =
+ Subscription.find_by(customer_id: customer_id, external_id: subscription_id)
+ discourse_subscription.update(status: status) if discourse_subscription
+ end
+
+ def find_active_customer(customer_id, product_id)
+ Customer
+ .joins(:subscriptions)
+ .where(customer_id: customer_id, product_id: product_id)
+ .where(
+ Subscription.arel_table[:status].eq(nil).or(
+ Subscription.arel_table[:status].not_eq("canceled"),
+ ),
+ )
+ .first
+ end
+ end
+end
diff --git a/plugins/discourse-subscriptions/app/controllers/discourse_subscriptions/pricingtable_controller.rb b/plugins/discourse-subscriptions/app/controllers/discourse_subscriptions/pricingtable_controller.rb
new file mode 100644
index 00000000000..eca32e407b5
--- /dev/null
+++ b/plugins/discourse-subscriptions/app/controllers/discourse_subscriptions/pricingtable_controller.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+module DiscourseSubscriptions
+ class PricingtableController < ::ApplicationController
+ requires_plugin DiscourseSubscriptions::PLUGIN_NAME
+
+ def index
+ head 200
+ end
+ end
+end
diff --git a/plugins/discourse-subscriptions/app/controllers/discourse_subscriptions/subscribe_controller.rb b/plugins/discourse-subscriptions/app/controllers/discourse_subscriptions/subscribe_controller.rb
new file mode 100644
index 00000000000..9721698eaba
--- /dev/null
+++ b/plugins/discourse-subscriptions/app/controllers/discourse_subscriptions/subscribe_controller.rb
@@ -0,0 +1,267 @@
+# frozen_string_literal: true
+
+module DiscourseSubscriptions
+ class SubscribeController < ::ApplicationController
+ include DiscourseSubscriptions::Stripe
+ include DiscourseSubscriptions::Group
+
+ requires_plugin DiscourseSubscriptions::PLUGIN_NAME
+
+ before_action :set_api_key
+ requires_login except: %i[index contributors show]
+
+ def index
+ begin
+ product_ids = Product.all.pluck(:external_id)
+ products = []
+
+ if product_ids.present? && is_stripe_configured?
+ response = ::Stripe::Product.list({ ids: product_ids, active: true })
+
+ products = response[:data].map { |p| serialize_product(p) }
+ end
+
+ render_json_dump products
+ rescue ::Stripe::InvalidRequestError => e
+ render_json_error e.message
+ end
+ end
+
+ def contributors
+ return unless SiteSetting.discourse_subscriptions_campaign_show_contributors
+ contributor_ids = Set.new
+
+ campaign_product = SiteSetting.discourse_subscriptions_campaign_product
+ if campaign_product.present?
+ contributor_ids.merge(Customer.where(product_id: campaign_product).last(5).pluck(:user_id))
+ else
+ contributor_ids.merge(Customer.last(5).pluck(:user_id))
+ end
+
+ contributors = ::User.where(id: contributor_ids)
+
+ render_serialized(contributors, UserSerializer)
+ end
+
+ def show
+ params.require(:id)
+ begin
+ product = ::Stripe::Product.retrieve(params[:id])
+ plans = ::Stripe::Price.list(active: true, product: params[:id])
+
+ response = { product: serialize_product(product), plans: serialize_plans(plans) }
+
+ render_json_dump response
+ rescue ::Stripe::InvalidRequestError => e
+ render_json_error e.message
+ end
+ end
+
+ def create
+ params.require(%i[source plan])
+ begin
+ customer =
+ find_or_create_customer(
+ params[:source],
+ params[:cardholder_name],
+ params[:cardholder_address],
+ )
+ plan = ::Stripe::Price.retrieve(params[:plan])
+
+ if params[:promo].present?
+ promo_code = ::Stripe::PromotionCode.list({ code: params[:promo] })
+ promo_code = promo_code[:data][0] # we assume promo codes have a unique name
+
+ if promo_code.blank?
+ return render_json_error I18n.t("js.discourse_subscriptions.subscribe.invalid_coupon")
+ end
+ end
+
+ recurring_plan = plan[:type] == "recurring"
+
+ if recurring_plan
+ trial_days = plan[:metadata][:trial_period_days] if plan[:metadata] &&
+ plan[:metadata][:trial_period_days]
+
+ promo_code_id = promo_code[:id] if promo_code
+
+ subscription_params = {
+ customer: customer[:id],
+ items: [{ price: params[:plan] }],
+ metadata: metadata_user,
+ trial_period_days: trial_days,
+ promotion_code: promo_code_id,
+ }
+
+ if SiteSetting.discourse_subscriptions_enable_automatic_tax
+ subscription_params[:automatic_tax] = { enabled: true }
+ end
+
+ transaction = ::Stripe::Subscription.create(subscription_params)
+
+ payment_intent = retrieve_payment_intent(transaction[:latest_invoice]) if transaction[
+ :status
+ ] == "incomplete"
+ else
+ coupon_id = promo_code[:coupon][:id] if promo_code && promo_code[:coupon] &&
+ promo_code[:coupon][:id]
+
+ invoice_params = { customer: customer[:id] }
+ if SiteSetting.discourse_subscriptions_enable_automatic_tax
+ invoice_params[:automatic_tax] = { enabled: true }
+ end
+ invoice = ::Stripe::Invoice.create(invoice_params)
+
+ invoice_item =
+ ::Stripe::InvoiceItem.create(
+ customer: customer[:id],
+ price: params[:plan],
+ discounts: [{ coupon: coupon_id }],
+ invoice: invoice[:id],
+ )
+ transaction = ::Stripe::Invoice.finalize_invoice(invoice[:id])
+ payment_intent = retrieve_payment_intent(transaction[:id]) if transaction[:status] ==
+ "open"
+ if payment_intent.nil?
+ return(
+ render_json_error I18n.t("js.discourse_subscriptions.subscribe.transaction_error")
+ )
+ end
+ transaction = ::Stripe::Invoice.pay(invoice[:id]) if payment_intent[:status] ==
+ "successful"
+ end
+
+ finalize_transaction(transaction, plan) if transaction_ok(transaction)
+
+ transaction = transaction.to_h.merge(transaction, payment_intent: payment_intent)
+
+ render_json_dump transaction
+ rescue ::Stripe::InvalidRequestError => e
+ render_json_error e.message
+ end
+ end
+
+ def finalize
+ params.require(%i[plan transaction])
+ begin
+ price = ::Stripe::Price.retrieve(params[:plan])
+ transaction = retrieve_transaction(params[:transaction])
+ finalize_transaction(transaction, price) if transaction_ok(transaction)
+
+ render_json_dump params[:transaction]
+ rescue ::Stripe::InvalidRequestError => e
+ render_json_error e.message
+ end
+ end
+
+ def finalize_transaction(transaction, plan)
+ group = plan_group(plan)
+
+ group.add(current_user) if group
+
+ customer =
+ Customer.create(
+ user_id: current_user.id,
+ customer_id: transaction[:customer],
+ product_id: plan[:product],
+ )
+
+ if transaction[:object] == "subscription"
+ Subscription.create(
+ customer_id: customer.id,
+ external_id: transaction[:id],
+ status: transaction[:status],
+ )
+ end
+ end
+
+ private
+
+ def serialize_product(product)
+ {
+ id: product[:id],
+ name: product[:name],
+ description: PrettyText.cook(product[:metadata][:description]),
+ subscribed: current_user_products.include?(product[:id]),
+ repurchaseable: product[:metadata][:repurchaseable],
+ }
+ end
+
+ def current_user_products
+ return [] if current_user.nil?
+
+ Customer
+ .joins(:subscriptions)
+ .where(user_id: current_user.id)
+ .where(
+ Subscription.arel_table[:status].eq(nil).or(
+ Subscription.arel_table[:status].not_eq("canceled"),
+ ),
+ )
+ .select(:product_id)
+ .distinct
+ .pluck(:product_id)
+ end
+
+ def serialize_plans(plans)
+ plans[:data]
+ .map { |plan| plan.to_h.slice(:id, :unit_amount, :currency, :type, :recurring) }
+ .sort_by { |plan| plan[:amount] }
+ end
+
+ def find_or_create_customer(source, cardholder_name = nil, cardholder_address = nil)
+ customer = Customer.find_by_user_id(current_user.id)
+ cardholder_address =
+ (
+ if cardholder_address.present?
+ {
+ line1: cardholder_address[:line1],
+ city: cardholder_address[:city],
+ state: cardholder_address[:state],
+ country: cardholder_address[:country],
+ postal_code: cardholder_address[:postalCode],
+ }
+ else
+ nil
+ end
+ )
+
+ if customer.present?
+ ::Stripe::Customer.retrieve(customer.customer_id)
+ else
+ ::Stripe::Customer.create(
+ email: current_user.email,
+ source: source,
+ name: cardholder_name,
+ address: cardholder_address,
+ )
+ end
+ end
+
+ def retrieve_payment_intent(invoice_id)
+ invoice = ::Stripe::Invoice.retrieve(invoice_id)
+ ::Stripe::PaymentIntent.retrieve(invoice[:payment_intent])
+ end
+
+ def retrieve_transaction(transaction)
+ begin
+ case transaction
+ when /^sub_/
+ ::Stripe::Subscription.retrieve(transaction)
+ when /^in_/
+ ::Stripe::Invoice.retrieve(transaction)
+ end
+ rescue ::Stripe::InvalidRequestError => e
+ e.message
+ end
+ end
+
+ def metadata_user
+ { user_id: current_user.id, username: current_user.username_lower }
+ end
+
+ def transaction_ok(transaction)
+ %w[active trialing paid].include?(transaction[:status])
+ end
+ end
+end
diff --git a/plugins/discourse-subscriptions/app/controllers/discourse_subscriptions/user/payments_controller.rb b/plugins/discourse-subscriptions/app/controllers/discourse_subscriptions/user/payments_controller.rb
new file mode 100644
index 00000000000..7bc4712e0cb
--- /dev/null
+++ b/plugins/discourse-subscriptions/app/controllers/discourse_subscriptions/user/payments_controller.rb
@@ -0,0 +1,118 @@
+# frozen_string_literal: true
+
+module DiscourseSubscriptions
+ module User
+ class PaymentsController < ::ApplicationController
+ include DiscourseSubscriptions::Stripe
+
+ requires_plugin DiscourseSubscriptions::PLUGIN_NAME
+
+ before_action :set_api_key
+ requires_login
+
+ def index
+ begin
+ customer = Customer.where(user_id: current_user.id)
+ customer_ids = customer.map { |c| c.customer_id } if customer
+ product_ids = Product.all.pluck(:external_id)
+
+ data = []
+
+ if customer_ids.present? && product_ids.present?
+ customer_ids.each do |customer_id|
+ # lots of matching because the Stripe API doesn't make it easy to match products => payments except from invoices
+ all_invoices = ::Stripe::Invoice.list(customer: customer_id)
+ invoices_with_products = parse_invoices(all_invoices, product_ids)
+ invoice_ids = invoices_with_products.map { |invoice| invoice[:id] }
+ payments = ::Stripe::PaymentIntent.list(customer: customer_id)
+ payments_from_invoices =
+ payments[:data].select { |payment| invoice_ids.include?(payment[:invoice]) }
+
+ if SiteSetting.discourse_subscriptions_enable_verbose_logging
+ Rails.logger.warn("Payments from invoices: #{payments_from_invoices}")
+ end
+
+ # Pricing table one-off purchases do not have invoices
+ payments_without_invoices =
+ payments[:data].select { |payment| payment[:invoice].nil? }
+
+ if SiteSetting.discourse_subscriptions_enable_verbose_logging
+ Rails.logger.warn("Payments without invoices: #{payments_without_invoices}")
+ end
+
+ data = data | payments_from_invoices | payments_without_invoices
+ end
+ end
+
+ if SiteSetting.discourse_subscriptions_pricing_table_enabled && current_user.email
+ related_guest_payments = fetch_guest_payments(current_user.email)
+ if SiteSetting.discourse_subscriptions_enable_verbose_logging
+ Rails.logger.warn("Related guest payments: #{related_guest_payments}")
+ end
+ data = data | related_guest_payments
+ end
+
+ data = data.sort_by { |pmt| pmt[:created] }.reverse
+
+ render_json_dump data
+ rescue ::Stripe::InvalidRequestError => e
+ render_json_error e.message
+ end
+ end
+
+ private
+
+ def parse_invoices(all_invoices, product_ids)
+ all_invoices[:data].select do |invoice|
+ invoice_lines = invoice[:lines][:data][0] if invoice[:lines] && invoice[:lines][:data]
+ if invoice_lines
+ invoice_product_id = parse_invoice_lines(invoice_lines)
+ product_ids.include?(invoice_product_id)
+ end
+ end
+ end
+
+ def parse_invoice_lines(invoice_lines)
+ invoice_product_id = invoice_lines[:price][:product] if invoice_lines[:price] &&
+ invoice_lines[:price][:product]
+ invoice_product_id = invoice_lines[:plan][:product] if invoice_lines[:plan] &&
+ invoice_lines[:plan][:product]
+ invoice_product_id
+ end
+
+ def fetch_guest_payments(email)
+ guest_payments = []
+ starting_after = nil
+
+ begin
+ loop do
+ # Fetch charges in batches of 100, using pagination with starting_after
+ charges =
+ ::Stripe::Charge.list(
+ limit: 100,
+ starting_after: starting_after,
+ expand: ["data.payment_intent"],
+ )
+
+ charges[:data].each do |charge|
+ # Check if the charge is associated with the given email and has no customer ID
+ if charge[:billing_details][:email] == email && charge[:customer].nil?
+ guest_payments << charge
+ end
+ end
+
+ # Check if there are more charges to fetch
+ break if charges[:data].count < 100
+
+ # Set starting_after to the last charge's ID for the next batch
+ starting_after = charges[:data].last[:id]
+ end
+ rescue ::Stripe::StripeError => e
+ render_json_error e.message
+ end
+
+ guest_payments
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-subscriptions/app/controllers/discourse_subscriptions/user/subscriptions_controller.rb b/plugins/discourse-subscriptions/app/controllers/discourse_subscriptions/user/subscriptions_controller.rb
new file mode 100644
index 00000000000..913207eac38
--- /dev/null
+++ b/plugins/discourse-subscriptions/app/controllers/discourse_subscriptions/user/subscriptions_controller.rb
@@ -0,0 +1,98 @@
+# frozen_string_literal: true
+
+module DiscourseSubscriptions
+ module User
+ class SubscriptionsController < ::ApplicationController
+ include DiscourseSubscriptions::Stripe
+ include DiscourseSubscriptions::Group
+
+ requires_plugin DiscourseSubscriptions::PLUGIN_NAME
+
+ before_action :set_api_key
+ requires_login
+
+ def index
+ begin
+ customer = Customer.where(user_id: current_user.id)
+ customer_ids = customer.map { |c| c.id } if customer
+ stripe_customer_ids = customer.map { |c| c.customer_id }.uniq if customer
+ subscription_ids =
+ Subscription.where("customer_id in (?)", customer_ids).pluck(
+ :external_id,
+ ) if customer_ids
+
+ subscriptions = []
+
+ if subscription_ids
+ prices = []
+ price_params = { limit: 100, expand: ["data.product"] }
+ loop do
+ response = ::Stripe::Price.list(price_params)
+ prices.concat(response[:data])
+ break unless response[:has_more]
+ price_params[:starting_after] = response[:data].last.id
+ end
+ all_subscriptions = []
+
+ stripe_customer_ids.each do |stripe_customer_id|
+ customer_subscriptions =
+ ::Stripe::Subscription.list(customer: stripe_customer_id, status: "all")
+ all_subscriptions.concat(customer_subscriptions[:data])
+ end
+
+ subscriptions = all_subscriptions.select { |sub| subscription_ids.include?(sub[:id]) }
+ subscriptions.map! do |subscription|
+ plan = prices.find { |p| p[:id] == subscription[:items][:data][0][:price][:id] }
+ subscription.to_h.except!(:plan)
+ subscription.to_h.merge(plan: plan, product: plan[:product].to_h.slice(:id, :name))
+ end
+ end
+
+ render_json_dump subscriptions
+ rescue ::Stripe::InvalidRequestError => e
+ render_json_error e.message
+ end
+ end
+
+ def destroy
+ # we cancel but don't remove until the end of the period
+ # full removal is done via webhooks
+ begin
+ subscription = ::Stripe::Subscription.update(params[:id], { cancel_at_period_end: true })
+
+ if subscription
+ render_json_dump subscription
+ else
+ render_json_error I18n.t("discourse_subscriptions.customer_not_found")
+ end
+ rescue ::Stripe::InvalidRequestError => e
+ render_json_error e.message
+ end
+ end
+
+ def update
+ params.require(:payment_method)
+
+ subscription = Subscription.where(external_id: params[:id]).first
+ begin
+ attach_method_to_customer(subscription.customer_id, params[:payment_method])
+ subscription =
+ ::Stripe::Subscription.update(
+ params[:id],
+ { default_payment_method: params[:payment_method] },
+ )
+ render json: success_json
+ rescue ::Stripe::InvalidRequestError
+ render_json_error I18n.t("discourse_subscriptions.card.invalid")
+ end
+ end
+
+ private
+
+ def attach_method_to_customer(customer_id, method)
+ customer = Customer.find(customer_id)
+ ::Stripe::PaymentMethod.attach(method, { customer: customer.customer_id })
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-subscriptions/app/jobs/regular/manually_update_campaign_data.rb b/plugins/discourse-subscriptions/app/jobs/regular/manually_update_campaign_data.rb
new file mode 100644
index 00000000000..7a3cc175c2f
--- /dev/null
+++ b/plugins/discourse-subscriptions/app/jobs/regular/manually_update_campaign_data.rb
@@ -0,0 +1,10 @@
+# frozen_string_literal: true
+
+module ::Jobs
+ class ManuallyUpdateCampaignData < ::Jobs::Base
+ def execute(args)
+ return unless SiteSetting.discourse_subscriptions_campaign_enabled
+ DiscourseSubscriptions::Campaign.new.refresh_data
+ end
+ end
+end
diff --git a/plugins/discourse-subscriptions/app/jobs/scheduled/refresh_subscriptions_campaign_data.rb b/plugins/discourse-subscriptions/app/jobs/scheduled/refresh_subscriptions_campaign_data.rb
new file mode 100644
index 00000000000..46ef0a46dc3
--- /dev/null
+++ b/plugins/discourse-subscriptions/app/jobs/scheduled/refresh_subscriptions_campaign_data.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+module ::Jobs
+ class RefreshSubscriptionsCampaignData < ::Jobs::Scheduled
+ include ::DiscourseSubscriptions::Stripe
+ every 30.minutes
+
+ def execute(args)
+ return unless SiteSetting.discourse_subscriptions_campaign_enabled && is_stripe_configured?
+ DiscourseSubscriptions::Campaign.new.refresh_data
+ end
+ end
+end
diff --git a/plugins/discourse-subscriptions/app/models/discourse_subscriptions/customer.rb b/plugins/discourse-subscriptions/app/models/discourse_subscriptions/customer.rb
new file mode 100644
index 00000000000..27b48ded495
--- /dev/null
+++ b/plugins/discourse-subscriptions/app/models/discourse_subscriptions/customer.rb
@@ -0,0 +1,32 @@
+# frozen_string_literal: true
+
+module DiscourseSubscriptions
+ class Customer < ActiveRecord::Base
+ self.table_name = "discourse_subscriptions_customers"
+
+ scope :find_user, ->(user) { find_by_user_id(user.id) }
+
+ has_many :subscriptions
+
+ def self.create_customer(user, customer)
+ create(customer_id: customer[:id], user_id: user.id)
+ end
+ end
+end
+
+# == Schema Information
+#
+# Table name: discourse_subscriptions_customers
+#
+# id :bigint not null, primary key
+# customer_id :string not null
+# product_id :string
+# user_id :bigint
+# created_at :datetime not null
+# updated_at :datetime not null
+#
+# Indexes
+#
+# index_discourse_subscriptions_customers_on_customer_id (customer_id)
+# index_discourse_subscriptions_customers_on_user_id (user_id)
+#
diff --git a/plugins/discourse-subscriptions/app/models/discourse_subscriptions/product.rb b/plugins/discourse-subscriptions/app/models/discourse_subscriptions/product.rb
new file mode 100644
index 00000000000..72c20b0312f
--- /dev/null
+++ b/plugins/discourse-subscriptions/app/models/discourse_subscriptions/product.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+module DiscourseSubscriptions
+ class Product < ActiveRecord::Base
+ end
+end
+
+# == Schema Information
+#
+# Table name: discourse_subscriptions_products
+#
+# id :bigint not null, primary key
+# external_id :string not null
+# created_at :datetime not null
+# updated_at :datetime not null
+#
+# Indexes
+#
+# index_discourse_subscriptions_products_on_external_id (external_id)
+#
diff --git a/plugins/discourse-subscriptions/app/models/discourse_subscriptions/subscription.rb b/plugins/discourse-subscriptions/app/models/discourse_subscriptions/subscription.rb
new file mode 100644
index 00000000000..2224d15a9a6
--- /dev/null
+++ b/plugins/discourse-subscriptions/app/models/discourse_subscriptions/subscription.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+module DiscourseSubscriptions
+ class Subscription < ActiveRecord::Base
+ belongs_to :customer
+ end
+end
+
+# == Schema Information
+#
+# Table name: discourse_subscriptions_subscriptions
+#
+# id :bigint not null, primary key
+# customer_id :bigint not null
+# external_id :string not null
+# created_at :datetime not null
+# updated_at :datetime not null
+# status :string
+#
+# Indexes
+#
+# index_discourse_subscriptions_subscriptions_on_customer_id (customer_id)
+# index_discourse_subscriptions_subscriptions_on_external_id (external_id)
+#
diff --git a/plugins/discourse-subscriptions/app/serializers/discourse_subscriptions/payment_serializer.rb b/plugins/discourse-subscriptions/app/serializers/discourse_subscriptions/payment_serializer.rb
new file mode 100644
index 00000000000..5e19823651a
--- /dev/null
+++ b/plugins/discourse-subscriptions/app/serializers/discourse_subscriptions/payment_serializer.rb
@@ -0,0 +1,69 @@
+# frozen_string_literal: true
+
+module DiscourseSubscriptions
+ class PaymentSerializer < ApplicationSerializer
+ attributes :payment_intent_id,
+ :receipt_email,
+ :url,
+ :created_at_age,
+ :amount,
+ :amount_currency,
+ :username,
+ :user_id
+
+ def created_at_age
+ Time.now - object.created_at
+ end
+
+ def amount_currency
+ ActiveSupport::NumberHelper.number_to_currency(
+ object.amount / 100,
+ precision: 2,
+ unit: currency_unit,
+ )
+ end
+
+ def username
+ user&.username
+ end
+
+ private
+
+ def user
+ begin
+ User.find(object.user_id)
+ rescue StandardError
+ nil
+ end
+ end
+
+ def currency_unit
+ case object.currency
+ when "eur"
+ "€"
+ when "gbp"
+ "£"
+ when "inr"
+ "₹"
+ when "brl"
+ "R$"
+ when "dkk"
+ "KR"
+ when "sgd"
+ "S$"
+ when "zar"
+ "R"
+ when "chf"
+ "CHF"
+ when "pln"
+ "zł"
+ when "czk"
+ "Kč"
+ when "sek"
+ "kr"
+ else
+ "$"
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-subscriptions/app/services/discourse_subscriptions/campaign.rb b/plugins/discourse-subscriptions/app/services/discourse_subscriptions/campaign.rb
new file mode 100644
index 00000000000..c37410ebcae
--- /dev/null
+++ b/plugins/discourse-subscriptions/app/services/discourse_subscriptions/campaign.rb
@@ -0,0 +1,237 @@
+# frozen_string_literal: true
+
+module DiscourseSubscriptions
+ class Campaign
+ include DiscourseSubscriptions::Stripe
+ def initialize
+ set_api_key # instantiates Stripe API
+ end
+
+ def refresh_data
+ product_ids = Set.new(Product.all.pluck(:external_id))
+
+ # if a product id is set for the campaign, we only want to return those results.
+ # if it's blank, return them all.
+ campaign_product = SiteSetting.discourse_subscriptions_campaign_product
+ if campaign_product.present?
+ product_ids = product_ids.include?(campaign_product) ? [campaign_product] : []
+ end
+
+ amount = 0.00
+ subscriptions = get_subscription_data
+ subscriptions = filter_to_subscriptions_products(subscriptions, product_ids)
+
+ # Fetch product purchases
+ one_time_payments = get_one_time_payments(product_ids)
+ one_time_payments.each { |c| amount += c[:price].to_f / 100.00 }
+
+ # get number of subscribers
+ SiteSetting.discourse_subscriptions_campaign_subscribers = subscriptions&.length.to_i
+
+ # calculate amount raised
+ subscriptions&.each do |sub|
+ sub_amount = calculate_monthly_amount(sub)
+ amount += sub_amount / 100.00
+ end
+
+ SiteSetting.discourse_subscriptions_campaign_amount_raised = amount.round(2)
+
+ check_goal_status
+ end
+
+ def create_campaign
+ begin
+ group = create_campaign_group
+ product = create_campaign_product
+ create_campaign_prices(product, group)
+
+ SiteSetting.discourse_subscriptions_campaign_enabled = true
+ SiteSetting.discourse_subscriptions_campaign_product = product[:id]
+ rescue ::Stripe::InvalidRequestError => e
+ e
+ end
+ end
+
+ protected
+
+ def goal_met_date_key
+ "subscriptions_goal_met_date"
+ end
+
+ def check_goal_status
+ goal = SiteSetting.discourse_subscriptions_campaign_goal
+ goal_type = SiteSetting.discourse_subscriptions_campaign_type
+
+ case goal_type
+ when "Amount"
+ current_volume = SiteSetting.discourse_subscriptions_campaign_amount_raised
+ when "Subscribers"
+ current_volume = SiteSetting.discourse_subscriptions_campaign_subscribers
+ end
+
+ goal_met_date = Discourse.redis.get(goal_met_date_key)
+
+ if goal_met_date
+ # delete the key if we're at or below 90% of the goal
+ Discourse.redis.del(goal_met_date_key) if current_volume / goal <= 0.90
+ else
+ Discourse.redis.set(goal_met_date_key, Time.now) if current_volume > goal
+ end
+ end
+
+ def create_campaign_group
+ campaign_group = SiteSetting.discourse_subscriptions_campaign_group
+ group = ::Group.find_by_id(campaign_group) if campaign_group.present?
+
+ unless group
+ group = ::Group.create(name: "campaign_supporters")
+
+ SiteSetting.discourse_subscriptions_campaign_group = group[:id]
+
+ params = {
+ full_name: I18n.t("js.discourse_subscriptions.campaign.supporters"),
+ title: I18n.t("js.discourse_subscriptions.campaign.supporter"),
+ flair_icon: "circle-dollar-to-slot",
+ }
+
+ group.update(params)
+ end
+
+ group[:name]
+ end
+
+ def create_campaign_product
+ product_params = {
+ name: I18n.t("js.discourse_subscriptions.campaign.title"),
+ active: true,
+ metadata: {
+ description: I18n.t("js.discourse_subscriptions.campaign.body"),
+ },
+ }
+
+ product = ::Stripe::Product.create(product_params)
+
+ Product.create(external_id: product[:id])
+
+ product
+ end
+
+ def create_campaign_prices(product, group)
+ # hard coded defaults to make setting this up as simple as possible
+ monthly_prices = [3, 5, 10, 25]
+ yearly_prices = [50, 100]
+
+ monthly_prices.each { |price| create_price(product[:id], group, price, "month") }
+
+ yearly_prices.each { |price| create_price(product[:id], group, price, "year") }
+ end
+
+ def create_price(product_id, group_name, amount, recurrence)
+ price_object = {
+ nickname: "#{amount}/#{recurrence}",
+ unit_amount: amount * 100,
+ product: product_id,
+ currency: SiteSetting.discourse_subscriptions_currency,
+ active: true,
+ recurring: {
+ interval: recurrence,
+ },
+ metadata: {
+ group_name: group_name,
+ },
+ }
+
+ plan = ::Stripe::Price.create(price_object)
+ end
+
+ def get_one_time_payments(product_ids)
+ one_time_payments = []
+ current_set = { has_more: true, last_record: nil }
+
+ if product_ids.present?
+ # lots of matching because the Stripe API doesn't make it easy to match products => payments except from invoices
+ until current_set[:has_more] == false
+ all_invoices =
+ ::Stripe::Invoice.list(limit: 100, starting_after: current_set[:last_record])
+
+ if all_invoices[:data].present?
+ current_set[:last_record] = all_invoices[:data].last[:id]
+ current_set[:has_more] = all_invoices[:has_more]
+
+ all_invoices[:data].each do |invoice|
+ customer_id = invoice[:customer]
+ next if invoice[:paid] != true
+ line_item = invoice[:lines][:data][0] if invoice[:lines] && invoice[:lines][:data] # Discourse only makes single-line item charges
+ # check if non-subscription and that the plan is active
+ if line_item && line_item[:plan] == nil && line_item[:price] &&
+ line_item[:price][:recurring] == nil && line_item[:price][:active] == true
+ product_id = line_item[:price][:product]
+ if product_ids.include? product_id
+ line_data = {
+ customer_id: customer_id,
+ product_id: product_id,
+ price: line_item[:price][:unit_amount],
+ }
+ one_time_payments << line_data
+ end
+ end
+ end
+ else
+ current_set[:has_more] = false
+ end
+ end
+ end
+
+ one_time_payments
+ end
+
+ def get_subscription_data
+ subscriptions = []
+ current_set = { has_more: true, last_record: nil }
+
+ until current_set[:has_more] == false
+ current_set =
+ ::Stripe::Subscription.list(
+ expand: ["data.plan.product"],
+ limit: 100,
+ starting_after: current_set[:last_record],
+ )
+
+ current_set[:last_record] = current_set[:data].last[:id] if current_set[:data].present?
+ subscriptions.concat(current_set[:data].to_a)
+ end
+
+ subscriptions
+ end
+
+ def filter_to_subscriptions_products(data, ids)
+ valid =
+ data.select do |sub|
+ # cannot .dig stripe objects
+ items = sub[:items][:data][0] if sub[:items] && sub[:items][:data]
+ product = items[:price][:product] if items[:price] && items[:price][:product]
+
+ ids.include?(product)
+ end
+ valid.empty? ? nil : valid
+ end
+
+ def calculate_monthly_amount(sub)
+ items = sub[:items][:data][0] if sub[:items] && sub[:items][:data]
+ price = items[:price] if items[:price]
+ unit_amount = price[:unit_amount] if price[:unit_amount]
+ recurrence = price[:recurring][:interval] if price[:recurring] && price[:recurring][:interval]
+
+ case recurrence
+ when "day"
+ unit_amount = unit_amount * 30
+ when "week"
+ unit_amount = unit_amount * 4
+ when "year"
+ unit_amount = unit_amount / 12.00
+ end
+
+ unit_amount.to_f
+ end
+ end
+end
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/components/campaign-banner.gjs b/plugins/discourse-subscriptions/assets/javascripts/discourse/components/campaign-banner.gjs
new file mode 100644
index 00000000000..b1398c7d5ba
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/components/campaign-banner.gjs
@@ -0,0 +1,399 @@
+import Component from "@ember/component";
+import { concat } from "@ember/helper";
+import { action } from "@ember/object";
+import { equal } from "@ember/object/computed";
+import { LinkTo } from "@ember/routing";
+import { later } from "@ember/runloop";
+import { service } from "@ember/service";
+import { classNameBindings } from "@ember-decorators/component";
+import { observes } from "@ember-decorators/object";
+import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";
+import DButton from "discourse/components/d-button";
+import avatar from "discourse/helpers/avatar";
+import icon from "discourse/helpers/d-icon";
+import htmlSafe from "discourse/helpers/html-safe";
+import { ajax } from "discourse/lib/ajax";
+import { setting } from "discourse/lib/computed";
+import discourseComputed from "discourse/lib/decorators";
+import { i18n } from "discourse-i18n";
+import formatCurrency from "../helpers/format-currency";
+
+const SIDEBAR_BODY_CLASS = "subscription-campaign-sidebar";
+
+@classNameBindings("isGoalMet:goal-met")
+export default class CampaignBanner extends Component {
+ @service router;
+
+ dismissed = false;
+ loading = false;
+
+ @setting("discourse_subscriptions_campaign_banner_shadow_color")
+ dropShadowColor;
+
+ @setting("discourse_subscriptions_campaign_banner_bg_image")
+ backgroundImageUrl;
+
+ @equal(
+ "siteSettings.discourse_subscriptions_campaign_banner_location",
+ "Sidebar"
+ )
+ isSidebar;
+
+ @setting("discourse_subscriptions_campaign_subscribers") subscribers;
+
+ @equal("siteSettings.discourse_subscriptions_campaign_type", "Subscribers")
+ subscriberGoal;
+
+ @setting("discourse_subscriptions_currency") currency;
+
+ @setting("discourse_subscriptions_campaign_amount_raised") amountRaised;
+
+ @setting("discourse_subscriptions_campaign_goal") goalTarget;
+
+ @setting("discourse_subscriptions_campaign_product") product;
+
+ @setting("discourse_subscriptions_pricing_table_enabled") pricingTableEnabled;
+
+ @setting("discourse_subscriptions_campaign_show_contributors")
+ showContributors;
+
+ init() {
+ super.init(...arguments);
+
+ this.set("contributors", []);
+
+ // add background-image url to stylesheet
+ if (this.backgroundImageUrl) {
+ const backgroundUrl = `url(${this.backgroundImageUrl}`.replace(/\\/g, "");
+ if (
+ document.documentElement.style.getPropertyValue(
+ "--campaign-background-image"
+ ) !== backgroundUrl
+ ) {
+ document.documentElement.style.setProperty(
+ "--campaign-background-image",
+ backgroundUrl
+ );
+ }
+ }
+
+ if (this.currentUser && this.showContributors) {
+ return ajax("/s/contributors", { method: "get" }).then((result) => {
+ this.setProperties({
+ contributors: result,
+ loading: false,
+ });
+ });
+ }
+ }
+
+ didInsertElement() {
+ super.didInsertElement(...arguments);
+ if (this.isSidebar && this.shouldShow && !this.site.mobileView) {
+ document.body.classList.add(SIDEBAR_BODY_CLASS);
+ } else {
+ document.body.classList.remove(SIDEBAR_BODY_CLASS);
+ }
+
+ // makes sure to only play animation once, & not repeat on reload
+ if (this.isGoalMet) {
+ const successAnimationKey = this.keyValueStore.get(
+ "campaign_success_animation"
+ );
+
+ if (!successAnimationKey) {
+ later(() => {
+ this.keyValueStore.set({
+ key: "campaign_success_animation",
+ value: Date.now(),
+ });
+ document.body.classList.add("success-animation-off");
+ }, 7000);
+ } else {
+ document.body.classList.add("success-animation-off");
+ }
+ }
+ }
+
+ willDestroyElement() {
+ super.willDestroyElement(...arguments);
+ document.body.classList.remove(SIDEBAR_BODY_CLASS);
+ }
+
+ @discourseComputed("backgroundImageUrl")
+ bannerInfoStyle(backgroundImageUrl) {
+ if (!backgroundImageUrl) {
+ return "";
+ }
+
+ return `background-image: linear-gradient(
+ 0deg,
+ rgba(var(--secondary-rgb), 0.75) 0%,
+ rgba(var(--secondary-rgb), 0.75) 100%),
+ var(--campaign-background-image);
+ background-size: cover;
+ background-repeat: no-repeat;`;
+ }
+
+ @discourseComputed(
+ "router.currentRouteName",
+ "currentUser",
+ "siteSettings.discourse_subscriptions_campaign_enabled",
+ "visible"
+ )
+ shouldShow(currentRoute, currentUser, enabled, visible) {
+ // do not show on admin or subscriptions pages
+ const showOnRoute =
+ currentRoute !== "discovery.s" &&
+ !currentRoute.split(".")[0].includes("admin") &&
+ currentRoute.split(".")[0] !== "subscribe" &&
+ currentRoute.split(".")[0] !== "subscriptions";
+
+ if (!this.site.show_campaign_banner) {
+ return false;
+ }
+
+ // make sure not to render above main container when inside a topic
+ if (
+ this.connectorName === "above-main-container" &&
+ currentRoute.includes("topic")
+ ) {
+ return false;
+ }
+
+ return showOnRoute && currentUser && enabled && visible;
+ }
+
+ @observes("dismissed")
+ _updateBodyClasses() {
+ if (this.dismissed) {
+ document.body.classList.remove(SIDEBAR_BODY_CLASS);
+ }
+ }
+
+ @discourseComputed("dismissed")
+ visible(dismissed) {
+ const dismissedBannerKey = this.keyValueStore.get(
+ "dismissed_campaign_banner"
+ );
+ const threeMonths = 2628000000 * 3;
+
+ const bannerDismissedTime = new Date(dismissedBannerKey);
+ const now = Date.now();
+
+ return (
+ (!dismissedBannerKey || now - bannerDismissedTime > threeMonths) &&
+ !dismissed
+ );
+ }
+
+ @discourseComputed
+ subscribeRoute() {
+ if (this.pricingTableEnabled) {
+ return "subscriptions";
+ }
+ return "subscribe";
+ }
+
+ @discourseComputed
+ isGoalMet() {
+ const currentVolume = this.subscriberGoal
+ ? this.subscribers
+ : this.amountRaised;
+ return currentVolume >= this.goalTarget;
+ }
+
+ @action
+ dismissBanner() {
+ this.set("dismissed", true);
+ this.keyValueStore.set({
+ key: "dismissed_campaign_banner",
+ value: Date.now(),
+ });
+ }
+
+ <template>
+ {{#if this.shouldShow}}
+ <div
+ class="campaign-banner"
+ style={{htmlSafe (concat "box-shadow: 5px 5px #" this.dropShadowColor)}}
+ >
+ <DButton @icon="xmark" @action={{this.dismissBanner}} class="close" />
+
+ <div
+ class="campaign-banner-info"
+ style={{htmlSafe this.bannerInfoStyle}}
+ >
+ {{#if this.isGoalMet}}
+ <h2 class="campaign-banner-info-header">
+ {{i18n "discourse_subscriptions.campaign.success_title"}}
+ </h2>
+
+ <p class="campaign-banner-info-description">
+ {{i18n "discourse_subscriptions.campaign.success_body"}}
+ </p>
+ {{else}}
+ <h2 class="campaign-banner-info-header">
+ {{i18n "discourse_subscriptions.campaign.title"}}
+ </h2>
+
+ <p class="campaign-banner-info-description">
+ {{i18n "discourse_subscriptions.campaign.body"}}
+ </p>
+
+ {{#if this.product}}
+ <LinkTo
+ @route="subscribe.show"
+ @model={{this.product}}
+ @disabled={{this.product.subscribed}}
+ class="btn btn-primary campaign-banner-info-button"
+ >
+ {{icon "far-heart"}}
+ {{icon "heart" class="hover-heart"}}
+ {{i18n "discourse_subscriptions.campaign.button"}}
+ </LinkTo>
+ {{else}}
+ <LinkTo
+ @route={{this.subscribeRoute}}
+ class="btn btn-primary campaign-banner-info-button"
+ >
+ {{icon "far-heart"}}
+ {{icon "heart" class="hover-heart"}}
+ {{i18n "discourse_subscriptions.campaign.button"}}
+ </LinkTo>
+ {{/if}}
+ {{/if}}
+ </div>
+
+ <div class="campaign-banner-progress">
+ {{#if this.isGoalMet}}
+ <div class="fireworks">
+ <div class="before"></div>
+ <div class="after"></div>
+ </div>
+
+ <div class="campaign-banner-progress-success"></div>
+
+ {{#if this.subscriberGoal}}
+ <p class="campaign-banner-progress-description">
+ {{htmlSafe
+ (i18n
+ "discourse_subscriptions.campaign.goal_comparison"
+ current=this.subscribers
+ goal=this.goalTarget
+ )
+ }}
+ {{i18n "discourse_subscriptions.campaign.subscribers"}}
+ </p>
+ {{else}}
+ <p class="campaign-banner-progress-description">
+ {{htmlSafe
+ (i18n
+ "discourse_subscriptions.campaign.goal_comparison"
+ current=(formatCurrency this.currency this.amountRaised)
+ goal=(formatCurrency this.currency this.goalTarget)
+ )
+ }}
+ {{i18n "discourse_subscriptions.campaign.raised"}}
+ </p>
+
+ {{#if this.showContributors}}
+ <ConditionalLoadingSpinner
+ @condition={{this.loading}}
+ @size="small"
+ >
+ <div class="campaign-banner-progress-users">
+ <p class="campaign-banner-progress-users-title">
+ <strong>
+ {{i18n
+ "discourse_subscriptions.campaign.recent_contributors"
+ }}
+ </strong>
+ </p>
+
+ <div class="campaign-banner-progress-users-avatars">
+ {{#each this.contributors as |contributor|}}
+ {{avatar
+ contributor
+ avatarTemplatePath="avatar_template"
+ usernamePath="username"
+ namePath="name"
+ imageSize="small"
+ }}
+ {{/each}}
+ </div>
+ </div>
+ </ConditionalLoadingSpinner>
+ {{/if}}
+ {{/if}}
+ {{else}}
+ {{#if this.subscriberGoal}}
+ <progress
+ class="campaign-banner-progress-bar"
+ value={{this.subscribers}}
+ max={{this.siteSettings.discourse_subscriptions_campaign_goal}}
+ ></progress>
+
+ <p class="campaign-banner-progress-description">
+ {{htmlSafe
+ (i18n
+ "discourse_subscriptions.campaign.goal_comparison"
+ current=this.subscribers
+ goal=this.goalTarget
+ )
+ }}
+ {{i18n "discourse_subscriptions.campaign.subscribers"}}
+ </p>
+ {{else}}
+ <progress
+ class="campaign-banner-progress-bar"
+ value={{this.amountRaised}}
+ max={{this.siteSettings.discourse_subscriptions_campaign_goal}}
+ ></progress>
+
+ <p class="campaign-banner-progress-description">
+ {{htmlSafe
+ (i18n
+ "discourse_subscriptions.campaign.goal_comparison"
+ current=(formatCurrency this.currency this.amountRaised)
+ goal=(formatCurrency this.currency this.goalTarget)
+ )
+ }}
+ {{i18n "discourse_subscriptions.campaign.raised"}}
+ </p>
+ {{/if}}
+
+ {{#if this.showContributors}}
+ <ConditionalLoadingSpinner
+ @condition={{this.loading}}
+ @size="small"
+ >
+ <div class="campaign-banner-progress-users">
+ <p class="campaign-banner-progress-users-title">
+ <strong>
+ {{i18n
+ "discourse_subscriptions.campaign.recent_contributors"
+ }}
+ </strong>
+ </p>
+
+ <div class="campaign-banner-progress-users-avatars">
+ {{#each this.contributors as |contributor|}}
+ {{avatar
+ contributor
+ avatarTemplatePath="avatar_template"
+ usernamePath="username"
+ namePath="name"
+ imageSize="small"
+ }}
+ {{/each}}
+ </div>
+ </div>
+ </ConditionalLoadingSpinner>
+ {{/if}}
+ {{/if}}
+ </div>
+ </div>
+ {{/if}}
+ </template>
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/components/create-coupon-form.gjs b/plugins/discourse-subscriptions/assets/javascripts/discourse/components/create-coupon-form.gjs
new file mode 100644
index 00000000000..136394e942f
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/components/create-coupon-form.gjs
@@ -0,0 +1,92 @@
+import Component, { Input } from "@ember/component";
+import { fn } from "@ember/helper";
+import { action } from "@ember/object";
+import DButton from "discourse/components/d-button";
+import discourseComputed from "discourse/lib/decorators";
+import { i18n } from "discourse-i18n";
+import ComboBox from "select-kit/components/combo-box";
+
+export default class CreateCouponForm extends Component {
+ discountType = "amount";
+ discount = null;
+ promoCode = null;
+ active = false;
+
+ @discourseComputed
+ discountTypes() {
+ return [
+ { id: "amount", name: "Amount" },
+ { id: "percent", name: "Percent" },
+ ];
+ }
+
+ @action
+ createNewCoupon() {
+ const createParams = {
+ promo: this.promoCode,
+ discount_type: this.discountType,
+ discount: this.discount,
+ active: this.active,
+ };
+
+ this.create(createParams);
+ }
+
+ @action
+ cancelCreate() {
+ this.cancel();
+ }
+
+ <template>
+ <div class="create-coupon-form">
+ <form class="form-horizontal">
+ <p>
+ <label for="promo_code">
+ {{i18n "discourse_subscriptions.admin.coupons.promo_code"}}
+ </label>
+ <Input @type="text" name="promo_code" @value={{this.promoCode}} />
+ </p>
+
+ <p>
+ <label for="amount">
+ {{i18n "discourse_subscriptions.admin.coupons.discount"}}
+ </label>
+ <ComboBox
+ @content={{this.discountTypes}}
+ @value={{this.discountType}}
+ @onChange={{fn (mut this.discountType)}}
+ />
+ <Input
+ class="discount-amount"
+ @type="text"
+ name="amount"
+ @value={{this.discount}}
+ />
+ </p>
+
+ <p>
+ <label for="active">
+ {{i18n "discourse_subscriptions.admin.coupons.active"}}
+ </label>
+ <Input @type="checkbox" name="active" @checked={{this.active}} />
+ </p>
+ </form>
+
+ <DButton
+ @action={{this.createNewCoupon}}
+ @label="discourse_subscriptions.admin.coupons.create"
+ @title="discourse_subscriptions.admin.coupons.create"
+ @icon="plus"
+ class="btn-primary btn btn-icon"
+ />
+
+ <DButton
+ @action={{this.cancelCreate}}
+ label="cancel"
+ @title="cancel"
+ @icon="xmark"
+ class="btn btn-icon"
+ />
+ </div>
+ </template>
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/components/login-required.gjs b/plugins/discourse-subscriptions/assets/javascripts/discourse/components/login-required.gjs
new file mode 100644
index 00000000000..538dcb1f637
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/components/login-required.gjs
@@ -0,0 +1,16 @@
+import DButton from "discourse/components/d-button";
+import routeAction from "discourse/helpers/route-action";
+import { i18n } from "discourse-i18n";
+
+const LoginRequired = <template>
+ <h3>{{i18n "discourse_subscriptions.subscribe.unauthenticated"}}</h3>
+
+ <DButton
+ @label="log_in"
+ @action={{routeAction "showLogin"}}
+ @icon="user"
+ class="btn btn-primary login-required subscriptions"
+ />
+</template>;
+
+export default LoginRequired;
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/components/modal/admin-cancel-subscription.gjs b/plugins/discourse-subscriptions/assets/javascripts/discourse/components/modal/admin-cancel-subscription.gjs
new file mode 100644
index 00000000000..11f76fd5081
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/components/modal/admin-cancel-subscription.gjs
@@ -0,0 +1,42 @@
+import Component from "@glimmer/component";
+import { tracked } from "@glimmer/tracking";
+import { Input } from "@ember/component";
+import { fn, hash } from "@ember/helper";
+import DButton from "discourse/components/d-button";
+import DModal from "discourse/components/d-modal";
+import { i18n } from "discourse-i18n";
+
+export default class AdminCancelSubscription extends Component {
+ @tracked refund;
+
+ <template>
+ <DModal
+ @title={{i18n
+ "discourse_subscriptions.user.subscriptions.operations.destroy.confirm"
+ }}
+ @closeModal={{@closeModal}}
+ >
+ <:body>
+ <Input @type="checkbox" @checked={{this.refund}} />
+ {{i18n "discourse_subscriptions.admin.ask_refund"}}
+ </:body>
+ <:footer>
+ <DButton
+ @label="yes_value"
+ @action={{fn
+ @model.cancelSubscription
+ (hash
+ refund=this.refund
+ closeModal=@closeModal
+ )
+ }}
+ @icon="xmark"
+ @isLoading={{@model.subscription.loading}}
+ class="btn-danger"
+ />
+ <DButton @label="no_value" @action={{@closeModal}} />
+ </:footer>
+ </DModal>
+ </template>
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/components/payment-options.gjs b/plugins/discourse-subscriptions/assets/javascripts/discourse/components/payment-options.gjs
new file mode 100644
index 00000000000..e63b7ec9983
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/components/payment-options.gjs
@@ -0,0 +1,42 @@
+import Component from "@ember/component";
+import { action } from "@ember/object";
+import discourseComputed from "discourse/lib/decorators";
+import { i18n } from "discourse-i18n";
+import PaymentPlan from "./payment-plan";
+
+export default class PaymentOptions extends Component {
+ @discourseComputed("plans")
+ orderedPlans(plans) {
+ if (plans) {
+ return plans.sort((a, b) => (a.unit_amount > b.unit_amount ? 1 : -1));
+ }
+ }
+
+ didInsertElement() {
+ super.didInsertElement(...arguments);
+ if (this.plans && this.plans.length === 1) {
+ this.set("selectedPlan", this.plans[0].id);
+ }
+ }
+
+ @action
+ clickPlan(plan) {
+ this.set("selectedPlan", plan.id);
+ }
+
+ <template>
+ <p>
+ {{i18n "discourse_subscriptions.plans.select"}}
+ </p>
+
+ <div class="subscribe-buttons">
+ {{#each this.orderedPlans as |plan|}}
+ <PaymentPlan
+ @plan={{plan}}
+ @selectedPlan={{this.selectedPlan}}
+ @clickPlan={{this.clickPlan}}
+ />
+ {{/each}}
+ </div>
+ </template>
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/components/payment-plan.gjs b/plugins/discourse-subscriptions/assets/javascripts/discourse/components/payment-plan.gjs
new file mode 100644
index 00000000000..376bdaa5880
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/components/payment-plan.gjs
@@ -0,0 +1,57 @@
+import Component from "@ember/component";
+import { concat } from "@ember/helper";
+import { action } from "@ember/object";
+import { tagName } from "@ember-decorators/component";
+import DButton from "discourse/components/d-button";
+import concatClass from "discourse/helpers/concat-class";
+import discourseComputed from "discourse/lib/decorators";
+import { i18n } from "discourse-i18n";
+import formatCurrency from "../helpers/format-currency";
+
+const RECURRING = "recurring";
+
+@tagName("")
+export default class PaymentPlan extends Component {
+ @discourseComputed("selectedPlan")
+ selectedClass(planId) {
+ return planId === this.plan.id ? "btn-primary" : "";
+ }
+
+ @discourseComputed("plan.type")
+ recurringPlan(type) {
+ return type === RECURRING;
+ }
+
+ @action
+ planClick() {
+ this.clickPlan(this.plan);
+ return false;
+ }
+
+ <template>
+ <DButton
+ @action={{this.planClick}}
+ class={{concatClass
+ "btn-discourse-subscriptions-subscribe"
+ this.selectedClass
+ }}
+ >
+ <span class="interval">
+ {{#if this.recurringPlan}}
+ {{i18n
+ (concat
+ "discourse_subscriptions.plans.interval.adverb."
+ this.plan.recurring.interval
+ )
+ }}
+ {{else}}
+ {{i18n "discourse_subscriptions.one_time_payment"}}
+ {{/if}}
+ </span>
+
+ <span class="amount">
+ {{formatCurrency this.plan.currency this.plan.amountDollars}}
+ </span>
+ </DButton>
+ </template>
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/components/product-item.gjs b/plugins/discourse-subscriptions/assets/javascripts/discourse/components/product-item.gjs
new file mode 100644
index 00000000000..0bf3a21c6f9
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/components/product-item.gjs
@@ -0,0 +1,64 @@
+import Component from "@ember/component";
+import { LinkTo } from "@ember/routing";
+import { classNames } from "@ember-decorators/component";
+import htmlSafe from "discourse/helpers/html-safe";
+import { i18n } from "discourse-i18n";
+
+@classNames("product")
+export default class ProductItem extends Component {
+ <template>
+ <h2>{{this.product.name}}</h2>
+
+ <p class="product-description">
+ {{htmlSafe this.product.description}}
+ </p>
+
+ {{#if this.isLoggedIn}}
+ <div class="product-purchase">
+ {{#if this.product.repurchaseable}}
+ <LinkTo
+ @route="subscribe.show"
+ @model={{this.product.id}}
+ class="btn btn-primary"
+ >
+ {{i18n "discourse_subscriptions.subscribe.title"}}
+ </LinkTo>
+
+ {{#if this.product.subscribed}}
+ <LinkTo
+ @route="user.billing.subscriptions"
+ @model={{this.currentUser.username}}
+ class="billing-link"
+ >
+ {{i18n "discourse_subscriptions.subscribe.view_past"}}
+ </LinkTo>
+ {{/if}}
+ {{else}}
+ {{#if this.product.subscribed}}
+ <span class="purchased">
+ &#x2713;
+ {{i18n "discourse_subscriptions.subscribe.purchased"}}
+ </span>
+
+ <LinkTo
+ @route="user.billing.subscriptions"
+ @model={{this.currentUser.username}}
+ class="billing-link"
+ >
+ {{i18n "discourse_subscriptions.subscribe.go_to_billing"}}
+ </LinkTo>
+ {{else}}
+ <LinkTo
+ @route="subscribe.show"
+ @model={{this.product.id}}
+ @disabled={{this.product.subscribed}}
+ class="btn btn-primary"
+ >
+ {{i18n "discourse_subscriptions.subscribe.title"}}
+ </LinkTo>
+ {{/if}}
+ {{/if}}
+ </div>
+ {{/if}}
+ </template>
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/components/product-list.gjs b/plugins/discourse-subscriptions/assets/javascripts/discourse/components/product-list.gjs
new file mode 100644
index 00000000000..09160b4caa6
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/components/product-list.gjs
@@ -0,0 +1,24 @@
+import Component from "@ember/component";
+import { isEmpty } from "@ember/utils";
+import { classNames } from "@ember-decorators/component";
+import discourseComputed from "discourse/lib/decorators";
+import { i18n } from "discourse-i18n";
+import ProductItem from "./product-item";
+
+@classNames("product-list")
+export default class ProductList extends Component {
+ @discourseComputed("products")
+ emptyProducts(products) {
+ return isEmpty(products);
+ }
+
+ <template>
+ {{#if this.emptyProducts}}
+ <p>{{i18n "discourse_subscriptions.subscribe.no_products"}}</p>
+ {{else}}
+ {{#each this.products as |product|}}
+ <ProductItem @product={{product}} @isLoggedIn={{this.isLoggedIn}} />
+ {{/each}}
+ {{/if}}
+ </template>
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/components/subscribe-ca-province-select.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/components/subscribe-ca-province-select.js
new file mode 100644
index 00000000000..d2863ed160a
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/components/subscribe-ca-province-select.js
@@ -0,0 +1,43 @@
+import { computed } from "@ember/object";
+import { classNames } from "@ember-decorators/component";
+import { i18n } from "discourse-i18n";
+import ComboBoxComponent from "select-kit/components/combo-box";
+import {
+ pluginApiIdentifiers,
+ selectKitOptions,
+} from "select-kit/components/select-kit";
+
+@selectKitOptions({
+ filterable: true,
+ allowAny: false,
+ translatedNone: i18n(
+ "discourse_subscriptions.subscribe.cardholder_address.province"
+ ),
+})
+@pluginApiIdentifiers("subscribe-ca-province-select")
+@classNames("subscribe-address-state-select")
+export default class SubscribeCaProvinceSelect extends ComboBoxComponent {
+ nameProperty = "name";
+ valueProperty = "value";
+
+ @computed
+ get content() {
+ return [
+ ["AB", "Alberta"],
+ ["BC", "British Columbia"],
+ ["MB", "Manitoba"],
+ ["NB", "New Brunswick"],
+ ["NL", "Newfoundland and Labrador"],
+ ["NT", "Northwest Territories"],
+ ["NS", "Nova Scotia"],
+ ["NU", "Nunavut"],
+ ["ON", "Ontario"],
+ ["PE", "Prince Edward Island"],
+ ["QC", "Quebec"],
+ ["SK", "Saskatchewan"],
+ ["YT", "Yukon"],
+ ].map((arr) => {
+ return { value: arr[0], name: arr[1] };
+ });
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/components/subscribe-card.gjs b/plugins/discourse-subscriptions/assets/javascripts/discourse/components/subscribe-card.gjs
new file mode 100644
index 00000000000..bdee67870cb
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/components/subscribe-card.gjs
@@ -0,0 +1,35 @@
+import Component from "@ember/component";
+
+export default class SubscribeCard extends Component {
+ didInsertElement() {
+ super.didInsertElement(...arguments);
+ this.cardElement.mount("#card-element");
+ this.setCardElementStyles();
+ }
+
+ setCardElementStyles() {
+ const root = document.querySelector(":root");
+ const computedStyle = getComputedStyle(root);
+ const primaryColor = computedStyle.getPropertyValue("--primary");
+ const placeholderColor =
+ computedStyle.getPropertyValue("--secondary-medium");
+ this.cardElement.update({
+ style: {
+ base: {
+ color: primaryColor,
+ "::placeholder": {
+ color: placeholderColor,
+ },
+ },
+ },
+ });
+ }
+
+ didDestroyElement() {
+ super.didDestroyElement(...arguments);
+ }
+
+ <template>
+ <div id="card-element"></div>
+ </template>
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/components/subscribe-country-select.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/components/subscribe-country-select.js
new file mode 100644
index 00000000000..48c57f50c75
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/components/subscribe-country-select.js
@@ -0,0 +1,279 @@
+import { computed } from "@ember/object";
+import { classNames } from "@ember-decorators/component";
+import { i18n } from "discourse-i18n";
+import ComboBoxComponent from "select-kit/components/combo-box";
+import {
+ pluginApiIdentifiers,
+ selectKitOptions,
+} from "select-kit/components/select-kit";
+
+@pluginApiIdentifiers("subscribe-country-select")
+@selectKitOptions({
+ filterable: true,
+ allowAny: false,
+ translatedNone: i18n(
+ "discourse_subscriptions.subscribe.cardholder_address.country"
+ ),
+})
+@classNames("subscribe-address-country-select")
+export default class SubscribeCountrySelect extends ComboBoxComponent {
+ nameProperty = "name";
+ valueProperty = "value";
+
+ @computed
+ get content() {
+ return [
+ ["AF", i18n("discourse_subscriptions.subscribe.countries.AF")],
+ ["AX", i18n("discourse_subscriptions.subscribe.countries.AX")],
+ ["AL", i18n("discourse_subscriptions.subscribe.countries.AL")],
+ ["DZ", i18n("discourse_subscriptions.subscribe.countries.DZ")],
+ ["AS", i18n("discourse_subscriptions.subscribe.countries.AS")],
+ ["AD", i18n("discourse_subscriptions.subscribe.countries.AD")],
+ ["AO", i18n("discourse_subscriptions.subscribe.countries.AO")],
+ ["AI", i18n("discourse_subscriptions.subscribe.countries.AI")],
+ ["AQ", i18n("discourse_subscriptions.subscribe.countries.AQ")],
+ ["AG", i18n("discourse_subscriptions.subscribe.countries.AG")],
+ ["AR", i18n("discourse_subscriptions.subscribe.countries.AR")],
+ ["AM", i18n("discourse_subscriptions.subscribe.countries.AM")],
+ ["AW", i18n("discourse_subscriptions.subscribe.countries.AW")],
+ ["AU", i18n("discourse_subscriptions.subscribe.countries.AU")],
+ ["AT", i18n("discourse_subscriptions.subscribe.countries.AT")],
+ ["AZ", i18n("discourse_subscriptions.subscribe.countries.AZ")],
+ ["BS", i18n("discourse_subscriptions.subscribe.countries.BS")],
+ ["BH", i18n("discourse_subscriptions.subscribe.countries.BH")],
+ ["BD", i18n("discourse_subscriptions.subscribe.countries.BD")],
+ ["BB", i18n("discourse_subscriptions.subscribe.countries.BB")],
+ ["BY", i18n("discourse_subscriptions.subscribe.countries.BY")],
+ ["BE", i18n("discourse_subscriptions.subscribe.countries.BE")],
+ ["BZ", i18n("discourse_subscriptions.subscribe.countries.BZ")],
+ ["BJ", i18n("discourse_subscriptions.subscribe.countries.BJ")],
+ ["BM", i18n("discourse_subscriptions.subscribe.countries.BM")],
+ ["BT", i18n("discourse_subscriptions.subscribe.countries.BT")],
+ ["BO", i18n("discourse_subscriptions.subscribe.countries.BO")],
+ ["BQ", i18n("discourse_subscriptions.subscribe.countries.BQ")],
+ ["BA", i18n("discourse_subscriptions.subscribe.countries.BA")],
+ ["BW", i18n("discourse_subscriptions.subscribe.countries.BW")],
+ ["BV", i18n("discourse_subscriptions.subscribe.countries.BV")],
+ ["BR", i18n("discourse_subscriptions.subscribe.countries.BR")],
+ ["IO", i18n("discourse_subscriptions.subscribe.countries.IO")],
+ ["BN", i18n("discourse_subscriptions.subscribe.countries.BN")],
+ ["BG", i18n("discourse_subscriptions.subscribe.countries.BG")],
+ ["BF", i18n("discourse_subscriptions.subscribe.countries.BF")],
+ ["BI", i18n("discourse_subscriptions.subscribe.countries.BI")],
+ ["KH", i18n("discourse_subscriptions.subscribe.countries.KH")],
+ ["CM", i18n("discourse_subscriptions.subscribe.countries.CM")],
+ ["CA", i18n("discourse_subscriptions.subscribe.countries.CA")],
+ ["CV", i18n("discourse_subscriptions.subscribe.countries.CV")],
+ ["KY", i18n("discourse_subscriptions.subscribe.countries.KY")],
+ ["CF", i18n("discourse_subscriptions.subscribe.countries.CF")],
+ ["TD", i18n("discourse_subscriptions.subscribe.countries.TD")],
+ ["CL", i18n("discourse_subscriptions.subscribe.countries.CL")],
+ ["CN", i18n("discourse_subscriptions.subscribe.countries.CN")],
+ ["CX", i18n("discourse_subscriptions.subscribe.countries.CX")],
+ ["CC", i18n("discourse_subscriptions.subscribe.countries.CC")],
+ ["CO", i18n("discourse_subscriptions.subscribe.countries.CO")],
+ ["KM", i18n("discourse_subscriptions.subscribe.countries.KM")],
+ ["CG", i18n("discourse_subscriptions.subscribe.countries.CG")],
+ ["CD", i18n("discourse_subscriptions.subscribe.countries.CD")],
+ ["CK", i18n("discourse_subscriptions.subscribe.countries.CK")],
+ ["CR", i18n("discourse_subscriptions.subscribe.countries.CR")],
+ ["CI", i18n("discourse_subscriptions.subscribe.countries.CI")],
+ ["HR", i18n("discourse_subscriptions.subscribe.countries.HR")],
+ ["CU", i18n("discourse_subscriptions.subscribe.countries.CU")],
+ ["CW", i18n("discourse_subscriptions.subscribe.countries.CW")],
+ ["CY", i18n("discourse_subscriptions.subscribe.countries.CY")],
+ ["CZ", i18n("discourse_subscriptions.subscribe.countries.CZ")],
+ ["DK", i18n("discourse_subscriptions.subscribe.countries.DK")],
+ ["DJ", i18n("discourse_subscriptions.subscribe.countries.DJ")],
+ ["DM", i18n("discourse_subscriptions.subscribe.countries.DM")],
+ ["DO", i18n("discourse_subscriptions.subscribe.countries.DO")],
+ ["EC", i18n("discourse_subscriptions.subscribe.countries.EC")],
+ ["EG", i18n("discourse_subscriptions.subscribe.countries.EG")],
+ ["SV", i18n("discourse_subscriptions.subscribe.countries.SV")],
+ ["GQ", i18n("discourse_subscriptions.subscribe.countries.GQ")],
+ ["ER", i18n("discourse_subscriptions.subscribe.countries.ER")],
+ ["EE", i18n("discourse_subscriptions.subscribe.countries.EE")],
+ ["ET", i18n("discourse_subscriptions.subscribe.countries.ET")],
+ ["FK", i18n("discourse_subscriptions.subscribe.countries.FK")],
+ ["FO", i18n("discourse_subscriptions.subscribe.countries.FO")],
+ ["FJ", i18n("discourse_subscriptions.subscribe.countries.FJ")],
+ ["FI", i18n("discourse_subscriptions.subscribe.countries.FI")],
+ ["FR", i18n("discourse_subscriptions.subscribe.countries.FR")],
+ ["GF", i18n("discourse_subscriptions.subscribe.countries.GF")],
+ ["PF", i18n("discourse_subscriptions.subscribe.countries.PF")],
+ ["TF", i18n("discourse_subscriptions.subscribe.countries.TF")],
+ ["GA", i18n("discourse_subscriptions.subscribe.countries.GA")],
+ ["GM", i18n("discourse_subscriptions.subscribe.countries.GM")],
+ ["GE", i18n("discourse_subscriptions.subscribe.countries.GE")],
+ ["DE", i18n("discourse_subscriptions.subscribe.countries.DE")],
+ ["GH", i18n("discourse_subscriptions.subscribe.countries.GH")],
+ ["GI", i18n("discourse_subscriptions.subscribe.countries.GI")],
+ ["GR", i18n("discourse_subscriptions.subscribe.countries.GR")],
+ ["GL", i18n("discourse_subscriptions.subscribe.countries.GL")],
+ ["GD", i18n("discourse_subscriptions.subscribe.countries.GD")],
+ ["GP", i18n("discourse_subscriptions.subscribe.countries.GP")],
+ ["GU", i18n("discourse_subscriptions.subscribe.countries.GU")],
+ ["GT", i18n("discourse_subscriptions.subscribe.countries.GT")],
+ ["GG", i18n("discourse_subscriptions.subscribe.countries.GG")],
+ ["GN", i18n("discourse_subscriptions.subscribe.countries.GN")],
+ ["GW", i18n("discourse_subscriptions.subscribe.countries.GW")],
+ ["GY", i18n("discourse_subscriptions.subscribe.countries.GY")],
+ ["HT", i18n("discourse_subscriptions.subscribe.countries.HT")],
+ ["HM", i18n("discourse_subscriptions.subscribe.countries.HM")],
+ ["VA", i18n("discourse_subscriptions.subscribe.countries.VA")],
+ ["HN", i18n("discourse_subscriptions.subscribe.countries.HN")],
+ ["HK", i18n("discourse_subscriptions.subscribe.countries.HK")],
+ ["HU", i18n("discourse_subscriptions.subscribe.countries.HU")],
+ ["IS", i18n("discourse_subscriptions.subscribe.countries.IS")],
+ ["IN", i18n("discourse_subscriptions.subscribe.countries.IN")],
+ ["ID", i18n("discourse_subscriptions.subscribe.countries.ID")],
+ ["IR", i18n("discourse_subscriptions.subscribe.countries.IR")],
+ ["IQ", i18n("discourse_subscriptions.subscribe.countries.IQ")],
+ ["IE", i18n("discourse_subscriptions.subscribe.countries.IE")],
+ ["IM", i18n("discourse_subscriptions.subscribe.countries.IM")],
+ ["IL", i18n("discourse_subscriptions.subscribe.countries.IL")],
+ ["IT", i18n("discourse_subscriptions.subscribe.countries.IT")],
+ ["JM", i18n("discourse_subscriptions.subscribe.countries.JM")],
+ ["JP", i18n("discourse_subscriptions.subscribe.countries.JP")],
+ ["JE", i18n("discourse_subscriptions.subscribe.countries.JE")],
+ ["JO", i18n("discourse_subscriptions.subscribe.countries.JO")],
+ ["KZ", i18n("discourse_subscriptions.subscribe.countries.KZ")],
+ ["KE", i18n("discourse_subscriptions.subscribe.countries.KE")],
+ ["KI", i18n("discourse_subscriptions.subscribe.countries.KI")],
+ ["KP", i18n("discourse_subscriptions.subscribe.countries.KP")],
+ ["KR", i18n("discourse_subscriptions.subscribe.countries.KR")],
+ ["KW", i18n("discourse_subscriptions.subscribe.countries.KW")],
+ ["KG", i18n("discourse_subscriptions.subscribe.countries.KG")],
+ ["LA", i18n("discourse_subscriptions.subscribe.countries.LA")],
+ ["LV", i18n("discourse_subscriptions.subscribe.countries.LV")],
+ ["LB", i18n("discourse_subscriptions.subscribe.countries.LB")],
+ ["LS", i18n("discourse_subscriptions.subscribe.countries.LS")],
+ ["LR", i18n("discourse_subscriptions.subscribe.countries.LR")],
+ ["LY", i18n("discourse_subscriptions.subscribe.countries.LY")],
+ ["LI", i18n("discourse_subscriptions.subscribe.countries.LI")],
+ ["LT", i18n("discourse_subscriptions.subscribe.countries.LT")],
+ ["LU", i18n("discourse_subscriptions.subscribe.countries.LU")],
+ ["MO", i18n("discourse_subscriptions.subscribe.countries.MO")],
+ ["MK", i18n("discourse_subscriptions.subscribe.countries.MK")],
+ ["MG", i18n("discourse_subscriptions.subscribe.countries.MG")],
+ ["MW", i18n("discourse_subscriptions.subscribe.countries.MW")],
+ ["MY", i18n("discourse_subscriptions.subscribe.countries.MY")],
+ ["MV", i18n("discourse_subscriptions.subscribe.countries.MV")],
+ ["ML", i18n("discourse_subscriptions.subscribe.countries.ML")],
+ ["MT", i18n("discourse_subscriptions.subscribe.countries.MT")],
+ ["MH", i18n("discourse_subscriptions.subscribe.countries.MH")],
+ ["MQ", i18n("discourse_subscriptions.subscribe.countries.MQ")],
+ ["MR", i18n("discourse_subscriptions.subscribe.countries.MR")],
+ ["MU", i18n("discourse_subscriptions.subscribe.countries.MU")],
+ ["YT", i18n("discourse_subscriptions.subscribe.countries.YT")],
+ ["MX", i18n("discourse_subscriptions.subscribe.countries.MX")],
+ ["FM", i18n("discourse_subscriptions.subscribe.countries.FM")],
+ ["MD", i18n("discourse_subscriptions.subscribe.countries.MD")],
+ ["MC", i18n("discourse_subscriptions.subscribe.countries.MC")],
+ ["MN", i18n("discourse_subscriptions.subscribe.countries.MN")],
+ ["ME", i18n("discourse_subscriptions.subscribe.countries.ME")],
+ ["MS", i18n("discourse_subscriptions.subscribe.countries.MS")],
+ ["MA", i18n("discourse_subscriptions.subscribe.countries.MA")],
+ ["MZ", i18n("discourse_subscriptions.subscribe.countries.MZ")],
+ ["MM", i18n("discourse_subscriptions.subscribe.countries.MM")],
+ ["NA", i18n("discourse_subscriptions.subscribe.countries.NA")],
+ ["NR", i18n("discourse_subscriptions.subscribe.countries.NR")],
+ ["NP", i18n("discourse_subscriptions.subscribe.countries.NP")],
+ ["NL", i18n("discourse_subscriptions.subscribe.countries.NL")],
+ ["NC", i18n("discourse_subscriptions.subscribe.countries.NC")],
+ ["NZ", i18n("discourse_subscriptions.subscribe.countries.NZ")],
+ ["NI", i18n("discourse_subscriptions.subscribe.countries.NI")],
+ ["NE", i18n("discourse_subscriptions.subscribe.countries.NE")],
+ ["NG", i18n("discourse_subscriptions.subscribe.countries.NG")],
+ ["NU", i18n("discourse_subscriptions.subscribe.countries.NU")],
+ ["NF", i18n("discourse_subscriptions.subscribe.countries.NF")],
+ ["MP", i18n("discourse_subscriptions.subscribe.countries.MP")],
+ ["NO", i18n("discourse_subscriptions.subscribe.countries.NO")],
+ ["OM", i18n("discourse_subscriptions.subscribe.countries.OM")],
+ ["PK", i18n("discourse_subscriptions.subscribe.countries.PK")],
+ ["PW", i18n("discourse_subscriptions.subscribe.countries.PW")],
+ ["PS", i18n("discourse_subscriptions.subscribe.countries.PS")],
+ ["PA", i18n("discourse_subscriptions.subscribe.countries.PA")],
+ ["PG", i18n("discourse_subscriptions.subscribe.countries.PG")],
+ ["PY", i18n("discourse_subscriptions.subscribe.countries.PY")],
+ ["PE", i18n("discourse_subscriptions.subscribe.countries.PE")],
+ ["PH", i18n("discourse_subscriptions.subscribe.countries.PH")],
+ ["PN", i18n("discourse_subscriptions.subscribe.countries.PN")],
+ ["PL", i18n("discourse_subscriptions.subscribe.countries.PL")],
+ ["PT", i18n("discourse_subscriptions.subscribe.countries.PT")],
+ ["PR", i18n("discourse_subscriptions.subscribe.countries.PR")],
+ ["QA", i18n("discourse_subscriptions.subscribe.countries.QA")],
+ ["RE", i18n("discourse_subscriptions.subscribe.countries.RE")],
+ ["RO", i18n("discourse_subscriptions.subscribe.countries.RO")],
+ ["RU", i18n("discourse_subscriptions.subscribe.countries.RU")],
+ ["RW", i18n("discourse_subscriptions.subscribe.countries.RW")],
+ ["BL", i18n("discourse_subscriptions.subscribe.countries.BL")],
+ ["SH", i18n("discourse_subscriptions.subscribe.countries.SH")],
+ ["KN", i18n("discourse_subscriptions.subscribe.countries.KN")],
+ ["LC", i18n("discourse_subscriptions.subscribe.countries.LC")],
+ ["MF", i18n("discourse_subscriptions.subscribe.countries.MF")],
+ ["PM", i18n("discourse_subscriptions.subscribe.countries.PM")],
+ ["VC", i18n("discourse_subscriptions.subscribe.countries.VC")],
+ ["WS", i18n("discourse_subscriptions.subscribe.countries.WS")],
+ ["SM", i18n("discourse_subscriptions.subscribe.countries.SM")],
+ ["ST", i18n("discourse_subscriptions.subscribe.countries.ST")],
+ ["SA", i18n("discourse_subscriptions.subscribe.countries.SA")],
+ ["SN", i18n("discourse_subscriptions.subscribe.countries.SN")],
+ ["RS", i18n("discourse_subscriptions.subscribe.countries.RS")],
+ ["SC", i18n("discourse_subscriptions.subscribe.countries.SC")],
+ ["SL", i18n("discourse_subscriptions.subscribe.countries.SL")],
+ ["SG", i18n("discourse_subscriptions.subscribe.countries.SG")],
+ ["SX", i18n("discourse_subscriptions.subscribe.countries.SX")],
+ ["SK", i18n("discourse_subscriptions.subscribe.countries.SK")],
+ ["SI", i18n("discourse_subscriptions.subscribe.countries.SI")],
+ ["SB", i18n("discourse_subscriptions.subscribe.countries.SB")],
+ ["SO", i18n("discourse_subscriptions.subscribe.countries.SO")],
+ ["ZA", i18n("discourse_subscriptions.subscribe.countries.ZA")],
+ ["GS", i18n("discourse_subscriptions.subscribe.countries.GS")],
+ ["SS", i18n("discourse_subscriptions.subscribe.countries.SS")],
+ ["ES", i18n("discourse_subscriptions.subscribe.countries.ES")],
+ ["LK", i18n("discourse_subscriptions.subscribe.countries.LK")],
+ ["SD", i18n("discourse_subscriptions.subscribe.countries.SD")],
+ ["SR", i18n("discourse_subscriptions.subscribe.countries.SR")],
+ ["SJ", i18n("discourse_subscriptions.subscribe.countries.SJ")],
+ ["SZ", i18n("discourse_subscriptions.subscribe.countries.SZ")],
+ ["SE", i18n("discourse_subscriptions.subscribe.countries.SE")],
+ ["CH", i18n("discourse_subscriptions.subscribe.countries.CH")],
+ ["SY", i18n("discourse_subscriptions.subscribe.countries.SY")],
+ ["TW", i18n("discourse_subscriptions.subscribe.countries.TW")],
+ ["TJ", i18n("discourse_subscriptions.subscribe.countries.TJ")],
+ ["TZ", i18n("discourse_subscriptions.subscribe.countries.TZ")],
+ ["TH", i18n("discourse_subscriptions.subscribe.countries.TH")],
+ ["TL", i18n("discourse_subscriptions.subscribe.countries.TL")],
+ ["TG", i18n("discourse_subscriptions.subscribe.countries.TG")],
+ ["TK", i18n("discourse_subscriptions.subscribe.countries.TK")],
+ ["TO", i18n("discourse_subscriptions.subscribe.countries.TO")],
+ ["TT", i18n("discourse_subscriptions.subscribe.countries.TT")],
+ ["TN", i18n("discourse_subscriptions.subscribe.countries.TN")],
+ ["TR", i18n("discourse_subscriptions.subscribe.countries.TR")],
+ ["TM", i18n("discourse_subscriptions.subscribe.countries.TM")],
+ ["TC", i18n("discourse_subscriptions.subscribe.countries.TC")],
+ ["TV", i18n("discourse_subscriptions.subscribe.countries.TV")],
+ ["UG", i18n("discourse_subscriptions.subscribe.countries.UG")],
+ ["UA", i18n("discourse_subscriptions.subscribe.countries.UA")],
+ ["AE", i18n("discourse_subscriptions.subscribe.countries.AE")],
+ ["GB", i18n("discourse_subscriptions.subscribe.countries.GB")],
+ ["US", i18n("discourse_subscriptions.subscribe.countries.US")],
+ ["UM", i18n("discourse_subscriptions.subscribe.countries.UM")],
+ ["UY", i18n("discourse_subscriptions.subscribe.countries.UY")],
+ ["UZ", i18n("discourse_subscriptions.subscribe.countries.UZ")],
+ ["VU", i18n("discourse_subscriptions.subscribe.countries.VU")],
+ ["VE", i18n("discourse_subscriptions.subscribe.countries.VE")],
+ ["VN", i18n("discourse_subscriptions.subscribe.countries.VN")],
+ ["VG", i18n("discourse_subscriptions.subscribe.countries.VG")],
+ ["VI", i18n("discourse_subscriptions.subscribe.countries.VI")],
+ ["WF", i18n("discourse_subscriptions.subscribe.countries.WF")],
+ ["EH", i18n("discourse_subscriptions.subscribe.countries.EH")],
+ ["YE", i18n("discourse_subscriptions.subscribe.countries.YE")],
+ ["ZM", i18n("discourse_subscriptions.subscribe.countries.ZM")],
+ ["ZW", i18n("discourse_subscriptions.subscribe.countries.ZW")],
+ ].map((arr) => {
+ return { value: arr[0], name: arr[1] };
+ });
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/components/subscribe-us-state-select.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/components/subscribe-us-state-select.js
new file mode 100644
index 00000000000..1836aad8024
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/components/subscribe-us-state-select.js
@@ -0,0 +1,93 @@
+import { computed } from "@ember/object";
+import { classNames } from "@ember-decorators/component";
+import { i18n } from "discourse-i18n";
+import ComboBoxComponent from "select-kit/components/combo-box";
+import {
+ pluginApiIdentifiers,
+ selectKitOptions,
+} from "select-kit/components/select-kit";
+
+@pluginApiIdentifiers("subscribe-us-state-select")
+@selectKitOptions({
+ filterable: true,
+ allowAny: false,
+ translatedNone: i18n(
+ "discourse_subscriptions.subscribe.cardholder_address.state"
+ ),
+})
+@classNames("subscribe-address-state-select")
+export default class SubscribeUsStateSelect extends ComboBoxComponent {
+ nameProperty = "name";
+ valueProperty = "value";
+
+ @computed
+ get content() {
+ return [
+ ["AL", "Alabama"],
+ ["AK", "Alaska"],
+ ["AZ", "Arizona"],
+ ["AR", "Arkansas"],
+ ["CA", "California"],
+ ["CO", "Colorado"],
+ ["CT", "Connecticut"],
+ ["DE", "Delaware"],
+ ["US", "District"],
+ ["FL", "Florida"],
+ ["GA", "Georgia"],
+ ["HI", "Hawaii"],
+ ["ID", "Idaho"],
+ ["IL", "Illinois"],
+ ["IN", "Indiana"],
+ ["IA", "Iowa"],
+ ["KS", "Kansas"],
+ ["KY", "Kentucky"],
+ ["LA", "Louisiana"],
+ ["ME", "Maine"],
+ ["MD", "Maryland"],
+ ["MA", "Massachusetts"],
+ ["MI", "Michigan"],
+ ["MN", "Minnesota"],
+ ["MS", "Mississippi"],
+ ["MO", "Missouri"],
+ ["MT", "Montana"],
+ ["NE", "Nebraska"],
+ ["NV", "Nevada"],
+ ["NH", "New Hampshire"],
+ ["NJ", "New Jersey"],
+ ["NM", "New Mexico"],
+ ["NY", "New York"],
+ ["NC", "North Carolina"],
+ ["ND", "North Dakota"],
+ ["OH", "Ohio"],
+ ["OK", "Oklahoma"],
+ ["OR", "Oregon"],
+ ["PA", "Pennsylvania"],
+ ["RI", "Rhode"],
+ ["SC", "South"],
+ ["SD", "South"],
+ ["TN", "Tennessee"],
+ ["TX", "Texas"],
+ ["UT", "Utah"],
+ ["VT", "Vermont"],
+ ["VA", "Virginia"],
+ ["WA", "Washington"],
+ ["WV", "West"],
+ ["WI", "Wisconsin"],
+ ["WY", "Wyoming"],
+ ["AS", "American Samoa"],
+ ["GU", "Guam"],
+ ["MP", "Northern Mariana Islands"],
+ ["PR", "Puerto Rico"],
+ ["VI", "U.S. Virgin Islands"],
+ ["UM", "U.S. Minor Outlying Islands"],
+ ["MH", "Marshall Islands"],
+ ["FM", "Micronesia"],
+ ["PW", "Palau"],
+ ["AA", "U.S. Armed Forces – Americas"],
+ ["AE", "U.S. Armed Forces – Europe"],
+ ["AP", "U.S. Armed Forces – Pacific"],
+ ].map((arr) => {
+ return { value: arr[0], name: arr[1] };
+ });
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/connectors/above-main-container/subscriptions-campaign.gjs b/plugins/discourse-subscriptions/assets/javascripts/discourse/connectors/above-main-container/subscriptions-campaign.gjs
new file mode 100644
index 00000000000..c0265d0c2e6
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/connectors/above-main-container/subscriptions-campaign.gjs
@@ -0,0 +1,19 @@
+import Component from "@ember/component";
+import { classNames, tagName } from "@ember-decorators/component";
+import CampaignBanner from "../../components/campaign-banner";
+
+@tagName("div")
+@classNames("above-main-container-outlet", "subscriptions-campaign")
+export default class SubscriptionsCampaign extends Component {
+ static shouldRender(args, context) {
+ const { siteSettings } = context;
+ const mobileView = context.site.mobileView;
+ const bannerLocation =
+ siteSettings.discourse_subscriptions_campaign_banner_location;
+ return (
+ bannerLocation === "Top" || (bannerLocation === "Sidebar" && mobileView)
+ );
+ }
+
+ <template><CampaignBanner @connectorName="above-main-container" /></template>
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/connectors/after-topic-footer-buttons/subscriptions-campaign-topic-footer.gjs b/plugins/discourse-subscriptions/assets/javascripts/discourse/connectors/after-topic-footer-buttons/subscriptions-campaign-topic-footer.gjs
new file mode 100644
index 00000000000..5a169402efb
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/connectors/after-topic-footer-buttons/subscriptions-campaign-topic-footer.gjs
@@ -0,0 +1,21 @@
+import Component from "@ember/component";
+import { classNames, tagName } from "@ember-decorators/component";
+import CampaignBanner from "../../components/campaign-banner";
+
+@tagName("span")
+@classNames(
+ "after-topic-footer-buttons-outlet",
+ "subscriptions-campaign-topic-footer"
+)
+export default class SubscriptionsCampaignTopicFooter extends Component {
+ static shouldRender(args, context) {
+ const { siteSettings } = context;
+ const bannerLocation =
+ siteSettings.discourse_subscriptions_campaign_banner_location;
+ return bannerLocation === "Top" || bannerLocation === "Sidebar";
+ }
+
+ <template>
+ <CampaignBanner @connectorName="after-topic-footer-buttons" />
+ </template>
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/connectors/before-topic-list/subscriptions-campaign-sidebar.gjs b/plugins/discourse-subscriptions/assets/javascripts/discourse/connectors/before-topic-list/subscriptions-campaign-sidebar.gjs
new file mode 100644
index 00000000000..fa4f0eb5c2c
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/connectors/before-topic-list/subscriptions-campaign-sidebar.gjs
@@ -0,0 +1,17 @@
+import Component from "@ember/component";
+import { classNames, tagName } from "@ember-decorators/component";
+import CampaignBanner from "../../components/campaign-banner";
+
+@tagName("div")
+@classNames("before-topic-list-outlet", "subscriptions-campaign-sidebar")
+export default class SubscriptionsCampaignSidebar extends Component {
+ static shouldRender(args, context) {
+ const { siteSettings } = context;
+ const mobileView = context.site.mobileView;
+ const bannerLocation =
+ siteSettings.discourse_subscriptions_campaign_banner_location;
+ return bannerLocation === "Sidebar" && !mobileView;
+ }
+
+ <template><CampaignBanner @connectorName="before-topic-list" /></template>
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/connectors/user-main-nav/billing.gjs b/plugins/discourse-subscriptions/assets/javascripts/discourse/connectors/user-main-nav/billing.gjs
new file mode 100644
index 00000000000..6fc29ad3ecc
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/connectors/user-main-nav/billing.gjs
@@ -0,0 +1,29 @@
+import Component from "@ember/component";
+import { LinkTo } from "@ember/routing";
+import { service } from "@ember/service";
+import { classNames, tagName } from "@ember-decorators/component";
+import icon from "discourse/helpers/d-icon";
+import { i18n } from "discourse-i18n";
+
+@tagName("li")
+@classNames("user-main-nav-outlet", "billing")
+export default class Billing extends Component {
+ @service currentUser;
+
+ get viewingSelf() {
+ return (
+ this.currentUser &&
+ this.currentUser.username.toLowerCase() ===
+ this.model.username.toLowerCase()
+ );
+ }
+
+ <template>
+ {{#if this.viewingSelf}}
+ <LinkTo @route="user.billing">
+ {{icon "far-credit-card"}}
+ {{i18n "discourse_subscriptions.navigation.billing"}}
+ </LinkTo>
+ {{/if}}
+ </template>
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-coupons.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-coupons.js
new file mode 100644
index 00000000000..78f3b072b69
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-coupons.js
@@ -0,0 +1,50 @@
+import Controller from "@ember/controller";
+import { action } from "@ember/object";
+import { popupAjaxError } from "discourse/lib/ajax-error";
+import AdminCoupon from "discourse/plugins/discourse-subscriptions/discourse/models/admin-coupon";
+
+export default class AdminPluginsDiscourseSubscriptionsCouponsController extends Controller {
+ creating = null;
+
+ @action
+ openCreateForm() {
+ this.set("creating", true);
+ }
+
+ @action
+ closeCreateForm() {
+ this.set("creating", false);
+ }
+
+ @action
+ createNewCoupon(params) {
+ AdminCoupon.save(params)
+ .then(() => {
+ this.send("closeCreateForm");
+ this.send("reloadModel");
+ })
+ .catch(popupAjaxError);
+ }
+
+ @action
+ deleteCoupon(coupon) {
+ AdminCoupon.destroy(coupon)
+ .then(() => {
+ this.send("reloadModel");
+ })
+ .catch(popupAjaxError);
+ }
+
+ @action
+ toggleActive(coupon) {
+ const couponData = {
+ id: coupon.id,
+ active: !coupon.active,
+ };
+ AdminCoupon.update(couponData)
+ .then(() => {
+ this.send("reloadModel");
+ })
+ .catch(popupAjaxError);
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-dashboard.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-dashboard.js
new file mode 100644
index 00000000000..651532c1fcb
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-dashboard.js
@@ -0,0 +1,20 @@
+import Controller from "@ember/controller";
+import { action } from "@ember/object";
+
+export default class AdminPluginsDiscourseSubscriptionsDashboardController extends Controller {
+ queryParams = ["order", "descending"];
+ order = null;
+ descending = true;
+
+ @action
+ loadMore() {}
+
+ @action
+ orderPayments(order) {
+ if (order === this.get("order")) {
+ this.toggleProperty("descending");
+ }
+
+ this.set("order", order);
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-plans-index.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-plans-index.js
new file mode 100644
index 00000000000..7289c985d0b
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-plans-index.js
@@ -0,0 +1,12 @@
+import Controller from "@ember/controller";
+import { action } from "@ember/object";
+import DiscourseURL from "discourse/lib/url";
+
+export default class AdminPluginsDiscourseSubscriptionsPlansIndexController extends Controller {
+ @action
+ editPlan(id) {
+ return DiscourseURL.redirectTo(
+ `/admin/plugins/discourse-subscriptions/plans/${id}`
+ );
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-plans-show.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-plans-show.js
new file mode 100644
index 00000000000..78286a90279
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-plans-show.js
@@ -0,0 +1,23 @@
+import Controller from "@ember/controller";
+import { action } from "@ember/object";
+import { service } from "@ember/service";
+import { popupAjaxError } from "discourse/lib/ajax-error";
+
+export default class AdminPluginsDiscourseSubscriptionsPlansShowController extends Controller {
+ @service router;
+
+ @action
+ createPlan() {
+ if (this.get("model.plan.product_id") === undefined) {
+ const productID = this.get("model.products.firstObject.id");
+ this.set("model.plan.product_id", productID);
+ }
+
+ this.get("model.plan")
+ .save()
+ .then(() => {
+ this.router.transitionTo("adminPlugins.discourse-subscriptions.plans");
+ })
+ .catch(popupAjaxError);
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-plans.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-plans.js
new file mode 100644
index 00000000000..f25271523df
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-plans.js
@@ -0,0 +1,3 @@
+import Controller from "@ember/controller";
+
+export default class AdminPluginsDiscourseSubscriptionsPlansController extends Controller {}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-products-index.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-products-index.js
new file mode 100644
index 00000000000..695c80c5ea0
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-products-index.js
@@ -0,0 +1,3 @@
+import Controller from "@ember/controller";
+
+export default class AdminPluginsDiscourseSubscriptionsProductsIndexController extends Controller {}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-products-show-plans-show.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-products-show-plans-show.js
new file mode 100644
index 00000000000..e3226bcd458
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-products-show-plans-show.js
@@ -0,0 +1,107 @@
+import Controller from "@ember/controller";
+import { action } from "@ember/object";
+import { alias } from "@ember/object/computed";
+import { popupAjaxError } from "discourse/lib/ajax-error";
+import discourseComputed from "discourse/lib/decorators";
+import DiscourseURL from "discourse/lib/url";
+
+const RECURRING = "recurring";
+const ONE_TIME = "one_time";
+
+export default class AdminPluginsDiscourseSubscriptionsProductsShowPlansShowController extends Controller {
+ // Also defined in settings.
+ @alias("model.plan.currency") selectedCurrency;
+ @alias("model.plan.interval") selectedInterval;
+
+ @discourseComputed("model.plan.metadata.group_name")
+ selectedGroup(groupName) {
+ return groupName || "no-group";
+ }
+
+ @discourseComputed("model.groups")
+ availableGroups(groups) {
+ return [
+ {
+ id: null,
+ name: "no-group",
+ },
+ ...groups,
+ ];
+ }
+
+ @discourseComputed
+ currencies() {
+ return [
+ { id: "AUD", name: "AUD" },
+ { id: "CAD", name: "CAD" },
+ { id: "EUR", name: "EUR" },
+ { id: "GBP", name: "GBP" },
+ { id: "USD", name: "USD" },
+ { id: "INR", name: "INR" },
+ { id: "BRL", name: "BRL" },
+ { id: "DKK", name: "DKK" },
+ { id: "SGD", name: "SGD" },
+ { id: "JPY", name: "JPY" },
+ { id: "ZAR", name: "ZAR" },
+ { id: "CHF", name: "CHF" },
+ { id: "PLN", name: "PLN" },
+ { id: "CZK", name: "CZK" },
+ { id: "SEK", name: "SEK" },
+ ];
+ }
+
+ @discourseComputed
+ availableIntervals() {
+ return [
+ { id: "day", name: "day" },
+ { id: "week", name: "week" },
+ { id: "month", name: "month" },
+ { id: "year", name: "year" },
+ ];
+ }
+
+ @discourseComputed("model.plan.isNew")
+ planFieldDisabled(isNew) {
+ return !isNew;
+ }
+
+ @discourseComputed("model.product.id")
+ productId(id) {
+ return id;
+ }
+
+ redirect(product_id) {
+ DiscourseURL.redirectTo(
+ `/admin/plugins/discourse-subscriptions/products/${product_id}`
+ );
+ }
+
+ @action
+ changeRecurring() {
+ const recurring = this.get("model.plan.isRecurring");
+ this.set("model.plan.type", recurring ? ONE_TIME : RECURRING);
+ this.set("model.plan.isRecurring", !recurring);
+ }
+
+ @action
+ createPlan() {
+ if (this.model.plan.metadata.group_name === "no-group") {
+ this.set("model.plan.metadata.group_name", null);
+ }
+ this.get("model.plan")
+ .save()
+ .then(() => this.redirect(this.productId))
+ .catch(popupAjaxError);
+ }
+
+ @action
+ updatePlan() {
+ if (this.model.plan.metadata.group_name === "no-group") {
+ this.set("model.plan.metadata.group_name", null);
+ }
+ this.get("model.plan")
+ .update()
+ .then(() => this.redirect(this.productId))
+ .catch(popupAjaxError);
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-products-show.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-products-show.js
new file mode 100644
index 00000000000..cf32804ce80
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-products-show.js
@@ -0,0 +1,38 @@
+import Controller from "@ember/controller";
+import { action } from "@ember/object";
+import { service } from "@ember/service";
+import { popupAjaxError } from "discourse/lib/ajax-error";
+
+export default class AdminPluginsDiscourseSubscriptionsProductsShowController extends Controller {
+ @service router;
+
+ @action
+ cancelProduct() {
+ this.router.transitionTo("adminPlugins.discourse-subscriptions.products");
+ }
+
+ @action
+ createProduct() {
+ this.get("model.product")
+ .save()
+ .then((product) => {
+ this.router.transitionTo(
+ "adminPlugins.discourse-subscriptions.products.show",
+ product.id
+ );
+ })
+ .catch(popupAjaxError);
+ }
+
+ @action
+ updateProduct() {
+ this.get("model.product")
+ .update()
+ .then(() => {
+ this.router.transitionTo(
+ "adminPlugins.discourse-subscriptions.products"
+ );
+ })
+ .catch(popupAjaxError);
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-subscriptions.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-subscriptions.js
new file mode 100644
index 00000000000..cf4f398b48f
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-subscriptions.js
@@ -0,0 +1,61 @@
+import Controller from "@ember/controller";
+import { action } from "@ember/object";
+import { service } from "@ember/service";
+import { i18n } from "discourse-i18n";
+import AdminCancelSubscription from "../components/modal/admin-cancel-subscription";
+import AdminSubscription from "../models/admin-subscription";
+
+export default class AdminPluginsDiscourseSubscriptionsSubscriptionsController extends Controller {
+ @service modal;
+ @service dialog;
+
+ loading = false;
+
+ @action
+ showCancelModal(subscription) {
+ this.modal.show(AdminCancelSubscription, {
+ model: {
+ subscription,
+ cancelSubscription: this.cancelSubscription,
+ },
+ });
+ }
+
+ @action
+ loadMore() {
+ if (!this.loading && this.model.has_more) {
+ this.set("loading", true);
+
+ return AdminSubscription.loadMore(this.model.last_record).then(
+ (result) => {
+ const updated = this.model.data.concat(result.data);
+ this.set("model", result);
+ this.set("model.data", updated);
+ this.set("loading", false);
+ }
+ );
+ }
+ }
+
+ @action
+ cancelSubscription(model) {
+ const subscription = model.subscription;
+ const refund = model.refund;
+ const closeModal = model.closeModal;
+
+ subscription.set("loading", true);
+ subscription
+ .destroy(refund)
+ .then((result) => {
+ subscription.set("status", result.status);
+ this.dialog.alert(i18n("discourse_subscriptions.admin.canceled"));
+ })
+ .catch((data) =>
+ this.dialog.alert(data.jqXHR.responseJSON.errors.join("\n"))
+ )
+ .finally(() => {
+ subscription.set("loading", false);
+ closeModal();
+ });
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions.js
new file mode 100644
index 00000000000..77ebf18bba8
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions.js
@@ -0,0 +1,65 @@
+import Controller from "@ember/controller";
+import { action } from "@ember/object";
+import { service } from "@ember/service";
+import { htmlSafe } from "@ember/template";
+import { ajax } from "discourse/lib/ajax";
+import { popupAjaxError } from "discourse/lib/ajax-error";
+import discourseComputed from "discourse/lib/decorators";
+import { i18n } from "discourse-i18n";
+
+export default class AdminPluginsDiscourseSubscriptionsController extends Controller {
+ @service dialog;
+
+ loading = false;
+
+ @discourseComputed
+ stripeConfigured() {
+ return !!this.siteSettings.discourse_subscriptions_public_key;
+ }
+
+ @discourseComputed
+ campaignEnabled() {
+ return this.siteSettings.discourse_subscriptions_campaign_enabled;
+ }
+
+ @discourseComputed
+ campaignProductSet() {
+ return !!this.siteSettings.discourse_subscriptions_campaign_product;
+ }
+
+ @action
+ triggerManualRefresh() {
+ ajax(`/s/admin/refresh`, {
+ method: "post",
+ }).then(() => {
+ this.dialog.alert(i18n("discourse_subscriptions.campaign.refresh_page"));
+ });
+ }
+
+ @action
+ createOneClickCampaign() {
+ this.dialog.yesNoConfirm({
+ title: i18n("discourse_subscriptions.campaign.confirm_creation_title"),
+ message: htmlSafe(
+ i18n("discourse_subscriptions.campaign.confirm_creation")
+ ),
+ didConfirm: () => {
+ this.set("loading", true);
+
+ ajax(`/s/admin/create-campaign`, {
+ method: "post",
+ })
+ .then(() => {
+ this.set("loading", false);
+ this.dialog.confirm({
+ message: i18n("discourse_subscriptions.campaign.created"),
+ shouldDisplayCancel: false,
+ didConfirm: () => this.send("showSettings"),
+ didCancel: () => this.send("showSettings"),
+ });
+ })
+ .catch(popupAjaxError);
+ },
+ });
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/subscribe-index.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/subscribe-index.js
new file mode 100644
index 00000000000..55dfc4dda32
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/subscribe-index.js
@@ -0,0 +1,10 @@
+import Controller from "@ember/controller";
+import discourseComputed from "discourse/lib/decorators";
+import User from "discourse/models/user";
+
+export default class SubscribeIndexController extends Controller {
+ @discourseComputed()
+ isLoggedIn() {
+ return User.current();
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/subscribe-show.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/subscribe-show.js
new file mode 100644
index 00000000000..3ce624c382e
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/subscribe-show.js
@@ -0,0 +1,195 @@
+/* global Stripe */
+import Controller from "@ember/controller";
+import { action } from "@ember/object";
+import { not } from "@ember/object/computed";
+import { service } from "@ember/service";
+import discourseComputed from "discourse/lib/decorators";
+import { i18n } from "discourse-i18n";
+import Subscription from "discourse/plugins/discourse-subscriptions/discourse/models/subscription";
+import Transaction from "discourse/plugins/discourse-subscriptions/discourse/models/transaction";
+
+export default class SubscribeShowController extends Controller {
+ @service dialog;
+ @service router;
+
+ selectedPlan = null;
+ promoCode = null;
+ cardholderName = null;
+ cardholderAddress = {
+ line1: null,
+ city: null,
+ state: null,
+ country: null,
+ postalCode: null,
+ };
+
+ @not("currentUser") isAnonymous;
+
+ isCountryUS = false;
+ isCountryCA = false;
+
+ init() {
+ super.init(...arguments);
+ this.set(
+ "stripe",
+ Stripe(this.siteSettings.discourse_subscriptions_public_key)
+ );
+ const elements = this.get("stripe").elements();
+
+ this.set("cardElement", elements.create("card", { hidePostalCode: true }));
+
+ this.set("isCountryUS", this.cardholderAddress.country === "US");
+ this.set("isCountryCA", this.cardholderAddress.country === "CA");
+ }
+
+ alert(path) {
+ this.dialog.alert(i18n(`discourse_subscriptions.${path}`));
+ }
+
+ @discourseComputed("model.product.repurchaseable", "model.product.subscribed")
+ canPurchase(repurchaseable, subscribed) {
+ if (!repurchaseable && subscribed) {
+ return false;
+ }
+
+ return true;
+ }
+
+ createSubscription(plan) {
+ return this.stripe
+ .createToken(this.get("cardElement"), {
+ name: this.cardholderName, // Recommended by Stripe
+ address_line1: this.cardholderAddress.line1 ?? "",
+ address_city: this.cardholderAddress.city ?? "",
+ address_state: this.cardholderAddress.state ?? "",
+ address_zip: this.cardholderAddress.postalCode ?? "",
+ address_country: this.cardholderAddress.country, // Recommended by Stripe
+ })
+ .then((result) => {
+ if (result.error) {
+ this.set("loading", false);
+ return result;
+ } else {
+ const subscription = Subscription.create({
+ source: result.token.id,
+ plan: plan.get("id"),
+ promo: this.promoCode,
+ cardholderName: this.cardholderName,
+ cardholderAddress: this.cardholderAddress,
+ });
+
+ return subscription.save();
+ }
+ });
+ }
+
+ handleAuthentication(plan, transaction) {
+ return this.stripe
+ .confirmCardPayment(transaction.payment_intent.client_secret)
+ .then((result) => {
+ if (
+ result.paymentIntent &&
+ result.paymentIntent.status === "succeeded"
+ ) {
+ return result;
+ } else {
+ this.set("loading", false);
+ this.dialog.alert(result.error.message || result.error);
+ return result;
+ }
+ });
+ }
+
+ _advanceSuccessfulTransaction(plan) {
+ this.alert("plans.success");
+ this.set("loading", false);
+
+ this.router.transitionTo(
+ plan.type === "recurring"
+ ? "user.billing.subscriptions"
+ : "user.billing.payments",
+ this.currentUser.username.toLowerCase()
+ );
+ }
+
+ @action
+ changeCountry(country) {
+ this.set("cardholderAddress.country", country);
+ this.set("isCountryUS", country === "US");
+ this.set("isCountryCA", country === "CA");
+ }
+
+ @action
+ changeState(stateOrProvince) {
+ this.set("cardholderAddress.state", stateOrProvince);
+ }
+
+ @action
+ stripePaymentHandler() {
+ this.set("loading", true);
+ const plan = this.get("model.plans")
+ .filterBy("id", this.selectedPlan)
+ .get("firstObject");
+ const cardholderAddress = this.cardholderAddress;
+ const cardholderName = this.cardholderName;
+
+ if (!plan) {
+ this.alert("plans.validate.payment_options.required");
+ this.set("loading", false);
+ return;
+ }
+
+ if (!cardholderName) {
+ this.alert("subscribe.invalid_cardholder_name");
+ this.set("loading", false);
+ return;
+ }
+
+ if (!cardholderAddress.country) {
+ this.alert("subscribe.invalid_cardholder_country");
+ this.set("loading", false);
+ return;
+ }
+
+ if (cardholderAddress.country === "US" && !cardholderAddress.state) {
+ this.alert("subscribe.invalid_cardholder_state");
+ this.set("loading", false);
+ return;
+ }
+
+ if (cardholderAddress.country === "CA" && !cardholderAddress.state) {
+ this.alert("subscribe.invalid_cardholder_province");
+ this.set("loading", false);
+ return;
+ }
+
+ let transaction = this.createSubscription(plan);
+
+ transaction
+ .then((result) => {
+ if (result.error) {
+ this.dialog.alert(result.error.message || result.error);
+ } else if (result.status === "incomplete" || result.status === "open") {
+ const transactionId = result.id;
+ const planId = this.selectedPlan;
+ this.handleAuthentication(plan, result).then(
+ (authenticationResult) => {
+ if (authenticationResult && !authenticationResult.error) {
+ return Transaction.finalize(transactionId, planId).then(() => {
+ this._advanceSuccessfulTransaction(plan);
+ });
+ }
+ }
+ );
+ } else {
+ this._advanceSuccessfulTransaction(plan);
+ }
+ })
+ .catch((result) => {
+ this.dialog.alert(
+ result.jqXHR.responseJSON.errors[0] || result.errorThrown
+ );
+ this.set("loading", false);
+ });
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/subscribe.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/subscribe.js
new file mode 100644
index 00000000000..025307ca254
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/subscribe.js
@@ -0,0 +1,3 @@
+import Controller from "@ember/controller";
+
+export default class SubscribeController extends Controller {}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/subscriptions.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/subscriptions.js
new file mode 100644
index 00000000000..b707a08ab33
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/subscriptions.js
@@ -0,0 +1,45 @@
+import Controller from "@ember/controller";
+import { computed } from "@ember/object";
+import { htmlSafe } from "@ember/template";
+import { i18n } from "discourse-i18n";
+
+export default class SubscriptionsController extends Controller {
+ init() {
+ super.init(...arguments);
+ if (this.currentUser) {
+ this.currentUser
+ .checkEmail()
+ .then(() => this.set("email", this.currentUser.email));
+ }
+ }
+
+ @computed("email")
+ get pricingTable() {
+ try {
+ const pricingTableId =
+ this.siteSettings.discourse_subscriptions_pricing_table_id;
+ const publishableKey =
+ this.siteSettings.discourse_subscriptions_public_key;
+ const pricingTableEnabled =
+ this.siteSettings.discourse_subscriptions_pricing_table_enabled;
+
+ if (!pricingTableEnabled || !pricingTableId || !publishableKey) {
+ throw new Error("Pricing table not configured");
+ }
+
+ if (this.currentUser) {
+ return htmlSafe(`<stripe-pricing-table
+ pricing-table-id="${pricingTableId}"
+ publishable-key="${publishableKey}"
+ customer-email="${this.email}"></stripe-pricing-table>`);
+ } else {
+ return htmlSafe(`<stripe-pricing-table
+ pricing-table-id="${pricingTableId}"
+ publishable-key="${publishableKey}"
+ ></stripe-pricing-table>`);
+ }
+ } catch {
+ return i18n("discourse_subscriptions.subscribe.no_products");
+ }
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/user-billing-subscriptions-card.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/user-billing-subscriptions-card.js
new file mode 100644
index 00000000000..c959128cf4b
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/controllers/user-billing-subscriptions-card.js
@@ -0,0 +1,60 @@
+/* global Stripe */
+import Controller from "@ember/controller";
+import { action } from "@ember/object";
+import { service } from "@ember/service";
+import { ajax } from "discourse/lib/ajax";
+import { popupAjaxError } from "discourse/lib/ajax-error";
+import { i18n } from "discourse-i18n";
+
+export default class UserBillingSubscriptionsCardController extends Controller {
+ @service dialog;
+
+ loading = false;
+ saved = false;
+
+ init() {
+ super.init(...arguments);
+ this.set(
+ "stripe",
+ Stripe(this.siteSettings.discourse_subscriptions_public_key)
+ );
+ const elements = this.get("stripe").elements();
+ this.set("cardElement", elements.create("card", { hidePostalCode: true }));
+ }
+
+ @action
+ async updatePaymentMethod() {
+ this.set("loading", true);
+ this.set("saved", false);
+
+ const paymentMethodObject = await this.stripe.createPaymentMethod({
+ type: "card",
+ card: this.cardElement,
+ });
+
+ if (paymentMethodObject.error) {
+ this.dialog.alert(
+ paymentMethodObject.error?.message || i18n("generic_error")
+ );
+ this.set("loading", false);
+ return;
+ }
+
+ const paymentMethod = paymentMethodObject.paymentMethod.id;
+
+ try {
+ await ajax(`/s/user/subscriptions/${this.model}`, {
+ method: "PUT",
+ data: {
+ payment_method: paymentMethod,
+ },
+ });
+ this.set("saved", true);
+ } catch (err) {
+ popupAjaxError(err);
+ } finally {
+ this.set("loading", false);
+ this.cardElement?.clear();
+ }
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/discourse-subscriptions-route-map.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/discourse-subscriptions-route-map.js
new file mode 100644
index 00000000000..3995510ee62
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/discourse-subscriptions-route-map.js
@@ -0,0 +1,20 @@
+export default {
+ resource: "admin.adminPlugins",
+ path: "/plugins",
+
+ map() {
+ this.route("discourse-subscriptions", function () {
+ this.route("products", function () {
+ this.route("show", { path: "/:product-id" }, function () {
+ this.route("plans", function () {
+ this.route("show", { path: "/:plan-id" });
+ });
+ });
+ });
+
+ this.route("coupons");
+
+ this.route("subscriptions");
+ });
+ },
+};
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/discourse-subscriptions-user-route-map.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/discourse-subscriptions-user-route-map.js
new file mode 100644
index 00000000000..5f382db9314
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/discourse-subscriptions-user-route-map.js
@@ -0,0 +1,12 @@
+export default {
+ resource: "user",
+ path: "users/:username",
+ map() {
+ this.route("billing", function () {
+ this.route("payments");
+ this.route("subscriptions", function () {
+ this.route("card", { path: "/card/:stripe-subscription-id" });
+ });
+ });
+ },
+};
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/helpers/format-currency.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/helpers/format-currency.js
new file mode 100644
index 00000000000..1b12a903d6f
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/helpers/format-currency.js
@@ -0,0 +1,44 @@
+export default function formatCurrency(currency, amount) {
+ let currencySign;
+
+ switch (currency.toUpperCase()) {
+ case "EUR":
+ currencySign = "€";
+ break;
+ case "GBP":
+ currencySign = "£";
+ break;
+ case "INR":
+ currencySign = "₹";
+ break;
+ case "BRL":
+ currencySign = "R$";
+ break;
+ case "DKK":
+ currencySign = "DKK";
+ break;
+ case "SGD":
+ currencySign = "S$";
+ break;
+ case "ZAR":
+ currencySign = "R";
+ break;
+ case "CHF":
+ currencySign = "CHF";
+ break;
+ case "PLN":
+ currencySign = "zł";
+ break;
+ case "CZK":
+ currencySign = "Kč";
+ break;
+ case "SEK":
+ currencySign = "kr";
+ break;
+ default:
+ currencySign = "$";
+ }
+
+ const formattedAmount = parseFloat(amount).toFixed(2);
+ return currencySign + formattedAmount;
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/helpers/format-unix-date.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/helpers/format-unix-date.js
new file mode 100644
index 00000000000..3a1b786f0d5
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/helpers/format-unix-date.js
@@ -0,0 +1,16 @@
+import { htmlSafe } from "@ember/template";
+import { autoUpdatingRelativeAge } from "discourse/lib/formatter";
+
+export default function formatUnixDate(timestamp) {
+ if (timestamp) {
+ const date = new Date(moment.unix(timestamp).format());
+
+ return new htmlSafe(
+ autoUpdatingRelativeAge(date, {
+ format: "medium",
+ title: true,
+ leaveAgo: true,
+ })
+ );
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/initializers/setup-subscriptions.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/initializers/setup-subscriptions.js
new file mode 100644
index 00000000000..0efc4c4bf3c
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/initializers/setup-subscriptions.js
@@ -0,0 +1,32 @@
+import { withPluginApi } from "discourse/lib/plugin-api";
+import { i18n } from "discourse-i18n";
+
+export default {
+ name: "setup-subscriptions",
+ initialize(container) {
+ withPluginApi("0.8.11", (api) => {
+ const siteSettings = container.lookup("service:site-settings");
+ const isNavLinkEnabled =
+ siteSettings.discourse_subscriptions_extra_nav_subscribe;
+ const isPricingTableEnabled =
+ siteSettings.discourse_subscriptions_pricing_table_enabled;
+ const subscribeHref = isPricingTableEnabled ? "/s/subscriptions" : "/s";
+ if (isNavLinkEnabled) {
+ api.addNavigationBarItem({
+ name: "subscribe",
+ displayName: i18n("discourse_subscriptions.navigation.subscribe"),
+ href: subscribeHref,
+ });
+ }
+
+ const user = api.getCurrentUser();
+ if (user) {
+ api.addQuickAccessProfileItem({
+ icon: "far-credit-card",
+ href: `/u/${user.username}/billing/subscriptions`,
+ content: "Billing",
+ });
+ }
+ });
+ },
+};
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/models/admin-coupon.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/models/admin-coupon.js
new file mode 100644
index 00000000000..32553197034
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/models/admin-coupon.js
@@ -0,0 +1,61 @@
+import EmberObject from "@ember/object";
+import { ajax } from "discourse/lib/ajax";
+import discourseComputed from "discourse/lib/decorators";
+
+export default class AdminCoupon extends EmberObject {
+ static list() {
+ return ajax("/s/admin/coupons", {
+ method: "get",
+ }).then((result) => {
+ if (result === null) {
+ return { unconfigured: true };
+ }
+ return result.map((coupon) => AdminCoupon.create(coupon));
+ });
+ }
+
+ static save(params) {
+ const data = {
+ promo: params.promo,
+ discount_type: params.discount_type,
+ discount: params.discount,
+ active: params.active,
+ };
+
+ return ajax("/s/admin/coupons", {
+ method: "post",
+ data,
+ }).then((coupon) => AdminCoupon.create(coupon));
+ }
+
+ static update(params) {
+ const data = {
+ id: params.id,
+ active: params.active,
+ };
+
+ return ajax("/s/admin/coupons", {
+ method: "put",
+ data,
+ }).then((coupon) => AdminCoupon.create(coupon));
+ }
+
+ static destroy(params) {
+ const data = {
+ coupon_id: params.coupon.id,
+ };
+ return ajax("/s/admin/coupons", {
+ method: "delete",
+ data,
+ });
+ }
+
+ @discourseComputed("coupon.amount_off", "coupon.percent_off")
+ discount(amount_off, percent_off) {
+ if (amount_off) {
+ return `${parseFloat(amount_off * 0.01).toFixed(2)}`;
+ } else if (percent_off) {
+ return `${percent_off}%`;
+ }
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/models/admin-plan.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/models/admin-plan.js
new file mode 100644
index 00000000000..6c0f22cec0e
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/models/admin-plan.js
@@ -0,0 +1,60 @@
+import { ajax } from "discourse/lib/ajax";
+import discourseComputed from "discourse/lib/decorators";
+import Plan from "discourse/plugins/discourse-subscriptions/discourse/models/plan";
+
+export default class AdminPlan extends Plan {
+ static findAll(data) {
+ return ajax("/s/admin/plans", { method: "get", data }).then((result) =>
+ result.map((plan) => AdminPlan.create(plan))
+ );
+ }
+
+ static find(id) {
+ return ajax(`/s/admin/plans/${id}`, { method: "get" }).then((plan) =>
+ AdminPlan.create(plan)
+ );
+ }
+
+ isNew = false;
+ name = "";
+ interval = "month";
+ unit_amount = 0;
+ intervals = ["day", "week", "month", "year"];
+ metadata = {};
+
+ @discourseComputed("trial_period_days")
+ parseTrialPeriodDays(trialDays) {
+ if (trialDays) {
+ return parseInt(0 + trialDays, 10);
+ } else {
+ return 0;
+ }
+ }
+
+ save() {
+ const data = {
+ nickname: this.nickname,
+ interval: this.interval,
+ amount: this.unit_amount,
+ currency: this.currency,
+ trial_period_days: this.parseTrialPeriodDays,
+ type: this.type,
+ product: this.product,
+ metadata: this.metadata,
+ active: this.active,
+ };
+
+ return ajax("/s/admin/plans", { method: "post", data });
+ }
+
+ update() {
+ const data = {
+ nickname: this.nickname,
+ trial_period_days: this.parseTrialPeriodDays,
+ metadata: this.metadata,
+ active: this.active,
+ };
+
+ return ajax(`/s/admin/plans/${this.id}`, { method: "patch", data });
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/models/admin-product.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/models/admin-product.js
new file mode 100644
index 00000000000..03abc48c8db
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/models/admin-product.js
@@ -0,0 +1,54 @@
+import EmberObject from "@ember/object";
+import { ajax } from "discourse/lib/ajax";
+
+export default class AdminProduct extends EmberObject {
+ static findAll() {
+ return ajax("/s/admin/products", { method: "get" }).then((result) => {
+ if (result === null) {
+ return { unconfigured: true };
+ }
+ return result.map((product) => AdminProduct.create(product));
+ });
+ }
+
+ static find(id) {
+ return ajax(`/s/admin/products/${id}`, {
+ method: "get",
+ }).then((product) => AdminProduct.create(product));
+ }
+
+ isNew = false;
+ metadata = {};
+
+ destroy() {
+ return ajax(`/s/admin/products/${this.id}`, { method: "delete" });
+ }
+
+ save() {
+ const data = {
+ name: this.name,
+ statement_descriptor: this.statement_descriptor,
+ metadata: this.metadata,
+ active: this.active,
+ };
+
+ return ajax("/s/admin/products", {
+ method: "post",
+ data,
+ }).then((product) => AdminProduct.create(product));
+ }
+
+ update() {
+ const data = {
+ name: this.name,
+ statement_descriptor: this.statement_descriptor,
+ metadata: this.metadata,
+ active: this.active,
+ };
+
+ return ajax(`/s/admin/products/${this.id}`, {
+ method: "patch",
+ data,
+ });
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/models/admin-subscription.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/models/admin-subscription.js
new file mode 100644
index 00000000000..77099415288
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/models/admin-subscription.js
@@ -0,0 +1,56 @@
+import EmberObject from "@ember/object";
+import { ajax } from "discourse/lib/ajax";
+import discourseComputed from "discourse/lib/decorators";
+import getURL from "discourse/lib/get-url";
+
+export default class AdminSubscription extends EmberObject {
+ static find() {
+ return ajax("/s/admin/subscriptions", {
+ method: "get",
+ }).then((result) => {
+ if (result === null) {
+ return { unconfigured: true };
+ }
+ result.data = result.data.map((subscription) =>
+ AdminSubscription.create(subscription)
+ );
+ return result;
+ });
+ }
+
+ static loadMore(lastRecord) {
+ return ajax(`/s/admin/subscriptions?last_record=${lastRecord}`, {
+ method: "get",
+ }).then((result) => {
+ result.data = result.data.map((subscription) =>
+ AdminSubscription.create(subscription)
+ );
+ return result;
+ });
+ }
+
+ @discourseComputed("status")
+ canceled(status) {
+ return status === "canceled";
+ }
+
+ @discourseComputed("metadata")
+ metadataUserExists(metadata) {
+ return metadata.user_id && metadata.username;
+ }
+
+ @discourseComputed("metadata")
+ subscriptionUserPath(metadata) {
+ return getURL(`/admin/users/${metadata.user_id}/${metadata.username}`);
+ }
+
+ destroy(refund) {
+ const data = {
+ refund,
+ };
+ return ajax(`/s/admin/subscriptions/${this.id}`, {
+ method: "delete",
+ data,
+ }).then((result) => AdminSubscription.create(result));
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/models/plan.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/models/plan.js
new file mode 100644
index 00000000000..71f6d574ad4
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/models/plan.js
@@ -0,0 +1,24 @@
+import EmberObject, { computed } from "@ember/object";
+import discourseComputed from "discourse/lib/decorators";
+
+export default class Plan extends EmberObject {
+ @computed("unit_amount")
+ get amountDollars() {
+ return parseFloat(this.get("unit_amount") / 100).toFixed(2);
+ }
+
+ set amountDollars(value) {
+ const decimal = parseFloat(value) * 100;
+ this.set("unit_amount", decimal);
+ }
+
+ @discourseComputed("recurring.interval")
+ billingInterval(interval) {
+ return interval || "one-time";
+ }
+
+ @discourseComputed("amountDollars", "currency", "billingInterval")
+ subscriptionRate(amountDollars, currency, interval) {
+ return `${amountDollars} ${currency.toUpperCase()} / ${interval}`;
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/models/product.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/models/product.js
new file mode 100644
index 00000000000..4cf48f538d6
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/models/product.js
@@ -0,0 +1,10 @@
+import EmberObject from "@ember/object";
+import { ajax } from "discourse/lib/ajax";
+
+export default class Product extends EmberObject {
+ static findAll() {
+ return ajax("/s", { method: "get" }).then((result) =>
+ result.map((product) => Product.create(product))
+ );
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/models/subscription.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/models/subscription.js
new file mode 100644
index 00000000000..4d3373a2310
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/models/subscription.js
@@ -0,0 +1,26 @@
+import EmberObject from "@ember/object";
+import { ajax } from "discourse/lib/ajax";
+import discourseComputed from "discourse/lib/decorators";
+
+export default class Subscription extends EmberObject {
+ static show(id) {
+ return ajax(`/s/${id}`, { method: "get" });
+ }
+
+ @discourseComputed("status")
+ canceled(status) {
+ return status === "canceled";
+ }
+
+ save() {
+ const data = {
+ source: this.source,
+ plan: this.plan,
+ promo: this.promo,
+ cardholder_name: this.cardholderName,
+ cardholder_address: this.cardholderAddress,
+ };
+
+ return ajax("/s/create", { method: "post", data });
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/models/transaction.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/models/transaction.js
new file mode 100644
index 00000000000..08fe6a70d81
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/models/transaction.js
@@ -0,0 +1,12 @@
+import { ajax } from "discourse/lib/ajax";
+
+export default {
+ finalize(transaction, plan) {
+ const data = {
+ transaction,
+ plan,
+ };
+
+ return ajax("/s/finalize", { method: "post", data });
+ },
+};
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/models/user-payment.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/models/user-payment.js
new file mode 100644
index 00000000000..71b0daa7d93
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/models/user-payment.js
@@ -0,0 +1,18 @@
+import EmberObject from "@ember/object";
+import { ajax } from "discourse/lib/ajax";
+import discourseComputed from "discourse/lib/decorators";
+
+export default class UserPayment extends EmberObject {
+ static findAll() {
+ return ajax("/s/user/payments", { method: "get" }).then((result) =>
+ result.map((payment) => {
+ return UserPayment.create(payment);
+ })
+ );
+ }
+
+ @discourseComputed("amount")
+ amountDollars(amount) {
+ return parseFloat(amount / 100).toFixed(2);
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/models/user-subscription.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/models/user-subscription.js
new file mode 100644
index 00000000000..b77f4e46106
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/models/user-subscription.js
@@ -0,0 +1,52 @@
+import EmberObject from "@ember/object";
+import { ajax } from "discourse/lib/ajax";
+import discourseComputed from "discourse/lib/decorators";
+import { i18n } from "discourse-i18n";
+import Plan from "discourse/plugins/discourse-subscriptions/discourse/models/plan";
+
+export default class UserSubscription extends EmberObject {
+ static findAll() {
+ return ajax("/s/user/subscriptions", { method: "get" }).then((result) =>
+ result.map((subscription) => {
+ subscription.plan = Plan.create(subscription.plan);
+ return UserSubscription.create(subscription);
+ })
+ );
+ }
+
+ @discourseComputed("status")
+ canceled(status) {
+ return status === "canceled";
+ }
+
+ @discourseComputed("current_period_end", "canceled_at")
+ endDate(current_period_end, canceled_at) {
+ if (!canceled_at) {
+ return moment.unix(current_period_end).format("LL");
+ } else {
+ return i18n("discourse_subscriptions.user.subscriptions.cancelled");
+ }
+ }
+
+ @discourseComputed("discount")
+ discounted(discount) {
+ if (discount) {
+ const amount_off = discount.coupon.amount_off;
+ const percent_off = discount.coupon.percent_off;
+
+ if (amount_off) {
+ return `${parseFloat(amount_off * 0.01).toFixed(2)}`;
+ } else if (percent_off) {
+ return `${percent_off}%`;
+ }
+ } else {
+ return i18n("no_value");
+ }
+ }
+
+ destroy() {
+ return ajax(`/s/user/subscriptions/${this.id}`, {
+ method: "delete",
+ }).then((result) => UserSubscription.create(result));
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/payments-activity-route-map.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/payments-activity-route-map.js
new file mode 100644
index 00000000000..952d682bb0e
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/payments-activity-route-map.js
@@ -0,0 +1,6 @@
+export default {
+ resource: "user.userActivity",
+ map() {
+ this.route("payments");
+ },
+};
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-coupons.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-coupons.js
new file mode 100644
index 00000000000..a8096a2d5a8
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-coupons.js
@@ -0,0 +1,14 @@
+import { action } from "@ember/object";
+import Route from "@ember/routing/route";
+import AdminCoupon from "discourse/plugins/discourse-subscriptions/discourse/models/admin-coupon";
+
+export default class AdminPluginsDiscourseSubscriptionsCouponsRoute extends Route {
+ model() {
+ return AdminCoupon.list();
+ }
+
+ @action
+ reloadModel() {
+ this.refresh();
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-plans-index.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-plans-index.js
new file mode 100644
index 00000000000..c9f09126a55
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-plans-index.js
@@ -0,0 +1,8 @@
+import Route from "@ember/routing/route";
+import AdminPlan from "discourse/plugins/discourse-subscriptions/discourse/models/admin-plan";
+
+export default class AdminPluginsDiscourseSubscriptionsPlansIndexRoute extends Route {
+ model() {
+ return AdminPlan.findAll();
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-plans.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-plans.js
new file mode 100644
index 00000000000..1ed87d494a9
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-plans.js
@@ -0,0 +1,3 @@
+import Route from "@ember/routing/route";
+
+export default class AdminPluginsDiscourseSubscriptionsPlansRoute extends Route {}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-products-index.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-products-index.js
new file mode 100644
index 00000000000..269f1fb93e1
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-products-index.js
@@ -0,0 +1,36 @@
+import { action } from "@ember/object";
+import Route from "@ember/routing/route";
+import { service } from "@ember/service";
+import { i18n } from "discourse-i18n";
+import AdminProduct from "discourse/plugins/discourse-subscriptions/discourse/models/admin-product";
+
+export default class AdminPluginsDiscourseSubscriptionsProductsIndexRoute extends Route {
+ @service dialog;
+
+ model() {
+ return AdminProduct.findAll();
+ }
+
+ @action
+ destroyProduct(product) {
+ this.dialog.yesNoConfirm({
+ message: i18n(
+ "discourse_subscriptions.admin.products.operations.destroy.confirm"
+ ),
+ didConfirm: () => {
+ return product
+ .destroy()
+ .then(() => {
+ this.controllerFor(
+ "adminPluginsDiscourseSubscriptionsProductsIndex"
+ )
+ .get("model")
+ .removeObject(product);
+ })
+ .catch((data) =>
+ this.dialog.alert(data.jqXHR.responseJSON.errors.join("\n"))
+ );
+ },
+ });
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-products-show-plans-show.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-products-show-plans-show.js
new file mode 100644
index 00000000000..3d21d238aaa
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-products-show-plans-show.js
@@ -0,0 +1,51 @@
+import Route from "@ember/routing/route";
+import { hash } from "rsvp";
+import Group from "discourse/models/group";
+import AdminPlan from "discourse/plugins/discourse-subscriptions/discourse/models/admin-plan";
+
+export default class AdminPluginsDiscourseSubscriptionsProductsShowPlansShowRoute extends Route {
+ model(params) {
+ const id = params["plan-id"];
+ const product = this.modelFor(
+ "adminPlugins.discourse-subscriptions.products.show"
+ ).product;
+ let plan;
+
+ if (id === "new") {
+ plan = AdminPlan.create({
+ active: true,
+ isNew: true,
+ interval: "month",
+ type: "recurring",
+ isRecurring: true,
+ currency: this.siteSettings.discourse_subscriptions_currency,
+ product: product.get("id"),
+ metadata: {
+ group_name: null,
+ },
+ });
+ } else {
+ plan = AdminPlan.find(id).then((result) => {
+ result.isRecurring = result.type === "recurring";
+
+ return result;
+ });
+ }
+
+ const groups = Group.findAll({ ignore_automatic: true });
+
+ return hash({ plan, product, groups });
+ }
+
+ renderTemplate() {
+ this.render(
+ "adminPlugins.discourse-subscriptions.products.show.plans.show",
+ {
+ into: "adminPlugins.discourse-subscriptions.products",
+ outlet: "main",
+ controller:
+ "adminPlugins.discourse-subscriptions.products.show.plans.show",
+ }
+ );
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-products-show.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-products-show.js
new file mode 100644
index 00000000000..4062b880375
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-products-show.js
@@ -0,0 +1,47 @@
+import { action } from "@ember/object";
+import Route from "@ember/routing/route";
+import { service } from "@ember/service";
+import { hash } from "rsvp";
+import { i18n } from "discourse-i18n";
+import AdminPlan from "discourse/plugins/discourse-subscriptions/discourse/models/admin-plan";
+import AdminProduct from "discourse/plugins/discourse-subscriptions/discourse/models/admin-product";
+
+export default class AdminPluginsDiscourseSubscriptionsProductsShowRoute extends Route {
+ @service dialog;
+
+ model(params) {
+ const product_id = params["product-id"];
+ let product;
+ let plans = [];
+
+ if (product_id === "new") {
+ product = AdminProduct.create({ active: false, isNew: true });
+ } else {
+ product = AdminProduct.find(product_id);
+ plans = AdminPlan.findAll({ product_id });
+ }
+
+ return hash({ plans, product });
+ }
+
+ @action
+ destroyPlan(plan) {
+ this.dialog.yesNoConfirm({
+ message: i18n(
+ "discourse_subscriptions.admin.plans.operations.destroy.confirm"
+ ),
+ didConfirm: () => {
+ plan
+ .destroy()
+ .then(() => {
+ this.controllerFor("adminPluginsDiscourseSubscriptionsProductsShow")
+ .get("model.plans")
+ .removeObject(plan);
+ })
+ .catch((data) =>
+ this.dialog.alert(data.jqXHR.responseJSON.errors.join("\n"))
+ );
+ },
+ });
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-products.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-products.js
new file mode 100644
index 00000000000..eb98e34090a
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-products.js
@@ -0,0 +1,3 @@
+import Route from "@ember/routing/route";
+
+export default class AdminPluginsDiscourseSubscriptionsProductsRoute extends Route {}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-subscriptions.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-subscriptions.js
new file mode 100644
index 00000000000..c45102e99a6
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-subscriptions.js
@@ -0,0 +1,8 @@
+import Route from "@ember/routing/route";
+import AdminSubscription from "discourse/plugins/discourse-subscriptions/discourse/models/admin-subscription";
+
+export default class AdminPluginsDiscourseSubscriptionsSubscriptionsRoute extends Route {
+ model() {
+ return AdminSubscription.find();
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions.js
new file mode 100644
index 00000000000..97e730d0e4b
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions.js
@@ -0,0 +1,19 @@
+import { action } from "@ember/object";
+import Route from "@ember/routing/route";
+import { service } from "@ember/service";
+
+export default class AdminPluginsDiscourseSubscriptionsRoute extends Route {
+ @service router;
+
+ @action
+ showSettings() {
+ const controller = this.controllerFor("adminSiteSettings");
+ this.router
+ .transitionTo("adminSiteSettingsCategory", "plugins")
+ .then(() => {
+ controller.set("filter", "plugin:discourse-subscriptions campaign");
+ controller.set("_skipBounce", true);
+ controller.filterContentNow("plugins");
+ });
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/subscribe-index.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/subscribe-index.js
new file mode 100644
index 00000000000..c5ef9b01c98
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/subscribe-index.js
@@ -0,0 +1,26 @@
+import Route from "@ember/routing/route";
+import { service } from "@ember/service";
+import Product from "discourse/plugins/discourse-subscriptions/discourse/models/product";
+
+export default class SubscribeIndexRoute extends Route {
+ @service router;
+
+ model() {
+ return Product.findAll();
+ }
+
+ afterModel(products) {
+ if (products.length === 1) {
+ const product = products[0];
+
+ if (this.currentUser && product.subscribed && !product.repurchaseable) {
+ this.router.transitionTo(
+ "user.billing.subscriptions",
+ this.currentUser.username
+ );
+ } else {
+ this.router.transitionTo("subscribe.show", product.id);
+ }
+ }
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/subscribe-show.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/subscribe-show.js
new file mode 100644
index 00000000000..1ec4f42c25f
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/subscribe-show.js
@@ -0,0 +1,19 @@
+import Route from "@ember/routing/route";
+import Plan from "discourse/plugins/discourse-subscriptions/discourse/models/plan";
+import Product from "discourse/plugins/discourse-subscriptions/discourse/models/product";
+import Subscription from "discourse/plugins/discourse-subscriptions/discourse/models/subscription";
+
+export default class SubscribeShowRoute extends Route {
+ model(params) {
+ const product_id = params["subscription-id"];
+
+ return Subscription.show(product_id).then((result) => {
+ result.product = Product.create(result.product);
+ result.plans = result.plans.map((plan) => {
+ return Plan.create(plan);
+ });
+
+ return result;
+ });
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/subscribe.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/subscribe.js
new file mode 100644
index 00000000000..2b5737b0e96
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/subscribe.js
@@ -0,0 +1,16 @@
+import Route from "@ember/routing/route";
+import { service } from "@ember/service";
+
+export default class SubscribeRoute extends Route {
+ @service router;
+ @service siteSettings;
+
+ beforeModel() {
+ const pricingTableEnabled =
+ this.siteSettings.discourse_subscriptions_pricing_table_enabled;
+
+ if (pricingTableEnabled) {
+ this.router.transitionTo("subscriptions");
+ }
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/subscriptions.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/subscriptions.js
new file mode 100644
index 00000000000..893c2392f8f
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/subscriptions.js
@@ -0,0 +1,16 @@
+import Route from "@ember/routing/route";
+import { service } from "@ember/service";
+
+export default class SubscriptionsRoute extends Route {
+ @service router;
+ @service siteSettings;
+
+ beforeModel() {
+ const pricingTableEnabled =
+ this.siteSettings.discourse_subscriptions_pricing_table_enabled;
+
+ if (!pricingTableEnabled) {
+ this.router.transitionTo("subscribe");
+ }
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/user-billing-index.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/user-billing-index.js
new file mode 100644
index 00000000000..9518224f757
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/user-billing-index.js
@@ -0,0 +1,12 @@
+import Route from "@ember/routing/route";
+import { service } from "@ember/service";
+
+export default class UserBillingIndexRoute extends Route {
+ @service router;
+
+ templateName = "user/billing/index";
+
+ redirect() {
+ this.router.transitionTo("user.billing.subscriptions.index");
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/user-billing-payments.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/user-billing-payments.js
new file mode 100644
index 00000000000..13b66cb1db7
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/user-billing-payments.js
@@ -0,0 +1,10 @@
+import Route from "@ember/routing/route";
+import UserPayment from "discourse/plugins/discourse-subscriptions/discourse/models/user-payment";
+
+export default class UserBillingPaymentsRoute extends Route {
+ templateName = "user/billing/payments";
+
+ model() {
+ return UserPayment.findAll();
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/user-billing-subscriptions-card.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/user-billing-subscriptions-card.js
new file mode 100644
index 00000000000..c1e2703c268
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/user-billing-subscriptions-card.js
@@ -0,0 +1,7 @@
+import Route from "@ember/routing/route";
+
+export default class UserBillingSubscriptionsCardRoute extends Route {
+ model(params) {
+ return params["stripe-subscription-id"];
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/user-billing-subscriptions-index.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/user-billing-subscriptions-index.js
new file mode 100644
index 00000000000..70ab823fa28
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/user-billing-subscriptions-index.js
@@ -0,0 +1,42 @@
+import { action } from "@ember/object";
+import Route from "@ember/routing/route";
+import { service } from "@ember/service";
+import { i18n } from "discourse-i18n";
+import UserSubscription from "discourse/plugins/discourse-subscriptions/discourse/models/user-subscription";
+
+export default class UserBillingSubscriptionsIndexRoute extends Route {
+ @service dialog;
+ @service router;
+
+ model() {
+ return UserSubscription.findAll();
+ }
+
+ @action
+ updateCard(subscriptionId) {
+ this.router.transitionTo("user.billing.subscriptions.card", subscriptionId);
+ }
+
+ @action
+ cancelSubscription(subscription) {
+ this.dialog.yesNoConfirm({
+ message: i18n(
+ "discourse_subscriptions.user.subscriptions.operations.destroy.confirm"
+ ),
+ didConfirm: () => {
+ subscription.set("loading", true);
+
+ subscription
+ .destroy()
+ .then((result) => subscription.set("status", result.status))
+ .catch((data) =>
+ this.dialog.alert(data.jqXHR.responseJSON.errors.join("\n"))
+ )
+ .finally(() => {
+ subscription.set("loading", false);
+ this.refresh();
+ });
+ },
+ });
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/user-billing-subscriptions.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/user-billing-subscriptions.js
new file mode 100644
index 00000000000..147eb89f663
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/user-billing-subscriptions.js
@@ -0,0 +1,3 @@
+import Route from "@ember/routing/route";
+
+export default class UserBillingSubscriptionsRoute extends Route {}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/user-billing.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/user-billing.js
new file mode 100644
index 00000000000..e8192d5fe02
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/routes/user-billing.js
@@ -0,0 +1,16 @@
+import Route from "@ember/routing/route";
+import { service } from "@ember/service";
+
+export default class UserBillingRoute extends Route {
+ @service router;
+
+ templateName = "user/billing";
+
+ setupController(controller, model) {
+ if (this.currentUser.id !== this.modelFor("user").id) {
+ this.router.replaceWith("userActivity");
+ } else {
+ controller.setProperties({ model });
+ }
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/subscriptions-route-map.js b/plugins/discourse-subscriptions/assets/javascripts/discourse/subscriptions-route-map.js
new file mode 100644
index 00000000000..cea2fb2cda0
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/subscriptions-route-map.js
@@ -0,0 +1,6 @@
+export default function () {
+ this.route("subscriptions", { path: "/s/subscriptions" });
+ this.route("subscribe", { path: "/s" }, function () {
+ this.route("show", { path: "/:subscription-id" });
+ });
+}
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-coupons.gjs b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-coupons.gjs
new file mode 100644
index 00000000000..fda82b38d05
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-coupons.gjs
@@ -0,0 +1,74 @@
+import { Input } from "@ember/component";
+import { fn } from "@ember/helper";
+import { on } from "@ember/modifier";
+import RouteTemplate from "ember-route-template";
+import DButton from "discourse/components/d-button";
+import { i18n } from "discourse-i18n";
+import CreateCouponForm from "../../components/create-coupon-form";
+
+export default RouteTemplate(
+ <template>
+ {{#if @controller.model.unconfigured}}
+ <p>{{i18n "discourse_subscriptions.admin.unconfigured"}}</p>
+ <p>
+ <a href="https://meta.discourse.org/t/discourse-subscriptions/140818/">
+ {{i18n "discourse_subscriptions.admin.on_meta"}}
+ </a>
+ </p>
+ {{else}}
+ {{#if @controller.model}}
+ <table class="table discourse-patrons-table">
+ <thead>
+ <th>{{i18n "discourse_subscriptions.admin.coupons.code"}}</th>
+ <th>{{i18n "discourse_subscriptions.admin.coupons.discount"}}</th>
+ <th>{{i18n
+ "discourse_subscriptions.admin.coupons.times_redeemed"
+ }}</th>
+ <th>{{i18n "discourse_subscriptions.admin.coupons.active"}}</th>
+ <th>{{i18n "discourse_subscriptions.admin.coupons.actions"}}</th>
+ </thead>
+ <tbody>
+ {{#each @controller.model as |coupon|}}
+ <tr>
+ <td>{{coupon.code}}</td>
+ <td>{{coupon.discount}}</td>
+ <td>{{coupon.times_redeemed}}</td>
+ <td>
+ <Input
+ @type="checkbox"
+ @checked={{coupon.active}}
+ {{on "click" (fn @controller.toggleActive coupon)}}
+ />
+ </td>
+ <td>
+ <DButton
+ @action={{fn @controller.deleteCoupon coupon}}
+ @icon="trash-can"
+ class="btn-danger btn btn-icon btn-no-text"
+ />
+ </td>
+ </tr>
+ {{/each}}
+ </tbody>
+ </table>
+ {{/if}}
+
+ {{#unless @controller.creating}}
+ <DButton
+ @action={{@controller.openCreateForm}}
+ @label="discourse_subscriptions.admin.coupons.create"
+ @title="discourse_subscriptions.admin.coupons.create"
+ @icon="plus"
+ class="btn btn-icon btn-primary create-coupon"
+ />
+ {{/unless}}
+
+ {{#if @controller.creating}}
+ <CreateCouponForm
+ @cancel={{@controller.closeCreateForm}}
+ @create={{@controller.createNewCoupon}}
+ />
+ {{/if}}
+ {{/if}}
+ </template>
+);
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-dashboard.gjs b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-dashboard.gjs
new file mode 100644
index 00000000000..4e5cba0a084
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-dashboard.gjs
@@ -0,0 +1,84 @@
+import { array, fn } from "@ember/helper";
+import { on } from "@ember/modifier";
+import { LinkTo } from "@ember/routing";
+import RouteTemplate from "ember-route-template";
+import LoadMore from "discourse/components/load-more";
+import formatDuration from "discourse/helpers/format-duration";
+import htmlSafe from "discourse/helpers/html-safe";
+import { i18n } from "discourse-i18n";
+
+export default RouteTemplate(
+ <template>
+ <h3>{{i18n "discourse_subscriptions.admin.dashboard.title"}}</h3>
+
+ <LoadMore
+ @selector=".discourse-patrons-table tr"
+ @action={{@controller.loadMore}}
+ >
+ {{#if @controller.model}}
+ <table class="table discourse-patrons-table">
+ <thead>
+ <tr>
+ <th>
+ {{i18n
+ "discourse_subscriptions.admin.dashboard.table.head.user"
+ }}
+ </th>
+ <th>
+ {{i18n
+ "discourse_subscriptions.admin.dashboard.table.head.payment_intent"
+ }}
+ </th>
+ <th>
+ {{i18n
+ "discourse_subscriptions.admin.dashboard.table.head.receipt_email"
+ }}
+ </th>
+ <th
+ {{on "click" (fn @controller.orderPayments "created_at")}}
+ role="button"
+ class="sortable"
+ >
+ {{i18n "created"}}
+ </th>
+ <th
+ {{on "click" (fn @controller.orderPayments "amount")}}
+ role="button"
+ class="sortable amount"
+ >
+ {{i18n
+ "discourse_subscriptions.admin.dashboard.table.head.amount"
+ }}
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ {{#each @controller.model as |payment|}}
+ <tr>
+ <td>
+ <LinkTo
+ @route="adminUser.index"
+ @models={{array payment.user_id payment.username}}
+ >
+ {{payment.username}}
+ </LinkTo>
+ </td>
+ <td>
+ <LinkTo
+ @route="patrons.show"
+ @model={{payment.payment_intent_id}}
+ >
+ {{htmlSafe payment.payment_intent_id}}
+ </LinkTo>
+ </td>
+ <td>{{payment.receipt_email}}</td>
+ <td>{{htmlSafe (formatDuration payment.created_at_age)}}</td>
+ <td class="amount">{{payment.amount_currency}}</td>
+ </tr>
+ {{/each}}
+ </tbody>
+ </table>
+ {{/if}}
+ </LoadMore>
+ </template>
+);
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-plans-index.gjs b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-plans-index.gjs
new file mode 100644
index 00000000000..6f827310f92
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-plans-index.gjs
@@ -0,0 +1,44 @@
+import { fn } from "@ember/helper";
+import RouteTemplate from "ember-route-template";
+import DButton from "discourse/components/d-button";
+import routeAction from "discourse/helpers/route-action";
+import { i18n } from "discourse-i18n";
+
+export default RouteTemplate(
+ <template>
+ <table class="table discourse-patrons-table">
+ <thead>
+ <th>{{i18n "discourse_subscriptions.admin.plans.plan.plan_id"}}</th>
+ <th>{{i18n
+ "discourse_subscriptions.admin.plans.plan.nickname.title"
+ }}</th>
+ <th>{{i18n "discourse_subscriptions.admin.plans.plan.interval"}}</th>
+ <th>{{i18n "discourse_subscriptions.admin.plans.plan.amount"}}</th>
+ <th></th>
+ </thead>
+ <tbody>
+ {{#each @controller.model as |plan|}}
+ <tr>
+ <td>{{plan.id}}</td>
+ <td>{{plan.nickname}}</td>
+ <td>{{plan.interval}}</td>
+ <td>{{plan.unit_amount}}</td>
+ <td class="td-right">
+ <DButton
+ @action={{fn @controller.editPlan plan.id}}
+ @icon="far-pen-to-square"
+ class="btn no-text btn-icon"
+ />
+ <DButton
+ @action={{routeAction "destroyPlan"}}
+ @actionParam={{plan}}
+ @icon="trash-can"
+ class="btn-danger btn no-text btn-icon"
+ />
+ </td>
+ </tr>
+ {{/each}}
+ </tbody>
+ </table>
+ </template>
+);
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products-index.gjs b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products-index.gjs
new file mode 100644
index 00000000000..9637a8bb69e
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products-index.gjs
@@ -0,0 +1,90 @@
+import { LinkTo } from "@ember/routing";
+import RouteTemplate from "ember-route-template";
+import DButton from "discourse/components/d-button";
+import icon from "discourse/helpers/d-icon";
+import routeAction from "discourse/helpers/route-action";
+import { i18n } from "discourse-i18n";
+import formatUnixDate from "../../helpers/format-unix-date";
+
+export default RouteTemplate(
+ <template>
+ {{#if @controller.model.unconfigured}}
+ <p>{{i18n "discourse_subscriptions.admin.unconfigured"}}</p>
+ <p>
+ <a href="https://meta.discourse.org/t/discourse-subscriptions/140818/">
+ {{i18n "discourse_subscriptions.admin.on_meta"}}
+ </a>
+ </p>
+ {{else}}
+ <p class="btn-right">
+ <LinkTo
+ @route="adminPlugins.discourse-subscriptions.products.show"
+ @model="new"
+ class="btn btn-primary"
+ >
+ {{icon "plus"}}
+ <span>
+ {{i18n "discourse_subscriptions.admin.products.operations.new"}}
+ </span>
+ </LinkTo>
+ </p>
+
+ {{#if @controller.model}}
+ <table class="table discourse-patrons-table">
+ <thead>
+ <th>
+ {{i18n "discourse_subscriptions.admin.products.product.name"}}
+ </th>
+ <th>
+ {{i18n
+ "discourse_subscriptions.admin.products.product.created_at"
+ }}
+ </th>
+ <th>
+ {{i18n
+ "discourse_subscriptions.admin.products.product.updated_at"
+ }}
+ </th>
+ <th class="td-right">
+ {{i18n "discourse_subscriptions.admin.products.product.active"}}
+ </th>
+ <th></th>
+ </thead>
+
+ <tbody>
+ {{#each @controller.model as |product|}}
+ <tr>
+ <td>{{product.name}}</td>
+ <td>{{formatUnixDate product.created}}</td>
+ <td>{{formatUnixDate product.updated}}</td>
+ <td class="td-right">{{product.active}}</td>
+ <td class="td-right">
+ <div class="align-buttons">
+ <LinkTo
+ @route="adminPlugins.discourse-subscriptions.products.show"
+ @model={{product.id}}
+ class="btn no-text btn-icon"
+ >
+ {{icon "far-pen-to-square"}}
+ </LinkTo>
+
+ <DButton
+ @action={{routeAction "destroyProduct"}}
+ @actionParam={{product}}
+ @icon="trash-can"
+ class="btn-danger btn no-text btn-icon"
+ />
+ </div>
+ </td>
+ </tr>
+ {{/each}}
+ </tbody>
+ </table>
+ {{else}}
+ <p>
+ {{i18n "discourse_subscriptions.admin.products.product_help"}}
+ </p>
+ {{/if}}
+ {{/if}}
+ </template>
+);
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products-show-plans-show.gjs b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products-show-plans-show.gjs
new file mode 100644
index 00000000000..66bd4d0932e
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products-show-plans-show.gjs
@@ -0,0 +1,185 @@
+import { Input } from "@ember/component";
+import { fn } from "@ember/helper";
+import { on } from "@ember/modifier";
+import RouteTemplate from "ember-route-template";
+import DButton from "discourse/components/d-button";
+import { i18n } from "discourse-i18n";
+import ComboBox from "select-kit/components/combo-box";
+
+export default RouteTemplate(
+ <template>
+ <h4>{{i18n "discourse_subscriptions.admin.plans.title"}}</h4>
+
+ <form class="form-horizontal">
+ <p>
+ <label for="product">
+ {{i18n "discourse_subscriptions.admin.products.product.name"}}
+ </label>
+
+ <Input
+ @type="text"
+ name="product_name"
+ @value={{@controller.model.product.name}}
+ disabled={{true}}
+ />
+ </p>
+
+ <p>
+ <label for="name">
+ {{i18n "discourse_subscriptions.admin.plans.plan.nickname"}}
+ </label>
+
+ <Input
+ @type="text"
+ name="name"
+ @value={{@controller.model.plan.nickname}}
+ />
+
+ <div class="control-instructions">
+ {{i18n "discourse_subscriptions.admin.plans.plan.nickname_help"}}
+ </div>
+ </p>
+
+ <p>
+ <label for="interval">
+ {{i18n "discourse_subscriptions.admin.plans.plan.group"}}
+ </label>
+
+ <ComboBox
+ @valueProperty="name"
+ @content={{@controller.availableGroups}}
+ @value={{@controller.selectedGroup}}
+ @onChange={{fn (mut @controller.model.plan.metadata.group_name)}}
+ />
+
+ <div class="control-instructions">
+ {{i18n "discourse_subscriptions.admin.plans.plan.group_help"}}
+ </div>
+ </p>
+
+ <p>
+ <label for="amount">
+ {{i18n "discourse_subscriptions.admin.plans.plan.amount"}}
+ </label>
+
+ {{#if @controller.planFieldDisabled}}
+ <Input
+ class="plan-amount plan-currency"
+ disabled={{true}}
+ @value={{@controller.model.plan.currency}}
+ />
+ {{else}}
+ <ComboBox
+ @disabled={{@controller.planFieldDisabled}}
+ @content={{@controller.currencies}}
+ @value={{@controller.model.plan.currency}}
+ @onChange={{fn (mut @controller.model.plan.currency)}}
+ />
+ {{/if}}
+
+ <Input
+ class="plan-amount"
+ @type="text"
+ name="name"
+ @value={{@controller.model.plan.amountDollars}}
+ disabled={{@controller.planFieldDisabled}}
+ />
+ </p>
+
+ <p>
+ <label for="recurring">
+ {{i18n "discourse_subscriptions.admin.plans.plan.recurring"}}
+ </label>
+
+ {{#if @controller.planFieldDisabled}}
+ <Input
+ @type="checkbox"
+ name="recurring"
+ @checked={{@controller.model.plan.isRecurring}}
+ disabled={{true}}
+ />
+ {{else}}
+ <Input
+ @type="checkbox"
+ name="recurring"
+ @checked={{@controller.model.plan.isRecurring}}
+ {{on "change" @controller.changeRecurring}}
+ />
+ {{/if}}
+ </p>
+
+ {{#if @controller.model.plan.isRecurring}}
+ <p>
+ <label for="interval">
+ {{i18n "discourse_subscriptions.admin.plans.plan.interval"}}
+ </label>
+
+ {{#if @controller.planFieldDisabled}}
+ <Input disabled={{true}} @value={{@controller.selectedInterval}} />
+ {{else}}
+ <ComboBox
+ @valueProperty="name"
+ @content={{@controller.availableIntervals}}
+ @value={{@controller.selectedInterval}}
+ @onChange={{fn (mut @controller.selectedInterval)}}
+ />
+ {{/if}}
+ </p>
+
+ <p>
+ <label for="trial">
+ {{i18n "discourse_subscriptions.admin.plans.plan.trial"}}
+ ({{i18n "discourse_subscriptions.optional"}})
+ </label>
+
+ <Input
+ @type="text"
+ name="trial"
+ @value={{@controller.model.plan.trial_period_days}}
+ />
+
+ <div class="control-instructions">
+ {{i18n "discourse_subscriptions.admin.plans.plan.trial_help"}}
+ </div>
+ </p>
+ {{/if}}
+
+ <p>
+ <label for="active">
+ {{i18n "discourse_subscriptions.admin.plans.plan.active"}}
+ </label>
+ <Input
+ @type="checkbox"
+ name="active"
+ @checked={{@controller.model.plan.active}}
+ />
+ </p>
+ </form>
+
+ <section>
+ <hr />
+
+ <p class="control-instructions">
+ {{i18n "discourse_subscriptions.admin.plans.operations.create_help"}}
+ </p>
+
+ <div class="pull-right">
+ {{#if @controller.model.plan.isNew}}
+ <DButton
+ @label="discourse_subscriptions.admin.plans.operations.create"
+ @action={{@controller.createPlan}}
+ @icon="plus"
+ class="btn btn-primary"
+ />
+ {{else}}
+ <DButton
+ @label="discourse_subscriptions.admin.plans.operations.update"
+ @action={{@controller.updatePlan}}
+ @icon="check"
+ class="btn btn-primary"
+ />
+ {{/if}}
+ </div>
+ </section>
+ </template>
+);
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products-show.gjs b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products-show.gjs
new file mode 100644
index 00000000000..517b82894d8
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products-show.gjs
@@ -0,0 +1,195 @@
+import { Input, Textarea } from "@ember/component";
+import { array } from "@ember/helper";
+import { LinkTo } from "@ember/routing";
+import RouteTemplate from "ember-route-template";
+import DButton from "discourse/components/d-button";
+import icon from "discourse/helpers/d-icon";
+import { i18n } from "discourse-i18n";
+import formatCurrency from "../../helpers/format-currency";
+import formatUnixDate from "../../helpers/format-unix-date";
+
+export default RouteTemplate(
+ <template>
+ <h4>{{i18n "discourse_subscriptions.admin.products.title"}}</h4>
+
+ <form class="form-horizontal">
+ <p>
+ <label for="name">
+ {{i18n "discourse_subscriptions.admin.products.product.name"}}
+ </label>
+ <Input
+ @type="text"
+ name="name"
+ @value={{@controller.model.product.name}}
+ />
+ </p>
+
+ <p>
+ <label for="description">
+ {{i18n "discourse_subscriptions.admin.products.product.description"}}
+ </label>
+
+ <Textarea
+ name="description"
+ @value={{@controller.model.product.metadata.description}}
+ class="discourse-subscriptions-admin-textarea"
+ />
+
+ <div class="control-instructions">
+ {{i18n
+ "discourse_subscriptions.admin.products.product.description_help"
+ }}
+ </div>
+ </p>
+
+ <p>
+ <label for="statement_descriptor">
+ {{i18n
+ "discourse_subscriptions.admin.products.product.statement_descriptor"
+ }}
+ </label>
+
+ <Input
+ @type="text"
+ name="statement_descriptor"
+ @value={{@controller.model.product.statement_descriptor}}
+ />
+
+ <div class="control-instructions">
+ {{i18n
+ "discourse_subscriptions.admin.products.product.statement_descriptor_help"
+ }}
+ </div>
+ </p>
+
+ <p>
+ <label for="repurchaseable">
+ {{i18n
+ "discourse_subscriptions.admin.products.product.repurchaseable"
+ }}
+ </label>
+
+ <Input
+ @type="checkbox"
+ name="repurchaseable"
+ @checked={{@controller.model.product.metadata.repurchaseable}}
+ />
+
+ <div class="control-instructions">
+ {{i18n
+ "discourse_subscriptions.admin.products.product.repurchase_help"
+ }}
+ </div>
+ </p>
+
+ <p>
+ <label for="active">
+ {{i18n "discourse_subscriptions.admin.products.product.active"}}
+ </label>
+
+ <Input
+ @type="checkbox"
+ name="active"
+ @checked={{@controller.model.product.active}}
+ />
+
+ <div class="control-instructions">
+ {{i18n "discourse_subscriptions.admin.products.product.active_help"}}
+ </div>
+ </p>
+ </form>
+
+ {{#unless @controller.model.product.isNew}}
+ <h4>{{i18n "discourse_subscriptions.admin.plans.title"}}</h4>
+
+ <p>
+ <table class="table discourse-patrons-table">
+ <thead>
+ <th>{{i18n
+ "discourse_subscriptions.admin.plans.plan.nickname"
+ }}</th>
+ <th>{{i18n
+ "discourse_subscriptions.admin.plans.plan.interval"
+ }}</th>
+ <th>{{i18n
+ "discourse_subscriptions.admin.plans.plan.created_at"
+ }}</th>
+ <th>{{i18n "discourse_subscriptions.admin.plans.plan.group"}}</th>
+ <th>{{i18n "discourse_subscriptions.admin.plans.plan.active"}}</th>
+ <th class="td-right">
+ {{i18n "discourse_subscriptions.admin.plans.plan.amount"}}
+ </th>
+ <th class="td-right">
+ <LinkTo
+ @route="adminPlugins.discourse-subscriptions.products.show.plans.show"
+ @models={{array @controller.model.product.id "new"}}
+ class="btn"
+ >
+ {{i18n "discourse_subscriptions.admin.plans.operations.add"}}
+ </LinkTo>
+ </th>
+ </thead>
+
+ <tbody>
+ {{#each @controller.model.plans as |plan|}}
+ <tr>
+ <td>{{plan.nickname}}</td>
+ <td>{{plan.recurring.interval}}</td>
+ <td>{{formatUnixDate plan.created}}</td>
+ <td>{{plan.metadata.group_name}}</td>
+ <td>{{plan.active}}</td>
+ <td class="td-right">
+ {{formatCurrency plan.currency plan.amountDollars}}
+ </td>
+ <td class="td-right">
+ <LinkTo
+ @route="adminPlugins.discourse-subscriptions.products.show.plans.show"
+ @models={{array @controller.model.product.id plan.id}}
+ class="btn no-text btn-icon"
+ >
+ {{icon "far-pen-to-square"}}
+ </LinkTo>
+ </td>
+ </tr>
+ {{else}}
+ <tr>
+ <td colspan="8">
+ <hr />
+ {{i18n
+ "discourse_subscriptions.admin.products.product.plan_help"
+ }}
+ </td>
+ </tr>
+ {{/each}}
+ </tbody>
+ </table>
+ </p>
+ {{/unless}}
+
+ <div class="pull-right">
+ <DButton
+ @label="cancel"
+ @action={{@controller.cancelProduct}}
+ @icon="xmark"
+ />
+
+ {{#if @controller.model.product.isNew}}
+ <DButton
+ @label="discourse_subscriptions.admin.products.operations.create"
+ @action={{@controller.createProduct}}
+ @icon="plus"
+ class="btn btn-primary"
+ />
+ {{else}}
+ <DButton
+ @label="discourse_subscriptions.admin.products.operations.update"
+ @action={{@controller.updateProduct}}
+ @icon="check"
+ class="btn btn-primary"
+ />
+ {{/if}}
+ </div>
+
+ {{outlet}}
+ </template>
+);
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products.gjs b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products.gjs
new file mode 100644
index 00000000000..76ab5bd9893
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products.gjs
@@ -0,0 +1,3 @@
+import RouteTemplate from "ember-route-template";
+
+export default RouteTemplate(<template>{{outlet}}</template>);
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-subscriptions.gjs b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-subscriptions.gjs
new file mode 100644
index 00000000000..5ef264ec013
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-subscriptions.gjs
@@ -0,0 +1,105 @@
+import { fn } from "@ember/helper";
+import RouteTemplate from "ember-route-template";
+import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";
+import DButton from "discourse/components/d-button";
+import LoadMore from "discourse/components/load-more";
+import loadingSpinner from "discourse/helpers/loading-spinner";
+import { i18n } from "discourse-i18n";
+import formatUnixDate from "../../helpers/format-unix-date";
+
+export default RouteTemplate(
+ <template>
+ {{#if @controller.model.unconfigured}}
+ <p>{{i18n "discourse_subscriptions.admin.unconfigured"}}</p>
+ <p>
+ <a href="https://meta.discourse.org/t/discourse-subscriptions/140818/">
+ {{i18n "discourse_subscriptions.admin.on_meta"}}
+ </a>
+ </p>
+ {{else}}
+ <LoadMore
+ @selector=".discourse-patrons-table tr"
+ @action={{@controller.loadMore}}
+ >
+ <table class="table discourse-patrons-table">
+ <thead>
+ <tr>
+ <th>
+ {{i18n
+ "discourse_subscriptions.admin.subscriptions.subscription.user"
+ }}
+ </th>
+ <th>
+ {{i18n
+ "discourse_subscriptions.admin.subscriptions.subscription.subscription_id"
+ }}
+ </th>
+ <th>
+ {{i18n
+ "discourse_subscriptions.admin.subscriptions.subscription.customer"
+ }}
+ </th>
+ <th>
+ {{i18n
+ "discourse_subscriptions.admin.subscriptions.subscription.product"
+ }}
+ </th>
+ <th>
+ {{i18n
+ "discourse_subscriptions.admin.subscriptions.subscription.plan"
+ }}
+ </th>
+ <th>
+ {{i18n
+ "discourse_subscriptions.admin.subscriptions.subscription.status"
+ }}
+ </th>
+ <th class="td-right">
+ {{i18n
+ "discourse_subscriptions.admin.subscriptions.subscription.created_at"
+ }}
+ </th>
+ <th></th>
+ </tr>
+ </thead>
+
+ <tbody>
+ {{#each @controller.model.data as |subscription|}}
+ <tr>
+ <td>
+ {{#if subscription.metadataUserExists}}
+ <a href={{subscription.subscriptionUserPath}}>
+ {{subscription.metadata.username}}
+ </a>
+ {{/if}}
+ </td>
+ <td>{{subscription.id}}</td>
+ <td>{{subscription.customer}}</td>
+ <td>{{subscription.plan.product.name}}</td>
+ <td>{{subscription.plan.nickname}}</td>
+ <td>{{subscription.status}}</td>
+ <td class="td-right">
+ {{formatUnixDate subscription.created}}
+ </td>
+ <td class="td-right">
+ {{#if subscription.loading}}
+ {{loadingSpinner size="small"}}
+ {{else}}
+ <DButton
+ @disabled={{subscription.canceled}}
+ @label="cancel"
+ @action={{fn @controller.showCancelModal subscription}}
+ @icon="xmark"
+ />
+ {{/if}}
+ </td>
+ </tr>
+ {{/each}}
+ </tbody>
+ </table>
+ </LoadMore>
+
+ <ConditionalLoadingSpinner @condition={{@controller.loading}} />
+ {{/if}}
+ </template>
+);
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions.gjs b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions.gjs
new file mode 100644
index 00000000000..8c77742ec06
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions.gjs
@@ -0,0 +1,62 @@
+import RouteTemplate from "ember-route-template";
+import DButton from "discourse/components/d-button";
+import NavItem from "discourse/components/nav-item";
+import { i18n } from "discourse-i18n";
+
+export default RouteTemplate(
+ <template>
+ <h2>{{i18n
+ "discourse_subscriptions.title"
+ }}</h2>
+
+ {{#if @controller.stripeConfigured}}
+ <div class="discourse-subscriptions-buttons">
+ {{#if @controller.campaignEnabled}}
+ <DButton
+ @label="discourse_subscriptions.campaign.refresh_campaign"
+ @icon="rotate"
+ @action={{@controller.triggerManualRefresh}}
+ />
+ {{else}}
+ {{#unless @controller.campaignProductSet}}
+ <DButton
+ @label="discourse_subscriptions.campaign.one_click_campaign"
+ @icon="square-plus"
+ @action={{@controller.createOneClickCampaign}}
+ @isLoading={{@controller.loading}}
+ />
+ {{/unless}}
+ {{/if}}
+ </div>
+
+ <ul class="nav nav-pills">
+ <NavItem
+ @route="adminPlugins.discourse-subscriptions.products"
+ @label="discourse_subscriptions.admin.products.title"
+ />
+ <NavItem
+ @route="adminPlugins.discourse-subscriptions.coupons"
+ @label="discourse_subscriptions.admin.coupons.title"
+ />
+ <NavItem
+ @route="adminPlugins.discourse-subscriptions.subscriptions"
+ @label="discourse_subscriptions.admin.subscriptions.title"
+ />
+ </ul>
+
+ <hr />
+
+ <div id="discourse-subscriptions-admin">
+ {{outlet}}
+ </div>
+ {{else}}
+ <p>{{i18n "discourse_subscriptions.admin.unconfigured"}}</p>
+ <p>
+ <a href="https://meta.discourse.org/t/discourse-subscriptions/140818/">
+ {{i18n "discourse_subscriptions.admin.on_meta"}}
+ </a>
+ </p>
+ {{/if}}
+ </template>
+);
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/subscribe.gjs b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/subscribe.gjs
new file mode 100644
index 00000000000..21ab138781d
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/subscribe.gjs
@@ -0,0 +1,18 @@
+import RouteTemplate from "ember-route-template";
+import { i18n } from "discourse-i18n";
+
+export default RouteTemplate(
+ <template>
+ <div class="container">
+ <div class="title-wrapper">
+ <h1>
+ {{i18n "discourse_subscriptions.subscribe.title"}}
+ </h1>
+ </div>
+
+ <hr />
+
+ {{outlet}}
+ </div>
+ </template>
+);
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/subscribe/index.gjs b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/subscribe/index.gjs
new file mode 100644
index 00000000000..10b8ac0621a
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/subscribe/index.gjs
@@ -0,0 +1,16 @@
+import RouteTemplate from "ember-route-template";
+import LoginRequired from "../../components/login-required";
+import ProductList from "../../components/product-list";
+
+export default RouteTemplate(
+ <template>
+ {{#unless @controller.isLoggedIn}}
+ <LoginRequired />
+ {{/unless}}
+
+ <ProductList
+ @products={{@controller.model}}
+ @isLoggedIn={{@controller.isLoggedIn}}
+ />
+ </template>
+);
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/subscribe/show.gjs b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/subscribe/show.gjs
new file mode 100644
index 00000000000..1c52936657c
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/subscribe/show.gjs
@@ -0,0 +1,151 @@
+import { Input } from "@ember/component";
+import { LinkTo } from "@ember/routing";
+import RouteTemplate from "ember-route-template";
+import DButton from "discourse/components/d-button";
+import htmlSafe from "discourse/helpers/html-safe";
+import loadingSpinner from "discourse/helpers/loading-spinner";
+import { i18n } from "discourse-i18n";
+import LoginRequired from "../../components/login-required";
+import PaymentOptions from "../../components/payment-options";
+import SubscribeCaProvinceSelect from "../../components/subscribe-ca-province-select";
+import SubscribeCard from "../../components/subscribe-card";
+import SubscribeCountrySelect from "../../components/subscribe-country-select";
+import SubscribeUsStateSelect from "../../components/subscribe-us-state-select";
+
+export default RouteTemplate(
+ <template>
+ <div class="discourse-subscriptions-section-columns">
+ <div class="section-column discourse-subscriptions-confirmation-billing">
+ <h2>
+ {{@controller.model.product.name}}
+ </h2>
+
+ <hr />
+
+ <p>
+ {{htmlSafe @controller.model.product.description}}
+ </p>
+ </div>
+
+ <div class="section-column">
+ {{#if @controller.canPurchase}}
+ <h2>
+ {{i18n "discourse_subscriptions.subscribe.card.title"}}
+ </h2>
+
+ <hr />
+
+ <PaymentOptions
+ @plans={{@controller.model.plans}}
+ @selectedPlan={{@controller.selectedPlan}}
+ />
+
+ <hr />
+
+ <SubscribeCard @cardElement={{@controller.cardElement}} />
+
+ {{#if @controller.loading}}
+ {{loadingSpinner}}
+ {{else if @controller.isAnonymous}}
+ <LoginRequired />
+ {{else}}
+ <Input
+ @type="text"
+ name="cardholder_name"
+ placeholder={{i18n
+ "discourse_subscriptions.subscribe.cardholder_name"
+ }}
+ @value={{@controller.cardholderName}}
+ class="subscribe-name"
+ />
+ <div class="address-fields">
+ <SubscribeCountrySelect
+ @value={{@controller.cardholderAddress.country}}
+ @onChange={{@controller.changeCountry}}
+ />
+ <Input
+ @type="text"
+ name="cardholder_postal_code"
+ placeholder={{i18n
+ "discourse_subscriptions.subscribe.cardholder_address.postal_code"
+ }}
+ @value={{@controller.cardholderAddress.postalCode}}
+ class="subscribe-address-postal-code"
+ />
+ </div>
+ <Input
+ @type="text"
+ name="cardholder_line1"
+ placeholder={{i18n
+ "discourse_subscriptions.subscribe.cardholder_address.line1"
+ }}
+ @value={{@controller.cardholderAddress.line1}}
+ class="subscribe-address-line1"
+ />
+ <div class="address-fields">
+ <Input
+ @type="text"
+ name="cardholder_city"
+ placeholder={{i18n
+ "discourse_subscriptions.subscribe.cardholder_address.city"
+ }}
+ @value={{@controller.cardholderAddress.city}}
+ class="subscribe-address-city"
+ />
+ {{#if @controller.isCountryUS}}
+ <SubscribeUsStateSelect
+ @value={{@controller.cardholderAddress.state}}
+ @onChange={{@controller.changeState}}
+ />
+ {{else if @controller.isCountryCA}}
+ <SubscribeCaProvinceSelect
+ @value={{@controller.cardholderAddress.state}}
+ @onChange={{@controller.changeState}}
+ />
+ {{else}}
+ <Input
+ @type="text"
+ name="cardholder_state"
+ placeholder={{i18n
+ "discourse_subscriptions.subscribe.cardholder_address.state"
+ }}
+ @value={{@controller.cardholderAddress.state}}
+ class="subscribe-address-state"
+ />
+ {{/if}}
+ </div>
+
+ <Input
+ @type="text"
+ name="promo_code"
+ placeholder={{i18n
+ "discourse_subscriptions.subscribe.promo_code"
+ }}
+ @value={{@controller.promoCode}}
+ class="subscribe-promo-code"
+ />
+
+ <DButton
+ @disabled={{@controller.loading}}
+ @action={{@controller.stripePaymentHandler}}
+ class="btn btn-primary btn-payment"
+ @label="discourse_subscriptions.plans.payment_button"
+ />
+ {{/if}}
+ {{else}}
+ <h2>{{i18n
+ "discourse_subscriptions.subscribe.already_purchased"
+ }}</h2>
+
+ <LinkTo
+ @route="user.billing.subscriptions"
+ @model={{@controller.currentUser.username}}
+ class="btn btn-primary"
+ >
+ {{i18n "discourse_subscriptions.subscribe.go_to_billing"}}
+ </LinkTo>
+ {{/if}}
+ </div>
+ </div>
+ </template>
+);
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/subscriptions.gjs b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/subscriptions.gjs
new file mode 100644
index 00000000000..2654419debf
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/subscriptions.gjs
@@ -0,0 +1,14 @@
+import RouteTemplate from "ember-route-template";
+import LoginRequired from "../components/login-required";
+
+export default RouteTemplate(
+ <template>
+ <div class="container">
+ {{#if @controller.currentUser}}
+ {{@controller.pricingTable}}
+ {{else}}
+ <LoginRequired />
+ {{/if}}
+ </div>
+ </template>
+);
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/user/billing.gjs b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/user/billing.gjs
new file mode 100644
index 00000000000..370041b21a8
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/user/billing.gjs
@@ -0,0 +1,35 @@
+import { LinkTo } from "@ember/routing";
+import RouteTemplate from "ember-route-template";
+import MobileNav from "discourse/components/mobile-nav";
+import bodyClass from "discourse/helpers/body-class";
+import { i18n } from "discourse-i18n";
+
+export default RouteTemplate(
+ <template>
+ {{bodyClass "user-billing-page"}}
+
+ <section class="user-secondary-navigation">
+ <MobileNav
+ @desktopClass="action-list nav-stacked"
+ @currentPath={{@controller.router._router.currentPath}}
+ class="activity-nav"
+ >
+ <li>
+ <LinkTo @route="user.billing.subscriptions">
+ {{i18n "discourse_subscriptions.navigation.subscriptions"}}
+ </LinkTo>
+ </li>
+
+ <li>
+ <LinkTo @route="user.billing.payments">
+ {{i18n "discourse_subscriptions.navigation.payments"}}
+ </LinkTo>
+ </li>
+ </MobileNav>
+ </section>
+
+ <section class="user-content">
+ {{outlet}}
+ </section>
+ </template>
+);
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/user/billing/index.gjs b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/user/billing/index.gjs
new file mode 100644
index 00000000000..1d7d7b5ac82
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/user/billing/index.gjs
@@ -0,0 +1,3 @@
+import RouteTemplate from "ember-route-template";
+
+export default RouteTemplate(<template>BILLING INDEX</template>);
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/user/billing/payments.gjs b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/user/billing/payments.gjs
new file mode 100644
index 00000000000..46efe531e2c
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/user/billing/payments.gjs
@@ -0,0 +1,31 @@
+import RouteTemplate from "ember-route-template";
+import { i18n } from "discourse-i18n";
+import formatCurrency from "../../../helpers/format-currency";
+import formatUnixDate from "../../../helpers/format-unix-date";
+
+export default RouteTemplate(
+ <template>
+ {{#if @controller.model}}
+ <table class="table discourse-subscriptions-user-table">
+ <thead>
+ <th>{{i18n "discourse_subscriptions.user.payments.id"}}</th>
+ <th>{{i18n "discourse_subscriptions.user.payments.amount"}}</th>
+ <th>{{i18n "discourse_subscriptions.user.payments.created_at"}}</th>
+ </thead>
+ <tbody>
+ {{#each @controller.model as |payment|}}
+ <tr>
+ <td>{{payment.id}}</td>
+ <td>{{formatCurrency payment.currency payment.amountDollars}}</td>
+ <td>{{formatUnixDate payment.created}}</td>
+ </tr>
+ {{/each}}
+ </tbody>
+ </table>
+ {{else}}
+ <div class="alert alert-info">
+ {{i18n "discourse_subscriptions.user.payments_help"}}
+ </div>
+ {{/if}}
+ </template>
+);
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/user/billing/subscriptions/card.gjs b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/user/billing/subscriptions/card.gjs
new file mode 100644
index 00000000000..1c5a2a0a626
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/user/billing/subscriptions/card.gjs
@@ -0,0 +1,28 @@
+import RouteTemplate from "ember-route-template";
+import SaveControls from "discourse/components/save-controls";
+import { i18n } from "discourse-i18n";
+import SubscribeCard from "../../../../components/subscribe-card";
+
+export default RouteTemplate(
+ <template>
+ <h3>{{i18n
+ "discourse_subscriptions.user.subscriptions.update_card.heading"
+ }}</h3>
+
+ <div class="form-vertical">
+ <div class="control-group">
+ <SubscribeCard
+ @cardElement={{@controller.cardElement}}
+ class="input-xxlarge"
+ />
+ </div>
+
+ <SaveControls
+ @action={{@controller.updatePaymentMethod}}
+ @saved={{@controller.saved}}
+ @saveDisabled={{@controller.loading}}
+ />
+ </div>
+ </template>
+);
diff --git a/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/user/billing/subscriptions/index.gjs b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/user/billing/subscriptions/index.gjs
new file mode 100644
index 00000000000..2b727a7d468
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/javascripts/discourse/templates/user/billing/subscriptions/index.gjs
@@ -0,0 +1,70 @@
+import RouteTemplate from "ember-route-template";
+import DButton from "discourse/components/d-button";
+import loadingSpinner from "discourse/helpers/loading-spinner";
+import routeAction from "discourse/helpers/route-action";
+import { i18n } from "discourse-i18n";
+import formatUnixDate from "../../../../helpers/format-unix-date";
+
+export default RouteTemplate(
+ <template>
+ {{#if @controller.model}}
+ <table class="table discourse-subscriptions-user-table">
+ <thead>
+ <th>{{i18n "discourse_subscriptions.user.subscriptions.id"}}</th>
+ <th>{{i18n "discourse_subscriptions.user.plans.product"}}</th>
+ <th>{{i18n "discourse_subscriptions.user.plans.rate"}}</th>
+ <th>{{i18n
+ "discourse_subscriptions.user.subscriptions.discounted"
+ }}</th>
+ <th>{{i18n "discourse_subscriptions.user.subscriptions.status"}}</th>
+ <th>{{i18n "discourse_subscriptions.user.subscriptions.renews"}}</th>
+ <th>{{i18n
+ "discourse_subscriptions.user.subscriptions.created_at"
+ }}</th>
+ <th></th>
+ </thead>
+ <tbody>
+ {{#each @controller.model as |subscription|}}
+ <tr>
+ <td>{{subscription.id}}</td>
+ <td>{{subscription.product.name}}</td>
+ <td>{{subscription.plan.subscriptionRate}}</td>
+ <td>{{subscription.discounted}}</td>
+ <td>{{subscription.status}}</td>
+ <td>{{subscription.endDate}}</td>
+ <td>{{formatUnixDate subscription.created}}</td>
+ <td class="td-right">
+ {{#if subscription.loading}}
+ {{loadingSpinner size="small"}}
+ {{else}}
+ {{#if subscription.canceled_at}}
+ <DButton
+ @disabled={{subscription.canceled_at}}
+ @label="discourse_subscriptions.user.subscriptions.cancelled"
+ />
+ {{else}}
+ <DButton
+ @action={{routeAction "updateCard" subscription.id}}
+ @icon="far-pen-to-square"
+ class="btn no-text btn-icon"
+ />
+ <DButton
+ class="btn-danger btn no-text btn-icon"
+ @icon="trash-can"
+ @disabled={{subscription.canceled_at}}
+ @action={{routeAction "cancelSubscription" subscription}}
+ />
+ {{/if}}
+ {{/if}}
+ </td>
+ </tr>
+ {{/each}}
+ </tbody>
+ </table>
+ {{else}}
+ <div class="alert alert-info">
+ {{i18n "discourse_subscriptions.user.subscriptions_help"}}
+ </div>
+ {{/if}}
+ </template>
+);
diff --git a/plugins/discourse-subscriptions/assets/stylesheets/common/campaign.scss b/plugins/discourse-subscriptions/assets/stylesheets/common/campaign.scss
new file mode 100644
index 00000000000..c1358537ec1
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/stylesheets/common/campaign.scss
@@ -0,0 +1,462 @@
+@use "lib/viewport";
+/* stylelint-disable scss/no-global-function-names */
+.subscription-campaign-sidebar {
+ #main-outlet
+ .container.list-container
+ .row:nth-of-type(2)
+ .full-width
+ #list-area
+ .contents {
+ display: grid;
+ grid-template-columns: 78% calc(22% - 2em);
+ grid-template-areas: "content sidebar";
+ grid-column-gap: 2em;
+
+ span:first-of-type {
+ grid-area: sidebar;
+ }
+ }
+}
+
+// Sidebar Version
+.subscriptions-campaign-sidebar .campaign-banner {
+ width: 100%;
+ flex-direction: column;
+ position: relative;
+
+ .btn.close {
+ position: absolute;
+ top: 1em;
+ right: 1em;
+ font-size: 10px;
+ z-index: 1;
+ }
+
+ .campaign-banner-info {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ width: calc(100% - 2em);
+ padding: 1em 1em 2em 1em;
+ position: relative;
+
+ &-header {
+ font-size: $font-up-5;
+ margin: 0 !important;
+ text-align: center;
+ }
+
+ &-description {
+ width: 100%;
+ font-size: $font-down-1;
+ text-align: center;
+ margin-bottom: 1em;
+ }
+ }
+
+ .campaign-banner-progress {
+ width: calc(100% - 2em);
+ margin: 1em 0;
+ padding: 1em;
+
+ &-users {
+ align-items: stretch;
+ display: flex;
+ flex-direction: column;
+ margin: 0;
+
+ &-title {
+ font-size: $font-down-1;
+
+ strong {
+ font-weight: bold;
+ }
+ }
+ }
+ }
+
+ .campaign-banner-info-button {
+ height: 2em;
+ }
+
+ progress[value] {
+ height: 1.5em;
+ }
+
+ .campaign-banner-progress-description {
+ font-size: $font-down-1;
+ }
+}
+
+// Hide from showing above main container outlet
+// on topic list
+body.archetype-regular {
+ .above-main-container-outlet.subscriptions-campaign {
+ display: none;
+ }
+}
+
+// Above Topic List version
+.campaign-banner {
+ display: flex;
+ width: 100%;
+ margin: 1em 0 2em 0;
+ border: 1px solid var(--primary-low);
+ position: relative;
+ align-items: stretch;
+ box-shadow: 5px 5px
+ var(--discourse_subscriptions_campaign_banner_shadow_color);
+
+ @include viewport.until(md) {
+ width: 98%;
+ flex-direction: column;
+ }
+
+ .btn.close {
+ position: absolute;
+ top: 1em;
+ right: 1em;
+ font-size: 10px;
+ background-color: transparent;
+ padding: 0;
+
+ &:hover {
+ .d-icon {
+ color: var(--primary);
+ }
+ }
+ }
+
+ &-info {
+ width: 30%;
+ padding: 2em;
+ background-color: var(--primary-very-low);
+
+ @include viewport.until(md) {
+ width: calc(100% - 4em);
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ padding-bottom: 1em;
+ }
+
+ &-header {
+ font-size: $font-up-4;
+ margin: 0;
+
+ @include viewport.until(md) {
+ font-size: $font-up-3;
+ }
+ }
+
+ &-success {
+ width: 100%;
+ margin: 0;
+ }
+
+ &-description {
+ width: 100%;
+ margin: 0.25em 0 1em 0;
+
+ @include viewport.until(md) {
+ font-size: $font-down-1;
+ text-align: center;
+ }
+ }
+
+ &-button {
+ grid-area: right;
+ height: 2.5em;
+ padding: 0.75em 1.5em 0.75em 2.75em;
+ position: relative;
+
+ .d-icon {
+ position: absolute;
+ left: 1em;
+
+ &.hover-heart {
+ opacity: 0;
+ transition: opacity 0.2s ease-in-out;
+ }
+ }
+
+ &:hover {
+ .d-icon.hover-heart {
+ opacity: 1;
+ }
+ }
+ }
+ }
+
+ &-progress {
+ width: 60%;
+ padding: 1.5em 2em 1.5em;
+ display: flex;
+ flex-flow: column;
+ justify-content: center;
+
+ @include viewport.until(md) {
+ width: calc(100% - 4em);
+ }
+
+ &-success {
+ height: 32px;
+ background: linear-gradient(
+ -45deg,
+ var(--tertiary-hover),
+ var(--tertiary-medium),
+ var(--tertiary-hover),
+ var(--tertiary-medium)
+ );
+ border-radius: 2em;
+ margin: 0;
+ background-size: 400% 100%;
+ animation: gradient 15s ease infinite;
+ }
+
+ &-description {
+ margin: 0.5em 0 0;
+ font-weight: 300;
+
+ strong {
+ font-weight: bold;
+ }
+ }
+
+ &-users {
+ align-items: center;
+ display: inline-flex;
+ margin: 0 0 -2em 0;
+
+ &-title {
+ strong {
+ font-weight: bold;
+ }
+ }
+
+ &-avatars {
+ margin: 0 0 0 0.5em;
+ }
+ }
+
+ progress[value] {
+ appearance: none;
+ height: 2.5em;
+ width: 100%;
+ border: 1px solid #e5e5e5;
+ border-radius: 2em;
+ background-color: var(--primary-very-low);
+ overflow: hidden;
+ }
+
+ progress[value]::-webkit-progress-bar {
+ background-color: var(--primary-very-low);
+ }
+
+ progress[value]::-webkit-progress-value {
+ background-color: var(--tertiary);
+ border-top-right-radius: 2em;
+ border-bottom-right-radius: 2em;
+ }
+
+ progress[value]::-moz-progress-bar {
+ background-color: var(--tertiary);
+ border-top-right-radius: 2em;
+ border-bottom-right-radius: 2em;
+ }
+ }
+}
+
+html:not(.mobile-view) {
+ .subscriptions-campaign,
+ .subscriptions-campaign-sidebar,
+ .subscriptions-campaign-topic-footer {
+ .goal-met .campaign-banner {
+ .campaign-banner-info {
+ &-description {
+ margin: 1em auto !important;
+ }
+ }
+ }
+ }
+}
+
+// Stack buttons and container on mobile
+html.mobile-view #topic-footer-buttons {
+ display: flex;
+ flex-direction: column;
+}
+
+// Topic Footer Version
+html:not(.mobile-view) .subscriptions-campaign-topic-footer .campaign-banner {
+ margin-top: 2em;
+ width: calc(var(--d-max-width) * 0.87);
+
+ @include viewport.until(lg) {
+ width: auto;
+ }
+
+ .btn.close {
+ top: 1em;
+ right: 1em;
+ }
+}
+
+// Topic Footer Version + Sidebar visible
+@media screen and (width <= 1285px) {
+ html:not(.mobile-view)
+ body.has-sidebar-page
+ .subscriptions-campaign-topic-footer
+ .campaign-banner {
+ width: auto;
+ }
+}
+
+// CSS Animations for campaign Success
+@keyframes gradient {
+ 0% {
+ background-position: 0% 50%;
+ }
+
+ 50% {
+ background-position: 100% 50%;
+ }
+
+ 100% {
+ background-position: 0% 50%;
+ }
+}
+
+/* Fireworks (modified to fit modern SASS standards)
+ Copyright (c) 2020 by Eddie Lin (https://codepen.io/yshlin/pen/ylDEk)
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+$particles: 50;
+$width: 500;
+$halfwidth: calc($width / 2);
+$height: 250;
+$heightpartial: calc($height / 1.2);
+
+// Create the explosion...
+$box-shadow: ();
+
+@for $i from 0 through $particles {
+ $box-shadow:
+ $box-shadow,
+ random($width) -
+ $halfwidth +
+ px
+ random($height) -
+ $heightpartial +
+ px
+ hsl(random(360), 100%, 50%);
+}
+
+@mixin keyframes($animationName) {
+ @keyframes #{$animationName} {
+ @content;
+ }
+
+ @keyframes #{$animationName} {
+ @content;
+ }
+
+ @keyframes #{$animationName} {
+ @content;
+ }
+
+ @keyframes #{$animationName} {
+ @content;
+ }
+
+ @keyframes #{$animationName} {
+ @content;
+ }
+}
+
+@mixin animation-delay($settings) {
+ animation-delay: $settings;
+}
+
+@mixin animation-duration($settings) {
+ animation-duration: $settings;
+}
+
+@mixin animation($settings) {
+ animation: $settings;
+}
+
+@mixin transform($settings) {
+ transform: $settings;
+}
+
+body:not(.archetype-regular, .success-animation-off) {
+ .fireworks > .before,
+ .fireworks > .after {
+ position: absolute;
+ width: 5px;
+ height: 5px;
+ border-radius: 50%;
+
+ @include animation(
+ (
+ 1s bang ease-out 1s 2 backwards,
+ 1s gravity ease-in 1s 2 backwards,
+ 5s position ease-in-out 1s 1 backwards
+ )
+ );
+ }
+}
+
+.fireworks > .after {
+ @include animation-delay((1.25s, 1.25s, 1.25s));
+ @include animation-duration((1.25s, 1.25s, 1.25s));
+}
+
+@include keyframes(bang) {
+ to {
+ box-shadow: $box-shadow;
+ }
+}
+
+@include keyframes(gravity) {
+ to {
+ @include transform(translateY(200px));
+ opacity: 0;
+ }
+}
+
+@include keyframes(position) {
+ 0%,
+ 19.9% {
+ margin-top: -2%;
+ margin-left: -43%;
+ }
+
+ 20%,
+ 39.9% {
+ margin-top: 2%;
+ margin-left: -18%;
+ }
+
+ 40%,
+ 59.9% {
+ margin-top: 0%;
+ margin-left: 0%;
+ }
+
+ 60%,
+ 79.9% {
+ margin-top: 4%;
+ margin-left: 18%;
+ }
+
+ 80%,
+ 99.9% {
+ margin-top: 6%;
+ margin-left: 56%;
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/stylesheets/common/layout.scss b/plugins/discourse-subscriptions/assets/stylesheets/common/layout.scss
new file mode 100644
index 00000000000..fabc7c7b59e
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/stylesheets/common/layout.scss
@@ -0,0 +1,79 @@
+@use "lib/viewport";
+
+.discourse-subscriptions-section-columns {
+ display: flex;
+ justify-content: space-between;
+ margin: 20px;
+ padding: 20px;
+
+ @include viewport.until(lg) {
+ flex-direction: column;
+ margin: 0;
+ padding: 0.5em;
+ }
+
+ .section-column {
+ min-width: calc(50% - 0.5em);
+ max-width: 100%;
+
+ &:last-child {
+ margin-left: 0.5em;
+ }
+
+ &:first-child {
+ margin-right: 0.5em;
+ }
+
+ @include viewport.until(lg) {
+ min-width: 100%;
+
+ &:last-child {
+ order: 2;
+ margin-left: 0;
+ }
+
+ &:first-child {
+ order: 1;
+ margin-right: 0;
+ }
+ }
+ }
+}
+
+.product-list {
+ display: flex;
+ flex-flow: row wrap;
+ justify-content: center;
+
+ .product {
+ display: flex;
+ flex-flow: column nowrap;
+ border: 1px solid var(--primary-low);
+ padding: 1.5rem;
+ margin: 1rem;
+ width: calc(50% - 240px);
+
+ .product-description {
+ flex-grow: 1;
+ }
+
+ .product-purchase {
+ display: flex;
+ flex-flow: row wrap;
+ justify-content: space-between;
+
+ .purchased {
+ color: var(--success);
+ }
+
+ .billing-link {
+ align-self: flex-end;
+ font-size: $font-down-1;
+
+ @include viewport.until(lg) {
+ margin-top: 1em;
+ }
+ }
+ }
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/stylesheets/common/main.scss b/plugins/discourse-subscriptions/assets/stylesheets/common/main.scss
new file mode 100644
index 00000000000..cfde9e3d047
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/stylesheets/common/main.scss
@@ -0,0 +1,81 @@
+// TODO: This gets overridden somewhere. It is defined in common/base/discourse.scss
+input[disabled],
+input[readonly],
+select[disabled],
+select[readonly],
+textarea[disabled],
+textarea[readonly] {
+ cursor: not-allowed;
+ background-color: #e9e9e9;
+ border-color: #e9e9e9;
+}
+
+.admin-plugins.discourse-subscriptions .discourse-subscriptions-buttons {
+ margin: 1em 0 2.5em;
+}
+
+#discourse-subscriptions-admin {
+ .btn-right {
+ text-align: right;
+ }
+
+ .align-buttons {
+ display: flex;
+ justify-content: flex-end;
+
+ .btn {
+ margin-right: 5px;
+ }
+ }
+
+ .btn-primary.create-coupon {
+ margin-top: 1em;
+ }
+}
+
+.plan-amount {
+ position: relative;
+ top: 2px;
+}
+
+.plan-currency {
+ width: 70px;
+}
+
+.td-right {
+ text-align: right;
+}
+
+table.discourse-subscriptions-user-table {
+ width: 100%;
+
+ th,
+ td {
+ padding-top: 8px;
+ padding-bottom: 8px;
+ padding-left: 8px;
+ }
+
+ th:first-child,
+ td:first-child {
+ padding-left: 0;
+ }
+}
+
+.discourse-subscriptions-admin-textarea {
+ width: 80%;
+}
+
+#stripe-elements {
+ border: 1px solid var(--primary-low-mid);
+ padding: 10px;
+ background-color: var(--primary-very-low);
+}
+
+#card-action {
+ margin: 20px 0;
+}
+
+.discourse-subscriptions-confirmation-billing {
+ margin-right: 40px;
+}
diff --git a/plugins/discourse-subscriptions/assets/stylesheets/common/subscribe.scss b/plugins/discourse-subscriptions/assets/stylesheets/common/subscribe.scss
new file mode 100644
index 00000000000..c8b8b49648f
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/stylesheets/common/subscribe.scss
@@ -0,0 +1,74 @@
+.subscribe-buttons {
+ align-items: stretch;
+ display: flex;
+ flex-flow: row wrap;
+ justify-content: left;
+
+ .btn-discourse-subscriptions-subscribe {
+ flex-direction: column;
+ flex-grow: 1;
+ margin: 0.25em;
+ padding: 1em;
+ width: 6em;
+ }
+}
+
+.btn-payment {
+ width: 100%;
+}
+
+.anon #card-element {
+ display: none;
+}
+
+.StripeElement {
+ box-sizing: border-box;
+ padding: 10px;
+ height: 40px;
+ margin-bottom: 9px;
+ border: 1px solid var(--primary-medium);
+ background-color: var(--secondary);
+ font-size: $base-font-size;
+ font-family: $base-font-family;
+}
+
+.StripeElement--focus {
+ border-color: var(--tertiary);
+ outline: 1px solid var(--tertiary);
+}
+
+.StripeElement--invalid {
+ border-color: var(--danger);
+}
+
+.StripeElement--webkit-autofill {
+ color: var(--quaternary);
+}
+
+.subscribe-promo-code,
+.subscribe-name,
+.subscribe-address-line1,
+.subscribe-address-city,
+.subscribe-address-state,
+.subscribe-address-country-select,
+.subscribe-address-state-select,
+.subscribe-address-postal-code {
+ width: 100%;
+}
+
+.subscribe-address-country-select,
+.subscribe-address-state-select {
+ margin-bottom: 9px;
+}
+
+@media all and (width >= 1350px) {
+ .address-fields {
+ display: flex;
+ justify-content: space-between;
+
+ & > input,
+ & > .select-kit {
+ width: calc(50% - 4.5px);
+ }
+ }
+}
diff --git a/plugins/discourse-subscriptions/assets/stylesheets/mobile/main.scss b/plugins/discourse-subscriptions/assets/stylesheets/mobile/main.scss
new file mode 100644
index 00000000000..61f588fa8fe
--- /dev/null
+++ b/plugins/discourse-subscriptions/assets/stylesheets/mobile/main.scss
@@ -0,0 +1,9 @@
+.mobile-view {
+ .product-list {
+ flex-flow: column nowrap;
+
+ .product {
+ width: unset;
+ }
+ }
+}
diff --git a/plugins/discourse-subscriptions/config/locales/client.ar.yml b/plugins/discourse-subscriptions/config/locales/client.ar.yml
new file mode 100644
index 00000000000..4bd214f975f
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.ar.yml
@@ -0,0 +1,484 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ar:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_subscriptions: "اشتراكات Discourse"
+ site_settings:
+ discourse_subscriptions_enabled: تفعيل المكوِّن الإضافي "اشتراكات Discourse".
+ discourse_subscriptions_extra_nav_subscribe: عرض زر الاشتراك في التنقل الأساسي
+ discourse_subscriptions_pricing_table_id: أضِف pricing-table-id من الرمز البرمجي لتضمين جدول التسعير هنا.
+ discourse_subscriptions_pricing_table_enabled: سيُظهر زر الاشتراك جدول التسعير المضمَّن وسيتم استخدام "الدفع بواسطة Stripe".
+ discourse_subscriptions_public_key: مفتاح قابل للنشر من Stripe
+ discourse_subscriptions_secret_key: مفتاح سري من Stripe
+ discourse_subscriptions_webhook_secret: سر خطاف ويب من Stripe
+ discourse_subscriptions_currency: رمز العملة الافتراضي. يمكن تجاوز هذا عند إنشاء خطة اشتراك.
+ discourse_subscriptions_campaign_enabled: يفعِّل بانر حملة للترويج لدعم هذا المجتمع ماديًا.
+ discourse_subscriptions_campaign_goal: الهدف العددي لحملة الدعم الخاصة بك (المشتركون أو المبلغ الذي تم جمعه).
+ discourse_subscriptions_campaign_type: يحدِّد نوع الحملة المراد تشغيلها (المشتركون أو المبلغ الشهري الذي تم جمعه).
+ discourse_subscriptions_campaign_banner_location: يحدِّد موقع بانر الحملة (الشريط العلوي أو الجانبي).
+ discourse_subscriptions_campaign_banner_shadow_color: يحدِّد لون الظل الخلفي لبانر الحملة.
+ discourse_subscriptions_campaign_banner_bg_image: تحميل صورة مخصَّصة لاستخدامها كخلفية في بانر الحملة
+ discourse_subscriptions_campaign_show_contributors: عرض الصور الرمزية لأحدث المشتريات من منتجات الاشتراكات
+ discourse_subscriptions_campaign_product: مُعرِّف منتج Stripe الذي سيتم إرساله إلى الداعمين عندما ينقرون على الزر في الحملة. إذا كان هذا الإعداد فارغًا، فسيتم توجيه الداعمين إلى الصفحة الرئيسية للمنتجات.
+ discourse_subscriptions_enable_automatic_tax: تفعيل الحساب التلقائي للضريبة، والذي سيحسب تلقائيًا معدلات الضريبة على جميع الفواتير الناتجة عن الاشتراك.
+ discourse_subscriptions_enable_verbose_logging: يتيح تسجيلًا أكثر تفصيلًا للمساعدة في تصحيح الأخطاء. يُرجى عدم تركه مفعَّلًا بشكلٍ دائم في الإنتاج.
+ errors:
+ discourse_patrons_amount_must_be_currency: "يجب أن تكون مبالغ العملات عبارة عن عملات دون رمز الدولار (مثل 1.50)"
+ js:
+ filters:
+ subscribe:
+ help: ادعم هذا الموقع عن طريق الاشتراك
+ discourse_subscriptions:
+ title: اشتراكات Discourse
+ admin_navigation: الاشتراكات
+ optional: اختياري
+ navigation:
+ billing: الفوترة
+ payments: المدفوعات
+ subscriptions: الاشتراكات
+ subscribe: اشتراك
+ user_activity:
+ payments: المدفوعات
+ campaign:
+ title: ادعمنا
+ body: نحن بحاجة إلى مساعدتك للحفاظ على هذا المجتمع قائمًا!
+ success_title: تم بنجاح!
+ success_body: شكرًا لك على مساعدتك في الحفاظ على هذا المجتمع قائمًا!
+ subscribers: المشتركون
+ goal_comparison: "<strong>%{current}</strong> من <strong>%{goal}</strong>"
+ raised: تم جمعه
+ button: الدعم
+ recent_contributors: آخر المساهمين
+ goal: لقد حقَّقنا هدفنا
+ one_click_campaign: إنشاء حملة دعم تلقائيًا
+ refresh_campaign: تحديث بيانات الحملة
+ refresh_page: تتم الآن مزامنة بيانات الحملة من Stripe في الخلفية. حدِّث الصفحة خلال لحظات لتحميل المعلومات المحدَّثة.
+ supporter: الداعم
+ supporters: الداعمون
+ confirm_creation_title: هل تريد إنشاء حملة لمجتمعك تلقائيًا؟
+ confirm_creation: |-
+ <p>ستؤدي المتابعة إلى إنشاء:</p>
+
+ <ul>
+ <li>مجموعة لمكافأة داعميك بلقب مخصَّص وطابع للصورة الرمزية</li>
+ <li>أحد منتجات Stripe بأسعار محدَّدة مُسبقًا (شهريًا وسنويًا) يمكن لمستخدمين شرائها لدعم موقعك.</li>
+ </ul>
+
+ <p>هل ترغب في المتابعة؟</p>
+ created: تم إنشاء حملتك ذات النقرة الواحدة وهي جاهزة للانطلاق! جارٍ إعادة التوجيه إلى إعدادات الحملة.
+ one_time_payment: الدفع لمرة واحدة
+ plans:
+ purchase: شراء اشتراك
+ select: تحديد خطة اشتراك
+ interval:
+ adverb:
+ day: يوميًا
+ week: أسبوعيًا
+ month: شهريًا
+ year: سنويًا
+ payment_button: اشتراك
+ success: شكرًا لك! تم إنشاء اشتراكك.
+ incomplete: الدفع غير مكتمل. سيتم تحديث اشتراكك عند اكتمال الدفع.
+ validate:
+ payment_options:
+ required: يُرجى تحديد خطة اشتراك.
+ user:
+ payments:
+ id: مُعرِّف الدفع
+ amount: المبلغ
+ created_at: تاريخ الإنشاء
+ payments_help: لا توجد مدفوعات
+ plans:
+ rate: السعر
+ product: الاسم
+ subscriptions_help: ليس لديك أي اشتراكات نشطة.
+ subscriptions:
+ id: مُعرِّف الإشتراك
+ status: الحالة
+ discounted: مخفَّض
+ renews: يتجدَّد في
+ update_card:
+ heading: "تحديث البطاقة للاشتراك: %{sub_id}"
+ single: "تحديث"
+ created_at: تاريخ الإنشاء
+ cancel: إلغاء
+ cancelled: تم الإلغاء
+ operations:
+ destroy:
+ confirm: هل تريد بالتأكيد إلغاء هذا الاشتراك؟
+ subscribe:
+ title: اشتراك
+ view_past: عرض المشتريات السابقة
+ no_products: لا توجد أي منتجات متوفرة حاليًا.
+ unauthenticated: سجِّل الدخول أو أنشئ حسابًا للاشتراك.
+ invalid_coupon: لقد أدخلت رمز قسيمة غير صالح. يُرجى إعادة المحاولة.
+ invalid_cardholder_name: اسم حامل البطاقة مطلوب.
+ invalid_cardholder_country: البلد مطلوب.
+ invalid_cardholder_state: الحالة مطلوبة.
+ invalid_cardholder_province: المقاطعة مطلوبة.
+ transaction_error: حدث خطأ في أثناء معالجة الدفع. يُرجى إعادة المحاولة.
+ card:
+ title: الدفع
+ customer:
+ title: تفاصيل العميل
+ promo_code: القسيمة
+ buttons:
+ subscribe: اشتراك
+ purchased: تم الشراء
+ go_to_billing: الانتقال إلى الفوترة
+ already_purchased: شكرًا جزيلًا على عملية الشراء السابقة لهذا المنتج!
+ cardholder_name: اسم حامل البطاقة
+ cardholder_address:
+ line1: عنوان الشارع
+ city: المدينة
+ state: الحالة
+ province: المقاطعة
+ country: البلد
+ postal_code: الرمز البريدي
+ countries:
+ AF: "أفغانستان"
+ AX: "جزر آلاند"
+ AL: "ألبانيا"
+ DZ: "الجزائر"
+ AS: "ساموا الأمريكية"
+ AD: "أندورا"
+ AO: "أنجولا"
+ AI: "أنغيلا"
+ AQ: "أنتاركتيكا"
+ AG: "أنتيغوا وبربودا"
+ AR: "الأرجنتين"
+ AM: "أرمينيا"
+ AW: "أروبا"
+ AU: "أستراليا"
+ AT: "النمسا"
+ AZ: "أزربيجان"
+ BS: "جزر البهاما"
+ BH: "البحرين"
+ BD: "بنجلاديش"
+ BB: "باربادوس"
+ BY: "بيلاروسيا"
+ BE: "بلجيكا"
+ BZ: "بيليز"
+ BJ: "بنين"
+ BM: "برمودا"
+ BT: "بوتان"
+ BO: "دولة بوليفيا متعددة القوميات"
+ BQ: "بونير وسينت أوستاتيوس وسابا"
+ BA: "البوسنة والهرسك"
+ BW: "بتسوانا"
+ BV: "جزيرة بوفيت"
+ BR: "البرازيل"
+ IO: "إقليم المحيط الهندي البريطاني"
+ BN: "بروناي دار السلام"
+ BG: "بلغاريا"
+ BF: "بوركينا فاسو"
+ BI: "بوروندي"
+ KH: "كامبوديا"
+ CM: "الكاميرون"
+ CA: "كندا"
+ CV: "الرأس الأخضر"
+ KY: "جزر الكايمان"
+ CF: "إفريقيا الوسطى"
+ TD: "تشاد"
+ CL: "تشيلي"
+ CN: "الصين"
+ CX: "جزيرة الكريسماس"
+ CC: "جزر كوكوس (كيلينغ)"
+ CO: "كولوميبا"
+ KM: "جزر القمر"
+ CG: "الكونغو"
+ CD: "جمهورية الكونغو الديمقراطية"
+ CK: "جزر كوك"
+ CR: "كوستاريكا"
+ CI: "كوت ديفوار"
+ HR: "كرواتيا"
+ CU: "كوبا"
+ CW: "كوراساو"
+ CY: "قبرص"
+ CZ: "جمهورية التشيك"
+ DK: "الدنمارك"
+ DJ: "جيبوتي"
+ DM: "دومينيكا"
+ DO: "جمهورية الدومينيكان"
+ EC: "الإكوادور"
+ EG: "مصر"
+ SV: "السلفادور"
+ GQ: "غينيا الاستوائية"
+ ER: "أريتريا"
+ EE: "إستونيا"
+ ET: "إثيوبيا"
+ FK: "جزر فوكلاند (مالفيناس)"
+ FO: "جزر فارو"
+ FJ: "فيجي"
+ FI: "فنلندا"
+ FR: "فرنسا"
+ GF: "غينيا الفرنسية"
+ PF: "بولينيزيا الفرنسية"
+ TF: "الأراضي الفرنسية الجنوبية"
+ GA: "الجابون"
+ GM: "جامبيا"
+ GE: "جورجيا"
+ DE: "ألمانيا"
+ GH: "غانا"
+ GI: "جبل طارق"
+ GR: "اليونان"
+ GL: "جرينلاند"
+ GD: "غرينادا"
+ GP: "غوادلوب"
+ GU: "جوام"
+ GT: "غواتيمالا"
+ GG: "غيرنزي"
+ GN: "غينيا"
+ GW: "غينيا بيساو"
+ GY: "غويانا"
+ HT: "هايتي"
+ HM: "جزيرة هيرد وجزر ماكدونالد"
+ VA: "الكرسي الرسولي (دولة مدينة الفاتيكان)"
+ HN: "هندوراس"
+ HK: "هونغ كونغ"
+ HU: "المجر"
+ IS: "أيسلندا"
+ IN: "الهند"
+ ID: "إندونيسيا"
+ IR: "جمهورية إيران الإسلامية"
+ IQ: "العراق"
+ IE: "إيرلندا"
+ IM: "جزيرة مان"
+ IL: "إسرائيل"
+ IT: "إيطاليا"
+ JM: "جامايكا"
+ JP: "اليابان"
+ JE: "جيرسي"
+ JO: "الأردن"
+ KZ: "كازاخستان"
+ KE: "كينيا"
+ KI: "كيريباس"
+ KP: "جمهورية كوريا الديموقراطية الشعبية"
+ KR: "جمهورية كوريا"
+ KW: "الكويت"
+ KG: "قرغيزستان"
+ LA: "جمهورية لاو الديموقراطية الشعبية"
+ LV: "لاتفيا"
+ LB: "لبنان"
+ LS: "ليسوتو"
+ LR: "ليبيريا"
+ LY: "ليبيا"
+ LI: "ليختنشتاين"
+ LT: "ليتوانيا"
+ LU: "لوكسمبورغ"
+ MO: "ماكاو"
+ MK: "جمهورية مقدونيا اليوغوسلافية السابقة"
+ MG: "مدغشقر"
+ MW: "مالاوي"
+ MY: "ماليزيا"
+ MV: "جزر المالديف"
+ ML: "مالي"
+ MT: "مالطا"
+ MH: "جزر مارشال"
+ MQ: "مارتينيك"
+ MR: "موريتانيا"
+ MU: "موريشيوس"
+ YT: "مايوت"
+ MX: "المكسيك"
+ FM: "ولايات ميكرونيسيا المتحدة"
+ MD: "جمهورية مولدوفا"
+ MC: "موناكو"
+ MN: "منغوليا"
+ ME: "مونتينيغرو"
+ MS: "مونتسرات"
+ MA: "المغرب"
+ MZ: "موزمبيق"
+ MM: "ميانمار"
+ NA: "ناميبيا"
+ NR: "ناورو"
+ NP: "نيبال"
+ NL: "هولندا"
+ NC: "كاليدونيا الجديدة"
+ NZ: "نيوزيلندا"
+ NI: "نيكاراغوا"
+ NE: "النيجر"
+ NG: "نيجيريا"
+ NU: "نيوي"
+ NF: "جزيرة نورفولك"
+ MP: "جزر مريانا الشمالية"
+ "NO": "النرويج"
+ OM: "عمان"
+ PK: "باكستان"
+ PW: "بالاو"
+ PS: "الأراضي الفلسطينية المحتلة"
+ PA: "بنما"
+ PG: "بابوا غينيا الجديدة"
+ PY: "باراجواي"
+ PE: "بيرو"
+ PH: "الفلبين"
+ PN: "بيتكيرن"
+ PL: "بولندا"
+ PT: "البرتغال"
+ PR: "بورتوريكو"
+ QA: "قطر"
+ RE: "ريونيون"
+ RO: "رومانيا"
+ RU: "روسيا الاتحادية"
+ RW: "رواندا"
+ BL: "سانت بارتيليمي"
+ SH: "سانت هيلينا وأسينشين وتريستان دا كونا"
+ KN: "سانت كيتس ونيفيس"
+ LC: "سانت لوسيا"
+ MF: "سانت مارتن (الفرنسية)"
+ PM: "سان بيار وميكلون"
+ VC: "سانت فينسنت والغرينادين"
+ WS: "ساموا"
+ SM: "سان مارينو"
+ ST: "ساو تومي وبرينسيبي"
+ SA: "السعودية"
+ SN: "السنغال"
+ RS: "صربيا"
+ SC: "سيشيل"
+ SL: "سيراليون"
+ SG: "سنغافورة"
+ SX: "سانت مارتن (الهولندية)"
+ SK: "سلوفاكيا"
+ SI: "سلوفينيا"
+ SB: "جزر سليمان"
+ SO: "الصومال"
+ ZA: "جنوب إفريقيا"
+ GS: "جورجيا الجنوبية وجزر ساندويتش الجنوبية"
+ SS: "جنوب السودان"
+ ES: "إسبانيا"
+ LK: "سريلانكا"
+ SD: "السودان"
+ SR: "سورينام"
+ SJ: "سفالبارد ويان ماين"
+ SZ: "إسواتيني"
+ SE: "السويد"
+ CH: "سويسرا"
+ SY: "الجمهورية العربية السورية"
+ TW: "مقاطعة تايوان، جمهورية الصين الشعبية"
+ TJ: "طاجيكستان"
+ TZ: "جمهورية تنزانيا الاتحادية"
+ TH: "تايلاند"
+ TL: "تيمور الشرقية"
+ TG: "توجو"
+ TK: "توكيلاو"
+ TO: "تونجا"
+ TT: "ترينيداد وتوباغو"
+ TN: "تونس"
+ TR: "ديك رومي"
+ TM: "تركمانستان"
+ TC: "جزر تركس وكايكوس"
+ TV: "توفالو"
+ UG: "أوغندا"
+ UA: "أوكرانيا"
+ AE: "الإمارات العربية المتحدة"
+ GB: "المملكة المتحدة"
+ US: "الولايات المتحدة"
+ UM: "جزر الولايات المتحدة النائية"
+ UY: "الأوروجواي"
+ UZ: "أوزبكستان"
+ VU: "فانواتو"
+ VE: "جمهورية فنزويلا البوليفارية"
+ VN: "فيتنام"
+ VG: "جزر فيرجن البريطانية"
+ VI: "جزر فيرجن الأمريكية"
+ WF: "واليس وفوتونا"
+ EH: "الصحراء الغربية"
+ YE: "اليمن"
+ ZM: "زامبيا"
+ ZW: "زيمبابوي"
+ billing:
+ name: الاسم بالكامل
+ email: البريد الإلكتروني
+ phone: رقم الهاتف
+ confirmation:
+ amount: المبلغ
+ last4: رقم البطاقة
+ buttons:
+ make_payment: إجراء الدفع
+ confirm_payment: تأكيد الدفع
+ success: العودة
+ admin:
+ unconfigured: 'لم يتم إعداد Stripe بشكلٍ صحيح. يُرجى الاطلاع على Discourse Meta للحصول على المعلومات.'
+ on_meta: اشتراكات Discourse على Meta
+ dashboard:
+ title: لوحة المعلومات
+ table:
+ head:
+ user: المستخدم
+ payment_intent: مُعرِّف الدفع
+ receipt_email: الرسالة الإلكترونية للإيصال
+ amount: المبلغ
+ products:
+ title: المنتجات
+ operations:
+ create: إنشاء منتج جديد
+ update: تحديث المنتج
+ new: منتج جديد
+ destroy:
+ confirm: هل تريد بالتأكيد تدمير هذا المنتج؟
+ product:
+ product_id: مُعرِّف المنتج
+ name: اسم المنتج
+ statement_descriptor: واصف العبارة
+ statement_descriptor_help: ستظهر معلومات إضافية بشأن المنتج في كشف حساب البطاقة الائتمانية للعميل.
+ plan_help: أنشئ خطة أسعار للاشتراك للعملاء في هذا المنتج.
+ description: الوصف
+ description_help: هذا يصف منتج الاشتراك الخاص بك.
+ repurchaseable: هل هو قابل لإعادة الشراء؟
+ repurchase_help: السماح بشراء المنتج والخطط المرتبطة به عدة مرات
+ active: نشط
+ active_help: شغِّل هذا الخيار حتى يصبح منتجك جاهزًا للمستهلكين.
+ created_at: تاريخ الإنشاء
+ updated_at: تاريخ التحديث
+ product_help: أنت بحاجة إلى إنشاء منتج واحد على الأقل وخطة مرتبطة به قبل أن يتمكن العملاء من الاشتراك في موقعك.
+ plans:
+ title: خطط الأسعار
+ operations:
+ add: إضافة خطة جديدة
+ create: إنشاء خطة
+ update: تحديث الخطة
+ create_help: بعد إنشاء خطة أسعار، لا يمكن تحديث أي تفاصيل سوى الاسم المستعار والفترة التجريبية ومجموعة المستخدمين.
+ new: خطة جديدة
+ destroy:
+ confirm: هل تريد بالتأكيد تدمير هذه الخطة؟
+ plan:
+ nickname: الاسم المستعار للخطة
+ nickname_help: لن يكون هذا مرئيًا للعملاء، لكنه سيساعدك في العثور على هذه الخطة لاحقًا
+ plan_id: مُعرِّف الخطة
+ product: المنتج
+ interval: فترة الفوترة
+ amount: المبلغ
+ trial: عدد أيام الفترة التجريبية
+ trial_help: ستبدأ الاشتراكات في هذه الخطة تلقائيًا بفترة تجريبية مجانية بهذا الطول
+ group: مجموعة المستخدمين
+ group_help: هذه هي مجموعة مستخدمي Discourse التي تمت إضافة العميل إليها عند إنشاء الاشتراك.
+ active: نشط
+ created_at: تاريخ الإنشاء
+ recurring: هل هي خطة متكررة؟
+ coupons:
+ title: القسائم
+ code: الرمز الترويجي
+ discount: الخصم
+ times_redeemed: عدد مرات الاسترداد
+ active: نشط؟
+ actions: الإجراءات
+ create: إنشاء قسيمة
+ promo_code: الرمز الترويجي (حساس لحالة الأحرف)
+ subscriptions:
+ title: الاشتراكات
+ subscription:
+ user: المستخدم
+ subscription_id: مُعرِّف الاشتراك
+ customer: العميل
+ product: المنتج
+ plan: الخطة
+ status: الحالة
+ created_at: تاريخ الإنشاء
+ ask_refund: هل تريد رد أموال آخر عملية دفع أجراها العميل؟
+ canceled: "تم إلغاء الاشتراك."
diff --git a/plugins/discourse-subscriptions/config/locales/client.be.yml b/plugins/discourse-subscriptions/config/locales/client.be.yml
new file mode 100644
index 00000000000..ed93ffe95a8
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.be.yml
@@ -0,0 +1,52 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+be:
+ js:
+ discourse_subscriptions:
+ campaign:
+ success_title: поспех!
+ plans:
+ interval:
+ adverb:
+ day: штодня
+ week: штотыдзень
+ month: штомесяц
+ year: штогод
+ user:
+ payments:
+ created_at: створаны
+ plans:
+ product: Імя
+ subscriptions:
+ status: Статус
+ created_at: створаны
+ cancel: адмена
+ billing:
+ email: Электронная пошта
+ admin:
+ dashboard:
+ title: Галоўная панэль
+ table:
+ head:
+ user: Карыстальнік
+ products:
+ product:
+ description: Апісанне
+ active: актыўны
+ created_at: створаны
+ plans:
+ plan:
+ active: актыўны
+ created_at: створаны
+ coupons:
+ active: актыўны?
+ actions: дзеянні
+ subscriptions:
+ subscription:
+ user: Карыстальнік
+ status: Статус
+ created_at: створаны
diff --git a/plugins/discourse-subscriptions/config/locales/client.bg.yml b/plugins/discourse-subscriptions/config/locales/client.bg.yml
new file mode 100644
index 00000000000..8c50de90bce
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.bg.yml
@@ -0,0 +1,53 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+bg:
+ js:
+ discourse_subscriptions:
+ optional: По избор
+ plans:
+ interval:
+ adverb:
+ day: Дневно
+ week: Седмично
+ month: Месечно
+ year: Годишно
+ user:
+ payments:
+ created_at: Създадени
+ plans:
+ product: Име
+ subscriptions:
+ status: Статус
+ update_card:
+ single: "Актуализация"
+ created_at: Създадени
+ cancel: прекрати
+ billing:
+ email: Имейл
+ admin:
+ dashboard:
+ title: Работен плот
+ table:
+ head:
+ user: Потребител
+ products:
+ product:
+ description: Описание
+ active: Активни
+ created_at: Създадени
+ plans:
+ plan:
+ active: Активни
+ created_at: Създадени
+ coupons:
+ active: Активни?
+ actions: Действия
+ subscriptions:
+ subscription:
+ user: Потребител
+ status: Статус
+ created_at: Създадени
diff --git a/plugins/discourse-subscriptions/config/locales/client.bs_BA.yml b/plugins/discourse-subscriptions/config/locales/client.bs_BA.yml
new file mode 100644
index 00000000000..8d711cf1069
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.bs_BA.yml
@@ -0,0 +1,54 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+bs_BA:
+ js:
+ discourse_subscriptions:
+ optional: Opcionalno
+ campaign:
+ success_title: Uspjeh!
+ plans:
+ interval:
+ adverb:
+ day: Dnevno
+ week: Popularne Sedmično
+ month: Popularne Mjesečno
+ year: Popularne Godišnje
+ user:
+ payments:
+ created_at: Kreiran
+ plans:
+ product: Ime
+ subscriptions:
+ status: Status
+ created_at: Kreiran
+ cancel: otkaži
+ billing:
+ email: Email
+ admin:
+ dashboard:
+ title: Dashboard
+ table:
+ head:
+ user: User
+ products:
+ product:
+ description: Opis
+ active: Active
+ created_at: Kreiran
+ updated_at: Ažurirano
+ plans:
+ plan:
+ active: Active
+ created_at: Kreiran
+ coupons:
+ active: Active?
+ actions: Akcije
+ subscriptions:
+ subscription:
+ user: User
+ status: Status
+ created_at: Kreiran
diff --git a/plugins/discourse-subscriptions/config/locales/client.ca.yml b/plugins/discourse-subscriptions/config/locales/client.ca.yml
new file mode 100644
index 00000000000..d59d3e94580
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.ca.yml
@@ -0,0 +1,54 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ca:
+ js:
+ discourse_subscriptions:
+ optional: Opcional
+ campaign:
+ success_title: Èxit!
+ plans:
+ interval:
+ adverb:
+ day: Diàriament
+ week: Setmanalment
+ month: Mensualment
+ year: Anualment
+ user:
+ payments:
+ created_at: Creat
+ plans:
+ product: Nom
+ subscriptions:
+ status: Estat
+ created_at: Creat
+ cancel: cancel·la
+ billing:
+ email: Correu electrònic
+ admin:
+ dashboard:
+ title: Tauler de control
+ table:
+ head:
+ user: Usuari
+ products:
+ product:
+ description: Descripció
+ active: Actiu
+ created_at: Creat
+ updated_at: Actualitzat
+ plans:
+ plan:
+ active: Actiu
+ created_at: Creat
+ coupons:
+ active: Actiu?
+ actions: Accions
+ subscriptions:
+ subscription:
+ user: Usuari
+ status: Estat
+ created_at: Creat
diff --git a/plugins/discourse-subscriptions/config/locales/client.cs.yml b/plugins/discourse-subscriptions/config/locales/client.cs.yml
new file mode 100644
index 00000000000..34ed3f51e28
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.cs.yml
@@ -0,0 +1,56 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+cs:
+ js:
+ discourse_subscriptions:
+ optional: Volitelné
+ campaign:
+ success_title: Úspěch!
+ plans:
+ interval:
+ adverb:
+ day: Denně
+ week: Týdně
+ month: Měsíčně
+ year: Ročně
+ user:
+ payments:
+ created_at: Vytvořený
+ plans:
+ product: Jméno
+ subscriptions:
+ status: Stav
+ update_card:
+ single: "Aktualizovat"
+ created_at: Vytvořený
+ cancel: zrušit
+ billing:
+ email: Email
+ admin:
+ dashboard:
+ title: Rozcestník
+ table:
+ head:
+ user: Uživatel
+ products:
+ product:
+ description: Popis
+ active: Aktivní
+ created_at: Vytvořený
+ updated_at: Aktualizováno
+ plans:
+ plan:
+ active: Aktivní
+ created_at: Vytvořený
+ coupons:
+ active: Aktivní?
+ actions: Akce
+ subscriptions:
+ subscription:
+ user: Uživatel
+ status: Stav
+ created_at: Vytvořený
diff --git a/plugins/discourse-subscriptions/config/locales/client.da.yml b/plugins/discourse-subscriptions/config/locales/client.da.yml
new file mode 100644
index 00000000000..559a593be57
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.da.yml
@@ -0,0 +1,56 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+da:
+ js:
+ discourse_subscriptions:
+ optional: Valgfrit
+ campaign:
+ success_title: Succes!
+ plans:
+ interval:
+ adverb:
+ day: Dagligt
+ week: Ugentligt
+ month: Månedligt
+ year: Årligt
+ user:
+ payments:
+ created_at: Oprettet
+ plans:
+ product: Navn
+ subscriptions:
+ status: Status
+ update_card:
+ single: "Opdater"
+ created_at: Oprettet
+ cancel: annuller
+ billing:
+ email: Email
+ admin:
+ dashboard:
+ title: Dashboard
+ table:
+ head:
+ user: Bruger
+ products:
+ product:
+ description: Beskrivelse
+ active: Aktiv
+ created_at: Oprettet
+ updated_at: Opdateret
+ plans:
+ plan:
+ active: Aktiv
+ created_at: Oprettet
+ coupons:
+ active: Aktiv?
+ actions: Handlinger
+ subscriptions:
+ subscription:
+ user: Bruger
+ status: Status
+ created_at: Oprettet
diff --git a/plugins/discourse-subscriptions/config/locales/client.de.yml b/plugins/discourse-subscriptions/config/locales/client.de.yml
new file mode 100644
index 00000000000..38ca59add12
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.de.yml
@@ -0,0 +1,484 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+de:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_subscriptions: "Discourse – Abonnements"
+ site_settings:
+ discourse_subscriptions_enabled: Aktiviere das Discourse-Subscriptions-Plug-in.
+ discourse_subscriptions_extra_nav_subscribe: Zeige die Schaltfläche „Abonnieren“ in der Hauptnavigation
+ discourse_subscriptions_pricing_table_id: Füge hier die pricing-table-id aus dem Einbettungscode der Preistabelle ein.
+ discourse_subscriptions_pricing_table_enabled: Die Schaltfläche „Abonnieren“ zeigt die eingebettete Preistabelle an und Stripe Checkout wird verwendet.
+ discourse_subscriptions_public_key: Veröffentlichbarer Striple-Schlüssel
+ discourse_subscriptions_secret_key: Geheimer Stripe-Schlüssel
+ discourse_subscriptions_webhook_secret: Stripe-Webhook-Geheimnis
+ discourse_subscriptions_currency: Standardwährungscode. Dieser kann beim Erstellen eines Abonnementplans überschrieben werden.
+ discourse_subscriptions_campaign_enabled: Aktiviert ein Kampagnenbanner, um für die finanzielle Unterstützung dieser Community zu werben.
+ discourse_subscriptions_campaign_goal: Das numerische Ziel für deine Unterstützungskampagne (Abonnenten oder Spendenbetrag).
+ discourse_subscriptions_campaign_type: Wählt die Art der Kampagne aus (Abonnenten oder monatlicher Spendenbetrag).
+ discourse_subscriptions_campaign_banner_location: Wählt die Position des Kampagnenbanners aus (oben oder in der Seitenleiste).
+ discourse_subscriptions_campaign_banner_shadow_color: Wählt die Farbe für den Schlagschatten des Kampagnenbanners aus.
+ discourse_subscriptions_campaign_banner_bg_image: Lade ein benutzerdefiniertes Bild hoch, das als Hintergrund für das Kampagnenbanner verwendet werden soll.
+ discourse_subscriptions_campaign_show_contributors: Zeige Avatare für die zuletzt gekauften Abonnementprodukte.
+ discourse_subscriptions_campaign_product: Die Stripe-Produkt-ID, die an die Unterstützer gesendet werden soll, wenn sie auf die Schaltfläche der Kampagne klicken. Wenn diese Einstellung leer ist, werden die Unterstützer auf die Hauptseite der Produkte weitergeleitet.
+ discourse_subscriptions_enable_automatic_tax: Aktiviert die automatische Steuerberechnung, die automatisch die Steuersätze auf allen durch das Abonnement generierten Rechnungen berechnet.
+ discourse_subscriptions_enable_verbose_logging: Aktiviert eine ausführlichere Protokollierung, um die Fehlersuche zu erleichtern. Bitte lass die Option in der Produktionsumgebung nicht dauerhaft aktiviert.
+ errors:
+ discourse_patrons_amount_must_be_currency: "Währungsbeträge müssen Währungen ohne Dollarzeichen sein (z. B. 1,50)"
+ js:
+ filters:
+ subscribe:
+ help: Unterstütze diese Website, indem du ein Abonnement abschließt
+ discourse_subscriptions:
+ title: Discourse-Abonnements
+ admin_navigation: Abonnements
+ optional: Optional
+ navigation:
+ billing: Abrechnung
+ payments: Zahlungen
+ subscriptions: Abonnements
+ subscribe: Abonnieren
+ user_activity:
+ payments: Zahlungen
+ campaign:
+ title: Unterstütze uns
+ body: Wir brauchen deine Hilfe, um diese Community am Laufen zu halten!
+ success_title: Erfolg!
+ success_body: Vielen Dank für deine Hilfe, diese Community am Laufen zu halten!
+ subscribers: Abonnenten
+ goal_comparison: "<strong>%{current}</strong> von <strong>%{goal}</strong>"
+ raised: Eingenommen
+ button: Unterstützen
+ recent_contributors: Aktuelle Unterstützer
+ goal: Wir haben unser Ziel erreicht
+ one_click_campaign: Unterstützungskampagne automatisch erstellen
+ refresh_campaign: Kampagnendaten aktualisieren
+ refresh_page: Die Kampagnendaten werden jetzt im Hintergrund mit Stripe synchronisiert. Aktualisiere die Seite in ein paar Augenblicken, um die aktualisierten Daten zu laden.
+ supporter: Unterstützer
+ supporters: Unterstützer
+ confirm_creation_title: Möchtest du automatisch eine Kampagne für deine Community erstellen?
+ confirm_creation: |-
+ <p>Wenn du fortfährst, wird Folgendes angelegt:</p>
+
+ <ul>
+ <li>eine Gruppe, um deine Unterstützer mit einem benutzerdefinierten Titel und Avatar-Flair zu belohnen</li>
+ <li>ein Stripe-Produkt mit voreingestellten Preisen (monatlich und jährlich), das Benutzer kaufen können, um deine Website zu unterstützen</li>
+ </ul>
+
+ <p>Möchtest du fortfahren?</p>
+ created: Deine Ein-Klick-Kampagne wurde erstellt und ist bereit! Weiterleitung zu den Kampagneneinstellungen erfolgt.
+ one_time_payment: Einmalige Zahlung
+ plans:
+ purchase: Ein Abonnement abschließen
+ select: Abonnementplan auswählen
+ interval:
+ adverb:
+ day: Täglich
+ week: Wöchentlich
+ month: Monatlich
+ year: Jährlich
+ payment_button: Abonnieren
+ success: Vielen Dank! Dein Abonnement wurde erstellt.
+ incomplete: Die Zahlung ist unvollständig. Dein Abonnement wird aktualisiert, sobald die Zahlung abgeschlossen ist.
+ validate:
+ payment_options:
+ required: Bitte Abonnementplan auswählen.
+ user:
+ payments:
+ id: Zahlungs-ID
+ amount: Betrag
+ created_at: Erstellt
+ payments_help: Es gibt keine Zahlungen
+ plans:
+ rate: Tarif
+ product: Name
+ subscriptions_help: Du hast keine aktiven Abonnements.
+ subscriptions:
+ id: Abonnement-ID
+ status: Status
+ discounted: Ermäßigt
+ renews: Verlängerung am
+ update_card:
+ heading: "Karte für Abonnement aktualisieren: %{sub_id}"
+ single: "Aktualisieren"
+ created_at: Erstellt
+ cancel: kündigen
+ cancelled: gekündigt
+ operations:
+ destroy:
+ confirm: Bist du sicher, dass du dieses Abonnement kündigen möchtest?
+ subscribe:
+ title: Abonnieren
+ view_past: Vergangene Käufe ansehen
+ no_products: Es sind derzeit keine Produkte verfügbar.
+ unauthenticated: Melde dich an oder erstelle ein Konto, um zu abonnieren.
+ invalid_coupon: Du hast einen ungültigen Gutscheincode eingegeben. Bitte versuche es erneut.
+ invalid_cardholder_name: Der Name des Karteninhabers ist erforderlich.
+ invalid_cardholder_country: Land ist erforderlich.
+ invalid_cardholder_state: Staat ist erforderlich.
+ invalid_cardholder_province: Provinz ist erforderlich.
+ transaction_error: Bei der Verarbeitung der Zahlung ist ein Fehler aufgetreten. Bitte versuche es noch einmal.
+ card:
+ title: Zahlung
+ customer:
+ title: Kundendetails
+ promo_code: Gutschein
+ buttons:
+ subscribe: Abonnieren
+ purchased: Gekauft
+ go_to_billing: Zur Abrechnung gehen
+ already_purchased: Vielen Dank, dass du dieses Produkt bereits gekauft hast!
+ cardholder_name: Name des Karteninhabers
+ cardholder_address:
+ line1: Adresse
+ city: Stadt
+ state: Staat
+ province: Provinz
+ country: Land
+ postal_code: Postleitzahl
+ countries:
+ AF: "Afghanistan"
+ AX: "Åland-Inseln"
+ AL: "Albanien"
+ DZ: "Algerien"
+ AS: "Amerikanisch-Samoa"
+ AD: "Andorra"
+ AO: "Angola"
+ AI: "Anguilla"
+ AQ: "Antarktis"
+ AG: "Antigua und Barbuda"
+ AR: "Argentinien"
+ AM: "Armenien"
+ AW: "Aruba"
+ AU: "Australien"
+ AT: "Österreich"
+ AZ: "Aserbaidschan"
+ BS: "Bahamas"
+ BH: "Bahrain"
+ BD: "Bangladesch"
+ BB: "Barbados"
+ BY: "Belarus"
+ BE: "Belgien"
+ BZ: "Belize"
+ BJ: "Benin"
+ BM: "Bermuda"
+ BT: "Bhutan"
+ BO: "Bolivien, plurinationaler Staat"
+ BQ: "Bonaire, Sint Eustatius und Saba"
+ BA: "Bosnien und Herzegowina"
+ BW: "Botsuana"
+ BV: "Bouvetinsel"
+ BR: "Brasilien"
+ IO: "Britisches Territorium im Indischen Ozean"
+ BN: "Brunei Darussalam"
+ BG: "Bulgarien"
+ BF: "Burkina Faso"
+ BI: "Burundi"
+ KH: "Kambodscha"
+ CM: "Kamerun"
+ CA: "Kanada"
+ CV: "Kap Verde"
+ KY: "Kaimaninseln"
+ CF: "Zentralafrikanische Republik"
+ TD: "Tschad"
+ CL: "Chile"
+ CN: "China"
+ CX: "Weihnachtsinsel"
+ CC: "Cocosinseln (Keeling)"
+ CO: "Kolumbien"
+ KM: "Komoren"
+ CG: "Kongo"
+ CD: "Kongo, demokratische Republik"
+ CK: "Cookinseln"
+ CR: "Costa Rica"
+ CI: "Elfenbeinküste"
+ HR: "Kroatien"
+ CU: "Kuba"
+ CW: "Curaçao"
+ CY: "Zypern"
+ CZ: "Tschechische Republik"
+ DK: "Dänemark"
+ DJ: "Dschibuti"
+ DM: "Dominica"
+ DO: "Dominikanische Republik"
+ EC: "Ecuador"
+ EG: "Ägypten"
+ SV: "El Salvador"
+ GQ: "Äquatorialguinea"
+ ER: "Eritrea"
+ EE: "Estland"
+ ET: "Äthiopien"
+ FK: "Falklandinseln (Malwinen)"
+ FO: "Färöer"
+ FJ: "Fidschi"
+ FI: "Finnland"
+ FR: "Frankreich"
+ GF: "Französisch-Guayana"
+ PF: "Französisch-Polynesien"
+ TF: "Französische Südgebiete"
+ GA: "Gabun"
+ GM: "Gambia"
+ GE: "Georgien"
+ DE: "Deutschland"
+ GH: "Ghana"
+ GI: "Gibraltar"
+ GR: "Griechenland"
+ GL: "Grönland"
+ GD: "Grenada"
+ GP: "Guadeloupe"
+ GU: "Guam"
+ GT: "Guatemala"
+ GG: "Guernsey"
+ GN: "Guinea"
+ GW: "Guinea-Bissau"
+ GY: "Guyana"
+ HT: "Haiti"
+ HM: "Heard und McDonaldinseln"
+ VA: "Heiliger Stuhl (Staat Vatikanstadt)"
+ HN: "Honduras"
+ HK: "Hongkong"
+ HU: "Ungarn"
+ IS: "Island"
+ IN: "Indien"
+ ID: "Indonesien"
+ IR: "Iran, islamische Republik"
+ IQ: "Irak"
+ IE: "Irland"
+ IM: "Isle of Man"
+ IL: "Israel"
+ IT: "Italien"
+ JM: "Jamaika"
+ JP: "Japan"
+ JE: "Jersey"
+ JO: "Jordanien"
+ KZ: "Kasachstan"
+ KE: "Kenia"
+ KI: "Kiribati"
+ KP: "Korea, demokratische Volksrepublik"
+ KR: "Korea, Republik"
+ KW: "Kuwait"
+ KG: "Kirgisistan"
+ LA: "Demokratische Volksrepublik Laos"
+ LV: "Lettland"
+ LB: "Libanon"
+ LS: "Lesotho"
+ LR: "Liberia"
+ LY: "Libyen"
+ LI: "Liechtenstein"
+ LT: "Litauen"
+ LU: "Luxemburg"
+ MO: "Macao"
+ MK: "Mazedonien, ehemalige jugoslawische Republik"
+ MG: "Madagaskar"
+ MW: "Malawi"
+ MY: "Malaysia"
+ MV: "Malediven"
+ ML: "Mali"
+ MT: "Malta"
+ MH: "Marshallinseln"
+ MQ: "Martinique"
+ MR: "Mauretanien"
+ MU: "Mauritius"
+ YT: "Mayotte"
+ MX: "Mexiko"
+ FM: "Mikronesien, föderierte Staaten"
+ MD: "Moldau, Republik"
+ MC: "Monaco"
+ MN: "Mongolei"
+ ME: "Montenegro"
+ MS: "Montserrat"
+ MA: "Marokko"
+ MZ: "Mosambik"
+ MM: "Myanmar"
+ NA: "Namibia"
+ NR: "Nauru"
+ NP: "Nepal"
+ NL: "Niederlande"
+ NC: "Neukaledonien"
+ NZ: "Neuseeland"
+ NI: "Nicaragua"
+ NE: "Niger"
+ NG: "Nigeria"
+ NU: "Niue"
+ NF: "Norfolkinsel"
+ MP: "Nördliche Marianen"
+ "NO": "Norwegen"
+ OM: "Oman"
+ PK: "Pakistan"
+ PW: "Palau"
+ PS: "Palästinensisches Gebiet, besetzt"
+ PA: "Panama"
+ PG: "Papua-Neuguinea"
+ PY: "Paraguay"
+ PE: "Peru"
+ PH: "Philippinen"
+ PN: "Pitcairn"
+ PL: "Polen"
+ PT: "Portugal"
+ PR: "Puerto Rico"
+ QA: "Katar"
+ RE: "Réunion"
+ RO: "Rumänien"
+ RU: "Russische Föderation"
+ RW: "Ruanda"
+ BL: "St. Barthélemy"
+ SH: "St. Helena, Ascension und Tristan da Cunha"
+ KN: "St. Kitts und Nevis"
+ LC: "St. Lucia"
+ MF: "St. Martin (französischer Teil)"
+ PM: "St. Pierre und Miquelon"
+ VC: "St. Vincent und die Grenadinen"
+ WS: "Samoa"
+ SM: "San Marino"
+ ST: "São Tomé und Príncipe"
+ SA: "Saudi-Arabien"
+ SN: "Senegal"
+ RS: "Serbien"
+ SC: "Seychellen"
+ SL: "Sierra Leone"
+ SG: "Singapur"
+ SX: "Sint Maarten (holländischer Teil)"
+ SK: "Slowakei"
+ SI: "Slowenien"
+ SB: "Salomoninseln"
+ SO: "Somalia"
+ ZA: "Südafrika"
+ GS: "Südgeorgien und die Südlichen Sandwichinseln"
+ SS: "Südsudan"
+ ES: "Spanien"
+ LK: "Sri Lanka"
+ SD: "Sudan"
+ SR: "Suriname"
+ SJ: "Svalbard und Jan Mayen"
+ SZ: "Swasiland"
+ SE: "Schweden"
+ CH: "Schweiz"
+ SY: "Syrische Arabische Republik"
+ TW: "Taiwan, Provinz China"
+ TJ: "Tadschikistan"
+ TZ: "Tansania, vereinigte Republik"
+ TH: "Thailand"
+ TL: "Timor-Leste"
+ TG: "Togo"
+ TK: "Tokelau"
+ TO: "Tonga"
+ TT: "Trinidad und Tobago"
+ TN: "Tunesien"
+ TR: "Türkei"
+ TM: "Turkmenistan"
+ TC: "Turks- und Caicos-Inseln"
+ TV: "Tuvalu"
+ UG: "Uganda"
+ UA: "Ukraine"
+ AE: "Vereinigte Arabische Emirate"
+ GB: "Vereinigtes Königreich"
+ US: "Vereinigte Staaten"
+ UM: "Kleinere Inselbesitzungen der Vereinigten Staaten"
+ UY: "Uruguay"
+ UZ: "Usbekistan"
+ VU: "Vanuatu"
+ VE: "Venezuela, bolivarische Republik"
+ VN: "Vietnam"
+ VG: "Jungferninseln, britisch"
+ VI: "Jungferninseln, amerikanisch"
+ WF: "Wallis und Futuna"
+ EH: "Westsahara"
+ YE: "Jemen"
+ ZM: "Sambia"
+ ZW: "Simbabwe"
+ billing:
+ name: Vollständiger Name
+ email: E-Mail
+ phone: Telefonnummer
+ confirmation:
+ amount: Betrag
+ last4: Kartennummer
+ buttons:
+ make_payment: Zahlung vornehmen
+ confirm_payment: Zahlung bestätigen
+ success: Zurück
+ admin:
+ unconfigured: 'Stripe ist nicht richtig konfiguriert. Weitere Informationen findest du unter Discourse Meta.'
+ on_meta: Discourse-Abonnements bei Meta
+ dashboard:
+ title: Dashboard
+ table:
+ head:
+ user: Benutzer
+ payment_intent: Zahlungs-ID
+ receipt_email: Belegs-E-Mail
+ amount: Betrag
+ products:
+ title: Produkte
+ operations:
+ create: Neues Produkt erstellen
+ update: Produkt aktualisieren
+ new: Neues Produkt
+ destroy:
+ confirm: Bist du sicher, dass du dieses Produkt löschen willst?
+ product:
+ product_id: Produkt-ID
+ name: Produktname
+ statement_descriptor: Abrechnungsbeschreibung
+ statement_descriptor_help: Zusätzliche Informationen über ein Produkt, die auf der Kreditkartenabrechnung deines Kunden erscheinen.
+ plan_help: Erstelle einen Preisplan, damit Kunden dieses Produkt abonnieren können.
+ description: Beschreibung
+ description_help: Dies beschreibt dein Abonnementprodukt.
+ repurchaseable: Nachkaufbar?
+ repurchase_help: Erlaube den mehrfachen Kauf von Produkten und zugehörigen Plänen
+ active: Aktiv
+ active_help: Schalte dies aus, bis dein Produkt für Verbraucher bereit ist.
+ created_at: Erstellt
+ updated_at: Aktualisiert
+ product_help: Bevor Kunden deine Website abonnieren können, musst du mindestens ein Produkt und einen dazugehörigen Plan erstellen.
+ plans:
+ title: Preispläne
+ operations:
+ add: Neuen Plan hinzufügen
+ create: Plan erstellen
+ update: Plan aktualisieren
+ create_help: Sobald ein Preisplan erstellt wurde, können nur noch sein Spitzname, der Testzeitraum und die Benutzergruppe aktualisiert werden.
+ new: Neuer Plan
+ destroy:
+ confirm: Bist du sicher, dass du diesen Plan löschen willst?
+ plan:
+ nickname: Plan-Spitzname
+ nickname_help: Dies ist für die Kunden nicht sichtbar, hilft dir aber später, den Plan zu finden.
+ plan_id: Plan-ID
+ product: Produkt
+ interval: Abrechnungsintervall
+ amount: Betrag
+ trial: Testzeitraum (Tage)
+ trial_help: Abonnements für diesen Plan beginnen automatisch mit einer kostenlosen Testphase dieser Länge
+ group: Benutzergruppe
+ group_help: Dies ist die Discourse-Benutzergruppe, der der Kunde bei der Erstellung des Abonnements hinzugefügt wird.
+ active: Aktiv
+ created_at: Erstellt
+ recurring: Wiederkehrender Plan?
+ coupons:
+ title: Gutscheine
+ code: Promo-Code
+ discount: Rabatt
+ times_redeemed: Mal eingelöst
+ active: Aktiv?
+ actions: Aktionen
+ create: Gutschein erstellen
+ promo_code: Promo-Code (Groß- und Kleinschreibung wird nicht berücksichtigt)
+ subscriptions:
+ title: Abonnements
+ subscription:
+ user: Benutzer
+ subscription_id: Abonnement-ID
+ customer: Kunde
+ product: Produkt
+ plan: Plan
+ status: Status
+ created_at: Erstellt
+ ask_refund: Die letzte vom Kunden geleistete Zahlung zurückerstatten?
+ canceled: "Das Abonnement wird gekündigt."
diff --git a/plugins/discourse-subscriptions/config/locales/client.el.yml b/plugins/discourse-subscriptions/config/locales/client.el.yml
new file mode 100644
index 00000000000..795b82ce388
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.el.yml
@@ -0,0 +1,59 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+el:
+ js:
+ discourse_subscriptions:
+ optional: Προαιρετικό
+ campaign:
+ success_title: Επιτυχία!
+ plans:
+ interval:
+ adverb:
+ day: Ημερήσιες
+ week: Εβδομαδιαία
+ month: Μηνιαία
+ year: Ετήσια
+ user:
+ payments:
+ created_at: Δημιουργήθηκε
+ plans:
+ product: Όνομα
+ subscriptions:
+ status: Κατάσταση
+ update_card:
+ single: "Ενημέρωση"
+ created_at: Δημιουργήθηκε
+ cancel: ακύρωση
+ subscribe:
+ countries:
+ MS: "Montserrat"
+ billing:
+ email: Διεύθυνση Email
+ admin:
+ dashboard:
+ title: Πίνακας ελέγχου
+ table:
+ head:
+ user: Χρήστης
+ products:
+ product:
+ description: Περιγραφή
+ active: Ενεργοί
+ created_at: Δημιουργήθηκε
+ updated_at: Ενημερώθηκε
+ plans:
+ plan:
+ active: Ενεργοί
+ created_at: Δημιουργήθηκε
+ coupons:
+ active: Ενεργοί?
+ actions: Ενέργειες
+ subscriptions:
+ subscription:
+ user: Χρήστης
+ status: Κατάσταση
+ created_at: Δημιουργήθηκε
diff --git a/plugins/discourse-subscriptions/config/locales/client.en.yml b/plugins/discourse-subscriptions/config/locales/client.en.yml
new file mode 100644
index 00000000000..43fb9b558c8
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.en.yml
@@ -0,0 +1,480 @@
+en:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_subscriptions: "Discourse Subscriptions"
+ site_settings:
+ discourse_subscriptions_enabled: Enable the Discourse Subscriptions plugin.
+ discourse_subscriptions_extra_nav_subscribe: Show the subscribe button in the primary navigation
+ discourse_subscriptions_pricing_table_id: Add the pricing-table-id from the Pricing Table embed code here.
+ discourse_subscriptions_pricing_table_enabled: Subscribe button will show the embedded pricing table and Stripe Checkout will be used.
+ discourse_subscriptions_public_key: Stripe Publishable Key
+ discourse_subscriptions_secret_key: Stripe Secret Key
+ discourse_subscriptions_webhook_secret: Stripe Webhook Secret
+ discourse_subscriptions_currency: Default Currency Code. This can be overridden when creating a subscription plan.
+ discourse_subscriptions_campaign_enabled: Enables a campaign banner to promote supporting this community financially.
+ discourse_subscriptions_campaign_goal: The numerical goal for your support campaign (subscribers or amount raised).
+ discourse_subscriptions_campaign_type: Selects the type of campaign to run (subscribers or monthly amount raised).
+ discourse_subscriptions_campaign_banner_location: Selects the location of the campaign banner (top or sidebar).
+ discourse_subscriptions_campaign_banner_shadow_color: Selects the color of the campaign banner drop shadow.
+ discourse_subscriptions_campaign_banner_bg_image: Upload a custom image to use as the background on the campaign banner.
+ discourse_subscriptions_campaign_show_contributors: Show avatars of the most recent purchases of subscription products.
+ discourse_subscriptions_campaign_product: The Stripe product id to send supporters when they click the button on the campaign. If this setting is blank, supporters will be directed to the main products page.
+ discourse_subscriptions_enable_automatic_tax: Enables automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.
+ discourse_subscriptions_enable_verbose_logging: Enables more verbose logging to aid in debugging. Please do not leave permanently enabled in production.
+
+ errors:
+ discourse_patrons_amount_must_be_currency: "Currency amounts must be currencies without dollar symbol (eg 1.50)"
+ js:
+ filters:
+ subscribe:
+ help: Support this site by subscribing
+ discourse_subscriptions:
+ title: Discourse Subscriptions
+ admin_navigation: Subscriptions
+ optional: Optional
+ navigation:
+ billing: Billing
+ payments: Payments
+ subscriptions: Subscriptions
+ subscribe: Subscribe
+ user_activity:
+ payments: Payments
+ campaign:
+ title: Support Us
+ body: We need your help to keep this community up and running!
+ success_title: Success!
+ success_body: Thank you for your help in keeping this community up and running!
+ subscribers: Subscribers
+ goal_comparison: "<strong>%{current}</strong> of <strong>%{goal}</strong>"
+ raised: Raised
+ button: Support
+ recent_contributors: Recent Contributors
+ goal: We've met our goal
+ one_click_campaign: Auto-Create Support Campaign
+ refresh_campaign: Refresh Campaign Data
+ refresh_page: Campaign data is now syncing from Stripe in the background. Refresh the page in a few moments to load the updated info.
+ supporter: Supporter
+ supporters: Supporters
+ confirm_creation_title: Do you want to automatically create a campaign for your community?
+ confirm_creation: |-
+ <p>Continuing will create:</p>
+
+ <ul>
+ <li>A group to reward your supporters with a custom title and avatar flair</li>
+ <li>A Stripe product with pre-set prices (monthly and annual) your users can purchase to support your site.</li>
+ </ul>
+
+ <p>Do you wish to continue?</p>
+
+ created: Your one-click campaign is created and ready to go! Redirecting to the campaign settings.
+ one_time_payment: One-Time Payment
+ plans:
+ purchase: Purchase a subscription
+ select: Select subscription plan
+ interval:
+ adverb:
+ day: Daily
+ week: Weekly
+ month: Monthly
+ year: Yearly
+ payment_button: Subscribe
+ success: Thank you! Your subscription has been created.
+ incomplete: The payment is incomplete. Your subscription will be updated when payment is complete.
+ validate:
+ payment_options:
+ required: Please select a subscription plan.
+ user:
+ payments:
+ id: Payment ID
+ amount: Amount
+ created_at: Created
+ payments_help: There are no payments
+ plans:
+ rate: Rate
+ product: Name
+ subscriptions_help: You have no active subscriptions.
+ subscriptions:
+ id: Subscription ID
+ status: Status
+ discounted: Discounted
+ renews: Renews
+ update_card:
+ heading: "Update Card for subscription: %{sub_id}"
+ single: "Update"
+ created_at: Created
+ cancel: cancel
+ cancelled: cancelled
+ operations:
+ destroy:
+ confirm: Are you sure you want to cancel this subscription?
+ subscribe:
+ title: Subscribe
+ view_past: View past purchases
+ no_products: There are currently no products available.
+ unauthenticated: Log in or create an account to subscribe.
+ invalid_coupon: You entered an invalid coupon code. Please try again.
+ invalid_cardholder_name: Cardholder name is required.
+ invalid_cardholder_country: Country is required.
+ invalid_cardholder_state: State is required.
+ invalid_cardholder_province: Province is required.
+ transaction_error: There was an error processing the payment. Please try again.
+ card:
+ title: Payment
+ customer:
+ title: Customer Details
+ promo_code: Coupon
+ buttons:
+ subscribe: Subscribe
+ purchased: Purchased
+ go_to_billing: Go to Billing
+ already_purchased: Thanks so much for your prior purchase of this product!
+ cardholder_name: Cardholder Name
+ cardholder_address:
+ line1: Street Address
+ city: City
+ state: State
+ province: Province
+ country: Country
+ postal_code: Postal Code
+ countries:
+ AF: "Afghanistan"
+ AX: "Åland Islands"
+ AL: "Albania"
+ DZ: "Algeria"
+ AS: "American Samoa"
+ AD: "Andorra"
+ AO: "Angola"
+ AI: "Anguilla"
+ AQ: "Antarctica"
+ AG: "Antigua and Barbuda"
+ AR: "Argentina"
+ AM: "Armenia"
+ AW: "Aruba"
+ AU: "Australia"
+ AT: "Austria"
+ AZ: "Azerbaijan"
+ BS: "Bahamas"
+ BH: "Bahrain"
+ BD: "Bangladesh"
+ BB: "Barbados"
+ BY: "Belarus"
+ BE: "Belgium"
+ BZ: "Belize"
+ BJ: "Benin"
+ BM: "Bermuda"
+ BT: "Bhutan"
+ BO: "Bolivia, Plurinational State of"
+ BQ: "Bonaire, Sint Eustatius and Saba"
+ BA: "Bosnia and Herzegovina"
+ BW: "Botswana"
+ BV: "Bouvet Island"
+ BR: "Brazil"
+ IO: "British Indian Ocean Territory"
+ BN: "Brunei Darussalam"
+ BG: "Bulgaria"
+ BF: "Burkina Faso"
+ BI: "Burundi"
+ KH: "Cambodia"
+ CM: "Cameroon"
+ CA: "Canada"
+ CV: "Cape Verde"
+ KY: "Cayman Islands"
+ CF: "Central African Republic"
+ TD: "Chad"
+ CL: "Chile"
+ CN: "China"
+ CX: "Christmas Island"
+ CC: "Cocos (Keeling) Islands"
+ CO: "Colombia"
+ KM: "Comoros"
+ CG: "Congo"
+ CD: "Congo, the Democratic Republic of the"
+ CK: "Cook Islands"
+ CR: "Costa Rica"
+ CI: "Côte d'Ivoire"
+ HR: "Croatia"
+ CU: "Cuba"
+ CW: "Curaçao"
+ CY: "Cyprus"
+ CZ: "Czech Republic"
+ DK: "Denmark"
+ DJ: "Djibouti"
+ DM: "Dominica"
+ DO: "Dominican Republic"
+ EC: "Ecuador"
+ EG: "Egypt"
+ SV: "El Salvador"
+ GQ: "Equatorial Guinea"
+ ER: "Eritrea"
+ EE: "Estonia"
+ ET: "Ethiopia"
+ FK: "Falkland Islands (Malvinas)"
+ FO: "Faroe Islands"
+ FJ: "Fiji"
+ FI: "Finland"
+ FR: "France"
+ GF: "French Guiana"
+ PF: "French Polynesia"
+ TF: "French Southern Territories"
+ GA: "Gabon"
+ GM: "Gambia"
+ GE: "Georgia"
+ DE: "Germany"
+ GH: "Ghana"
+ GI: "Gibraltar"
+ GR: "Greece"
+ GL: "Greenland"
+ GD: "Grenada"
+ GP: "Guadeloupe"
+ GU: "Guam"
+ GT: "Guatemala"
+ GG: "Guernsey"
+ GN: "Guinea"
+ GW: "Guinea-Bissau"
+ GY: "Guyana"
+ HT: "Haiti"
+ HM: "Heard Island and McDonald Islands"
+ VA: "Holy See (Vatican City State)"
+ HN: "Honduras"
+ HK: "Hong Kong"
+ HU: "Hungary"
+ IS: "Iceland"
+ IN: "India"
+ ID: "Indonesia"
+ IR: "Iran, Islamic Republic of"
+ IQ: "Iraq"
+ IE: "Ireland"
+ IM: "Isle of Man"
+ IL: "Israel"
+ IT: "Italy"
+ JM: "Jamaica"
+ JP: "Japan"
+ JE: "Jersey"
+ JO: "Jordan"
+ KZ: "Kazakhstan"
+ KE: "Kenya"
+ KI: "Kiribati"
+ KP: "Korea, Democratic People's Republic of"
+ KR: "Korea, Republic of"
+ KW: "Kuwait"
+ KG: "Kyrgyzstan"
+ LA: "Lao People's Democratic Republic"
+ LV: "Latvia"
+ LB: "Lebanon"
+ LS: "Lesotho"
+ LR: "Liberia"
+ LY: "Libya"
+ LI: "Liechtenstein"
+ LT: "Lithuania"
+ LU: "Luxembourg"
+ MO: "Macao"
+ MK: "Macedonia, the former Yugoslav Republic of"
+ MG: "Madagascar"
+ MW: "Malawi"
+ MY: "Malaysia"
+ MV: "Maldives"
+ ML: "Mali"
+ MT: "Malta"
+ MH: "Marshall Islands"
+ MQ: "Martinique"
+ MR: "Mauritania"
+ MU: "Mauritius"
+ YT: "Mayotte"
+ MX: "Mexico"
+ FM: "Micronesia, Federated States of"
+ MD: "Moldova, Republic of"
+ MC: "Monaco"
+ MN: "Mongolia"
+ ME: "Montenegro"
+ MS: "Montserrat"
+ MA: "Morocco"
+ MZ: "Mozambique"
+ MM: "Myanmar"
+ NA: "Namibia"
+ NR: "Nauru"
+ NP: "Nepal"
+ NL: "Netherlands"
+ NC: "New Caledonia"
+ NZ: "New Zealand"
+ NI: "Nicaragua"
+ NE: "Niger"
+ NG: "Nigeria"
+ NU: "Niue"
+ NF: "Norfolk Island"
+ MP: "Northern Mariana Islands"
+ "NO": "Norway"
+ OM: "Oman"
+ PK: "Pakistan"
+ PW: "Palau"
+ PS: "Palestinian Territory, Occupied"
+ PA: "Panama"
+ PG: "Papua New Guinea"
+ PY: "Paraguay"
+ PE: "Peru"
+ PH: "Philippines"
+ PN: "Pitcairn"
+ PL: "Poland"
+ PT: "Portugal"
+ PR: "Puerto Rico"
+ QA: "Qatar"
+ RE: "Réunion"
+ RO: "Romania"
+ RU: "Russian Federation"
+ RW: "Rwanda"
+ BL: "Saint Barthélemy"
+ SH: "Saint Helena, Ascension and Tristan da Cunha"
+ KN: "Saint Kitts and Nevis"
+ LC: "Saint Lucia"
+ MF: "Saint Martin (French part)"
+ PM: "Saint Pierre and Miquelon"
+ VC: "Saint Vincent and the Grenadines"
+ WS: "Samoa"
+ SM: "San Marino"
+ ST: "Sao Tome and Principe"
+ SA: "Saudi Arabia"
+ SN: "Senegal"
+ RS: "Serbia"
+ SC: "Seychelles"
+ SL: "Sierra Leone"
+ SG: "Singapore"
+ SX: "Sint Maarten (Dutch part)"
+ SK: "Slovakia"
+ SI: "Slovenia"
+ SB: "Solomon Islands"
+ SO: "Somalia"
+ ZA: "South Africa"
+ GS: "South Georgia and the South Sandwich Islands"
+ SS: "South Sudan"
+ ES: "Spain"
+ LK: "Sri Lanka"
+ SD: "Sudan"
+ SR: "Suriname"
+ SJ: "Svalbard and Jan Mayen"
+ SZ: "Swaziland"
+ SE: "Sweden"
+ CH: "Switzerland"
+ SY: "Syrian Arab Republic"
+ TW: "Taiwan, Province of China"
+ TJ: "Tajikistan"
+ TZ: "Tanzania, United Republic of"
+ TH: "Thailand"
+ TL: "Timor-Leste"
+ TG: "Togo"
+ TK: "Tokelau"
+ TO: "Tonga"
+ TT: "Trinidad and Tobago"
+ TN: "Tunisia"
+ TR: "Turkey"
+ TM: "Turkmenistan"
+ TC: "Turks and Caicos Islands"
+ TV: "Tuvalu"
+ UG: "Uganda"
+ UA: "Ukraine"
+ AE: "United Arab Emirates"
+ GB: "United Kingdom"
+ US: "United States"
+ UM: "United States Minor Outlying Islands"
+ UY: "Uruguay"
+ UZ: "Uzbekistan"
+ VU: "Vanuatu"
+ VE: "Venezuela, Bolivarian Republic of"
+ VN: "Viet Nam"
+ VG: "Virgin Islands, British"
+ VI: "Virgin Islands, U.S."
+ WF: "Wallis and Futuna"
+ EH: "Western Sahara"
+ YE: "Yemen"
+ ZM: "Zambia"
+ ZW: "Zimbabwe"
+ billing:
+ name: Full name
+ email: Email
+ phone: Phone Number
+ confirmation:
+ amount: Amount
+ last4: Card number
+ buttons:
+ make_payment: Make payment
+ confirm_payment: Confirm payment
+ success: Go back
+ admin:
+ unconfigured: 'Stripe is not configured correctly. Please see Discourse Meta for information.'
+ on_meta: Discourse Subscriptions on Meta
+ dashboard:
+ title: Dashboard
+ table:
+ head:
+ user: User
+ payment_intent: Payment ID
+ receipt_email: Receipt Email
+ amount: Amount
+ products:
+ title: Products
+ operations:
+ create: Create New Product
+ update: Update Product
+ new: New Product
+ destroy:
+ confirm: Are you sure you want to destroy this product?
+ product:
+ product_id: Product ID
+ name: Product Name
+ statement_descriptor: Statement Descriptor
+ statement_descriptor_help: Extra information about a product which will appear on your customer’s credit card statement.
+ plan_help: Create a pricing plan to subscribe customers to this product.
+ description: Description
+ description_help: This describes your subscription product.
+ repurchaseable: Repurchaseable?
+ repurchase_help: Allow product and associated plans to be purchased multiple times
+ active: Active
+ active_help: Toggle this off until your product is ready for consumers.
+ created_at: Created
+ updated_at: Updated
+ product_help: Before customers can subscribe to your site, you need to create at least one product and an associated plan.
+ plans:
+ title: Pricing Plans
+ operations:
+ add: Add New Plan
+ create: Create Plan
+ update: Update Plan
+ create_help: Once a pricing plan is created, only its nickname, trial period and user group can be updated.
+ new: New Plan
+ destroy:
+ confirm: Are you sure you want to destroy this plan?
+ plan:
+ nickname: Plan Nickname
+ nickname_help: This won't be visible to customers, but will help you find this plan later
+ plan_id: Plan ID
+ product: Product
+ interval: Billing Interval
+ amount: Amount
+ trial: Trial Period Days
+ trial_help: Subscriptions to this plan will automatically start with a free trial of this length
+ group: User Group
+ group_help: This is the discourse user group the customer gets added to when the subscription is created.
+ active: Active
+ created_at: Created
+ recurring: Recurring Plan?
+ coupons:
+ title: Coupons
+ code: Promo Code
+ discount: Discount
+ times_redeemed: Times Redeemed
+ active: Active?
+ actions: Actions
+ create: Create Coupon
+ promo_code: Promo Code (case-insensitive)
+ subscriptions:
+ title: Subscriptions
+ subscription:
+ user: User
+ subscription_id: Subscription ID
+ customer: Customer
+ product: Product
+ plan: Plan
+ status: Status
+ created_at: Created
+ ask_refund: Refund the last payment made by the customer?
+ canceled: "The subscription is canceled."
diff --git a/plugins/discourse-subscriptions/config/locales/client.en_GB.yml b/plugins/discourse-subscriptions/config/locales/client.en_GB.yml
new file mode 100644
index 00000000000..e22a8f60f07
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.en_GB.yml
@@ -0,0 +1,13 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+en_GB:
+ js:
+ discourse_subscriptions:
+ admin:
+ products:
+ product:
+ description: Description
diff --git a/plugins/discourse-subscriptions/config/locales/client.es.yml b/plugins/discourse-subscriptions/config/locales/client.es.yml
new file mode 100644
index 00000000000..798e06a4537
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.es.yml
@@ -0,0 +1,484 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+es:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_subscriptions: "Suscripciones de Discourse"
+ site_settings:
+ discourse_subscriptions_enabled: Habilita el complemento Discourse Subscriptions.
+ discourse_subscriptions_extra_nav_subscribe: Mostrar el botón de suscripción en la navegación principal
+ discourse_subscriptions_pricing_table_id: Añade aquí el pricing-table-id del código de incrustación de la Tabla de precios.
+ discourse_subscriptions_pricing_table_enabled: El botón Suscribir mostrará la tabla de precios incrustada y se utilizará Stripe Checkout.
+ discourse_subscriptions_public_key: Clave publicable de Stripe
+ discourse_subscriptions_secret_key: Clave secreta de Stripe
+ discourse_subscriptions_webhook_secret: Secreto del Webhook de Stripe
+ discourse_subscriptions_currency: Código de moneda predeterminado. Esto puede anularse al crear un plan de suscripción.
+ discourse_subscriptions_campaign_enabled: Permite un banner de campaña para promover el apoyo financiero a esta comunidad.
+ discourse_subscriptions_campaign_goal: El objetivo numérico de tu campaña de apoyo (suscriptores o cantidad recaudada).
+ discourse_subscriptions_campaign_type: Selecciona el tipo de campaña a realizar (suscriptores o cantidad mensual recaudada).
+ discourse_subscriptions_campaign_banner_location: Selecciona la ubicación del banner de la campaña (arriba o en la barra lateral).
+ discourse_subscriptions_campaign_banner_shadow_color: Selecciona el color de la sombra del banner de la campaña.
+ discourse_subscriptions_campaign_banner_bg_image: Sube una imagen personalizada para utilizarla como fondo en el banner de la campaña.
+ discourse_subscriptions_campaign_show_contributors: Muestra los avatares de las compras más recientes de productos de suscripción.
+ discourse_subscriptions_campaign_product: El identificador de producto de Stripe que se enviará a los seguidores cuando hagan clic en el botón de la campaña. Si esta configuración está en blanco, se dirigirá a los colaboradores a la página principal de productos.
+ discourse_subscriptions_enable_automatic_tax: Activa el cálculo automático de impuestos, que calculará automáticamente los tipos impositivos de todas las facturas generadas por la suscripción.
+ discourse_subscriptions_enable_verbose_logging: Permite un registro más detallado para facilitar la depuración. No lo dejes activado permanentemente en producción.
+ errors:
+ discourse_patrons_amount_must_be_currency: "Los importes de moneda deben ser monedas sin el símbolo de dólar (por ejemplo, 1,50)"
+ js:
+ filters:
+ subscribe:
+ help: Apoya este sitio suscribiéndote
+ discourse_subscriptions:
+ title: Discourse Subscriptions
+ admin_navigation: Suscripciones
+ optional: Opcional
+ navigation:
+ billing: Facturación
+ payments: Pagos
+ subscriptions: Suscripciones
+ subscribe: Suscribirse
+ user_activity:
+ payments: Pagos
+ campaign:
+ title: Apóyanos
+ body: '¡Necesitamos tu ayuda para mantener esta comunidad en funcionamiento!'
+ success_title: '¡Éxito!'
+ success_body: '¡Gracias por tu ayuda para mantener esta comunidad en funcionamiento!'
+ subscribers: Suscriptores
+ goal_comparison: "<strong>%{current}</strong> de <strong>%{goal}</strong>"
+ raised: Recaudado
+ button: Apoyar
+ recent_contributors: Colaboradores recientes
+ goal: Hemos cumplido nuestro objetivo
+ one_click_campaign: Crear automáticamente una campaña de apoyo
+ refresh_campaign: Actualizar los datos de la campaña
+ refresh_page: Los datos de la campaña se están sincronizando desde Stripe en segundo plano. Actualiza la página en unos momentos para cargar la información actualizada.
+ supporter: Colaborador
+ supporters: Colaboradores
+ confirm_creation_title: '¿Quieres crear automáticamente una campaña para tu comunidad?'
+ confirm_creation: |-
+ <p>Si continúas, se creará:</p>
+
+ <ul>
+ <li>Un grupo para recompensar a tus colaboradores con un título y un avatar personalizado</li>
+ <li>Un producto de Stripe con precios preestablecidos (mensuales y anuales) que tus usuarios pueden comprar para apoyar tu sitio.</li>
+ </ul>
+
+ <p>¿Deseas continuar?</p>
+ created: '¡Tu campaña de un clic está creada y lista para funcionar! Redirigiendo a la configuración de la campaña.'
+ one_time_payment: Pago único
+ plans:
+ purchase: Comprar una suscripción
+ select: Seleccionar un plan de suscripción
+ interval:
+ adverb:
+ day: Diario
+ week: Semanal
+ month: Mensual
+ year: Anual
+ payment_button: Suscribirse
+ success: '¡Gracias! Se ha creado tu suscripción.'
+ incomplete: El pago está incompleto. Tu suscripción se actualizará cuando se complete el pago.
+ validate:
+ payment_options:
+ required: Selecciona un plan de suscripción.
+ user:
+ payments:
+ id: ID de pago
+ amount: Cantidad
+ created_at: Creado
+ payments_help: No hay pagos
+ plans:
+ rate: Tarifa
+ product: Nombre
+ subscriptions_help: No tienes suscripciones activas.
+ subscriptions:
+ id: ID de suscripción
+ status: Estado
+ discounted: Con descuento
+ renews: Se renueva
+ update_card:
+ heading: "Tarjeta de actualización de la suscripción: %{sub_id}"
+ single: "Actualizar"
+ created_at: Creado
+ cancel: cancelar
+ cancelled: cancelada
+ operations:
+ destroy:
+ confirm: '¿Seguro que quieres cancelar esta suscripción?'
+ subscribe:
+ title: Suscribirse
+ view_past: Ver compras anteriores
+ no_products: No hay productos disponibles en este momento.
+ unauthenticated: Inicia sesión o crea una cuenta para suscribirte.
+ invalid_coupon: Has introducido un código de cupón no válido. Inténtalo de nuevo.
+ invalid_cardholder_name: El nombre del titular de la tarjeta es obligatorio.
+ invalid_cardholder_country: El país es obligatorio.
+ invalid_cardholder_state: El estado es obligatorio.
+ invalid_cardholder_province: La provincia es obligatoria.
+ transaction_error: Se ha producido un error al procesar el pago. Inténtalo de nuevo.
+ card:
+ title: Pago
+ customer:
+ title: Detalles del cliente
+ promo_code: Cupón
+ buttons:
+ subscribe: Suscribir
+ purchased: Comprado
+ go_to_billing: Ir a facturación
+ already_purchased: '¡Muchas gracias por la compra previa de este producto!'
+ cardholder_name: Nombre del titular de la tarjeta
+ cardholder_address:
+ line1: Dirección
+ city: Ciudad
+ state: Estado
+ province: Provincia
+ country: País
+ postal_code: Código postal
+ countries:
+ AF: "Afganistán"
+ AX: "Islas Åland"
+ AL: "Albania"
+ DZ: "Argelia"
+ AS: "Samoa Americana"
+ AD: "Andorra"
+ AO: "Angola"
+ AI: "Anguila"
+ AQ: "Antártida"
+ AG: "Antigua y Barbuda"
+ AR: "Argentina"
+ AM: "Armenia"
+ AW: "Aruba"
+ AU: "Australia"
+ AT: "Austria"
+ AZ: "Azerbaiyán"
+ BS: "Bahamas"
+ BH: "Baréin"
+ BD: "Bangladesh"
+ BB: "Barbados"
+ BY: "Bielorrusia"
+ BE: "Bélgica"
+ BZ: "Belice"
+ BJ: "Benín"
+ BM: "Bermudas"
+ BT: "Bután"
+ BO: "Bolivia, Estado Plurinacional de"
+ BQ: "Bonaire, San Eustaquio y Saba"
+ BA: "Bosnia y Herzegovina"
+ BW: "Botsuana"
+ BV: "Isla Bouvet"
+ BR: "Brasil"
+ IO: "Territorio Británico del Océano Índico"
+ BN: "Brunéi Darussalam"
+ BG: "Bulgaria"
+ BF: "Burkina Faso"
+ BI: "Burundi"
+ KH: "Camboya"
+ CM: "Camerún"
+ CA: "Canadá"
+ CV: "Cabo Verde"
+ KY: "Islas Caimán"
+ CF: "República Centroafricana"
+ TD: "Chad"
+ CL: "Chile"
+ CN: "China"
+ CX: "Isla de Navidad"
+ CC: "Islas Cocos (Keeling)"
+ CO: "Colombia"
+ KM: "Comoras"
+ CG: "Congo"
+ CD: "Congo, República Democrática del"
+ CK: "Islas Cook"
+ CR: "Costa Rica"
+ CI: "Costa de Marfil"
+ HR: "Croacia"
+ CU: "Cuba"
+ CW: "Curazao"
+ CY: "Chipre"
+ CZ: "República Checa"
+ DK: "Dinamarca"
+ DJ: "Yibuti"
+ DM: "Dominica"
+ DO: "República Dominicana"
+ EC: "Ecuador"
+ EG: "Egipto"
+ SV: "El Salvador"
+ GQ: "Guinea Ecuatorial"
+ ER: "Eritrea"
+ EE: "Estonia"
+ ET: "Etiopía"
+ FK: "Islas Malvinas (Falkland)"
+ FO: "Islas Feroe"
+ FJ: "Fiyi"
+ FI: "Finlandia"
+ FR: "Francia"
+ GF: "Guayana Francesa"
+ PF: "Polinesia francesa"
+ TF: "Territorios Australes Franceses"
+ GA: "Gabón"
+ GM: "Gambia"
+ GE: "Georgia"
+ DE: "Alemania"
+ GH: "Ghana"
+ GI: "Gibraltar"
+ GR: "Grecia"
+ GL: "Groenlandia"
+ GD: "Granada"
+ GP: "Guadalupe"
+ GU: "Guam"
+ GT: "Guatemala"
+ GG: "Guernsey"
+ GN: "Guinea"
+ GW: "Guinea-Bisáu"
+ GY: "Guayana"
+ HT: "Haití"
+ HM: "Islas Heard e Islas McDonald"
+ VA: "Santa Sede (Estado de la Ciudad del Vaticano)"
+ HN: "Honduras"
+ HK: "Hong Kong"
+ HU: "Hungría"
+ IS: "Islandia"
+ IN: "India"
+ ID: "Indonesia"
+ IR: "Irán, República Islámica de"
+ IQ: "Irak"
+ IE: "Irlanda"
+ IM: "Isla de Man"
+ IL: "Israel"
+ IT: "Italia"
+ JM: "Jamaica"
+ JP: "Japón"
+ JE: "Jersey"
+ JO: "Jordán"
+ KZ: "Kazajstán"
+ KE: "Kenia"
+ KI: "Kiribati"
+ KP: "Corea, República Popular Democrática de"
+ KR: "Corea, República de"
+ KW: "Kuwait"
+ KG: "Kirguistán"
+ LA: "República Democrática Popular de Laos"
+ LV: "Letonia"
+ LB: "Líbano"
+ LS: "Lesoto"
+ LR: "Liberia"
+ LY: "Libia"
+ LI: "Liechtenstein"
+ LT: "Lituania"
+ LU: "Luxemburgo"
+ MO: "Macao"
+ MK: "Macedonia, ex República Yugoslava de"
+ MG: "Madagascar"
+ MW: "Malawi"
+ MY: "Malasia"
+ MV: "Maldivas"
+ ML: "Malí"
+ MT: "Malta"
+ MH: "Islas Marshall"
+ MQ: "Martinica"
+ MR: "Mauritania"
+ MU: "Mauricio"
+ YT: "Mayotte"
+ MX: "México"
+ FM: "Micronesia, Estados Federados de"
+ MD: "Moldavia, República de"
+ MC: "Mónaco"
+ MN: "Mongolia"
+ ME: "Montenegro"
+ MS: "Montserrat"
+ MA: "Marruecos"
+ MZ: "Mozambique"
+ MM: "Birmania"
+ NA: "Namibia"
+ NR: "Nauru"
+ NP: "Nepal"
+ NL: "Países Bajos"
+ NC: "Nueva Caledonia"
+ NZ: "Nueva Zelanda"
+ NI: "Nicaragua"
+ NE: "Níger"
+ NG: "Nigeria"
+ NU: "Niue"
+ NF: "Isla Norfolk"
+ MP: "Islas Marianas del Norte"
+ "NO": "Noruega"
+ OM: "Omán"
+ PK: "Pakistán"
+ PW: "Palaos"
+ PS: "Territorio Palestino Ocupado"
+ PA: "Panamá"
+ PG: "Papúa Nueva Guinea"
+ PY: "Paraguay"
+ PE: "Perú"
+ PH: "Filipinas"
+ PN: "Pitcairn"
+ PL: "Polonia"
+ PT: "Portugal"
+ PR: "Puerto Rico"
+ QA: "Qatar"
+ RE: "Reunión"
+ RO: "Rumania"
+ RU: "Federación Rusa"
+ RW: "Ruanda"
+ BL: "San Bartolomé"
+ SH: "Santa Elena, Ascensión y Tristán da Cunha"
+ KN: "San Cristóbal y Nieves"
+ LC: "Santa Lucía"
+ MF: "San Martín (parte francesa)"
+ PM: "San Pedro y Miquelón"
+ VC: "San Vicente y las Granadinas"
+ WS: "Samoa"
+ SM: "San Marino"
+ ST: "Santo Tomé y Príncipe"
+ SA: "Arabia Saudí"
+ SN: "Senegal"
+ RS: "Serbia"
+ SC: "Seychelles"
+ SL: "Sierra Leona"
+ SG: "Singapur"
+ SX: "Sint Maarten (parte holandesa)"
+ SK: "Eslovaquia"
+ SI: "Eslovenia"
+ SB: "Islas Salomón"
+ SO: "Somalia"
+ ZA: "Sudáfrica"
+ GS: "Islas Georgias del Sur y Sandwich del Sur"
+ SS: "Sudán del Sur"
+ ES: "España"
+ LK: "Sri Lanka"
+ SD: "Sudán"
+ SR: "Surinam"
+ SJ: "Svalbard y Jan Mayen"
+ SZ: "Swazilandia"
+ SE: "Suecia"
+ CH: "Suiza"
+ SY: "República Árabe Siria"
+ TW: "Taiwán, Provincia de China"
+ TJ: "Tayikistán"
+ TZ: "Tanzania, República Unida de"
+ TH: "Tailandia"
+ TL: "Timor Oriental"
+ TG: "Togo"
+ TK: "Tokelau"
+ TO: "Tonga"
+ TT: "Trinidad y Tobago"
+ TN: "Túnez"
+ TR: "Turquía"
+ TM: "Turkmenistán"
+ TC: "Islas Turcas y Caicos"
+ TV: "Tuvalu"
+ UG: "Uganda"
+ UA: "Ucrania"
+ AE: "Emiratos Árabes Unidos"
+ GB: "Reino Unido"
+ US: "Estados Unidos"
+ UM: "Islas periféricas menores de los Estados Unidos"
+ UY: "Uruguay"
+ UZ: "Uzbekistán"
+ VU: "Vanuatu"
+ VE: "Venezuela, República Bolivariana de"
+ VN: "Vietnam"
+ VG: "Islas Vírgenes Británicas"
+ VI: "Islas Vírgenes de EE. UU."
+ WF: "Wallis y Futuna"
+ EH: "Sáhara Occidental"
+ YE: "Yemen"
+ ZM: "Zambia"
+ ZW: "Zimbabue"
+ billing:
+ name: Nombre completo
+ email: Correo electrónico
+ phone: Número de teléfono
+ confirmation:
+ amount: Cantidad
+ last4: Número de tarjeta
+ buttons:
+ make_payment: Pagar
+ confirm_payment: Confirmar pago
+ success: Volver
+ admin:
+ unconfigured: 'Stripe no está configurado correctamente. Consulta Discourse Meta para obtener más información.'
+ on_meta: Discourse Subscriptions en Meta
+ dashboard:
+ title: Panel de control
+ table:
+ head:
+ user: Usuario
+ payment_intent: ID de pago
+ receipt_email: Correo electrónico de recibo
+ amount: Cantidad
+ products:
+ title: Productos
+ operations:
+ create: Crear nuevo producto
+ update: Actualizar producto
+ new: Nuevo producto
+ destroy:
+ confirm: '¿Seguro que quieres eliminar este producto?'
+ product:
+ product_id: ID de producto
+ name: Nombre del producto
+ statement_descriptor: Concepto del extracto
+ statement_descriptor_help: Información adicional sobre un producto que aparecerá en el extracto de la tarjeta de crédito del cliente.
+ plan_help: Crear un plan de precios para suscribir clientes a este producto.
+ description: Descripción
+ description_help: Esto describe el producto de suscripción.
+ repurchaseable: '¿Se puede recomprar?'
+ repurchase_help: Permitir que el producto y los planes asociados se compren varias veces
+ active: Activa
+ active_help: Desactiva esto hasta que el producto esté listo para el consumidor final.
+ created_at: Creada
+ updated_at: Actualizada
+ product_help: Antes de que los clientes puedan suscribirse al sitio, debes crear al menos un producto y un plan asociado.
+ plans:
+ title: Planes de precios
+ operations:
+ add: Añadir nuevo plan
+ create: Crear plan
+ update: Actualizar plan
+ create_help: Una vez que se crea un plan de precios, solo se puede actualizar su apodo, el período de prueba y el grupo de usuarios.
+ new: Nuevo plan
+ destroy:
+ confirm: '¿Seguro que quieres destruir este plan?'
+ plan:
+ nickname: Apodo del plan
+ nickname_help: Esto no será visible para los clientes, pero te ayudará a encontrar este plan más adelante
+ plan_id: ID del plan
+ product: Producto
+ interval: Intervalo de facturación
+ amount: Cantidad
+ trial: Días del período de prueba
+ trial_help: Las suscripciones a este plan comenzarán automáticamente con una prueba gratuita de esta duración
+ group: Grupo de usuarios
+ group_help: Este es el grupo de usuarios en Discourse al que se añadirá el cliente cuando se cree la suscripción.
+ active: Activo
+ created_at: Creado
+ recurring: '¿Plan recurrente?'
+ coupons:
+ title: Cupones
+ code: Código promocional
+ discount: Descuento
+ times_redeemed: Veces canjeado
+ active: '¿Activo?'
+ actions: Acciones
+ create: Crear un cupón
+ promo_code: Código promocional (no distingue entre mayúsculas y minúsculas)
+ subscriptions:
+ title: Suscripciones
+ subscription:
+ user: Usuario
+ subscription_id: ID de suscripción
+ customer: Cliente
+ product: Producto
+ plan: Plan
+ status: Estado
+ created_at: Creado
+ ask_refund: '¿Reembolsar el último pago realizado por el cliente?'
+ canceled: "La suscripción está cancelada."
diff --git a/plugins/discourse-subscriptions/config/locales/client.et.yml b/plugins/discourse-subscriptions/config/locales/client.et.yml
new file mode 100644
index 00000000000..a97c85aa391
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.et.yml
@@ -0,0 +1,53 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+et:
+ js:
+ discourse_subscriptions:
+ optional: Valikuline
+ campaign:
+ success_title: Korras!
+ plans:
+ interval:
+ adverb:
+ day: Igapäevaselt
+ week: Iganädalaselt
+ month: Igakuiselt
+ year: Iga-aastaselt
+ user:
+ payments:
+ created_at: Loodud
+ plans:
+ product: Nimi
+ subscriptions:
+ status: Staatus
+ created_at: Loodud
+ cancel: tühista
+ billing:
+ email: E-post
+ admin:
+ dashboard:
+ title: Armatuurlaud
+ table:
+ head:
+ user: Kasutaja
+ products:
+ product:
+ description: Kirjeldus
+ active: Aktiivne
+ created_at: Loodud
+ plans:
+ plan:
+ active: Aktiivne
+ created_at: Loodud
+ coupons:
+ active: Aktiivne?
+ actions: Tegevused
+ subscriptions:
+ subscription:
+ user: Kasutaja
+ status: Staatus
+ created_at: Loodud
diff --git a/plugins/discourse-subscriptions/config/locales/client.fa_IR.yml b/plugins/discourse-subscriptions/config/locales/client.fa_IR.yml
new file mode 100644
index 00000000000..9ec10fc6eb0
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.fa_IR.yml
@@ -0,0 +1,205 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+fa_IR:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_subscriptions: "اشتراک دیسکورس"
+ site_settings:
+ discourse_subscriptions_enabled: فعال کردن افزونه اشتراک دیسکورس
+ discourse_subscriptions_extra_nav_subscribe: دکمه اشتراک در منو اصلی نشان داده شود
+ js:
+ filters:
+ subscribe:
+ help: با خرید اشتراک از این سایت پشتیبانی کنید
+ discourse_subscriptions:
+ title: اشتراک دیسکورس
+ admin_navigation: اشتراک‌ها
+ optional: اختیاری
+ navigation:
+ billing: صورت‌حساب
+ payments: پرداخت‌ها
+ subscriptions: اشتراک‌ها
+ subscribe: اشتراک
+ user_activity:
+ payments: پرداخت‌ها
+ campaign:
+ title: از ما حمایت کنید
+ success_title: موفقیت!
+ goal_comparison: "<strong>%{current}</strong> از <strong>%{goal}</strong>"
+ confirm_creation_title: آیا می‌خواهید به طور خودکار یک کمپین برای انجمن خود ایجاد کنید؟
+ plans:
+ interval:
+ adverb:
+ day: روزانه
+ week: هفتگی
+ month: ماهانه
+ year: سالیانه
+ payment_button: اشتراک
+ user:
+ payments:
+ id: شناسه پرداخت‌
+ created_at: ساخته شده
+ payments_help: هنوز هیچ پرداختی وجود ندارد
+ plans:
+ rate: نرخ
+ product: نام
+ subscriptions:
+ status: وضعیت
+ discounted: با تخفیف
+ update_card:
+ heading: "به‌روزرسانی کارت برای اشتراک: %{sub_id}"
+ single: "به‌روزرسانی"
+ created_at: ساخته شده
+ cancel: لغو
+ subscribe:
+ title: اشتراک
+ invalid_cardholder_name: نام دارنده کارت الزامی است.
+ invalid_cardholder_country: کشور الزامی است.
+ invalid_cardholder_state: ایالت الزامی است.
+ invalid_cardholder_province: استان الزامی است.
+ card:
+ title: پرداخت‌
+ promo_code: تخفیف
+ buttons:
+ subscribe: اشتراک
+ cardholder_name: نام دارنده کارت
+ cardholder_address:
+ line1: آدرس خیابان
+ city: شهر
+ state: ایالت
+ province: استان
+ country: کشور
+ postal_code: کد پستی
+ countries:
+ AF: "افغانستان"
+ AX: "جزایر الند"
+ AL: "آلبانی"
+ DZ: "الجزایر"
+ AS: "ساموآی آمریکا"
+ AD: "آندورا"
+ AO: "آنگولا"
+ AI: "آنگویلا"
+ AQ: "جنوبگان"
+ AG: "آنتیگوآ و باربودا"
+ AR: "آرژانتین"
+ AM: "ارمنستان"
+ AW: "آروبا"
+ AU: "استرالیا"
+ AT: "اتریش"
+ AZ: "آذربایجان"
+ BS: "باهاما"
+ BH: "بحرین"
+ BD: "بنگلادش"
+ BB: "باربادوس"
+ BY: "بلاروس"
+ BE: "بلژیک"
+ BZ: "بلیز"
+ BJ: "بنین"
+ BM: "برمودا"
+ BT: "بوتان"
+ BO: "بولیوی، دولت چند ملیتی"
+ BQ: "جزایر کارائیب هلند"
+ BA: "بوسنی و هرزگوین"
+ BW: "بوتسوانا"
+ BV: "جزیره بووه"
+ BR: "برزیل"
+ IO: "قلمرو بریتانیا در اقیانوس هند"
+ BN: "برونئی دارالسلام"
+ BG: "بلغارستان"
+ BF: "بورکینافاسو"
+ BI: "بوروندی"
+ KH: "کامبوج"
+ CM: "کامرون"
+ CA: "کانادا"
+ CV: "کیپ ورد"
+ KY: "جزایر کیمن"
+ CF: "جمهوری آفریقای مرکزی"
+ TD: "چاد"
+ CL: "شیلی"
+ CN: "چین"
+ CX: "جزیره کریسمس"
+ CC: "جزایر کوکوس"
+ CO: "کلمبیا"
+ KM: "کومور"
+ CG: "کنگو"
+ CD: "کنگو، جمهوری دموکراتیک"
+ CK: "جزایر کوک"
+ CR: "کاستاریکا"
+ CI: "ساحل عاج"
+ HR: "کرواسی"
+ CU: "کوبا"
+ CW: "کوراسائو"
+ CY: "قبرس"
+ CZ: "جمهوری چک"
+ DK: "دانمارک"
+ DJ: "جیبوتی"
+ DM: "دومینیکا"
+ DO: "جمهوری دومینیکن"
+ EC: "اکوادور"
+ EG: "مصر"
+ SV: "السالوادور"
+ GQ: "گینه استوایی"
+ ER: "اریتره"
+ IR: "ایران"
+ IQ: "عراق"
+ IE: "ایرلند"
+ IT: "ایتالیا"
+ JP: "ژاپن"
+ KW: "کویت"
+ billing:
+ name: نام کامل
+ email: ایمیل
+ phone: شماره تلفن
+ confirmation:
+ last4: شماره کارت
+ buttons:
+ confirm_payment: تایید پرداخت‌
+ admin:
+ dashboard:
+ title: پیشخوان
+ table:
+ head:
+ user: کاربر
+ payment_intent: شناسه پرداخت‌
+ products:
+ title: محصولات
+ operations:
+ create: ایجاد محصول جدید
+ update: به‌روزرسانی محصول
+ new: محصول جدید
+ destroy:
+ confirm: آیا مطمئن هستید که می‌خواهید این محصول را پاک کنید؟
+ product:
+ product_id: شناسه محصول
+ name: نام محصول
+ description: توضیح
+ active: فعال
+ created_at: ساخته شده
+ updated_at: به روز شده
+ plans:
+ plan:
+ product: محصول
+ active: فعال
+ created_at: ساخته شده
+ coupons:
+ title: تخفیف‌ها
+ code: کد تبلیغاتی
+ discount: با تخفیف
+ active: فعال؟
+ actions: عملیات
+ create: ایجاد تخفیف
+ promo_code: کد تبلیغاتی (حساس به حروف کوچک و بزرگ)
+ subscriptions:
+ title: اشتراک‌ها
+ subscription:
+ user: کاربر
+ customer: مشتری
+ product: محصول
+ status: وضعیت
+ created_at: ساخته شده
diff --git a/plugins/discourse-subscriptions/config/locales/client.fi.yml b/plugins/discourse-subscriptions/config/locales/client.fi.yml
new file mode 100644
index 00000000000..80d25c3431d
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.fi.yml
@@ -0,0 +1,484 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+fi:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_subscriptions: "Discoursen tilaukset"
+ site_settings:
+ discourse_subscriptions_enabled: Ota Discoursen Subscriptions-lisäosa käyttöön.
+ discourse_subscriptions_extra_nav_subscribe: Näytä tilauspainike päänavigoinnissa
+ discourse_subscriptions_pricing_table_id: Lisää pricing-table-id hintataulukon upotuskoodista tähän.
+ discourse_subscriptions_pricing_table_enabled: Tilauspainike näyttää upotetun hintataulukon ja Stripe Checkoutia käytetään.
+ discourse_subscriptions_public_key: Stripen Publishable Key
+ discourse_subscriptions_secret_key: Stripen Secret Key
+ discourse_subscriptions_webhook_secret: Stripen Webhook Secret
+ discourse_subscriptions_currency: Oletusvaluuttakoodi. Tämä voidaan ohittaa tilausta luotaessa.
+ discourse_subscriptions_campaign_enabled: Ottaa käyttöön kampanjabannerin tämän yhteisön taloudellisen tukemisen edistämiseksi.
+ discourse_subscriptions_campaign_goal: Tukikampanjasi numeerinen tavoite (tilaajat tai kerätty summa).
+ discourse_subscriptions_campaign_type: Valitsee suoritettavan kampanjan tyypin (tilaajat tai kuukausittain kerättävä summa).
+ discourse_subscriptions_campaign_banner_location: Valitsee kampanjabannerin sijainnin (ylä- tai sivupalkki).
+ discourse_subscriptions_campaign_banner_shadow_color: Valitsee kampanjabannerin varjon värin.
+ discourse_subscriptions_campaign_banner_bg_image: Lataa mukautettu kuva käytettäväksi kampanjabannerin taustana.
+ discourse_subscriptions_campaign_show_contributors: Näytä tilaustuotteiden viimeisimpien ostosten avatarit.
+ discourse_subscriptions_campaign_product: Stripen tuotetunnus, johon tukijat ohjataan, kun he napsauttavat kampanjan painiketta. Jos tämä asetus on tyhjä, tukijat ohjataan päätuotesivulle.
+ discourse_subscriptions_enable_automatic_tax: Ottaa käyttöön automaattisen verolaskelman, joka laskee automaattisesti veroprosentin kaikille tilauksen luomille laskuille.
+ discourse_subscriptions_enable_verbose_logging: Ottaa käyttöön monisanaisemman kirjauksen viankorjauksen helpottamiseksi. Älä jätä sitä pysyvästi käyttöön tuotannossa.
+ errors:
+ discourse_patrons_amount_must_be_currency: "Valuuttasummien täytyy olla valuuttoja ilman dollarimerkkiä (esim. 1,50)"
+ js:
+ filters:
+ subscribe:
+ help: Tue tätä sivustoa tilaamalla
+ discourse_subscriptions:
+ title: Discoursen tilaukset
+ admin_navigation: Tilaukset
+ optional: Ei pakollinen
+ navigation:
+ billing: Laskutus
+ payments: Maksut
+ subscriptions: Tilaukset
+ subscribe: Tilaa
+ user_activity:
+ payments: Maksut
+ campaign:
+ title: Tue meitä
+ body: Tarvitsemme apuasi pitääksemme tämän yhteisön toiminnassa!
+ success_title: Onnistui!
+ success_body: Kiitos avustasi tämän yhteisön ylläpitämisessä!
+ subscribers: Tilaajat
+ goal_comparison: "<strong>%{current}</strong>/<strong>%{goal}</strong>"
+ raised: Kerätty
+ button: Tuki
+ recent_contributors: Viimeisimmät tukijat
+ goal: Olemme saavuttaneet tavoitteemme
+ one_click_campaign: Luo tukikampanja automaattisesti
+ refresh_campaign: Päivitä kampanjatiedot
+ refresh_page: Kampanjan tietoja synkronoidaan nyt Stripesta taustalla. Päivitä sivu hetken kuluttua ladataksesi päivitetyt tiedot.
+ supporter: Tukija
+ supporters: Tukijat
+ confirm_creation_title: Haluatko luoda automaattisesti kampanjan yhteisöllesi?
+ confirm_creation: |-
+ <p>Jatkaminen luo:</p>
+
+ <ul>
+ <li>ryhmän, joka palkitsee tukijasi mukautetulla otsikolla ja avatarilla</li>
+ <li>Stripe-tuotteen ennalta määritetyillä hinnoilla (kuukausittainen ja vuosittainen), jonka käyttäjät voivat ostaa tukeakseen sivustoasi.</li>
+ </ul>
+
+ <p>Haluatko jatkaa?</p>
+ created: Yhden napsautuksen kampanjasi on luotu ja valmis käytettäväksi! Sinut ohjataan kampanja-asetuksiin.
+ one_time_payment: Kertamaksu
+ plans:
+ purchase: Osta tilaus
+ select: Valitse tilaus
+ interval:
+ adverb:
+ day: Päivittäinen
+ week: Viikoittain
+ month: Kuukausittain
+ year: Vuosittain
+ payment_button: Tilaa
+ success: Kiitos! Tilauksesi on luotu.
+ incomplete: Maksu on kesken. Tilauksesi päivitetään, kun maksu on suoritettu.
+ validate:
+ payment_options:
+ required: Valitse tilaus.
+ user:
+ payments:
+ id: Maksun tunnus
+ amount: Summa
+ created_at: Luotu
+ payments_help: Maksuja ei ole
+ plans:
+ rate: Hinta
+ product: Nimi
+ subscriptions_help: Sinulla ei ole aktiivisia tilauksia.
+ subscriptions:
+ id: Tilauksen tunnus
+ status: Tila
+ discounted: Alennettu
+ renews: Uusiutuu
+ update_card:
+ heading: "Päivitä kortti tilaukselle: %{sub_id}"
+ single: "Päivitä"
+ created_at: Luotu
+ cancel: peruuta
+ cancelled: peruutettu
+ operations:
+ destroy:
+ confirm: Haluatko varmasti peruuttaa tämän tilauksen?
+ subscribe:
+ title: Tilaa
+ view_past: Näytä aikaisemmat ostokset
+ no_products: Tuotteita ei ole tällä hetkellä saatavilla.
+ unauthenticated: Kirjaudu sisään tai luo tili tilataksesi.
+ invalid_coupon: Annoit virheellisen kuponkikoodin. Yritä uudelleen.
+ invalid_cardholder_name: Kortinhaltijan nimi on pakollinen.
+ invalid_cardholder_country: Maa on pakollinen.
+ invalid_cardholder_state: Osavaltio on pakollinen.
+ invalid_cardholder_province: Provinssi on pakollinen.
+ transaction_error: Maksun käsittelyssä tapahtui virhe. Yritä uudelleen.
+ card:
+ title: Maksu
+ customer:
+ title: Asiakkaan tiedot
+ promo_code: Kuponki
+ buttons:
+ subscribe: Tilaa
+ purchased: Ostettu
+ go_to_billing: Siirry laskutukseen
+ already_purchased: Kiitos paljon tämän tuotteen aikaisemmasta ostostasi!
+ cardholder_name: Kortinhaltijan nimi
+ cardholder_address:
+ line1: Katuosoite
+ city: Kaupunki
+ state: Osavaltio
+ province: Provinssi
+ country: Maa
+ postal_code: Postinumero
+ countries:
+ AF: "Afganistan"
+ AX: "Ahvenanmaa"
+ AL: "Albania"
+ DZ: "Algeria"
+ AS: "Amerikan Samoa"
+ AD: "Andorra"
+ AO: "Angola"
+ AI: "Anguilla"
+ AQ: "Antarktis"
+ AG: "Antigua ja Barbuda"
+ AR: "Argentiina"
+ AM: "Armenia"
+ AW: "Aruba"
+ AU: "Australia"
+ AT: "Itävalta"
+ AZ: "Azerbaidžan"
+ BS: "Bahama"
+ BH: "Bahrain"
+ BD: "Bangladesh"
+ BB: "Barbados"
+ BY: "Valko-Venäjä"
+ BE: "Belgia"
+ BZ: "Belize"
+ BJ: "Benin"
+ BM: "Bermuda"
+ BT: "Bhutan"
+ BO: "Bolivian monikansainen valtio"
+ BQ: "Bonaire, Sint Eustatius ja Saba"
+ BA: "Bosnia ja Hertsegovina"
+ BW: "Botswana"
+ BV: "Bouvet'nsaari"
+ BR: "Brasilia"
+ IO: "Brittiläinen Intian valtameren alue"
+ BN: "Brunei Darussalam"
+ BG: "Bulgaria"
+ BF: "Burkina Faso"
+ BI: "Burundi"
+ KH: "Kambodža"
+ CM: "Kamerun"
+ CA: "Kanada"
+ CV: "Kap Verde"
+ KY: "Caymansaaret"
+ CF: "Keski-Afrikan tasavalta"
+ TD: "Tšad"
+ CL: "Chile"
+ CN: "Kiina"
+ CX: "Joulusaari"
+ CC: "Kookossaaret (Keeling)"
+ CO: "Kolumbia"
+ KM: "Komorit"
+ CG: "Kongo"
+ CD: "Kongon demokraattinen tasavalta"
+ CK: "Cookinsaaret"
+ CR: "Costa Rica"
+ CI: "Norsunluurannikko"
+ HR: "Kroatia"
+ CU: "Kuuba"
+ CW: "Curaçao"
+ CY: "Kypros"
+ CZ: "Tšekin tasavalta"
+ DK: "Tanska"
+ DJ: "Djibouti"
+ DM: "Dominica"
+ DO: "Dominikaaninen tasavalta"
+ EC: "Ecuador"
+ EG: "Egypti"
+ SV: "El Salvador"
+ GQ: "Päiväntasaajan Guinea"
+ ER: "Eritrea"
+ EE: "Viro"
+ ET: "Etiopia"
+ FK: "Falklandinsaaret (Malvinassaaret)"
+ FO: "Färsaaret"
+ FJ: "Fidži"
+ FI: "Suomi"
+ FR: "Ranska"
+ GF: "Ranskan Guayana"
+ PF: "Ranskan Polynesia"
+ TF: "Ranskan eteläiset alueet"
+ GA: "Gabon"
+ GM: "Gambia"
+ GE: "Georgia"
+ DE: "Saksa"
+ GH: "Ghana"
+ GI: "Gibraltar"
+ GR: "Kreikka"
+ GL: "Grönlanti"
+ GD: "Grenada"
+ GP: "Guadeloupe"
+ GU: "Guam"
+ GT: "Guatemala"
+ GG: "Guernsey"
+ GN: "Guinea"
+ GW: "Guinea-Bissau"
+ GY: "Guyana"
+ HT: "Haiti"
+ HM: "Heard ja McDonaldinsaaret"
+ VA: "Vatikaani"
+ HN: "Honduras"
+ HK: "Hongkong"
+ HU: "Unkari"
+ IS: "Islanti"
+ IN: "Intia"
+ ID: "Indonesia"
+ IR: "Iranin islamilainen tasavalta"
+ IQ: "Irak"
+ IE: "Irlanti"
+ IM: "Mansaari"
+ IL: "Israel"
+ IT: "Italia"
+ JM: "Jamaika"
+ JP: "Japani"
+ JE: "Jersey"
+ JO: "Jordania"
+ KZ: "Kazakstan"
+ KE: "Kenia"
+ KI: "Kiribati"
+ KP: "Korean demokraattinen kansantasavalta"
+ KR: "Korean tasavalta"
+ KW: "Kuwait"
+ KG: "Kirgisia"
+ LA: "Laosin demokraattinen kansantasavalta"
+ LV: "Latvia"
+ LB: "Libanon"
+ LS: "Lesotho"
+ LR: "Liberia"
+ LY: "Libya"
+ LI: "Liechtenstein"
+ LT: "Liettua"
+ LU: "Luxemburg"
+ MO: "Macao"
+ MK: "Pohjois-Makedonia"
+ MG: "Madagaskar"
+ MW: "Malawi"
+ MY: "Malesia"
+ MV: "Malediivit"
+ ML: "Mali"
+ MT: "Malta"
+ MH: "Marshallinsaaret"
+ MQ: "Martinique"
+ MR: "Mauritania"
+ MU: "Mauritius"
+ YT: "Mayotte"
+ MX: "Meksiko"
+ FM: "Mikronesian liittovaltio"
+ MD: "Moldovan tasavalta"
+ MC: "Monaco"
+ MN: "Mongolia"
+ ME: "Montenegro"
+ MS: "Montserrat"
+ MA: "Marokko"
+ MZ: "Mosambik"
+ MM: "Myanmar"
+ NA: "Namibia"
+ NR: "Nauru"
+ NP: "Nepal"
+ NL: "Alankomaat"
+ NC: "Uusi-Kaledonia"
+ NZ: "Uusi-Seelanti"
+ NI: "Nicaragua"
+ NE: "Niger"
+ NG: "Nigeria"
+ NU: "Niue"
+ NF: "Norfolkinsaari"
+ MP: "Pohjois-Mariaanit"
+ "NO": "Norja"
+ OM: "Oman"
+ PK: "Pakistan"
+ PW: "Palau"
+ PS: "Palestiinalaisalue"
+ PA: "Panama"
+ PG: "Papua-Uusi-Guinea"
+ PY: "Paraguay"
+ PE: "Peru"
+ PH: "Filippiinit"
+ PN: "Pitcairn"
+ PL: "Puola"
+ PT: "Portugali"
+ PR: "Puerto Rico"
+ QA: "Qatar"
+ RE: "Réunion"
+ RO: "Romania"
+ RU: "Venäjän federaatio"
+ RW: "Ruanda"
+ BL: "Saint Barthélemy"
+ SH: "Saint Helena, Ascension ja Tristan da Cunha"
+ KN: "Saint Kitts ja Nevis"
+ LC: "Saint Lucia"
+ MF: "Saint Martin (ranskalainen osa)"
+ PM: "Saint-Pierre ja Miquelon"
+ VC: "Saint Vincent ja Grenadiinit"
+ WS: "Samoa"
+ SM: "San Marino"
+ ST: "São Tomé ja Príncipe"
+ SA: "Saudi-Arabia"
+ SN: "Senegal"
+ RS: "Serbia"
+ SC: "Seychellit"
+ SL: "Sierra Leone"
+ SG: "Singapore"
+ SX: "Sint Maarten (alankomaalainen osa)"
+ SK: "Slovakia"
+ SI: "Slovenia"
+ SB: "Salomonsaaret"
+ SO: "Somalia"
+ ZA: "Etelä-Afrikka"
+ GS: "Etelä-Georgia ja Eteläiset Sandwichsaaret"
+ SS: "Etelä-Sudan"
+ ES: "Espanja"
+ LK: "Sri Lanka"
+ SD: "Sudan"
+ SR: "Suriname"
+ SJ: "Huippuvuoret ja Jan Mayen"
+ SZ: "Swazimaa"
+ SE: "Ruotsi"
+ CH: "Sveitsi"
+ SY: "Syyrian arabitasavalta"
+ TW: "Taiwan, Kiinan maakunta"
+ TJ: "Tadžikistan"
+ TZ: "Tansanian yhdistynyt tasavalta"
+ TH: "Thaimaa"
+ TL: "Itä-Timor"
+ TG: "Togo"
+ TK: "Tokelau"
+ TO: "Tonga"
+ TT: "Trinidad ja Tobago"
+ TN: "Tunisia"
+ TR: "Turkki"
+ TM: "Turkmenistan"
+ TC: "Turks- ja Caicossaaret"
+ TV: "Tuvalu"
+ UG: "Uganda"
+ UA: "Ukraina"
+ AE: "Yhdistyneet arabiemiirikunnat"
+ GB: "Yhdistynyt kuningaskunta"
+ US: "Yhdysvallat"
+ UM: "Yhdysvaltain pienet erillissaaret"
+ UY: "Uruguay"
+ UZ: "Uzbekistan"
+ VU: "Vanuatu"
+ VE: "Venezuelan bolivariaaninen tasavalta"
+ VN: "Vietnam"
+ VG: "Brittiläiset Neitsytsaaret"
+ VI: "Yhdysvaltain Neitsytsaaret"
+ WF: "Wallis ja Futuna"
+ EH: "Länsi-Sahara"
+ YE: "Jemen"
+ ZM: "Sambia"
+ ZW: "Zimbabwe"
+ billing:
+ name: Koko nimi
+ email: Sähköposti
+ phone: Puhelinnumero
+ confirmation:
+ amount: Summa
+ last4: Kortin numero
+ buttons:
+ make_payment: Maksa
+ confirm_payment: Vahvista maksu
+ success: Palaa takaisin
+ admin:
+ unconfigured: 'Stripea ei ole määritetty oikein. Katso lisätietoja Discourse Metasta.'
+ on_meta: Discoursen tilaukset Metassa
+ dashboard:
+ title: Hallintapaneeli
+ table:
+ head:
+ user: Käyttäjä
+ payment_intent: Maksun tunnus
+ receipt_email: Kuitin sähköposti
+ amount: Summa
+ products:
+ title: Tuotteet
+ operations:
+ create: Luo uusi tuote
+ update: Päivitä tuote
+ new: Uusi tuote
+ destroy:
+ confirm: Haluatko varmasti tuhota tämän tuotteen?
+ product:
+ product_id: Tuotekoodi
+ name: Tuotteen nimi
+ statement_descriptor: Kuvaus otteella
+ statement_descriptor_help: Tuotteen lisätiedot, jotka näkyvät asiakkaasi luottokorttiotteessa.
+ plan_help: Luo hinnoittelusopimus, jotta asiakkaat voivat tilata tämän tuotteen.
+ description: Kuvaus
+ description_help: Tämä kuvaa tilaustuotettasi.
+ repurchaseable: Ostettavissa uudelleen?
+ repurchase_help: Salli tuotteen ja siihen liittyvien sopimusten ostaminen useita kertoja
+ active: Aktiiviset
+ active_help: Poista tämä käytöstä, kunnes tuotteesi on valmis kuluttajille.
+ created_at: Luotu
+ updated_at: Päivitetty
+ product_help: Ennen kuin asiakkaat voivat tilata sivustosi, sinun täytyy luoda vähintään yksi tuote ja siihen liittyvä sopimus.
+ plans:
+ title: Hinnoittelusopimukset
+ operations:
+ add: Lisää uusi sopimus
+ create: Luo sopimus
+ update: Päivitä sopimus
+ create_help: Kun hinnoittelusopimus on luotu, vain sen lempinimi, kokeilujakso ja käyttäjäryhmä voidaan päivittää.
+ new: Uusi sopimus
+ destroy:
+ confirm: Haluatko varmasti tuhota tämän sopimuksen?
+ plan:
+ nickname: Sopimuksen lempinimi
+ nickname_help: Tämä ei näy asiakkaille, mutta auttaa sinua löytämään tämän sopimuksen myöhemmin
+ plan_id: Sopimuksen tunnus
+ product: Tuote
+ interval: Laskutusväli
+ amount: Summa
+ trial: Kokeilupäiviä
+ trial_help: Tämän sopimuksen tilaukset alkavat automaattisesti tämän pituisella ilmaisella kokeilujaksolla
+ group: Käyttäjäryhmä
+ group_help: Tämä on Discoursen käyttäjäryhmä, johon asiakas lisätään, kun tilaus luodaan.
+ active: Aktiiviset
+ created_at: Luotu
+ recurring: Toistuva sopimus?
+ coupons:
+ title: Kupongit
+ code: Tarjouskoodi
+ discount: Alennus
+ times_redeemed: Lunastuskertoja
+ active: Aktiivinen?
+ actions: Toiminnot
+ create: Luo kuponki
+ promo_code: Tarjouskoodi (kirjainkoolla ei ole väliä)
+ subscriptions:
+ title: Tilaukset
+ subscription:
+ user: Käyttäjä
+ subscription_id: Tilauksen tunnus
+ customer: Asiakas
+ product: Tuote
+ plan: Sopimus
+ status: Tila
+ created_at: Luotu
+ ask_refund: Hyvitetäänkö asiakkaan viimeisin maksu?
+ canceled: "Tilaus on peruutettu."
diff --git a/plugins/discourse-subscriptions/config/locales/client.fr.yml b/plugins/discourse-subscriptions/config/locales/client.fr.yml
new file mode 100644
index 00000000000..41b93201226
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.fr.yml
@@ -0,0 +1,484 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+fr:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_subscriptions: "Abonnements Discourse"
+ site_settings:
+ discourse_subscriptions_enabled: Activer l'extension Discourse Subscription
+ discourse_subscriptions_extra_nav_subscribe: Afficher le bouton « S'abonner » dans le menu de navigation.
+ discourse_subscriptions_pricing_table_id: Ajoutez ici l'identifiant du tableau de tarification à partir du code intégré de la table de tarification.
+ discourse_subscriptions_pricing_table_enabled: Le bouton d'inscription affichera le tableau des prix intégré et Stripe Checkout sera utilisé.
+ discourse_subscriptions_public_key: Clé publique Stripe
+ discourse_subscriptions_secret_key: Clé secrète Stripe
+ discourse_subscriptions_webhook_secret: Secret du Webhook de Stripe
+ discourse_subscriptions_currency: Code de devise par défaut. Cette option peut être remplacée lors de la création d'un plan d'abonnement.
+ discourse_subscriptions_campaign_enabled: Permet de créer une bannière de campagne pour promouvoir le soutien financier de cette communauté.
+ discourse_subscriptions_campaign_goal: L'objectif numérique de votre campagne de soutien (abonnés ou montant récolté).
+ discourse_subscriptions_campaign_type: Sélectionne le type de campagne à mener (abonnés ou montant mensuel collecté).
+ discourse_subscriptions_campaign_banner_location: Sélectionne l'emplacement de la bannière de la campagne (en haut ou dans la barre latérale).
+ discourse_subscriptions_campaign_banner_shadow_color: Sélectionne la couleur de l'ombre portée de la bannière de la campagne.
+ discourse_subscriptions_campaign_banner_bg_image: Téléverse une image personnalisée à utiliser comme arrière-plan de la bannière de la campagne.
+ discourse_subscriptions_campaign_show_contributors: Afficher les avatars des achats les plus récents de produits d'abonnement.
+ discourse_subscriptions_campaign_product: L'identifiant du produit Stripe à envoyer aux supporters lorsqu'ils cliquent sur le bouton de la campagne. Si ce paramètre est vide, les supporters seront dirigés vers la page principale des produits.
+ discourse_subscriptions_enable_automatic_tax: Active le calcul automatique des taxes qui calculera automatiquement les taux d'imposition sur toutes les factures générées par l'abonnement.
+ discourse_subscriptions_enable_verbose_logging: Permet une journalisation plus détaillée pour faciliter le débogage. Veuillez ne pas laisser cette option activée en permanence en production.
+ errors:
+ discourse_patrons_amount_must_be_currency: "Les montants doivent être indiqués sans le symbole du dollar (p. ex., 1,50)"
+ js:
+ filters:
+ subscribe:
+ help: Soutenez ce site en vous abonnant
+ discourse_subscriptions:
+ title: Discourse Subscriptions
+ admin_navigation: Abonnements
+ optional: Facultatif
+ navigation:
+ billing: Facturation
+ payments: Paiements
+ subscriptions: Abonnements
+ subscribe: S'abonner
+ user_activity:
+ payments: Paiements
+ campaign:
+ title: Soutenez-nous
+ body: Nous avons besoin de votre aide pour maintenir cette communauté en activité !
+ success_title: Succès !
+ success_body: Merci de votre aide pour maintenir cette communauté en activité !
+ subscribers: Abonnés
+ goal_comparison: "<strong>%{current}</strong> sur <strong>%{goal}</strong>"
+ raised: Récoltés
+ button: Soutenir
+ recent_contributors: Contributeurs récents
+ goal: Nous avons atteint notre objectif
+ one_click_campaign: Créer automatiquement une campagne d'assistance
+ refresh_campaign: Actualiser les données de campagne
+ refresh_page: Les données de campagne sont maintenant synchronisées à partir de Stripe en arrière-plan. Actualisez la page dans quelques instants pour charger les informations mises à jour.
+ supporter: Supporter
+ supporters: Supporters
+ confirm_creation_title: Vous souhaitez créer automatiquement une campagne pour votre communauté ?
+ confirm_creation: |-
+ <p>En continuant, vous créerez :</p>
+
+ <ul>
+ <li>Un groupe pour récompenser vos supporters avec un titre et un avatar personnalisés</li>
+ <li>Un produit Stripe avec des prix prédéfinis (mensuels et annuels) que vos utilisateurs pourront acheter pour soutenir votre site.</li>
+ </ul>
+
+ <p>Souhaitez-vous continuer ?</p>
+ created: Votre campagne en un clic est créée et prête à être lancée ! Redirection vers les paramètres de la campagne.
+ one_time_payment: Paiement unique
+ plans:
+ purchase: Acheter un abonnement
+ select: Sélectionnez le plan d'abonnement
+ interval:
+ adverb:
+ day: Quotidien
+ week: Hebdomadaire
+ month: Mensuel
+ year: Annuel
+ payment_button: S'abonner
+ success: Merci ! Votre abonnement a été créé.
+ incomplete: Le paiement n'a pas fonctionné. Votre abonnement sera activé lorsque le paiement aura été validé.
+ validate:
+ payment_options:
+ required: Veuillez sélectionner un plan d'abonnement.
+ user:
+ payments:
+ id: Identifiant du paiement
+ amount: Montant
+ created_at: Création
+ payments_help: Il n'y a aucun paiement
+ plans:
+ rate: Taux
+ product: Nom
+ subscriptions_help: Vous n'avez aucun abonnement actif.
+ subscriptions:
+ id: Identifiant de l'abonnement
+ status: Statut
+ discounted: Remise
+ renews: Renouvellements
+ update_card:
+ heading: "Mettre à jour la carte pour l'abonnement : %{sub_id}"
+ single: "Mettre à jour"
+ created_at: Création
+ cancel: annuler
+ cancelled: annulé
+ operations:
+ destroy:
+ confirm: Voulez-vous vraiment annuler cet abonnement ?
+ subscribe:
+ title: S'abonner
+ view_past: Afficher les achats précédents
+ no_products: Il n'y a actuellement aucun produit disponible.
+ unauthenticated: Connectez-vous ou créez un compte pour vous abonner.
+ invalid_coupon: Vous avez saisi un code de coupon invalide. Veuillez réessayer.
+ invalid_cardholder_name: Le nom du titulaire de la carte est requis.
+ invalid_cardholder_country: Le pays est requis.
+ invalid_cardholder_state: L'État est requis.
+ invalid_cardholder_province: La province est requise.
+ transaction_error: Une erreur s'est produite lors du traitement du paiement. Veuillez réessayer.
+ card:
+ title: Paiement
+ customer:
+ title: Informations du client
+ promo_code: Coupon
+ buttons:
+ subscribe: S'abonner
+ purchased: Acheté
+ go_to_billing: Accéder à la facturation
+ already_purchased: Merci beaucoup pour votre achat préalable de ce produit !
+ cardholder_name: Nom du titulaire de la carte
+ cardholder_address:
+ line1: Adresse postale
+ city: Ville
+ state: État
+ province: Province
+ country: Pays
+ postal_code: Code postal
+ countries:
+ AF: "Afghanistan"
+ AX: "Îles d'Åland"
+ AL: "Albanie"
+ DZ: "Algérie"
+ AS: "Samoa américaines"
+ AD: "Andorre"
+ AO: "Angola"
+ AI: "Anguilla"
+ AQ: "Antarctique"
+ AG: "Antigua-et-Barbuda"
+ AR: "Argentine"
+ AM: "Arménie"
+ AW: "Aruba"
+ AU: "Australie"
+ AT: "Autriche"
+ AZ: "Azerbaïdjan"
+ BS: "Bahamas"
+ BH: "Bahreïn"
+ BD: "Bengladesh"
+ BB: "Barbade"
+ BY: "Biélorussie"
+ BE: "Belgique"
+ BZ: "Belize"
+ BJ: "Bénin"
+ BM: "Bermudes"
+ BT: "Bhoutan"
+ BO: "Bolivie, État plurinational de"
+ BQ: "Bonaire, Saint Eustache et Saba"
+ BA: "Bosnie-Herzégovine"
+ BW: "Botswana"
+ BV: "Île Bouvet"
+ BR: "Brésil"
+ IO: "Territoire britannique de l'océan Indien"
+ BN: "Brunéi Darussalam"
+ BG: "Bulgarie"
+ BF: "Burkina Faso"
+ BI: "Burundi"
+ KH: "Cambodge"
+ CM: "Cameroun"
+ CA: "Canada"
+ CV: "Cap-Vert"
+ KY: "Îles Caïmans"
+ CF: "République centrafricaine"
+ TD: "Tchad"
+ CL: "Chili"
+ CN: "Chine"
+ CX: "Île Christmas"
+ CC: "Îles Cocos (Keeling)"
+ CO: "Colombie"
+ KM: "Comores"
+ CG: "Congo"
+ CD: "Congo, République démocratique du"
+ CK: "Îles Cook"
+ CR: "Costa Rica"
+ CI: "Côte d'Ivoire"
+ HR: "Croatie"
+ CU: "Cuba"
+ CW: "Curaçao"
+ CY: "Chypre"
+ CZ: "République tchèque"
+ DK: "Danemark"
+ DJ: "Djibouti"
+ DM: "Dominique"
+ DO: "République dominicaine"
+ EC: "Équateur"
+ EG: "Égypte"
+ SV: "El Salvador"
+ GQ: "Guinée Équatoriale"
+ ER: "Érythrée"
+ EE: "Estonie"
+ ET: "Éthiopie"
+ FK: "Îles Falkland (Malouines)"
+ FO: "Îles Féroé"
+ FJ: "Fidji"
+ FI: "Finlande"
+ FR: "France"
+ GF: "Guyane française"
+ PF: "Polynésie française"
+ TF: "Terres australes françaises"
+ GA: "Gabon"
+ GM: "Gambie"
+ GE: "Géorgie"
+ DE: "Allemagne"
+ GH: "Ghana"
+ GI: "Gibraltar"
+ GR: "Grèce"
+ GL: "Groenland"
+ GD: "Grenade"
+ GP: "Guadeloupe"
+ GU: "Guam"
+ GT: "Guatemala"
+ GG: "Guernesey"
+ GN: "Guinée"
+ GW: "Guinée-Bissau"
+ GY: "Guyane"
+ HT: "Haïti"
+ HM: "Îles Heard et McDonald"
+ VA: "Saint-Siège (État de la Cité du Vatican)"
+ HN: "Honduras"
+ HK: "Hong Kong"
+ HU: "Hongrie"
+ IS: "Islande"
+ IN: "Inde"
+ ID: "Indonésie"
+ IR: "Iran, République islamique d'"
+ IQ: "Irak"
+ IE: "Irlande"
+ IM: "île de Man"
+ IL: "Israël"
+ IT: "Italie"
+ JM: "Jamaïque"
+ JP: "Japon"
+ JE: "Jersey"
+ JO: "Jordanie"
+ KZ: "Kazakhstan"
+ KE: "Kenya"
+ KI: "Kiribati"
+ KP: "République populaire démocratique de Corée"
+ KR: "Corée, République de"
+ KW: "Koweït"
+ KG: "Kirghizistan"
+ LA: "République démocratique populaire laotienne"
+ LV: "Lettonie"
+ LB: "Liban"
+ LS: "Lesotho"
+ LR: "Liberia"
+ LY: "Libye"
+ LI: "Liechtenstein"
+ LT: "Lituanie"
+ LU: "Luxembourg"
+ MO: "Macao"
+ MK: "Macédoine, ancienne République yougoslave de"
+ MG: "Madagascar"
+ MW: "Malawi"
+ MY: "Malaisie"
+ MV: "Maldives"
+ ML: "Mali"
+ MT: "Malte"
+ MH: "Îles Marshall"
+ MQ: "Martinique"
+ MR: "Mauritanie"
+ MU: "Maurice"
+ YT: "Mayotte"
+ MX: "Mexique"
+ FM: "Micronésie, États fédérés de"
+ MD: "Moldavie, République de"
+ MC: "Monaco"
+ MN: "Mongolie"
+ ME: "Monténégro"
+ MS: "Montserrat"
+ MA: "Maroc"
+ MZ: "Mozambique"
+ MM: "Myanmar"
+ NA: "Namibie"
+ NR: "Nauru"
+ NP: "Népal"
+ NL: "Pays-Bas"
+ NC: "Nouvelle-Calédonie"
+ NZ: "Nouvelle-Zélande"
+ NI: "Nicaragua"
+ NE: "Niger"
+ NG: "Nigeria"
+ NU: "Nioué"
+ NF: "Île Norfolk"
+ MP: "Îles Mariannes du Nord"
+ "NO": "Norvège"
+ OM: "Oman"
+ PK: "Pakistan"
+ PW: "Palaos"
+ PS: "Territoire palestinien occupé"
+ PA: "Panama"
+ PG: "Papouasie-Nouvelle-Guinée"
+ PY: "Paraguay"
+ PE: "Pérou"
+ PH: "Philippines"
+ PN: "Pitcairn"
+ PL: "Pologne"
+ PT: "Portugal"
+ PR: "Porto Rico"
+ QA: "Qatar"
+ RE: "Réunion"
+ RO: "Roumanie"
+ RU: "Fédération de Russie"
+ RW: "Rwanda"
+ BL: "Saint-Barthélemy"
+ SH: "Sainte-Hélène, Ascension et Tristan da Cunha"
+ KN: "Saint-Christophe-et-Niévès"
+ LC: "Sainte-Lucie"
+ MF: "Saint Martin (partie française)"
+ PM: "Saint-Pierre-et-Miquelon"
+ VC: "Saint-Vincent-et-les-Grenadines"
+ WS: "Samoa"
+ SM: "Saint-Marin"
+ ST: "Sao Tomé-et-Principe"
+ SA: "Arabie Saoudite"
+ SN: "Sénégal"
+ RS: "Serbie"
+ SC: "Seychelles"
+ SL: "Sierra Leone"
+ SG: "Singapour"
+ SX: "Sint Maarten (partie néerlandaise)"
+ SK: "Slovaquie"
+ SI: "Slovénie"
+ SB: "Îles Salomon"
+ SO: "Somalie"
+ ZA: "Afrique du Sud"
+ GS: "Géorgie du Sud et îles Sandwich du Sud"
+ SS: "Soudan du Sud"
+ ES: "Espagne"
+ LK: "Sri Lanka"
+ SD: "Soudan"
+ SR: "Suriname"
+ SJ: "Svalbard et Jan Mayen"
+ SZ: "Swaziland"
+ SE: "Suède"
+ CH: "Suisse"
+ SY: "République arabe syrienne"
+ TW: "Taïwan, province de Chine"
+ TJ: "Tadjikistan"
+ TZ: "Tanzanie, République-Unie de"
+ TH: "Thaïlande"
+ TL: "Timor oriental"
+ TG: "Togo"
+ TK: "Tokélaou"
+ TO: "Tonga"
+ TT: "Trinité-et-Tobago"
+ TN: "Tunisie"
+ TR: "Turquie"
+ TM: "Turkménistan"
+ TC: "îles Turques-et-Caïques"
+ TV: "Tuvalu"
+ UG: "Ouganda"
+ UA: "Ukraine"
+ AE: "Émirats arabes unis"
+ GB: "Royaume-Uni"
+ US: "États-Unis"
+ UM: "Îles mineures éloignées des États-Unis"
+ UY: "Uruguay"
+ UZ: "Ouzbékistan"
+ VU: "Vanuatu"
+ VE: "Venezuela, République bolivarienne du"
+ VN: "Vietnam"
+ VG: "Îles Vierges britanniques"
+ VI: "Îles Vierges, États-Unis"
+ WF: "Wallis-et-Futuna"
+ EH: "Sahara occidental"
+ YE: "Yémen"
+ ZM: "Zambie"
+ ZW: "Zimbabwe"
+ billing:
+ name: Nom complet
+ email: E-mail
+ phone: Numéro de téléphone
+ confirmation:
+ amount: Montant
+ last4: Numéro de carte
+ buttons:
+ make_payment: Effectuer un paiement
+ confirm_payment: Confirmer le paiement
+ success: Retour
+ admin:
+ unconfigured: 'Stripe n''est pas configuré correctement. Veuillez consulter Discourse Meta pour obtenir plus d''informations.'
+ on_meta: Discourse Subscriptions sur Meta
+ dashboard:
+ title: Tableau de bord
+ table:
+ head:
+ user: Utilisateur
+ payment_intent: Identifiant du paiement
+ receipt_email: E-mail de réception
+ amount: Montant
+ products:
+ title: Produits
+ operations:
+ create: Créer un nouveau produit
+ update: Mettre à jour le produit
+ new: Nouveau produit
+ destroy:
+ confirm: Voulez-vous vraiment supprimer ce produit ?
+ product:
+ product_id: Identifiant du produit
+ name: Nom du produit
+ statement_descriptor: Descripteur du relevé
+ statement_descriptor_help: Informations supplémentaires relatives à un produit qui apparaîtront sur le relevé de carte de crédit de votre client.
+ plan_help: Créez un plan tarifaire pour abonner les clients à ce produit.
+ description: Description
+ description_help: Description de votre produit d'abonnement.
+ repurchaseable: Achat renouvelable ?
+ repurchase_help: Autoriser l'achat multiple du produit et des plans associés
+ active: Actif
+ active_help: Désactivez cette option jusqu'à ce que votre produit soit prêt pour être rendu public.
+ created_at: Création
+ updated_at: Modification
+ product_help: Avant que les clients puissent s'abonner à votre site, vous devez créer au moins un produit et un abonnement associé.
+ plans:
+ title: Plans tarifaires
+ operations:
+ add: Ajouter un nouveau plan
+ create: Créer un plan
+ update: Mettre à jour le plan
+ create_help: Une fois qu'un plan tarifaire est créé, seuls son surnom, sa période d'essai et son groupe d'utilisateurs peuvent être mis à jour.
+ new: Nouveau plan
+ destroy:
+ confirm: Voulez-vous vraiment supprimer ce plan ?
+ plan:
+ nickname: Surnom du plan
+ nickname_help: Cette information ne sera pas visible pour les clients, mais vous aidera à retrouver ce plan plus tard
+ plan_id: ID du plan
+ product: Produit
+ interval: Intervalle de facturation
+ amount: Montant
+ trial: Nombre de jours de la période d'essai
+ trial_help: Les abonnements à ce plan donneront automatiquement droit à cette période d'essai
+ group: Groupe d'utilisateurs
+ group_help: Il s'agit du groupe d'utilisateurs de Discourse auquel le client est ajouté lors de la création de l'abonnement.
+ active: Actif
+ created_at: Création
+ recurring: Plan récurrent ?
+ coupons:
+ title: Coupons
+ code: Code promotionnel
+ discount: Remise
+ times_redeemed: Nombre d'utilisations
+ active: Actif ?
+ actions: Actions
+ create: Créer un coupon
+ promo_code: Code promotionnel (insensible à la casse)
+ subscriptions:
+ title: Abonnements
+ subscription:
+ user: Utilisateur
+ subscription_id: Identifiant de l'abonnement
+ customer: Client
+ product: Produit
+ plan: Plan
+ status: Statut
+ created_at: Création
+ ask_refund: Rembourser le dernier paiement effectué par le client ?
+ canceled: "L'abonnement est annulé."
diff --git a/plugins/discourse-subscriptions/config/locales/client.gl.yml b/plugins/discourse-subscriptions/config/locales/client.gl.yml
new file mode 100644
index 00000000000..29f049dec69
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.gl.yml
@@ -0,0 +1,56 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+gl:
+ js:
+ discourse_subscriptions:
+ optional: Opcional
+ campaign:
+ success_title: Feito!
+ plans:
+ interval:
+ adverb:
+ day: Diario
+ week: Semanal
+ month: Mensual
+ year: Anual
+ user:
+ payments:
+ created_at: Creado
+ plans:
+ product: Nome
+ subscriptions:
+ status: Estado
+ update_card:
+ single: "Actualizar"
+ created_at: Creado
+ cancel: cancelar
+ billing:
+ email: Correo electrónico
+ admin:
+ dashboard:
+ title: Panel
+ table:
+ head:
+ user: Usuario
+ products:
+ product:
+ description: Descrición
+ active: Activo
+ created_at: Creado
+ updated_at: Actualizado
+ plans:
+ plan:
+ active: Activo
+ created_at: Creado
+ coupons:
+ active: Activo?
+ actions: Accións
+ subscriptions:
+ subscription:
+ user: Usuario
+ status: Estado
+ created_at: Creado
diff --git a/plugins/discourse-subscriptions/config/locales/client.he.yml b/plugins/discourse-subscriptions/config/locales/client.he.yml
new file mode 100644
index 00000000000..5a88caa481a
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.he.yml
@@ -0,0 +1,484 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+he:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_subscriptions: "Discourse מינויים"
+ site_settings:
+ discourse_subscriptions_enabled: הפעלת תוסף המינויים של Discourse.
+ discourse_subscriptions_extra_nav_subscribe: להציג את כפתור הרישום בניווט הראשי
+ discourse_subscriptions_pricing_table_id: נא להוסיף את מזהה טבלת התמחיר (pricing-table-id) מקוד הטמעת טבלת התמחור לכאן.
+ discourse_subscriptions_pricing_table_enabled: כפתור הרישום יציג את טבלת התמחור להמטעה ויעשה שימוש ב־Stripe Checkout.
+ discourse_subscriptions_public_key: מפתח מופץ של Stripe
+ discourse_subscriptions_secret_key: מפתח סודי של Stripe
+ discourse_subscriptions_webhook_secret: סוד התלייה של Stripe
+ discourse_subscriptions_currency: קוד מטבע כבררת מחדל. ניתן לדרוס את זה בעת יצירת תכנית מינוי.
+ discourse_subscriptions_campaign_enabled: מאפשר כרזת מסע פרסום לקידום תמיכה כלכלית בקהילה הזאת.
+ discourse_subscriptions_campaign_goal: היעד המספרי של מסע פרסום התמיכה שלך (מנויים או סכום שגויס).
+ discourse_subscriptions_campaign_type: בוחר את סוג מסע הפרסום להרצה (מנויים או סכום חודשי שגויס).
+ discourse_subscriptions_campaign_banner_location: בוחר את מיקום כרזת מסע הפרסום (למעלה או בסרגל הצד).
+ discourse_subscriptions_campaign_banner_shadow_color: בוחר את צבע הצללת כרזת מסע הפרסום.
+ discourse_subscriptions_campaign_banner_bg_image: ניתן להעלות תמונה משלך כרקע לכרזת מסע הפרסום.
+ discourse_subscriptions_campaign_show_contributors: מציג תמונות ייצוגיות של הרכישות האחרונות של מוצרים שדורשים מינוי.
+ discourse_subscriptions_campaign_product: מזהה המוצר ב־Stripe לשליחה לתומכים כשהם לוחצים על הכפתור במסע הפרסום. אם ההגדרה הזאת ריקה, התומכים יופנו לעמוד המוצרים הראשי.
+ discourse_subscriptions_enable_automatic_tax: מאפשר חישוב מס אוטומטי שיחשב את כל שיעורי המס בכל החשבוניות שמופקות על ידי המינוי.
+ discourse_subscriptions_enable_verbose_logging: הפעלת תיאור מפורט יותר כדי לסייע בניפוי שגיאות. נא לא להשאיר פעיל לצמיתות בסביבה מבצעית.
+ errors:
+ discourse_patrons_amount_must_be_currency: "סכומי המטבעות אמורים להיות מטבעות בלי סימן דולר (למשל: 1.50)"
+ js:
+ filters:
+ subscribe:
+ help: ניתן לתמוך באתר הזה בהרשמה אל
+ discourse_subscriptions:
+ title: מינויי Discourse
+ admin_navigation: מינויים
+ optional: רשות
+ navigation:
+ billing: חיוב
+ payments: תשלומים
+ subscriptions: מינויים
+ subscribe: הרשמה
+ user_activity:
+ payments: תשלומים
+ campaign:
+ title: לתמוך בנו
+ body: אנו זקוקים לעזרה שלך כדי שהקהילה הזאת תמשיך להתקיים!
+ success_title: הצלחה!
+ success_body: אנו מודים ךף על עזרתך להמשך ביסוס הקהילה הזאת!
+ subscribers: מנויים
+ goal_comparison: "<strong>%{current}</strong> מתוך <strong>%{goal}</strong>"
+ raised: גויסו
+ button: תמיכה
+ recent_contributors: תורמים אחרונים
+ goal: הגענו ליעד
+ one_click_campaign: ליצור מסע פרסום תמיכה אוטומטית
+ refresh_campaign: לרענן את נתוני מסע הפרסום
+ refresh_page: נתוני מסע הפרסום מסתנכרנים כעת מול Stripe מאחורי הקלעים. יש לרענן את העמוד בעוד מספר רגעים כדי לטעון את הנתונים העדכניים.
+ supporter: תומך
+ supporters: תומכים
+ confirm_creation_title: ליצור אוטומטית מסע פרסום עבור הקהילה שלך?
+ confirm_creation: |-
+ <p>בחירה להמשיך תיצור:</p>
+
+ <ul>
+ <li>קבוצה לתגמול לתומכים שלך עם כותרת מותאמת אישית ותוספת חביבה לתמונה הייצוגית</li>
+ <li>מוצר Stripe עם מחירים שהוגדרו מראש (חודשית ושנתית) אותו המשתמשים שלך יכולים לרכוש כדי לתמוך באתר שלך.</li>
+ </ul>
+
+ <p>שנמשיך?</p>
+ created: מסע הפרסום שלך בלחיצה בודדת נוצר ומוכן לצאת לדרך! מתבצעת הפניה להגדרות מסע הפרסום.
+ one_time_payment: תשלום חד־פעמי
+ plans:
+ purchase: רכישת מינוי
+ select: בחירת תכנית מינוי
+ interval:
+ adverb:
+ day: יומי
+ week: שבועי
+ month: חודשי
+ year: שנתי
+ payment_button: הרשמה
+ success: תודה לך! המינוי של נוצר.
+ incomplete: התשלום הושלם. המינוי שלך יתעדכן עם סיום תהליך התשלום.
+ validate:
+ payment_options:
+ required: נא לבחור תכנית מינוי.
+ user:
+ payments:
+ id: מזהה תשלום
+ amount: סכום
+ created_at: נוצר
+ payments_help: אין תשלומים
+ plans:
+ rate: תעריף
+ product: שם
+ subscriptions_help: אין לך מינויים פעילים.
+ subscriptions:
+ id: מזהה מינוי
+ status: מצב
+ discounted: בהנחה
+ renews: חידושים
+ update_card:
+ heading: "עדכון כרטיס למינוי: %{sub_id}"
+ single: "עדכון"
+ created_at: נוצר
+ cancel: ביטול
+ cancelled: בוטל
+ operations:
+ destroy:
+ confirm: לבטל את המינוי הזה?
+ subscribe:
+ title: הרשמה
+ view_past: הצגת רכישות עבר
+ no_products: אין מוצרים זמינים.
+ unauthenticated: עליך להיכנס או ליצור חשבון כדי להירשם.
+ invalid_coupon: קוד הקופון שהזנת שגוי. נא לנסות שוב.
+ invalid_cardholder_name: שם בעל הכרטיס נדרש.
+ invalid_cardholder_country: ארץ נדרשת.
+ invalid_cardholder_state: מדינה נדרשת.
+ invalid_cardholder_province: מחוז נדרש.
+ transaction_error: אירעה שגיאה בעיבוד התשלום. נא לנסות שוב.
+ card:
+ title: תשלום
+ customer:
+ title: פרטי הלקו
+ promo_code: קופון
+ buttons:
+ subscribe: הרשמה
+ purchased: נרכשה
+ go_to_billing: מעבר לחיוב
+ already_purchased: תודה רבה לך על רכישת המוצר הזה בעבר!
+ cardholder_name: שם בעל הכרטיס
+ cardholder_address:
+ line1: כתובת
+ city: עיר
+ state: מדינה
+ province: מחוז
+ country: ארץ
+ postal_code: מיקוד
+ countries:
+ AF: "אפגניסטן"
+ AX: "איי אולנד"
+ AL: "אלבניה"
+ DZ: "אלג׳יריה"
+ AS: "סמואה האמריקנית"
+ AD: "אנדורה"
+ AO: "אנגולה"
+ AI: "אנגווילה"
+ AQ: "אנטארקטיקה"
+ AG: "אנטיגואה וברבודה"
+ AR: "ארגנטינה"
+ AM: "ארמניה"
+ AW: "ארובה"
+ AU: "אוסטרליה"
+ AT: "אוסטריה"
+ AZ: "אזרבייג׳ן"
+ BS: "איי בהאמה"
+ BH: "בחריין"
+ BD: "בנגלדש"
+ BB: "ברבדוס"
+ BY: "בלארוס"
+ BE: "בלגיה"
+ BZ: "בליז"
+ BJ: "בנין"
+ BM: "ברמודה"
+ BT: "בהוטן"
+ BO: "בוליביה, המדינה הרב־לאומית של"
+ BQ: "הולנד הקריבית"
+ BA: "בוסניה והרצגובינה"
+ BW: "בוטסואנה"
+ BV: "האי בובה"
+ BR: "ברזיל"
+ IO: "הטריטוריה הבריטית באוקיינוס ההודי"
+ BN: "ברוניי משכן השלום"
+ BG: "בולגריה"
+ BF: "בורקינה פאסו"
+ BI: "בורונדי"
+ KH: "קמבודיה"
+ CM: "קמרון"
+ CA: "קנדה"
+ CV: "כף ורדה"
+ KY: "איי קיימן"
+ CF: "הרפובליקה המרכז אפריקאית"
+ TD: "צ׳אד"
+ CL: "צ׳ילה"
+ CN: "סין"
+ CX: "אי חג המולד"
+ CC: "איי קוקוס (קילינג)"
+ CO: "קולומביה"
+ KM: "קומורו"
+ CG: "קונגו"
+ CD: "קונגו, הרפובליקה הדמוקרטית של"
+ CK: "איי קוק"
+ CR: "קוסטה ריקה"
+ CI: "חוף השנהב"
+ HR: "קרואטיה"
+ CU: "קובה"
+ CW: "קוראסאו"
+ CY: "קפריסין"
+ CZ: "הרפובליקה הצ׳כית"
+ DK: "דנמרק"
+ DJ: "ג׳יבוטי"
+ DM: "דומיניקה"
+ DO: "הרפובליקה הדומיניקנית"
+ EC: "אקוודור"
+ EG: "מצרים"
+ SV: "אל סלבדור"
+ GQ: "גינאה המשוונית"
+ ER: "אריתריאה"
+ EE: "אסטוניה"
+ ET: "אתיופיה"
+ FK: "איי פוקלנד (מאלווינאס)"
+ FO: "איי פארו"
+ FJ: "פיג׳י"
+ FI: "פינלנד"
+ FR: "צרפת"
+ GF: "גיאנה הצרפתית"
+ PF: "פולינזיה הצרפתית"
+ TF: "הארצות הדרומיות והאנטארקטיות של צרפת"
+ GA: "גבון"
+ GM: "גמביה"
+ GE: "גאורגיה"
+ DE: "גרמניה"
+ GH: "גאנה"
+ GI: "גיברלטר"
+ GR: "יוון"
+ GL: "גרינלנד"
+ GD: "גרנדה"
+ GP: "גוואדלופ"
+ GU: "גואם"
+ GT: "גואטמלה"
+ GG: "גרנזי"
+ GN: "גינאה"
+ GW: "גינאה ביסאו"
+ GY: "גיאנה"
+ HT: "האיטי"
+ HM: "האי הרד ואיי מקדונלד"
+ VA: "הכס הקדוש (מדינת הוותיקן)"
+ HN: "הונדורס"
+ HK: "הונג קונג"
+ HU: "הונגריה"
+ IS: "איסלנד"
+ IN: "הודו"
+ ID: "אינדונזיה"
+ IR: "איראן, הרפובליקה האסלאמית של"
+ IQ: "עיראק"
+ IE: "אירלנד"
+ IM: "האי מאן"
+ IL: "ישראל"
+ IT: "איטליה"
+ JM: "ג׳מייקה"
+ JP: "יפן"
+ JE: "ג׳רזי"
+ JO: "ירדן"
+ KZ: "קזחסטן"
+ KE: "קניה"
+ KI: "קיריבטי"
+ KP: "קוריאה, הרפובליקה הדמוקרטית העממית של"
+ KR: "קוריאה, הרפובליקה של"
+ KW: "כוויית"
+ KG: "קירגיזסטן"
+ LA: "לאוס, הרפובליקה הדמוקרטית העממית של"
+ LV: "לטביה"
+ LB: "לבנון"
+ LS: "לסוטו"
+ LR: "ליבריה"
+ LY: "לוב"
+ LI: "ליכטנשטיין"
+ LT: "ליטא"
+ LU: "לוקסמבורג"
+ MO: "מקאו"
+ MK: "מקדוניה, הרפובליקה היוגוסלבית לשעבר של"
+ MG: "מדגסקר"
+ MW: "מלאווי"
+ MY: "מלזיה"
+ MV: "האיים המלדיביים"
+ ML: "מאלי"
+ MT: "מלטה"
+ MH: "איי מרשל"
+ MQ: "מרטיניק"
+ MR: "מאוריטניה"
+ MU: "מאוריציוס"
+ YT: "מיוט"
+ MX: "מקסיקו"
+ FM: "מיקרונזיה, המדינות הפדרטיביות של"
+ MD: "מולדובה, הרפובליקה של"
+ MC: "מונקו"
+ MN: "מונגוליה"
+ ME: "מונטנגרו"
+ MS: "Montserrat"
+ MA: "מרוקו"
+ MZ: "מוזמביק"
+ MM: "מיאנמר"
+ NA: "נמיביה"
+ NR: "נאורו"
+ NP: "נפאל"
+ NL: "הולנד"
+ NC: "קלדוניה החדשה"
+ NZ: "ניו זילנד"
+ NI: "ניקרגואה"
+ NE: "ניז׳ר"
+ NG: "ניגריה"
+ NU: "ניואה"
+ NF: "האי נורפוק"
+ MP: "איי מריאנה הצפוניים"
+ "NO": "נורווגיה"
+ OM: "עומאן"
+ PK: "פקיסטן"
+ PW: "פלאו"
+ PS: "הרשות הפלסטינית"
+ PA: "פנמה"
+ PG: "פפואה גינאה החדשה"
+ PY: "פרגוואי"
+ PE: "פרו"
+ PH: "הפיליפינים"
+ PN: "פיטקרן"
+ PL: "פולין"
+ PT: "פורטוגל"
+ PR: "פוארטו ריקו"
+ QA: "קטאר"
+ RE: "ראוניון"
+ RO: "רומניה"
+ RU: "רוסיה, פדרציית"
+ RW: "רואנדה"
+ BL: "סן ברתלמי"
+ SH: "סנט הלנה, אסנשן וטריסטן דה קונה"
+ KN: "סנט קיטס ונוויס"
+ LC: "סנט לוסיה"
+ MF: "סן מרטן (החלק הצרפתי)"
+ PM: "סן־פייר ומיקלון"
+ VC: "סנט וינסנט והגרנדינים"
+ WS: "סמואה"
+ SM: "סן מרינו"
+ ST: "סאו טומה ופרינסיפה"
+ SA: "ערב הסעודית"
+ SN: "סנגל"
+ RS: "סרביה"
+ SC: "סיישל"
+ SL: "סיירה לאון"
+ SG: "סינגפור"
+ SX: "סן מרטן (החלק ההולנדי)"
+ SK: "סלובקיה"
+ SI: "סלובניה"
+ SB: "איי שלמה"
+ SO: "סומליה"
+ ZA: "דרום אפריקה"
+ GS: "איי ג׳ורג׳יה הדרומית ואיי סנדוויץ׳ הדרומיים"
+ SS: "דרום סודאן"
+ ES: "ספרד"
+ LK: "סרי לנקה"
+ SD: "סודאן"
+ SR: "סורינאם"
+ SJ: "סבאלברד ויאן מאיין"
+ SZ: "סווזילנד"
+ SE: "שוודיה"
+ CH: "שווייץ"
+ SY: "הרפובליקה הערבית הסורית"
+ TW: "טאייוואן, מחוז של סין"
+ TJ: "טג׳יקיסטן"
+ TZ: "טנזניה, הרפובליקה המאוחדת של"
+ TH: "תאילנד"
+ TL: "מזרח טימור"
+ TG: "טוגו"
+ TK: "טוקלאו"
+ TO: "טונגה"
+ TT: "טרינידד וטובגו"
+ TN: "תוניסיה"
+ TR: "טורקיה"
+ TM: "טורקמניסטן"
+ TC: "איי טרקס וקייקוס"
+ TV: "טובאלו"
+ UG: "אוגנדה"
+ UA: "אוקראינה"
+ AE: "איחוד האמירויות הערביות"
+ GB: "הממלכה המאוחדת"
+ US: "ארצות הברית"
+ UM: "האיים המרוחקים הקטנים של ארצות הברית"
+ UY: "אורוגוואי"
+ UZ: "אוזבקיסטן"
+ VU: "ונואטו"
+ VE: "ונצואלה, הרפובליקה הבוליברית של"
+ VN: "וייטנאם"
+ VG: "איי הבתולה הבריטיים"
+ VI: "איי הבתולה, ארצות הברית"
+ WF: "ואליס ופוטונה"
+ EH: "סהרה המערבית"
+ YE: "תימן"
+ ZM: "זמביה"
+ ZW: "זימבבואה"
+ billing:
+ name: שם מלא
+ email: כתובת דוא״ל
+ phone: מספר טלפון
+ confirmation:
+ amount: סכום
+ last4: מספר כרטיס
+ buttons:
+ make_payment: ביצוע תשלום
+ confirm_payment: אישור תשלום
+ success: חזרה
+ admin:
+ unconfigured: 'Stripe לא מוגדר נכון. נא לעיין ב־Discourse Meta למידע נוסף.'
+ on_meta: מינויי Discourse ב־Meta
+ dashboard:
+ title: לוח בקרה
+ table:
+ head:
+ user: משתמש
+ payment_intent: מזהה תשלום
+ receipt_email: דוא״ל הנמען
+ amount: סכום
+ products:
+ title: מוצרים
+ operations:
+ create: יצירת מוצר חדש
+ update: עדכון מוצר
+ new: מוצר חדש
+ destroy:
+ confirm: להשמיד את המוצר הזה?
+ product:
+ product_id: מזהה מוצר
+ name: שם מוצר
+ statement_descriptor: תיאור עסקה
+ statement_descriptor_help: מידע נוסף על המוצר שיופיע בשורה בתדפיס בכרטיס האשראי של הלקוח שלך.
+ plan_help: יצירת תכנית תשלום לרישום לקוחות למוצר הזה.
+ description: תיאור
+ description_help: מתאר את מוצר המינוי שלך.
+ repurchaseable: ניתן לרכישה חוזרת?
+ repurchase_help: לאפשר לרכוש מוצר ותכניות נלוות מספר פעמים
+ active: פעיל
+ active_help: יש לכבות את זה עד שהמוצר שלך מוכן לקבל לקוחות.
+ created_at: נוצר
+ updated_at: עודכן
+ product_help: לפני שללקוחות יתאפשר להירשם לאתר שלך, עליך ליצור לפחות מוצר אחד ותוכנית שיוך.
+ plans:
+ title: תכניות תמחור
+ operations:
+ add: הוספת תכנית חדשה
+ create: יצירת תכנית
+ update: עדכון תכנית
+ create_help: לאחר יצירת תכנית תמחור, ניתן לעדכן אך ורק את הכינוי, תקופת הניסוי וקבוצת המשתמשים שלה.
+ new: תכנית חדשה
+ destroy:
+ confirm: להשמיד את התכנית הזאת?
+ plan:
+ nickname: כינוי התכנית
+ nickname_help: לא יופיע בפני הלקוחות אך יסייע לך למצוא את התכנית הזאת בהמשך
+ plan_id: מזהה תכנית
+ product: מוצר
+ interval: הפרשי חיוב
+ amount: סכום
+ trial: ימי תקופת ניסיון
+ trial_help: מינויים לתכנית זו יתחילו אוטומטית עם תקופת ניסיון באורך זה
+ group: קבוצת משתמשים
+ group_help: זו קבוצת המשתמשים ב־Discourse אליה יתווסף הלקוח בעת יצירת המינוי.
+ active: פעיל
+ created_at: נוצר
+ recurring: תכנית מתחדשת?
+ coupons:
+ title: שוברים
+ code: קוד שובר
+ discount: הנחה
+ times_redeemed: מספר הסליקות
+ active: פעיל?
+ actions: פעולות
+ create: יצירת שובר
+ promo_code: קוד שובר (בלתי תלוי רישיות)
+ subscriptions:
+ title: מינויים
+ subscription:
+ user: משתמש
+ subscription_id: מזהה מינוי
+ customer: לקו
+ product: מוצר
+ plan: תכנית
+ status: מצב
+ created_at: נוצר
+ ask_refund: לזכות את התשלום האחרון ששולם על ידי הלקוח?
+ canceled: "המינוי מבוטל."
diff --git a/plugins/discourse-subscriptions/config/locales/client.hr.yml b/plugins/discourse-subscriptions/config/locales/client.hr.yml
new file mode 100644
index 00000000000..6fdfc6f6189
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.hr.yml
@@ -0,0 +1,56 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+hr:
+ js:
+ discourse_subscriptions:
+ optional: Neobvezno
+ campaign:
+ success_title: Uspjeh!
+ plans:
+ interval:
+ adverb:
+ day: Dnevno
+ week: Tjedno
+ month: Mjesečno
+ year: Godišnje
+ user:
+ payments:
+ created_at: Stvoreno
+ plans:
+ product: Ime i prezime
+ subscriptions:
+ status: Statust
+ update_card:
+ single: "Ažuriraj"
+ created_at: Stvoreno
+ cancel: otkaži
+ billing:
+ email: Email
+ admin:
+ dashboard:
+ title: Nadzorna ploča
+ table:
+ head:
+ user: Korisnik
+ products:
+ product:
+ description: Opis
+ active: Aktivno
+ created_at: Stvoreno
+ updated_at: Ažurirano
+ plans:
+ plan:
+ active: Aktivno
+ created_at: Stvoreno
+ coupons:
+ active: Aktivno?
+ actions: Akcije
+ subscriptions:
+ subscription:
+ user: Korisnik
+ status: Statust
+ created_at: Stvoreno
diff --git a/plugins/discourse-subscriptions/config/locales/client.hu.yml b/plugins/discourse-subscriptions/config/locales/client.hu.yml
new file mode 100644
index 00000000000..133f72dfb3e
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.hu.yml
@@ -0,0 +1,56 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+hu:
+ js:
+ discourse_subscriptions:
+ optional: Opcionális
+ campaign:
+ success_title: Siker!
+ plans:
+ interval:
+ adverb:
+ day: Napi
+ week: Heti
+ month: Havi
+ year: Éves
+ user:
+ payments:
+ created_at: Létrehozott
+ plans:
+ product: Név
+ subscriptions:
+ status: Állapot
+ update_card:
+ single: "Frissítés"
+ created_at: Létrehozott
+ cancel: mégse
+ billing:
+ email: E-mail
+ admin:
+ dashboard:
+ title: Vezérlőpult
+ table:
+ head:
+ user: Felhasználó
+ products:
+ product:
+ description: Leírás
+ active: Aktív
+ created_at: Létrehozott
+ updated_at: Frissítve
+ plans:
+ plan:
+ active: Aktív
+ created_at: Létrehozott
+ coupons:
+ active: Aktív?
+ actions: Műveletek
+ subscriptions:
+ subscription:
+ user: Felhasználó
+ status: Állapot
+ created_at: Létrehozott
diff --git a/plugins/discourse-subscriptions/config/locales/client.hy.yml b/plugins/discourse-subscriptions/config/locales/client.hy.yml
new file mode 100644
index 00000000000..c0452274374
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.hy.yml
@@ -0,0 +1,54 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+hy:
+ js:
+ discourse_subscriptions:
+ optional: Ընտրովի
+ campaign:
+ success_title: Հաջողություն!
+ plans:
+ interval:
+ adverb:
+ day: Օրվա Ընթացքում
+ week: Շաբաթվա Ընթացքում
+ month: Ամսվա Ընթացքում
+ year: Տարվա Ընթացքում
+ user:
+ payments:
+ created_at: Ստեղծված
+ plans:
+ product: Անուն
+ subscriptions:
+ status: Ստատուս
+ created_at: Ստեղծված
+ cancel: չեղարկել
+ billing:
+ email: Էլ. հասցե
+ admin:
+ dashboard:
+ title: Կառավարման Հարթակ
+ table:
+ head:
+ user: Օգտատեր
+ products:
+ product:
+ description: Նկարագրություն
+ active: Ակտիվ
+ created_at: Ստեղծված
+ updated_at: Թարմացված
+ plans:
+ plan:
+ active: Ակտիվ
+ created_at: Ստեղծված
+ coupons:
+ active: Ակտիվ?
+ actions: Գործողություններ
+ subscriptions:
+ subscription:
+ user: Օգտատեր
+ status: Ստատուս
+ created_at: Ստեղծված
diff --git a/plugins/discourse-subscriptions/config/locales/client.id.yml b/plugins/discourse-subscriptions/config/locales/client.id.yml
new file mode 100644
index 00000000000..3b0dfcddc5f
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.id.yml
@@ -0,0 +1,43 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+id:
+ js:
+ discourse_subscriptions:
+ optional: Opsional
+ user:
+ payments:
+ created_at: Dibuat
+ plans:
+ product: Nama
+ subscriptions:
+ status: Status
+ created_at: Dibuat
+ cancel: batal
+ billing:
+ email: Email
+ admin:
+ dashboard:
+ table:
+ head:
+ user: Pengguna
+ products:
+ product:
+ description: Deskripsi
+ active: Aktif
+ created_at: Dibuat
+ plans:
+ plan:
+ active: Aktif
+ created_at: Dibuat
+ coupons:
+ active: Aktif?
+ actions: Aksi
+ subscriptions:
+ subscription:
+ user: Pengguna
+ status: Status
+ created_at: Dibuat
diff --git a/plugins/discourse-subscriptions/config/locales/client.it.yml b/plugins/discourse-subscriptions/config/locales/client.it.yml
new file mode 100644
index 00000000000..837ebe1a2fa
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.it.yml
@@ -0,0 +1,484 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+it:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_subscriptions: "Abbonamenti Discourse"
+ site_settings:
+ discourse_subscriptions_enabled: Abilita il plug-in di abbonamenti a Discourse
+ discourse_subscriptions_extra_nav_subscribe: Mostra il pulsante di abbonamento nel menu principale
+ discourse_subscriptions_pricing_table_id: Aggiungi qui il valore di pricing-table-id dal codice di incorporamento della tabella dei prezzi.
+ discourse_subscriptions_pricing_table_enabled: Il pulsante Abbonati mostrerà la tabella dei prezzi incorporata e verrà utilizzato il checkout di Stripe.
+ discourse_subscriptions_public_key: Chiave Stripe pubblicabile
+ discourse_subscriptions_secret_key: Chiave Stripe segreta
+ discourse_subscriptions_webhook_secret: Segreto Webhook Stripe
+ discourse_subscriptions_currency: Codice valuta predefinito. Questo valore può essere sovrascritto quando si crea un piano di abbonamento.
+ discourse_subscriptions_campaign_enabled: Consente un banner pubblicitario per promuovere il sostegno finanziario a questa community.
+ discourse_subscriptions_campaign_goal: L'obiettivo numerico per la tua campagna di sostegno (numero di abbonati o fondi raccolti).
+ discourse_subscriptions_campaign_type: Seleziona il tipo di campagna da eseguire (sottoscrizione di abbonati o raccolta mensile di fondi).
+ discourse_subscriptions_campaign_banner_location: Seleziona la posizione del banner pubblicitario (in alto o nella barra laterale).
+ discourse_subscriptions_campaign_banner_shadow_color: Seleziona il colore dell'ombreggiatura esterna del banner pubblicitario.
+ discourse_subscriptions_campaign_banner_bg_image: Carica un'immagine personalizzata da utilizzare come sfondo sul banner pubblicitario.
+ discourse_subscriptions_campaign_show_contributors: Mostra gli avatar degli acquisti più recenti di prodotti in abbonamento.
+ discourse_subscriptions_campaign_product: L'ID del prodotto Stripe da inviare ai sostenitori quando fanno clic sul pulsante della campagna. Se questa impostazione è lasciata vuota, i sostenitori verranno reindirizzati alla pagina principale dei prodotti.
+ discourse_subscriptions_enable_automatic_tax: Abilita il calcolo automatico delle imposte che calcolerà automaticamente le aliquote fiscali su tutte le fatture generate dall'abbonamento.
+ discourse_subscriptions_enable_verbose_logging: Abilita una registrazione più dettagliata per facilitare il debug. Non lasciare abilitato in modo permanente in produzione.
+ errors:
+ discourse_patrons_amount_must_be_currency: "Gli importi valutari devono essere valori senza il simbolo del dollaro (ad es. 1,50)"
+ js:
+ filters:
+ subscribe:
+ help: Sostieni questo sito abbonandoti
+ discourse_subscriptions:
+ title: Abbonamenti a Discourse
+ admin_navigation: Abbonamenti
+ optional: Opzionale
+ navigation:
+ billing: Fatturazione
+ payments: Pagamenti
+ subscriptions: Abbonamenti
+ subscribe: Abbonati
+ user_activity:
+ payments: Pagamenti
+ campaign:
+ title: Sostienici
+ body: Abbiamo bisogno del tuo aiuto per continuare a garantire l'attività di questa community!
+ success_title: Riuscito!
+ success_body: Ti ringraziamo del tuo sostegno che ci aiuta a proseguire l'attività di questa community!
+ subscribers: Abbonati
+ goal_comparison: "<strong>%{current}</strong> di <strong>%{goal}</strong>"
+ raised: Fondi raccolti
+ button: Sostienici
+ recent_contributors: Sostenitori recenti
+ goal: Abbiamo raggiunto il nostro obiettivo
+ one_click_campaign: Creazione automatica campagna di sostegno
+ refresh_campaign: Aggiorna i dati della campagna
+ refresh_page: I dati della campagna vengono ora sincronizzati da Stripe in background. Aggiorna la pagina tra poco per caricare le informazioni aggiornate.
+ supporter: Sostenitore
+ supporters: Sostenitori
+ confirm_creation_title: Vuoi creare automaticamente una campagna per la tua community?
+ confirm_creation: |-
+ <p>Se scegli di continuare, procederai alla creazione di:</p>
+
+ <ul>
+ <li>Un gruppo per premiare i tuoi sostenitori con un titolo personalizzato e un avatar elegante</li>
+ <li>Un prodotto Stripe con prezzi predefiniti (mensili e annuali) che i tuoi utenti possono acquistare per sostenere il tuo sito.</li>
+ </ul>
+
+ <p>Vuoi continuare?</p>
+ created: Hai creato la tua campagna in un solo clic ed ora è pronta all'uso! Sarai reindirizzato alle impostazioni della campagna.
+ one_time_payment: Pagamento una tantum
+ plans:
+ purchase: Acquista un abbonamento
+ select: Seleziona il piano di abbonamento
+ interval:
+ adverb:
+ day: Giornaliero
+ week: Settimanale
+ month: Mensile
+ year: Annuale
+ payment_button: Abbonati
+ success: Grazie! Il tuo abbonamento è stato creato.
+ incomplete: Il pagamento non è completo. L'abbonamento verrà aggiornato al completamento del pagamento.
+ validate:
+ payment_options:
+ required: Seleziona un piano di abbonamento.
+ user:
+ payments:
+ id: ID pagamento
+ amount: Importo
+ created_at: Creazione
+ payments_help: Non ci sono pagamenti
+ plans:
+ rate: Tariffa
+ product: Nome
+ subscriptions_help: Non hai abbonamenti attivi.
+ subscriptions:
+ id: ID abbonamento
+ status: Stato
+ discounted: Sconto
+ renews: Rinnovo
+ update_card:
+ heading: "Aggiorna carta per abbonamento: %{sub_id}"
+ single: "Aggiorna"
+ created_at: Creazione
+ cancel: annulla
+ cancelled: annullato
+ operations:
+ destroy:
+ confirm: Vuoi annullare questo abbonamento?
+ subscribe:
+ title: Abbonati
+ view_past: Visualizza gli acquisti precedenti
+ no_products: Al momento non ci sono prodotti disponibili.
+ unauthenticated: Accedi o crea un account per abbonarti.
+ invalid_coupon: Hai inserito un codice coupon non valido. Riprova.
+ invalid_cardholder_name: Il nome del titolare della carta è obbligatorio.
+ invalid_cardholder_country: Il paese è obbligatorio.
+ invalid_cardholder_state: Lo Stato è obbligatorio.
+ invalid_cardholder_province: La provincia è obbligatoria.
+ transaction_error: Si è verificato un errore durante l'elaborazione del pagamento. Riprova.
+ card:
+ title: Pagamento
+ customer:
+ title: Dettagli Cliente
+ promo_code: Coupon
+ buttons:
+ subscribe: Abbonati
+ purchased: Acquistato
+ go_to_billing: Vai a Fatturazione
+ already_purchased: Ti ringraziamo per aver acquistato questo prodotto!
+ cardholder_name: Nome del titolare
+ cardholder_address:
+ line1: Indirizzo
+ city: Città
+ state: Stato
+ province: Provincia
+ country: Paese
+ postal_code: Codice Postale
+ countries:
+ AF: "Afghanistan"
+ AX: "Isole Aland"
+ AL: "Albania"
+ DZ: "Algeria"
+ AS: "Samoa americane"
+ AD: "Andorra"
+ AO: "Angola"
+ AI: "Anguilla"
+ AQ: "Antartide"
+ AG: "Antigua e Barbuda"
+ AR: "Argentina"
+ AM: "Armenia"
+ AW: "Aruba"
+ AU: "Australia"
+ AT: "Austria"
+ AZ: "Azerbaigian"
+ BS: "Bahamas"
+ BH: "Bahrein"
+ BD: "Bangladesh"
+ BB: "Barbados"
+ BY: "Bielorussia"
+ BE: "Belgio"
+ BZ: "Belize"
+ BJ: "Benin"
+ BM: "Bermude"
+ BT: "Bhutan"
+ BO: "Bolivia, Stato Plurinazionale di"
+ BQ: "Bonaire, Sint Eustatius e Saba"
+ BA: "Bosnia Erzegovina"
+ BW: "Botswana"
+ BV: "Isola Bouvet"
+ BR: "Brasile"
+ IO: "Territorio britannico dell'Oceano Indiano"
+ BN: "Brunei Darusalam"
+ BG: "Bulgaria"
+ BF: "Burkina Faso"
+ BI: "Burundi"
+ KH: "Cambogia"
+ CM: "Camerun"
+ CA: "Canada"
+ CV: "Capo Verde"
+ KY: "Isole Cayman"
+ CF: "Repubblica Centrafricana"
+ TD: "Chad"
+ CL: "Cile"
+ CN: "Cina"
+ CX: "Isola di Natale"
+ CC: "Isole Cocos (Keeling)."
+ CO: "Colombia"
+ KM: "Comore"
+ CG: "Congo"
+ CD: "Congo, Repubblica Democratica del"
+ CK: "Isole Cook"
+ CR: "Costa Rica"
+ CI: "Costa d'Avorio"
+ HR: "Croazia"
+ CU: "Cuba"
+ CW: "Curacao"
+ CY: "Cipro"
+ CZ: "Repubblica Ceca"
+ DK: "Danimarca"
+ DJ: "Gibuti"
+ DM: "Dominica"
+ DO: "Repubblica Dominicana"
+ EC: "Ecuador"
+ EG: "Egitto"
+ SV: "El Salvador"
+ GQ: "Guinea Equatoriale"
+ ER: "Eritrea"
+ EE: "Estonia"
+ ET: "Etiopia"
+ FK: "Isole Falkland (Malvine)"
+ FO: "Isole Faroe"
+ FJ: "Figi"
+ FI: "Finlandia"
+ FR: "Francia"
+ GF: "Guiana francese"
+ PF: "Polinesia francese"
+ TF: "Territori della Francia del sud"
+ GA: "Gabon"
+ GM: "Gambia"
+ GE: "Georgia"
+ DE: "Germania"
+ GH: "Ghana"
+ GI: "Gibilterra"
+ GR: "Grecia"
+ GL: "Groenlandia"
+ GD: "Granada"
+ GP: "Guadalupa"
+ GU: "Guam"
+ GT: "Guatemala"
+ GG: "Guernsey"
+ GN: "Guinea"
+ GW: "Guinea Bissau"
+ GY: "Guyana"
+ HT: "Haiti"
+ HM: "Isole Heard e McDonald"
+ VA: "Santa Sede (Stato della Città del Vaticano)"
+ HN: "Honduras"
+ HK: "Hong Kong"
+ HU: "Ungheria"
+ IS: "Islanda"
+ IN: "India"
+ ID: "Indonesia"
+ IR: "Iran, Repubblica Islamica"
+ IQ: "Iraq"
+ IE: "Irlanda"
+ IM: "Isola di Man"
+ IL: "Israele"
+ IT: "Italia"
+ JM: "Giamaica"
+ JP: "Giappone"
+ JE: "Maglia"
+ JO: "Giordania"
+ KZ: "Kazakistan"
+ KE: "Kenya"
+ KI: "Kiribati"
+ KP: "Corea, Repubblica popolare democratica di"
+ KR: "Corea, Repubblica di"
+ KW: "Kuwait"
+ KG: "Kirghizistan"
+ LA: "Repubblica democratica popolare del Laos"
+ LV: "Lettonia"
+ LB: "Libano"
+ LS: "Lesoto"
+ LR: "Liberia"
+ LY: "Libia"
+ LI: "Liechtenstein"
+ LT: "Lituania"
+ LU: "Lussemburgo"
+ MO: "Macao"
+ MK: "Macedonia, ex Repubblica jugoslava di"
+ MG: "Madagascar"
+ MW: "Malawi"
+ MY: "Malesia"
+ MV: "Maldive"
+ ML: "Mali"
+ MT: "Malta"
+ MH: "Isole Marshall"
+ MQ: "Martinica"
+ MR: "Mauritania"
+ MU: "Mauritius"
+ YT: "Mayotta"
+ MX: "Messico"
+ FM: "Micronesia, Stati Federati di"
+ MD: "Moldavia, Repubblica di"
+ MC: "Monaco"
+ MN: "Mongolia"
+ ME: "Montenegro"
+ MS: "Montserrat"
+ MA: "Marocco"
+ MZ: "Mozambico"
+ MM: "Birmania"
+ NA: "Namibia"
+ NR: "Nauru"
+ NP: "Nepal"
+ NL: "Olanda"
+ NC: "Nuova Caledonia"
+ NZ: "Nuova Zelanda"
+ NI: "Nicaragua"
+ NE: "Niger"
+ NG: "Nigeria"
+ NU: "Niue"
+ NF: "Isola Norfolk"
+ MP: "Isole Marianne settentrionali"
+ "NO": "Norvegia"
+ OM: "Oman"
+ PK: "Pakistan"
+ PW: "Palau"
+ PS: "Territorio palestinese, occupato"
+ PA: "Panama"
+ PG: "Papua Nuova Guinea"
+ PY: "Paraguay"
+ PE: "Perù"
+ PH: "Filippine"
+ PN: "Pitcairn"
+ PL: "Polonia"
+ PT: "Portogallo"
+ PR: "Porto Rico"
+ QA: "Qatar"
+ RE: "Réunion"
+ RO: "Romania"
+ RU: "Federazione Russa"
+ RW: "Ruanda"
+ BL: "Saint Barthélemy"
+ SH: "Sant'Elena, Ascensione e Tristan da Cunha"
+ KN: "Saint Kitts e Nevis"
+ LC: "Santa Lucia"
+ MF: "Saint Martin (parte francese)"
+ PM: "San Pietro e Miquelon"
+ VC: "Saint Vincent e Grenadine"
+ WS: "Samoa"
+ SM: "San Marino"
+ ST: "Sao Tomè e Principe"
+ SA: "Arabia Saudita"
+ SN: "Senegal"
+ RS: "Serbia"
+ SC: "Seychelles"
+ SL: "Sierra Leone"
+ SG: "Singapore"
+ SX: "Sint Maarten (parte olandese)"
+ SK: "Slovacchia"
+ SI: "Slovenia"
+ SB: "Isole Salomone"
+ SO: "Somalia"
+ ZA: "Sud Africa"
+ GS: "Georgia del Sud e Isole Sandwich Australi"
+ SS: "Sudan del Sud"
+ ES: "Spagna"
+ LK: "Sri Lanka"
+ SD: "Sudan"
+ SR: "Suriname"
+ SJ: "Svalbard e Jan Mayen"
+ SZ: "Swaziland"
+ SE: "Svezia"
+ CH: "Svizzera"
+ SY: "Repubblica Araba Siriana"
+ TW: "Taiwan, provincia della Cina"
+ TJ: "Tagikistan"
+ TZ: "Tanzania, Repubblica Unita di"
+ TH: "Tailandia"
+ TL: "Timor Est"
+ TG: "Andare"
+ TK: "Tokelau"
+ TO: "Tonga"
+ TT: "Trinidad e Tobago"
+ TN: "Tunisia"
+ TR: "Tacchino"
+ TM: "Turkmenistan"
+ TC: "Isole Turks e Caicos"
+ TV: "Tuvalù"
+ UG: "Uganda"
+ UA: "Ucraina"
+ AE: "Emirati Arabi Uniti"
+ GB: "Regno Unito"
+ US: "Stati Uniti"
+ UM: "Isole minori esterne degli Stati Uniti"
+ UY: "Uruguay"
+ UZ: "Uzbekistan"
+ VU: "Vanuatu"
+ VE: "Venezuela, Repubblica Bolivariana di"
+ VN: "Vietnam"
+ VG: "Isole Vergini, britanniche"
+ VI: "Isole Vergini, americane"
+ WF: "Wallis e Futuna"
+ EH: "Sahara occidentale"
+ YE: "Yemen"
+ ZM: "Zambia"
+ ZW: "Zimbabwe"
+ billing:
+ name: Nome Completo
+ email: Email
+ phone: Numero di telefono
+ confirmation:
+ amount: Importo
+ last4: Numero di carta
+ buttons:
+ make_payment: Effettua il pagamento
+ confirm_payment: Conferma il pagamento
+ success: Torna Indietro
+ admin:
+ unconfigured: 'Stripe non è configurato correttamente. Consulta Discourse Meta per altre informazioni.'
+ on_meta: Abbonamenti a Discourse su Meta
+ dashboard:
+ title: Dashboard
+ table:
+ head:
+ user: Utente
+ payment_intent: ID pagamento
+ receipt_email: E-mail di ricevuta
+ amount: Importo
+ products:
+ title: Prodotti
+ operations:
+ create: Crea nuovo prodotto
+ update: Aggiorna prodotto
+ new: Nuovo prodotto
+ destroy:
+ confirm: Vuoi rimuovere questo prodotto?
+ product:
+ product_id: ID prodotto
+ name: Nome del prodotto
+ statement_descriptor: Descrittore estratto conto
+ statement_descriptor_help: Ulteriori informazioni su un prodotto che appariranno sull'estratto conto della carta di credito del cliente.
+ plan_help: Crea un piano tariffario per consentire l'abbonamento dei clienti a questo prodotto.
+ description: Descrizione
+ description_help: Descrizione del tuo prodotto in abbonamento.
+ repurchaseable: Riacquistabile?
+ repurchase_help: Consenti l'acquisto multiplo del prodotto e dei relativi piani di abbonamento.
+ active: Attivi
+ active_help: Disattiva questa opzione finché il tuo prodotto non è pronto per i consumatori.
+ created_at: Creazione
+ updated_at: Aggiornamento
+ product_help: Prima che i clienti possano abbonarsi al tuo sito, devi creare almeno un prodotto e un piano tariffario a esso associato.
+ plans:
+ title: Piani tariffari
+ operations:
+ add: Aggiungi nuovo Piano
+ create: Crea Piano
+ update: Aggiorna Piano
+ create_help: Dopo aver creato un piano tariffario, sarà possibile aggiornare solo il suo soprannome, il periodo di prova e il gruppo di utenti.
+ new: Nuovo Piano
+ destroy:
+ confirm: Vuoi rimuovere questo piano tariffario?
+ plan:
+ nickname: Soprannome piano tariffario
+ nickname_help: Questo nome non sarà visibile ai clienti, ma ti aiuterà a individuare questo piano in seguito
+ plan_id: ID piano
+ product: Prodotto
+ interval: Intervallo di fatturazione
+ amount: Importo
+ trial: Giorni del periodo di prova
+ trial_help: Gli abbonamenti a questo piano inizieranno automaticamente con una prova gratuita di questa durata
+ group: Gruppo di utenti
+ group_help: Si tratta del gruppo di utenti Discourse a cui il cliente viene aggiunto alla creazione dell''abbonamento.
+ active: Attivo
+ created_at: Creazione
+ recurring: Piano periodico?
+ coupons:
+ title: Coupon
+ code: Codice promozionale
+ discount: Sconto
+ times_redeemed: Date di riscossione
+ active: Attivo?
+ actions: Azioni
+ create: Crea coupon
+ promo_code: Codice promozionale (non distingue maiuscole e minuscole)
+ subscriptions:
+ title: Abbonamenti
+ subscription:
+ user: Utente
+ subscription_id: ID abbonamento
+ customer: Cliente
+ product: Prodotto
+ plan: Piano
+ status: Stato
+ created_at: Creazione
+ ask_refund: Rimborsare l'ultimo pagamento effettuato dal cliente?
+ canceled: "L'abbonamento è stato annullato."
diff --git a/plugins/discourse-subscriptions/config/locales/client.ja.yml b/plugins/discourse-subscriptions/config/locales/client.ja.yml
new file mode 100644
index 00000000000..d33f1ed009c
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.ja.yml
@@ -0,0 +1,484 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ja:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_subscriptions: "Discourse サブスクリプション"
+ site_settings:
+ discourse_subscriptions_enabled: Discourse サブスクリプションプラグインを有効にします。
+ discourse_subscriptions_extra_nav_subscribe: プライマリーナビゲーションに購読ボタンを表示する
+ discourse_subscriptions_pricing_table_id: 価格表の埋め込みコードの pricing-table-id をここに追加します。
+ discourse_subscriptions_pricing_table_enabled: 購読ボタンを使うと、埋め込み価格表が表示され、Stripe による決済が使用されます。
+ discourse_subscriptions_public_key: Stripe の公開可能キー
+ discourse_subscriptions_secret_key: Stripe のシークレットキー
+ discourse_subscriptions_webhook_secret: Stripe の Webhook シークレット
+ discourse_subscriptions_currency: デフォルトの通貨コード。これは、サブスクリプションプランを作成する際にオーバーライドできます。
+ discourse_subscriptions_campaign_enabled: このコミュニティーの財政的支援を促進するキャンペーンバナーを有効にします。
+ discourse_subscriptions_campaign_goal: 支援キャンペーンの数値目標(購読者数または集金額)。
+ discourse_subscriptions_campaign_type: 実施するキャンペーンのタイプを選択します(購読者数または月間集金額)。
+ discourse_subscriptions_campaign_banner_location: キャンペーンバナーの場所を選択します(トップまたはサイドバー)。
+ discourse_subscriptions_campaign_banner_shadow_color: キャンペーンバナーのドロップシャドウの色を選択します。
+ discourse_subscriptions_campaign_banner_bg_image: キャンペーンバナーの背景として使用するカスタム画像をアップロードします。
+ discourse_subscriptions_campaign_show_contributors: 直近のサブスクリプション商品のアバターを表示します。
+ discourse_subscriptions_campaign_product: サポーターがキャンペーンのボタンをクリックしたときにサポーターを送信するための Stripe 商品 ID。この設定が空白である場合、サポーターはメインの商品ページにリダイレクトされます。
+ discourse_subscriptions_enable_automatic_tax: サブスクリプションによって生成されるすべての請求書の税率を自動的に計算する自動税計算を有効にします。
+ discourse_subscriptions_enable_verbose_logging: デバッグを支援するために、より詳細なログを有効にします。本番環境では永久的に有効にしないでください。
+ errors:
+ discourse_patrons_amount_must_be_currency: "通貨の金額は、ドル記号なしの通貨である必要があります(例: 1.50)"
+ js:
+ filters:
+ subscribe:
+ help: 購読してこのサイトを支援する
+ discourse_subscriptions:
+ title: Discourse サブスクリプション
+ admin_navigation: サブスクリプション
+ optional: オプション
+ navigation:
+ billing: 請求
+ payments: 支払い
+ subscriptions: サブスクリプション
+ subscribe: 購読
+ user_activity:
+ payments: 支払い
+ campaign:
+ title: ご支援ください
+ body: このコミュニティーを運営し続けるには、あなたの支援が必要です!
+ success_title: 成功!
+ success_body: このコミュニティーの運営をご支援いただきありがとうございます!
+ subscribers: 購読者数
+ goal_comparison: "<strong>%{current}</strong> / <strong>%{goal}</strong>"
+ raised: 集金額
+ button: 支援する
+ recent_contributors: 最近の貢献者
+ goal: 目標を達成しました
+ one_click_campaign: 支援キャンペーンを自動作成
+ refresh_campaign: キャンペーンデータを更新
+ refresh_page: キャンペーンデータはバックグラウンドで Stripe から同期しています。しばらくしてからページを更新し、最新の情報を読み込んでください。
+ supporter: サポーター
+ supporters: サポーター
+ confirm_creation_title: コミュニティーのキャンペーンを自動的に作成しますか?
+ confirm_creation: |-
+ <p>続行すると、以下が作成されます。</p>
+
+ <ul>
+ <li>カスタムタイトルとアバターフレアを報酬として与えるサポーターグループ</li>
+ <li>あなたのサイトを支援するためにユーザーが購入する既定の価格(月間および年間)の Stripe 商品</li>
+ </ul>
+
+ <p>続行しますか?</p>
+ created: ワンクリックキャンペーンが作成され、実施準備が整いました!キャンペーン設定にリダイレクトします。
+ one_time_payment: 一回払い
+ plans:
+ purchase: サブスクリプションを購入する
+ select: サブスクリプションプランを選択する
+ interval:
+ adverb:
+ day: 毎日
+ week: 毎週
+ month: 毎月
+ year: 毎年
+ payment_button: 購読
+ success: ありがとうございました!サブスクリプションが作成されました。
+ incomplete: お支払いは未完了です。あなたのサブスクリプションはお支払いが完了してから更新されます。
+ validate:
+ payment_options:
+ required: サブスクリプションプランを選択してください。
+ user:
+ payments:
+ id: 支払い ID
+ amount: 金額
+ created_at: 作成
+ payments_help: 支払いはありません
+ plans:
+ rate: 料金
+ product: 名前
+ subscriptions_help: アクティブなサブスクリプションはありません。
+ subscriptions:
+ id: サブスクリプション ID
+ status: ステータス
+ discounted: 割引適用
+ renews: 更新
+ update_card:
+ heading: "サブスクリプション用カードの更新: %{sub_id}"
+ single: "更新"
+ created_at: 作成
+ cancel: キャンセル
+ cancelled: キャンセル済み
+ operations:
+ destroy:
+ confirm: このサブスクリプションをキャンセルしてもよろしいですか?
+ subscribe:
+ title: 購読
+ view_past: 過去の購入を表示
+ no_products: 現在、利用可能な商品はありません。
+ unauthenticated: 購読するにはログインするか、アカウントを作成してください。
+ invalid_coupon: 無効なクーポンコードを入力しました。もう一度お試しください。
+ invalid_cardholder_name: カード名義人名は必須です。
+ invalid_cardholder_country: 国は必須です。
+ invalid_cardholder_state: 都道府県は必須です。
+ invalid_cardholder_province: 都道府県は必須です。
+ transaction_error: 支払いの処理中にエラーが発生しました。もう一度お試しください。
+ card:
+ title: 支払い
+ customer:
+ title: お客様情報
+ promo_code: クーポン
+ buttons:
+ subscribe: 購読
+ purchased: 購入済み
+ go_to_billing: 請求に移動
+ already_purchased: この商品をご購入いただきありがとうございました!
+ cardholder_name: カード名義人名
+ cardholder_address:
+ line1: 町名・番地
+ city: 市区郡
+ state: 都道府県
+ province: 都道府県
+ country: 国
+ postal_code: 郵便番号
+ countries:
+ AF: "アフガニスタン"
+ AX: "オーランド諸島"
+ AL: "アルバニア"
+ DZ: "アルジェリア"
+ AS: "アメリカ領サモア"
+ AD: "アンドラ"
+ AO: "アンゴラ"
+ AI: "アンギラ"
+ AQ: "南極大陸"
+ AG: "アンティグア・バーブーダ"
+ AR: "アルゼンチン"
+ AM: "アルメニア"
+ AW: "アルバ"
+ AU: "オーストラリア"
+ AT: "オーストリア"
+ AZ: "アゼルバイジャン"
+ BS: "バハマ"
+ BH: "バーレーン"
+ BD: "バングラデシュ"
+ BB: "バルバドス"
+ BY: "ベラルーシ"
+ BE: "ベルギー"
+ BZ: "ベリーズ"
+ BJ: "ベナン"
+ BM: "バミューダ"
+ BT: "ブータン"
+ BO: "ボリビア多民族国"
+ BQ: "ボネール島、シント・ユースタティウス島、サバ島"
+ BA: "ボスニア・ヘルツェゴヴィナ"
+ BW: "ボツワナ"
+ BV: "ブーべ島"
+ BR: "ブラジル"
+ IO: "イギリス領インド洋地域"
+ BN: "ブルネイ・ダルサラーム"
+ BG: "ブルガリア"
+ BF: "ブルキナファソ"
+ BI: "ブルンジ"
+ KH: "カンボジア"
+ CM: "カメルーン"
+ CA: "カナダ"
+ CV: "カーボベルデ"
+ KY: "ケイマン諸島"
+ CF: "中央アフリカ共和国"
+ TD: "チャド"
+ CL: "チリ"
+ CN: "中国"
+ CX: "クリスマス島"
+ CC: "ココス (キーリング) 諸島"
+ CO: "コロンビア"
+ KM: "コモロ"
+ CG: "コンゴ"
+ CD: "コンゴ民主共和国"
+ CK: "クック諸島"
+ CR: "コスタリカ"
+ CI: "コートジボワール"
+ HR: "クロアチア"
+ CU: "キューバ"
+ CW: "キュラソー"
+ CY: "キプロス"
+ CZ: "チェコ共和国"
+ DK: "デンマーク"
+ DJ: "ジブチ"
+ DM: "ドミニカ"
+ DO: "ドミニカ共和国"
+ EC: "エクアドル"
+ EG: "エジプト"
+ SV: "エルサルバドル"
+ GQ: "赤道ギニア"
+ ER: "エリトリア"
+ EE: "エストニア"
+ ET: "エチオピア"
+ FK: "フォークランド諸島 (マルビナス)"
+ FO: "フェロー諸島"
+ FJ: "フィジー"
+ FI: "フィンランド"
+ FR: "フランス"
+ GF: "フランス領ギアナ"
+ PF: "フランス領ポリネシア"
+ TF: "フランス領南方領土"
+ GA: "ガボン"
+ GM: "ガンビア"
+ GE: "ジョージア"
+ DE: "ドイツ"
+ GH: "ガーナ"
+ GI: "ジブラルタル"
+ GR: "ギリシャ"
+ GL: "グリーンランド"
+ GD: "グレナダ"
+ GP: "グアドループ"
+ GU: "グアム"
+ GT: "グアテマラ"
+ GG: "ガーンジー島"
+ GN: "ギニア"
+ GW: "ギニアビサウ"
+ GY: "ガイアナ"
+ HT: "ハイチ"
+ HM: "ハード島およびマクドナルド島"
+ VA: "ローマ法王庁 (バチカン市国)"
+ HN: "ホンジュラス"
+ HK: "香港"
+ HU: "ハンガリー"
+ IS: "アイスランド"
+ IN: "インド"
+ ID: "インドネシア"
+ IR: "イラン、イスラム共和国"
+ IQ: "イラク"
+ IE: "アイルランド"
+ IM: "マン島"
+ IL: "イスラエル"
+ IT: "イタリア"
+ JM: "ジャマイカ"
+ JP: "日本"
+ JE: "ジャージー"
+ JO: "ヨルダン"
+ KZ: "カザフスタン"
+ KE: "ケニア"
+ KI: "キリバチ"
+ KP: "北朝鮮、民主人民共和国"
+ KR: "韓国、大韓民国"
+ KW: "クウェート"
+ KG: "キルギス"
+ LA: "ラオス人民民主共和国"
+ LV: "ラトビア"
+ LB: "レバノン"
+ LS: "レソト"
+ LR: "リベリア"
+ LY: "リビア"
+ LI: "リヒテンシュタイン"
+ LT: "リトアニア"
+ LU: "ルクセンブルク"
+ MO: "マカオ"
+ MK: "マケドニア、旧ユーゴスラビア共和国"
+ MG: "マダガスカル"
+ MW: "マラウイ"
+ MY: "マレーシア"
+ MV: "モルディブ"
+ ML: "マリ"
+ MT: "マルタ"
+ MH: "マーシャル諸島"
+ MQ: "マルティニーク"
+ MR: "モーリタニア"
+ MU: "モーリシャス"
+ YT: "マヨット"
+ MX: "メキシコ"
+ FM: "ミクロネシア連邦"
+ MD: "モルドバ共和国"
+ MC: "モナコ"
+ MN: "モンゴル"
+ ME: "モンテネグロ"
+ MS: "モントセラト"
+ MA: "モロッコ"
+ MZ: "モザンビーク"
+ MM: "ミャンマー"
+ NA: "ナミビア"
+ NR: "ナウル"
+ NP: "ネパール"
+ NL: "オランダ"
+ NC: "ニューカレドニア"
+ NZ: "ニュージーランド"
+ NI: "ニカラグア"
+ NE: "ニジェール"
+ NG: "ナイジェリア"
+ NU: "ニウエ"
+ NF: "ノーフォーク島"
+ MP: "北マリアナ諸島"
+ "NO": "ノルウェー"
+ OM: "オマーン"
+ PK: "パキスタン"
+ PW: "パラオ"
+ PS: "パレスチナ領土、占領下"
+ PA: "パナマ"
+ PG: "パプアニューギニア"
+ PY: "パラグアイ"
+ PE: "ペルー"
+ PH: "フィリピン"
+ PN: "ピトケアン"
+ PL: "ポーランド"
+ PT: "ポルトガル"
+ PR: "プエルトリコ"
+ QA: "カタール"
+ RE: "レユニオン島"
+ RO: "ルーマニア"
+ RU: "ロシア連邦"
+ RW: "ルワンダ"
+ BL: "サン・バルテルミー島"
+ SH: "セントヘレナ・アセンションおよびトリスタンダクーニャ"
+ KN: "セントクリストファー ネイビス"
+ LC: "セントルシア"
+ MF: "サン・マルタン (フランス領)"
+ PM: "サンピエール島およびミクロン島"
+ VC: "セントビンセントおよびグレナディーン諸島"
+ WS: "サモア"
+ SM: "サンマリノ"
+ ST: "サントメ・プリンシペ"
+ SA: "サウジアラビア"
+ SN: "セネガル"
+ RS: "セルビア"
+ SC: "セーシェル"
+ SL: "シエラレオネ"
+ SG: "シンガポール"
+ SX: "シント・マールテン (オランダ領)"
+ SK: "スロバキア"
+ SI: "スロベニア"
+ SB: "ソロモン諸島"
+ SO: "ソマリア"
+ ZA: "南アフリカ"
+ GS: "サウスジョージア島およびサウスサンドイッチ諸島"
+ SS: "南スーダン"
+ ES: "スペイン"
+ LK: "スリランカ"
+ SD: "スーダン"
+ SR: "スリナム"
+ SJ: "スバールバル諸島およびヤンマイエン島"
+ SZ: "スワジランド"
+ SE: "スウェーデン"
+ CH: "スイス"
+ SY: "シリア・アラブ共和国"
+ TW: "台湾、中国省"
+ TJ: "タジキスタン"
+ TZ: "タンザニア連合共和国"
+ TH: "タイ"
+ TL: "東ティモール"
+ TG: "トーゴ"
+ TK: "トケラウ"
+ TO: "トンガ"
+ TT: "トリニダード・トバゴ"
+ TN: "チュニジア"
+ TR: "トルコ"
+ TM: "トルクメニスタン"
+ TC: "タークス・カイコス諸島"
+ TV: "ツバル"
+ UG: "ウガンダ"
+ UA: "ウクライナ"
+ AE: "アラブ首長国連邦"
+ GB: "イギリス"
+ US: "アメリカ合衆国"
+ UM: "米国領有小離島"
+ UY: "ウルグアイ"
+ UZ: "ウズベキスタン"
+ VU: "バヌアツ"
+ VE: "ベネズエラ、ボリバル共和国"
+ VN: "ベトナム"
+ VG: "イギリス領バージン諸島"
+ VI: "アメリカ領バージン諸島"
+ WF: "ウォリス・フツナ"
+ EH: "西サハラ"
+ YE: "イエメン"
+ ZM: "ザンビア"
+ ZW: "ジンバブエ"
+ billing:
+ name: 氏名
+ email: Eメール
+ phone: 電話番号
+ confirmation:
+ amount: 金額
+ last4: カード番号
+ buttons:
+ make_payment: 支払う
+ confirm_payment: 支払いを確認
+ success: 戻る
+ admin:
+ unconfigured: 'Stripe が正しく構成されていません。詳細は、Discourse メタをご覧ください。'
+ on_meta: メタの Discourse サブスクリプション
+ dashboard:
+ title: ダッシュボード
+ table:
+ head:
+ user: ユーザー
+ payment_intent: 支払い ID
+ receipt_email: 領収書メール
+ amount: 金額
+ products:
+ title: 商品
+ operations:
+ create: 商品の新規作成
+ update: 商品を更新
+ new: 新しい商品
+ destroy:
+ confirm: この商品を破棄してもよろしいですか?
+ product:
+ product_id: 商品 ID
+ name: 商品名
+ statement_descriptor: 明細書の記述
+ statement_descriptor_help: お客様のクレジットカード明細書に表示される商品に関する追加情報。
+ plan_help: お客様がこの商品に購読するための料金プランを作成します。
+ description: 説明
+ description_help: これは、サブスクリプション商品の説明です。
+ repurchaseable: 再購入可能?
+ repurchase_help: 商品と関連するプランを複数回購入できるようにします
+ active: アクティブ
+ active_help: 商品を消費者に提供する準備が整うまで、これをオフにします。
+ created_at: 作成
+ updated_at: 更新
+ product_help: お客様がサイトを購読するまでに、少なくとも 1 つの商品と関連するプランを作成する必要があります。
+ plans:
+ title: 料金プラン
+ operations:
+ add: 新しいプランを追加
+ create: プランを作成
+ update: プランを更新
+ create_help: 料金プランが作成されると、ニックネーム、試用期間、およびユーザーグループのみを更新できます。
+ new: 新しいプラン
+ destroy:
+ confirm: このプランを破棄してもよろしいですか?
+ plan:
+ nickname: プランのニックネーム
+ nickname_help: これはお客様には表示されませんが、後でこのプランを見つけるのに役立ちます
+ plan_id: プラン ID
+ product: 商品
+ interval: 請求頻度
+ amount: 金額
+ trial: 試用期間の日数
+ trial_help: このプランのサブスクリプションは、この期間の無料の試用期間で自動的に開始されます。
+ group: ユーザーグループ
+ group_help: これは、サブスクリプションが作成されたときにお客様が追加される Discourse ユーザーグループです。
+ active: アクティブ
+ created_at: 作成
+ recurring: 定期プラン?
+ coupons:
+ title: クーポン
+ code: プロモコ―ド
+ discount: 割引
+ times_redeemed: 引き換え回数
+ active: アクティブ?
+ actions: アクション
+ create: クーポンを作成
+ promo_code: プロモコ―ド(大文字と小文字を区別しない)
+ subscriptions:
+ title: サブスクリプション
+ subscription:
+ user: ユーザー
+ subscription_id: サブスクリプション ID
+ customer: お客様
+ product: 商品
+ plan: プラン
+ status: ステータス
+ created_at: 作成
+ ask_refund: お客様が最後に行った支払いを返金しますか?
+ canceled: "サブスクリプションはキャンセルされました。"
diff --git a/plugins/discourse-subscriptions/config/locales/client.ko.yml b/plugins/discourse-subscriptions/config/locales/client.ko.yml
new file mode 100644
index 00000000000..af958d88c17
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.ko.yml
@@ -0,0 +1,59 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ko:
+ js:
+ discourse_subscriptions:
+ optional: 선택사항
+ campaign:
+ success_title: 성공!
+ plans:
+ interval:
+ adverb:
+ day: 일
+ week: 주
+ month: 월
+ year: 연
+ user:
+ payments:
+ created_at: 생성일자
+ plans:
+ product: 이름
+ subscriptions:
+ status: 상태
+ update_card:
+ single: "업데이트"
+ created_at: 생성일자
+ cancel: 취소
+ subscribe:
+ countries:
+ MS: "Montserrat"
+ billing:
+ email: 이메일
+ admin:
+ dashboard:
+ title: 대시보드
+ table:
+ head:
+ user: 사용자
+ products:
+ product:
+ description: 내용
+ active: 활성화 사용자
+ created_at: 생성일자
+ updated_at: 업데이트
+ plans:
+ plan:
+ active: 활성화 사용자
+ created_at: 생성일자
+ coupons:
+ active: 활성화 사용자?
+ actions: 작업
+ subscriptions:
+ subscription:
+ user: 사용자
+ status: 상태
+ created_at: 생성일자
diff --git a/plugins/discourse-subscriptions/config/locales/client.lt.yml b/plugins/discourse-subscriptions/config/locales/client.lt.yml
new file mode 100644
index 00000000000..e187a62585a
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.lt.yml
@@ -0,0 +1,56 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+lt:
+ js:
+ discourse_subscriptions:
+ optional: Pasirinktinai
+ campaign:
+ success_title: Sėkmingai!
+ plans:
+ interval:
+ adverb:
+ day: Kasdien
+ week: Kas savaitę
+ month: Kas mėnesį
+ year: Kasmet
+ user:
+ payments:
+ created_at: Sukurta
+ plans:
+ product: Vardas
+ subscriptions:
+ status: Statusas
+ update_card:
+ single: "Atnaujinti"
+ created_at: Sukurta
+ cancel: atšaukti
+ billing:
+ email: Epaštas
+ admin:
+ dashboard:
+ title: Apžvalga
+ table:
+ head:
+ user: Narys
+ products:
+ product:
+ description: Aprašymas
+ active: Aktyvus
+ created_at: Sukurta
+ updated_at: Atnaujinta
+ plans:
+ plan:
+ active: Aktyvus
+ created_at: Sukurta
+ coupons:
+ active: Aktyvus?
+ actions: Veiksmai
+ subscriptions:
+ subscription:
+ user: Narys
+ status: Statusas
+ created_at: Sukurta
diff --git a/plugins/discourse-subscriptions/config/locales/client.lv.yml b/plugins/discourse-subscriptions/config/locales/client.lv.yml
new file mode 100644
index 00000000000..347ff1289c7
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.lv.yml
@@ -0,0 +1,53 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+lv:
+ js:
+ discourse_subscriptions:
+ optional: Pēc izvēles
+ campaign:
+ success_title: Veiksmīgi!
+ plans:
+ interval:
+ adverb:
+ day: Dienas
+ week: Nedēļas
+ month: Mēneša
+ year: Gada
+ user:
+ payments:
+ created_at: Radīts
+ plans:
+ product: Vārds
+ subscriptions:
+ status: Statuss
+ created_at: Radīts
+ cancel: atcelt
+ billing:
+ email: E-pasts
+ admin:
+ dashboard:
+ title: Administrācijas panelis
+ table:
+ head:
+ user: Lietotājs
+ products:
+ product:
+ description: Apraksts
+ active: Aktīvs
+ created_at: Radīts
+ plans:
+ plan:
+ active: Aktīvs
+ created_at: Radīts
+ coupons:
+ active: Aktīvs?
+ actions: Darbības
+ subscriptions:
+ subscription:
+ user: Lietotājs
+ status: Statuss
+ created_at: Radīts
diff --git a/plugins/discourse-subscriptions/config/locales/client.nb_NO.yml b/plugins/discourse-subscriptions/config/locales/client.nb_NO.yml
new file mode 100644
index 00000000000..6682c1226a3
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.nb_NO.yml
@@ -0,0 +1,56 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+nb_NO:
+ js:
+ discourse_subscriptions:
+ optional: Valgfritt
+ campaign:
+ success_title: Suksess!
+ plans:
+ interval:
+ adverb:
+ day: Daglig
+ week: Ukentlig
+ month: Månedlig
+ year: Årlig
+ user:
+ payments:
+ created_at: Opprettet
+ plans:
+ product: Navn
+ subscriptions:
+ status: Status
+ update_card:
+ single: "Oppdater"
+ created_at: Opprettet
+ cancel: avbryt
+ billing:
+ email: E-post
+ admin:
+ dashboard:
+ title: Dashbord
+ table:
+ head:
+ user: Bruker
+ products:
+ product:
+ description: Beskrivelse
+ active: Aktiv
+ created_at: Opprettet
+ updated_at: Oppdatert
+ plans:
+ plan:
+ active: Aktiv
+ created_at: Opprettet
+ coupons:
+ active: Aktiv?
+ actions: Handlinger
+ subscriptions:
+ subscription:
+ user: Bruker
+ status: Status
+ created_at: Opprettet
diff --git a/plugins/discourse-subscriptions/config/locales/client.nl.yml b/plugins/discourse-subscriptions/config/locales/client.nl.yml
new file mode 100644
index 00000000000..2580a9c7bab
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.nl.yml
@@ -0,0 +1,484 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+nl:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_subscriptions: "Discourse-abonnementen"
+ site_settings:
+ discourse_subscriptions_enabled: Schakel de Discourse Subscriptions-plug-in in.
+ discourse_subscriptions_extra_nav_subscribe: Geef de abonneerknop knop weer in de primaire navigatie
+ discourse_subscriptions_pricing_table_id: Voeg hier de prijstabel-ID uit de insluitcode voor de prijstabel toe.
+ discourse_subscriptions_pricing_table_enabled: De knop Abonneren toont de ingesloten prijstabel en Stripe Checkout wordt gebruikt.
+ discourse_subscriptions_public_key: Publiceerbare Stripe-sleutel
+ discourse_subscriptions_secret_key: Geheime Stripe-sleutel
+ discourse_subscriptions_webhook_secret: Stripe-webhookgeheim
+ discourse_subscriptions_currency: Standaard valutacode. Deze kan worden overschreven bij het maken van een abonnement.
+ discourse_subscriptions_campaign_enabled: Schakelt een campagnebanner in om de financiële ondersteuning van deze community te promoten.
+ discourse_subscriptions_campaign_goal: Het numerieke doel voor je steuncampagne (abonnees of ingezameld bedrag).
+ discourse_subscriptions_campaign_type: Selecteert het type campagne dat moet worden uitgevoerd (abonnees of maandelijks ingezameld bedrag).
+ discourse_subscriptions_campaign_banner_location: Selecteert de locatie van de campagnebanner (bovenaan of zijbalk).
+ discourse_subscriptions_campaign_banner_shadow_color: Selecteert de kleur van de slagschaduw van de campagnebanner.
+ discourse_subscriptions_campaign_banner_bg_image: Upload een aangepaste afbeelding als achtergrond voor de campagnebanner.
+ discourse_subscriptions_campaign_show_contributors: Toon avatars van de meest recente aankopen van abonnementsproducten.
+ discourse_subscriptions_campaign_product: De Stripe-product-ID om naar supporters te sturen wanneer ze op de knop van de campagne klikken. Als deze instelling leeg is, worden supporters doorverwezen naar de hoofdpagina met producten.
+ discourse_subscriptions_enable_automatic_tax: Maakt automatische berekening van belastingen mogelijk, waardoor automatisch de belastingtarieven worden berekend op alle facturen die door het abonnement worden gegenereerd.
+ discourse_subscriptions_enable_verbose_logging: Schakelt uitgebreidere logging in om te helpen bij het debuggen. Laat dit niet permanent ingeschakeld tijdens productie.
+ errors:
+ discourse_patrons_amount_must_be_currency: "Valutabedragen moeten valuta zonder valutateken zijn (bijvoorbeeld 1,50)"
+ js:
+ filters:
+ subscribe:
+ help: Steun deze website door je te abonneren
+ discourse_subscriptions:
+ title: Discourse-abonnementen
+ admin_navigation: Abonnementen
+ optional: Optioneel
+ navigation:
+ billing: Facturatie
+ payments: Betalingen
+ subscriptions: Abonnementen
+ subscribe: Abonneren
+ user_activity:
+ payments: Betalingen
+ campaign:
+ title: Steun ons
+ body: We hebben je hulp nodig om deze community draaiende te houden!
+ success_title: Succes!
+ success_body: Bedankt voor je hulp om deze community draaiende te houden!
+ subscribers: Abonnees
+ goal_comparison: "<strong>%{current}</strong> van <strong>%{goal}</strong>"
+ raised: Ingezameld
+ button: Steunen
+ recent_contributors: Recente bijdragers
+ goal: We hebben ons doel bereikt
+ one_click_campaign: Ondersteuningscampagne automatisch maken
+ refresh_campaign: Campagnegegevens vernieuwen
+ refresh_page: Campagnegegevens worden nu gesynchroniseerd vanuit Stripe op de achtergrond. Vernieuw de pagina over enkele ogenblikken om de bijgewerkte gegevens te laden.
+ supporter: Supporter
+ supporters: Supporters
+ confirm_creation_title: Wil je automatisch een campagne maken voor je community?
+ confirm_creation: |-
+ <p>Als je doorgaat, wordt het volgende gemaakt:</p>
+
+ <ul>
+ <li>Een groep om je supporters te belonen met een aangepaste titel en avatarflair</li>
+ <li>Een Stripe-product met vooraf ingestelde prijzen (maandelijks en jaarlijks) die je gebruikers kunnen kopen om je site te steunen.</li>
+ </ul>
+
+ <p>Wil je doorgaan?</p>
+ created: Je één-klik-campagne is gemaakt en klaar voor gebruik! Je wordt naar de campagne-instellingen geleid.
+ one_time_payment: Eenmalige betaling
+ plans:
+ purchase: Koop een abonnement
+ select: Selecteer abonnement
+ interval:
+ adverb:
+ day: Dagelijks
+ week: Wekelijks
+ month: Maandelijks
+ year: Jaarlijks
+ payment_button: Abonneren
+ success: Bedankt!, je abonnement is gemaakt.
+ incomplete: De betaling is niet voltooid. Je abonnement wordt bijgewerkt zodra de betaling is voltooid.
+ validate:
+ payment_options:
+ required: Selecteer een abonnement.
+ user:
+ payments:
+ id: Betalings-ID
+ amount: Bedrag
+ created_at: Gemaakt
+ payments_help: Er zijn geen betalingen
+ plans:
+ rate: Tarief
+ product: Naam
+ subscriptions_help: Je hebt geen actieve abonnementen.
+ subscriptions:
+ id: Abonnements-ID
+ status: Status
+ discounted: Met korting
+ renews: Wordt verlengd
+ update_card:
+ heading: "Kaart bijwerken voor abonnement: %{sub_id}"
+ single: "Bijwerken"
+ created_at: Gemaakt
+ cancel: annuleren
+ cancelled: geannuleerd
+ operations:
+ destroy:
+ confirm: Weet je zeker dat je dit abonnement wilt annuleren?
+ subscribe:
+ title: Abonneren
+ view_past: Eerdere aankopen weergeven
+ no_products: Er zijn momenteel geen producten beschikbaar.
+ unauthenticated: Meld je aan of maak een account aan om je te abonneren.
+ invalid_coupon: Je hebt een ongeldige couponcode ingevoerd. Probeer het opnieuw.
+ invalid_cardholder_name: Naam kaarthouder is vereist.
+ invalid_cardholder_country: Land is vereist.
+ invalid_cardholder_state: Staat is vereist.
+ invalid_cardholder_province: Provincie is vereist.
+ transaction_error: Er was een fout bij het verwerken van de betaling. Probeer het opnieuw.
+ card:
+ title: Betaling
+ customer:
+ title: Klantgegevens
+ promo_code: Coupon
+ buttons:
+ subscribe: Abonneren
+ purchased: Gekocht
+ go_to_billing: Naar facturatie
+ already_purchased: Hartelijk dank voor je eerdere aankoop van dit product!
+ cardholder_name: Naam kaarthouder
+ cardholder_address:
+ line1: Adres
+ city: Plaats
+ state: Staat
+ province: Provincie
+ country: Land
+ postal_code: Postcode
+ countries:
+ AF: "Afghanistan"
+ AX: "Ålandseilanden"
+ AL: "Albanië"
+ DZ: "Algerije"
+ AS: "Amerikaans-Samoa"
+ AD: "Andorra"
+ AO: "Angola"
+ AI: "Anguilla"
+ AQ: "Antarctica"
+ AG: "Antigua en Barbuda"
+ AR: "Argentinië"
+ AM: "Armenië"
+ AW: "Aruba"
+ AU: "Australië"
+ AT: "Oostenrijk"
+ AZ: "Azerbeidzjan"
+ BS: "Bahama's"
+ BH: "Bahrein"
+ BD: "Bangladesh"
+ BB: "Barbados"
+ BY: "Belarus"
+ BE: "België"
+ BZ: "Belize"
+ BJ: "Benin"
+ BM: "Bermuda"
+ BT: "Bhutan"
+ BO: "Bolivia"
+ BQ: "Bonaire, Sint Eustatius en Saba"
+ BA: "Bosnië-Herzegovina"
+ BW: "Botswana"
+ BV: "Bouveteiland"
+ BR: "Brazilië"
+ IO: "Brits Indische Oceaanterritorium"
+ BN: "Brunei"
+ BG: "Bulgarije"
+ BF: "Burkina Faso"
+ BI: "Burundi"
+ KH: "Cambodja"
+ CM: "Kameroen"
+ CA: "Canada"
+ CV: "Kaapverdië"
+ KY: "Kaaimaneilanden"
+ CF: "Centraal-Afrikaanse Republiek"
+ TD: "Tsjaad"
+ CL: "Chili"
+ CN: "China"
+ CX: "Kersteiland"
+ CC: "Cocoseilanden"
+ CO: "Colombia"
+ KM: "Comoren"
+ CG: "Congo"
+ CD: "Congo, Democratische Republiek"
+ CK: "Cookeilanden"
+ CR: "Costa Rica"
+ CI: "Ivoorkust"
+ HR: "Kroatië"
+ CU: "Cuba"
+ CW: "Curaçao"
+ CY: "Cyprus"
+ CZ: "Tsjechië"
+ DK: "Denemarken"
+ DJ: "Djibouti"
+ DM: "Dominica"
+ DO: "Dominicaanse Republiek"
+ EC: "Ecuador"
+ EG: "Egypte"
+ SV: "El Salvador"
+ GQ: "Equatoriaal-Guinea"
+ ER: "Eritrea"
+ EE: "Estland"
+ ET: "Ethiopië"
+ FK: "Falklandeilanden"
+ FO: "Faeröer"
+ FJ: "Fiji"
+ FI: "Finland"
+ FR: "Frankrijk"
+ GF: "Frans-Guyana"
+ PF: "Frans-Polynesië"
+ TF: "Franse Zuidelijke Gebieden"
+ GA: "Gabon"
+ GM: "Gambia"
+ GE: "Georgië"
+ DE: "Duitsland"
+ GH: "Ghana"
+ GI: "Gibraltar"
+ GR: "Griekenland"
+ GL: "Groenland"
+ GD: "Grenada"
+ GP: "Guadeloupe"
+ GU: "Guam"
+ GT: "Guatemala"
+ GG: "Guernsey"
+ GN: "Guinea"
+ GW: "Guinee-Bissau"
+ GY: "Guyana"
+ HT: "Haïti"
+ HM: "Heard en McDonaldeilanden"
+ VA: "Vaticaanstad"
+ HN: "Honduras"
+ HK: "Hongkong"
+ HU: "Hongarije"
+ IS: "IJsland"
+ IN: "India"
+ ID: "Indonesië"
+ IR: "Iran"
+ IQ: "Irak"
+ IE: "Ierland"
+ IM: "Eiland Man"
+ IL: "Israël"
+ IT: "Italië"
+ JM: "Jamaica"
+ JP: "Japan"
+ JE: "Jersey"
+ JO: "Jordanië"
+ KZ: "Kazachstan"
+ KE: "Kenia"
+ KI: "Kiribati"
+ KP: "Noord-Korea"
+ KR: "Zuid-Korea"
+ KW: "Koeweit"
+ KG: "Kirgizië"
+ LA: "Laos"
+ LV: "Letland"
+ LB: "Libanon"
+ LS: "Lesotho"
+ LR: "Liberia"
+ LY: "Libië"
+ LI: "Liechtenstein"
+ LT: "Litouwen"
+ LU: "Luxemburg"
+ MO: "Macau"
+ MK: "Noord-Macedonië"
+ MG: "Madagaskar"
+ MW: "Malawi"
+ MY: "Maleisië"
+ MV: "Maldiven"
+ ML: "Mali"
+ MT: "Malta"
+ MH: "Marshalleilanden"
+ MQ: "Martinique"
+ MR: "Mauritanië"
+ MU: "Mauritius"
+ YT: "Mayotte"
+ MX: "Mexico"
+ FM: "Micronesië"
+ MD: "Moldavië"
+ MC: "Monaco"
+ MN: "Mongolië"
+ ME: "Montenegro"
+ MS: "Montserrat"
+ MA: "Marokko"
+ MZ: "Mozambique"
+ MM: "Myanmar"
+ NA: "Namibië"
+ NR: "Nauru"
+ NP: "Nepal"
+ NL: "Nederland"
+ NC: "Nieuw-Caledonië"
+ NZ: "Nieuw-Zeeland"
+ NI: "Nicaragua"
+ NE: "Niger"
+ NG: "Nigeria"
+ NU: "Niue"
+ NF: "Norfolkeiland"
+ MP: "Noordelijke Marianen"
+ "NO": "Noorwegen"
+ OM: "Oman"
+ PK: "Pakistan"
+ PW: "Palau"
+ PS: "Palestijnse Gebieden"
+ PA: "Panama"
+ PG: "Papoea-Nieuw-Guinea"
+ PY: "Paraguay"
+ PE: "Peru"
+ PH: "Filipijnen"
+ PN: "Pitcairn"
+ PL: "Polen"
+ PT: "Portugal"
+ PR: "Puerto Rico"
+ QA: "Qatar"
+ RE: "Réunion"
+ RO: "Roemenië"
+ RU: "Rusland"
+ RW: "Rwanda"
+ BL: "Saint-Barthélemy"
+ SH: "Sint-Helena, Ascension en Tristan da Cunha"
+ KN: "Saint Kitts en Nevis"
+ LC: "Saint Lucia"
+ MF: "Sint Maarten (Frans deel)"
+ PM: "Saint-Pierre en Miquelon"
+ VC: "Saint Vincent en de Grenadines"
+ WS: "Samoa"
+ SM: "San Marino"
+ ST: "Sao Tomé en Principe"
+ SA: "Saoedi-Arabië"
+ SN: "Senegal"
+ RS: "Servië"
+ SC: "Seychellen"
+ SL: "Sierra Leone"
+ SG: "Singapore"
+ SX: "Sint Maarten (Nederlands deel)"
+ SK: "Slowakije"
+ SI: "Slovenië"
+ SB: "Salomonseilanden"
+ SO: "Somalië"
+ ZA: "Zuid-Afrika"
+ GS: "Zuid-Georgia en de Zuidelijke Sandwicheilanden"
+ SS: "Zuid-Soedan"
+ ES: "Spanje"
+ LK: "Sri Lanka"
+ SD: "Soedan"
+ SR: "Suriname"
+ SJ: "Spitsbergen en Jan Mayen"
+ SZ: "eSwatini"
+ SE: "Zweden"
+ CH: "Zwitserland"
+ SY: "Syrië"
+ TW: "Taiwan"
+ TJ: "Tadzjikistan"
+ TZ: "Tanzania"
+ TH: "Thailand"
+ TL: "Oost-Timor"
+ TG: "Togo"
+ TK: "Tokelau"
+ TO: "Tonga"
+ TT: "Trinidad en Tobago"
+ TN: "Tunesië"
+ TR: "Turkije"
+ TM: "Turkmenistan"
+ TC: "Turks- en Caicoseilanden"
+ TV: "Tuvalu"
+ UG: "Oeganda"
+ UA: "Oekraïne"
+ AE: "Verenigde Arabische Emiraten"
+ GB: "Verenigd Koninkrijk"
+ US: "Verenigde Staten"
+ UM: "Amerikaanse Kleinere Afgelegen Eilanden"
+ UY: "Uruguay"
+ UZ: "Oezbekistan"
+ VU: "Vanuatu"
+ VE: "Venezuela"
+ VN: "Vietnam"
+ VG: "Maagdeneilanden, Britse"
+ VI: "Maagdeneilanden, Amerikaanse"
+ WF: "Wallis en Futuna"
+ EH: "Westelijke Sahara"
+ YE: "Jemen"
+ ZM: "Zambia"
+ ZW: "Zimbabwe"
+ billing:
+ name: Volledige naam
+ email: E-mailadres
+ phone: Telefoonnummer
+ confirmation:
+ amount: Bedrag
+ last4: Kaartnummer
+ buttons:
+ make_payment: Betalen
+ confirm_payment: Betaling bevestigen
+ success: Terug
+ admin:
+ unconfigured: 'Stripe is niet goed geconfigureerd. Zie Discourse Meta voor informatie.'
+ on_meta: Discourse-abonnementen op Meta
+ dashboard:
+ title: Dashboard
+ table:
+ head:
+ user: Gebruiker
+ payment_intent: Betalings-ID
+ receipt_email: E-mailadres voor betalingsbewijs
+ amount: Bedrag
+ products:
+ title: Producten
+ operations:
+ create: Nieuw product maken
+ update: Product bijwerken
+ new: Nieuw product
+ destroy:
+ confirm: Weet je zeker dat je dit product wilt verwijderen?
+ product:
+ product_id: Product-ID
+ name: Productnaam
+ statement_descriptor: Beschrijving op afschrift
+ statement_descriptor_help: Extra informatie over een product die op het afschrift van de creditcard van je klant wordt vermeld.
+ plan_help: Maak een tariefplan om klanten op dit product te abonneren.
+ description: Beschrijving
+ description_help: Dit beschrijft je abonnementsproduct.
+ repurchaseable: Opnieuw koopbaar?
+ repurchase_help: Toestaan dat producten en bijbehorende abonnementen meerdere keren worden gekocht
+ active: Actief
+ active_help: Schakel dit uit totdat je product gereed is voor consumenten.
+ created_at: Gemaakt
+ updated_at: Bijgewerkt
+ product_help: Voordat klanten zich op je website kunnen abonneren, moet je minimaal één product en een bijbehorend abonnement maken.
+ plans:
+ title: Prijsplannen
+ operations:
+ add: Nieuwe plan toevoegen
+ create: Plan maken
+ update: Plan bijwerken
+ create_help: Wanneer een prijsplan is gemaakt, kunnen alleen de alias, proefperiode en gebruikersgroep ervan worden bijgewerkt.
+ new: Nieuw plan
+ destroy:
+ confirm: Weet je zeker dat je dit plan wilt verwijderen?
+ plan:
+ nickname: Planalias
+ nickname_help: Dit is niet zichtbaar voor klanten, maar helpt je dit plan terug te vinden
+ plan_id: Plan-ID
+ product: Product
+ interval: Facturatie-interval
+ amount: Bedrag
+ trial: Proefperiodedagen
+ trial_help: Abonnementen op dit plan beginnen automatisch met een gratis proefperiode van deze duur
+ group: Gebruikersgroep
+ group_help: Dit is de Discourse-gebruikersgroep waaraan de gebruiker wordt toegevoegd wanneer het abonnement wordt gemaakt.
+ active: Actief
+ created_at: Gemaakt
+ recurring: Automatisch verlengd abonnement?
+ coupons:
+ title: Coupons
+ code: Promotiecode
+ discount: Korting
+ times_redeemed: Keren verzilverd
+ active: Actief?
+ actions: Acties
+ create: Coupon maken
+ promo_code: Promotiecode (niet hoofdlettergevoelig)
+ subscriptions:
+ title: Abonnementen
+ subscription:
+ user: Gebruiker
+ subscription_id: Abonnement-ID
+ customer: Klant
+ product: Product
+ plan: Plan
+ status: Status
+ created_at: Gemaakt
+ ask_refund: Laatste betaling door klant terugbetalen?
+ canceled: "Het abonnement is geannuleerd."
diff --git a/plugins/discourse-subscriptions/config/locales/client.pl_PL.yml b/plugins/discourse-subscriptions/config/locales/client.pl_PL.yml
new file mode 100644
index 00000000000..6f3905ae9cc
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.pl_PL.yml
@@ -0,0 +1,181 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+pl_PL:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_subscriptions: "Subskrypcje Discourse"
+ site_settings:
+ discourse_subscriptions_enabled: Włącz wtyczkę Discourse Subscriptions.
+ discourse_subscriptions_extra_nav_subscribe: Pokaż przycisk subskrypcji w podstawowej nawigacji
+ discourse_subscriptions_secret_key: Sekretny klucz Stripe
+ discourse_subscriptions_webhook_secret: Webhook sekretnego klucza Stripe
+ discourse_subscriptions_currency: Domyślny kod waluty. Można to zmienić podczas tworzenia planu subskrypcji.
+ errors:
+ discourse_patrons_amount_must_be_currency: "Kwoty walut muszą być walutami bez symbolu dolara (np. 1,50)"
+ js:
+ filters:
+ subscribe:
+ help: Wesprzyj tę witrynę subskrybując
+ discourse_subscriptions:
+ title: Subskrypcje Discourse
+ admin_navigation: Subskrypcje
+ optional: Opcjonalnie
+ navigation:
+ billing: Rozliczenia
+ payments: Płatności
+ subscriptions: Subskrypcje
+ subscribe: Subskrybuj
+ user_activity:
+ payments: Płatności
+ campaign:
+ title: Wesprzyj nas
+ success_title: Sukces!
+ subscribers: Subskrybenci
+ supporter: Wspierający
+ supporters: Wspierający
+ one_time_payment: Płatność jednorazowa
+ plans:
+ purchase: Kup subskrypcję
+ select: Wybierz plan subskrypcji
+ interval:
+ adverb:
+ day: Dziennie
+ week: Tygodniowo
+ month: Miesięcznie
+ year: Rocznie
+ payment_button: Subskrybuj
+ success: Dziękujemy! Twoja subskrypcja została utworzona.
+ incomplete: Płatność jest niekompletna. Twoja subskrypcja zostanie zaktualizowana po zakończeniu płatności.
+ validate:
+ payment_options:
+ required: Wybierz plan subskrypcji.
+ user:
+ payments:
+ id: ID płatności
+ amount: Kwota
+ created_at: Utworzono
+ payments_help: Nie ma żadnych płatności
+ plans:
+ rate: Oceń
+ product: Imię
+ subscriptions_help: Nie masz żadnych aktywnych subskrypcji.
+ subscriptions:
+ id: ID subskrypcji
+ status: Status
+ discounted: Zniżka
+ renews: Odnawia się
+ update_card:
+ single: "Aktualizuj"
+ created_at: Utworzono
+ cancel: anuluj
+ cancelled: anulowane
+ operations:
+ destroy:
+ confirm: Czy na pewno chcesz anulować tę subskrypcję?
+ subscribe:
+ title: Subskrybuj
+ view_past: Zobacz poprzednie zakupy
+ no_products: Obecnie nie ma dostępnych produktów.
+ unauthenticated: Zaloguj się lub utwórz konto, aby subskrybować.
+ card:
+ title: Płatność
+ customer:
+ title: Dane klienta
+ promo_code: Kupon
+ buttons:
+ subscribe: Subskrybuj
+ purchased: Zakupione
+ go_to_billing: Przejdź do rozliczenia
+ billing:
+ name: Pełna nazwa
+ email: Email
+ phone: Numer telefonu
+ confirmation:
+ amount: Kwota
+ last4: Numer karty
+ buttons:
+ make_payment: Dokonaj płatności
+ confirm_payment: Potwierdź płatność
+ success: Cofnij
+ admin:
+ unconfigured: 'Stripe nie jest poprawnie skonfigurowany. Więcej informacji można znaleźć w Discourse Meta.'
+ dashboard:
+ title: Raporty
+ table:
+ head:
+ user: Użytkownik
+ payment_intent: ID płatności
+ receipt_email: E-mail z potwierdzeniem
+ amount: Kwota
+ products:
+ title: Produkty
+ operations:
+ create: Utwórz nowy produkt
+ update: Zaktualizuj produkt
+ new: Nowy produkt
+ destroy:
+ confirm: Czy na pewno chcesz usunąć ten produkt?
+ product:
+ product_id: ID produktu
+ name: Nazwa produktu
+ statement_descriptor_help: Dodatkowe informacje o produkcie, które pojawią się na wyciągu z karty kredytowej Twojego klienta.
+ plan_help: Utwórz plan cenowy, aby subskrybować klientów tego produktu.
+ description: Opis
+ description_help: To opisuje produkt objęty subskrypcją.
+ repurchaseable: Możliwość ponownego zakupu?
+ repurchase_help: Zezwalaj na wielokrotne kupowanie produktów i powiązanych planów
+ active: Aktywni
+ active_help: Wyłącz tę opcję, aż produkt będzie gotowy dla konsumentów.
+ created_at: Utworzono
+ updated_at: Zaktualizowane
+ plans:
+ title: Plany cenowe
+ operations:
+ add: Dodaj nowy plan
+ create: Utwórz plan
+ update: Zaktualizuj plan
+ create_help: Po utworzeniu planu cenowego można zaktualizować tylko jego nazwę, okres próbny i grupę użytkowników.
+ new: Nowy plan
+ destroy:
+ confirm: Czy na pewno chcesz usunąć ten plan?
+ plan:
+ nickname: Nazwa planu
+ nickname_help: Nie będzie to widoczne dla klientów, ale pomoże Ci później znaleźć ten plan
+ plan_id: ID planu
+ product: Produkt
+ interval: Okres rozliczeniowy
+ amount: Kwota
+ trial: Dni okresu próbnego
+ trial_help: Subskrypcje do tego planu rozpoczną się automatycznie z bezpłatnym okresem próbnym o tej długości
+ group: Grupa użytkownika
+ group_help: To jest grupa użytkowników Discourse, do której klient zostanie dodany po utworzeniu subskrypcji.
+ active: Aktywni
+ created_at: Utworzono
+ recurring: Plan cykliczny?
+ coupons:
+ title: Kupony
+ code: Kod promocyjny
+ discount: Zniżka
+ times_redeemed: Liczba użyć
+ active: Aktywny?
+ actions: Akcje
+ create: Utwórz kupon
+ promo_code: Kod promocyjny (bez rozróżniania wielkości liter)
+ subscriptions:
+ title: Subskrypcje
+ subscription:
+ user: Użytkownik
+ subscription_id: ID subskrypcji
+ customer: Klient
+ product: Produkt
+ plan: Plan
+ status: Status
+ created_at: Utworzono
+ ask_refund: Zwrócić ostatnią płatność dokonaną przez klienta?
+ canceled: "Subskrypcja została anulowana."
diff --git a/plugins/discourse-subscriptions/config/locales/client.pt.yml b/plugins/discourse-subscriptions/config/locales/client.pt.yml
new file mode 100644
index 00000000000..d3cfeeb397f
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.pt.yml
@@ -0,0 +1,173 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+pt:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_subscriptions: "Discourse - Subscrições"
+ site_settings:
+ discourse_subscriptions_enabled: Ativar o plugin Subscrições Discourse.
+ discourse_subscriptions_extra_nav_subscribe: Mostrar o botão de subscrição na navegação principal
+ discourse_subscriptions_public_key: Chave Publicável do Stripe
+ discourse_subscriptions_secret_key: Chave Secreta Stripe
+ discourse_subscriptions_webhook_secret: Webhook Secreto Stripe
+ discourse_subscriptions_currency: Código de Moeda Padrão. Isto pode ser substituído ao criar um plano de subscrição.
+ errors:
+ discourse_patrons_amount_must_be_currency: "Os valores das moedas devem ser moedas sem o símbolo do dólar (por exemplo, 1.50)"
+ js:
+ filters:
+ subscribe:
+ help: Apoie este site através de uma subscrição
+ discourse_subscriptions:
+ title: Discourse - Subscrições
+ admin_navigation: Subscrições
+ optional: Opcional
+ navigation:
+ billing: Faturação
+ payments: Pagamentos
+ subscriptions: Subscrições
+ subscribe: Subscrever
+ user_activity:
+ payments: Pagamentos
+ one_time_payment: Pagamento único
+ plans:
+ purchase: Comprar uma subscrição
+ select: Selecionar plano de subscrição
+ interval:
+ adverb:
+ day: Diariamente
+ week: Semanalmente
+ month: Mensalmente
+ year: Anualmente
+ payment_button: Subscrever
+ success: Obrigado! A sua subscrição foi criada.
+ incomplete: O pagamento está incompleto. A sua subscrição será atualizada quando o pagamento for concluído.
+ validate:
+ payment_options:
+ required: Por favor, selecione um plano de subscrição.
+ user:
+ payments:
+ id: Id. de Pagamento
+ amount: Montante
+ created_at: Criado
+ payments_help: Não existem pagamentos
+ plans:
+ rate: Taxa
+ product: Nome
+ subscriptions_help: Não tem subscrições ativas.
+ subscriptions:
+ id: Id. da Subscrição
+ status: Estado
+ discounted: Descontado
+ renews: Renovações
+ update_card:
+ single: "Atualização"
+ created_at: Criado
+ cancel: cancelar
+ cancelled: cancelada
+ operations:
+ destroy:
+ confirm: Tem a certeza que deseja cancelar esta subscrição?
+ subscribe:
+ title: Subscrever
+ view_past: Ver compras passadas
+ no_products: Não existem produtos disponíveis de momento.
+ unauthenticated: Faça login ou crie uma conta para subscrever.
+ card:
+ title: Pagamento
+ customer:
+ title: Detalhes do Cliente
+ promo_code: Cupão
+ buttons:
+ subscribe: Subscrever
+ purchased: Comprado
+ go_to_billing: Ir para Faturação
+ billing:
+ name: Nome completo
+ email: E-mail
+ phone: Número de Telefone
+ confirmation:
+ amount: Montante
+ last4: Número do cartão
+ buttons:
+ make_payment: Efetuar pagamento
+ confirm_payment: Confirmar pagamento
+ success: Anterior
+ admin:
+ unconfigured: 'O Stripe não está correctamente configurado. Por favor, veja o Discourse Meta para obter informações.'
+ dashboard:
+ title: Painel
+ table:
+ head:
+ user: Utilizador
+ payment_intent: Id. de Pagamento
+ receipt_email: E-mail de Recibo
+ amount: Montante
+ products:
+ title: Produtos
+ operations:
+ create: Criar Novo Produto
+ update: Atualizar Produto
+ new: Novo Produto
+ destroy:
+ confirm: Tem a certeza que deseja eliminar este produto?
+ product:
+ product_id: Id. do Produto
+ name: Nome do Produto
+ statement_descriptor: Descritor do Extrato
+ statement_descriptor_help: Informação extra cerca do produto que irá aparecer no extrato do cartão de crédito do seu cliente.
+ plan_help: Crie um plano de preços para subscrever clientes para este produto.
+ description: Descrição
+ description_help: Isto descreve o seu produto de subscrição.
+ repurchaseable: Recomprável?
+ repurchase_help: Permitir a compra de produtos e planos associados várias vezes
+ active: Ativo
+ active_help: Desative isto até que o seu produto esteja pronto para os consumidores.
+ created_at: Criado
+ updated_at: Atualizado
+ plans:
+ title: Planos de Preço
+ operations:
+ add: Adicionar Novo Plano
+ create: Criar Plano
+ update: Atualizar Plano
+ create_help: Depois de ser criado um plano de preços, a sua alcunha, período de teste e grupo de usuários poderão ser atualizados.
+ new: Novo Plano
+ destroy:
+ confirm: Tem a certeza que deseja eliminar este plano?
+ plan:
+ nickname: Alcunha do plano
+ nickname_help: Isto não será visível para os clientes, mas ajudá-lo-á a encontrar este plano mais tarde
+ plan_id: Id. do Plano
+ product: Produto
+ interval: Intervalo de Facturação
+ amount: Montante
+ trial: Dias do Período de Teste
+ trial_help: As subscrições para este plano começarão automaticamente com um teste gratuito com a seguinte duração
+ group: Grupo de Usuários
+ group_help: Este é o grupo de usuários do discourse no qual o cliente é adicionado quando a subscrição é criada.
+ active: Ativo
+ created_at: Criado
+ recurring: Plano Recorrente?
+ coupons:
+ title: Cupões
+ code: Código Promocional
+ discount: Desconto
+ times_redeemed: Vezes Resgatados
+ active: Ativo?
+ actions: Ações
+ subscriptions:
+ title: Subscrições
+ subscription:
+ user: Utilizador
+ subscription_id: Id. da Subscrição
+ customer: Cliente
+ product: Produto
+ plan: Plano
+ status: Estado
+ created_at: Criado
diff --git a/plugins/discourse-subscriptions/config/locales/client.pt_BR.yml b/plugins/discourse-subscriptions/config/locales/client.pt_BR.yml
new file mode 100644
index 00000000000..c7d11142a36
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.pt_BR.yml
@@ -0,0 +1,484 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+pt_BR:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_subscriptions: "Assinaturas do Discourse"
+ site_settings:
+ discourse_subscriptions_enabled: Ativar o Plugin de Assinaturas no Discourse.
+ discourse_subscriptions_extra_nav_subscribe: Mostrar o botão de assinatura na navegação principal
+ discourse_subscriptions_pricing_table_id: Adicione o pricing-table-id do código incorporado da Tabela de Preços aqui.
+ discourse_subscriptions_pricing_table_enabled: No botão de assinatura, serão exibidos a Finalização da Stripe e a tabela de preços incorporada.
+ discourse_subscriptions_public_key: Chave Publicável da Stripe
+ discourse_subscriptions_secret_key: Chave Secreta da Stripe
+ discourse_subscriptions_webhook_secret: Segredo do Webhook da Stripe
+ discourse_subscriptions_currency: Símbolo da Moeda Padrão. Isso pode ser modificado no momento da criação de um plano de assinatura.
+ discourse_subscriptions_campaign_enabled: Ativa um banner de campanha para promover o apoio financeiro a esta comunidade.
+ discourse_subscriptions_campaign_goal: A meta em números para nossa campanha de apoio (assinantes ou quantia recebida).
+ discourse_subscriptions_campaign_type: Seleciona o tipo de campanha para realizar (assinantes ou quantia mensal recebida).
+ discourse_subscriptions_campaign_banner_location: Seleciona o local do banner da campanha (topo ou barra lateral).
+ discourse_subscriptions_campaign_banner_shadow_color: Seleciona a cor da sombra projetada pelo banner da campanha.
+ discourse_subscriptions_campaign_banner_bg_image: Envie uma imagem personalizada para usar como plano de fundo no banner da campanha.
+ discourse_subscriptions_campaign_show_contributors: Mostre avatares das compras mais recentes dos produtos de assinatura.
+ discourse_subscriptions_campaign_product: A ID do produto da Stripe para enviar aos(às) apoiadores(as) quando clicam no botão da campanha. Se esta configuração estiver em branco, eles(as) serão direcionados(as) para a página de produtos principais.
+ discourse_subscriptions_enable_automatic_tax: Ative o cálculo automático dos impostos, determinando as taxas dos tributos automaticamente em todas as faturas geradas pela assinatura.
+ discourse_subscriptions_enable_verbose_logging: Ativa mais registros detalhados para ajudar na depuração. Não deixe essa opção ativada permanentemente durante a produção.
+ errors:
+ discourse_patrons_amount_must_be_currency: "As quantias devem ser escritas sem o símbolo de dólar (ex 1,50)"
+ js:
+ filters:
+ subscribe:
+ help: Apoie este site assinando
+ discourse_subscriptions:
+ title: Assinaturas do Discourse
+ admin_navigation: Assinaturas
+ optional: Opcional
+ navigation:
+ billing: Cobrança
+ payments: Pagamentos
+ subscriptions: Assinaturas
+ subscribe: Assinar
+ user_activity:
+ payments: Pagamentos
+ campaign:
+ title: Apoie-nos
+ body: Precisamos da sua ajuda para manter esta comunidade no ar!
+ success_title: Sucesso!
+ success_body: Obrigado por ajudar a manter esta comunidade no ar!
+ subscribers: Assinantes
+ goal_comparison: "<strong>%{current}</strong> de <strong>%{goal}</strong>"
+ raised: Recebido(s)
+ button: Apoio
+ recent_contributors: Contribuidores(as) recentes
+ goal: Atingimos a nossa meta
+ one_click_campaign: Criar automaticamente campanha de apoio
+ refresh_campaign: Renovar dados da campanha
+ refresh_page: Agora os dados da campanha estão sendo sincronizados com o Stripe em segundo plano. Aguarde um pouco e atualize a página para carregar as informações mais recentes.
+ supporter: Apoiador(a)
+ supporters: Apoiadores(as)
+ confirm_creation_title: Deseja criar automaticamente uma campanha para sua comunidade?
+ confirm_creation: |-
+ <p>Ao, continuar, você criará:</p>
+
+ <ul>
+ <li>Um grupo para recompensar seus apoiadores com um título personalizado e um estilo de avatar</li>
+ <li>Um produto Stripe com preços predefinidos (mensal e anual) que seus usuários podem comprar para ter compatibilidade com o seu site.</li>
+ </ul>
+
+ <p>Deseja continuar?</p>
+ created: Sua campanha de um clique foi criada e já está pronta! Redirecionando para configurações da campanha.
+ one_time_payment: Pagamento Único
+ plans:
+ purchase: Adquirir uma assinatura
+ select: Selecione um plano de assinatura
+ interval:
+ adverb:
+ day: Diário
+ week: Semanalmente
+ month: Mensalmente
+ year: Anualmente
+ payment_button: Assinar
+ success: Obrigado! Sua assinatura foi criada.
+ incomplete: O pagamento está incompleto. Sua assinatura será atualizada quando o pagamento for aceito.
+ validate:
+ payment_options:
+ required: Por favor selecione um plano de assinatura.
+ user:
+ payments:
+ id: ID do Pagamento
+ amount: Quantia
+ created_at: Criado
+ payments_help: Não existem pagamentos
+ plans:
+ rate: Taxa
+ product: Nome
+ subscriptions_help: Você não possui assinaturas ativas.
+ subscriptions:
+ id: ID da Assinatura
+ status: Status
+ discounted: Descontado
+ renews: Renovada
+ update_card:
+ heading: "Atualizar Cartão para assinatura: %{sub_id}"
+ single: "Atualizar"
+ created_at: Criada
+ cancel: cancelar
+ cancelled: cancelado
+ operations:
+ destroy:
+ confirm: Tem certeza que deseja cancelar essa assinatura?
+ subscribe:
+ title: Assinar
+ view_past: Ver compras anteriores
+ no_products: No momento não existem produtos disponíveis.
+ unauthenticated: Entre ou crie uma conta para se inscrever.
+ invalid_coupon: Você inseriu um código de cupom inválido. Tente novamente.
+ invalid_cardholder_name: Requer o nome do(a) titular do cartão.
+ invalid_cardholder_country: Requer o país.
+ invalid_cardholder_state: Requer o estado.
+ invalid_cardholder_province: Requer a província.
+ transaction_error: Houve um erro ao processar o pagamento. Tente novamente.
+ card:
+ title: Pagamento
+ customer:
+ title: Informações do(a) consumidor(a)
+ promo_code: Cupom
+ buttons:
+ subscribe: Fazer assinatura
+ purchased: Comprado
+ go_to_billing: Vá para o Faturamento
+ already_purchased: Muito obrigado por ter comprado este produto!
+ cardholder_name: Nome do(a) titular do cartão
+ cardholder_address:
+ line1: Endereço da rua
+ city: Cidade
+ state: Estado
+ province: Província
+ country: País
+ postal_code: Código postal
+ countries:
+ AF: "Afeganistão"
+ AX: "Ilhas Aland"
+ AL: "Albânia"
+ DZ: "Argélia"
+ AS: "Samoa Americana"
+ AD: "Andorra"
+ AO: "Angola"
+ AI: "Anguilla"
+ AQ: "Antártica"
+ AG: "Antigua e Barbuda"
+ AR: "Argentina"
+ AM: "Armênia"
+ AW: "Aruba"
+ AU: "Austrália"
+ AT: "Áustria"
+ AZ: "Azerbaijão"
+ BS: "Bahamas"
+ BH: "Bahrain"
+ BD: "Bangladesh"
+ BB: "Barbados"
+ BY: "Bielorrússia"
+ BE: "Bélgica"
+ BZ: "Belize"
+ BJ: "Benin"
+ BM: "Bermudas"
+ BT: "Butão"
+ BO: "Bolívia"
+ BQ: "Bonaire, Sint Eustatius e Saba"
+ BA: "Bósnia e Herzegovina"
+ BW: "Botswana"
+ BV: "Ilha Bouvet"
+ BR: "Brasil"
+ IO: "Território Britânico do Oceano Índico"
+ BN: "Brunei Darussalam"
+ BG: "Bulgária"
+ BF: "Burkina Faso"
+ BI: "Burundi"
+ KH: "Camboja"
+ CM: "Camarões"
+ CA: "Canadá"
+ CV: "Cabo Verde"
+ KY: "Ilhas Cayman"
+ CF: "República Centro-Africana"
+ TD: "Chad"
+ CL: "Chile"
+ CN: "China"
+ CX: "Ilhas do Natal"
+ CC: "Ilhas Cocos (Keeling)"
+ CO: "Colômbia"
+ KM: "Comores"
+ CG: "Congo"
+ CD: "República Democrática do Congo"
+ CK: "Ilhas Cook"
+ CR: "Costa Rica"
+ CI: "Costa do Marfim"
+ HR: "Croácia"
+ CU: "Cuba"
+ CW: "Curaçao"
+ CY: "Chipre"
+ CZ: "República Tcheca"
+ DK: "Dinamarca"
+ DJ: "Djibuti"
+ DM: "Dominica"
+ DO: "República Dominicana"
+ EC: "Equador"
+ EG: "Egito"
+ SV: "El Salvador"
+ GQ: "Guiné Equatorial"
+ ER: "Eritreia"
+ EE: "Estônia"
+ ET: "Etiópia"
+ FK: "Ilhas Falkland (Malvinas)"
+ FO: "Ilhas Faroé"
+ FJ: "Fiji"
+ FI: "Finlândia"
+ FR: "França"
+ GF: "Guiana Francesa"
+ PF: "Polinésia Francesa"
+ TF: "Territórios Franceses do Sul"
+ GA: "Gabão"
+ GM: "Gâmbia"
+ GE: "Geórgia"
+ DE: "Alemanha"
+ GH: "Gana"
+ GI: "Gibraltar"
+ GR: "Grécia"
+ GL: "Groelândia"
+ GD: "Granada"
+ GP: "Guadalupe"
+ GU: "Guam"
+ GT: "Guatemala"
+ GG: "Guernsey"
+ GN: "Guiné"
+ GW: "Guiné-Bissau"
+ GY: "Guiana"
+ HT: "Haiti"
+ HM: "Ilha Heard e Ilhas McDonald"
+ VA: "Santa Sé (Estado da Cidade do Vaticano)"
+ HN: "Honduras"
+ HK: "Hong Kong"
+ HU: "Hungria"
+ IS: "Islândia"
+ IN: "Índia"
+ ID: "Indonésia"
+ IR: "República Islâmica do Irã"
+ IQ: "Iraque"
+ IE: "Irlanda"
+ IM: "Ilha de Man"
+ IL: "Israel"
+ IT: "Itália"
+ JM: "Jamaica"
+ JP: "Japão"
+ JE: "Jérsei"
+ JO: "Jordânia"
+ KZ: "Cazaquistão"
+ KE: "Quênia"
+ KI: "Kiribati"
+ KP: "República Popular Democrática da Coreia"
+ KR: "República da Coreia"
+ KW: "Kuwait"
+ KG: "Quirguistão"
+ LA: "República Democrática Popular do Laos"
+ LV: "Letônia"
+ LB: "Líbano"
+ LS: "Lesoto"
+ LR: "Libéria"
+ LY: "Líbia"
+ LI: "Liechtenstein"
+ LT: "Lituânia"
+ LU: "Luxemburgo"
+ MO: "Macau"
+ MK: "Antiga República Iugoslava da Macedônia"
+ MG: "Madagascar"
+ MW: "Malawi"
+ MY: "Malásia"
+ MV: "Maldivas"
+ ML: "Mali"
+ MT: "Malta"
+ MH: "Ilhas Marshall"
+ MQ: "Martinica"
+ MR: "Mauritânia"
+ MU: "Maurícia"
+ YT: "Mayotte"
+ MX: "México"
+ FM: "Estados Federados da Micronésia"
+ MD: "República da Moldávia"
+ MC: "Mônaco"
+ MN: "Mongólia"
+ ME: "Montenegro"
+ MS: "Montserrat"
+ MA: "Marrocos"
+ MZ: "Moçambique"
+ MM: "Mianmar"
+ NA: "Namíbia"
+ NR: "Nauru"
+ NP: "Nepal"
+ NL: "Holanda"
+ NC: "Nova Caledônia"
+ NZ: "Nova Zelândia"
+ NI: "Nicarágua"
+ NE: "Níger"
+ NG: "Nigéria"
+ NU: "Niue"
+ NF: "Ilha Norfolk"
+ MP: "Ilhas Marianas do Norte"
+ "NO": "Noruega"
+ OM: "Omã"
+ PK: "Paquistão"
+ PW: "Palau"
+ PS: "Território Palestino"
+ PA: "Panamá"
+ PG: "Papua Nova Guiné"
+ PY: "Paraguai"
+ PE: "Perú"
+ PH: "Filipinas"
+ PN: "Pitcairn"
+ PL: "Polônia"
+ PT: "Portugal"
+ PR: "Porto Rico"
+ QA: "Catar"
+ RE: "Reunião"
+ RO: "Romênia"
+ RU: "Federação Russa"
+ RW: "Ruanda"
+ BL: "São Bartolomeu"
+ SH: "Santa Helena, Ascensão e Tristão da Cunha"
+ KN: "São Cristóvão e Nevis"
+ LC: "Santa Lúcia"
+ MF: "Saint Martin (parte francesa)"
+ PM: "Saint Pierre e Miquelon"
+ VC: "São Vicente e Granadinas"
+ WS: "Samoa"
+ SM: "San Marino"
+ ST: "São Tomé e Príncipe"
+ SA: "Arábia Saudita"
+ SN: "Senegal"
+ RS: "Sérvia"
+ SC: "Seicheles"
+ SL: "Serra Leoa"
+ SG: "Cingapura"
+ SX: "São Martinho (parte holandesa)"
+ SK: "Eslováquia"
+ SI: "Eslovênia"
+ SB: "Ilhas Salomão"
+ SO: "Somália"
+ ZA: "África do Sul"
+ GS: "Ilhas Geórgia do Sul e Sandwich do Sul"
+ SS: "Sudão do Sul"
+ ES: "Espanha"
+ LK: "Sri Lanka"
+ SD: "Sudão"
+ SR: "Suriname"
+ SJ: "Svalbard e Jan Mayen"
+ SZ: "Suazilândia"
+ SE: "Suécia"
+ CH: "Suíça"
+ SY: "República Árabe da Síria"
+ TW: "Província da China de Taiwan"
+ TJ: "Tajiquistão"
+ TZ: "República Unida da Tanzânia"
+ TH: "Tailândia"
+ TL: "Timor-Leste"
+ TG: "Togo"
+ TK: "Tokelau"
+ TO: "Reino de Tonga"
+ TT: "Trinidad e Tobago"
+ TN: "Tunísia"
+ TR: "Turquia"
+ TM: "Turquemenistão"
+ TC: "Ilhas Turks e Caicos"
+ TV: "Tuvalu"
+ UG: "Uganda"
+ UA: "Ucrânia"
+ AE: "Emirados Árabes Unidos"
+ GB: "Reino Unido"
+ US: "Estados Unidos"
+ UM: "Ilhas Menores Distantes dos Estados Unidos"
+ UY: "Uruguai"
+ UZ: "Uzbequistão"
+ VU: "Vanuatu"
+ VE: "República Bolivariana da Venezuela"
+ VN: "Vietnã"
+ VG: "Ilhas Virgens Britânicas"
+ VI: "Ilhas Virgens, EUA"
+ WF: "Wallis e Futuna"
+ EH: "Saara Ocidental"
+ YE: "Iémen"
+ ZM: "Zâmbia"
+ ZW: "Zimbábue"
+ billing:
+ name: Nome completo
+ email: E-mail
+ phone: Número de telefone
+ confirmation:
+ amount: Quantia
+ last4: Número do cartão
+ buttons:
+ make_payment: Fazer o pagamento
+ confirm_payment: Confirmar pagamento
+ success: Voltar
+ admin:
+ unconfigured: 'O Stripe não está configurado corretamente. Acesse o Meta do Discourse para mais informações.'
+ on_meta: Assinaturas do Discourse no Meta
+ dashboard:
+ title: Painel de Controle
+ table:
+ head:
+ user: Usuário(a)
+ payment_intent: ID do Pagamento
+ receipt_email: E-mail do Recibo
+ amount: Quantia
+ products:
+ title: Produtos
+ operations:
+ create: Criar Novo Produto
+ update: Atualizar Produto
+ new: Novo Produto
+ destroy:
+ confirm: Você tem certeza que deseja eliminar este produto?
+ product:
+ product_id: ID do Produto
+ name: Nome do Produto
+ statement_descriptor: Descrição da Declaração
+ statement_descriptor_help: Informação adicional sobre o produto que aparecerá no extrato do cartão de crédito do(a) cliente.
+ plan_help: Crie um plano de preços para os(as) clientes assinarem este produto.
+ description: Descrição
+ description_help: Isso descreve o seu produto de assinatura.
+ repurchaseable: É possível comprar novamente?
+ repurchase_help: Permitir que produtos e planos associados sejam comprados várias vezes
+ active: Ativos
+ active_help: Desative isso até que seu produto esteja pronto para os(as) consumidores(as).
+ created_at: Criado
+ updated_at: Atualizado
+ product_help: Antes que os(as) clientes possam fazer assinatura no seu site, é preciso criar pelo menos um produto e um plano associado.
+ plans:
+ title: Preços dos planos
+ operations:
+ add: Adicionar Novo Plano
+ create: Criar Plano
+ update: Atualizar Plano
+ create_help: Após criar os preços dos planos, é possível atualizar apenas seu apelido, período de teste e grupo de usuários(as).
+ new: Novo Plano
+ destroy:
+ confirm: Tem certeza que deseja excluir este plano?
+ plan:
+ nickname: Apelido do plano
+ nickname_help: Isso não será visível para os(as) clientes, porém ajudará a encontrar esse plano depois.
+ plan_id: ID do Plano
+ product: Produto
+ interval: Período de Cobrança
+ amount: Quantia
+ trial: Período (em dias) da avaliação
+ trial_help: As assinaturas para esse plano iniciarão automaticamente com a avaliação gratuita com essa duração.
+ group: Grupo de Usuários(as)
+ group_help: Esse é o grupo de usuários(as) em que o cliente será adicionado ao criar a assinatura.
+ active: Ativos
+ created_at: Criado
+ recurring: Plano recorrente?
+ coupons:
+ title: Cupons
+ code: Código promocional
+ discount: Desconto
+ times_redeemed: Vezes Resgatadas
+ active: Ativo?
+ actions: Ações
+ create: Criar cupom
+ promo_code: Código promocional (não diferencia maiúsculas de minúsculas)
+ subscriptions:
+ title: Assinaturas
+ subscription:
+ user: Usuário(a)
+ subscription_id: ID de Assinatura
+ customer: Consumidor(a)
+ product: Produto
+ plan: Plano
+ status: Status
+ created_at: Criado
+ ask_refund: Reembolsar o último pagamento efetuado pelo(a) cliente?
+ canceled: "A assinatura foi cancelada."
diff --git a/plugins/discourse-subscriptions/config/locales/client.ro.yml b/plugins/discourse-subscriptions/config/locales/client.ro.yml
new file mode 100644
index 00000000000..cd9c533c105
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.ro.yml
@@ -0,0 +1,54 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ro:
+ js:
+ discourse_subscriptions:
+ optional: Opțional
+ campaign:
+ success_title: Succes!
+ plans:
+ interval:
+ adverb:
+ day: Zilnic
+ week: Săptămânal
+ month: Lunar
+ year: Anual
+ user:
+ payments:
+ created_at: Creat
+ plans:
+ product: Nume
+ subscriptions:
+ status: Status
+ created_at: Creat
+ cancel: Anulează
+ billing:
+ email: Email
+ admin:
+ dashboard:
+ title: Panou de control
+ table:
+ head:
+ user: Utilizatori
+ products:
+ product:
+ description: Descriere
+ active: Active
+ created_at: Creat
+ updated_at: Actualizat
+ plans:
+ plan:
+ active: Active
+ created_at: Creat
+ coupons:
+ active: Active?
+ actions: Acțiuni
+ subscriptions:
+ subscription:
+ user: Utilizatori
+ status: Status
+ created_at: Creat
diff --git a/plugins/discourse-subscriptions/config/locales/client.ru.yml b/plugins/discourse-subscriptions/config/locales/client.ru.yml
new file mode 100644
index 00000000000..1d5076ba2f1
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.ru.yml
@@ -0,0 +1,484 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ru:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_subscriptions: "Плагин «Подписки» для Discourse"
+ site_settings:
+ discourse_subscriptions_enabled: Включить плагин Discourse Subscription.
+ discourse_subscriptions_extra_nav_subscribe: Показать кнопку подписки в основной навигации
+ discourse_subscriptions_pricing_table_id: Добавьте идентификатор pricing-table-id из кода встраивания таблицы цен здесь.
+ discourse_subscriptions_pricing_table_enabled: Кнопка «Подписаться» отобразит встроенную таблицу цен, и будет использована система Stripe Checkout.
+ discourse_subscriptions_public_key: Публичный ключ сервиса Stripe
+ discourse_subscriptions_secret_key: Секретный ключ сервиса Stripe
+ discourse_subscriptions_webhook_secret: Секретный вебхук сервиса Stripe
+ discourse_subscriptions_currency: Код валюты по умолчанию. Может быть переопределён при создании плана подписки.
+ discourse_subscriptions_campaign_enabled: Использовать баннер кампании для финансовой поддержки сообщества.
+ discourse_subscriptions_campaign_goal: Цель кампании поддержки, выраженная числом (количество подписчиков или сумма сбора).
+ discourse_subscriptions_campaign_type: Тип кампании (подписчики или ежемесячная сумма сбора).
+ discourse_subscriptions_campaign_banner_location: Расположение баннера кампании (верхняя или боковая панель).
+ discourse_subscriptions_campaign_banner_shadow_color: Цвет тени баннера кампании.
+ discourse_subscriptions_campaign_banner_bg_image: Загрузить изображение для использования его в качестве фона на баннере кампании.
+ discourse_subscriptions_campaign_show_contributors: Показывать аватары последних купленных товаров по подписке.
+ discourse_subscriptions_campaign_product: Идентификатор продукта Stripe для отправки участникам, когда они нажимают кнопку кампании. Если этот параметр не задан, участники будут перенаправлены на главную страницу товаров.
+ discourse_subscriptions_enable_automatic_tax: Включает автоматический расчет налогов, который автоматически рассчитывает налоговые ставки для всех счетов, созданных подпиской.
+ discourse_subscriptions_enable_verbose_logging: Включает детализированное ведение журнала для помощи в отладке. Не оставляйте параметр постоянно включенным в рабочей среде.
+ errors:
+ discourse_patrons_amount_must_be_currency: "Сумма должна быть без символа доллара (например, 1,50)"
+ js:
+ filters:
+ subscribe:
+ help: Подпишитесь и поддержите этот сайт
+ discourse_subscriptions:
+ title: Подписки
+ admin_navigation: Подписки
+ optional: Опционально
+ navigation:
+ billing: Биллинг
+ payments: Платежи
+ subscriptions: Подписки
+ subscribe: Подписаться
+ user_activity:
+ payments: Платежи
+ campaign:
+ title: Поддержите нас
+ body: Нам нужна ваша помощь для поддержки и продуктивной работы этого сообщества!
+ success_title: Кампания успешно завершена!
+ success_body: Спасибо за вашу помощь в поддержании работы сообщества!
+ subscribers: Подписчики
+ goal_comparison: "<strong>%{current}</strong> из <strong>%{goal}</strong>"
+ raised: Собрано
+ button: Поддержать
+ recent_contributors: Недавние участники
+ goal: Мы достигли своей цели
+ one_click_campaign: Автосоздание кампании поддержки
+ refresh_campaign: Обновить данные кампании
+ refresh_page: Данные кампании теперь синхронизируются из Stripe в фоновом режиме. Обновите страницу через несколько секунд, чтобы загрузить обновленную информацию.
+ supporter: Участник
+ supporters: Участники
+ confirm_creation_title: Хотите автоматически создать кампанию для своего сообщества?
+ confirm_creation: |-
+ <p>Это приведет к созданию:</p>
+
+ <ul>
+ <li>Группы, которая вознаградит участников индивидуальным титулом и отметкой для аватара.</li>
+ <li>Позиций в Stripe с заранее установленными ценами (ежемесячными и ежегодными), которые пользователи могут приобрести для поддержки вашего сайта.</li>
+ </ul>
+
+ <p>Продолжить?</p>
+ created: Ваша кампания создана в один клик и готова к работе! Перенаправление в настройки кампании.
+ one_time_payment: Одноразовый платеж
+ plans:
+ purchase: Купить подписку
+ select: Выберите тарифный план
+ interval:
+ adverb:
+ day: Ежедневно
+ week: За неделю
+ month: За месяц
+ year: За год
+ payment_button: Подписаться
+ success: Спасибо! Подписка была создана.
+ incomplete: Оплата не завершена. Ваша подписка будет обновлена после завершения оплаты.
+ validate:
+ payment_options:
+ required: Пожалуйста, выберите тарифный план.
+ user:
+ payments:
+ id: Идентификатор платежа
+ amount: Количество
+ created_at: Создано
+ payments_help: Платежи отсутствуют
+ plans:
+ rate: Ставка
+ product: Имя
+ subscriptions_help: У вас нет активных подписок.
+ subscriptions:
+ id: ID подписки
+ status: Статус
+ discounted: Со скидкой
+ renews: Продлить
+ update_card:
+ heading: "Обновить карту для подписки: %{sub_id}"
+ single: "Обновить"
+ created_at: Создано
+ cancel: Отменить
+ cancelled: отменён
+ operations:
+ destroy:
+ confirm: Вы действительно хотите отменить эту подписку?
+ subscribe:
+ title: Подписаться
+ view_past: Посмотреть прошлые покупки
+ no_products: В настоящее время нет доступных предложений.
+ unauthenticated: Войдите в систему или создайте учетную запись, чтобы подписаться.
+ invalid_coupon: Вы ввели неверный код купона. Пожалуйста, попробуйте еще раз.
+ invalid_cardholder_name: Укажите имя держателя карты.
+ invalid_cardholder_country: Укажите страну.
+ invalid_cardholder_state: Укажите штат.
+ invalid_cardholder_province: Укажите провинцию.
+ transaction_error: При обработке платежа произошла ошибка. Попробуйте еще раз.
+ card:
+ title: Оплата
+ customer:
+ title: Данные клиента
+ promo_code: Купон
+ buttons:
+ subscribe: Подписаться
+ purchased: Оплачено
+ go_to_billing: Перейти к оплате
+ already_purchased: Большое спасибо за предыдущую покупку этого продукта!
+ cardholder_name: Имя держателя карты
+ cardholder_address:
+ line1: Почтовый адрес
+ city: Город
+ state: Штат
+ province: Провинция
+ country: Страна
+ postal_code: Почтовый индекс
+ countries:
+ AF: "Афганистан"
+ AX: "Аландские острова"
+ AL: "Албания"
+ DZ: "Алжир"
+ AS: "Американское Самоа"
+ AD: "Андорра"
+ AO: "Ангола"
+ AI: "Ангилья"
+ AQ: "Антарктида"
+ AG: "Антигуа и Барбуда"
+ AR: "Аргентина"
+ AM: "Армения"
+ AW: "Аруба"
+ AU: "Австралия"
+ AT: "Австрия"
+ AZ: "Азербайджан"
+ BS: "Багамские острова"
+ BH: "Бахрейн"
+ BD: "Бангладеш"
+ BB: "Барбадос"
+ BY: "Беларусь"
+ BE: "Бельгия"
+ BZ: "Белиз"
+ BJ: "Бенин"
+ BM: "Бермудские острова"
+ BT: "Бутан"
+ BO: "Боливия (Многонациональное Государство)"
+ BQ: "Бонайре, Синт-Эстатиус и Саба"
+ BA: "Босния и Герцеговина"
+ BW: "Ботсвана"
+ BV: "Остров Буве"
+ BR: "Бразилия"
+ IO: "Британская территория в Индийском океане"
+ BN: "Бруней-Даруссалам"
+ BG: "Болгария"
+ BF: "Буркина-Фасо"
+ BI: "Бурунди"
+ KH: "Камбоджа"
+ CM: "Камерун"
+ CA: "Канада"
+ CV: "Кабо-Верде"
+ KY: "Каймановы острова"
+ CF: "Центральноафриканская Республика"
+ TD: "Чад"
+ CL: "Чили"
+ CN: "Китай"
+ CX: "Остров Рождества"
+ CC: "Кокосовые Острова (Килинг)"
+ CO: "Колумбия"
+ KM: "Коморские острова"
+ CG: "Конго"
+ CD: "Конго (Демократическая Республика)"
+ CK: "Острова Кука"
+ CR: "Коста-Рика"
+ CI: "Кот-д'Ивуар"
+ HR: "Хорватия"
+ CU: "Куба"
+ CW: "Кюрасао"
+ CY: "Кипр"
+ CZ: "Чешская Республика"
+ DK: "Дания"
+ DJ: "Джибути"
+ DM: "Доминика"
+ DO: "Доминиканская Республика"
+ EC: "Эквадор"
+ EG: "Египет"
+ SV: "Сальвадор"
+ GQ: "Экваториальная Гвинея"
+ ER: "Эритрея"
+ EE: "Эстония"
+ ET: "Эфиопия"
+ FK: "Фолклендские (Мальвинские) острова"
+ FO: "Фарерские острова"
+ FJ: "Фиджи"
+ FI: "Финляндия"
+ FR: "Франция"
+ GF: "Французская Гвиана"
+ PF: "Французская Полинезия"
+ TF: "Французские Южные Территории"
+ GA: "Габон"
+ GM: "Гамбия"
+ GE: "Грузия"
+ DE: "Германия"
+ GH: "Гана"
+ GI: "Гибралтар"
+ GR: "Греция"
+ GL: "Гренландия"
+ GD: "Гренада"
+ GP: "Гваделупа"
+ GU: "Гуам"
+ GT: "Гватемала"
+ GG: "Гернси"
+ GN: "Гвинея"
+ GW: "Гвинея-Бисау"
+ GY: "Гайана"
+ HT: "Гаити"
+ HM: "Остров Херд и острова Макдональд"
+ VA: "Ватикан"
+ HN: "Гондурас"
+ HK: "Гонконг"
+ HU: "Венгрия"
+ IS: "Исландия"
+ IN: "Индия"
+ ID: "Индонезия"
+ IR: "Иран (Исламская Республика)"
+ IQ: "Ирак"
+ IE: "Ирландия"
+ IM: "Остров Мэн"
+ IL: "Израиль"
+ IT: "Италия"
+ JM: "Ямайка"
+ JP: "Япония"
+ JE: "Джерси"
+ JO: "Иордания"
+ KZ: "Казахстан"
+ KE: "Кения"
+ KI: "Кирибати"
+ KP: "Корея (Народно-Демократическая Республика)"
+ KR: "Корея (Республика)"
+ KW: "Кувейт"
+ KG: "Кыргызстан"
+ LA: "Лаосская Народно-Демократическая Республика"
+ LV: "Латвия"
+ LB: "Ливан"
+ LS: "Лесото"
+ LR: "Либерия"
+ LY: "Ливия"
+ LI: "Лихтенштейн"
+ LT: "Литва"
+ LU: "Люксембург"
+ MO: "Макао"
+ MK: "Северная Македония"
+ MG: "Мадагаскар"
+ MW: "Малави"
+ MY: "Малайзия"
+ MV: "Мальдивы"
+ ML: "Мали"
+ MT: "Мальта"
+ MH: "Маршалловы острова"
+ MQ: "Мартиника"
+ MR: "Мавритания"
+ MU: "Маврикий"
+ YT: "Майотта"
+ MX: "Мексика"
+ FM: "Микронезия (Федеративные Штаты)"
+ MD: "Молдова (Республика)"
+ MC: "Монако"
+ MN: "Монголия"
+ ME: "Черногория"
+ MS: "Montserrat"
+ MA: "Марокко"
+ MZ: "Мозамбик"
+ MM: "Мьянма"
+ NA: "Намибия"
+ NR: "Науру"
+ NP: "Непал"
+ NL: "Нидерланды"
+ NC: "Новая Каледония"
+ NZ: "Новая Зеландия"
+ NI: "Никарагуа"
+ NE: "Нигер"
+ NG: "Нигерия"
+ NU: "Ниуэ"
+ NF: "Остров Норфолк"
+ MP: "Северные Марианские острова"
+ "NO": "Норвегия"
+ OM: "Оман"
+ PK: "Пакистан"
+ PW: "Палау"
+ PS: "Государство Палестина (оккупированные палестинские территории)"
+ PA: "Панама"
+ PG: "Папуа — Новая Гвинея"
+ PY: "Парагвай"
+ PE: "Перу"
+ PH: "Филиппины"
+ PN: "Питкэрн"
+ PL: "Польша"
+ PT: "Португалия"
+ PR: "Пуэрто-Рико"
+ QA: "Катар"
+ RE: "Реюньон"
+ RO: "Румыния"
+ RU: "Российская Федерация"
+ RW: "Руанда"
+ BL: "Сен-Бартелеми"
+ SH: "Острова Святой Елены, Вознесения и Тристан-да-Кунья"
+ KN: "Сент-Китс и Невис"
+ LC: "Сент-Люсия"
+ MF: "Сен-Мартен (французская часть)"
+ PM: "Сен-Пьер и Микелон"
+ VC: "Сент-Винсент и Гренадины"
+ WS: "Самоа"
+ SM: "Сан-Марино"
+ ST: "Сан-Томе и Принсипи"
+ SA: "Саудовская Аравия"
+ SN: "Сенегал"
+ RS: "Сербия"
+ SC: "Сейшельские острова"
+ SL: "Сьерра-Леоне"
+ SG: "Сингапур"
+ SX: "Синт-Мартен (голландская часть)"
+ SK: "Словакия"
+ SI: "Словения"
+ SB: "Соломоновы острова"
+ SO: "Сомали"
+ ZA: "Южная Африка"
+ GS: "Южная Георгия и Южные Сандвичевы острова"
+ SS: "Южный Судан"
+ ES: "Испания"
+ LK: "Шри-Ланка"
+ SD: "Судан"
+ SR: "Суринам"
+ SJ: "Шпицберген и Ян Майен"
+ SZ: "Эсватини"
+ SE: "Швеция"
+ CH: "Швейцария"
+ SY: "Сирийская Арабская Республика"
+ TW: "Тайвань (провинция Китая)"
+ TJ: "Таджикистан"
+ TZ: "Танзания (Объединенная Республика)"
+ TH: "Таиланд"
+ TL: "Тимор-Лешти"
+ TG: "Того"
+ TK: "Токелау"
+ TO: "Тонга"
+ TT: "Тринидад и Тобаго"
+ TN: "Тунис"
+ TR: "Турция"
+ TM: "Туркменистан"
+ TC: "Острова Теркс и Кайкос"
+ TV: "Тувалу"
+ UG: "Уганда"
+ UA: "Украина"
+ AE: "Объединенные Арабские Эмираты"
+ GB: "Великобритания"
+ US: "Соединенные Штаты Америки"
+ UM: "Внешние малые острова США"
+ UY: "Уругвай"
+ UZ: "Узбекистан"
+ VU: "Вануату"
+ VE: "Венесуэла (Боливарианская Республика)"
+ VN: "Вьетнам"
+ VG: "Виргинские острова (Британские)"
+ VI: "Виргинские острова (США)"
+ WF: "Уоллис и Футуна"
+ EH: "Западная Сахара"
+ YE: "Йемен"
+ ZM: "Замбия"
+ ZW: "Зимбабве"
+ billing:
+ name: ФИО
+ email: Email
+ phone: Телефонный номер
+ confirmation:
+ amount: Количество
+ last4: Номер карты
+ buttons:
+ make_payment: Совершить платеж
+ confirm_payment: Подтвердить оплату
+ success: Назад
+ admin:
+ unconfigured: 'Сервис Stripe настроен неправильно. За дополнительной информацией обратитесь к описанию плагина: meta.discourse.org/t/discourse-subscriptions'
+ on_meta: Подписки на Discourse на Meta
+ dashboard:
+ title: Админка
+ table:
+ head:
+ user: Пользователь
+ payment_intent: Идентификатор платежа
+ receipt_email: Квитанция
+ amount: Количество
+ products:
+ title: Продукты
+ operations:
+ create: Создать новый продукт
+ update: Обновить продукт
+ new: Новый продукт
+ destroy:
+ confirm: Вы действительно хотите удалить этот продукт?
+ product:
+ product_id: Код продукта
+ name: Наименование товара
+ statement_descriptor: Дескриптор оператора
+ statement_descriptor_help: Дополнительная информация о продукте, которая появится в выписке по кредитной карте вашего клиента.
+ plan_help: Создайте тарифный план, чтобы подписать клиентов на этот продукт.
+ description: Описание
+ description_help: Описание подписки.
+ repurchaseable: Многократная покупка?
+ repurchase_help: Разрешить многократную покупку продукта и связанных с ним тарифных планов
+ active: Активный
+ active_help: Отключите эту настройку, пока ваш продукт не будет готов для потребителей.
+ created_at: Создано
+ updated_at: Обновлено
+ product_help: Прежде чем клиенты смогут подписаться на ваш сайт, вам нужно создать хотя бы один продукт и соответствующий тарифный план.
+ plans:
+ title: Планы ценообразования
+ operations:
+ add: Добавить новый план
+ create: Создать план
+ update: Обновить план
+ create_help: После создания тарифного плана можно обновить только его псевдоним, пробный период и группу пользователей.
+ new: Новый план
+ destroy:
+ confirm: Вы действительно хотите удалить этот план?
+ plan:
+ nickname: Название плана
+ nickname_help: Название не будет видно для клиентов, но поможет вам найти этот план позже
+ plan_id: ID плана
+ product: Товар
+ interval: Интервал выставления счетов
+ amount: Количество
+ trial: Дни пробного периода
+ trial_help: Подписки на этот план автоматически начнутся с бесплатной пробной версии
+ group: Группа пользователей
+ group_help: Это группа пользователей, к которой добавляется клиент при создании подписки.
+ active: Активный
+ created_at: Создано
+ recurring: Повторяющийся план?
+ coupons:
+ title: Купоны
+ code: Промокод
+ discount: Скидка
+ times_redeemed: Время погашения
+ active: Активный?
+ actions: Действия
+ create: Создать купон
+ promo_code: Промокод (без учета регистра)
+ subscriptions:
+ title: Подписки
+ subscription:
+ user: Пользователь
+ subscription_id: ID подписки
+ customer: Клиент
+ product: Товар
+ plan: План
+ status: Статус
+ created_at: Создано
+ ask_refund: Вернуть последний платеж клиента?
+ canceled: "Подписка отменена."
diff --git a/plugins/discourse-subscriptions/config/locales/client.sk.yml b/plugins/discourse-subscriptions/config/locales/client.sk.yml
new file mode 100644
index 00000000000..f6c331d598c
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.sk.yml
@@ -0,0 +1,56 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sk:
+ js:
+ discourse_subscriptions:
+ optional: Voliteľné
+ campaign:
+ success_title: Úspech!
+ plans:
+ interval:
+ adverb:
+ day: Denne
+ week: Týždenne
+ month: Mesačne
+ year: Ročne
+ user:
+ payments:
+ created_at: Vytvorené
+ plans:
+ product: Meno
+ subscriptions:
+ status: Stav
+ update_card:
+ single: "Aktualizovať"
+ created_at: Vytvorené
+ cancel: zrušiť
+ billing:
+ email: Email
+ admin:
+ dashboard:
+ title: Ovládací panel
+ table:
+ head:
+ user: Používateľ
+ products:
+ product:
+ description: Popis
+ active: Aktívny
+ created_at: Vytvorené
+ updated_at: Aktualizované
+ plans:
+ plan:
+ active: Aktívny
+ created_at: Vytvorené
+ coupons:
+ active: Aktívny?
+ actions: Akcie
+ subscriptions:
+ subscription:
+ user: Používateľ
+ status: Stav
+ created_at: Vytvorené
diff --git a/plugins/discourse-subscriptions/config/locales/client.sl.yml b/plugins/discourse-subscriptions/config/locales/client.sl.yml
new file mode 100644
index 00000000000..1cfacf823e4
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.sl.yml
@@ -0,0 +1,53 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sl:
+ js:
+ discourse_subscriptions:
+ optional: Neobvezno
+ campaign:
+ success_title: Uspeh!
+ plans:
+ interval:
+ adverb:
+ day: Dnevno
+ week: Tedensko
+ month: Mesečno
+ year: V letu
+ user:
+ payments:
+ created_at: Ustvarjeno
+ plans:
+ product: Polno ime
+ subscriptions:
+ status: Stanje
+ created_at: Ustvarjeno
+ cancel: prekliči
+ billing:
+ email: E-sporočila
+ admin:
+ dashboard:
+ title: Nadzorna plošča
+ table:
+ head:
+ user: Uporabnik
+ products:
+ product:
+ description: Opis
+ active: Aktivni
+ created_at: Ustvarjeno
+ plans:
+ plan:
+ active: Aktivni
+ created_at: Ustvarjeno
+ coupons:
+ active: Aktivni?
+ actions: Akcije
+ subscriptions:
+ subscription:
+ user: Uporabnik
+ status: Stanje
+ created_at: Ustvarjeno
diff --git a/plugins/discourse-subscriptions/config/locales/client.sq.yml b/plugins/discourse-subscriptions/config/locales/client.sq.yml
new file mode 100644
index 00000000000..37c995e708e
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.sq.yml
@@ -0,0 +1,49 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sq:
+ js:
+ discourse_subscriptions:
+ optional: Fakultative
+ plans:
+ interval:
+ adverb:
+ day: Ditore
+ week: Javore
+ month: Mujore
+ year: Vjetore
+ user:
+ payments:
+ created_at: Krijuar
+ plans:
+ product: Emri
+ subscriptions:
+ created_at: Krijuar
+ cancel: anulo
+ billing:
+ email: Email
+ admin:
+ dashboard:
+ title: Paneli i kontrollit
+ table:
+ head:
+ user: User
+ products:
+ product:
+ description: Përshkrimi
+ active: Aktiv
+ created_at: Krijuar
+ plans:
+ plan:
+ active: Aktiv
+ created_at: Krijuar
+ coupons:
+ active: Aktiv?
+ actions: Veprimet
+ subscriptions:
+ subscription:
+ user: User
+ created_at: Krijuar
diff --git a/plugins/discourse-subscriptions/config/locales/client.sr.yml b/plugins/discourse-subscriptions/config/locales/client.sr.yml
new file mode 100644
index 00000000000..c1aabc2d762
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.sr.yml
@@ -0,0 +1,48 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sr:
+ js:
+ discourse_subscriptions:
+ plans:
+ interval:
+ adverb:
+ day: Top dnevne
+ week: Top nedeljne
+ month: Top mesečne
+ year: Top godišnje
+ user:
+ payments:
+ created_at: Napravljeno
+ plans:
+ product: Ime foruma
+ subscriptions:
+ created_at: Napravljeno
+ cancel: otkaži
+ billing:
+ email: E-mail
+ admin:
+ dashboard:
+ title: Komandna Tabla
+ table:
+ head:
+ user: Korisnik
+ products:
+ product:
+ description: Opis
+ active: Aktivni
+ created_at: Napravljeno
+ plans:
+ plan:
+ active: Aktivni
+ created_at: Napravljeno
+ coupons:
+ active: Aktivni?
+ actions: Akcije
+ subscriptions:
+ subscription:
+ user: Korisnik
+ created_at: Napravljeno
diff --git a/plugins/discourse-subscriptions/config/locales/client.sv.yml b/plugins/discourse-subscriptions/config/locales/client.sv.yml
new file mode 100644
index 00000000000..55cd949e29c
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.sv.yml
@@ -0,0 +1,208 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sv:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_subscriptions: "Discourse-prenumerationer"
+ site_settings:
+ discourse_subscriptions_enabled: Aktivera tillägget för Discourse-prenumerationer.
+ discourse_subscriptions_extra_nav_subscribe: Visa prenumerationsknappen i den primära navigeringen
+ discourse_subscriptions_public_key: Stripe-publiceringsnyckel
+ discourse_subscriptions_secret_key: Stripe hemlig nyckel
+ discourse_subscriptions_webhook_secret: Stripe Webhook-hemlighet
+ discourse_subscriptions_currency: Standardiserad valutakod. Detta kan åsidosättas vid skapandet av en prenumerationsplan.
+ discourse_subscriptions_campaign_enabled: Aktiverar en kampanjbanderoll för att främja stödet till detta forum ekonomiskt.
+ discourse_subscriptions_campaign_goal: Det numeriska målet för din stödkampanj (prenumeranter eller insamlat belopp).
+ discourse_subscriptions_campaign_type: Väljer vilken typ av kampanj som ska drivas (prenumeranter eller månatligt belopp).
+ discourse_subscriptions_campaign_banner_location: Väljer platsen för kampanjbanderollen (överst eller sidofält).
+ discourse_subscriptions_campaign_banner_shadow_color: Väljer färgen på kampanjbanderollens skugga.
+ discourse_subscriptions_campaign_banner_bg_image: Ladda upp en anpassad bild som ska användas som bakgrund på kampanjbanderollen.
+ discourse_subscriptions_campaign_show_contributors: Visa avatarer för de senaste inköpen av prenumerationsprodukter.
+ discourse_subscriptions_campaign_product: Stripe-produkt-id för plats dit understödjare skickas när de klickar på knappen i kampanjen. Om den här inställningen är tom skickas understödjarna till produkternas huvudsida.
+ errors:
+ discourse_patrons_amount_must_be_currency: "Valutasumman måste vara utan valutasymbol (ex 1,50)"
+ js:
+ filters:
+ subscribe:
+ help: Stöd denna webbplats genom att prenumerera
+ discourse_subscriptions:
+ title: Discourse-prenumerationer
+ admin_navigation: Prenumerationer
+ optional: Valfria
+ navigation:
+ billing: Fakturering
+ payments: Betalningar
+ subscriptions: Prenumerationer
+ subscribe: Prenumerera
+ user_activity:
+ payments: Betalningar
+ campaign:
+ title: Stöd oss
+ body: Vi behöver din hjälp för att hålla igång detta forum!
+ success_title: Klart!
+ success_body: Tack för att du hjälper oss hålla igång detta forum!
+ subscribers: Prenumeranter
+ goal_comparison: "<strong>%{current}</strong> av <strong>%{goal}</strong>"
+ raised: Insamlat
+ button: Stöd
+ recent_contributors: Senaste bidragsgivare
+ goal: Vi har uppfyllt vårt mål
+ one_click_campaign: Auto-skapa stödkampanj
+ refresh_campaign: Uppdatera kampanjdata
+ refresh_page: Kampanjdata synkroniseras nu från Stripe i bakgrunden. Uppdatera sidan om en stund för att ladda den uppdaterade informationen.
+ supporter: Understödjare
+ supporters: Understödjare
+ created: Din kampanj genom ett klick är skapad och klar att börja! Omdirigerar till kampanjinställningarna.
+ one_time_payment: Engångsbetalning
+ plans:
+ purchase: Köp en prenumeration
+ select: Välj en prenumerationsplan
+ interval:
+ adverb:
+ day: Dagligen
+ week: Veckovis
+ month: Månadsvis
+ year: Årsvis
+ payment_button: Prenumerera
+ success: Tack så mycket! Din prenumeration har skapats.
+ incomplete: Din betalning är ofullständig. Din prenumeration kommer att uppdateras när din betalning är fullständig.
+ validate:
+ payment_options:
+ required: Välj en prenumerationsplan.
+ user:
+ payments:
+ id: Betalnings-ID
+ amount: Summa
+ created_at: Skapad
+ payments_help: Det finns inga betalningar
+ plans:
+ rate: Frekvens
+ product: Namn
+ subscriptions_help: Du har inga aktiva prenumerationer
+ subscriptions:
+ id: Prenumerations-ID
+ status: Status
+ discounted: Rabatterad
+ renews: Förnyar
+ update_card:
+ heading: "Uppdatera kort för prenumeration: %{sub_id}"
+ single: "Uppdatera"
+ created_at: Skapad
+ cancel: avbryt
+ cancelled: avbruten
+ operations:
+ destroy:
+ confirm: Är du säker på att du vill avbryta denna prenumeration?
+ subscribe:
+ title: Prenumerera
+ view_past: Visa tidigare köp
+ no_products: Det finns för tillfället inga produkter tillgängliga.
+ unauthenticated: Logga in eller skapa ett konto för att prenumerera.
+ invalid_coupon: Du angav en ogiltig kupongkod. Försök igen.
+ card:
+ title: Betalning
+ customer:
+ title: Kunddetaljer
+ promo_code: Kupong
+ buttons:
+ subscribe: Prenumerera
+ purchased: Köpt
+ go_to_billing: Gå till fakturering
+ already_purchased: Tack så mycket för ditt tidigare köp av den här produkten!
+ countries:
+ MS: "Montserrat"
+ billing:
+ name: Fullständigt namn
+ email: E-post
+ phone: Telefonnummer
+ confirmation:
+ amount: Summa
+ last4: Kortnummer
+ buttons:
+ make_payment: Genomför betalning
+ confirm_payment: Bekräfta betalning
+ success: Gå tillbaka
+ admin:
+ unconfigured: 'Stripe är inte korrekt konfigurerat. Se Discourse Meta för information.'
+ on_meta: Discourse-prenumerationer i Meta
+ dashboard:
+ title: Översiktspanel
+ table:
+ head:
+ user: Användare
+ payment_intent: Betalnings-ID
+ receipt_email: Kvitto per e-post
+ amount: Summa
+ products:
+ title: Produkter
+ operations:
+ create: Skapa ny produkt
+ update: Uppdatera produkt
+ new: Ny produkt
+ destroy:
+ confirm: Är du säker på att du vill ta bort denna produkt?
+ product:
+ product_id: Produkt-ID
+ name: Produktnamn
+ statement_descriptor: Transaktionsbeskrivning
+ statement_descriptor_help: Extra information om en produkt som visas på din kunds kreditkortsutdrag.
+ plan_help: Skapa en prislista för prenumeranter för denna produkt.
+ description: Beskrivning
+ description_help: Detta beskriver din prenumerationsprodukt.
+ repurchaseable: Återköpbar?
+ repurchase_help: Tillåt flera köp av produkten och tillhörande planer
+ active: Aktiv
+ active_help: Avaktivera denna tills din produkt är redo för kunder.
+ created_at: Skapad
+ updated_at: Uppdaterad
+ plans:
+ title: Prisplaner
+ operations:
+ add: Lägg till ny plan
+ create: Skapa plan
+ update: Uppdatera plan
+ create_help: När en prisplan väl är skapad kan enbart dess smeknamn, testperiod och användargrupp uppdateras.
+ new: Ny plan
+ destroy:
+ confirm: Är du säker på att du vill ta bort denna plan?
+ plan:
+ nickname: Planens smeknamn
+ nickname_help: Detta kommer inte visas för kunder, utan enbart hjälpa dig att hitta planen senare
+ plan_id: Plan-ID
+ product: Produkt
+ interval: Betalningsintervall
+ amount: Summa
+ trial: Testperiod i antal dagar
+ trial_help: Prenumerationer för denna plan kommer automatiskt att börja med en gratis testperiod av denna längd
+ group: Användargrupp
+ group_help: Detta är den användargrupp som kunden läggs till i när kundens prenumeration skapas.
+ active: Aktiv
+ created_at: Skapad
+ recurring: Återkommande plan?
+ coupons:
+ title: Rabattkoder
+ code: Kampanjkod
+ discount: Rabatt
+ times_redeemed: Gånger inlösta
+ active: Aktiv?
+ actions: Åtgärder
+ create: Skapa rabattkod
+ promo_code: Kampanjkod (skiftlägesokänslig)
+ subscriptions:
+ title: Prenumerationer
+ subscription:
+ user: Användare
+ subscription_id: Prenumerations-ID
+ customer: Kund
+ product: Produkt
+ plan: Plan
+ status: Status
+ created_at: Skapad
+ ask_refund: Återbetala den senaste betalningen från kunden?
+ canceled: "Prenumerationen har sagts upp."
diff --git a/plugins/discourse-subscriptions/config/locales/client.sw.yml b/plugins/discourse-subscriptions/config/locales/client.sw.yml
new file mode 100644
index 00000000000..0aae428439d
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.sw.yml
@@ -0,0 +1,51 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sw:
+ js:
+ discourse_subscriptions:
+ optional: Sio Muhimu
+ campaign:
+ success_title: Mafanikio!
+ plans:
+ interval:
+ adverb:
+ day: Kila siku
+ week: Kila wiki
+ month: Klla mwezi
+ year: Kila Mwaka
+ user:
+ payments:
+ created_at: Imetengenezwa
+ plans:
+ product: Jina
+ subscriptions:
+ created_at: Imetengenezwa
+ cancel: ghairi
+ billing:
+ email: Barua Pepe
+ admin:
+ dashboard:
+ title: Ubao
+ table:
+ head:
+ user: Mtumiaji
+ products:
+ product:
+ description: Maelezo
+ active: Amilifu
+ created_at: Imetengenezwa
+ plans:
+ plan:
+ active: Amilifu
+ created_at: Imetengenezwa
+ coupons:
+ active: Amilifu?
+ actions: Vitendo
+ subscriptions:
+ subscription:
+ user: Mtumiaji
+ created_at: Imetengenezwa
diff --git a/plugins/discourse-subscriptions/config/locales/client.te.yml b/plugins/discourse-subscriptions/config/locales/client.te.yml
new file mode 100644
index 00000000000..f15967d82ec
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.te.yml
@@ -0,0 +1,54 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+te:
+ js:
+ discourse_subscriptions:
+ optional: ఐచ్ఛికం
+ plans:
+ interval:
+ adverb:
+ day: రోజువారీ
+ week: వారానికోసారి
+ month: నెలవారీ
+ year: వార్షిక
+ user:
+ payments:
+ created_at: సృష్టించిన
+ plans:
+ product: పేరు
+ subscriptions:
+ status: స్థితి
+ update_card:
+ single: "నవీకరించండి"
+ created_at: సృష్టించిన
+ cancel: రద్దు
+ billing:
+ email: ఈమెయిల్
+ admin:
+ dashboard:
+ title: రంగస్థలం
+ table:
+ head:
+ user: సభ్యుడు
+ products:
+ product:
+ description: వివరణ
+ active: క్రియాశీల
+ created_at: సృష్టించిన
+ updated_at: నవీకరించబడింది
+ plans:
+ plan:
+ active: క్రియాశీల
+ created_at: సృష్టించిన
+ coupons:
+ active: క్రియాశీల?
+ actions: చర్యలు
+ subscriptions:
+ subscription:
+ user: సభ్యుడు
+ status: స్థితి
+ created_at: సృష్టించిన
diff --git a/plugins/discourse-subscriptions/config/locales/client.th.yml b/plugins/discourse-subscriptions/config/locales/client.th.yml
new file mode 100644
index 00000000000..6515e6db21d
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.th.yml
@@ -0,0 +1,55 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+th:
+ js:
+ discourse_subscriptions:
+ optional: ทางเลือก
+ campaign:
+ success_title: สำเร็จ!
+ plans:
+ interval:
+ adverb:
+ day: รายวัน
+ week: รายสัปดาห์
+ month: รายเดือน
+ year: รายปี
+ user:
+ payments:
+ created_at: สร้างแล้ว
+ plans:
+ product: ชื่อ
+ subscriptions:
+ status: สถานะ
+ update_card:
+ single: "อัปเดต"
+ created_at: สร้างแล้ว
+ cancel: ยกเลิก
+ billing:
+ email: อีเมล
+ admin:
+ dashboard:
+ title: แดชบอร์ด
+ table:
+ head:
+ user: ผู้ใช้
+ products:
+ product:
+ description: รายละเอียด
+ active: ใช้งานอยู่
+ created_at: สร้างแล้ว
+ updated_at: อัปเดตแล้ว
+ plans:
+ plan:
+ active: ใช้งานอยู่
+ created_at: สร้างแล้ว
+ coupons:
+ actions: การกระทำ
+ subscriptions:
+ subscription:
+ user: ผู้ใช้
+ status: สถานะ
+ created_at: สร้างแล้ว
diff --git a/plugins/discourse-subscriptions/config/locales/client.tr_TR.yml b/plugins/discourse-subscriptions/config/locales/client.tr_TR.yml
new file mode 100644
index 00000000000..f22fc22074e
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.tr_TR.yml
@@ -0,0 +1,484 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+tr_TR:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_subscriptions: "Discourse Abonelikleri"
+ site_settings:
+ discourse_subscriptions_enabled: Discourse Abonelikleri eklentisini etkinleştirin.
+ discourse_subscriptions_extra_nav_subscribe: Birincil gezinmede abone ol düğmesini gösterin
+ discourse_subscriptions_pricing_table_id: Fiyatlandırma Tablosu gömme kodundaki pricing-table-id'yi buraya ekleyin.
+ discourse_subscriptions_pricing_table_enabled: Abone ol düğmesi gömülü fiyatlandırma tablosunu gösterir ve Stripe Checkout kullanılır.
+ discourse_subscriptions_public_key: Stripe Yayınlanabilir Anahtarı
+ discourse_subscriptions_secret_key: Stripe Gizli Anahtarı
+ discourse_subscriptions_webhook_secret: Stripe Webhook Sırrı
+ discourse_subscriptions_currency: Varsayılan Para Birimi Kodu. Bu, abonelik planı oluşturulurken geçersiz kılınabilir.
+ discourse_subscriptions_campaign_enabled: Bu topluluğu finansal olarak desteklemeyi teşvik etmek için bir kampanya afişi etkinleştirir.
+ discourse_subscriptions_campaign_goal: Destek kampanyanız için sayısal hedef (aboneler veya toplanan miktar).
+ discourse_subscriptions_campaign_type: Yürütülecek kampanya türünü seçer (aboneler veya aylık toplanan miktar).
+ discourse_subscriptions_campaign_banner_location: Kampanya banner'ının konumunu seçer (üst veya kenar çubuğu).
+ discourse_subscriptions_campaign_banner_shadow_color: Kampanya banner'ının alt gölgesinin rengini seçer.
+ discourse_subscriptions_campaign_banner_bg_image: Kampanya banner'ında arka plan olarak kullanmak için özel bir görsel yükleyin.
+ discourse_subscriptions_campaign_show_contributors: En son satın alınan abonelik ürünlerinin avatarlarını gösterin.
+ discourse_subscriptions_campaign_product: Destekçiler kampanyadaki düğmeye tıkladıklarında gönderilecek Stripe ürün kimliği. Bu ayar boş bırakılırsa destekçiler ana ürünler sayfasına yönlendirilir.
+ discourse_subscriptions_enable_automatic_tax: Abonelik tarafından oluşturulan tüm faturalarda vergi oranlarını otomatik olarak hesaplayacak olan otomatik vergi hesaplamasını etkinleştirir.
+ discourse_subscriptions_enable_verbose_logging: Hata ayıklamaya yardımcı olmak için daha ayrıntılı günlüğe kaydetmeyi etkinleştirir. Lütfen üretimde kalıcı olarak etkin bırakmayın.
+ errors:
+ discourse_patrons_amount_must_be_currency: "Para birimi tutarları dolar sembolü olmayan para birimleri olmalıdır (ör. 1,50)"
+ js:
+ filters:
+ subscribe:
+ help: Abone olarak bu siteyi destekleyin
+ discourse_subscriptions:
+ title: Discourse Abonelikleri
+ admin_navigation: Abonelikler
+ optional: İsteğe Bağlı
+ navigation:
+ billing: Faturalandırma
+ payments: Ödemeler
+ subscriptions: Abonelikler
+ subscribe: Abone Olun
+ user_activity:
+ payments: Ödemeler
+ campaign:
+ title: Bize Destek Olun
+ body: Bu topluluğu işler halde tutmak için yardımınıza ihtiyacımız var!
+ success_title: Başarılı!
+ success_body: Bu topluluğu işler durumda tutmaya yardımcı olduğunuz için teşekkür ederiz!
+ subscribers: Aboneler
+ goal_comparison: "<strong>%{current}</strong> / <strong>%{goal}</strong>"
+ raised: Toplandı
+ button: Destek
+ recent_contributors: Son Katkıda Bulunanlar
+ goal: Hedefimize ulaştık
+ one_click_campaign: Destek Kampanyasını Otomatik Oluştur
+ refresh_campaign: Kampanya Verilerini Yenile
+ refresh_page: Kampanya verileri artık Stripe'tan arka planda senkronize ediliyor. Güncellenmiş bilgileri yüklemek için birkaç dakika içinde sayfayı yenileyin.
+ supporter: Destekçi
+ supporters: Destekçiler
+ confirm_creation_title: Topluluğunuz için otomatik olarak bir kampanya mı oluşturmak istiyorsunuz?
+ confirm_creation: |-
+ <p>Devam ederek şunları oluşturacaksınız:</p>
+
+ <ul>
+ <li>Destekçilerinizi özel bir başlık ve avatar becerisiyle ödüllendirecek bir grup</li>
+ <li>Kullanıcılarınızın sitenizi desteklemek için satın alabileceği önceden belirlenmiş fiyatlara (aylık ve yıllık) sahip bir Stripe ürünü.</li>
+ </ul>
+
+ <p>Devam etmek istiyor musunuz?</p>
+ created: Tek tıklama kampanyanız oluşturuldu ve kullanıma hazır! Kampanya ayarlarına yönlendiriliyor.
+ one_time_payment: Tek Seferlik Ödeme
+ plans:
+ purchase: Abonelik satın alın
+ select: Abonelik planı seçin
+ interval:
+ adverb:
+ day: Günlük
+ week: Haftalık
+ month: Aylık
+ year: Yıllık
+ payment_button: Abone Olun
+ success: Teşekkürler! Aboneliğiniz oluşturuldu.
+ incomplete: Ödeme tamamlanamadı. Ödeme tamamlandığında aboneliğiniz güncellenecek.
+ validate:
+ payment_options:
+ required: Lütfen bir abonelik planı seçin.
+ user:
+ payments:
+ id: Ödeme Kimliği
+ amount: Miktar
+ created_at: Oluşturuldu
+ payments_help: Ödeme yok
+ plans:
+ rate: Fiyat
+ product: İsim
+ subscriptions_help: Aktif aboneliğiniz yok.
+ subscriptions:
+ id: Abonelik Kimliği
+ status: Durum
+ discounted: İndirimli
+ renews: 'Yenilenme:'
+ update_card:
+ heading: "Abonelik için Kartı güncelleyin: %{sub_id}"
+ single: "Güncelle"
+ created_at: Oluşturuldu
+ cancel: iptal et
+ cancelled: iptal edildi
+ operations:
+ destroy:
+ confirm: Bu aboneliği iptal etmek istediğinizden emin misiniz?
+ subscribe:
+ title: Abone ol
+ view_past: Geçmiş satın alımları görüntüle
+ no_products: Şu anda kullanılabilir ürün bulunmuyor.
+ unauthenticated: Abone olmak için giriş yapın veya bir hesap oluşturun.
+ invalid_coupon: Geçersiz bir kupon kodu girdiniz. Lütfen tekrar deneyin.
+ invalid_cardholder_name: Kart sahibinin adı gerekli.
+ invalid_cardholder_country: Ülke gerekli.
+ invalid_cardholder_state: Eyalet gerekli.
+ invalid_cardholder_province: İl gerekli.
+ transaction_error: Ödeme işlenirken bir hata oluştu. Lütfen tekrar deneyin.
+ card:
+ title: Ödeme
+ customer:
+ title: Müşteri Bilgileri
+ promo_code: Kupon
+ buttons:
+ subscribe: Abone Olun
+ purchased: Satın alındı
+ go_to_billing: Faturalandırmaya Git
+ already_purchased: Bu ürünü daha önce satın aldığınız için çok teşekkürler!
+ cardholder_name: Kart Sahibinin Adı
+ cardholder_address:
+ line1: Cadde Adresi
+ city: Şehir
+ state: Eyalet
+ province: İl
+ country: Ülke
+ postal_code: Posta Kodu
+ countries:
+ AF: "Afganistan"
+ AX: "Åland Adaları"
+ AL: "Arnavutluk"
+ DZ: "Cezayir"
+ AS: "Amerikan Samoası"
+ AD: "Andorra"
+ AO: "Angola"
+ AI: "Anguilla"
+ AQ: "Antarktika"
+ AG: "Antigua ve Barbuda"
+ AR: "Arjantin"
+ AM: "Ermenistan"
+ AW: "Aruba"
+ AU: "Avustralya"
+ AT: "Avusturya"
+ AZ: "Azerbaycan"
+ BS: "Bahamalar"
+ BH: "Bahreyn"
+ BD: "Bangladeş"
+ BB: "Barbados"
+ BY: "Belarus"
+ BE: "Belçika"
+ BZ: "Belize"
+ BJ: "Benin"
+ BM: "Bermuda"
+ BT: "Bhutan"
+ BO: "Bolivya Çokuluslu Devleti"
+ BQ: "Bonaire, Sint Eustatius ve Saba"
+ BA: "Bosna-Hersek"
+ BW: "Botsvana"
+ BV: "Bouvet Adası"
+ BR: "Brezilya"
+ IO: "Britanya Hint Okyanusu Toprakları"
+ BN: "Brunei Sultanlığı"
+ BG: "Bulgaristan"
+ BF: "Burkina Faso"
+ BI: "Burundi"
+ KH: "Kamboçya"
+ CM: "Kamerun"
+ CA: "Kanada"
+ CV: "Yeşil Burun"
+ KY: "Cayman Adaları"
+ CF: "Orta Afrika Cumhuriyeti"
+ TD: "Çad"
+ CL: "Şili"
+ CN: "Çin"
+ CX: "Noel Adası"
+ CC: "Cocos (Keeling) Adaları"
+ CO: "Kolombiya"
+ KM: "Komorlar"
+ CG: "Kongo"
+ CD: "Demokratik Kongo Cumhuriyeti"
+ CK: "Cook Adaları"
+ CR: "Kosta Rika"
+ CI: "Fildişi Sahili"
+ HR: "Hırvatistan"
+ CU: "Küba"
+ CW: "Curaçao"
+ CY: "Kıbrıs"
+ CZ: "Çek Cumhuriyeti"
+ DK: "Danimarka"
+ DJ: "Cibuti"
+ DM: "Dominika"
+ DO: "Dominik Cumhuriyeti"
+ EC: "Ekvador"
+ EG: "Mısır"
+ SV: "El Salvador"
+ GQ: "Ekvator Ginesi"
+ ER: "Eritre"
+ EE: "Estonya"
+ ET: "Etiyopya"
+ FK: "Falkland Adaları (Malvinas)"
+ FO: "Faroe Adaları"
+ FJ: "Fiji"
+ FI: "Finlandiya"
+ FR: "Fransa"
+ GF: "Fransız Guyanası"
+ PF: "Fransız Polinezyası"
+ TF: "Fransız Güney Toprakları"
+ GA: "Gabon"
+ GM: "Gambiya"
+ GE: "Gürcistan"
+ DE: "Almanya"
+ GH: "Gana"
+ GI: "Cebelitarık"
+ GR: "Yunanistan"
+ GL: "Grönland"
+ GD: "Grenada"
+ GP: "Guadeloupe"
+ GU: "Guam"
+ GT: "Guatemala"
+ GG: "Guernsey"
+ GN: "Gine"
+ GW: "Gine-Bissau"
+ GY: "Guyana"
+ HT: "Haiti"
+ HM: "Heard Adası ve McDonald Adaları"
+ VA: "Holy See (Vatikan Şehir Devleti)"
+ HN: "Honduras"
+ HK: "Hong Kong"
+ HU: "Macaristan"
+ IS: "İzlanda"
+ IN: "Hindistan"
+ ID: "Endonezya"
+ IR: "İran İslam Cumhuriyeti"
+ IQ: "Irak"
+ IE: "İrlanda"
+ IM: "Man Adası"
+ IL: "İsrail"
+ IT: "İtalya"
+ JM: "Jamaika"
+ JP: "Japonya"
+ JE: "Jersey"
+ JO: "Ürdün"
+ KZ: "Kazakistan"
+ KE: "Kenya"
+ KI: "Kiribati"
+ KP: "Kore Demokratik Halk Cumhuriyeti"
+ KR: "Kore Cumhuriyeti"
+ KW: "Kuveyt"
+ KG: "Kırgızistan"
+ LA: "Lao Demokratik Halk Cumhuriyeti"
+ LV: "Letonya"
+ LB: "Lübnan"
+ LS: "Lesoto"
+ LR: "Liberya"
+ LY: "Libya"
+ LI: "Lihtenştayn"
+ LT: "Litvanya"
+ LU: "Lüksemburg"
+ MO: "Makao"
+ MK: "Makedonya, eski Yugoslav Cumhuriyeti"
+ MG: "Madagaskar"
+ MW: "Malavi"
+ MY: "Malezya"
+ MV: "Maldivler"
+ ML: "Mali"
+ MT: "Malta"
+ MH: "Marşal Adaları"
+ MQ: "Martinik"
+ MR: "Moritanya"
+ MU: "Mauritius"
+ YT: "Mayotte"
+ MX: "Meksika"
+ FM: "Mikronezya Federal Devletleri"
+ MD: "Moldova Cumhuriyeti"
+ MC: "Monako"
+ MN: "Moğolistan"
+ ME: "Karadağ"
+ MS: "Montserrat"
+ MA: "Fas"
+ MZ: "Mozambik"
+ MM: "Myanmar"
+ NA: "Namibya"
+ NR: "Nauru"
+ NP: "Nepal"
+ NL: "Hollanda"
+ NC: "Yeni Kaledonya"
+ NZ: "Yeni Zelanda"
+ NI: "Nikaragua"
+ NE: "Nijer"
+ NG: "Nijerya"
+ NU: "Niue"
+ NF: "Norfolk Adası"
+ MP: "Kuzey Mariana Adaları"
+ "NO": "Norveç"
+ OM: "Umman"
+ PK: "Pakistan"
+ PW: "Palau"
+ PS: "Filistin Toprakları, İşgal Altında"
+ PA: "Panama"
+ PG: "Papua Yeni Gine"
+ PY: "Paraguay"
+ PE: "Peru"
+ PH: "Filipinler"
+ PN: "Pitcairn"
+ PL: "Polonya"
+ PT: "Portekiz"
+ PR: "Porto Riko"
+ QA: "Katar"
+ RE: "Réunion"
+ RO: "Romanya"
+ RU: "Rusya Federasyonu"
+ RW: "Ruanda"
+ BL: "Saint Barthelemy"
+ SH: "Saint Helena, Ascension ve Tristan da Cunha"
+ KN: "Saint Kitts ve Nevis"
+ LC: "Saint Lucia"
+ MF: "Saint Martin (Fransız kısmı)"
+ PM: "Saint Pierre ve Miquelon"
+ VC: "Saint Vincent ve Grenadinler"
+ WS: "Samoa"
+ SM: "San Marino"
+ ST: "Sao Tome ve Principe"
+ SA: "Suudi Arabistan"
+ SN: "Senegal"
+ RS: "Sırbistan"
+ SC: "Seyşeller"
+ SL: "Sierra Leone"
+ SG: "Singapur"
+ SX: "Sint Maarten (Hollanda tarafı)"
+ SK: "Slovakya"
+ SI: "Slovenya"
+ SB: "Solomon Adaları"
+ SO: "Somali"
+ ZA: "Güney Afrika"
+ GS: "Güney Georgia ve Güney Sandwich Adaları"
+ SS: "Güney Sudan"
+ ES: "İspanya"
+ LK: "Sri Lanka"
+ SD: "Sudan"
+ SR: "Surinam"
+ SJ: "Svalbard ve Jan Mayen"
+ SZ: "Svaziland"
+ SE: "İsveç"
+ CH: "İsviçre"
+ SY: "Suriye Arap Cumhuriyeti"
+ TW: "Tayvan, Çin Eyaleti"
+ TJ: "Tacikistan"
+ TZ: "Tanzanya Birleşik Cumhuriyeti"
+ TH: "Tayland"
+ TL: "Doğu Timor"
+ TG: "Togo"
+ TK: "Tokelau"
+ TO: "Tonga"
+ TT: "Trinidad ve Tobago"
+ TN: "Tunus"
+ TR: "Türkiye"
+ TM: "Türkmenistan"
+ TC: "Turks ve Caicos Adaları"
+ TV: "Tuvalu"
+ UG: "Uganda"
+ UA: "Ukrayna"
+ AE: "Birleşik Arap Emirlikleri"
+ GB: "Birleşik Krallık"
+ US: "Amerika Birleşik Devletleri"
+ UM: "Amerika Birleşik Devletleri Küçük Dış Adaları"
+ UY: "Uruguay"
+ UZ: "Özbekistan"
+ VU: "Vanuatu"
+ VE: "Bolivarcı Venezuela Cumhuriyeti"
+ VN: "Vietnam"
+ VG: "İngiliz Virgin Adaları"
+ VI: "Virgin Adaları, ABD"
+ WF: "Wallis ve Futuna"
+ EH: "Batı Sahra"
+ YE: "Yemen"
+ ZM: "Zambiya"
+ ZW: "Zimbabve"
+ billing:
+ name: Ad soyad
+ email: E-posta
+ phone: Telefon Numarası
+ confirmation:
+ amount: Miktar
+ last4: Kart numarası
+ buttons:
+ make_payment: Ödeme yapın
+ confirm_payment: Ödemeyi onaylayın
+ success: Geri dön
+ admin:
+ unconfigured: 'Stripe doğru yapılandırılmamış. Bilgi için lütfen Discourse Meta''ya bakın.'
+ on_meta: Meta'da Discourse Abonelikleri
+ dashboard:
+ title: Pano
+ table:
+ head:
+ user: Kullanıcı
+ payment_intent: Ödeme Kimliği
+ receipt_email: Makbuz E-postası
+ amount: Miktar
+ products:
+ title: Ürünler
+ operations:
+ create: Yeni Ürün Oluştur
+ update: Ürünü Güncelle
+ new: Yeni Ürün
+ destroy:
+ confirm: Bu ürünü yok etmek istediğinizden emin misiniz?
+ product:
+ product_id: Ürün Kimliği
+ name: Ürün Adı
+ statement_descriptor: İfade Tanımlayıcı
+ statement_descriptor_help: Müşterinizin kredi kartı ekstresinde görünecek bir ürün hakkında ekstra bilgi.
+ plan_help: Müşterileri bu ürüne abone etmek için bir fiyatlandırma planı oluşturun.
+ description: Açıklama
+ description_help: Bu, abonelik ürününüzü tanımlar.
+ repurchaseable: Tekrar satın alınabilir mi?
+ repurchase_help: Ürün ve ilgili planların birden fazla kez satın alınmasına izin verin
+ active: Aktif
+ active_help: Ürününüz tüketiciler için hazır olana kadar bunu kapatın.
+ created_at: Oluşturuldu
+ updated_at: Güncellenmiş
+ product_help: Müşterilerin sitenize abone olabilmesi için en az bir ürün ve ilgili bir plan oluşturmanız gerekir.
+ plans:
+ title: Fiyatlandırma Planları
+ operations:
+ add: Yeni Plan Ekle
+ create: Plan Oluştur
+ update: Planı Güncelle
+ create_help: Fiyatlandırma planı oluşturulduktan sonra, yalnızca takma adı, deneme süresi ve kullanıcı grubu güncellenebilir.
+ new: Yeni Plan
+ destroy:
+ confirm: Bu planı yok etmek istediğinizden emin misiniz?
+ plan:
+ nickname: Plan Takma Adı
+ nickname_help: Bu, müşteriler tarafından görülemez, ancak bu planı daha sonra bulmanıza yardımcı olur
+ plan_id: Plan Kimliği
+ product: Ürün
+ interval: Faturalandırma Aralığı
+ amount: Miktar
+ trial: Deneme Süresi Günleri
+ trial_help: Bu plana abonelikler, otomatik olarak bu uzunlukta bir ücretsiz deneme ile başlar
+ group: Kullanıcı Grubu
+ group_help: Bu, abonelik oluşturulduğunda müşterinin ekleneceği Discourse kullanıcı grubudur.
+ active: Aktif
+ created_at: Oluşturuldu
+ recurring: Yinelenen Plan?
+ coupons:
+ title: Kuponlar
+ code: Promosyon Kodu
+ discount: İndirim
+ times_redeemed: Kez Kullanıldı
+ active: Aktif mi?
+ actions: Eylemler
+ create: Kupon Oluştur
+ promo_code: Promosyon Kodu (büyük/küçük harfe duyarlı değil)
+ subscriptions:
+ title: Abonelikler
+ subscription:
+ user: Kullanıcı
+ subscription_id: Abonelik Kimliği
+ customer: Müşteri
+ product: Ürün
+ plan: Plan
+ status: Durum
+ created_at: Oluşturuldu
+ ask_refund: Müşteri tarafından yapılan son ödeme iade edilsin mi?
+ canceled: "Abonelik iptal edildi."
diff --git a/plugins/discourse-subscriptions/config/locales/client.ug.yml b/plugins/discourse-subscriptions/config/locales/client.ug.yml
new file mode 100644
index 00000000000..c13124e31d7
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.ug.yml
@@ -0,0 +1,56 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ug:
+ js:
+ discourse_subscriptions:
+ optional: تاللاشچان
+ campaign:
+ success_title: مۇۋەپپەقىيەتلىك!
+ plans:
+ interval:
+ adverb:
+ day: كۈندىلىك
+ week: ھەپتىلىك
+ month: ئايلىق
+ year: يىللىق
+ user:
+ payments:
+ created_at: قۇرغان ۋاقتى
+ plans:
+ product: ئىسمى
+ subscriptions:
+ status: ھالەت
+ update_card:
+ single: "يېڭىلا"
+ created_at: قۇرغان ۋاقتى
+ cancel: ۋاز كەچ
+ billing:
+ email: ئېلخەت
+ admin:
+ dashboard:
+ title: باشقۇرۇش تاختا
+ table:
+ head:
+ user: ئىشلەتكۈچى
+ products:
+ product:
+ description: چۈشەندۈرۈش
+ active: ئاكتىپ
+ created_at: قۇرغان ۋاقتى
+ updated_at: يېڭىلاندى
+ plans:
+ plan:
+ active: ئاكتىپ
+ created_at: قۇرغان ۋاقتى
+ coupons:
+ active: ئاكتىپ?
+ actions: مەشغۇلات
+ subscriptions:
+ subscription:
+ user: ئىشلەتكۈچى
+ status: ھالەت
+ created_at: قۇرغان ۋاقتى
diff --git a/plugins/discourse-subscriptions/config/locales/client.uk.yml b/plugins/discourse-subscriptions/config/locales/client.uk.yml
new file mode 100644
index 00000000000..b486995d165
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.uk.yml
@@ -0,0 +1,59 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+uk:
+ js:
+ discourse_subscriptions:
+ optional: Опціонально
+ campaign:
+ success_title: Успіх!
+ plans:
+ interval:
+ adverb:
+ day: За день
+ week: Щотижня
+ month: Щомісяця
+ year: Щорічно
+ user:
+ payments:
+ created_at: Створено
+ plans:
+ product: Назва
+ subscriptions:
+ status: Статус
+ update_card:
+ single: "Оновити"
+ created_at: Створено
+ cancel: скасувати
+ subscribe:
+ countries:
+ MS: "Montserrat"
+ billing:
+ email: Електронна пошта
+ admin:
+ dashboard:
+ title: Майстерня
+ table:
+ head:
+ user: Користувач
+ products:
+ product:
+ description: Опис
+ active: Активний
+ created_at: Створено
+ updated_at: Оновлено
+ plans:
+ plan:
+ active: Активний
+ created_at: Створено
+ coupons:
+ active: Активний?
+ actions: Дії
+ subscriptions:
+ subscription:
+ user: Користувач
+ status: Статус
+ created_at: Створено
diff --git a/plugins/discourse-subscriptions/config/locales/client.ur.yml b/plugins/discourse-subscriptions/config/locales/client.ur.yml
new file mode 100644
index 00000000000..35cc6a2c3e1
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.ur.yml
@@ -0,0 +1,56 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ur:
+ js:
+ discourse_subscriptions:
+ optional: اختیاری
+ campaign:
+ success_title: کامیابی!
+ plans:
+ interval:
+ adverb:
+ day: روزانہ
+ week: ہفتہ وار
+ month: ماہانہ
+ year: سالانہ
+ user:
+ payments:
+ created_at: بنایا گیا
+ plans:
+ product: نام
+ subscriptions:
+ status: سٹیٹس
+ update_card:
+ single: "اپ ڈیٹ"
+ created_at: بنایا گیا
+ cancel: منسوخ
+ billing:
+ email: اِی میل
+ admin:
+ dashboard:
+ title: ڈَیش بورڈ
+ table:
+ head:
+ user: صارف
+ products:
+ product:
+ description: تفصیل
+ active: فعال
+ created_at: بنایا گیا
+ updated_at: اپ ڈیٹ
+ plans:
+ plan:
+ active: فعال
+ created_at: بنایا گیا
+ coupons:
+ active: فعال?
+ actions: عمل
+ subscriptions:
+ subscription:
+ user: صارف
+ status: سٹیٹس
+ created_at: بنایا گیا
diff --git a/plugins/discourse-subscriptions/config/locales/client.vi.yml b/plugins/discourse-subscriptions/config/locales/client.vi.yml
new file mode 100644
index 00000000000..e59e873fa14
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.vi.yml
@@ -0,0 +1,56 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+vi:
+ js:
+ discourse_subscriptions:
+ optional: Tuỳ chọn
+ campaign:
+ success_title: Thành công!
+ plans:
+ interval:
+ adverb:
+ day: hằng ngày
+ week: Hàng tuần
+ month: Hàng tháng
+ year: Hàng năm
+ user:
+ payments:
+ created_at: Tạo bởi
+ plans:
+ product: Tên
+ subscriptions:
+ status: Trạng thái
+ update_card:
+ single: "Cập nhật"
+ created_at: Tạo bởi
+ cancel: hủy
+ billing:
+ email: Email
+ admin:
+ dashboard:
+ title: Bảng điều khiển
+ table:
+ head:
+ user: Người dùng
+ products:
+ product:
+ description: Mô tả
+ active: Kích hoạt
+ created_at: Tạo bởi
+ updated_at: Đã cập nhật
+ plans:
+ plan:
+ active: Kích hoạt
+ created_at: Tạo bởi
+ coupons:
+ active: Kích hoạt?
+ actions: Hành động
+ subscriptions:
+ subscription:
+ user: Người dùng
+ status: Trạng thái
+ created_at: Tạo bởi
diff --git a/plugins/discourse-subscriptions/config/locales/client.zh_CN.yml b/plugins/discourse-subscriptions/config/locales/client.zh_CN.yml
new file mode 100644
index 00000000000..a184edaa33e
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.zh_CN.yml
@@ -0,0 +1,484 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+zh_CN:
+ admin_js:
+ admin:
+ site_settings:
+ categories:
+ discourse_subscriptions: "Discourse Subscriptions"
+ site_settings:
+ discourse_subscriptions_enabled: 启用 Discourse Subscriptions 插件。
+ discourse_subscriptions_extra_nav_subscribe: 在主导航中显示订阅按钮
+ discourse_subscriptions_pricing_table_id: 在此处从定价表嵌入代码中添加 pricing-table-id。
+ discourse_subscriptions_pricing_table_enabled: '“订阅”按钮将显示嵌入的定价表,并且将使用 Stripe Checkout。'
+ discourse_subscriptions_public_key: Stripe 可发布密钥
+ discourse_subscriptions_secret_key: Stripe 密钥
+ discourse_subscriptions_webhook_secret: Stripe 网络钩子密钥
+ discourse_subscriptions_currency: 默认货币代码。创建订阅方案时可以替换此代码。
+ discourse_subscriptions_campaign_enabled: 启用活动横幅以促进对此社区的财务支持。
+ discourse_subscriptions_campaign_goal: 您的支持活动的数字目标(订阅者或筹集金额)。
+ discourse_subscriptions_campaign_type: 选择要运行的活动类型(订阅者或每月筹集金额)。
+ discourse_subscriptions_campaign_banner_location: 选择活动横幅的位置(顶部或边栏)。
+ discourse_subscriptions_campaign_banner_shadow_color: 选择活动横幅投影的颜色。
+ discourse_subscriptions_campaign_banner_bg_image: 上传自定义图片以用作活动横幅的背景。
+ discourse_subscriptions_campaign_show_contributors: 显示最近购买的订阅产品的头像。
+ discourse_subscriptions_campaign_product: 当支持者点击活动上的按钮时向支持者发送的 Stripe 产品 ID。如果此设置为空,则支持者将被定向到主要产品页面。
+ discourse_subscriptions_enable_automatic_tax: 启用自动税务计算,它将自动计算订阅生成的所有发票的税率。
+ discourse_subscriptions_enable_verbose_logging: 启用更详细的日志记录以帮助调试。请勿在生产环境下永久启用。
+ errors:
+ discourse_patrons_amount_must_be_currency: "货币金额必须为无美元符号的金额(例如 1.50)"
+ js:
+ filters:
+ subscribe:
+ help: 订阅以支持此网站
+ discourse_subscriptions:
+ title: Discourse Subscriptions
+ admin_navigation: 订阅
+ optional: 可选
+ navigation:
+ billing: 结算
+ payments: 付款
+ subscriptions: 订阅
+ subscribe: 订阅
+ user_activity:
+ payments: 付款
+ campaign:
+ title: 支持我们
+ body: 我们需要您的帮助来使此社区保持正常运转!
+ success_title: 成功!
+ success_body: 感谢您帮助此社区保持正常运转!
+ subscribers: 订阅者
+ goal_comparison: "<strong>%{current}</strong>/<strong>%{goal}</strong>"
+ raised: 已筹集
+ button: 支持
+ recent_contributors: 最近的贡献者
+ goal: 我们已达成目标
+ one_click_campaign: 自动创建支持活动
+ refresh_campaign: 刷新活动数据
+ refresh_page: 现在正在后台从 Stripe 同步活动数据。请稍后刷新页面以加载更新的信息。
+ supporter: 支持者
+ supporters: 支持者
+ confirm_creation_title: 您想为您的社区自动创建活动吗?
+ confirm_creation: |-
+ <p>继续将创建:</p>
+
+ <ul>
+ <li>具有自定义标题和头像风格的群组,用于奖励您的支持者</li>
+ <li>具有预设价格(包月和包年)的 Stripe 产品,可供您的用户购买以支持您的网站。</li>
+ </ul>
+
+ <p>您想继续吗?</p>
+ created: 您的一键式活动已创建并准备就绪!正在重定向到活动设置。
+ one_time_payment: 一次性付款
+ plans:
+ purchase: 购买订阅
+ select: 选择订阅方案
+ interval:
+ adverb:
+ day: 每天
+ week: 每周
+ month: 每月
+ year: 每年
+ payment_button: 订阅
+ success: 谢谢!您的订阅已创建。
+ incomplete: 未完成付款。您的订阅将在付款完成后更新。
+ validate:
+ payment_options:
+ required: 请选择订阅方案。
+ user:
+ payments:
+ id: 付款 ID
+ amount: 金额
+ created_at: 创建时间
+ payments_help: 没有付款
+ plans:
+ rate: 费率
+ product: 名称
+ subscriptions_help: 您没有有效订阅。
+ subscriptions:
+ id: 订阅 ID
+ status: 状态
+ discounted: 折扣价
+ renews: 续订
+ update_card:
+ heading: "订阅更新卡片:%{sub_id}"
+ single: "更新"
+ created_at: 创建时间
+ cancel: 取消
+ cancelled: 已取消
+ operations:
+ destroy:
+ confirm: 确定要取消此订阅吗?
+ subscribe:
+ title: 订阅
+ view_past: 查看以前的购买记录
+ no_products: 当前没有可用产品。
+ unauthenticated: 登录或创建帐户以订阅。
+ invalid_coupon: 您输入的优惠码无效。请重试。
+ invalid_cardholder_name: 持卡人姓名为必填项。
+ invalid_cardholder_country: 国家/地区为必填项。
+ invalid_cardholder_state: 州为必填项。
+ invalid_cardholder_province: 省为必填项。
+ transaction_error: 处理付款时出错。请重试。
+ card:
+ title: 付款
+ customer:
+ title: 客户详细信息
+ promo_code: 优惠券
+ buttons:
+ subscribe: 订阅
+ purchased: 已购买
+ go_to_billing: 前往结算
+ already_purchased: 非常感谢您之前购买此产品!
+ cardholder_name: 持卡人姓名
+ cardholder_address:
+ line1: 街道地址
+ city: 城市
+ state: 州
+ province: 省
+ country: 国家/地区
+ postal_code: 邮政编码
+ countries:
+ AF: "阿富汗"
+ AX: "奥兰群岛"
+ AL: "阿尔巴尼亚"
+ DZ: "阿尔及利亚"
+ AS: "美属萨摩亚"
+ AD: "安道尔"
+ AO: "安哥拉"
+ AI: "安圭拉"
+ AQ: "南极洲"
+ AG: "安提瓜和巴布达"
+ AR: "阿根廷"
+ AM: "亚美尼亚"
+ AW: "阿鲁巴"
+ AU: "澳大利亚"
+ AT: "奥地利"
+ AZ: "阿塞拜疆"
+ BS: "巴哈马"
+ BH: "巴林"
+ BD: "孟加拉国"
+ BB: "巴巴多斯"
+ BY: "白俄罗斯"
+ BE: "比利时"
+ BZ: "伯利兹"
+ BJ: "贝宁"
+ BM: "百慕大"
+ BT: "不丹"
+ BO: "玻利维亚"
+ BQ: "博奈尔岛、圣尤斯特歇斯岛和萨巴岛"
+ BA: "波斯尼亚和黑塞哥维那"
+ BW: "博茨瓦纳"
+ BV: "布维岛"
+ BR: "巴西"
+ IO: "英属印度洋领地"
+ BN: "文莱达鲁萨兰国"
+ BG: "保加利亚"
+ BF: "布基纳法索"
+ BI: "布隆迪"
+ KH: "柬埔寨"
+ CM: "喀麦隆"
+ CA: "加拿大"
+ CV: "佛得角"
+ KY: "开曼群岛"
+ CF: "中非共和国"
+ TD: "乍得"
+ CL: "智利"
+ CN: "中国"
+ CX: "圣诞岛"
+ CC: "科科斯(基林)群岛"
+ CO: "哥伦比亚"
+ KM: "科摩罗"
+ CG: "刚果"
+ CD: "刚果民主共和国"
+ CK: "库克群岛"
+ CR: "哥斯达黎加"
+ CI: "科特迪瓦"
+ HR: "克罗地亚"
+ CU: "古巴"
+ CW: "库拉索"
+ CY: "塞浦路斯"
+ CZ: "捷克共和国"
+ DK: "丹麦"
+ DJ: "吉布提"
+ DM: "多米尼克"
+ DO: "多米尼加共和国"
+ EC: "厄瓜多尔"
+ EG: "埃及"
+ SV: "萨尔瓦多"
+ GQ: "赤道几内亚"
+ ER: "厄立特里亚"
+ EE: "爱沙尼亚"
+ ET: "埃塞俄比亚"
+ FK: "福克兰群岛(马尔维纳斯群岛)"
+ FO: "法罗群岛"
+ FJ: "斐济"
+ FI: "芬兰"
+ FR: "法国"
+ GF: "法属圭亚那"
+ PF: "法属波利尼西亚"
+ TF: "法属南部领地"
+ GA: "加蓬"
+ GM: "冈比亚"
+ GE: "格鲁吉亚"
+ DE: "德国"
+ GH: "加纳"
+ GI: "直布罗陀"
+ GR: "希腊"
+ GL: "格陵兰"
+ GD: "格林纳达"
+ GP: "瓜德罗普岛"
+ GU: "关岛"
+ GT: "危地马拉"
+ GG: "根西岛"
+ GN: "几内亚"
+ GW: "几内亚比绍"
+ GY: "圭亚那"
+ HT: "海地"
+ HM: "赫德岛和麦克唐纳群岛"
+ VA: "罗马教廷(梵蒂冈城国)"
+ HN: "洪都拉斯"
+ HK: "中国香港"
+ HU: "匈牙利"
+ IS: "冰岛"
+ IN: "印度"
+ ID: "印度尼西亚"
+ IR: "伊朗伊斯兰共和国"
+ IQ: "伊拉克"
+ IE: "爱尔兰"
+ IM: "马恩岛"
+ IL: "以色列"
+ IT: "意大利"
+ JM: "牙买加"
+ JP: "日本"
+ JE: "泽西岛"
+ JO: "约旦"
+ KZ: "哈萨克斯坦"
+ KE: "肯尼亚"
+ KI: "基里巴斯"
+ KP: "朝鲜民主主义人民共和国"
+ KR: "大韩民国"
+ KW: "科威特"
+ KG: "吉尔吉斯斯坦"
+ LA: "老挝人民民主共和国"
+ LV: "拉脱维亚"
+ LB: "黎巴嫩"
+ LS: "莱索托"
+ LR: "利比里亚"
+ LY: "利比亚"
+ LI: "列支敦士登"
+ LT: "立陶宛"
+ LU: "卢森堡"
+ MO: "中国澳门"
+ MK: "北马其顿"
+ MG: "马达加斯加"
+ MW: "马拉维"
+ MY: "马来西亚"
+ MV: "马尔代夫"
+ ML: "马里"
+ MT: "马耳他"
+ MH: "马绍尔群岛"
+ MQ: "马提尼克岛"
+ MR: "毛里塔尼亚"
+ MU: "毛里求斯"
+ YT: "马约特岛"
+ MX: "墨西哥"
+ FM: "密克罗尼西亚联邦"
+ MD: "摩尔多瓦共和国"
+ MC: "摩纳哥"
+ MN: "蒙古"
+ ME: "黑山"
+ MS: "蒙特塞拉特"
+ MA: "摩洛哥"
+ MZ: "莫桑比克"
+ MM: "缅甸"
+ NA: "纳米比亚"
+ NR: "瑙鲁"
+ NP: "尼泊尔"
+ NL: "荷兰"
+ NC: "新喀里多尼亚"
+ NZ: "新西兰"
+ NI: "尼加拉瓜"
+ NE: "尼日尔"
+ NG: "尼日利亚"
+ NU: "纽埃"
+ NF: "诺福克岛"
+ MP: "北马里亚纳群岛"
+ "NO": "挪威"
+ OM: "阿曼"
+ PK: "巴基斯坦"
+ PW: "帕劳"
+ PS: "巴勒斯坦被占领土"
+ PA: "巴拿马"
+ PG: "巴布亚新几内亚"
+ PY: "巴拉圭"
+ PE: "秘鲁"
+ PH: "菲律宾"
+ PN: "皮特凯恩群岛"
+ PL: "波兰"
+ PT: "葡萄牙"
+ PR: "波多黎各"
+ QA: "卡塔尔"
+ RE: "留尼汪岛"
+ RO: "罗马尼亚"
+ RU: "俄罗斯联邦"
+ RW: "卢旺达"
+ BL: "圣巴泰勒米"
+ SH: "圣赫勒拿、阿森松和特里斯坦-达库尼亚"
+ KN: "圣基茨和尼维斯"
+ LC: "圣卢西亚"
+ MF: "法属圣马丁"
+ PM: "圣皮埃尔和密克隆群岛"
+ VC: "圣文森特和格林纳丁斯"
+ WS: "萨摩亚"
+ SM: "圣马力诺"
+ ST: "圣多美和普林西比"
+ SA: "沙特阿拉伯"
+ SN: "塞内加尔"
+ RS: "塞尔维亚"
+ SC: "塞舌尔"
+ SL: "塞拉利昂"
+ SG: "新加坡"
+ SX: "荷属圣马丁"
+ SK: "斯洛伐克"
+ SI: "斯洛文尼亚"
+ SB: "所罗门群岛"
+ SO: "索马里"
+ ZA: "南非"
+ GS: "南乔治亚岛和南桑威奇群岛"
+ SS: "南苏丹"
+ ES: "西班牙"
+ LK: "斯里兰卡"
+ SD: "苏丹"
+ SR: "苏里南"
+ SJ: "斯瓦尔巴和扬马延"
+ SZ: "斯威士兰"
+ SE: "瑞典"
+ CH: "瑞士"
+ SY: "阿拉伯叙利亚共和国"
+ TW: "中国台湾省"
+ TJ: "塔吉克斯坦"
+ TZ: "坦桑尼亚联合共和国"
+ TH: "泰国"
+ TL: "东帝汶"
+ TG: "多哥"
+ TK: "托克劳"
+ TO: "汤加"
+ TT: "特立尼达和多巴哥"
+ TN: "突尼斯"
+ TR: "土耳其"
+ TM: "土库曼斯坦"
+ TC: "特克斯和凯科斯群岛"
+ TV: "图瓦卢"
+ UG: "乌干达"
+ UA: "乌克兰"
+ AE: "阿拉伯联合酋长国"
+ GB: "英国"
+ US: "美国"
+ UM: "美国本土外小岛屿"
+ UY: "乌拉圭"
+ UZ: "乌兹别克斯坦"
+ VU: "瓦努阿图"
+ VE: "委内瑞拉玻利瓦尔共和国"
+ VN: "越南"
+ VG: "英属维尔京群岛"
+ VI: "美属维尔京群岛"
+ WF: "瓦利斯和富图纳群岛"
+ EH: "西撒哈拉"
+ YE: "也门"
+ ZM: "赞比亚"
+ ZW: "津巴布韦"
+ billing:
+ name: 全名
+ email: 电子邮件
+ phone: 电话号码
+ confirmation:
+ amount: 金额
+ last4: 卡号
+ buttons:
+ make_payment: 付款
+ confirm_payment: 确认付款
+ success: 返回
+ admin:
+ unconfigured: 'Stripe 配置不正确。有关信息,请参阅 Discourse Meta。'
+ on_meta: Meta 上的 Discourse Subscriptions
+ dashboard:
+ title: 信息中心
+ table:
+ head:
+ user: 用户
+ payment_intent: 付款 ID
+ receipt_email: 收据电子邮件
+ amount: 金额
+ products:
+ title: 产品
+ operations:
+ create: 创建新产品
+ update: 更新产品
+ new: 新产品
+ destroy:
+ confirm: 确定要销毁此产品吗?
+ product:
+ product_id: 产品 ID
+ name: 产品名称
+ statement_descriptor: 对账单标注
+ statement_descriptor_help: 您客户的信用卡对账单上将显示的有关产品的额外信息。
+ plan_help: 创建客户订阅此产品的定价方案。
+ description: 描述
+ description_help: 此为您的订阅产品描述。
+ repurchaseable: 可重复购买?
+ repurchase_help: 允许多次购买产品和关联方案
+ active: 有效
+ active_help: 在您的产品准备好向客户开放前请关闭此项。
+ created_at: 创建时间
+ updated_at: 更新时间
+ product_help: 您需要至少创建一个产品及关联方案,然后客户才可以订阅您的站点。
+ plans:
+ title: 定价方案
+ operations:
+ add: 添加新方案
+ create: 创建方案
+ update: 更新方案
+ create_help: 在定价方案创建完成后,只能更新其昵称、试用期和用户群组。
+ new: 新建方案
+ destroy:
+ confirm: 确定要销毁此方案吗?
+ plan:
+ nickname: 方案昵称
+ nickname_help: 此信息对客户不可见,但可以帮助您稍后查找此方案
+ plan_id: 方案 ID
+ product: 产品
+ interval: 结算间隔
+ amount: 金额
+ trial: 试用期天数
+ trial_help: 订阅此方案将自动开始以此为时长的免费试用期
+ group: 用户群组
+ group_help: 这是创建订阅时客户将被添加到的 Discourse 用户群组。
+ active: 有效
+ created_at: 创建时间
+ recurring: 定期重复的方案?
+ coupons:
+ title: 优惠券
+ code: 促销代码
+ discount: 折扣
+ times_redeemed: 已兑换次数
+ active: 有效?
+ actions: 操作
+ create: 创建优惠券
+ promo_code: 促销代码(不区分大小写)
+ subscriptions:
+ title: 订阅
+ subscription:
+ user: 用户
+ subscription_id: 订阅 ID
+ customer: 客户
+ product: 产品
+ plan: 方案
+ status: 状态
+ created_at: 创建时间
+ ask_refund: 对客户最近一笔付款进行退款?
+ canceled: "该订阅已被取消。"
diff --git a/plugins/discourse-subscriptions/config/locales/client.zh_TW.yml b/plugins/discourse-subscriptions/config/locales/client.zh_TW.yml
new file mode 100644
index 00000000000..f435013d68f
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/client.zh_TW.yml
@@ -0,0 +1,56 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+zh_TW:
+ js:
+ discourse_subscriptions:
+ optional: 可選
+ campaign:
+ success_title: 成功!
+ plans:
+ interval:
+ adverb:
+ day: 日
+ week: 周
+ month: 月
+ year: 年
+ user:
+ payments:
+ created_at: 已建立
+ plans:
+ product: 名稱
+ subscriptions:
+ status: 狀態
+ update_card:
+ single: "更新"
+ created_at: 已建立
+ cancel: 取消
+ billing:
+ email: 電子信箱
+ admin:
+ dashboard:
+ title: 控制面板
+ table:
+ head:
+ user: 使用者
+ products:
+ product:
+ description: 描述
+ active: 啟用
+ created_at: 已建立
+ updated_at: 更新時間
+ plans:
+ plan:
+ active: 啟用
+ created_at: 已建立
+ coupons:
+ active: 啟用?
+ actions: 動作
+ subscriptions:
+ subscription:
+ user: 使用者
+ status: 狀態
+ created_at: 已建立
diff --git a/plugins/discourse-subscriptions/config/locales/server.ar.yml b/plugins/discourse-subscriptions/config/locales/server.ar.yml
new file mode 100644
index 00000000000..16e8616e195
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.ar.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ar:
+ discourse_subscriptions:
+ customer_not_found: لم يتم العثور على العميل
+ card:
+ declined: تم رفض البطاقة
+ invalid: البطاقة غير صالحة
diff --git a/plugins/discourse-subscriptions/config/locales/server.be.yml b/plugins/discourse-subscriptions/config/locales/server.be.yml
new file mode 100644
index 00000000000..2ea77a0d350
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.be.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+be:
diff --git a/plugins/discourse-subscriptions/config/locales/server.bg.yml b/plugins/discourse-subscriptions/config/locales/server.bg.yml
new file mode 100644
index 00000000000..52333529d3c
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.bg.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+bg:
diff --git a/plugins/discourse-subscriptions/config/locales/server.bs_BA.yml b/plugins/discourse-subscriptions/config/locales/server.bs_BA.yml
new file mode 100644
index 00000000000..828a7e65af8
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.bs_BA.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+bs_BA:
diff --git a/plugins/discourse-subscriptions/config/locales/server.ca.yml b/plugins/discourse-subscriptions/config/locales/server.ca.yml
new file mode 100644
index 00000000000..ec737bc1a5b
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.ca.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ca:
diff --git a/plugins/discourse-subscriptions/config/locales/server.cs.yml b/plugins/discourse-subscriptions/config/locales/server.cs.yml
new file mode 100644
index 00000000000..041b2f0bd05
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.cs.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+cs:
diff --git a/plugins/discourse-subscriptions/config/locales/server.da.yml b/plugins/discourse-subscriptions/config/locales/server.da.yml
new file mode 100644
index 00000000000..f39c727c594
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.da.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+da:
diff --git a/plugins/discourse-subscriptions/config/locales/server.de.yml b/plugins/discourse-subscriptions/config/locales/server.de.yml
new file mode 100644
index 00000000000..0be9a174d51
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.de.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+de:
+ discourse_subscriptions:
+ customer_not_found: Kunde nicht gefunden
+ card:
+ declined: Karte abgelehnt
+ invalid: Karte ungültig
diff --git a/plugins/discourse-subscriptions/config/locales/server.el.yml b/plugins/discourse-subscriptions/config/locales/server.el.yml
new file mode 100644
index 00000000000..d872d0ecc40
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.el.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+el:
diff --git a/plugins/discourse-subscriptions/config/locales/server.en.yml b/plugins/discourse-subscriptions/config/locales/server.en.yml
new file mode 100644
index 00000000000..ff7edbf12a4
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.en.yml
@@ -0,0 +1,6 @@
+en:
+ discourse_subscriptions:
+ customer_not_found: Customer not found
+ card:
+ declined: Card Declined
+ invalid: Card Invalid
diff --git a/plugins/discourse-subscriptions/config/locales/server.en_GB.yml b/plugins/discourse-subscriptions/config/locales/server.en_GB.yml
new file mode 100644
index 00000000000..2d4fa180ec7
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.en_GB.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+en_GB:
diff --git a/plugins/discourse-subscriptions/config/locales/server.es.yml b/plugins/discourse-subscriptions/config/locales/server.es.yml
new file mode 100644
index 00000000000..837145acaf1
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.es.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+es:
+ discourse_subscriptions:
+ customer_not_found: Cliente no encontrado
+ card:
+ declined: Tarjeta rechazada
+ invalid: Tarjeta no válida
diff --git a/plugins/discourse-subscriptions/config/locales/server.et.yml b/plugins/discourse-subscriptions/config/locales/server.et.yml
new file mode 100644
index 00000000000..0ea0b6d554b
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.et.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+et:
diff --git a/plugins/discourse-subscriptions/config/locales/server.fa_IR.yml b/plugins/discourse-subscriptions/config/locales/server.fa_IR.yml
new file mode 100644
index 00000000000..610696ed3de
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.fa_IR.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+fa_IR:
+ discourse_subscriptions:
+ customer_not_found: مشتری پیدا نشد
+ card:
+ declined: کارت رد شد
+ invalid: کارت نامعتبر است
diff --git a/plugins/discourse-subscriptions/config/locales/server.fi.yml b/plugins/discourse-subscriptions/config/locales/server.fi.yml
new file mode 100644
index 00000000000..d6489f72593
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.fi.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+fi:
+ discourse_subscriptions:
+ customer_not_found: Asiakasta ei löydy
+ card:
+ declined: Kortti hylätty
+ invalid: Kortti ei kelpaa
diff --git a/plugins/discourse-subscriptions/config/locales/server.fr.yml b/plugins/discourse-subscriptions/config/locales/server.fr.yml
new file mode 100644
index 00000000000..dc5a3d025a5
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.fr.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+fr:
+ discourse_subscriptions:
+ customer_not_found: Client introuvable
+ card:
+ declined: Carte refusée
+ invalid: Carte invalide
diff --git a/plugins/discourse-subscriptions/config/locales/server.gl.yml b/plugins/discourse-subscriptions/config/locales/server.gl.yml
new file mode 100644
index 00000000000..fb911ce1635
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.gl.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+gl:
diff --git a/plugins/discourse-subscriptions/config/locales/server.he.yml b/plugins/discourse-subscriptions/config/locales/server.he.yml
new file mode 100644
index 00000000000..8ad8da490b6
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.he.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+he:
+ discourse_subscriptions:
+ customer_not_found: הלקוח לא נמצא
+ card:
+ declined: הכרטיס נדחה
+ invalid: כרטיס שגוי
diff --git a/plugins/discourse-subscriptions/config/locales/server.hr.yml b/plugins/discourse-subscriptions/config/locales/server.hr.yml
new file mode 100644
index 00000000000..93343ce6e19
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.hr.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+hr:
diff --git a/plugins/discourse-subscriptions/config/locales/server.hu.yml b/plugins/discourse-subscriptions/config/locales/server.hu.yml
new file mode 100644
index 00000000000..76b6e9d8bcb
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.hu.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+hu:
diff --git a/plugins/discourse-subscriptions/config/locales/server.hy.yml b/plugins/discourse-subscriptions/config/locales/server.hy.yml
new file mode 100644
index 00000000000..cb18f64d356
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.hy.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+hy:
diff --git a/plugins/discourse-subscriptions/config/locales/server.id.yml b/plugins/discourse-subscriptions/config/locales/server.id.yml
new file mode 100644
index 00000000000..596e36b2e13
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.id.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+id:
diff --git a/plugins/discourse-subscriptions/config/locales/server.it.yml b/plugins/discourse-subscriptions/config/locales/server.it.yml
new file mode 100644
index 00000000000..f1f0e22a05c
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.it.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+it:
+ discourse_subscriptions:
+ customer_not_found: Cliente non trovato
+ card:
+ declined: Carta rifiutata
+ invalid: Carta non valida
diff --git a/plugins/discourse-subscriptions/config/locales/server.ja.yml b/plugins/discourse-subscriptions/config/locales/server.ja.yml
new file mode 100644
index 00000000000..1a5fe777b06
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.ja.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ja:
+ discourse_subscriptions:
+ customer_not_found: お客様が見つかりません
+ card:
+ declined: カードが拒否されました
+ invalid: カードが無効です
diff --git a/plugins/discourse-subscriptions/config/locales/server.ko.yml b/plugins/discourse-subscriptions/config/locales/server.ko.yml
new file mode 100644
index 00000000000..18dd77fd3ec
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.ko.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ko:
diff --git a/plugins/discourse-subscriptions/config/locales/server.lt.yml b/plugins/discourse-subscriptions/config/locales/server.lt.yml
new file mode 100644
index 00000000000..16bb19758dc
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.lt.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+lt:
diff --git a/plugins/discourse-subscriptions/config/locales/server.lv.yml b/plugins/discourse-subscriptions/config/locales/server.lv.yml
new file mode 100644
index 00000000000..59e0ef6f4ed
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.lv.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+lv:
diff --git a/plugins/discourse-subscriptions/config/locales/server.nb_NO.yml b/plugins/discourse-subscriptions/config/locales/server.nb_NO.yml
new file mode 100644
index 00000000000..2e2224d1472
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.nb_NO.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+nb_NO:
diff --git a/plugins/discourse-subscriptions/config/locales/server.nl.yml b/plugins/discourse-subscriptions/config/locales/server.nl.yml
new file mode 100644
index 00000000000..60e1ebe5a09
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.nl.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+nl:
+ discourse_subscriptions:
+ customer_not_found: Klant niet gevonden
+ card:
+ declined: Kaart geweigerd
+ invalid: Kaart ongeldig
diff --git a/plugins/discourse-subscriptions/config/locales/server.pl_PL.yml b/plugins/discourse-subscriptions/config/locales/server.pl_PL.yml
new file mode 100644
index 00000000000..8302236a382
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.pl_PL.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+pl_PL:
+ discourse_subscriptions:
+ customer_not_found: Nie znaleziono klienta
+ card:
+ declined: Karta odrzucona
+ invalid: Nieprawidłowa karta
diff --git a/plugins/discourse-subscriptions/config/locales/server.pt.yml b/plugins/discourse-subscriptions/config/locales/server.pt.yml
new file mode 100644
index 00000000000..55105b806d9
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.pt.yml
@@ -0,0 +1,11 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+pt:
+ discourse_subscriptions:
+ customer_not_found: Cliente não encontrado
+ card:
+ declined: Cartão Recusado
diff --git a/plugins/discourse-subscriptions/config/locales/server.pt_BR.yml b/plugins/discourse-subscriptions/config/locales/server.pt_BR.yml
new file mode 100644
index 00000000000..85b9251b896
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.pt_BR.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+pt_BR:
+ discourse_subscriptions:
+ customer_not_found: Cliente não encontrado(a)
+ card:
+ declined: Cartão recusado
+ invalid: Cartão inválido
diff --git a/plugins/discourse-subscriptions/config/locales/server.ro.yml b/plugins/discourse-subscriptions/config/locales/server.ro.yml
new file mode 100644
index 00000000000..08a77f812ee
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.ro.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ro:
diff --git a/plugins/discourse-subscriptions/config/locales/server.ru.yml b/plugins/discourse-subscriptions/config/locales/server.ru.yml
new file mode 100644
index 00000000000..aefc4ce119f
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.ru.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ru:
+ discourse_subscriptions:
+ customer_not_found: Клиент не найден
+ card:
+ declined: Карта отклонена
+ invalid: Карта недействительна
diff --git a/plugins/discourse-subscriptions/config/locales/server.sk.yml b/plugins/discourse-subscriptions/config/locales/server.sk.yml
new file mode 100644
index 00000000000..6f815624081
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.sk.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sk:
diff --git a/plugins/discourse-subscriptions/config/locales/server.sl.yml b/plugins/discourse-subscriptions/config/locales/server.sl.yml
new file mode 100644
index 00000000000..23489a48b1f
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.sl.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sl:
diff --git a/plugins/discourse-subscriptions/config/locales/server.sq.yml b/plugins/discourse-subscriptions/config/locales/server.sq.yml
new file mode 100644
index 00000000000..7f051b7a7cf
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.sq.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sq:
diff --git a/plugins/discourse-subscriptions/config/locales/server.sr.yml b/plugins/discourse-subscriptions/config/locales/server.sr.yml
new file mode 100644
index 00000000000..88d63d6ae1a
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.sr.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sr:
diff --git a/plugins/discourse-subscriptions/config/locales/server.sv.yml b/plugins/discourse-subscriptions/config/locales/server.sv.yml
new file mode 100644
index 00000000000..befcfd5d8b4
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.sv.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sv:
+ discourse_subscriptions:
+ customer_not_found: Kunden hittades inte
+ card:
+ declined: Kort avvisat
+ invalid: Kortet är ogiltigt
diff --git a/plugins/discourse-subscriptions/config/locales/server.sw.yml b/plugins/discourse-subscriptions/config/locales/server.sw.yml
new file mode 100644
index 00000000000..0d7cdd075bf
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.sw.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sw:
diff --git a/plugins/discourse-subscriptions/config/locales/server.te.yml b/plugins/discourse-subscriptions/config/locales/server.te.yml
new file mode 100644
index 00000000000..03967bdbb07
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.te.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+te:
diff --git a/plugins/discourse-subscriptions/config/locales/server.th.yml b/plugins/discourse-subscriptions/config/locales/server.th.yml
new file mode 100644
index 00000000000..7de85ff91c4
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.th.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+th:
diff --git a/plugins/discourse-subscriptions/config/locales/server.tr_TR.yml b/plugins/discourse-subscriptions/config/locales/server.tr_TR.yml
new file mode 100644
index 00000000000..e6e0316abdf
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.tr_TR.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+tr_TR:
+ discourse_subscriptions:
+ customer_not_found: Müşteri bulunamadı
+ card:
+ declined: Kart Reddedildi
+ invalid: Kart Geçersiz
diff --git a/plugins/discourse-subscriptions/config/locales/server.ug.yml b/plugins/discourse-subscriptions/config/locales/server.ug.yml
new file mode 100644
index 00000000000..a6bf0185ae2
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.ug.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ug:
diff --git a/plugins/discourse-subscriptions/config/locales/server.uk.yml b/plugins/discourse-subscriptions/config/locales/server.uk.yml
new file mode 100644
index 00000000000..f1390545d1d
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.uk.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+uk:
diff --git a/plugins/discourse-subscriptions/config/locales/server.ur.yml b/plugins/discourse-subscriptions/config/locales/server.ur.yml
new file mode 100644
index 00000000000..b4a9c21ee2f
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.ur.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ur:
diff --git a/plugins/discourse-subscriptions/config/locales/server.vi.yml b/plugins/discourse-subscriptions/config/locales/server.vi.yml
new file mode 100644
index 00000000000..f629dcf5329
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.vi.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+vi:
diff --git a/plugins/discourse-subscriptions/config/locales/server.zh_CN.yml b/plugins/discourse-subscriptions/config/locales/server.zh_CN.yml
new file mode 100644
index 00000000000..5855353c795
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.zh_CN.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+zh_CN:
+ discourse_subscriptions:
+ customer_not_found: 找不到客户
+ card:
+ declined: 银行卡被拒绝
+ invalid: 卡片无效
diff --git a/plugins/discourse-subscriptions/config/locales/server.zh_TW.yml b/plugins/discourse-subscriptions/config/locales/server.zh_TW.yml
new file mode 100644
index 00000000000..7e15fab0018
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/locales/server.zh_TW.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+zh_TW:
diff --git a/plugins/discourse-subscriptions/config/routes.rb b/plugins/discourse-subscriptions/config/routes.rb
new file mode 100644
index 00000000000..3d2da420bed
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/routes.rb
@@ -0,0 +1,32 @@
+# frozen_string_literal: true
+require_dependency "subscriptions_user_constraint"
+
+DiscourseSubscriptions::Engine.routes.draw do
+ scope "admin" do
+ get "/" => "admin#index"
+ post "/refresh" => "admin#refresh_campaign"
+ post "/create-campaign" => "admin#create_campaign"
+ end
+
+ namespace :admin, constraints: AdminConstraint.new do
+ resources :plans
+ resources :subscriptions, only: %i[index destroy]
+ resources :products
+ resources :coupons, only: %i[index create]
+ resource :coupons, only: %i[destroy update]
+ end
+
+ namespace :user do
+ resources :payments, only: [:index]
+ resources :subscriptions, only: %i[index update destroy]
+ end
+
+ get "/" => "subscribe#index"
+ get ".json" => "subscribe#index"
+ get "/contributors" => "subscribe#contributors"
+ get "/:id" => "subscribe#show"
+ post "/create" => "subscribe#create"
+ post "/finalize" => "subscribe#finalize"
+
+ post "/hooks" => "hooks#create"
+end
diff --git a/plugins/discourse-subscriptions/config/settings.yml b/plugins/discourse-subscriptions/config/settings.yml
new file mode 100644
index 00000000000..1eec343f34c
--- /dev/null
+++ b/plugins/discourse-subscriptions/config/settings.yml
@@ -0,0 +1,90 @@
+discourse_subscriptions:
+ discourse_subscriptions_enabled:
+ default: false
+ discourse_subscriptions_extra_nav_subscribe:
+ default: false
+ client: true
+ discourse_subscriptions_pricing_table_id:
+ default: ''
+ client: true
+ discourse_subscriptions_pricing_table_enabled:
+ default: false
+ client: true
+ discourse_subscriptions_public_key:
+ default: ''
+ client: true
+ discourse_subscriptions_secret_key:
+ default: ''
+ client: false
+ discourse_subscriptions_webhook_secret:
+ default: ''
+ client: false
+ discourse_subscriptions_currency:
+ client: true
+ default: "USD"
+ type: enum
+ choices:
+ - AUD
+ - BRL
+ - CAD
+ - EUR
+ - GBP
+ - INR
+ - NZD
+ - USD
+ - DKK
+ - SGD
+ - ZAR
+ - CHF
+ - PLN
+ - CZK
+ - SEK
+ discourse_subscriptions_campaign_enabled:
+ client: true
+ default: false
+ discourse_subscriptions_campaign_goal:
+ client: true
+ default: 100
+ discourse_subscriptions_campaign_type:
+ client: true
+ type: enum
+ default: "Amount"
+ choices:
+ - Amount
+ - Subscribers
+ discourse_subscriptions_campaign_banner_location:
+ client: true
+ type: enum
+ default: "Top"
+ choices:
+ - Top
+ - Sidebar
+ discourse_subscriptions_campaign_banner_bg_image:
+ client: true
+ type: upload
+ default: ""
+ discourse_subscriptions_campaign_banner_shadow_color:
+ client: true
+ type: color
+ default: "2F70AC"
+ discourse_subscriptions_campaign_show_contributors:
+ client: true
+ default: true
+ discourse_subscriptions_campaign_product:
+ client: true
+ default: ""
+ discourse_subscriptions_campaign_amount_raised:
+ client: true
+ default: 0.00
+ hidden: true
+ discourse_subscriptions_campaign_subscribers:
+ client: true
+ default: 0
+ hidden: true
+ discourse_subscriptions_campaign_group:
+ default: ""
+ hidden: true
+ discourse_subscriptions_enable_automatic_tax:
+ default: false
+ discourse_subscriptions_enable_verbose_logging:
+ default: false
\ No newline at end of file
diff --git a/plugins/discourse-subscriptions/db/migrate/20191203014808_create_subscriptions_customers.rb b/plugins/discourse-subscriptions/db/migrate/20191203014808_create_subscriptions_customers.rb
new file mode 100644
index 00000000000..c6310737bca
--- /dev/null
+++ b/plugins/discourse-subscriptions/db/migrate/20191203014808_create_subscriptions_customers.rb
@@ -0,0 +1,12 @@
+# frozen_string_literal: true
+
+class CreateSubscriptionsCustomers < ActiveRecord::Migration[6.0]
+ def change
+ create_table :discourse_subscriptions_customers do |t|
+ t.string :customer_id, null: false, index: true
+ t.string :product_id
+ t.references :user
+ t.timestamps
+ end
+ end
+end
diff --git a/plugins/discourse-subscriptions/db/migrate/20200514175537_create_products.rb b/plugins/discourse-subscriptions/db/migrate/20200514175537_create_products.rb
new file mode 100644
index 00000000000..8ed54e7a9fc
--- /dev/null
+++ b/plugins/discourse-subscriptions/db/migrate/20200514175537_create_products.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class CreateProducts < ActiveRecord::Migration[6.0]
+ def change
+ create_table :discourse_subscriptions_products do |t|
+ t.string :external_id, null: false, index: true
+
+ t.timestamps
+ end
+ end
+end
diff --git a/plugins/discourse-subscriptions/db/migrate/20200518145424_create_subscriptions.rb b/plugins/discourse-subscriptions/db/migrate/20200518145424_create_subscriptions.rb
new file mode 100644
index 00000000000..9743629d942
--- /dev/null
+++ b/plugins/discourse-subscriptions/db/migrate/20200518145424_create_subscriptions.rb
@@ -0,0 +1,12 @@
+# frozen_string_literal: true
+
+class CreateSubscriptions < ActiveRecord::Migration[6.0]
+ def change
+ create_table :discourse_subscriptions_subscriptions do |t|
+ t.integer :customer_id, null: false, index: true
+ t.string :external_id, null: false, index: true
+
+ t.timestamps
+ end
+ end
+end
diff --git a/plugins/discourse-subscriptions/db/migrate/20240430163338_add_status_to_subscriptions.rb b/plugins/discourse-subscriptions/db/migrate/20240430163338_add_status_to_subscriptions.rb
new file mode 100644
index 00000000000..38c9bd542a8
--- /dev/null
+++ b/plugins/discourse-subscriptions/db/migrate/20240430163338_add_status_to_subscriptions.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class AddStatusToSubscriptions < ActiveRecord::Migration[7.0]
+ def change
+ add_column :discourse_subscriptions_subscriptions, :status, :string
+ end
+end
diff --git a/plugins/discourse-subscriptions/db/migrate/20241009160105_alter_customer_id_to_bigint.rb b/plugins/discourse-subscriptions/db/migrate/20241009160105_alter_customer_id_to_bigint.rb
new file mode 100644
index 00000000000..297222e1714
--- /dev/null
+++ b/plugins/discourse-subscriptions/db/migrate/20241009160105_alter_customer_id_to_bigint.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class AlterCustomerIdToBigint < ActiveRecord::Migration[7.1]
+ def up
+ change_column :discourse_subscriptions_subscriptions, :customer_id, :bigint
+ end
+
+ def down
+ raise ActiveRecord::IrreversibleMigration
+ end
+end
diff --git a/plugins/discourse-subscriptions/lib/discourse_subscriptions/engine.rb b/plugins/discourse-subscriptions/lib/discourse_subscriptions/engine.rb
new file mode 100644
index 00000000000..73a2521b11f
--- /dev/null
+++ b/plugins/discourse-subscriptions/lib/discourse_subscriptions/engine.rb
@@ -0,0 +1,8 @@
+# frozen_string_literal: true
+
+module ::DiscourseSubscriptions
+ class Engine < ::Rails::Engine
+ engine_name "discourse-subscriptions"
+ isolate_namespace DiscourseSubscriptions
+ end
+end
diff --git a/plugins/discourse-subscriptions/lib/subscriptions_user_constraint.rb b/plugins/discourse-subscriptions/lib/subscriptions_user_constraint.rb
new file mode 100644
index 00000000000..058f342d181
--- /dev/null
+++ b/plugins/discourse-subscriptions/lib/subscriptions_user_constraint.rb
@@ -0,0 +1,10 @@
+# frozen_string_literal: true
+
+class SubscriptionsUserConstraint
+ def matches?(request)
+ provider = Discourse.current_user_provider.new(request.env)
+ provider.current_user
+ rescue Discourse::InvalidAccess, Discourse::ReadOnly
+ false
+ end
+end
diff --git a/plugins/discourse-subscriptions/lib/tasks/subscriptions_import.rake b/plugins/discourse-subscriptions/lib/tasks/subscriptions_import.rake
new file mode 100644
index 00000000000..3dd116fabe3
--- /dev/null
+++ b/plugins/discourse-subscriptions/lib/tasks/subscriptions_import.rake
@@ -0,0 +1,180 @@
+# frozen_string_literal: true
+
+require "stripe"
+require "highline/import"
+
+desc "Import subscriptions from Stripe"
+task "subscriptions:subscriptions_import" => :environment do
+ setup_api
+ products = get_stripe_products
+ strip_products_to_import = []
+
+ procourse_import = false
+ procourse_import_response =
+ ask("Were the subscriptions you are importing created in Procourse Memberships?: (y/N)")
+ procourse_import = true if procourse_import_response.downcase == "y"
+
+ products.each do |product|
+ confirm_import =
+ ask("Do you wish to import product #{product[:name]} (id: #{product[:id]}): (y/N)")
+ next if confirm_import.downcase != "y"
+ strip_products_to_import << product
+ end
+
+ import_products(strip_products_to_import)
+ import_subscriptions(procourse_import)
+end
+
+def get_stripe_products(starting_after: nil)
+ puts "Getting products from Stripe API"
+
+ all_products = []
+
+ loop do
+ products =
+ Stripe::Product.list({ type: "service", starting_after: starting_after, active: true })
+ all_products += products[:data]
+ break if products[:has_more] == false
+ starting_after = products[:data].last["id"]
+ end
+
+ all_products
+end
+
+def get_stripe_subscriptions(starting_after: nil)
+ puts "Getting Subscriptions from Stripe API"
+
+ all_subscriptions = []
+
+ loop do
+ subscriptions = Stripe::Subscription.list({ starting_after: starting_after, status: "active" })
+ all_subscriptions += subscriptions[:data]
+ break if subscriptions[:has_more] == false
+ starting_after = subscriptions[:data].last["id"]
+ end
+
+ all_subscriptions
+end
+
+def get_stripe_customers(starting_after: nil)
+ puts "Getting Customers from Stripe API"
+
+ all_customers = []
+
+ loop do
+ customers = Stripe::Customer.list({ starting_after: starting_after })
+ all_customers += customers[:data]
+ break if customers[:has_more] == false
+ starting_after = customers[:data].last["id"]
+ end
+
+ all_customers
+end
+
+def import_products(products)
+ puts "Importing products:"
+
+ products.each do |product|
+ puts "Looking for external_id #{product[:id]} ..."
+ if DiscourseSubscriptions::Product.find_by(external_id: product[:id]).blank?
+ DiscourseSubscriptions::Product.create(external_id: product[:id])
+ puts "Subscriptions Product external_id: #{product[:id]} CREATED"
+ else
+ puts "Subscriptions Product external_id: #{product[:id]} already exists"
+ end
+ end
+end
+
+def import_subscriptions(procourse_import)
+ puts "Importing subscriptions"
+ product_ids = DiscourseSubscriptions::Product.all.pluck(:external_id)
+
+ all_customers = get_stripe_customers
+ puts "Total available Stripe Customers: #{all_customers.length}, the first of which is customer id: #{all_customers[0][:description]}"
+
+ subscriptions = get_stripe_subscriptions
+ puts "Total Active Subscriptions available: #{subscriptions.length}"
+
+ subscriptions_for_products =
+ subscriptions.select { |sub| product_ids.include?(sub[:items][:data][0][:price][:product]) }
+ puts "Total Subscriptions matching Products to Import: #{subscriptions_for_products.length}"
+
+ subscriptions_for_products.each do |subscription|
+ product_id = subscription[:items][:data][0][:plan][:product]
+ customer_id = subscription[:customer]
+ subscription_id = subscription[:id]
+
+ if procourse_import
+ stripe_customer = all_customers.select { |cust| cust[:id] == customer_id }
+ user_id = stripe_customer[0][:description].to_i
+ username = nil
+ else
+ user_id = subscription[:metadata][:user_id].to_i
+ username = subscription[:metadata][:username]
+ end
+
+ if product_id && customer_id && subscription_id
+ subscriptions_customer =
+ DiscourseSubscriptions::Customer.find_by(
+ user_id: user_id,
+ customer_id: customer_id,
+ product_id: product_id,
+ )
+
+ if subscriptions_customer.nil? && user_id && user_id > 0
+ # create the customer record if doesn't exist only if the user_id and username match, which
+ # prevents issues if multiple sites use the same Stripe account. Does not apply to a Procourse import.
+ user = User.find(user_id)
+ if procourse_import || (user && (user.username == username))
+ subscriptions_customer =
+ DiscourseSubscriptions::Customer.create(
+ user_id: user_id,
+ customer_id: customer_id,
+ product_id: product_id,
+ )
+ puts "Subscriptions Customer user_id: #{user_id}, customer_id: #{customer_id}, product_id: #{product_id}) CREATED"
+ end
+ else
+ puts "Subscriptions Customer user_id: #{user_id}, customer_id: #{customer_id}, product_id: #{product_id}) already exists"
+ end
+
+ if subscriptions_customer
+ if DiscourseSubscriptions::Subscription.find_by(
+ customer_id: subscriptions_customer.id,
+ external_id: subscription_id,
+ ).blank?
+ DiscourseSubscriptions::Subscription.create(
+ customer_id: subscriptions_customer.id,
+ external_id: subscription_id,
+ )
+ puts "Discourse Subscription customer_id: #{subscriptions_customer.id}, external_id: #{subscription_id}) CREATED"
+ else
+ puts "Discourse Subscription customer_id: #{subscriptions_customer.id}, external_id: #{subscription_id}) already exists"
+ end
+
+ if procourse_import
+ # Update Procourse Stripe data as it would be if it were created by discourse_subscriptions
+ discourse_user = User.find(user_id)
+ puts "Discourse User: #{discourse_user.username_lower} found for Strip metadata update ..."
+
+ updated_subscription =
+ Stripe::Subscription.update(
+ subscription_id,
+ { metadata: { user_id: user_id, username: discourse_user.username_lower } },
+ )
+ puts "Stripe Subscription: #{updated_subscription[:id]}, metadata: #{updated_subscription[:metadata]} UPDATED"
+
+ updated_customer = Stripe::Customer.update(customer_id, { email: discourse_user.email })
+ puts "Stripe Customer: #{updated_customer[:id]}, email: #{updated_customer[:email]} UPDATED"
+ end
+ end
+ end
+ end
+end
+
+private
+
+def setup_api
+ api_key = SiteSetting.discourse_subscriptions_secret_key || ask("Input Stripe secret key")
+ Stripe.api_key = api_key
+end
diff --git a/plugins/discourse-subscriptions/plugin.rb b/plugins/discourse-subscriptions/plugin.rb
new file mode 100644
index 00000000000..439a18fab0b
--- /dev/null
+++ b/plugins/discourse-subscriptions/plugin.rb
@@ -0,0 +1,91 @@
+# frozen_string_literal: true
+
+# name: discourse-subscriptions
+# about: Allows admins to sell subscriptions to site content.
+# meta_topic_id: 140818
+# version: 2.8.1
+# authors: Rimian Perkins, Justin DiRose
+# url: https://github.com/discourse/discourse/tree/main/plugins/discourse-subscriptions
+
+enabled_site_setting :discourse_subscriptions_enabled
+
+require "stripe"
+
+register_asset "stylesheets/common/main.scss"
+register_asset "stylesheets/common/layout.scss"
+register_asset "stylesheets/common/subscribe.scss"
+register_asset "stylesheets/common/campaign.scss"
+register_asset "stylesheets/mobile/main.scss"
+register_svg_icon "far-credit-card" if respond_to?(:register_svg_icon)
+
+register_html_builder("server:before-head-close") do |controller|
+ "<script src='https://js.stripe.com/v3/' nonce='#{controller.helpers.csp_nonce_placeholder}'></script>"
+end
+
+register_html_builder("server:before-head-close") do |controller|
+ "<script async src='https://js.stripe.com/v3/pricing-table.js' nonce='#{controller.helpers.csp_nonce_placeholder}'></script>"
+end
+
+extend_content_security_policy(script_src: %w[https://js.stripe.com/v3/ https://hooks.stripe.com])
+
+add_admin_route "discourse_subscriptions.admin_navigation", "discourse-subscriptions.products"
+
+Discourse::Application.routes.append do
+ get "/admin/plugins/discourse-subscriptions" => "admin/plugins#index",
+ :constraints => AdminConstraint.new
+ get "/admin/plugins/discourse-subscriptions/products" => "admin/plugins#index",
+ :constraints => AdminConstraint.new
+ get "/admin/plugins/discourse-subscriptions/products/:product_id" => "admin/plugins#index",
+ :constraints => AdminConstraint.new
+ get "/admin/plugins/discourse-subscriptions/products/:product_id/plans" => "admin/plugins#index",
+ :constraints => AdminConstraint.new
+ get "/admin/plugins/discourse-subscriptions/products/:product_id/plans/:plan_id" =>
+ "admin/plugins#index",
+ :constraints => AdminConstraint.new
+ get "/admin/plugins/discourse-subscriptions/subscriptions" => "admin/plugins#index",
+ :constraints => AdminConstraint.new
+ get "/admin/plugins/discourse-subscriptions/plans" => "admin/plugins#index",
+ :constraints => AdminConstraint.new
+ get "/admin/plugins/discourse-subscriptions/plans/:plan_id" => "admin/plugins#index",
+ :constraints => AdminConstraint.new
+ get "/admin/plugins/discourse-subscriptions/coupons" => "admin/plugins#index",
+ :constraints => AdminConstraint.new
+ get "u/:username/billing" => "users#show", :constraints => { username: USERNAME_ROUTE_FORMAT }
+ get "u/:username/billing/:id" => "users#show", :constraints => { username: USERNAME_ROUTE_FORMAT }
+ get "u/:username/billing/subscriptions/card/:subscription_id" => "users#show",
+ :constraints => {
+ username: USERNAME_ROUTE_FORMAT,
+ }
+end
+
+module ::DiscourseSubscriptions
+ PLUGIN_NAME = "discourse-subscriptions"
+end
+
+require_relative "lib/discourse_subscriptions/engine"
+require_relative "app/controllers/concerns/stripe"
+require_relative "app/controllers/concerns/group"
+
+after_initialize do
+ ::Stripe.api_version = "2024-04-10"
+
+ ::Stripe.set_app_info(
+ "Discourse Subscriptions",
+ version: "2.8.2",
+ url: "https://github.com/discourse/discourse-subscriptions",
+ )
+
+ Discourse::Application.routes.append { mount ::DiscourseSubscriptions::Engine, at: "s" }
+
+ add_to_serializer(:site, :show_campaign_banner) do
+ begin
+ enabled = SiteSetting.discourse_subscriptions_enabled
+ campaign_enabled = SiteSetting.discourse_subscriptions_campaign_enabled
+ goal_met = Discourse.redis.get("subscriptions_goal_met_date")
+
+ enabled && campaign_enabled && (!goal_met || 7.days.ago <= Date.parse(goal_met))
+ rescue StandardError
+ false
+ end
+ end
+end
diff --git a/plugins/discourse-subscriptions/spec/fabricators/customer_fabricator.rb b/plugins/discourse-subscriptions/spec/fabricators/customer_fabricator.rb
new file mode 100644
index 00000000000..c3f9174c54c
--- /dev/null
+++ b/plugins/discourse-subscriptions/spec/fabricators/customer_fabricator.rb
@@ -0,0 +1,3 @@
+# frozen_string_literal: true
+
+Fabricator(:customer, from: "DiscourseSubscriptions::Customer")
diff --git a/plugins/discourse-subscriptions/spec/fabricators/product_fabricator.rb b/plugins/discourse-subscriptions/spec/fabricators/product_fabricator.rb
new file mode 100644
index 00000000000..9c99c79c53b
--- /dev/null
+++ b/plugins/discourse-subscriptions/spec/fabricators/product_fabricator.rb
@@ -0,0 +1,3 @@
+# frozen_string_literal: true
+
+Fabricator(:product, from: "DiscourseSubscriptions::Product")
diff --git a/plugins/discourse-subscriptions/spec/fabricators/subscription_fabricator.rb b/plugins/discourse-subscriptions/spec/fabricators/subscription_fabricator.rb
new file mode 100644
index 00000000000..5ba9e2ea1c6
--- /dev/null
+++ b/plugins/discourse-subscriptions/spec/fabricators/subscription_fabricator.rb
@@ -0,0 +1,3 @@
+# frozen_string_literal: true
+
+Fabricator(:subscription, from: "DiscourseSubscriptions::Subscription")
diff --git a/plugins/discourse-subscriptions/spec/fixtures/json/stripe-price-list.json b/plugins/discourse-subscriptions/spec/fixtures/json/stripe-price-list.json
new file mode 100644
index 00000000000..fd0076f91b3
--- /dev/null
+++ b/plugins/discourse-subscriptions/spec/fixtures/json/stripe-price-list.json
@@ -0,0 +1,67 @@
+{
+ "object": "list",
+ "data": [
+ {
+ "id": "price_1OrmlvEYXaQnncShNahrpKvA",
+ "object": "price",
+ "active": true,
+ "billing_scheme": "per_unit",
+ "created": 1709840311,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {
+ "group_name": "subscribers",
+ "trial_period_days": "0"
+ },
+ "nickname": "EA1",
+ "product": {
+ "id": "prod_PhB6IpGhEX14Hi",
+ "object": "product",
+ "active": true,
+ "attributes": [
+
+ ],
+ "created": 1709840195,
+ "default_price": null,
+ "description": null,
+ "images": [
+
+ ],
+ "livemode": false,
+ "marketing_features": [
+
+ ],
+ "metadata": {
+ "description": "Sign up and get access to an exclusive group of enthusiasts just like you!"
+ },
+ "name": "Exclusive Access",
+ "package_dimensions": null,
+ "shippable": null,
+ "statement_descriptor": "TESTING",
+ "tax_code": null,
+ "type": "service",
+ "unit_label": null,
+ "updated": 1709840195,
+ "url": null
+ },
+ "recurring": {
+ "aggregate_usage": null,
+ "interval": "month",
+ "interval_count": 1,
+ "meter": null,
+ "trial_period_days": null,
+ "usage_type": "licensed"
+ },
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "recurring",
+ "unit_amount": 1000,
+ "unit_amount_decimal": "1000"
+ }
+ ],
+ "has_more": false,
+ "url": "/v1/prices"
+}
\ No newline at end of file
diff --git a/plugins/discourse-subscriptions/spec/fixtures/json/stripe-subscription-list.json b/plugins/discourse-subscriptions/spec/fixtures/json/stripe-subscription-list.json
new file mode 100644
index 00000000000..26ea417edc5
--- /dev/null
+++ b/plugins/discourse-subscriptions/spec/fixtures/json/stripe-subscription-list.json
@@ -0,0 +1,149 @@
+{
+ "has_more": false,
+ "data": [
+ {
+ "id": "sub_10z",
+ "object": "subscription",
+ "created": 1714594277,
+ "current_period_end": 1717272677,
+ "current_period_start": 1714594277,
+ "customer": "cus_Q1n43We0YFjnlc",
+ "items": {
+ "object": "list",
+ "data": [
+ {
+ "id": "si_Q1n45g1Ifcluuu",
+ "object": "subscription_item",
+ "billing_thresholds": null,
+ "created": 1714594277,
+ "discounts": [],
+ "metadata": {},
+ "plan": {
+ "id": "price_1OrmlvEYXaQnncShNahrpKvA",
+ "object": "plan",
+ "active": true,
+ "created": 1709840311,
+ "metadata": {
+ "group_name": "subscribers",
+ "trial_period_days": "0"
+ },
+ "nickname": "EA1",
+ "product": "prod_PhB6IpGhEX14Hi"
+ },
+ "price": {
+ "id": "price_1OrmlvEYXaQnncShNahrpKvA",
+ "object": "price",
+ "metadata": {
+ "group_name": "subscribers",
+ "trial_period_days": "0"
+ },
+ "nickname": "EA1",
+ "product": "prod_PhB6IpGhEX14Hi"
+ },
+ "quantity": 1,
+ "subscription": "sub_1PBjUnEYXaQnncShE7USquGd",
+ "tax_rates": []
+ }
+ ],
+ "has_more": false,
+ "total_count": 1,
+ "url": "/v1/subscription_items?subscription=sub_1PBjUnEYXaQnncShE7USquGd"
+ },
+ "latest_invoice": "in_1PBjUnEYXaQnncSh5c7HZ2jG",
+ "metadata": { "user_id": "108", "username": "f79fc8fde" },
+ "plan": {
+ "id": "price_1OrmlvEYXaQnncShNahrpKvA",
+ "object": "plan",
+ "active": true,
+ "metadata": { "group_name": "subscribers", "trial_period_days": "0" },
+ "meter": null,
+ "nickname": "EA1",
+ "product": {
+ "id": "prod_PhB6IpGhEX14Hi",
+ "object": "product",
+ "metadata": {
+ "description": "Sign up and get access to an exclusive group of enthusiasts just like you!"
+ },
+ "name": "Exclusive Access"
+ }
+ },
+ "quantity": 1,
+ "schedule": null,
+ "start_date": 1714594277,
+ "status": "active"
+ },
+ {
+ "id": "sub_32b",
+ "object": "subscription",
+ "created": 1714594277,
+ "current_period_end": 1717272677,
+ "current_period_start": 1714594277,
+ "customer": "cus_Q1n43We0YFjnlc",
+ "items": {
+ "object": "list",
+ "data": [
+ {
+ "id": "si_Q1n45g1Ifcluuu",
+ "object": "subscription_item",
+ "billing_thresholds": null,
+ "created": 1714594277,
+ "discounts": [],
+ "metadata": {},
+ "plan": {
+ "id": "price_1OrmlvEYXaQnncShNahrpKvA",
+ "object": "plan",
+ "active": true,
+ "created": 1709840311,
+ "metadata": {
+ "group_name": "subscribers",
+ "trial_period_days": "0"
+ },
+ "nickname": "EA1",
+ "product": "prod_PhB6IpGhEX14Hi"
+ },
+ "price": {
+ "id": "price_1OrmlvEYXaQnncShNahrpKvA",
+ "object": "price",
+ "metadata": {
+ "group_name": "subscribers",
+ "trial_period_days": "0"
+ },
+ "nickname": "EA1",
+ "product": "prod_PhB6IpGhEX14Hi"
+ },
+ "quantity": 1,
+ "subscription": "sub_1PBjUnEYXaQnncShE7USquGd",
+ "tax_rates": []
+ }
+ ],
+ "has_more": false,
+ "total_count": 1,
+ "url": "/v1/subscription_items?subscription=sub_1PBjUnEYXaQnncShE7USquGd"
+ },
+ "latest_invoice": "in_1PBjUnEYXaQnncSh5c7HZ2jG",
+ "metadata": { "user_id": "108", "username": "f79fc8fde" },
+ "plan": {
+ "id": "price_1OrmlvEYXaQnncShNahrpKvA",
+ "object": "plan",
+ "active": true,
+ "metadata": { "group_name": "subscribers", "trial_period_days": "0" },
+ "meter": null,
+ "nickname": "EA1",
+ "product": {
+ "id": "prod_PhB6IpGhEX14Hi",
+ "object": "product",
+ "metadata": {
+ "description": "Sign up and get access to an exclusive group of enthusiasts just like you!"
+ },
+ "name": "Exclusive Access"
+ }
+ },
+ "quantity": 1,
+ "schedule": null,
+ "start_date": 1714594277,
+ "status": "canceled"
+ }
+ ],
+ "length": 2,
+ "last_record": "sub_1P9aohEYXaQnncSh4wf1wzuL"
+}
\ No newline at end of file
diff --git a/plugins/discourse-subscriptions/spec/jobs/refresh_subscriptions_campaign_data_spec.rb b/plugins/discourse-subscriptions/spec/jobs/refresh_subscriptions_campaign_data_spec.rb
new file mode 100644
index 00000000000..f692bfa9450
--- /dev/null
+++ b/plugins/discourse-subscriptions/spec/jobs/refresh_subscriptions_campaign_data_spec.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+
+RSpec.describe Jobs::RefreshSubscriptionsCampaignData do
+ before { SiteSetting.discourse_subscriptions_campaign_enabled = true }
+
+ it "should execute the job only if stripe is configured" do
+ DiscourseSubscriptions::Campaign.any_instance.expects(:refresh_data).once
+ described_class.new.execute({})
+
+ SiteSetting.discourse_subscriptions_public_key = "PUBLIC_KEY"
+ SiteSetting.discourse_subscriptions_secret_key = "SECRET_KEY"
+ described_class.new.execute({})
+ end
+end
diff --git a/plugins/discourse-subscriptions/spec/models/customer_spec.rb b/plugins/discourse-subscriptions/spec/models/customer_spec.rb
new file mode 100644
index 00000000000..a760ee067b9
--- /dev/null
+++ b/plugins/discourse-subscriptions/spec/models/customer_spec.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+
+RSpec.describe DiscourseSubscriptions::Customer do
+ let(:user) { Fabricate(:user) }
+ let(:stripe_customer) { { id: "cus_id4567" } }
+
+ it "has a table name" do
+ expect(described_class.table_name).to eq "discourse_subscriptions_customers"
+ end
+
+ it "creates" do
+ customer = described_class.create_customer(user, stripe_customer)
+ expect(customer.customer_id).to eq "cus_id4567"
+ expect(customer.user_id).to eq user.id
+ end
+
+ it "has a user scope" do
+ described_class.create_customer(user, stripe_customer)
+ customer = described_class.find_user(user)
+ expect(customer.customer_id).to eq "cus_id4567"
+ end
+end
diff --git a/plugins/discourse-subscriptions/spec/plugin_helper.rb b/plugins/discourse-subscriptions/spec/plugin_helper.rb
new file mode 100644
index 00000000000..6693a846735
--- /dev/null
+++ b/plugins/discourse-subscriptions/spec/plugin_helper.rb
@@ -0,0 +1,3 @@
+# frozen_string_literal: true
+
+Dir[Rails.root.join("plugins/discourse-subscriptions/spec/fabricators/*.rb")].each { |f| require f }
diff --git a/plugins/discourse-subscriptions/spec/requests/admin/coupons_controller_spec.rb b/plugins/discourse-subscriptions/spec/requests/admin/coupons_controller_spec.rb
new file mode 100644
index 00000000000..42fe693e43c
--- /dev/null
+++ b/plugins/discourse-subscriptions/spec/requests/admin/coupons_controller_spec.rb
@@ -0,0 +1,87 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+
+RSpec.describe DiscourseSubscriptions::Admin::CouponsController do
+ before { SiteSetting.discourse_subscriptions_enabled = true }
+
+ it "is a subclass of AdminController" do
+ expect(DiscourseSubscriptions::Admin::CouponsController < ::Admin::AdminController).to eq(true)
+ end
+
+ context "when unauthenticated" do
+ it "does nothing" do
+ ::Stripe::PromotionCode.expects(:list).never
+ get "/s/admin/coupons.json"
+ expect(response.status).to eq(404)
+ end
+ end
+
+ context "when authenticated" do
+ let(:admin) { Fabricate(:admin) }
+
+ before { sign_in(admin) }
+
+ describe "#index" do
+ it "returns a list of promo codes" do
+ ::Stripe::PromotionCode
+ .expects(:list)
+ .with({ limit: 100 })
+ .returns({ data: [{ id: "promo_123", coupon: { valid: true } }] })
+
+ get "/s/admin/coupons.json"
+ expect(response.status).to eq(200)
+ expect(response.parsed_body[0]["id"]).to eq("promo_123")
+ end
+
+ it "only returns valid promo codes" do
+ ::Stripe::PromotionCode
+ .expects(:list)
+ .with({ limit: 100 })
+ .returns({ data: [{ id: "promo_123", coupon: { valid: false } }] })
+
+ get "/s/admin/coupons.json"
+ expect(response.status).to eq(200)
+ expect(response.parsed_body).to be_blank
+ end
+ end
+
+ describe "#create" do
+ it "creates a coupon with an amount off" do
+ ::Stripe::Coupon.expects(:create).returns(id: "coup_123")
+ ::Stripe::PromotionCode.expects(:create).returns(
+ { code: "p123", coupon: { amount_off: 2000 } },
+ )
+
+ post "/s/admin/coupons.json",
+ params: {
+ promo: "p123",
+ discount_type: "amount",
+ discount: "2000",
+ active: true,
+ }
+ expect(response.status).to eq(200)
+ expect(response.parsed_body["code"]).to eq("p123")
+ expect(response.parsed_body["coupon"]["amount_off"]).to eq(2000)
+ end
+
+ it "creates a coupon with a percent off" do
+ ::Stripe::Coupon.expects(:create).returns(id: "coup_123")
+ ::Stripe::PromotionCode.expects(:create).returns(
+ { code: "p123", coupon: { percent_off: 20 } },
+ )
+
+ post "/s/admin/coupons.json",
+ params: {
+ promo: "p123",
+ discount_type: "percent",
+ discount: "20",
+ active: true,
+ }
+ expect(response.status).to eq(200)
+ expect(response.parsed_body["code"]).to eq("p123")
+ expect(response.parsed_body["coupon"]["percent_off"]).to eq(20)
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-subscriptions/spec/requests/admin/plans_controller_spec.rb b/plugins/discourse-subscriptions/spec/requests/admin/plans_controller_spec.rb
new file mode 100644
index 00000000000..73441003e44
--- /dev/null
+++ b/plugins/discourse-subscriptions/spec/requests/admin/plans_controller_spec.rb
@@ -0,0 +1,170 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+
+RSpec.describe DiscourseSubscriptions::Admin::PlansController do
+ before { SiteSetting.discourse_subscriptions_enabled = true }
+
+ it "is a subclass of AdminController" do
+ expect(DiscourseSubscriptions::Admin::PlansController < ::Admin::AdminController).to eq(true)
+ end
+
+ context "when not authenticated" do
+ describe "index" do
+ it "does not get the plans" do
+ ::Stripe::Price.expects(:list).never
+ get "/s/admin/plans.json"
+ end
+
+ it "not ok" do
+ get "/s/admin/plans.json"
+ expect(response.status).to eq 404
+ end
+ end
+
+ describe "create" do
+ it "does not create a plan" do
+ ::Stripe::Price.expects(:create).never
+ post "/s/admin/plans.json", params: { name: "Rick Astley", amount: 1, interval: "week" }
+ end
+
+ it "is not ok" do
+ post "/s/admin/plans.json", params: { name: "Rick Astley", amount: 1, interval: "week" }
+ expect(response.status).to eq 404
+ end
+ end
+
+ describe "show" do
+ it "does not show the plan" do
+ ::Stripe::Price.expects(:retrieve).never
+ get "/s/admin/plans/plan_12345.json"
+ end
+
+ it "is not ok" do
+ get "/s/admin/plans/plan_12345.json"
+ expect(response.status).to eq 404
+ end
+ end
+
+ describe "update" do
+ it "does not update a plan" do
+ ::Stripe::Price.expects(:update).never
+ delete "/s/admin/plans/plan_12345.json"
+ end
+ end
+ end
+
+ context "when authenticated" do
+ let(:admin) { Fabricate(:admin) }
+
+ before { sign_in(admin) }
+
+ describe "index" do
+ it "lists the plans" do
+ ::Stripe::Price.expects(:list).with(nil)
+ get "/s/admin/plans.json"
+ end
+
+ it "lists the plans for the product" do
+ ::Stripe::Price.expects(:list).with({ product: "prod_id123" })
+ get "/s/admin/plans.json", params: { product_id: "prod_id123" }
+ end
+ end
+
+ describe "show" do
+ it "shows a plan" do
+ ::Stripe::Price.expects(:retrieve).with("plan_12345").returns(currency: "aud")
+ get "/s/admin/plans/plan_12345.json"
+ expect(response.status).to eq 200
+ end
+
+ it "upcases the currency" do
+ ::Stripe::Price
+ .expects(:retrieve)
+ .with("plan_12345")
+ .returns(currency: "aud", recurring: { interval: "year" })
+ get "/s/admin/plans/plan_12345.json"
+
+ plan = response.parsed_body
+ expect(plan["currency"]).to eq "AUD"
+ expect(plan["interval"]).to eq "year"
+ end
+ end
+
+ describe "create" do
+ it "creates a plan with a nickname" do
+ ::Stripe::Price.expects(:create).with(has_entry(:nickname, "Veg"))
+ post "/s/admin/plans.json", params: { nickname: "Veg", metadata: { group_name: "" } }
+ end
+
+ it "creates a plan with a currency" do
+ ::Stripe::Price.expects(:create).with(has_entry(:currency, "AUD"))
+ post "/s/admin/plans.json", params: { currency: "AUD", metadata: { group_name: "" } }
+ end
+
+ it "creates a plan with an interval" do
+ ::Stripe::Price.expects(:create).with(has_entry(recurring: { interval: "week" }))
+ post "/s/admin/plans.json",
+ params: {
+ type: "recurring",
+ interval: "week",
+ metadata: {
+ group_name: "",
+ },
+ }
+ end
+
+ it "creates a plan as a one-time purchase" do
+ ::Stripe::Price.expects(:create).with(Not(has_key(:recurring)))
+ post "/s/admin/plans.json", params: { metadata: { group_name: "" } }
+ end
+
+ it "creates a plan with an amount" do
+ ::Stripe::Price.expects(:create).with(has_entry(:unit_amount, "102"))
+ post "/s/admin/plans.json", params: { amount: "102", metadata: { group_name: "" } }
+ end
+
+ it "creates a plan with a product" do
+ ::Stripe::Price.expects(:create).with(has_entry(product: "prod_walterwhite"))
+ post "/s/admin/plans.json",
+ params: {
+ product: "prod_walterwhite",
+ metadata: {
+ group_name: "",
+ },
+ }
+ end
+
+ it "creates a plan with an active status" do
+ ::Stripe::Price.expects(:create).with(has_entry(:active, "false"))
+ post "/s/admin/plans.json", params: { active: "false", metadata: { group_name: "" } }
+ end
+
+ # TODO: Need to fix the metadata tests
+ # I think mocha has issues with the metadata fields here.
+
+ #it 'has metadata' do
+ # ::Stripe::Price.expects(:create).with(has_entry(:group_name, "discourse-user-group-name"))
+ # post "/s/admin/plans.json", params: { amount: "100", metadata: { group_name: 'discourse-user-group-name' } }
+ #end
+
+ #it "creates a plan with a trial period" do
+ # ::Stripe::Price.expects(:create).with(has_entry(trial_period_days: '14'))
+ # post "/s/admin/plans.json", params: { trial_period_days: '14' }
+ #end
+ end
+
+ describe "update" do
+ it "updates a plan" do
+ ::Stripe::Price.expects(:update)
+ patch "/s/admin/plans/plan_12345.json",
+ params: {
+ trial_period_days: "14",
+ metadata: {
+ group_name: "discourse-user-group-name",
+ },
+ }
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-subscriptions/spec/requests/admin/products_controller_spec.rb b/plugins/discourse-subscriptions/spec/requests/admin/products_controller_spec.rb
new file mode 100644
index 00000000000..75ffe63a2f0
--- /dev/null
+++ b/plugins/discourse-subscriptions/spec/requests/admin/products_controller_spec.rb
@@ -0,0 +1,130 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+
+RSpec.describe DiscourseSubscriptions::Admin::ProductsController do
+ before { SiteSetting.discourse_subscriptions_enabled = true }
+
+ it "is a subclass of AdminController" do
+ expect(DiscourseSubscriptions::Admin::ProductsController < ::Admin::AdminController).to eq(true)
+ end
+
+ context "when unauthenticated" do
+ it "does not list the products" do
+ ::Stripe::Product.expects(:list).never
+ get "/s/admin/products.json"
+ expect(response.status).to eq(404)
+ end
+
+ it "does not create the product" do
+ ::Stripe::Product.expects(:create).never
+ post "/s/admin/products.json"
+ expect(response.status).to eq(404)
+ end
+
+ it "does not show the product" do
+ ::Stripe::Product.expects(:retrieve).never
+ get "/s/admin/products/prod_qwerty123.json"
+ expect(response.status).to eq(404)
+ end
+
+ it "does not update the product" do
+ ::Stripe::Product.expects(:update).never
+ put "/s/admin/products/prod_qwerty123.json"
+ expect(response.status).to eq(404)
+ end
+
+ it "does not delete the product" do
+ ::Stripe::Product.expects(:delete).never
+ delete "/s/admin/products/u2.json"
+ expect(response.status).to eq(404)
+ end
+ end
+
+ context "when authenticated" do
+ let(:admin) { Fabricate(:admin) }
+
+ before { sign_in(admin) }
+
+ describe "index" do
+ it "gets the empty products" do
+ SiteSetting.discourse_subscriptions_public_key = "public-key"
+ SiteSetting.discourse_subscriptions_secret_key = "secret-key"
+ get "/s/admin/products.json"
+ expect(response.parsed_body).to be_empty
+ end
+ end
+
+ describe "create" do
+ it "is of product type service" do
+ ::Stripe::Product.expects(:create).with(has_entry(:type, "service"))
+ post "/s/admin/products.json", params: {}
+ end
+
+ it "has a name" do
+ ::Stripe::Product.expects(:create).with(has_entry(:name, "Jesse Pinkman"))
+ post "/s/admin/products.json", params: { name: "Jesse Pinkman" }
+ end
+
+ it "has an active attribute" do
+ ::Stripe::Product.expects(:create).with(has_entry(active: "false"))
+ post "/s/admin/products.json", params: { active: "false" }
+ end
+
+ it "has a statement descriptor" do
+ ::Stripe::Product.expects(:create).with(
+ has_entry(statement_descriptor: "Blessed are the cheesemakers"),
+ )
+ post "/s/admin/products.json",
+ params: {
+ statement_descriptor: "Blessed are the cheesemakers",
+ }
+ end
+
+ it "has no statement descriptor if empty" do
+ ::Stripe::Product.expects(:create).with(has_key(:statement_descriptor)).never
+ post "/s/admin/products.json", params: { statement_descriptor: "" }
+ end
+
+ it "has metadata" do
+ ::Stripe::Product.expects(:create).with(
+ has_entry(
+ metadata: {
+ description: "Oi, I think he just said bless be all the bignoses!",
+ repurchaseable: "false",
+ },
+ ),
+ )
+
+ post "/s/admin/products.json",
+ params: {
+ metadata: {
+ description: "Oi, I think he just said bless be all the bignoses!",
+ repurchaseable: "false",
+ },
+ }
+ end
+ end
+
+ describe "show" do
+ it "retrieves the product" do
+ ::Stripe::Product.expects(:retrieve).with("prod_walterwhite")
+ get "/s/admin/products/prod_walterwhite.json"
+ end
+ end
+
+ describe "update" do
+ it "updates the product" do
+ ::Stripe::Product.expects(:update)
+ patch "/s/admin/products/prod_walterwhite.json", params: {}
+ end
+ end
+
+ describe "delete" do
+ it "deletes the product" do
+ ::Stripe::Product.expects(:delete).with("prod_walterwhite")
+ delete "/s/admin/products/prod_walterwhite.json"
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-subscriptions/spec/requests/admin/subscriptions_controller_spec.rb b/plugins/discourse-subscriptions/spec/requests/admin/subscriptions_controller_spec.rb
new file mode 100644
index 00000000000..fb371efde7b
--- /dev/null
+++ b/plugins/discourse-subscriptions/spec/requests/admin/subscriptions_controller_spec.rb
@@ -0,0 +1,144 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+
+RSpec.describe DiscourseSubscriptions::Admin::SubscriptionsController do
+ before { SiteSetting.discourse_subscriptions_enabled = true }
+
+ it "is a subclass of AdminController" do
+ expect(DiscourseSubscriptions::Admin::SubscriptionsController < ::Admin::AdminController).to eq(
+ true,
+ )
+ end
+
+ let(:user) { Fabricate(:user) }
+ let(:customer) do
+ Fabricate(:customer, user_id: user.id, customer_id: "c_123", product_id: "pr_34578")
+ end
+
+ before do
+ Fabricate(:subscription, external_id: "sub_12345", customer_id: customer.id)
+ Fabricate(:subscription, external_id: "sub_77777", customer_id: customer.id)
+ end
+
+ context "when unauthenticated" do
+ it "does nothing" do
+ ::Stripe::Subscription.expects(:list).never
+ get "/s/admin/subscriptions.json"
+ expect(response.status).to eq(404)
+ end
+
+ it "does not destroy a subscription" do
+ ::Stripe::Subscription.expects(:delete).never
+ patch "/s/admin/subscriptions/sub_12345.json"
+ end
+ end
+
+ context "when authenticated" do
+ let(:admin) { Fabricate(:admin) }
+
+ before { sign_in(admin) }
+
+ describe "index" do
+ before do
+ SiteSetting.discourse_subscriptions_public_key = "public-key"
+ SiteSetting.discourse_subscriptions_secret_key = "secret-key"
+ end
+
+ it "gets the subscriptions and products" do
+ ::Stripe::Subscription
+ .expects(:list)
+ .with(expand: ["data.plan.product"], limit: 10, starting_after: nil, status: "all")
+ .returns(has_more: false, data: [{ id: "sub_12345" }, { id: "sub_nope" }])
+ get "/s/admin/subscriptions.json"
+ subscriptions = response.parsed_body["data"][0]["id"]
+
+ expect(response.status).to eq(200)
+ expect(subscriptions).to eq("sub_12345")
+ end
+
+ it "handles starting at a different point in the set" do
+ ::Stripe::Subscription
+ .expects(:list)
+ .with(expand: ["data.plan.product"], limit: 10, starting_after: "sub_nope", status: "all")
+ .returns(has_more: false, data: [{ id: "sub_77777" }, { id: "sub_yepnoep" }])
+ get "/s/admin/subscriptions.json", params: { last_record: "sub_nope" }
+ subscriptions = response.parsed_body["data"][0]["id"]
+
+ expect(response.status).to eq(200)
+ expect(subscriptions).to eq("sub_77777")
+ end
+ end
+
+ describe "destroy" do
+ let(:group) { Fabricate(:group, name: "subscribers") }
+
+ before { group.add(user) }
+
+ it "deletes a customer" do
+ ::Stripe::Subscription
+ .expects(:cancel)
+ .with("sub_12345")
+ .returns(plan: { product: "pr_34578" }, customer: "c_123")
+
+ # We don't want to delete the customer record. The webhook hook will update the status instead.
+ expect { delete "/s/admin/subscriptions/sub_12345.json" }.not_to change {
+ DiscourseSubscriptions::Customer.count
+ }
+ end
+
+ it "removes the user from the group" do
+ ::Stripe::Subscription
+ .expects(:cancel)
+ .with("sub_12345")
+ .returns(
+ plan: {
+ product: "pr_34578",
+ metadata: {
+ group_name: "subscribers",
+ },
+ },
+ customer: "c_123",
+ )
+
+ expect { delete "/s/admin/subscriptions/sub_12345.json" }.to change {
+ user.groups.count
+ }.by(-1)
+ end
+
+ it "does not remove the user from the group" do
+ ::Stripe::Subscription
+ .expects(:cancel)
+ .with("sub_12345")
+ .returns(
+ plan: {
+ product: "pr_34578",
+ metadata: {
+ group_name: "group_does_not_exist",
+ },
+ },
+ customer: "c_123",
+ )
+
+ expect { delete "/s/admin/subscriptions/sub_12345.json" }.not_to change {
+ user.groups.count
+ }
+ end
+
+ it "refunds if params[:refund] present" do
+ ::Stripe::Subscription
+ .expects(:cancel)
+ .with("sub_12345")
+ .returns(plan: { product: "pr_34578" }, customer: "c_123")
+ ::Stripe::Subscription
+ .expects(:retrieve)
+ .with("sub_12345")
+ .returns(latest_invoice: "in_123")
+ ::Stripe::Invoice.expects(:retrieve).with("in_123").returns(payment_intent: "pi_123")
+ ::Stripe::Refund.expects(:create).with({ payment_intent: "pi_123" })
+
+ delete "/s/admin/subscriptions/sub_12345.json", params: { refund: true }
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-subscriptions/spec/requests/admin_controller_spec.rb b/plugins/discourse-subscriptions/spec/requests/admin_controller_spec.rb
new file mode 100644
index 00000000000..42779ba3c17
--- /dev/null
+++ b/plugins/discourse-subscriptions/spec/requests/admin_controller_spec.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+
+RSpec.describe DiscourseSubscriptions::AdminController do
+ let(:admin) { Fabricate(:admin) }
+
+ before do
+ sign_in(admin)
+ SiteSetting.discourse_subscriptions_enabled = true
+ end
+
+ it "is a subclass of AdminController" do
+ expect(DiscourseSubscriptions::AdminController < ::Admin::AdminController).to eq(true)
+ end
+
+ it "is ok" do
+ get "/s/admin.json"
+ expect(response.status).to eq(200)
+ end
+end
diff --git a/plugins/discourse-subscriptions/spec/requests/hooks_controller_spec.rb b/plugins/discourse-subscriptions/spec/requests/hooks_controller_spec.rb
new file mode 100644
index 00000000000..3abf8309608
--- /dev/null
+++ b/plugins/discourse-subscriptions/spec/requests/hooks_controller_spec.rb
@@ -0,0 +1,344 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+
+RSpec.describe DiscourseSubscriptions::HooksController do
+ before do
+ SiteSetting.discourse_subscriptions_webhook_secret = "zascharoo"
+ SiteSetting.discourse_subscriptions_enabled = true
+ end
+
+ it "constructs a webhook event" do
+ payload = "we-want-a-shrubbery"
+ headers = { HTTP_STRIPE_SIGNATURE: "stripe-webhook-signature" }
+
+ ::Stripe::Webhook
+ .expects(:construct_event)
+ .with("we-want-a-shrubbery", "stripe-webhook-signature", "zascharoo")
+ .returns(type: "something")
+
+ post "/s/hooks.json", params: payload, headers: headers
+
+ expect(response.status).to eq 200
+ end
+
+ describe "event types" do
+ let(:user) { Fabricate(:user) }
+ let(:customer) do
+ Fabricate(:customer, customer_id: "c_575768", product_id: "p_8654", user_id: user.id)
+ end
+ let!(:subscription) do
+ Fabricate(:subscription, external_id: "sub_12345", customer_id: customer.id, status: nil)
+ end
+ let(:group) { Fabricate(:group, name: "subscribers-group") }
+
+ let(:event_data) do
+ {
+ object: {
+ customer: customer.customer_id,
+ plan: {
+ product: customer.product_id,
+ metadata: {
+ group_name: group.name,
+ },
+ },
+ },
+ }
+ end
+
+ let(:customer_subscription_deleted_data) do
+ {
+ object: {
+ id: subscription.external_id,
+ customer: customer.customer_id,
+ plan: {
+ product: customer.product_id,
+ metadata: {
+ group_name: group.name,
+ },
+ },
+ status: "canceled",
+ },
+ }
+ end
+
+ let(:checkout_session_completed_data) do
+ {
+ object: {
+ id: "cs_test_a1ENei5A9TGOaEketyV5qweiQR5CyJWHT5j8T3HheQY3uah3RxzKttVUKZ",
+ object: "checkout.session",
+ customer: customer.customer_id,
+ customer_email: user.email,
+ invoice: "in_1P9b7iEYXaQnncSh81AQtuHD",
+ metadata: {
+ },
+ mode: "subscription",
+ payment_status: "paid",
+ status: "complete",
+ submit_type: nil,
+ subscription: "sub_1P9b7iEYXaQnncSh3H3G9d2Y",
+ success_url: "http://localhost:4200/my/billing/subscriptions",
+ url: nil,
+ },
+ }
+ end
+
+ let(:checkout_session_completed_data_one_off) do
+ {
+ object: {
+ id: "cs_test_a1ENei5A9TGOaEketyV5qweiQR5CyJWHT5j8T3HheQY3uah3RxzKttVUKZ",
+ object: "checkout.session",
+ customer: nil,
+ customer_email: user.email,
+ invoice: nil,
+ metadata: {
+ },
+ mode: "subscription",
+ payment_intent: "pi_3PsohkGHcn",
+ payment_status: "paid",
+ status: "complete",
+ submit_type: nil,
+ subscription: nil,
+ success_url: "http://localhost:4200/my/billing/subscriptions",
+ url: nil,
+ },
+ }
+ end
+
+ let(:checkout_session_completed_bad_data) do
+ {
+ object: {
+ id: "cs_test_a1ENei5A9TGOaEketyV5qweiQR5CyJWHT5j8T3HheQY3uah3RxzKttVUKZ",
+ object: "checkout.session",
+ customer: nil,
+ customer_email: nil,
+ invoice: "in_1P9b7iEYXaQnncSh81AQtuHD",
+ metadata: {
+ },
+ mode: "subscription",
+ payment_status: "paid",
+ status: "complete",
+ submit_type: nil,
+ subscription: nil,
+ success_url: "http://localhost:4200/my/billing/subscriptions",
+ url: nil,
+ },
+ }
+ end
+
+ let(:list_line_items_data) do
+ {
+ data: [
+ {
+ id: "li_1P9YlFEYXaQnncShFBl7r0na",
+ object: "item",
+ description: "Exclusive Access",
+ price: {
+ id: "price_1OrmlvEYXaQnncShNahrpKvA",
+ metadata: {
+ group_name: group.name,
+ trial_period_days: "0",
+ },
+ nickname: "EA1",
+ product: "prod_PhB6IpGhEX14Hi",
+ },
+ },
+ ],
+ }
+ end
+
+ describe "checkout.session.completed" do
+ before do
+ event = { type: "checkout.session.completed", data: checkout_session_completed_data }
+ ::Stripe::Checkout::Session
+ .stubs(:list_line_items)
+ .with(checkout_session_completed_data[:object][:id], { limit: 1 })
+ .returns(list_line_items_data)
+
+ ::Stripe::Subscription
+ .stubs(:update)
+ .with(
+ checkout_session_completed_data[:object][:subscription],
+ { metadata: { user_id: user.id, username: user.username } },
+ )
+ .returns(
+ {
+ id: checkout_session_completed_data[:object][:subscription],
+ object: "subscription",
+ metadata: {
+ user_id: user.id.to_s,
+ username: user.username,
+ },
+ },
+ )
+
+ ::Stripe::Webhook.stubs(:construct_event).returns(event)
+ end
+
+ it "is successfull" do
+ post "/s/hooks.json"
+ expect(response.status).to eq 200
+ end
+
+ describe "completing the subscription" do
+ it "adds the user to the group when completing the transaction" do
+ expect { post "/s/hooks.json" }.to change { user.groups.count }.by(1)
+
+ expect(response.status).to eq 200
+ end
+ end
+ end
+
+ describe "checkout.session.completed with bad data" do
+ before do
+ event = { type: "checkout.session.completed", data: checkout_session_completed_bad_data }
+ ::Stripe::Checkout::Session
+ .stubs(:list_line_items)
+ .with(checkout_session_completed_data[:object][:id], { limit: 1 })
+ .returns(list_line_items_data)
+
+ ::Stripe::Webhook.stubs(:construct_event).returns(event)
+ ::Stripe::Customer.stubs(:create).returns(id: "cus_1234")
+ end
+
+ it "is returns 422" do
+ post "/s/hooks.json"
+ expect(response.status).to eq 422
+ end
+ end
+
+ describe "checkout.session.completed for one-off purchase" do
+ before do
+ event = {
+ type: "checkout.session.completed",
+ data: checkout_session_completed_data_one_off,
+ }
+ ::Stripe::Checkout::Session
+ .stubs(:list_line_items)
+ .with(checkout_session_completed_data[:object][:id], { limit: 1 })
+ .returns(list_line_items_data)
+
+ ::Stripe::Webhook.stubs(:construct_event).returns(event)
+ ::Stripe::Customer.stubs(:create).returns(id: "cus_1234")
+ end
+
+ it "is returns 200" do
+ expect { post "/s/hooks.json" }.to change { user.groups.count }.by(1)
+ expect(response.status).to eq 200
+ end
+ end
+
+ describe "checkout.session.completed with anonymous user" do
+ before do
+ checkout_session_completed_bad_data[:object][:customer_email] = "[email protected]"
+ data = checkout_session_completed_bad_data
+ event = { type: "checkout.session.completed", data: data }
+ ::Stripe::Checkout::Session
+ .stubs(:list_line_items)
+ .with(checkout_session_completed_data[:object][:id], { limit: 1 })
+ .returns(list_line_items_data)
+
+ ::Stripe::Webhook.stubs(:construct_event).returns(event)
+ ::Stripe::Customer.stubs(:create).returns(id: "cus_1234")
+ end
+
+ it "is returns 422" do
+ post "/s/hooks.json"
+ expect(response.status).to eq 422
+ end
+ end
+
+ describe "checkout.session.completed with no customer email" do
+ before do
+ checkout_session_completed_bad_data[:object][:customer_email] = nil
+ data = checkout_session_completed_bad_data
+ event = { type: "checkout.session.completed", data: data }
+ ::Stripe::Checkout::Session
+ .stubs(:list_line_items)
+ .with(checkout_session_completed_data[:object][:id], { limit: 1 })
+ .returns(list_line_items_data)
+
+ ::Stripe::Webhook.stubs(:construct_event).returns(event)
+ end
+
+ it "is returns 422" do
+ post "/s/hooks.json"
+ expect(response.status).to eq 422
+ end
+ end
+
+ describe "customer.subscription.updated" do
+ before do
+ event = { type: "customer.subscription.updated", data: event_data }
+
+ ::Stripe::Webhook.stubs(:construct_event).returns(event)
+ end
+
+ it "is successfull" do
+ post "/s/hooks.json"
+ expect(response.status).to eq 200
+ end
+
+ describe "completing the subscription" do
+ it "does not add the user to the group" do
+ event_data[:object][:status] = "incomplete"
+ event_data[:previous_attributes] = { status: "incomplete" }
+
+ expect { post "/s/hooks.json" }.not_to change { user.groups.count }
+
+ expect(response.status).to eq 200
+ end
+
+ it "does not add the user to the group" do
+ event_data[:object][:status] = "incomplete"
+ event_data[:previous_attributes] = { status: "something-else" }
+
+ expect { post "/s/hooks.json" }.not_to change { user.groups.count }
+
+ expect(response.status).to eq 200
+ end
+
+ it "adds the user to the group when completing the transaction" do
+ event_data[:object][:status] = "complete"
+ event_data[:previous_attributes] = { status: "incomplete" }
+
+ expect { post "/s/hooks.json" }.to change { user.groups.count }.by(1)
+
+ expect(response.status).to eq 200
+ end
+
+ it "adds the user to the group when status is active" do
+ event_data[:object][:status] = "active"
+
+ expect { post "/s/hooks.json" }.to change { user.groups.count }.by(1)
+
+ expect(response.status).to eq 200
+ end
+ end
+ end
+
+ describe "customer.subscription.deleted" do
+ before do
+ event = { type: "customer.subscription.deleted", data: customer_subscription_deleted_data }
+
+ ::Stripe::Webhook.stubs(:construct_event).returns(event)
+
+ group.add(user)
+ end
+
+ it "deletes the customer" do
+ expect { post "/s/hooks.json" }.to change {
+ DiscourseSubscriptions::Subscription.where(status: "canceled").count
+ }.by(+1)
+
+ expect(response.status).to eq 200
+ end
+
+ it "removes the user from the group" do
+ expect { post "/s/hooks.json" }.to change { user.groups.count }.by(-1)
+
+ expect(response.status).to eq 200
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-subscriptions/spec/requests/subscribe_controller_spec.rb b/plugins/discourse-subscriptions/spec/requests/subscribe_controller_spec.rb
new file mode 100644
index 00000000000..8392cd1e05f
--- /dev/null
+++ b/plugins/discourse-subscriptions/spec/requests/subscribe_controller_spec.rb
@@ -0,0 +1,691 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+
+RSpec.describe DiscourseSubscriptions::SubscribeController do
+ let(:user) { Fabricate(:user) }
+ let(:campaign_user) { Fabricate(:user) }
+
+ before { SiteSetting.discourse_subscriptions_enabled = true }
+
+ context "when showing products" do
+ let(:product) do
+ {
+ id: "prodct_23456",
+ name: "Very Special Product",
+ metadata: {
+ description:
+ "Many people listened to my phone call with the Ukrainian President while it was being made",
+ repurchaseable: false,
+ },
+ otherstuff: true,
+ }
+ end
+
+ let(:prices) do
+ {
+ data: [
+ {
+ id: "plan_id123",
+ unit_amount: 1220,
+ currency: "aud",
+ recurring: {
+ interval: "year",
+ },
+ metadata: {
+ },
+ },
+ {
+ id: "plan_id234",
+ unit_amount: 1399,
+ currency: "usd",
+ recurring: {
+ interval: "year",
+ },
+ metadata: {
+ },
+ },
+ {
+ id: "plan_id678",
+ unit_amount: 1000,
+ currency: "aud",
+ recurring: {
+ interval: "week",
+ },
+ metadata: {
+ },
+ },
+ ],
+ }
+ end
+
+ let(:product_ids) { ["prodct_23456"] }
+
+ before do
+ sign_in(user)
+ Fabricate(:product, external_id: "prodct_23456")
+ SiteSetting.discourse_subscriptions_public_key = "public-key"
+ SiteSetting.discourse_subscriptions_secret_key = "secret-key"
+ end
+
+ describe "#index" do
+ let(:customer) do
+ Fabricate(:customer, product_id: product[:id], user_id: user.id, customer_id: "x")
+ end
+
+ it "gets products" do
+ ::Stripe::Product
+ .expects(:list)
+ .with({ ids: product_ids, active: true })
+ .returns(data: [product])
+
+ get "/s.json"
+
+ expect(response.parsed_body).to eq(
+ [
+ {
+ "id" => "prodct_23456",
+ "name" => "Very Special Product",
+ "description" =>
+ PrettyText.cook(
+ "Many people listened to my phone call with the Ukrainian President while it was being made",
+ ),
+ "subscribed" => false,
+ "repurchaseable" => false,
+ },
+ ],
+ )
+ end
+
+ it "is subscribed" do
+ Fabricate(:subscription, external_id: "sub_12345", customer_id: customer.id, status: nil)
+
+ ::Stripe::Product
+ .expects(:list)
+ .with({ ids: product_ids, active: true })
+ .returns(data: [product])
+
+ get "/s.json"
+ data = response.parsed_body
+ expect(data.first["subscribed"]).to eq true
+ end
+
+ it "is not subscribed" do
+ ::DiscourseSubscriptions::Customer.delete_all
+ ::Stripe::Product
+ .expects(:list)
+ .with({ ids: product_ids, active: true })
+ .returns(data: [product])
+
+ get "/s.json"
+ data = response.parsed_body
+ expect(data.first["subscribed"]).to eq false
+ end
+ end
+
+ describe "#get_contributors" do
+ before do
+ Fabricate(:product, external_id: "prod_campaign")
+ Fabricate(:customer, product_id: "prodct_23456", user_id: user.id, customer_id: "x")
+ Fabricate(
+ :customer,
+ product_id: "prod_campaign",
+ user_id: campaign_user.id,
+ customer_id: "y",
+ )
+ end
+ context "when not showing contributors" do
+ it "returns nothing if not set to show contributors" do
+ SiteSetting.discourse_subscriptions_campaign_show_contributors = false
+ get "/s/contributors.json"
+
+ data = response.parsed_body
+ expect(data).to be_empty
+ end
+ end
+
+ context "when showing contributors" do
+ before { SiteSetting.discourse_subscriptions_campaign_show_contributors = true }
+
+ it "filters users by campaign product if set" do
+ SiteSetting.discourse_subscriptions_campaign_product = "prod_campaign"
+
+ get "/s/contributors.json"
+
+ data = response.parsed_body
+ expect(data.first["id"]).to eq campaign_user.id
+ expect(data.length).to eq 1
+ end
+
+ it "shows all purchases if campaign product not set" do
+ SiteSetting.discourse_subscriptions_campaign_product = nil
+
+ get "/s/contributors.json"
+
+ data = response.parsed_body
+ expect(data.length).to eq 2
+ end
+ end
+ end
+
+ describe "#show" do
+ it "retrieves the product" do
+ ::Stripe::Product.expects(:retrieve).with("prod_walterwhite").returns(product)
+ ::Stripe::Price
+ .expects(:list)
+ .with(active: true, product: "prod_walterwhite")
+ .returns(prices)
+ get "/s/prod_walterwhite.json"
+
+ expect(response.parsed_body).to eq(
+ {
+ "product" => {
+ "id" => "prodct_23456",
+ "name" => "Very Special Product",
+ "description" =>
+ PrettyText.cook(
+ "Many people listened to my phone call with the Ukrainian President while it was being made",
+ ),
+ "subscribed" => false,
+ "repurchaseable" => false,
+ },
+ "plans" => [
+ {
+ "currency" => "aud",
+ "id" => "plan_id123",
+ "recurring" => {
+ "interval" => "year",
+ },
+ "unit_amount" => 1220,
+ },
+ {
+ "currency" => "usd",
+ "id" => "plan_id234",
+ "recurring" => {
+ "interval" => "year",
+ },
+ "unit_amount" => 1399,
+ },
+ {
+ "currency" => "aud",
+ "id" => "plan_id678",
+ "recurring" => {
+ "interval" => "week",
+ },
+ "unit_amount" => 1000,
+ },
+ ],
+ },
+ )
+ end
+ end
+ end
+
+ context "when creating subscriptions" do
+ context "when unauthenticated" do
+ it "does not create a subscription" do
+ ::Stripe::Customer.expects(:create).never
+ ::Stripe::Price.expects(:retrieve).never
+ ::Stripe::Subscription.expects(:create).never
+ post "/s/create.json", params: { plan: "plan_1234", source: "tok_1234" }
+ end
+ end
+
+ context "when authenticated" do
+ before { sign_in(user) }
+
+ describe "#create" do
+ before { ::Stripe::Customer.expects(:create).returns(id: "cus_1234") }
+
+ it "creates a subscription without automatic_tax param" do
+ SiteSetting.discourse_subscriptions_enable_automatic_tax = false
+ ::Stripe::Price.expects(:retrieve).returns(
+ type: "recurring",
+ product: "product_12345",
+ metadata: {
+ group_name: "awesome",
+ trial_period_days: 0,
+ },
+ )
+
+ expected_subscription_params = {
+ customer: "cus_1234",
+ items: [{ price: "plan_1234" }],
+ metadata: {
+ user_id: user.id,
+ username: user.username_lower,
+ },
+ trial_period_days: 0,
+ promotion_code: nil,
+ }
+
+ ::Stripe::Subscription
+ .expects(:create)
+ .with do |params|
+ params == expected_subscription_params && !params.key?(:automatic_tax)
+ end
+ .returns(status: "active", customer: "cus_1234")
+
+ expect {
+ post "/s/create.json", params: { plan: "plan_1234", source: "tok_1234" }
+ }.to change { DiscourseSubscriptions::Customer.count }
+ end
+
+ it "creates a subscription with automatic tax" do
+ SiteSetting.discourse_subscriptions_enable_automatic_tax = true
+ ::Stripe::Price.expects(:retrieve).returns(
+ type: "recurring",
+ product: "product_12345",
+ metadata: {
+ group_name: "awesome",
+ trial_period_days: 0,
+ },
+ )
+
+ expected_subscription_params = {
+ customer: "cus_1234",
+ items: [{ price: "plan_1234" }],
+ metadata: {
+ user_id: user.id,
+ username: user.username_lower,
+ },
+ trial_period_days: 0,
+ promotion_code: nil,
+ automatic_tax: {
+ enabled: true,
+ },
+ }
+
+ ::Stripe::Subscription
+ .expects(:create)
+ .with(expected_subscription_params)
+ .returns(status: "active", customer: "cus_1234")
+
+ expect {
+ post "/s/create.json", params: { plan: "plan_1234", source: "tok_1234" }
+ }.to change { DiscourseSubscriptions::Customer.count }
+ end
+
+ it "returns 422 on a one time payment subscription error" do
+ # It's possible that the invoice item doesn't get attached
+ # to the invoice. This means the invoice is paid, but for $0.00 with
+ # a pending invoice item.
+ ::Stripe::Price.expects(:retrieve).returns(
+ type: "one_time",
+ product: "product_12345",
+ metadata: {
+ group_name: "awesome",
+ },
+ )
+
+ ::Stripe::InvoiceItem.expects(:create)
+
+ ::Stripe::Invoice.expects(:create).returns(status: "open", id: "in_123")
+
+ ::Stripe::Invoice.expects(:finalize_invoice).returns(
+ id: "in_123",
+ status: "paid",
+ payment_intent: "pi_123",
+ )
+
+ expect {
+ post "/s/create.json", params: { plan: "plan_1234", source: "tok_1234" }
+ }.not_to change { DiscourseSubscriptions::Customer.count }
+
+ expect(response.status).to eq 422
+ end
+
+ it "creates a one time payment subscription without automatic tax" do
+ SiteSetting.discourse_subscriptions_enable_automatic_tax = false
+ ::Stripe::Price.expects(:retrieve).returns(
+ type: "one_time",
+ product: "product_12345",
+ metadata: {
+ group_name: "awesome",
+ },
+ )
+
+ ::Stripe::InvoiceItem.expects(:create)
+
+ expected_one_time_params = { customer: "cus_1234" }
+
+ ::Stripe::Invoice
+ .expects(:create)
+ .with { |params| params == expected_one_time_params && !params.key?(:automatic_tax) }
+ .returns(status: "open", id: "in_123")
+
+ ::Stripe::Invoice.expects(:finalize_invoice).returns(
+ id: "in_123",
+ status: "open",
+ payment_intent: "pi_123",
+ )
+
+ ::Stripe::Invoice.expects(:retrieve).returns(
+ id: "in_123",
+ status: "open",
+ payment_intent: "pi_123",
+ )
+
+ ::Stripe::PaymentIntent.expects(:retrieve).returns(status: "successful")
+
+ ::Stripe::Invoice.expects(:pay).returns(status: "paid", customer: "cus_1234")
+
+ expect {
+ post "/s/create.json", params: { plan: "plan_1234", source: "tok_1234" }
+ }.to change { DiscourseSubscriptions::Customer.count }
+ end
+
+ it "creates a one time payment subscription" do
+ SiteSetting.discourse_subscriptions_enable_automatic_tax = true
+ ::Stripe::Price.expects(:retrieve).returns(
+ type: "one_time",
+ product: "product_12345",
+ metadata: {
+ group_name: "awesome",
+ },
+ )
+
+ ::Stripe::InvoiceItem.expects(:create)
+
+ expected_one_time_params = { customer: "cus_1234", automatic_tax: { enabled: true } }
+
+ ::Stripe::Invoice
+ .expects(:create)
+ .with(expected_one_time_params)
+ .returns(status: "open", id: "in_123")
+
+ ::Stripe::Invoice.expects(:finalize_invoice).returns(
+ id: "in_123",
+ status: "open",
+ payment_intent: "pi_123",
+ )
+
+ ::Stripe::Invoice.expects(:retrieve).returns(
+ id: "in_123",
+ status: "open",
+ payment_intent: "pi_123",
+ )
+
+ ::Stripe::PaymentIntent.expects(:retrieve).returns(status: "successful")
+
+ ::Stripe::Invoice.expects(:pay).returns(status: "paid", customer: "cus_1234")
+
+ expect {
+ post "/s/create.json", params: { plan: "plan_1234", source: "tok_1234" }
+ }.to change { DiscourseSubscriptions::Customer.count }
+ end
+
+ it "creates a customer model" do
+ ::Stripe::Price.expects(:retrieve).returns(type: "recurring", metadata: {}).twice
+ ::Stripe::Subscription.expects(:create).returns(status: "active", customer: "cus_1234")
+
+ expect {
+ post "/s/create.json", params: { plan: "plan_1234", source: "tok_1234" }
+ }.to change { DiscourseSubscriptions::Customer.count }
+
+ ::Stripe::Customer.expects(:retrieve).with("cus_1234")
+
+ expect {
+ post "/s/create.json", params: { plan: "plan_5678", source: "tok_5678" }
+ }.not_to change { DiscourseSubscriptions::Customer.count }
+ end
+
+ context "with customer name & address" do
+ it "creates a customer & subscription when a customer address is provided" do
+ ::Stripe::Price.expects(:retrieve).returns(type: "recurring", metadata: {})
+ ::Stripe::Subscription.expects(:create).returns(status: "active", customer: "cus_1234")
+ expect {
+ post "/s/create.json",
+ params: {
+ plan: "plan_1234",
+ source: "tok_1234",
+ cardholder_name: "A. Customer",
+ cardholder_address: {
+ line1: "123 Main Street",
+ city: "Anywhere",
+ state: "VT",
+ country: "US",
+ postal_code: "12345",
+ },
+ }
+ }.to change { DiscourseSubscriptions::Customer.count }
+ end
+ end
+
+ context "with promo code" do
+ context "with invalid code" do
+ it "prevents use of invalid coupon codes" do
+ ::Stripe::Price.expects(:retrieve).returns(
+ type: "recurring",
+ product: "product_12345",
+ metadata: {
+ group_name: "awesome",
+ trial_period_days: 0,
+ },
+ )
+
+ ::Stripe::PromotionCode.expects(:list).with({ code: "invalid" }).returns(data: [])
+
+ post "/s/create.json",
+ params: {
+ plan: "plan_1234",
+ source: "tok_1234",
+ promo: "invalid",
+ }
+
+ data = response.parsed_body
+ expect(data["errors"]).not_to be_blank
+ end
+ end
+
+ context "with valid code" do
+ before do
+ ::Stripe::PromotionCode
+ .expects(:list)
+ .with({ code: "123" })
+ .returns(data: [{ id: "promo123", coupon: { id: "c123" } }])
+ end
+
+ it "applies promo code to recurring subscription" do
+ ::Stripe::Price.expects(:retrieve).returns(
+ type: "recurring",
+ product: "product_12345",
+ metadata: {
+ group_name: "awesome",
+ trial_period_days: 0,
+ },
+ )
+
+ expected_subscription_params = {
+ customer: "cus_1234",
+ items: [price: "plan_1234"],
+ metadata: {
+ user_id: user.id,
+ username: user.username_lower,
+ },
+ trial_period_days: 0,
+ promotion_code: "promo123",
+ }
+
+ ::Stripe::Subscription
+ .expects(:create)
+ .with(expected_subscription_params)
+ .returns(status: "active", customer: "cus_1234")
+
+ expect {
+ post "/s/create.json",
+ params: {
+ plan: "plan_1234",
+ source: "tok_1234",
+ promo: "123",
+ }
+ }.to change { DiscourseSubscriptions::Customer.count }
+ end
+
+ it "applies promo code to one time purchase" do
+ ::Stripe::Price.expects(:retrieve).returns(
+ type: "one_time",
+ product: "product_12345",
+ metadata: {
+ group_name: "awesome",
+ },
+ )
+
+ ::Stripe::Invoice.expects(:create).returns(status: "open", id: "in_123")
+
+ ::Stripe::InvoiceItem.expects(:create).with(
+ customer: "cus_1234",
+ price: "plan_1234",
+ discounts: [{ coupon: "c123" }],
+ invoice: "in_123",
+ )
+
+ ::Stripe::Invoice.expects(:finalize_invoice).returns(
+ id: "in_123",
+ status: "open",
+ payment_intent: "pi_123",
+ )
+
+ ::Stripe::Invoice.expects(:retrieve).returns(
+ id: "in_123",
+ status: "open",
+ payment_intent: "pi_123",
+ )
+
+ ::Stripe::PaymentIntent.expects(:retrieve).returns(status: "successful")
+
+ ::Stripe::Invoice.expects(:pay).returns(status: "paid", customer: "cus_1234")
+
+ expect {
+ post "/s/create.json",
+ params: {
+ plan: "plan_1234",
+ source: "tok_1234",
+ promo: "123",
+ }
+ }.to change { DiscourseSubscriptions::Customer.count }
+ end
+ end
+ end
+ end
+
+ describe "#finalize strong customer authenticated transaction" do
+ context "with subscription" do
+ it "finalizes the subscription" do
+ ::Stripe::Price.expects(:retrieve).returns(
+ id: "plan_1234",
+ product: "prod_1234",
+ metadata: {
+ },
+ )
+ ::Stripe::Subscription.expects(:retrieve).returns(
+ id: "sub_123",
+ customer: "cus_1234",
+ status: "active",
+ )
+
+ expect {
+ post "/s/finalize.json", params: { plan: "plan_1234", transaction: "sub_1234" }
+ }.to change { DiscourseSubscriptions::Customer.count }
+ end
+ end
+
+ context "with one-time payment" do
+ it "finalizes the one-time payment" do
+ ::Stripe::Price.expects(:retrieve).returns(
+ id: "plan_1234",
+ product: "prod_1234",
+ metadata: {
+ },
+ )
+ ::Stripe::Invoice.expects(:retrieve).returns(
+ id: "in_123",
+ customer: "cus_1234",
+ status: "paid",
+ )
+
+ expect {
+ post "/s/finalize.json", params: { plan: "plan_1234", transaction: "in_1234" }
+ }.to change { DiscourseSubscriptions::Customer.count }
+ end
+ end
+ end
+
+ describe "user groups" do
+ let(:group_name) { "group-123" }
+ let(:group) { Fabricate(:group, name: group_name) }
+
+ context "with unauthorized group" do
+ before do
+ ::Stripe::Customer.expects(:create).returns(id: "cus_1234")
+ ::Stripe::Subscription.expects(:create).returns(status: "active")
+ end
+
+ it "does not add the user to the admins group" do
+ ::Stripe::Price.expects(:retrieve).returns(
+ type: "recurring",
+ metadata: {
+ group_name: "admins",
+ },
+ )
+ post "/s/create.json", params: { plan: "plan_1234", source: "tok_1234" }
+ expect(user.admin).to eq false
+ end
+
+ it "does not add the user to other group" do
+ ::Stripe::Price.expects(:retrieve).returns(
+ type: "recurring",
+ metadata: {
+ group_name: "other",
+ },
+ )
+ post "/s/create.json", params: { plan: "plan_1234", source: "tok_1234" }
+ expect(user.groups).to be_empty
+ end
+ end
+
+ context "when plan has group in metadata" do
+ before do
+ ::Stripe::Customer.expects(:create).returns(id: "cus_1234")
+ ::Stripe::Price.expects(:retrieve).returns(
+ type: "recurring",
+ metadata: {
+ group_name: group_name,
+ },
+ )
+ end
+
+ it "does not add the user to the group when subscription fails" do
+ ::Stripe::Subscription.expects(:create).returns(status: "failed")
+
+ expect {
+ post "/s/create.json", params: { plan: "plan_1234", source: "tok_1234" }
+ }.not_to change { group.users.count }
+
+ expect(user.groups).to be_empty
+ end
+
+ it "adds the user to the group when the subscription is active" do
+ ::Stripe::Subscription.expects(:create).returns(status: "active")
+
+ expect {
+ post "/s/create.json", params: { plan: "plan_1234", source: "tok_1234" }
+ }.to change { group.users.count }
+
+ expect(user.groups).not_to be_empty
+ end
+
+ it "adds the user to the group when the subscription is trialing" do
+ ::Stripe::Subscription.expects(:create).returns(status: "trialing")
+
+ expect {
+ post "/s/create.json", params: { plan: "plan_1234", source: "tok_1234" }
+ }.to change { group.users.count }
+
+ expect(user.groups).not_to be_empty
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-subscriptions/spec/requests/user/payments_controller_spec.rb b/plugins/discourse-subscriptions/spec/requests/user/payments_controller_spec.rb
new file mode 100644
index 00000000000..80a843f1474
--- /dev/null
+++ b/plugins/discourse-subscriptions/spec/requests/user/payments_controller_spec.rb
@@ -0,0 +1,136 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+
+RSpec.describe DiscourseSubscriptions::User::PaymentsController do
+ before { SiteSetting.discourse_subscriptions_enabled = true }
+
+ it "is a subclass of ApplicationController" do
+ expect(DiscourseSubscriptions::User::PaymentsController < ::ApplicationController).to eq(true)
+ end
+
+ context "when not authenticated" do
+ it "does not get the payment intents" do
+ ::Stripe::PaymentIntent.expects(:list).never
+ get "/s/user/payments.json"
+ expect(response.status).to eq(403)
+ end
+ end
+
+ context "when authenticated" do
+ let(:user) { Fabricate(:user, email: "[email protected]") }
+
+ before do
+ sign_in(user)
+ Fabricate(:customer, customer_id: "c_345678", user_id: user.id)
+ Fabricate(:product, external_id: "prod_8675309")
+ Fabricate(:product, external_id: "prod_8675310")
+ end
+
+ it "gets payment intents" do
+ created_time = Time.now
+ ::Stripe::Invoice
+ .expects(:list)
+ .with(customer: "c_345678")
+ .returns(
+ data: [
+ { id: "inv_900007", lines: { data: [plan: { product: "prod_8675309" }] } },
+ { id: "inv_900008", lines: { data: [plan: { product: "prod_8675310" }] } },
+ { id: "inv_900008", lines: { data: [plan: { product: "prod_8675310" }] } },
+ ],
+ )
+
+ ::Stripe::PaymentIntent
+ .expects(:list)
+ .with(customer: "c_345678")
+ .returns(
+ data: [
+ { id: "pi_900008", invoice: "inv_900008", created: created_time },
+ { id: "pi_900008", invoice: "inv_900008", created: created_time },
+ { id: "pi_900007", invoice: "inv_900007", created: Time.now },
+ { id: "pi_007", invoice: "inv_007", created: Time.now },
+ ],
+ )
+
+ get "/s/user/payments.json"
+
+ parsed_body = response.parsed_body
+ invoice = parsed_body[0]["invoice"]
+
+ expect(invoice).to eq("inv_900007")
+ expect(parsed_body.count).to eq(2)
+ end
+
+ it "gets pricing table one-off purchases" do
+ ::Stripe::Invoice.expects(:list).with(customer: "c_345678").returns(data: [])
+
+ ::Stripe::PaymentIntent
+ .expects(:list)
+ .with(customer: "c_345678")
+ .returns(data: [{ id: "pi_900010", invoice: nil, created: Time.now }])
+
+ get "/s/user/payments.json"
+
+ parsed_body = response.parsed_body
+
+ expect(parsed_body.count).to eq(1)
+ end
+
+ it "gets pricing table one-off purchases that show up as related guest payments" do
+ SiteSetting.discourse_subscriptions_pricing_table_enabled = true
+ ::Stripe::Invoice.expects(:list).with(customer: "c_345678").returns(data: [])
+
+ ::Stripe::PaymentIntent.expects(:list).with(customer: "c_345678").returns(data: [])
+
+ ::Stripe::Charge
+ .expects(:list)
+ .with(limit: 100, starting_after: nil, expand: ["data.payment_intent"])
+ .returns(
+ data: [
+ {
+ id: "ch_1HtGz2GHcn71qeAp4YjA2oB4",
+ amount: 2000,
+ currency: "usd",
+ billing_details: {
+ email: user.email,
+ },
+ customer: nil, # guest payment
+ payment_intent: "pi_1HtGz1GHcn71qeApT9N2Cjln",
+ created: Time.now.to_i,
+ },
+ {
+ id: "ch_2HtGz2GHcn71qeAp4YjA2oB4",
+ amount: 2000,
+ currency: "usd",
+ billing_details: {
+ email: "[email protected]",
+ },
+ customer: nil, # different guest
+ payment_intent: "pi_2HtGz1GHcn71qeApT9N2Cjln",
+ created: Time.now.to_i,
+ },
+ {
+ id: "ch_1HtGz3GHcn71qeAp5YjA2oC5",
+ amount: 3000,
+ currency: "usd",
+ billing_details: {
+ email: "[email protected]",
+ },
+ customer: "cus_1234", # This is not a guest payment
+ payment_intent: "pi_3HtGz2GHcn71qeApT9N2Cjln",
+ created: Time.now.to_i,
+ },
+ ],
+ )
+
+ get "/s/user/payments.json"
+
+ parsed_body = response.parsed_body
+
+ # Validate that only guest payments with the specified email are returned
+ expect(parsed_body.count).to eq(1)
+ expect(parsed_body.first["id"]).to eq("ch_1HtGz2GHcn71qeAp4YjA2oB4")
+ expect(parsed_body.first["customer"]).to be_nil
+ end
+ end
+end
diff --git a/plugins/discourse-subscriptions/spec/requests/user/subscriptions_controller_spec.rb b/plugins/discourse-subscriptions/spec/requests/user/subscriptions_controller_spec.rb
new file mode 100644
index 00000000000..d602fd44883
--- /dev/null
+++ b/plugins/discourse-subscriptions/spec/requests/user/subscriptions_controller_spec.rb
@@ -0,0 +1,137 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+
+RSpec.describe DiscourseSubscriptions::User::SubscriptionsController do
+ before { SiteSetting.discourse_subscriptions_enabled = true }
+
+ def create_price(id, product)
+ price = { id: id, product: product }
+ def price.id
+ self[:id]
+ end
+ price
+ end
+
+ it "is a subclass of ApplicationController" do
+ expect(DiscourseSubscriptions::User::SubscriptionsController < ::ApplicationController).to eq(
+ true,
+ )
+ end
+
+ context "when not authenticated" do
+ it "does not get the subscriptions" do
+ ::Stripe::Customer.expects(:list).never
+ get "/s/user/subscriptions.json"
+ end
+
+ it "does not destroy a subscription" do
+ ::Stripe::Subscription.expects(:delete).never
+ patch "/s/user/subscriptions/sub_12345.json"
+ end
+
+ it "doesn't update payment method for subscription" do
+ ::Stripe::Subscription.expects(:update).never
+ ::Stripe::PaymentMethod.expects(:attach).never
+ put "/s/user/subscriptions/sub_12345.json", params: { payment_method: "pm_abc123abc" }
+ end
+ end
+
+ context "when authenticated" do
+ let(:user) { Fabricate(:user, email: "[email protected]") }
+ let(:customer) do
+ Fabricate(:customer, user_id: user.id, customer_id: "cus_23456", product_id: "prod_123")
+ end
+
+ before do
+ sign_in(user)
+ Fabricate(:subscription, customer_id: customer.id, external_id: "sub_10z")
+ end
+
+ describe "index" do
+ plans_json =
+ File.read(
+ Rails.root.join(
+ "plugins",
+ "discourse-subscriptions",
+ "spec",
+ "fixtures",
+ "json",
+ "stripe-price-list.json",
+ ),
+ )
+
+ it "gets subscriptions" do
+ ::Stripe::Price.stubs(:list).returns(JSON.parse(plans_json, symbolize_names: true))
+
+ subscriptions_json =
+ File.read(
+ Rails.root.join(
+ "plugins",
+ "discourse-subscriptions",
+ "spec",
+ "fixtures",
+ "json",
+ "stripe-subscription-list.json",
+ ),
+ )
+
+ ::Stripe::Subscription.stubs(:list).returns(
+ JSON.parse(subscriptions_json, symbolize_names: true),
+ )
+
+ get "/s/user/subscriptions.json"
+
+ subscription = JSON.parse(response.body, symbolize_names: true).first
+
+ expect(subscription[:id]).to eq("sub_10z")
+ expect(subscription[:items][:data][0][:plan][:id]).to eq("price_1OrmlvEYXaQnncShNahrpKvA")
+ expect(subscription[:product][:name]).to eq("Exclusive Access")
+ end
+
+ it "aggregates prices from multiple pages using pagination logic" do
+ subscription_data = { id: "sub_10z", items: { data: [{ price: { id: "price_200" } }] } }
+ ::Stripe::Subscription
+ .stubs(:list)
+ .with(customer: "cus_23456", status: "all")
+ .returns({ data: [subscription_data] })
+
+ # Build the first page of 100 prices that do NOT include the desired price.
+ prices_page_1 =
+ (1..100).map do |i|
+ create_price("price_#{i}", { id: "prod_dummy", name: "Dummy Product #{i}" })
+ end
+
+ # Second page containing the desired price.
+ prices_page_2 = [create_price("price_200", { id: "prod_200", name: "Matching Product" })]
+
+ ::Stripe::Price
+ .expects(:list)
+ .with(has_entries(limit: 100, expand: ["data.product"]))
+ .returns({ data: prices_page_1, has_more: true })
+
+ ::Stripe::Price
+ .expects(:list)
+ .with(has_entries(limit: 100, expand: ["data.product"], starting_after: "price_100"))
+ .returns({ data: prices_page_2, has_more: false })
+
+ get "/s/user/subscriptions.json"
+ result = JSON.parse(response.body, symbolize_names: true)
+ subscription = result.first
+
+ expect(subscription[:id]).to eq("sub_10z")
+ expect(subscription[:plan][:id]).to eq("price_200")
+ expect(subscription[:product][:id]).to eq("prod_200")
+ expect(subscription[:product][:name]).to eq("Matching Product")
+ end
+ end
+
+ describe "update" do
+ it "updates the payment method for subscription" do
+ ::Stripe::Subscription.expects(:update).once
+ ::Stripe::PaymentMethod.expects(:attach).once
+ put "/s/user/subscriptions/sub_10z.json", params: { payment_method: "pm_abc123abc" }
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-subscriptions/spec/serializers/site_serializer_spec.rb b/plugins/discourse-subscriptions/spec/serializers/site_serializer_spec.rb
new file mode 100644
index 00000000000..db1da07d08a
--- /dev/null
+++ b/plugins/discourse-subscriptions/spec/serializers/site_serializer_spec.rb
@@ -0,0 +1,34 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+
+describe SiteSerializer do
+ fab!(:user)
+ let(:guardian) { Guardian.new(user) }
+
+ before do
+ Discourse.redis.del("subscriptions_goal_met_date")
+ SiteSetting.discourse_subscriptions_enabled = true
+ SiteSetting.discourse_subscriptions_campaign_enabled = true
+ end
+
+ it "is false if the goal_met date is < 7 days old" do
+ Discourse.redis.set("subscriptions_goal_met_date", 10.days.ago)
+ data = described_class.new(Site.new(guardian), scope: guardian, root: false).as_json
+
+ expect(data[:show_campaign_banner]).to be false
+ end
+
+ it "is true if the goal_met date is > 7 days old" do
+ Discourse.redis.set("subscriptions_goal_met_date", 1.days.ago)
+ data = described_class.new(Site.new(guardian), scope: guardian, root: false).as_json
+
+ expect(data[:show_campaign_banner]).to be true
+ end
+
+ it "fails gracefully if the goal_met date is invalid" do
+ Discourse.redis.set("subscriptions_goal_met_date", "bananas")
+ data = described_class.new(Site.new(guardian), scope: guardian, root: false).as_json
+ expect(data[:show_campaign_banner]).to be false
+ end
+end
diff --git a/plugins/discourse-subscriptions/spec/services/campaign_spec.rb b/plugins/discourse-subscriptions/spec/services/campaign_spec.rb
new file mode 100644
index 00000000000..241d9ae7a56
--- /dev/null
+++ b/plugins/discourse-subscriptions/spec/services/campaign_spec.rb
@@ -0,0 +1,195 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+
+describe DiscourseSubscriptions::Campaign do
+ describe "campaign data is refreshed" do
+ let(:user) { Fabricate(:user) }
+ let(:user2) { Fabricate(:user) }
+ let(:subscription) do
+ {
+ id: "sub_1234",
+ items: {
+ data: [
+ {
+ price: {
+ product: "prodct_23456",
+ unit_amount: 1000,
+ recurring: {
+ interval: "month",
+ },
+ },
+ },
+ ],
+ },
+ }
+ end
+ let(:invoice) do
+ {
+ id: "in_1234",
+ paid: true,
+ lines: {
+ data: [
+ {
+ plan: nil,
+ price: {
+ product: "prodct_65432",
+ active: true,
+ unit_amount: 1000,
+ recurring: nil,
+ },
+ },
+ ],
+ },
+ }
+ end
+ let(:invoice2) do
+ {
+ id: "in_1235",
+ paid: false,
+ lines: {
+ data: [
+ {
+ plan: nil,
+ price: {
+ product: "prodct_65433",
+ active: true,
+ unit_amount: 600,
+ recurring: nil,
+ },
+ },
+ ],
+ },
+ }
+ end
+ let(:invoice_with_nil_lines) { { id: "in_1236", paid: true, lines: nil } }
+ let(:invoice_with_nil_price) do
+ { id: "in_1237", paid: true, lines: { data: [{ plan: nil, price: nil }] } }
+ end
+
+ before do
+ Fabricate(:product, external_id: "prodct_23456")
+ Fabricate(:customer, product_id: "prodct_23456", user_id: user.id, customer_id: "x")
+ Fabricate(:product, external_id: "prodct_65432")
+ Fabricate(:customer, product_id: "prodct_65432", user_id: user2.id, customer_id: "y")
+ Fabricate(:product, external_id: "prodct_65433")
+ Fabricate(:customer, product_id: "prodct_65433", user_id: user2.id, customer_id: "y")
+ SiteSetting.discourse_subscriptions_public_key = "public-key"
+ SiteSetting.discourse_subscriptions_secret_key = "secret-key"
+ end
+
+ describe "refresh_data" do
+ context "for all subscription purchases" do
+ it "refreshes the campaign data properly" do
+ ::Stripe::Subscription.expects(:list).returns(data: [subscription], has_more: false)
+ ::Stripe::Invoice.expects(:list).returns(data: [invoice, invoice2], has_more: false)
+
+ DiscourseSubscriptions::Campaign.new.refresh_data
+
+ expect(SiteSetting.discourse_subscriptions_campaign_subscribers).to eq 1
+ expect(SiteSetting.discourse_subscriptions_campaign_amount_raised).to eq 20.00
+ end
+
+ it "checks if the goal is completed or not" do
+ SiteSetting.discourse_subscriptions_campaign_goal = 5
+ ::Stripe::Subscription.expects(:list).returns(data: [subscription], has_more: false)
+ ::Stripe::Invoice.expects(:list).returns(data: [invoice], has_more: false)
+
+ DiscourseSubscriptions::Campaign.new.refresh_data
+ expect(Discourse.redis.get("subscriptions_goal_met_date")).to be_present
+ end
+
+ it "checks if goal is < 90% met after being met" do
+ SiteSetting.discourse_subscriptions_campaign_goal = 25
+ Discourse.redis.set("subscriptions_goal_met_date", 10.days.ago)
+ ::Stripe::Subscription.expects(:list).returns(data: [subscription], has_more: false)
+ ::Stripe::Invoice.expects(:list).returns(data: [invoice], has_more: false)
+
+ DiscourseSubscriptions::Campaign.new.refresh_data
+ expect(Discourse.redis.get("subscriptions_goal_met_date")).to be_blank
+ end
+
+ it "handles invoices with nil lines gracefully" do
+ ::Stripe::Subscription.expects(:list).returns(data: [subscription], has_more: false)
+ ::Stripe::Invoice.expects(:list).returns(data: [invoice_with_nil_lines], has_more: false)
+
+ expect { DiscourseSubscriptions::Campaign.new.refresh_data }.not_to raise_error
+ end
+
+ it "handles invoices with nil price gracefully" do
+ ::Stripe::Subscription.expects(:list).returns(data: [subscription], has_more: false)
+ ::Stripe::Invoice.expects(:list).returns(data: [invoice_with_nil_price], has_more: false)
+
+ expect { DiscourseSubscriptions::Campaign.new.refresh_data }.not_to raise_error
+ end
+ end
+
+ context "with a campaign product set" do
+ let(:user2) { Fabricate(:user) }
+ let(:campaign_subscription) do
+ {
+ id: "sub_5678",
+ items: {
+ data: [
+ {
+ price: {
+ product: "prod_use",
+ unit_amount: 10_000,
+ recurring: {
+ interval: "year",
+ },
+ },
+ },
+ ],
+ },
+ }
+ end
+
+ before do
+ Fabricate(:product, external_id: "prod_use")
+ Fabricate(:customer, product_id: "prod_use", user_id: user2.id, customer_id: "y")
+ SiteSetting.discourse_subscriptions_campaign_product = "prod_use"
+ end
+
+ it "refreshes campaign data with only the campaign product/subscriptions" do
+ ::Stripe::Subscription.expects(:list).returns(
+ data: [subscription, campaign_subscription],
+ has_more: false,
+ )
+ ::Stripe::Invoice.expects(:list).returns(data: [invoice], has_more: false)
+
+ DiscourseSubscriptions::Campaign.new.refresh_data
+
+ expect(SiteSetting.discourse_subscriptions_campaign_subscribers).to eq 1
+ expect(SiteSetting.discourse_subscriptions_campaign_amount_raised).to eq 8.33
+ end
+ end
+ end
+ end
+
+ describe "campaign is automatically created" do
+ describe "create_campaign" do
+ it "successfully creates the campaign group, product, and prices" do
+ ::Stripe::Product.expects(:create).returns(id: "prod_campaign")
+ ::Stripe::Price.expects(:create)
+ ::Stripe::Price.expects(:create)
+ ::Stripe::Price.expects(:create)
+ ::Stripe::Price.expects(:create)
+ ::Stripe::Price.expects(:create)
+ ::Stripe::Price.expects(:create)
+
+ DiscourseSubscriptions::Campaign.new.create_campaign
+
+ group = Group.find_by(name: "campaign_supporters")
+
+ expect(group[:full_name]).to eq "Supporters"
+ expect(SiteSetting.discourse_subscriptions_campaign_group.to_i).to eq group.id
+
+ expect(DiscourseSubscriptions::Product.where(external_id: "prod_campaign").length).to eq 1
+
+ expect(SiteSetting.discourse_subscriptions_campaign_enabled).to eq true
+ expect(SiteSetting.discourse_subscriptions_campaign_product).to eq "prod_campaign"
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-subscriptions/spec/system/core_features_spec.rb b/plugins/discourse-subscriptions/spec/system/core_features_spec.rb
new file mode 100644
index 00000000000..db86db283bd
--- /dev/null
+++ b/plugins/discourse-subscriptions/spec/system/core_features_spec.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+RSpec.describe "Core features", type: :system do
+ before { enable_current_plugin }
+
+ it_behaves_like "having working core features"
+end
diff --git a/plugins/discourse-subscriptions/spec/system/page_objects/admin_subscription_product.rb b/plugins/discourse-subscriptions/spec/system/page_objects/admin_subscription_product.rb
new file mode 100644
index 00000000000..b4b55bcaf8e
--- /dev/null
+++ b/plugins/discourse-subscriptions/spec/system/page_objects/admin_subscription_product.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+module PageObjects
+ module Pages
+ class AdminSubscriptionProduct < PageObjects::Pages::Base
+ PRODUCTS_TABLE_SELECTOR = "table.discourse-patrons-table"
+
+ def visit_products
+ visit("/admin/plugins/discourse-subscriptions/products")
+ self
+ end
+
+ def has_product?(name)
+ has_css?("table.discourse-patrons-table tr", text: name)
+ self
+ end
+
+ def has_number_of_products?(count)
+ has_css?("table.discourse-patrons-table tr", count:)
+ self
+ end
+
+ def click_trash_nth_row(row)
+ find("table.discourse-patrons-table tr:nth-child(#{row}) button.btn-danger").click()
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-subscriptions/spec/system/page_objects/admin_subscription_subscription.rb b/plugins/discourse-subscriptions/spec/system/page_objects/admin_subscription_subscription.rb
new file mode 100644
index 00000000000..0900d85bf5d
--- /dev/null
+++ b/plugins/discourse-subscriptions/spec/system/page_objects/admin_subscription_subscription.rb
@@ -0,0 +1,32 @@
+# frozen_string_literal: true
+
+module PageObjects
+ module Pages
+ class AdminSubscriptionSubscription < PageObjects::Pages::Base
+ SUBSCRIPTIONS_TABLE_SELECTOR = "table.discourse-patrons-table"
+
+ def visit_subscriptions
+ visit("/admin/plugins/discourse-subscriptions/subscriptions")
+ self
+ end
+
+ def has_subscription?(id)
+ has_css?("#{SUBSCRIPTIONS_TABLE_SELECTOR} tr", text: id)
+ self
+ end
+
+ def subscription_row(id)
+ find("#{SUBSCRIPTIONS_TABLE_SELECTOR} tr", text: id)
+ end
+
+ def has_number_of_subscriptions?(count)
+ has_css?("#{SUBSCRIPTIONS_TABLE_SELECTOR} tr", count:)
+ self
+ end
+
+ def click_cancel_nth_row(row)
+ find("#{SUBSCRIPTIONS_TABLE_SELECTOR} tr:nth-child(#{row}) button.btn-danger").click()
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-subscriptions/spec/system/page_objects/user_billing_subscription.rb b/plugins/discourse-subscriptions/spec/system/page_objects/user_billing_subscription.rb
new file mode 100644
index 00000000000..89ce4eb4275
--- /dev/null
+++ b/plugins/discourse-subscriptions/spec/system/page_objects/user_billing_subscription.rb
@@ -0,0 +1,32 @@
+# frozen_string_literal: true
+
+module PageObjects
+ module Pages
+ class UserBillingSubscription < PageObjects::Pages::Base
+ SUBSCRIPTIONS_TABLE_SELECTOR = "table.discourse-subscriptions-user-table"
+
+ def visit_subscriptions
+ visit("/my/billing/subscriptions")
+ self
+ end
+
+ def has_subscription?(id)
+ has_css?("#{SUBSCRIPTIONS_TABLE_SELECTOR} tr", text: id)
+ self
+ end
+
+ def subscription_row(id)
+ find("#{SUBSCRIPTIONS_TABLE_SELECTOR} tr", text: id)
+ end
+
+ def has_number_of_subscriptions?(count)
+ has_css?("#{SUBSCRIPTIONS_TABLE_SELECTOR} tr", count:)
+ self
+ end
+
+ def click_cancel_nth_row(row)
+ find("#{SUBSCRIPTIONS_TABLE_SELECTOR} tr:nth-child(#{row}) button.btn-danger").click()
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-subscriptions/spec/system/pricing_table_spec.rb b/plugins/discourse-subscriptions/spec/system/pricing_table_spec.rb
new file mode 100644
index 00000000000..dd4e60571fc
--- /dev/null
+++ b/plugins/discourse-subscriptions/spec/system/pricing_table_spec.rb
@@ -0,0 +1,120 @@
+# frozen_string_literal: true
+
+RSpec.describe "Pricing Table", type: :system, js: true do
+ fab!(:admin)
+ fab!(:product) { Fabricate(:product, external_id: "prod_OiK") }
+ let(:dialog) { PageObjects::Components::Dialog.new }
+ let(:product_subscriptions_page) { PageObjects::Pages::AdminSubscriptionProduct.new }
+
+ before do
+ SiteSetting.discourse_subscriptions_enabled = true
+ SiteSetting.discourse_subscriptions_extra_nav_subscribe = true
+
+ SiteSetting.discourse_subscriptions_secret_key = "sk_test_51xuu"
+ SiteSetting.discourse_subscriptions_public_key = "pk_test_51xuu"
+
+ SiteSetting.discourse_subscriptions_pricing_table_enabled = true
+
+ # this needs to be stubbed or it will try to make a request to stripe
+ one_product = {
+ id: "prod_OiK",
+ active: true,
+ name: "Tomtom",
+ metadata: {
+ description: "Photos of tomtom",
+ repurchaseable: true,
+ },
+ }
+ ::Stripe::Product.stubs(:list).returns({ data: [one_product] })
+ ::Stripe::Product.stubs(:delete).returns({ id: "prod_OiK" })
+ ::Stripe::Product.stubs(:retrieve).returns(one_product)
+ ::Stripe::Price.stubs(:list).returns({ data: [] })
+ end
+
+ it "Links to the pricing table page" do
+ sign_in(admin)
+ visit("/")
+
+ link = find("li.nav-item_subscribe a")
+ uri = URI.parse(link[:href])
+ expect(uri.path).to eq("/s/subscriptions")
+ end
+
+ it "Links to the pricing table page from the campaign banner" do
+ sign_in(admin)
+ SiteSetting.discourse_subscriptions_campaign_enabled = true
+ visit("/")
+
+ link = find(".campaign-banner-info-button")
+ uri = URI.parse(link[:href])
+ expect(uri.path).to eq("/s/subscriptions")
+ end
+
+ it "Links to the old page when disabled" do
+ sign_in(admin)
+ SiteSetting.discourse_subscriptions_pricing_table_enabled = false
+ visit("/")
+
+ link = find("li.nav-item_subscribe a")
+ uri = URI.parse(link[:href])
+ expect(uri.path).to eq("/s")
+ end
+
+ it "Links to the old page from the campaign banner when disabled" do
+ sign_in(admin)
+ SiteSetting.discourse_subscriptions_pricing_table_enabled = false
+ SiteSetting.discourse_subscriptions_campaign_enabled = true
+ visit("/")
+
+ link = find(".campaign-banner-info-button")
+ uri = URI.parse(link[:href])
+ expect(uri.path).to eq("/s")
+ end
+
+ it "Old subscribe page still works when disabled" do
+ sign_in(admin)
+ SiteSetting.discourse_subscriptions_pricing_table_enabled = false
+ visit("/")
+
+ find("li.nav-item_subscribe a").click
+ expect(page).to have_selector("div.title-wrapper h1", text: "Subscribe")
+ end
+
+ it "Shows a message when not setup yet" do
+ sign_in(admin)
+ visit("/")
+
+ find("li.nav-item_subscribe a").click
+
+ expect(page).to have_selector(
+ "div.container",
+ text: "There are currently no products available.",
+ )
+ end
+
+ it "Shows a log in message if not signed in" do
+ visit("/")
+
+ find("li.nav-item_subscribe a").click
+
+ expect(page).to have_selector(
+ "div.container",
+ text: "Log in or create an account to subscribe.",
+ )
+ end
+
+ it "Redirects to the pricing table page if enabled" do
+ sign_in(admin)
+ visit("/s")
+
+ try_until_success { expect(current_url).to match("/s/subscriptions") }
+ end
+
+ it "Redirects to /s if pricing table is not enabled" do
+ sign_in(admin)
+ SiteSetting.discourse_subscriptions_campaign_enabled = false
+ visit("/s/subscriptions")
+
+ try_until_success { expect(current_url).to match("/s") }
+ end
+end
diff --git a/plugins/discourse-subscriptions/spec/system/subscription_product_spec.rb b/plugins/discourse-subscriptions/spec/system/subscription_product_spec.rb
new file mode 100644
index 00000000000..4bac8813c74
--- /dev/null
+++ b/plugins/discourse-subscriptions/spec/system/subscription_product_spec.rb
@@ -0,0 +1,49 @@
+# frozen_string_literal: true
+
+describe "Subscription products", type: :system do
+ fab!(:admin)
+ fab!(:product) { Fabricate(:product, external_id: "prod_OiK") }
+ let(:dialog) { PageObjects::Components::Dialog.new }
+ let(:product_subscriptions_page) { PageObjects::Pages::AdminSubscriptionProduct.new }
+
+ before do
+ SiteSetting.discourse_subscriptions_enabled = true
+
+ SiteSetting.discourse_subscriptions_secret_key = "sk_test_51xuu"
+ SiteSetting.discourse_subscriptions_public_key = "pk_test_51xuu"
+
+ # # this needs to be stubbed or it will try to make a request to stripe
+ one_product = {
+ id: "prod_OiK",
+ active: true,
+ name: "Tomtom",
+ metadata: {
+ description: "Photos of tomtom",
+ repurchaseable: true,
+ },
+ }
+ ::Stripe::Product.stubs(:list).returns({ data: [one_product] })
+ ::Stripe::Product.stubs(:delete).returns({ id: "prod_OiK" })
+ ::Stripe::Product.stubs(:retrieve).returns(one_product)
+ ::Stripe::Price.stubs(:list).returns({ data: [] })
+ end
+
+ it "shows the login screen" do
+ visit("/s")
+
+ find("button.login-required.subscriptions").click
+
+ expect(page).to have_css("#login-form")
+ end
+
+ it "shows products on the products and allows deletion" do
+ sign_in(admin)
+
+ product_subscriptions_page.visit_products.has_product?("Tomtom")
+
+ product_subscriptions_page.click_trash_nth_row(1)
+ dialog.click_yes
+
+ product_subscriptions_page.has_number_of_products?(0)
+ end
+end
diff --git a/plugins/discourse-subscriptions/spec/system/subscription_subscription_spec.rb b/plugins/discourse-subscriptions/spec/system/subscription_subscription_spec.rb
new file mode 100644
index 00000000000..1350e1a4161
--- /dev/null
+++ b/plugins/discourse-subscriptions/spec/system/subscription_subscription_spec.rb
@@ -0,0 +1,96 @@
+# frozen_string_literal: true
+
+describe "Subscription products", type: :system do
+ fab!(:admin)
+ fab!(:user)
+ fab!(:product) { Fabricate(:product, external_id: "prod_OiK") }
+ fab!(:customer) do
+ Fabricate(:customer, customer_id: "cus_Q1n", product_id: product.external_id, user_id: user.id)
+ end
+ fab!(:customer2) do
+ Fabricate(:customer, customer_id: "cus_Q1n", product_id: product.external_id, user_id: user.id)
+ end
+ fab!(:subscription) do
+ Fabricate(:subscription, customer_id: customer.id, external_id: "sub_10z", status: "active")
+ end
+ fab!(:subscription2) do
+ Fabricate(:subscription, customer_id: customer2.id, external_id: "sub_32b", status: "canceled")
+ end
+ let(:dialog) { PageObjects::Components::Dialog.new }
+ let(:product_subscriptions_page) { PageObjects::Pages::AdminSubscriptionProduct.new }
+ let(:admin_subscriptions_page) { PageObjects::Pages::AdminSubscriptionSubscription.new }
+ let(:user_billing_subscriptions_page) { PageObjects::Pages::UserBillingSubscription.new }
+
+ before do
+ SiteSetting.discourse_subscriptions_enabled = true
+
+ SiteSetting.discourse_subscriptions_secret_key = "sk_test_51xuu"
+ SiteSetting.discourse_subscriptions_public_key = "pk_test_51xuu"
+
+ # # this needs to be stubbed or it will try to make a request to stripe
+ one_product = {
+ id: "prod_OiK",
+ active: true,
+ name: "Tomtom",
+ metadata: {
+ description: "Photos of tomtom",
+ repurchaseable: true,
+ },
+ }
+
+ plans_json =
+ File.read(
+ Rails.root.join(
+ "plugins",
+ "discourse-subscriptions",
+ "spec",
+ "fixtures",
+ "json",
+ "stripe-price-list.json",
+ ),
+ )
+
+ subscriptions_json =
+ File.read(
+ Rails.root.join(
+ "plugins",
+ "discourse-subscriptions",
+ "spec",
+ "fixtures",
+ "json",
+ "stripe-subscription-list.json",
+ ),
+ )
+
+ ::Stripe::Product.stubs(:list).returns({ data: [one_product] })
+ ::Stripe::Product.stubs(:delete).returns({ id: "prod_OiK" })
+ ::Stripe::Product.stubs(:retrieve).returns(one_product)
+ ::Stripe::Price.stubs(:list).returns(JSON.parse(plans_json, symbolize_names: true))
+ ::Stripe::Subscription.stubs(:list).returns(
+ JSON.parse(subscriptions_json, symbolize_names: true),
+ )
+ end
+
+ it "shows active and canceled subscriptions for admins" do
+ sign_in(admin)
+
+ active_subscription_row =
+ admin_subscriptions_page.visit_subscriptions.subscription_row("sub_10z")
+ expect(active_subscription_row).to have_text("active")
+ canceled_subscription_row =
+ admin_subscriptions_page.visit_subscriptions.subscription_row("sub_32b")
+ expect(canceled_subscription_row).to have_text("canceled")
+ end
+
+ it "shows active and canceled subscriptions for users" do
+ sign_in(user)
+
+ user_billing_subscriptions_page.visit_subscriptions
+ user_billing_subscriptions_page.has_number_of_subscriptions?(2)
+
+ active_subscription_row = user_billing_subscriptions_page.subscription_row("sub_10z")
+ expect(active_subscription_row).to have_text("active")
+ canceled_subscription_row = user_billing_subscriptions_page.subscription_row("sub_32b")
+ expect(canceled_subscription_row).to have_text("canceled")
+ end
+end
diff --git a/plugins/discourse-subscriptions/test/javascripts/acceptance/payments-test.js b/plugins/discourse-subscriptions/test/javascripts/acceptance/payments-test.js
new file mode 100644
index 00000000000..90611320cd4
--- /dev/null
+++ b/plugins/discourse-subscriptions/test/javascripts/acceptance/payments-test.js
@@ -0,0 +1,19 @@
+/* eslint-disable qunit/no-loose-assertions */
+import { visit } from "@ember/test-helpers";
+import { test } from "qunit";
+import { acceptance, count } from "discourse/tests/helpers/qunit-helpers";
+import { stubStripe } from "discourse/plugins/discourse-subscriptions/helpers/stripe";
+
+acceptance("Subscriptions", function (needs) {
+ needs.user();
+ needs.hooks.beforeEach(function () {
+ stubStripe();
+ });
+
+ test("viewing product page", async function (assert) {
+ await visit("/s");
+
+ assert.ok(count(".product-list") > 0, "has product page");
+ assert.ok(count(".product:first-child a") > 0, "has a link");
+ });
+});
diff --git a/plugins/discourse-subscriptions/test/javascripts/acceptance/subscribe-test.js b/plugins/discourse-subscriptions/test/javascripts/acceptance/subscribe-test.js
new file mode 100644
index 00000000000..25b858207c3
--- /dev/null
+++ b/plugins/discourse-subscriptions/test/javascripts/acceptance/subscribe-test.js
@@ -0,0 +1,68 @@
+/* eslint-disable qunit/no-assert-equal */
+/* eslint-disable qunit/no-loose-assertions */
+import { click, visit } from "@ember/test-helpers";
+import { test } from "qunit";
+import pretender, { response } from "discourse/tests/helpers/create-pretender";
+import { acceptance, count } from "discourse/tests/helpers/qunit-helpers";
+import { i18n } from "discourse-i18n";
+import { stubStripe } from "discourse/plugins/discourse-subscriptions/helpers/stripe";
+
+function singleProductPretender() {
+ pretender.get("/s", () => {
+ const products = [
+ {
+ id: "prod_23o8I7tU4g56",
+ name: "Awesome Product",
+ description:
+ "Subscribe to our awesome product. For only $230.10 per month, you can get access. This is a test site. No real credit card transactions.",
+ },
+ ];
+
+ return response(products);
+ });
+}
+
+acceptance("Subscriptions", function (needs) {
+ needs.user();
+ needs.hooks.beforeEach(function () {
+ stubStripe();
+ });
+
+ test("subscribing", async function (assert) {
+ await visit("/s");
+ await click(".product:first-child a");
+
+ assert.ok(
+ count(".discourse-subscriptions-section-columns") > 0,
+ "has the sections for billing"
+ );
+
+ assert.ok(
+ count(".subscribe-buttons button") > 0,
+ "has buttons for subscribe"
+ );
+ });
+
+ test("skips products list on sites with one product", async function (assert) {
+ singleProductPretender();
+
+ await visit("/s");
+
+ assert.dom(".subscribe-buttons button").exists({ count: 1 });
+ assert.dom("input.subscribe-promo-code").exists();
+ assert.dom("button.btn-payment").exists();
+ });
+
+ // In YAML `NO:` is a boolean, so we need quotes around `"NO":`.
+ test("Norway is translated correctly", async function (assert) {
+ assert.equal(
+ i18n("discourse_subscriptions.subscribe.countries.NO"),
+ "Norway"
+ );
+
+ assert.equal(
+ i18n("discourse_subscriptions.subscribe.countries.NG"),
+ "Nigeria"
+ );
+ });
+});
diff --git a/plugins/discourse-subscriptions/test/javascripts/helpers/product-pretender.js b/plugins/discourse-subscriptions/test/javascripts/helpers/product-pretender.js
new file mode 100644
index 00000000000..b16179efc3f
--- /dev/null
+++ b/plugins/discourse-subscriptions/test/javascripts/helpers/product-pretender.js
@@ -0,0 +1,41 @@
+export default function (helpers) {
+ const { response } = helpers;
+
+ this.get("/s", () => {
+ const products = [
+ {
+ id: "prod_23o8I7tU4g56",
+ name: "Awesome Product",
+ description:
+ "Subscribe to our awesome product. For only $230.10 per month, you can get access. This is a test site. No real credit card transactions.",
+ },
+ {
+ id: "prod_B23dc9I7tU4eCy",
+ name: "Special Product",
+ description:
+ "This is another subscription product. You can have more than one. From $12 per month.",
+ },
+ ];
+
+ return response(products);
+ });
+
+ this.get("/s/:id", () => {
+ const product = {
+ id: "prod_23o8I7tU4g56",
+ name: "Awesome Product",
+ description:
+ "Subscribe to our awesome product. For only $230.10 per month, you can get access. This is a test site. No real credit card transactions.",
+ };
+ const plans = [
+ {
+ id: "plan_GHGHSHS8654G",
+ amount: 200,
+ currency: "usd",
+ interval: "month",
+ },
+ ];
+
+ return response({ product, plans });
+ });
+}
diff --git a/plugins/discourse-subscriptions/test/javascripts/helpers/stripe.js b/plugins/discourse-subscriptions/test/javascripts/helpers/stripe.js
new file mode 100644
index 00000000000..fbfd1866278
--- /dev/null
+++ b/plugins/discourse-subscriptions/test/javascripts/helpers/stripe.js
@@ -0,0 +1,25 @@
+import { Promise } from "rsvp";
+
+export function stubStripe() {
+ window.Stripe = () => {
+ return {
+ createPaymentMethod() {
+ return new Promise((resolve) => {
+ resolve({});
+ });
+ },
+ elements() {
+ return {
+ create() {
+ return {
+ on() {},
+ card() {},
+ mount() {},
+ update() {},
+ };
+ },
+ };
+ },
+ };
+ };
+}
diff --git a/plugins/discourse-subscriptions/test/javascripts/integration/components/payment-options-test.gjs b/plugins/discourse-subscriptions/test/javascripts/integration/components/payment-options-test.gjs
new file mode 100644
index 00000000000..1a83c434d2a
--- /dev/null
+++ b/plugins/discourse-subscriptions/test/javascripts/integration/components/payment-options-test.gjs
@@ -0,0 +1,55 @@
+import { tracked } from "@glimmer/tracking";
+import { render } from "@ember/test-helpers";
+import { module, test } from "qunit";
+import { setupRenderingTest } from "discourse/tests/helpers/component-test";
+import PaymentOptions from "discourse/plugins/discourse-subscriptions/discourse/components/payment-options";
+
+module("Subscriptions | payment-options", function (hooks) {
+ setupRenderingTest(hooks);
+
+ test("payment options have no plans", async function (assert) {
+ await render(<template><PaymentOptions @plans={{false}} /></template>);
+
+ assert
+ .dom(".btn-discourse-subscriptions-subscribe")
+ .doesNotExist("The plan buttons are not shown");
+ });
+
+ test("payment options has content", async function (assert) {
+ const plans = [
+ {
+ currency: "aud",
+ recurring: { interval: "year" },
+ amountDollars: "44.99",
+ },
+ {
+ currency: "gdp",
+ recurring: { interval: "month" },
+ amountDollars: "9.99",
+ },
+ ];
+
+ class State {
+ @tracked selectedPlan;
+ }
+
+ const testState = new State();
+
+ await render(
+ <template>
+ <PaymentOptions
+ @plans={{plans}}
+ @selectedPlan={{testState.selectedPlan}}
+ />
+ </template>
+ );
+
+ assert.dom(".btn-discourse-subscriptions-subscribe").exists({ count: 2 });
+
+ assert.strictEqual(
+ this.selectedPlan,
+ undefined,
+ "No plans are selected by default"
+ );
+ });
+});
diff --git a/plugins/discourse-subscriptions/test/javascripts/integration/components/payment-plan-test.gjs b/plugins/discourse-subscriptions/test/javascripts/integration/components/payment-plan-test.gjs
new file mode 100644
index 00000000000..5966ec32181
--- /dev/null
+++ b/plugins/discourse-subscriptions/test/javascripts/integration/components/payment-plan-test.gjs
@@ -0,0 +1,61 @@
+import { tracked } from "@glimmer/tracking";
+import { render } from "@ember/test-helpers";
+import { module, test } from "qunit";
+import { setupRenderingTest } from "discourse/tests/helpers/component-test";
+import PaymentPlan from "discourse/plugins/discourse-subscriptions/discourse/components/payment-plan";
+
+module("Subscriptions | payment-plan", function (hooks) {
+ setupRenderingTest(hooks);
+
+ test("Payment plan subscription button rendered", async function (assert) {
+ const plan = {
+ type: "recurring",
+ currency: "aud",
+ recurring: { interval: "year" },
+ amountDollars: "44.99",
+ };
+ let selectedPlan;
+
+ await render(
+ <template>
+ <PaymentPlan @plan={{plan}} @selectedPlan={{selectedPlan}} />
+ </template>
+ );
+
+ assert
+ .dom(".btn-discourse-subscriptions-subscribe")
+ .exists("The payment button is shown");
+
+ assert
+ .dom(".btn-discourse-subscriptions-subscribe:first-child .interval")
+ .hasText("Yearly", "The plan interval is shown -- Yearly");
+
+ assert
+ .dom(".btn-discourse-subscriptions-subscribe:first-child .amount")
+ .hasText("$44.99", "The plan amount and currency is shown");
+ });
+
+ test("Payment plan one-time-payment button rendered", async function (assert) {
+ const plan = {
+ type: "one_time",
+ currency: "USD",
+ amountDollars: "3.99",
+ };
+
+ class State {
+ @tracked selectedPlan;
+ }
+
+ const testState = new State();
+
+ await render(
+ <template>
+ <PaymentPlan @plan={{plan}} @selectedPlan={{testState.selectedPlan}} />
+ </template>
+ );
+
+ assert
+ .dom(".btn-discourse-subscriptions-subscribe:first-child .interval")
+ .hasText("One-Time Payment", "Shown as one time payment");
+ });
+});
diff --git a/plugins/discourse-subscriptions/test/javascripts/unit/helpers/format-currency-test.js b/plugins/discourse-subscriptions/test/javascripts/unit/helpers/format-currency-test.js
new file mode 100644
index 00000000000..b1cff4947d3
--- /dev/null
+++ b/plugins/discourse-subscriptions/test/javascripts/unit/helpers/format-currency-test.js
@@ -0,0 +1,19 @@
+/* eslint-disable qunit/no-assert-equal */
+/* eslint-disable qunit/no-loose-assertions */
+import { setupTest } from "ember-qunit";
+import { module, test } from "qunit";
+import formatCurrency from "discourse/plugins/discourse-subscriptions/discourse/helpers/format-currency";
+
+module("Subscriptions | Unit | Helper | format-currency", function (hooks) {
+ setupTest(hooks);
+
+ test("formats USD correctly", function (assert) {
+ const result = formatCurrency("USD", 338.2);
+ assert.equal(result, "$338.20", "Formats USD correctly");
+ });
+
+ test("rounds correctly", function (assert) {
+ const result = formatCurrency("USD", 338.289);
+ assert.equal(result, "$338.29", "Rounds correctly");
+ });
+});
diff --git a/plugins/discourse-subscriptions/test/javascripts/unit/models/plan-test.js b/plugins/discourse-subscriptions/test/javascripts/unit/models/plan-test.js
new file mode 100644
index 00000000000..3093de6d2e0
--- /dev/null
+++ b/plugins/discourse-subscriptions/test/javascripts/unit/models/plan-test.js
@@ -0,0 +1,40 @@
+import { module, test } from "qunit";
+import Plan from "discourse/plugins/discourse-subscriptions/discourse/models/plan";
+
+module("Subscriptions | Unit | Model | plan", function () {
+ test("subscriptionRate", function (assert) {
+ const plan = Plan.create({
+ unit_amount: "2399",
+ currency: "aud",
+ recurring: {
+ interval: "month",
+ },
+ });
+
+ assert.strictEqual(
+ plan.get("subscriptionRate"),
+ "23.99 AUD / month",
+ "it returns the formatted subscription rate"
+ );
+ });
+
+ test("amountDollars", function (assert) {
+ const plan = Plan.create({ unit_amount: 2399 });
+
+ assert.strictEqual(
+ plan.get("amountDollars"),
+ "23.99",
+ "it returns the formatted dollar amount"
+ );
+ });
+
+ test("amount", function (assert) {
+ const plan = Plan.create({ amountDollars: "22.12" });
+
+ assert.strictEqual(
+ plan.get("unit_amount"),
+ 2212,
+ "it returns the cents amount"
+ );
+ });
+});
diff --git a/translator.yml b/translator.yml
index c664c1c41d6..3e7df7396dd 100644
--- a/translator.yml
+++ b/translator.yml
@@ -227,3 +227,10 @@ files:
- source_path: plugins/discourse-assign/config/locales/server.en.yml
destination_path: plugins/assign/server.yml
label: assign
+
+ - source_path: plugins/discourse-subscriptions/config/locales/client.en.yml
+ destination_path: plugins/subscriptions/client.yml
+ label: subscriptions
+ - source_path: plugins/discourse-subscriptions/config/locales/server.en.yml
+ destination_path: plugins/subscriptions/server.yml
+ label: subscriptions