adyen-magento2 icon indicating copy to clipboard operation
adyen-magento2 copied to clipboard

[ECP-9246] Unable to create Credit Memos for orders containing deleted products.

Open SamJUK opened this issue 8 months ago • 5 comments

Describe the bug Unable to create a credit memo for orders containing deleted products. Getting the following Error message An error has happened during application run. See exception log for details. With the following log message

[2024-05-29T12:01:30.491360+00:00] main.CRITICAL: Error: Call to a member function getId() on null in /vendor/adyen/module-payment/Helper/OpenInvoice.php:190

To Reproduce Steps to reproduce the behavior:

  1. Create a product
  2. Place an order using said product
  3. Invoice & Ship the order
  4. Delete the product
  5. Attempt to create a credit memo for the order

Expected behavior Credit memo to create successfully.

Magento version 2.4.5-p7

Plugin version 9.5.2

Additional Information It should be expected that calling getProduct on a order item could return null, in the case the original product no longer exists in the catalog. Either should be looking to use the data baked into the line item, or have logic to handle cases where the original item no longer exists.

SamJUK avatar May 29 '24 12:05 SamJUK