-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Advance the order state to processing when a capture notification is received #25876
Conversation
…or pending_payment
Hi @azambon. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
Hi @dmytro-ch, thank you for the review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I endorse this PR and I think it should also be backported in version 2.3
Hi @azambon I checked PR changes and payment status is remaining "Pending Payment" after order was placed.
Expected result: Actual result: Could you take a look? |
Hello @engcom-Delta , I think that there are two issues with your test:
For reference, here are a few screenshots of some tests I did. Here's an order with Paypal Hosted Pro set to "Authorize". This is without this PR, just what happens in a clean Magento installation. Notice how the state changes from "Pending payment" to "Processing", even without this PR. Also notice how the transaction data appear in the "Payment information" section. Now another order, this time with Paypal set to "Sale". Again this is without this PR and the two pictures show the order before and after the IPN request. The payment information appear just like before, but this time the state remains set to "Pending payment". This is the bug that this PR fixes. One last picture, this time with the PR. Paypal is still set to "Sale". There's only the "after" picture because I forgot to take the "before" one, but it would be identical to the one of the previous case. And this time the state gets updated to "Processing" as expected. |
@magento give me test instance |
Hi @engcom-Delta. Thank you for your request. I'm working on Magento instance for you |
Hi @engcom-Delta, here is your new Magento instance. |
✔️ QA passed |
…ification is received #25876
Hi @azambon, thank you for your contribution! |
Description (*)
When the registerCaptureNotificationCommand is executed, if the order is in state "new" or "pending payment", then its state is advanced to "processing", as it was up to Magento 2.2.5.
This should fix issues with orders remaining in "pending payment" state even though they were correctly paid. See issue #25659
Previously this command would set the state to "processing" only if the order did not already have a state set. This PR changes that check to do the same for "new" and "pending payment" orders too.
The unit test covering the command has been updated to include the new test cases.
Fixed Issues (if relevant)
#25659: Paypal Payments Pro IPN keeping payments marked as Pending Payment
Manual testing scenarios (*)
Prerequisite: a payment method must be installed and enabled that initially creates orders in state "new" or "pending payment" and then uses the "registerCaptureNotification" command to indicate when the payment is captured.