-
Notifications
You must be signed in to change notification settings - Fork 169
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
Move EVENT_AFTER_ORDER_PAID back to after order marked as complete and paid #670
Comments
Hi @emilyfitton not sure I understand, couldn't you use the |
Yep so I can run Order::EVENT_AFTER_COMPLETE_ORDER and check the order is Paid. However the docs imply that EVENT_AFTER_ORDER_PAID should run when an order is paid and complete.
However in practice what I have found is that when using this event $order->getIsPaid() is returning false as is $order->isCompleted. |
Hey @emilyfitton After digging around the code a bit I think I understand your frustration. In broad strokes you are right. The commit you reference, though, was also wrong, because the event was nested inside the conditionals that also checked if the order was getting completed and some gateway payment flows dictated that sometimes an order would get completed first and paid a bit later, so before that commit was made, the We'll talk about this internally and, if everything seems to be safe with moving that event to after the order is being completed on that request, we'll do so. |
No problem, its not holding anything up on my end as like you said I can use EVENT_AFTER_COMPLETE_ORDER for now. Just thought it was worth raising what I found along the way. |
Description
The change to the setup in here:
80f0f1c
Now means that this event is firing before the order is marked as complete and whilst isPaid is still false.
In practice this means that its not possible for a plugin to change the order status of an order after the order is completed.
Steps to reproduce
Additional info
The text was updated successfully, but these errors were encountered: