<h2>Credit Card Details</h2>
<br>

<table class="list">
  <tr>
    <th>Billing Address</th>
    <td><%= current_account.billing_address_address1.presence || 'not provided' %> <%= current_account.billing_address_address2 %></td>
  </tr>
  <tr>
    <th> Company </th>
    <td><%= current_account.billing_address_name.presence || 'not provided' %> </td>
  </tr>

  <% %w{first_name last_name city country state zip phone}.each do |field| %>
    <%= payment_details_row(field, current_account) %>
  <% end %>
</table>

<% if current_account.credit_card_stored? %>
  <table class="list">
    <tr>
      <th>Credit card number</th>
      <td><%= current_account.credit_card_display_number.presence || 'not provided' %></td>
    </tr>
    <tr>
      <th>Expiration date</th>
      <td><%= current_account.credit_card_expires_on.strftime('%B, %Y').presence || 'not provided' -%></td>
  </tr>
  </table>
<%- end -%>

<%= link_to "Edit credit card details", edit_provider_admin_account_braintree_blue_path, class: "important-button" -%>

<%= link_to "Remove credit card details", provider_admin_account_braintree_blue_path, method: :delete, class: "important-button" -%>

<%=render :partial => '/shared/legal_terms_for_cc_details' -%>

