Level 12
Did you add the package to your composer.json and the provider/alias to config\app.php?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
So I installed the stripe package
https://packagist.org/packages/stripe/stripe-php
And I try and use the wrapper
<?php namespace Mybilling\Billing;
class StripeBilling implements BillingInterface {
function __construct() {
Stripe::setApiKey(Config::get('stripe.secret_key'));
}
?>
I get the error - Class 'Mybilling\Billing\Stripe' not found
The stripe package is in vendor/stripe, I have run composer so I assume it is being included. Do I need an alias?
If you're following the example I think you are:
<?php namespace MyBilling\Billing;
use Stripe;
use Stripe_Charge;
use Stripe_Customer;
use Stripe_InvalidRequestError;
use Stripe_CardError;
use Config;
class StripeBilling implements BillingInterface {
function __construct() {
Stripe::setApiKey(Config::get('stripe.secret_key'));
}
?>
What have you got for Stripe in composer.json?
Please or to participate in this conversation.