diff --git a/Envfile b/Envfile index 835d09a2d..dbbcc3e52 100644 --- a/Envfile +++ b/Envfile @@ -145,7 +145,6 @@ variable :SLACK_WEBHOOK_URL, :String, default: "" # (https://stripe.com/docs/api) variable :STRIPE_PUBLISHABLE_KEY, :String, default: "Optional" variable :STRIPE_SECRET_KEY, :String, default: "Optional" -variable :STRIPE_CANCELLATION_SECRET, :String, default: "Optional" # For video calling in DEV Connect # (https://www.twilio.com/docs/video) diff --git a/app/views/users/_membership.html.erb b/app/views/users/_membership.html.erb deleted file mode 100644 index fa4c49f07..000000000 --- a/app/views/users/_membership.html.erb +++ /dev/null @@ -1,68 +0,0 @@ -

Your Membership Features

- -<% if current_user.monthly_dues >= 1000 %> - <% cache "store_coupons_user_#{current_user.id}_dues_#{current_user.monthly_dues}" do %> -

Shop Coupons

-
- 🎟 25% Off Everything: - - <%= CouponGenerator.new(current_user.id, "member_discount").generate %> - -

- <% 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 %> -
- <%= label_tag :amount, "Monthly Contribution ($):", style: "width: 100%;" %> - <%= number_field_tag :amount, current_user.monthly_dues / 100.0, class: "amount-input", step: "any", min: "1" %> -
-
- <%= submit_tag "SUBMIT", class: "cta" %> -
-<% 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