Ingenico-ePayments / connect-extension-magento2

Ingenico Connect based Shopping Cart Extension for Magento 2.x
https://epayments.developer-ingenico.com/documentation/ecommerce-extensions/magento-2/
MIT License
4 stars 4 forks source link

PHP Fatal error: Uncaught TypeError: Argument 2 passed to Ingenico\Connect\Model\Ingenico\Status\Payment\Resolver... #18

Closed sergiuec closed 1 year ago

sergiuec commented 3 years ago

Hello, we have an issue. After order has been refunded the order details page at backend is not accessible anymore, 500 error is returned.

the error in error.log is as follows:

PHP Fatal error: Uncaught TypeError: Argument 2 passed to Ingenico\Connect\Model\Ingenico\Status\Payment\Resolver::resolve() must be an instance of Ingenico\Connect\Sdk\Domain\Payment\Definitions\Payment, instance of Ingenico\Connect\Sdk\Domain\Refund\RefundResponse given, called in /app/xxxx/vendor/ingenico-epayments/connect-extension-magento2/Model/Ingenico/Action/RetrievePayment.php on line 109 and defined in /app/xxxx/vendor/ingenico-epayments/connect-extension-magento2/Model/Ingenico/Status/Payment/Resolver.php:39 Stack trace:

0 /app/xxxx/vendor/ingenico-epayments/connect-extension-magento2/Model/Ingenico/Action/RetrievePayment.php(109): Ingenico\Connect\Model\Ingenico\Status\Payment\Resolver->resolve(Object(Magento\Sales\Model\Order\Interceptor), Object(Ingenico\Connect\Sdk\Domain\Refund\RefundResponse))

1 /app/xxxx/vendor/ingenico-epayments/connect-extension-magento2/Plugin/Magento/Sales/Controller/Adminhtml/Order/View.php(52): Ingenico\Connect\Model\Ingenico\Action\RetrievePayment in /app/xxxx/vendor/ingenico-epayments/connect-extension-magento2/Model/Ingenico/Status/Payment/Resolver.php on line 39

we are using: Ingenico 2.4.5 Magento commerce 2.3.6

kanduvisla commented 3 years ago

Hi @sergiuec ,

We'll look into this issue.

As a temporary workaround, you could disable the update_order_for_capture_requested-plugin in your own custom code. Create (or edit) etc/adminhtml/di.xml with the following:

    <type name="Magento\Sales\Controller\Adminhtml\Order\View">
        <plugin name="update_order_for_capture_requested" disabled="true"/>
    </type>

This plugin calls an update call each time the order is viewed so you can have a quicker transition from the CAPTURE_REQUESTED- to the CAPTURED-state, which is required if you want to perform a refund.

You can always use the manual "update payment"-button or simply wait for the webhook to arrive.

kanduvisla commented 3 years ago

Hi @sergiuec ,

Could you please provide the following information to help us reproduce the issue?

sergiuec commented 3 years ago

Hi @sergiuec ,

Could you please provide the following information to help us reproduce the issue?

* How is the module configured?

  * What checkout type are you using? (Hosted? Inline? Payment products in Magento checkout, input fields on Hosted Checkout?)
  * What capture mode are you using? (Delayed settlement? Direct capture?)

* Provide order details

  * Is it a guest checkout or a registered customer?
  * What's the country & currency?
  * What is the selected payment product?
kanduvisla commented 3 years ago

Hi @sergiuec ,

We've just uploaded version 2.4.6 of our module that should fix your problem. Could you please confirm that this fixes the issue for you?

sergiuec commented 3 years ago

Hi @sergiuec ,

We've just uploaded version 2.4.6 of our module that should fix your problem. Could you please confirm that this fixes the issue for you?

Ok, Thank you very much. We will check it as soon as possible and will let you know.