- <% if current_user.monthly_dues >= 2500 %>
- 🎟 Level 3 Merch Gift (one time use):
-
- <%= CouponGenerator.new(current_user.id, "tee_pack").generate %>
-
-
- 👆 This coupon will give you 100% off:
-
- DEV Tee Package (Unisex Cut)
-
- or
-
- DEV Tee Package (Women's Cut)
- .
-
- Visit one of these links to claim your gift. The listed price is a placeholder that will be negated by the coupon.
- <% else %>
- 🎟 Level 2 Sticker Gift (one time use):
-
- <%= CouponGenerator.new(current_user.id, "sticker_pack").generate %>
-
-
- 👆 This coupon will give you 100% off
-
- THE MEMBERS-ONLY STICKER PACK
- .
-
- Visit link to claim your gift. The listed price is a placeholder that will be negated by the coupon.
- <% end %>
-
-
- <% end %>
-<% end %>
-
Want to change your membership level?
-<%= form_tag "/stripe_subscriptions/current_user", method: :patch do %>
-
-<% end %>
-
-
-
-<%= form_tag "/stripe_subscriptions/current_user", method: :delete, onsubmit: "return confirm('Are you absolutely sure you want to perform this action?');" do %>
-
Don't want to keep your membership?
-
-<% end %>
diff --git a/config/initializers/stripe.rb b/config/initializers/stripe.rb
index e2f5ed49e..8e6bebd71 100644
--- a/config/initializers/stripe.rb
+++ b/config/initializers/stripe.rb
@@ -1,10 +1,8 @@
Rails.configuration.stripe = {
- publishable_key: ApplicationConfig["STRIPE_PUBLISHABLE_KEY"],
- secret_key: ApplicationConfig["STRIPE_SECRET_KEY"],
- stripe_cancellation_secret: ApplicationConfig["STRIPE_CANCELLATION_SECRET"]
+ publishable_key: ApplicationConfig["STRIPE_PUBLISHABLE_KEY"]
}
-Stripe.api_key = Rails.configuration.stripe[:secret_key]
+Stripe.api_key = ApplicationConfig["STRIPE_SECRET_KEY"]
if Rails.env.development? && Stripe.api_key.present?
Stripe.log_level = Stripe::LEVEL_INFO
diff --git a/spec/policies/stripe_active_card_policy_spec.rb b/spec/policies/stripe_active_card_policy_spec.rb
index 215106563..52ba1a5d5 100644
--- a/spec/policies/stripe_active_card_policy_spec.rb
+++ b/spec/policies/stripe_active_card_policy_spec.rb
@@ -1,7 +1,7 @@
require "rails_helper"
RSpec.describe StripeActiveCardPolicy, type: :policy do
- subject { described_class.new(user, :stripe_subscription) }
+ subject { described_class.new(user, :stripe_active_card) }
context "when user is not signed in" do
let(:user) { nil }
diff --git a/spec/policies/stripe_subscription_policy_spec.rb b/spec/policies/stripe_subscription_policy_spec.rb
deleted file mode 100644
index 615a4720d..000000000
--- a/spec/policies/stripe_subscription_policy_spec.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-require "rails_helper"
-
-RSpec.describe StripeSubscriptionPolicy, type: :policy do
- subject { described_class.new(user, :stripe_subscription) }
-
- context "when user is not signed in" do
- let(:user) { nil }
-
- it { within_block_is_expected.to raise_error(Pundit::NotAuthorizedError) }
- end
-
- context "when user is signed in" do
- let(:user) { build_stubbed(:user) }
-
- it { is_expected.to permit_actions(%i[create update destroy]) }
-
- context "when user is banned" do
- let(:user) { build(:user, :banned) }
-
- it { is_expected.to forbid_actions(%i[create update]) }
- end
- end
-end