Error When Trying to Complete Checkout

Created on 16 November 2023, about 1 year ago

I have the module installed and created a few Gift Card products that the user can purchase. However when they try and complete the transaction it gives a white screen. The order is recorded and saved and I see a code has been created in Gift Cards but checking the error log and I see the below message. Doesn't happen when they just purchase a normal product just happens when trying to purchase the new Gift Card product.

Error: Call to a member function get() on null in /sites/all/modules/commerce_webhook/src/Service/OrderNormalizer.php on line 50 #0 /sites/all/modules/commerce_webhook/src/EventSubscriber/OrderCompleteSubscriber.php(47): Drupal\commerce_webhook\Service\OrderNormalizer::normalize(Object(Drupal\commerce_order\Entity\Order))
#1 /sites/all/modules/commerce_webhook/src/EventSubscriber/OrderCompleteSubscriber.php(33): Drupal\commerce_webhook\EventSubscriber\OrderCompleteSubscriber->transmitOrder(Object(Drupal\commerce_order\Entity\Order), 'order_new')
#2 [internal function]: Drupal\commerce_webhook\EventSubscriber\OrderCompleteSubscriber->onOrderPlaced(Object(Drupal\state_machine\Event\WorkflowTransitionEvent), 'commerce_order....', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#3 /core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func(Array, Object(Drupal\state_machine\Event\WorkflowTransitionEvent), 'commerce_order....', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#4 /modules/contrib/state_machine/src/Plugin/Field/FieldType/StateItem.php(422): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object(Drupal\state_machine\Event\WorkflowTransitionEvent), 'commerce_order....')
#5 /modules/contrib/state_machine/src/Plugin/Field/FieldType/StateItem.php(389): Drupal\state_machine\Plugin\Field\FieldType\StateItem->dispatchTransitionEvent('post_transition')
#6 [internal function]: Drupal\state_machine\Plugin\Field\FieldType\StateItem->postSave(true)
#7 /core/lib/Drupal/Core/Field/FieldItemList.php(233): call_user_func_array(Array, Array)
#8 /core/lib/Drupal/Core/Field/FieldItemList.php(198): Drupal\Core\Field\FieldItemList->delegateMethod('postSave', true)
#9 [internal function]: Drupal\Core\Field\FieldItemList->postSave(true)
#10 /core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(938): call_user_func_array(Array, Array)
#11 /core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(970): Drupal\Core\Entity\ContentEntityStorageBase->invokeFieldMethod('postSave', Object(Drupal\commerce_order\Entity\Order), true)
#12 /core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(896): Drupal\Core\Entity\ContentEntityStorageBase->invokeFieldPostSave(Object(Drupal\commerce_order\Entity\Order), true)
#13 /modules/contrib/commerce/src/CommerceContentEntityStorage.php(56): Drupal\Core\Entity\ContentEntityStorageBase->invokeHook('update', Object(Drupal\commerce_order\Entity\Order))
#14 /modules/contrib/commerce/modules/order/src/OrderStorage.php(81): Drupal\commerce\CommerceContentEntityStorage->invokeHook('update', Object(Drupal\commerce_order\Entity\Order))
#15 /core/lib/Drupal/Core/Entity/EntityStorageBase.php(598): Drupal\commerce_order\OrderStorage->invokeHook('update', Object(Drupal\commerce_order\Entity\Order))
#16 /core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(781): Drupal\Core\Entity\EntityStorageBase->doPostSave(Object(Drupal\commerce_order\Entity\Order), true)
#17 /core/lib/Drupal/Core/Entity/EntityStorageBase.php(523): Drupal\Core\Entity\ContentEntityStorageBase->doPostSave(Object(Drupal\commerce_order\Entity\Order), true)
#18 /core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(804): Drupal\Core\Entity\EntityStorageBase->save(Object(Drupal\commerce_order\Entity\Order))
#19 /modules/contrib/commerce/modules/order/src/OrderStorage.php(159): Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object(Drupal\commerce_order\Entity\Order))
#20 /core/lib/Drupal/Core/Entity/EntityBase.php(339): Drupal\commerce_order\OrderStorage->save(Object(Drupal\commerce_order\Entity\Order))
#21 /modules/contrib/commerce/modules/checkout/src/Plugin/Commerce/CheckoutFlow/CheckoutFlowBase.php(220): Drupal\Core\Entity\EntityBase->save()
#22 /modules/contrib/commerce/modules/payment/src/Plugin/Commerce/CheckoutPane/PaymentProcess.php(232): Drupal\commerce_checkout\Plugin\Commerce\CheckoutFlow\CheckoutFlowBase->redirectToStep('complete')
#23 /modules/contrib/commerce/modules/checkout/src/Plugin/Commerce/CheckoutFlow/CheckoutFlowWithPanesBase.php(546): Drupal\commerce_payment\Plugin\Commerce\CheckoutPane\PaymentProcess->buildPaneForm(Array, Object(Drupal\Core\Form\FormState), Array)
#24 [internal function]: Drupal\commerce_checkout\Plugin\Commerce\CheckoutFlow\CheckoutFlowWithPanesBase->buildForm(Array, Object(Drupal\Core\Form\FormState), 'payment')
#25 /core/lib/Drupal/Core/Form/FormBuilder.php(536): call_user_func_array(Array, Array)
#26 /core/lib/Drupal/Core/Form/FormBuilder.php(283): Drupal\Core\Form\FormBuilder->retrieveForm('commerce_checko...', Object(Drupal\Core\Form\FormState))
#27 /core/lib/Drupal/Core/Form/FormBuilder.php(224): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\commerce_checkout\Plugin\Commerce\CheckoutFlow\MultistepDefault), Object(Drupal\Core\Form\FormState))
#28 /modules/contrib/commerce/modules/checkout/src/Controller/CheckoutController.php(143): Drupal\Core\Form\FormBuilder->getForm(Object(Drupal\commerce_checkout\Plugin\Commerce\CheckoutFlow\MultistepDefault), 'payment')
#29 [internal function]: Drupal\commerce_checkout\Controller\CheckoutController->formPage(Object(Drupal\Core\Routing\RouteMatch))
#30 /core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#31 /core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#32 /core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#33 /core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#34 /vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#35 /vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#36 /core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#37 /core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#38 /core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#39 /core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#40 /core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#41 /core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#42 /vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#43 /core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#44 /index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#45 {main}
πŸ’¬ Support request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States ryanfc78

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

Comments & Activities

Production build 0.71.5 2024