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

paultgreen created an issue. See original summary.

jsacksick’s picture

Status: Active » Closed (duplicate)

There'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).

beulette’s picture

I 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

jsacksick’s picture

It 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.

vinoth m’s picture

Is 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.

julianrob77’s picture

Hello, 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!

jsacksick’s picture

I'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.

jsacksick’s picture