カテゴリー:
Fatal error
閲覧数:438 配信日:2019-04-10 12:55
エラーメッセージ
( ! ) Fatal error: Uncaught Error: Class 'Stripe\Checkout\Session' not found in
エラーコード
require_once( dirname(__FILE__).'/../../vendor/autoload.php');
// Set your secret key: remember to change this to your live secret key in production
// See your keys here: https://dashboard.stripe.com/account/apikeys
\Stripe\Stripe::setApiKey("sk_test_xxxx");
$checkoutSession = \Stripe\Checkout\Session::create([
'success_url' => 'https://www.example.com/success',
'cancel_url' => 'https://www.example.com/cancel',
'payment_method_types' => ['card'],
'line_items' => [[
'amount' => 2000,
'quantity' => 2,
'name' => 'Blue banana',
'currency' => 'usd',
'images' => ['https://www.example.com/banana.png']
]]
], [
'stripe_version' => '2018-11-08; checkout_sessions_beta=v1'
]);
エラー原因
パッケージバージョンが古かった