wallee-payment / shopware-6

Wallee integration for Shopware 6.5 and greater
Apache License 2.0
3 stars 5 forks source link

placing order fails because the module assumes there are deliveries while there are none #11

Open darinda opened 1 year ago

darinda commented 1 year ago

When placing an order a fatal error is thrown

Error:
Call to a member function getId() on null

  at vendor/wallee/shopware-6/src/Core/Api/Transaction/Service/TransactionService.php:313
  at WalleePayment\Core\Api\Transaction\Service\TransactionService->holdDelivery('018a659d017673f0a0b72e0673b48e80', object(Context))
     (vendor/wallee/shopware-6/src/Core/Api/Transaction/Service/TransactionService.php:172)
  at WalleePayment\Core\Api\Transaction\Service\TransactionService->create(object(AsyncPaymentTransactionStruct), object(SalesChannelContext))
     (vendor/wallee/shopware-6/src/Core/Checkout/PaymentHandler/WalleePaymentHandler.php:86)
  at WalleePayment\Core\Checkout\PaymentHandler\WalleePaymentHandler->pay(object(AsyncPaymentTransactionStruct), object(RequestDataBag), object(SalesChannelContext))
     (vendor/shopware/core/Checkout/Payment/Cart/PaymentTransactionChainProcessor.php:130)
  at Shopware\Core\Checkout\Payment\Cart\PaymentTransactionChainProcessor->process('018a659d017673f0a0b72e0673b48e80', object(RequestDataBag), object(SalesChannelContext), '/checkout/finish?orderId=018a659d017673f0a0b72e0673b48e80&changedPayment=1', '/account/order/edit/018a659d017673f0a0b72e0673b48e80')
     (vendor/shopware/core/Checkout/Payment/PaymentService.php:90)
  at Shopware\Core\Checkout\Payment\PaymentService->handlePaymentByOrder('018a659d017673f0a0b72e0673b48e80', object(RequestDataBag), object(SalesChannelContext), '/checkout/finish?orderId=018a659d017673f0a0b72e0673b48e80&changedPayment=1', '/account/order/edit/018a659d017673f0a0b72e0673b48e80')
     (vendor/shopware/core/Checkout/Payment/SalesChannel/HandlePaymentMethodRoute.php:46)
  at Shopware\Core\Checkout\Payment\SalesChannel\HandlePaymentMethodRoute->load(object(Request), object(SalesChannelContext))
     (vendor/shopware/storefront/Controller/AccountOrderController.php:281)
  at Shopware\Storefront\Controller\AccountOrderController->updateOrder('018a659d017673f0a0b72e0673b48e80', object(Request), object(SalesChannelContext))
     (vendor/symfony/http-kernel/HttpKernel.php:182)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:76)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/http-kernel/Kernel.php:197)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request), 1, true)
     (vendor/shopware/core/HttpKernel.php:143)
  at Shopware\Core\HttpKernel->doHandle(object(Request), 1, true)
     (vendor/shopware/core/HttpKernel.php:65)
  at Shopware\Core\HttpKernel->handle(object(Request))
     (public/index.php:85)                

This is caused by the plugin trying to hold the delivery of an order while - when placing an order - there most probably is none yet.

This leads to the error when trying to get the id of the latest delivery in an empty collection.

Checking for existance fixes the problem.

Used shopware version: v6.5.5.1 Used module version: 5.0.2

Dominik-Niziol commented 2 months ago

Dear Darina,

Thank you for your email.

We will gladly take a closer look at your problem.

In order for us to look at the problem, please provide us with the following data: Shop Backend Login (full access recommended - Cache access necessary).

We kindly please you to send us your credentials through our ticketing system at info@wallee.com

Please make a complete backup before sending us the data.

We would like to point out that there may be short interruptions during interventions in the live system. We cannot accept any liability for such failures. If you do not agree with this, please only send us access data to a test system provided by you and mention this explicitly.

Sincerely, Dominik