Created
August 25, 2017 13:40
-
-
Save buoyant/7471720e8b2319a7163ff5d657abf0db to your computer and use it in GitHub Desktop.
unified credit card form
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p><i class="lock inline"></i> All information is sent via a secure SSL connection.</p> | |
<div class="checkout-row"> | |
<p class='<%= @payment_gateway.cc_number_field[:p_class] %>'> | |
<%= label_tag $credit_card_number %> | |
<%= text_field_tag @payment_gateway.cc_number_field[:name], '', @payment_gateway.cc_number_field[:options] %> | |
</p> | |
<p> | |
<%= label_tag $accepted_cards %> | |
<span class="accepted_cards"> | |
<% if @payment_gateway.visa? %> | |
<% if @payment_gateway.card_types_selectable? %> | |
<%= radio_button_tag 'card_type', 'Visa' %> | |
<% end %> | |
<span class="Visa"><%= image_tag "/images/creditcards/visa.gif", :alt => 'Visa' %></span> | |
<% end %> | |
<% if @payment_gateway.mastercard? %> | |
<% if @payment_gateway.card_types_selectable? %> | |
<%= radio_button_tag 'card_type', 'MasterCard' %> | |
<% end %> | |
<span class="Mastercard"><%= image_tag "/images/creditcards/mastercard.gif", :alt => 'Mastercard' %></span> | |
<% end %> | |
<% if @payment_gateway.amex? %> | |
<% if @payment_gateway.card_types_selectable? %> | |
<%= radio_button_tag 'card_type', 'Amex' %> | |
<% end %> | |
<span class="Amex"><%= image_tag "/images/creditcards/amex.gif", :alt => 'Amex' %></span> | |
<% end %> | |
<% if @payment_gateway.discover? %> | |
<% if @payment_gateway.card_types_selectable? %> | |
<%= radio_button_tag 'card_type', 'Discover' %> | |
<% end %> | |
<span class="Discover"><%= image_tag "/images/creditcards/discover.gif", :alt => 'Discover' %></span> | |
<% end %> | |
<% if @payment_gateway.diners? %> | |
<% if @payment_gateway.card_types_selectable? %> | |
<%= radio_button_tag 'card_type', 'Diners' %> | |
<% end %> | |
<span class="Diners"><%= image_tag "/images/creditcards/diners.gif", :alt => 'Diners' %></span> | |
<% end %> | |
</span> | |
</p> | |
<% if @payment_gateway.accepts_cvv? %> | |
<p> | |
<%= label_tag $cvv_number %> | |
<%= text_field_tag @payment_gateway.cvv_field[:name], '', @payment_gateway.cvv_field[:options] %> | |
</p> | |
<% end %> | |
<p> | |
<%= label_tag $expiration_date %> | |
<%= select_tag @payment_gateway.expiry_month_field[:name], options_for_select(('01'..'12').to_a.map {|x| [x,x]}), @payment_gateway.expiry_month_field[:options].merge({:include_blank => true, :class => 'field_set_width'}) %> | |
<span class="expiration_divider"> / </span> | |
<%= select_tag @payment_gateway.expiry_year_field[:name], options_for_select((Time.now.year..Time.now.year + 50).to_a.map {|x| [x,x]}), @payment_gateway.expiry_year_field[:options].merge({:include_blank => true, :class => 'field_set_width'}) %> | |
</p> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment