diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 5dfb3a144..1d40e3a52 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -109,7 +109,9 @@ class UsersController < ApplicationController new(access_token: current_user.identities.where(provider: "github").last.token) end when "billing" - @customer = Stripe::Customer.retrieve(current_user.stripe_id_code) if current_user.stripe_id_code + stripe_code = current_user.stripe_id_code + return if stripe_code == "special" + @customer = Stripe::Customer.retrieve(stripe_code) if !stripe_code.blank? when "membership" if current_user.monthly_dues.zero? redirect_to "/membership" diff --git a/app/views/users/_billing.html.erb b/app/views/users/_billing.html.erb index d7edc63d6..8a9ffb6aa 100644 --- a/app/views/users/_billing.html.erb +++ b/app/views/users/_billing.html.erb @@ -1,9 +1,16 @@

Billing Details

<% if current_user.monthly_dues == 0 %> -
You will be billed monthly based on your use of premium features. 🔒
+
+ You will be billed monthly based on your use of + premium features. 🔒 +
<% else %> -
You will be billed monthly for your dev.to sustaining membership. To make adjustments, visit your membership settings.
+
+ You will be billed monthly for your dev.to sustaining membership. + To make adjustments, visit your + membership settings. +
<% end %> <% if current_user.stripe_id_code.blank? %> <%= form_tag stripe_subscriptions_path, id: "credit-card-form" do %> @@ -18,6 +25,10 @@ <% end %> + <% elsif current_user.stripe_id_code == "special" %> +

+ Billing questions? Send an email to yo@dev.to. +

<% else %>
Your Credit Cards
<% @customer.sources.each do |source| %>