I have a page where a user enters a cc and get's charged.
I create a card token using js
Stripe.card.createToken(ccData, function stripeResponseHandler(status, response) {
var token = response.id;
// add the cc info to the user using
// charge the cc for an amount
});
To add the cc I'm using php
$stripeResp = Stripe_Customer::retrieve($stripeUserId);
$stripeResp->sources->create(['source' => $cardToken]);
To charge the cc I'm using php as well
$stripeCharge = Stripe_Charge::create([
'source' => $token,
'amount' => $amount
]);
Doing all this i get You cannot use a Stripe token more than once
.
Any ideas how can i save the cc to this user $stripeUserId
and charge it.
PHP is welcome, but js is great too.