Skip to content

Instantly share code, notes, and snippets.

@BillyParadise
Last active August 29, 2015 14:16
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 BillyParadise/304242e0201fd15e9154 to your computer and use it in GitHub Desktop.
Save BillyParadise/304242e0201fd15e9154 to your computer and use it in GitHub Desktop.
class ChargesController < ApplicationController
def new
end
def create
begin
customer = Stripe::Customer.create(
:email => current_user.email,
:source => params[:stripeToken]
)
customer.inspect
end
rescue Stripe::CardError => e
flash[:error] = e.message
redirect_to charges_path
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment