Skip to content

Instantly share code, notes, and snippets.

@Austio
Created July 18, 2014 16:36
Show Gist options
  • Save Austio/3d2ba8fa0efb5ae79293 to your computer and use it in GitHub Desktop.
Save Austio/3d2ba8fa0efb5ae79293 to your computer and use it in GitHub Desktop.
<div class="payment">
<%= javascript_include_tag 'https://js.recurly.com/v3/recurly.js' %>
<%= stylesheet_link_tag "creditcard" %>
<section class="credit-card visa gr-visa">
<header class="payment-top">
This is a secure 128-bit SSL encrypted payment form
</header>
<!--- <div class="logo">Visa</div> --->
<h2>Payment Details</h2>
<ul class="inputs">
<li>
<label class="cc">Name On Card</label>
<table width="100%" border="0" cellpadding="5">
<tr>
<th><input type="text" id="first_name" data-recurly="first_name" name="first_name" value="<%= @billing_info.try(:first_name) || "John" %>" class="firstname gr-input" required /></th>
<th><input type="text" id="last_name" data-recurly="last_name" name="last_name" value="<%= @billing_info.try(:last_name) || "Smith" %>" class="lastname gr-input" required /></th>
</tr>
</table>
</li>
<li>
<label class="cc">Card Number</label>
<input type="text" id="number" data-recurly="number" pattern="[0-9]{13,16}" value="**** **** **** <%= @billing_info.try(:last_four) || "****" %>" class="ccfull gr-input" required />
</li>
<table width="100%" border="0" cellpadding="0">
<tr>
<th><li class="ccexpire last">
<label class="cc">Expiration</label>
<table width="100%">
<tr>
<th><select required size="1" id="month" data-recurly="month" class="ccselectmonth gr-input">
<option value="01" <%= "selected='selected'" if @billing_info.try(:month) == 1 %>>Janurary (01)</option>
<option value="02" <%= "selected='selected'" if @billing_info.try(:month) == 2 %>>February (02)</option>
<option value="03" <%= "selected='selected'" if @billing_info.try(:month) == 3 %>>March (03)</option>
<option value="04" <%= "selected='selected'" if @billing_info.try(:month) == 4 %>>April (04)</option>
<option value="05" <%= "selected='selected'" if @billing_info.try(:month) == 5 %>>May (05)</option>
<option value="06" <%= "selected='selected'" if @billing_info.try(:month) == 6 %>>June (06)</option>
<option value="07" <%= "selected='selected'" if @billing_info.try(:month) == 7 %>>July (07)</option>
<option value="08" <%= "selected='selected'" if @billing_info.try(:month) == 8 %>>August (08)</option>
<option value="09" <%= "selected='selected'" if @billing_info.try(:month) == 9 %>>September (09)</option>
<option value="10" <%= "selected='selected'" if @billing_info.try(:month) == 10 %>>October (10)</option>
<option value="11" <%= "selected='selected'" if @billing_info.try(:month) == 11 %>>November (11)</option>
<option value="12" <%= "selected='selected'" if @billing_info.try(:month) == 12 %>>December (12)</option>
</select></th><% time = Time.now %>
<th><select size="1" id="year" data-recurly="year" class="ccselectyear gr-input" required>
<% 7.times do |years_out| %>
<% year = time.year + years_out %>
<%= raw "<option value='#{year}' #{"selected='selected'" if @billing_info.try(:year) == year} > #{year} </option>" %>
<% end %>
</select></th>
</tr>
</table>
</li></th>
<th><li class="cvc-code last">
<label class="cc">CVC Code</label>
<input type="text" id="cvv" data-recurly="cvv" value="" class="gr-input" required/>
</li></th>
</tr>
</table>
</ul>
<input type="hidden" id="recurly-token" data-recurly="token" name="recurly-token">
<!--- <div class="watermark">Visa</div> --->
</section>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment