MultiSafepay / magento2

MultiSafepay plugin for Magento 2
Open Software License 3.0
19 stars 8 forks source link

Cannot create online refunds #39

Closed atty31 closed 1 year ago

atty31 commented 1 year ago

Describe the bug Getting Error: Call to a member function setMethodCode(), while creating a refund Magento: 2.4.4 MSP version: 2.21.0

To Reproduce

  1. Go to Order -> Invoices
  2. Press the credit memo button
  3. Make sure the return to stock is checked
  4. Press the refund button
  5. Exception is thrown

Expected behavior Credit memo should be created

Additional context `main.CRITICAL: Error: Call to a member function setMethodCode() on null in /data/web/magento2/vendor/multisafepay/magento2-core/Gateway/Http/Client/GenericGatewayRefundClient.php:62 Stack trace:

0 /data/web/magento2/vendor/magento/module-payment/Gateway/Command/GatewayCommand.php(106): MultiSafepay\ConnectCore\Gateway\Http\Client\GenericGatewayRefundClient->placeRequest()

1 /data/web/magento2/vendor/multisafepay/magento2-core/Model/Method/GenericAdapter.php(527): Magento\Payment\Gateway\Command\GatewayCommand->execute()

2 /data/web/magento2/vendor/multisafepay/magento2-core/Model/Method/GenericAdapter.php(451): MultiSafepay\ConnectCore\Model\Method\GenericAdapter->executeCommand()

3 /data/web/magento2/vendor/magento/module-sales/Model/Order/Payment.php(699): MultiSafepay\ConnectCore\Model\Method\GenericAdapter->refund()

4 /data/web/magento2/generated/code/Magento/Sales/Model/Order/Payment/Interceptor.php(221): Magento\Sales\Model\Order\Payment->refund()

5 /data/web/magento2/vendor/magento/module-sales/Model/Order/Creditmemo/RefundOperation.php(118): Magento\Sales\Model\Order\Payment\Interceptor->refund()

6 /data/web/magento2/vendor/magento/module-sales/Model/Order/RefundAdapter.php(39): Magento\Sales\Model\Order\Creditmemo\RefundOperation->execute()

7 /data/web/magento2/vendor/magento/module-sales/Model/Service/CreditmemoService.php(167): Magento\Sales\Model\Order\RefundAdapter->refund()

8 /data/web/magento2/vendor/magento/module-sales/Controller/Adminhtml/Order/Creditmemo/Save.php(119): Magento\Sales\Model\Service\CreditmemoService->refund()

9 /data/web/magento2/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Sales\Controller\Adminhtml\Order\Creditmemo\Save->execute()

10 /data/web/magento2/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Sales\Controller\Adminhtml\Order\Creditmemo\Save\Interceptor->___callParent()

11 /data/web/magento2/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Sales\Controller\Adminhtml\Order\Creditmemo\Save\Interceptor->Magento\Framework\Interception{closure}()

12 /data/web/magento2/generated/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/Save/Interceptor.php(23): Magento\Sales\Controller\Adminhtml\Order\Creditmemo\Save\Interceptor->___callPlugins()

13 /data/web/magento2/vendor/magento/framework/App/Action/Action.php(111): Magento\Sales\Controller\Adminhtml\Order\Creditmemo\Save\Interceptor->execute()

14 /data/web/magento2/vendor/magento/module-backend/App/AbstractAction.php(151): Magento\Framework\App\Action\Action->dispatch()

15 /data/web/magento2/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Backend\App\AbstractAction->dispatch()

16 /data/web/magento2/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Sales\Controller\Adminhtml\Order\Creditmemo\Save\Interceptor->___callParent()

17 /data/web/magento2/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(145): Magento\Sales\Controller\Adminhtml\Order\Creditmemo\Save\Interceptor->Magento\Framework\Interception{closure}()

18 /data/web/magento2/vendor/magento/framework/Interception/Interceptor.php(135): Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch()

19 /data/web/magento2/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Sales\Controller\Adminhtml\Order\Creditmemo\Save\Interceptor->Magento\Framework\Interception{closure}()

20 /data/web/magento2/generated/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/Save/Interceptor.php(32): Magento\Sales\Controller\Adminhtml\Order\Creditmemo\Save\Interceptor->___callPlugins()

21 /data/web/magento2/vendor/magento/framework/App/FrontController.php(245): Magento\Sales\Controller\Adminhtml\Order\Creditmemo\Save\Interceptor->dispatch()

22 /data/web/magento2/vendor/magento/framework/App/FrontController.php(212): Magento\Framework\App\FrontController->getActionResponse()

23 /data/web/magento2/vendor/magento/framework/App/FrontController.php(147): Magento\Framework\App\FrontController->processRequest()

24 /data/web/magento2/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch()

25 /data/web/magento2/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent()

26 /data/web/magento2/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}()

27 /data/web/magento2/generated/code/Magento/Framework/App/FrontController/Interceptor.php(23): Magento\Framework\App\FrontController\Interceptor->___callPlugins()

28 /data/web/magento2/vendor/magento/framework/App/Http.php(116): Magento\Framework\App\FrontController\Interceptor->dispatch()

29 /data/web/magento2/generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http->launch()

30 /data/web/magento2/vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http\Interceptor->launch()

31 /data/web/magento2/pub/index.php(89): Magento\Framework\App\Bootstrap->run()

32 {main} [] []

`

vinodsowdagar commented 1 year ago

Hi @atty31 ,

Thank you for the report. We have successfully reproduced this issue and added this issue to the backlog.

As soon as i have an update i will let you know.

vinodsowdagar commented 1 year ago

Hi @atty31 ,

We have just released a new version where this issue should be fixed: https://github.com/MultiSafepay/magento2/releases/tag/2.21.1

If there are any more problems related to this after changing to the latest version, please feel free to reopen this issue or create a new one.