- Go to
c9.io
and log in - Create a new workspace
- Workspace name =
hello-stripe
- Clone from Git or Mercurial URL = https://github.com/tschaeff/stripe_checkout_integration_training.git
- (everything else at defaults)
- Workspace name =
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
<table> | |
<% @c.each do |customer| %> | |
<tr> | |
<td><%= customer.id %><td> | |
<td><%= customer.email %></td> | |
<td><a href="../customer/<%= customer.id %>">Subscriptions [<%= customer.subscriptions.total_count %>] </a></td> | |
</tr> | |
<% end %> | |
</table> |
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
get '/customer/:cid' do | |
# Output params hash in bash | |
puts params.inspect | |
# Retrieve customer ID from params hash | |
cid = params[:cid] | |
# Retrieve customer object from Stripe API | |
# Store customer object in an instance variable | |
@customer = Stripe::Customer.retrieve(cid) |
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
<h1><%= @customer.email %> // <%= @customer.id %></h1> | |
<h2># Subscriptions: <%= @customer.subscriptions.total_count %></h2> | |
<ol> | |
<% @customer.subscriptions.each do |sub| %> | |
<li><%= sub.plan.name %></li> | |
<%end%> | |
</ol> |
OlderNewer