<% if !payment_method.options[:client_side_encryption_key].present? %>

Please set the Braintree client side encryption key.

<% else %> <% content_for :head do %> <%= javascript_include_tag 'store/braintree-1.1.1.min.js' %> <% end %> <%= image_tag 'credit_cards/credit_card.gif', :id => 'credit-card-image' %> <% param_prefix = "payment_source[#{payment_method.id}]" %>

<%= label_tag nil, t(:card_number) %>*
<% options_hash = Rails.env.production? ? {:autocomplete => 'off'} : {} %> <%= text_field_tag "", '', options_hash.merge(:id => 'card_number', :class => 'required', :size => 19, :maxlength => 19, :autocomplete => "off") %> <%= hidden_field_tag "#{param_prefix}[number]", "", :id => "encrypted_card_number" %>  

<%= label_tag nil, t(:expiration) %>*
<%= select_month(Date.today, { :prefix => param_prefix, :field_name => 'month', :use_month_numbers => true }, :class => 'required') %> <%= select_year(Date.today, { :prefix => param_prefix, :field_name => 'year', :start_year => Date.today.year, :end_year => Date.today.year + 15 }, :class => 'required') %>

<%= label_tag nil, t(:card_code) %>*
<%= text_field_tag "", '', options_hash.merge(:id => 'card_code', :class => 'required', :size => 5) %> <%= hidden_field_tag "#{param_prefix}[verification_value]", "", :id => "encrypted_card_code" %> <%= link_to "(#{t(:what_is_this)})", spree.content_path('cvv'), :target => '_blank', :onclick => "window.open(this.href,'cvv_info','left=20,top=20,width=500,height=500,toolbar=0,resizable=0,scrollbars=1');return false", "data-hook" => "cvv_link" %>

<%= hidden_field param_prefix, 'first_name', :value => @order.billing_firstname %> <%= hidden_field param_prefix, 'last_name', :value => @order.billing_lastname %> <% end %>