Commerce Square stopped working

Created on 12 August 2023, over 1 year ago
Updated 19 January 2024, 11 months ago

I am inviestigating an issue with a site that has stopped accepting payments. It's not a big site, though, and they're not sure exactly when things stopped working. They are running Drupal 10.1.1 and Commerce Square Connect 8.x-1.7.

Their status report is showing the following error:
"Square Connect OAuth access token is not valid. Please reconnect by submitting the Square settings form."

The values in the Square config settings have not changed and all are correct as far as I can see.
But submitting the Square settings form returns the following error:

----------

The website encountered an unexpected error. Please try again later.

ArgumentCountError: Too few arguments to function Square\Models\ObtainTokenRequest::__construct(), 2 passed in /home/forge/drupal/[site.com]/web/modules/contrib/commerce_square/src/Form/SquareSettings.php on line 249 and exactly 3 expected in Square\Models\ObtainTokenRequest->__construct() (line 61 of /home/forge/drupal/[site.com]/vendor/square/square/src/Models/ObtainTokenRequest.php).
Drupal\commerce_square\Form\SquareSettings->requestAccessToken() (Line: 127)
Drupal\commerce_square\Form\SquareSettings->buildForm()
call_user_func_array() (Line: 536)
Drupal\Core\Form\FormBuilder->retrieveForm() (Line: 283)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
Drupal\Core\Controller\FormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 583)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 166)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 74)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 704)
Drupal\Core\DrupalKernel->handle() (Line: 19)

----------

πŸ› Bug report
Status

Active

Version

1.7

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia Andrew.Macpherson

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024