I'm trying to test Stripe Checkout on my virtual server but when i try return this error:
Fatal error: Class 'Stripe\Customer' not found in
/home/user/public_html/charge.php on line 8
As suggested here I verified if the file ./config.php was existing with:
var_dump(file_exists("./config.php"));
It returns bool(true) being a PhP beginner im not sure what i'm doing wrong.
charge.php
config.php
Directory:
UPDATE
Okay so with changes suggested by Matthew getting new error. But i'm not sure where should I set the API key Stripe::setApiKey(<API-KEY>)? It's aleady set in config.php...
Fatal error: Uncaught exception 'Stripe\Error\Authentication' with
message 'No API key provided. (HINT: set your API key using
"Stripe::setApiKey()".in
/home/user/public_html/vendor/stripe/lib/ApiRequestor.php:127 Stack
trace: #0
/home/user/public_html/vendor/stripe/lib/ApiRequestor.php(59):
Stripe\ApiRequestor->_requestRaw('post', '/v1/customers', Array,
Array) #1
/home/user/public_html/vendor/stripe/lib/ApiResource.php(115):
Stripe\ApiRequestor->request('post', '/v1/customers', Array, Array) #2
/home/user/public_html/vendor/stripe/lib/ApiResource.php(155):
Stripe\ApiResource::_staticRequest('post', '/v1/customers', Array,
NULL) #3 /home/user/public_html/vendor/stripe/lib/Customer.php(37):
Stripe\ApiResource::_create(Array, NULL) #4
/home/user/public_html/charge.php(9): Stripe\Customer::create(Array)
5 {main} thrown in /home/user/public_html/vendor/stripe/lib/ApiRequestor.php on line 127