Skip to content

PayPal failed eCheck change order status to Validated instead of Canceled #30518

Open
@fronke

Description

@fronke

When the IPN callback from Paypal is coming back few days after an echeck submission, the order get a history comment saying that the IPN Failed but change the order status to Validated instead of Canceled

Preconditions

  1. Magento 2.1.7, MySQL 5.7, PHP 7.0
  2. Nginx Server

Steps to reproduce

  1. Create an order and use Paypal to pay with a delayed payment (eCheck)
  2. Order status is changed to "Payment_reviewed"
  3. Paypal IPN callback is called on Magento website and returns a payment_status=failed (For example, there was insufficient funds on the customer bank account)
  4. Magento is adding the comment "IPN Failed" and changes the status to Validated

Expected result

  1. Magento is adding the comment "IPN Failed" and changes the status to Canceled

Actual result

  1. Magento is adding the comment "IPN Failed" and changes the status to Validated

screenshot from 2017-08-21 14-33-54

There is clearly a problem in Magento/Paypal/Model/Ipn _registerPaymentFailure() where the order is canceled. Invoices should be canceled before the order because the order cancellation cause a Validated status. So it's the exact opposite of what should happen and results in orders shipped without a received payment.

This is huge and was there already in Magento 1. I dont understand why it wasn't fixed earlier.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: PaymentsComponent: PaypalIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: ready for devReported on 2.1.xIndicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S2Major restrictions or short-term circumventions are required until a fix is available.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions