mollie / magento2

Mollie Payments for Magento 2
https://www.mollie.com
Other
98 stars 49 forks source link

[BUG] Creating order in admin backend with payment link -> wrong status #757

Closed simonmaass closed 1 month ago

simonmaass commented 3 months ago

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:

image

Used versions

To Reproduce Steps to reproduce the behavior:

  1. Create new order with payment method "Payment Link"
  2. 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!!!

Frank-Magmodules commented 3 months ago

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.

simonmaass commented 3 months ago

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.

Frank-Magmodules commented 3 months ago

Hi There @simonmaass ,

Thank you for your response on it, sure, this was roughly the idea this;

But feel free to share your thoughts on this as well.

Frank-Magmodules commented 3 months ago

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.

simonmaass commented 2 months ago

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:

I hope this will help to recreated the misaligned order/payment status... we are also open for a short video call... BR Simon

Frank-Magmodules commented 1 month ago

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!