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?
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.