paynl / magento2-plugin

The Pay. plugin for Magento 2
https://www.pay.nl
27 stars 31 forks source link

'last_trans_id' not always set in Order Cancel After observer #183

Closed femkepetter closed 1 year ago

femkepetter commented 1 year ago

Hi,

We're having some issues with this extension, where it tries to use an empty array key to get the pay order ID. This results in str_replace being used with a null value as subject, which is deprecated and results in a critical error.

[2023-08-21T08:47:49.042499+00:00] .CRITICAL: Exception message: Deprecated Functionality: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /data/web/releases/20230821081231/vendor/paynl/magento2-plugin/Observer/OrderCancelAfter.php on line 51

This observer is also fired for all order cancellations, it might be good to only try to handle orders payed with paynl. As far as I can tell it now tries to interact with any cancelled order.

escruickshank commented 1 year ago

Hi! Thank you for your message. We will look into this. If we decide to release a fix for this, I will share the release version here.