Skip to content

Instantly share code, notes, and snippets.

@Rio517
Created October 17, 2011 01:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rio517/1291712 to your computer and use it in GitHub Desktop.
Save Rio517/1291712 to your computer and use it in GitHub Desktop.
Stripe.com api feedback example
<% count = 1 %>
<% if @invoice.lines.subscriptions.any? %>
<% @invoice.lines.subscriptions.each do |subscription| -%>
<tr class="<%= count % 2 == 0 ? 'even' : 'odd' %>">
<td class="first"><%= format_unix_time(subscription.period.end) %></td>
<td><%= subscription.plan.name %> subscription from <%= format_unix_time(subscription.period.start) %> to <%= format_unix_time(subscription.period.end) %></td>
<td><%= number_to_currency(subscription.amount/100) %></td>
</tr>
<% count += 1 %>
<% end %>
<% end %>
<% if @invoice.lines.respond_to?(:invoiceitems) && @invoice.lines.invoiceitems.any? %>
<% @invoice.lines.invoiceitems.each do |invoiceitem| -%>
<tr class="<%= count % 2 == 0 ? 'even' : 'odd' %>">
<td class="first"><%= format_unix_time(invoiceitem.date) %></td>
<td><%= invoiceitem.description %></td>
<td><%= number_to_currency(invoiceitem.amount/100) %></td>
</tr>
<% count += 1 %>
<% end %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment