magento2
magento2 copied to clipboard
[BUG] Creating order in admin backend with payment link -> wrong status
Describe the bug When creating an order in the admin backend with payment method "payment link" the order is created with the status "pending". The order should be created with the status "pending payment" as set in the settings:
Used versions
- Magento Version number(eg 2.3.5): 2.4.6-p4
- Open source/Enterprise/B2b: OS
- Mollie version number (Check configuration): 2.35.1
To Reproduce Steps to reproduce the behavior:
- Create new order with payment method "Payment Link"
- Check new status order is created
There is a much bigger problem behind this!!
If you now create a shipment and ship the order the payment link totally breaks and creates a direct redirect to the order status page which of course cannot display any info and creates this magento error:
TypeError
/Magento/Webapi/Controller/Rest/Interceptor.php in Magento\Webapi\Controller\Rest\Interceptor::dispatch
New
Level: Error
substr(): Argument #1 ($string) must be of type string, null given
Expected behavior Order should be set to "pending payment" and you should not be able to create shipments or invoices!!!
Actual behavior Order is created as "pending" and only jumps to "pending payment" once you first click on the payment link.
Screenshots If applicable, add screenshots to help explain your problem.
Additional context The problem with this state is that order are able to be shipped in the status "pending" and this can lead to very ugly states!!!
Thank you for opening this issue @simonmaass .
The payment link method has a custom order status option available, which can be found under: Stores -> Configuration -> Mollie -> Payment Methods -> Payment Link -> Status New. So it’s expected that it’s not following the other option.
For the other mentioned problem, could you elaborate more about this? On a vanilla Magento installation with only Mollie installed, Magento is working as expected.
Thank you for the hint with the option of setting a different initial status for payment link orders. Just out of curiosity: What is the reason to not set the order as "pending payment"?
In order to elaborate more about the problem: If an order is set to "pending" you are able to ship and also invoice this order eventhou the order is not paid yet. When creating a shipment when the order in on pending and it has not been paid yet via the payment link, then the flow is messed up. For example is the payment link redirected to order page (proably the system thinks it is already paid as the order jumps to "processing" if you ship it.
Hi There @simonmaass ,
Thank you for your response on it, sure, this was roughly the idea this;
- If a payment link status is set -> Use that.
- If not, then revert to the default status it was referring to initially.
But feel free to share your thoughts on this as well.
Hey @simonmaass, I hope everything is fine on your end. Did our previous response answer your question? It appears that this issue may be related more to configuration than being an actual bug within the plugin. We'll investigate further to make this more clear for everyone of course. However, I'm happy to close it if you're satisfied for now.
Hey @Frank-Magmodules , thank you for getting back!
As stated here: "If an order is set to "pending" you are able to ship and also invoice this order eventhou the order is not paid yet. When creating a shipment when the order in on pending and it has not been paid yet via the payment link, then the flow is messed up. For example is the payment link redirected to order page (proably the system thinks it is already paid as the order jumps to "processing" if you ship it."
Let me try to make it more clear where the bug is created:
- Create order with payment link (order is set to pending)
- Now ship the order (before the order is paid)
- Now click on the payment link -> this will result in the described bug
I hope this will help to recreated the misaligned order/payment status... we are also open for a short video call... BR Simon
Hi There @simonmaass ,
With the instructions of your last response, we were finally able to reproduce the issue. We changed the default status for payment link orders to “pending payment” as it makes more sense. This is available in the last version that we just released.
For now, we'll mark this issue as resolved. However, please don't hesitate to reach out or reopen if further action is necessary.
Thanks again!