mollie / magento2

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

Payment status remains open when in fact it should be paid #615

Closed ThomasMW closed 1 year ago

ThomasMW commented 1 year ago

Describe the bug We are noticing quite a few orders where the payment status remains 'Open' even though the order was actually fully paid. Only after retrieving the payment status manually using the 'Fetch Status' button the payment status is set to 'Paid'. This creates a problem because the order is never set to processing and is not sent to our fulfillment party.

Used versions

Expected behavior After the customer pays the payment status should be set to 'Paid' so the order is set to 'Processing'.

Actual behavior The payment status remains open and the order is never processed and eventually canceled.

Additional context We only seem to have this issue when people use iDeal or Bancontact as a payment method.

Frank-Magmodules commented 1 year ago

HI @ThomasMW , thank you for opening this issue, it seems we can't directly reproduce this issue.

Can you please share the log files together with a screenshot of the webhook flow on these orders from the Mollie dashboard through our contact form so we can check together what's happening on these orders?

Thanks!

Telze commented 1 year ago

@ThomasMW @Frank-Magmodules Would you be so kind to share the solution here. Running into the same problem.

dverkade commented 1 year ago

@ThomasMW @Frank-Magmodules Having same issues here as well. Webhook in Mollie says successful. In the transactions tab the payment seems successful as well, but on the order overview screen it still says "open".

When manually clicking the "fetch status" button it will retrieve the payment status correct and update the order.

Frank-Magmodules commented 1 year ago

HI @dverkade , can you contact us directly as well so we can take a look into this? 
As this seems like a Webhook issue which makes it a bit hard to reproduce.

Medeka commented 1 year ago

Hello @Frank-Magmodules, we have the same issues since we updated Mollie to the latest version on Magento 2.4.5-p1. We shared all details with Mollie twice. It happens in about 10 percent of orders.

gjportegies commented 1 year ago

We're experiencing this issue as well on Magento 2.4.3-p3. Order is fully paid but stays on status "Processing". The order has an invoice which is paid.

At this point we are not able to create credit memo's for those orders.

gjportegies commented 1 year ago

We're experiencing a simular issue, multiple times per day, with orders getting cancelled where they should be paid. If we then open the issue and fetch the status manually the order hangs in the processing state (like this issue).

mollie-strange-behaviour

jesse-deboer commented 1 year ago

We are also experiencing this issue, we are running the following: PHP8.1 and Magento 2.4.5-p1

After updating Mollie from 2.20.0 to 2.20.1 this problem started to happen. When we downgraded the problem went away.

The notitications about the captured amount do show up, but the payment status is never updating which leaves the orders open while the payment is made and shown in the notifications

Quazz commented 1 year ago

As far as I can tell, in certain cases the 'sales_order_payment' table does not get updated correctly, thus making the backend report back incorrectly.

Mollie uses the "additional_information" field in particular for its display on an order.

What further complicates this is that the "fetch status" button compares the order state on Magento with the Mollie order state. If they match, it won't update.

So we can have an order in "processing" on both Mollie and Magento, but the additional_information field claims "created" for the payment only, despite the payment being processed fully otherwise as can be observed on Mollie dashboard.

By temporarily replacing $orderHasUpdate with true at https://github.com/mollie/magento2/blob/ef7ee97dc51a37ad0de682f25568625c0856d997/Controller/Adminhtml/Action/FetchOrderStatus.php#L34 the "Fetch status" button will update the status correctly.

Of course this isn't the cause of the problem, just a dirty workaround to force an update of the status manually.

Medeka commented 1 year ago

Yes in these cases the 'sales_order_payment' table has not been updated, even though an invoice has been created. The 'invoice' button also remains active so we can book the same invoice twice.

Frank-Magmodules commented 1 year ago

Thank you for opening up and for the input on this issue. It appears that the issue may be linked to changes in the default webhook response and/or the timing of that response. We are aware of this issue, but reproducing it has proven difficult. To ensure the effectiveness of our solution, we must conduct secure testing.

Still, it would be helpful if you could share the log files with us through our contact form so we can double-check the connection of the issue. We will provide an update shortly. Thank you for your valuable feedback thus far.

gjportegies commented 1 year ago

@Frank-Magmodules do you have an email? That form has a low filesize limit.

Frank-Magmodules commented 1 year ago

@Frank-Magmodules do you have an email? That form has a low filesize limit.

Sure @gjportegies , it's frank[AT]magmodules.eu

jorgb90 commented 1 year ago

Same issue here!

ThomasMW commented 1 year ago

Still, it would be helpful if you could share the log files with us through our contact form so we can double-check the connection of the issue. We will provide an update shortly. Thank you for your valuable feedback thus far.

Sure thing, I submitted a sample of 5 orders through the contact form.

peterjaap commented 1 year ago

Same issue here!

Frank-Magmodules commented 1 year ago

Received it @ThomasMW , thanks!

jesse-deboer commented 1 year ago

@Frank-Magmodules the solution for now if you are facing this issue is to temporarily downgrade to v2.20.0 right?

Frank-Magmodules commented 1 year ago

Thank you all for bringing this to our attention. Based on our investigation, it appears that the issue is related to the webhook firing faster than before, which results in an update before the order is saved into Magento. To address this, we have implemented a solution that involves appending an encrypted order ID to the webhook URL. This will serve as a fallback in situations where the transaction ID is not found in Magento.

In such cases, we will compare the order ID from the metadata in the loaded transaction on the Mollie side and set the transaction ID to the order to process the webhook. This will ensure that the order is properly processed and any necessary actions are taken. This solution is now available within our new 2.22.0 release.

We understand the importance of timely and accurate order processing and appreciate your patience as we work to resolve this issue. Please let us know if you have any further questions or concerns.

We are closing this issue now but please feel free to reopen the issue if this still occurs.