Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 条纹“;没有这样的标记:“;错误_Php_Laravel_Laravel 4_Stripe Payments - Fatal编程技术网

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文档解释了应该如何处理此问题