1
我跟着this link。如何在laravel中集成條紋支付網關?
我做了什麼,它說,但它拋出一些錯誤:
FatalErrorException in routes.php line 29: Class 'Stripe' not found Line 29 Stripe::setApiKey('sk_test_bDgMM85Y8hWWaRRBrulWNeng');
我跟着this link。如何在laravel中集成條紋支付網關?
我做了什麼,它說,但它拋出一些錯誤:
FatalErrorException in routes.php line 29: Class 'Stripe' not found Line 29 Stripe::setApiKey('sk_test_bDgMM85Y8hWWaRRBrulWNeng');
有幾件事情來檢查......
composer require stripe/stripe-php
composer dump-auto
use Stripe\Stripe;
Stripe\Stripe
和Stripe\Charge
訪問:舊版
Stripe::setApiKey('d8e8fca2dc0f896fd7cb4cb0031ba249');
$myCard = array('number' => '4242424242424242', 'exp_month' => 8, 'exp_year' => 2018);
$charge = Stripe_Charge::create(array('card' => $myCard, 'amount' => 2000, 'currency' => 'usd'));
echo $charge;
新版本
\Stripe\Stripe::setApiKey('d8e8fca2dc0f896fd7cb4cb0031ba249');
$myCard = array('number' => '4242424242424242', 'exp_month' => 8, 'exp_year' => 2018);
$charge = \Stripe\Charge::create(array('card' => $myCard, 'amount' => 2000, 'currency' => 'usd'));
echo $charge;
你通過作曲家安裝帶? – Criesto