Your payment method

For your security, we don't store your payment information on file.

Instead, we rely on industry-leading payment processor Stripe to safely and securely process payments and handle your subscription info.

<% if @stripe_customer.sources.total_count == 0 %>

We don't currently have a payment method on file for you. You'll be asked to add one whenever you upgrade, but you can add one at any time here.

<%= link_to "Add payment method", payment_info_path, class: 'btn white blue-text' %>

<% else %>

We have a payment method on file for you through Stripe (<%= @stripe_customer.sources.data[0].try(:brand) || 'a card' %> ending in <%= @stripe_customer.sources.data[0].last4 %>), but since we don't store it, you cannot edit it. You can choose to add a new one (replacing the old), or delete the existing one.

<% end %>
<% if @stripe_customer.sources.total_count > 0 %>
<%= link_to "Add new payment method", payment_info_path %> <%= link_to "Delete existing payment method", delete_payment_method_path %>
<% end %>
<% if current_user.paypal_invoices.any? %>
Please note that this list only reflects recurring subscription payments and doesn't include any standalone Premium Code purchases yet.
<% end %>
<% account_balance = @stripe_customer.account_balance %> <%= 'Outstanding balance:' if account_balance > 0 %> <%= number_to_currency(account_balance.abs / 100.0) if account_balance != 0 %> <%= 'credit' if account_balance < 0 %>
Billing history
<% @stripe_invoices.first(10).each do |invoice| %> <% end %>
Date Description Amount Billed
<%= Time.at(invoice.date).strftime("%B %d, %Y") %>
at <%= Time.at(invoice.date).strftime("%I:%M %p") %>
<%= '(Pending)' if Time.at(invoice.date) > Time.now %>
    <% invoice.lines.data.reverse.each do |line_item| %>
  • <% action = line_item.amount < 0 ? 'prorated' : 'charged' if line_item.description.nil? description = [ "a #{line_item.plan.name} subscription ", "from #{Time.at(line_item.period.start).strftime('%B %d, %Y')} ", "to #{Time.at(line_item.period.end).strftime('%B %d, %Y')}" ].join else description = line_item.description end %> You were <%= action %> <%= number_to_currency(line_item.amount / 100) %> for <%= description %>.
  • <% end %>
<%= number_to_currency(invoice.amount_due / 100) %>