Home > OS >  Undefined type 'Stripe\StripeClient' while integrating Stripe with my php project
Undefined type 'Stripe\StripeClient' while integrating Stripe with my php project

Time:10-04

Pardon me if this has been asked already. I am a beginner trying to integrate stripe payment gateway in my PHP sample project. I installed stripe API using composer from enter image description here

I tried solution described in this stack overflow post

but no positive results appeared. Thanks in advance.

CodePudding user response:

try like this:

require_once('/stripe-php-master/init.php');

\Stripe\Stripe::setApiKey('stripe_sectet_key');


$customer = \Stripe\Customer::create([
    'description' => 'example customer',
    'email' => '[email protected]',
    'payment_method' => 'pm_card_visa',
]);

echo $customer;
  • Related