Stripe charge multiple times

0xSina picture 0xSina · Apr 16, 2014 · Viewed 7.1k times · Source

Using Stripe.js, I get a card token that I can then use to charge via:

Stripe::Charge.create(
  :amount => 400,
  :currency => "usd",
  :card => "tok_103rC02eZvKYlo2C2RD5docg", # obtained with Stripe.js,
  :metadata => {'order_id' => '6735'}
)

Can I use the same card token multiple times to charge the customer or is it 1 token/charge and any subsequent charge, I will have to grab a new token?

Answer

Larry Ullman picture Larry Ullman · Apr 16, 2014

Good question! When you use the token in that manner, it's immediately consumed, so it can't be used again. However, you can instead provide that token as the card argument when creating a Customer object in Stripe. Then you can perform multiple charges against that Customer.

Hope that helps. Larry

PS I work on Support at Stripe.