Problem loading Braintree library

Hi,

I’m trying to integrate braintree (https://www.braintreepayments.com/) as a payment gateway for a custom webshop.

Seems childishly simple (https://developers.braintreepayments.com/start/hello-server/php), 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 :

Braintree_Configuration::environment('sandbox');
Braintree_Configuration::merchantId('xxx');
Braintree_Configuration::publicKey('xxx');
Braintree_Configuration::privateKey('xxx');

Returns :

Error 
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 !