Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. begin
  2. customer = Stripe::Customer.create(
  3. :email => params[:stripeEmail],
  4. :source => params[:stripeToken]
  5. )
  6. Stripe::Charge.create({
  7. :customer => customer.id,
  8. :amount => @amount,
  9. :description => "Payment recieved from #{params[:stripeEmail]} for the payment of order id #{@order.id}",
  10. :currency => "usd",
  11. }, {:stripe_account => StripeKeysForApp.last.uid} )
  12. rescue Stripe::CardError => e
  13. flash[:error] = e.message
  14. redirect_to new_charge_path
  15. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement