From fa25612b403c6c53ad037d16a7a00eb71f399743 Mon Sep 17 00:00:00 2001 From: Ricardo Velhote Date: Wed, 1 Jun 2022 23:40:36 +0100 Subject: [PATCH] Fix Failed IPN changing to Payment Received incorrectly (#617) --- app/code/core/Mage/Paypal/Model/Ipn.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/code/core/Mage/Paypal/Model/Ipn.php b/app/code/core/Mage/Paypal/Model/Ipn.php index 91f0e46f634..0d322a1a34d 100644 --- a/app/code/core/Mage/Paypal/Model/Ipn.php +++ b/app/code/core/Mage/Paypal/Model/Ipn.php @@ -532,6 +532,11 @@ protected function _registerPaymentDenial() protected function _registerPaymentFailure() { $this->_importPaymentInformation(); + + foreach ($this->_order->getInvoiceCollection() as $invoice){ + $invoice->cancel()->save(); + } + $this->_order ->registerCancellation($this->_createIpnComment(''), false) ->save();