Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi !
So I installed this module on a fresh install and I always get the same error. When I try to add a payment gateway, I got the message "The website encountered an unexpected error. Please try again later." Looking at the error_log files, the error is:
[proxy_fcgi:error] [pid 6938:tid 139637129455360] [client 67.71.35.xxx:44602] AH01071: Got error 'PHP message: Error: Class 'SquareConnect\\Api\\TransactionApi' not found in /var/www/vhosts/vps.ovh.ca/drupal8.url.com/web/modules/commerce_square/src/Plugin/Commerce/PaymentGateway/Square.php on line 55 #0 /var/www/vhosts/vps.ovh.ca/drupal8.url.com/web/modules/commerce_square/src/Plugin/Commerce/PaymentGateway/Square.php(70): Drupal\\commerce_square\\Plugin\\Commerce\\PaymentGateway\\Square->__construct(Array, 'square', Array, Object(Drupal\\Core\\Entity\\EntityTypeManager), Object(Drupal\\commerce_payment\\PaymentTypeManager), Object(Drupal\\commerce_payment\\PaymentMethodTypeManager), Object(Drupal\\Component\\Datetime\\Time))\n#1 /var/www/vhosts/vps.ovh.ca/drupal8.url.com/web/core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php(21): Drupal\\commerce_square\\Plugin\\Commerce\\PaymentGateway\\Square::create(Object(Drupal\\Core\\DependencyInjection\\Container), Array, 'square', Array)\n#2 /var/www/vhosts/vps.ovh.ca/drupal8.url.com/web/core/lib/Drupal/Component/Plu...\n', referer: http://drupal8.url.com/admin/commerce/config/payment-gateways
Anybody can help me out ? What's causing this ?
Comments
Comment #2
dmegatool CreditAttribution: dmegatool commentedComment #3
Nathaniel CreditAttribution: Nathaniel commentedTake a look at the composer.json file included with the module. It requires
"square/connect": "^2.0"
Comment #4
dmegatool CreditAttribution: dmegatool commentedI'm pretty new to composer. I ran "composer update" in the folder I created for the project. I thought everything would be downloaded...
That gives me
Running "composer update" in the module folder gives me
So I'm trying to figuring this out now. Thanks for pointing me in the right direction ! :)
Comment #5
Nathaniel CreditAttribution: Nathaniel commentedSure, I ended up adding it to composer.json in the Drupal root directory then ran composer update from there and it is working.
Comment #6
dmegatool CreditAttribution: dmegatool commentedIt indeed worked, I just figured that out. I didn't expect to have some copy/paste job to do. I need to get my way around Composer and know how it really works. Thanks for the help ! :D
Comment #7
dmegatool CreditAttribution: dmegatool commented