Skip to content
Advertisement

Error: Class ‘Stripe’ not found

I’m trying to use the Stripe php api in a Bolt extension but it’s having trouble finding the class. I added the Stripe library to composer.json:

JavaScript

And ran composer install. myextension/vendor/composer/autoload_classmap.php now shows the classes loaded:

JavaScript

And now I’m trying to use it in the extension like this:

JavaScript

But I get the error:

Error: Class ‘Stripe’ not found
File: extensions/local/andyjessop/myextension/Extension.php

I still haven’t got my head round autoloading, so I think I’m doing something basic wrong, but I can’t see what it is. Can anyone help?

Advertisement

Answer

You should include the composer autoload file.

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement