<% if previous_cards.any? %> <% previous_cards.each do |card| %> <% end %> <% end %>
<% param_prefix = "payment_source[#{payment_method.id}]" %>
<%= hidden_field_tag "#{param_prefix}[cc_type]", '', {class: 'ccType'} %> <%= label_tag "card_number#{payment_method.id}", Spree::CreditCard.human_attribute_name(:number), class: 'required' %> <%= text_field_tag "#{param_prefix}[number]", '', class: 'required fullwidth cardNumber', id: "card_number#{payment_method.id}", maxlength: 19 %>
<%= label_tag "card_name#{payment_method.id}", Spree::CreditCard.human_attribute_name(:name), class: 'required' %> <%= text_field_tag "#{param_prefix}[name]", '', id: "card_name#{payment_method.id}", class: 'required fullwidth', maxlength: 19 %>
<%= label_tag "card_expiry#{payment_method.id}", Spree::CreditCard.human_attribute_name(:expiration), class: 'required' %> <%= text_field_tag "#{param_prefix}[expiry]", '', id: "card_expiry#{payment_method.id}", class: "required cardExpiry", placeholder: "MM / YY" %>
<%= label_tag "card_code#{payment_method.id}", Spree::CreditCard.human_attribute_name(:card_code), class: 'required' %> <%= text_field_tag "#{param_prefix}[verification_value]", '', id: "card_code#{payment_method.id}", class: 'required fullwidth cardCode', size: 5 %>
<%= label_tag "card_address#{payment_method.id}", Spree.t(:billing_address) %> <% address = @order.bill_address || @order.ship_address || Spree::Address.build_default %> <%= fields_for "#{param_prefix}[address_attributes]", address do |f| %> <%= render partial: 'spree/admin/shared/address_form', locals: { f: f, type: "billing" } %> <% end %>