Canceling an order causes fatal error

Created on 9 March 2023, over 1 year ago
Updated 20 September 2024, 2 months ago

Problem/Motivation

Cancelling an order, with the expectation of voiding the tax request, causes a fatal error:

The watchdog log for the request:

POST error Exception

api/v2/companies//transactions/DC-3d1f724c-4f7a-424d-9f4d-c3ce790e3d0b/void

Request:

array(
  'json' => array(
    'code' => 'DocVoided',
  ),
)

Response:

NULL

and the PHP error:

TypeError: Drupal\commerce_avatax\AvataxLib::doRequest(): Return value must be of type array, null returned in Drupal\commerce_avatax\AvataxLib->doRequest() (line 617 of /Users/morbus/Sites/tsg-ecs-web-3/web/modules/contrib/commerce_avatax/src/AvataxLib.php)

#0 /Users/morbus/Sites/tsg-ecs-web-3/web/modules/contrib/commerce_avatax/src/AvataxLib.php(192): Drupal\commerce_avatax\AvataxLib->doRequest('POST', 'api/v2/companie...', Array)
#1 /Users/morbus/Sites/tsg-ecs-web-3/web/modules/contrib/commerce_avatax/src/EventSubscriber/OrderSubscriber.php(103): Drupal\commerce_avatax\AvataxLib->transactionsVoid(Object(Drupal\commerce_order\Entity\Order))
#2 /Users/morbus/Sites/tsg-ecs-web-3/web/modules/contrib/commerce_avatax/src/EventSubscriber/OrderSubscriber.php(79): Drupal\commerce_avatax\EventSubscriber\OrderSubscriber->voidTransaction(Object(Drupal\commerce_order\Entity\Order))

Steps to reproduce

1. Create an order as normal.
2. Using the order workflow buttons, "Cancel order".

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

1.1

Component

User interface

Created by

🇺🇸United States morbus iff

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

Comments & Activities

Production build 0.71.5 2024