Answers for "The token has already been used. Each token can only be used once to create a source."

0

The token has already been used. Each token can only be used once to create a source.

You do use the token twice.

First, when creating the customer. Second, when trying to charge the card.

Instead, you can create a customer and and then pass $customer->id to Stripe 
when you create the charge:

$charge = \Stripe\Charge::create(array(
  "amount" => 1000, // amount in cents, again
  "currency" => "cad",
  "customer" => $customer->id,
  "description" => "Example charge")
);
Posted by: Guest on April-20-2021

Code answers related to "The token has already been used. Each token can only be used once to create a source."

Browse Popular Code Answers by Language