Php 条纹“;没有这样的标记:“;错误
我的条带帐户配置为Php 条纹“;没有这样的标记:“;错误,php,laravel,laravel-4,stripe-payments,Php,Laravel,Laravel 4,Stripe Payments,我的条带帐户配置为test。并在我的laravel应用程序中使用test键 在发布时,我正在创建新的条带用户,如果不存在这样的用户 Stripe::setApiKey(Config::get('constants.features.stripe.secret')); $token = $input['_token']; $customer = Stripe_Customer::create(array( "description" => "#{$user->
test
。并在我的laravel应用程序中使用test
键
在发布时,我正在创建新的条带用户
,如果不存在这样的用户
Stripe::setApiKey(Config::get('constants.features.stripe.secret'));
$token = $input['_token'];
$customer = Stripe_Customer::create(array(
"description" => "#{$user->id} / {$user->username} / {$user->email}",
"source" => $token,
"email" => $user->email
));
$charge = Stripe_Charge::create(array(
"amount" => '5000',
"currency" => "gbp",
"customer" => $customer->id,
"description" => 'description',
"statement_descriptor" => strtoupper("test desc")
));
像这样制造电荷
Stripe::setApiKey(Config::get('constants.features.stripe.secret'));
$token = $input['_token'];
$customer = Stripe_Customer::create(array(
"description" => "#{$user->id} / {$user->username} / {$user->email}",
"source" => $token,
"email" => $user->email
));
$charge = Stripe_Charge::create(array(
"amount" => '5000',
"currency" => "gbp",
"customer" => $customer->id,
"description" => 'description',
"statement_descriptor" => strtoupper("test desc")
));
但是它返回错误
Stripe\u invalidRequester没有这样的令牌:
从Laravel输入的\u令牌是CSRF令牌。这不是您应该传递给source
字段中stripe的令牌。source
字段中的令牌应该是stripe.js库生成的令牌,该库允许您识别客户信用卡,而无需实际查看卡的详细信息
stripe文档解释了应该如何处理此问题