Problem loading Braintree library


I’m trying to integrate braintree ( as a payment gateway for a custom webshop.

Seems childishly simple (, but I cant’t get it to work.

I’ve put the braintree library inside the plugin folder, meaning it should automatically be required, right ?

Though the following in my code :


Returns :

Class 'Braintree_Configuration' not found

Does someone have an idea of why it isn’t loaded ?

Many thanks !

That depends. A plugin is only loaded if the folder name and the main file in that folder have the same name (see the docs). So if you put the complete Braintree folder into plugins, it won’t work.

I think the best solution would be to create new braintree folder in /site/plugins with a braintree.php that requires the main Braintree.php from the lib subfolder.

Thanks for the clarification, works like a charm !