Skip to content
This repository was archived by the owner on Feb 27, 2023. It is now read-only.

Commit 44684b3

Browse files
committed
allow specific customer
1 parent 5ce4c5f commit 44684b3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

web.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,14 @@
3535
authenticate!
3636
# Get the credit card details submitted by the form
3737
source = params[:source]
38-
38+
customer = params[:customer_id] || @customer.id
39+
3940
# Create the charge on Stripe's servers - this will charge the user's card
4041
begin
4142
charge = Stripe::Charge.create(
4243
:amount => params[:amount], # this number should be in cents
4344
:currency => "usd",
44-
:customer => @customer.id,
45+
:customer => customer,
4546
:source => source,
4647
:description => "Example Charge",
4748
:shipping => params[:shipping],

0 commit comments

Comments
 (0)