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

dmegatool created an issue. See original summary.

dmegatool’s picture

Issue summary: View changes
Nathaniel’s picture

Take a look at the composer.json file included with the module. It requires "square/connect": "^2.0"

dmegatool’s picture

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

>DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Updating dependencies (including require-dev)                        
Nothing to install or update
Generating autoload files
> DrupalProject\composer\ScriptHandler::createRequiredFiles

Running "composer update" in the module folder gives me

Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package drupal/commerce could not be found in any version, there may be a typo in the package name.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

So I'm trying to figuring this out now. Thanks for pointing me in the right direction ! :)

Nathaniel’s picture

Sure, I ended up adding it to composer.json in the Drupal root directory then ran composer update from there and it is working.

dmegatool’s picture

It 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

dmegatool’s picture

Status: Active » Closed (works as designed)