📜  令牌已被使用.每个令牌只能使用一次来创建一个源. - 无论代码示例

📅  最后修改于: 2022-03-11 15:00:49.584000             🧑  作者: Mango

代码示例1
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")
);