When attempting to create a payment gateway I get an Error 500 when clicking save.
The error on the server log is : AH01071: Got error 'PHP message: PHP Fatal error: Class 'Sainsburys\\Guzzle\\Oauth2\\GrantType\\ClientCredentials' not found in /var/www/vhosts/ourwebsite/httpdocs/modules/commerce_paypal/src/ClientCredentials.php on line 12\n', referer: https://ourwebsite.co.uk/admin/commerce/config/payment-gateways/add
Any advice on resolving this would be appreciated. I don't have access to Composer, and have never used Ludwig, so idiot-friendly help would be beneficial.
Thanks
PG
Comments
Comment #2
jsacksick commentedThere's no way to fix that error without making sure the required library is present, it has to be downloaded using composer or Ludwig (See #3046124: Error PHP Fatal error: Class 'Sainsburys\Guzzle\Oauth2\GrantType\ClientCredentials' not found when I save payment gateway).
Comment #3
beulette commentedI think they should be written somewhere that we have to install Sainsburys.
I found that information nowhere, it use to be on most modules pages when required. Or there is a problem with our installations not correctly installing it ?
By the way, I found this, somewhere not related to commerce_paypal, it worked for me just to add the library via composer :
> composer require sainsburys/guzzle-oauth2-plugin
Comment #4
jsacksick commentedIt is required in the composer.json provided with the module (See https://git.drupalcode.org/project/commerce_paypal/blob/8.x-1.x/composer...).
So if you install the module with composer, its dependencies should be properly installed.
Comment #5
vinoth m commentedIs there any other solution for this? I am also facing the same problem. I am using shared hosting. So I don't have ssh and couldn't install the commerce PayPal via composer. So I used Ludwig for adding libraries. But this issue coming while add payment gateway. Please help me to fix this issue.
Thanks.
Comment #6
julianrob77 commentedHello, I have encountered this same issue and have tried the fixes listed here, but nothing has worked. I installed the library with composer, but I am not conivned that it actually did install properly. something seems to be wrong here with that. the devs were rude and told me composer support is 'out of scope' and that it all works for them! charming!
Comment #7
jsacksick commentedI'm not sure how you can qualify my comment as "rude". Requiring a library is not something unique only done by Commerce PayPal. If you install the PayPal module using composer (which is technically the only way to install the module properly), you shouldn't encounter any issue...
Have you tried simply running composer require drupal/commerce_paypal?
Also, one way to check that the library is properly installed is to check the vendor directory... If it's not there, it means the libary is missing.
Comment #8
jsacksick commentedI also invite you to read: https://www.drupal.org/docs/develop/using-composer/manage-dependencies#a...