Created
April 18, 2012 15:46
-
-
Save coderforhire/2414454 to your computer and use it in GitHub Desktop.
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
| <%= form_for(@purchase) do |f| %> | |
| <%= f.hidden_field :stripe_card_token %> | |
| <% if @purchase.stripe_card_token.present? %> | |
| Credit card has been provided. | |
| <% else %> | |
| <div class="field"> | |
| <%= label_tag :card_number, "Credit Card Number" %> | |
| <%= text_field_tag :card_number, nil, name: nil %> | |
| </div> | |
| <div class="field"> | |
| <%= label_tag :card_code, "Security Code on Card (CVV)" %> | |
| <%= text_field_tag :card_code, nil, name: nil %> | |
| </div> | |
| <div class="field"> | |
| <%= label_tag :card_month, "Card Expiration" %> | |
| <%= select_month nil, {add_month_numbers: true}, {name: nil, id: "card_month"} %> | |
| <%= select_year nil, {start_year: Date.today.year, end_year: Date.today.year+15}, {name: nil, id: "card_year"} %> | |
| </div> | |
| <% end %> | |
| <div id="stripe_error"> | |
| <noscript>JavaScript is not enabled and is required for this form. First enable it in your web browser settings.</noscript> | |
| </div> | |
| <% if @purchase.errors.any? %> | |
| <div id="error_explanation"> | |
| <h2><%= pluralize(@purchase.errors.count, "error") %> prohibited this purchase from being saved:</h2> | |
| <ul> | |
| <% @purchase.errors.full_messages.each do |msg| %> | |
| <li><%= msg %></li> | |
| <% end %> | |
| </ul> | |
| </div> | |
| <% end %> | |
| <div class="actions"> | |
| <%= f.submit %> | |
| </div> | |
| <% end %> | |
| ~ | |
| ~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment