mollie / magento2

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

Connection between transaction_id and magento order id lost after multiple payment tries #773

Closed patricksteenks closed 1 month ago

patricksteenks commented 2 months ago

Describe the bug We have a problem with some payments through iDeal or Paypal payment methods. The problems seem to have appeared/increased since april 15th, when we switched to magento 2.4.6-p5 open source.

There are some orders in magento which get a payment failed/cancelled status. When searching for these orders in Mollie, we see multiple payment start by a customer (usually 3), of which two fail and one succeeds.

However, the transaction_id of the succeeded payment is not linked to the magento order. In stead, this one still refers to the failed order. After a while the order is cancelled, because the payment on this transaction_id failed. This is not correct, as the customer has paid through mollie on a different transaction_id.

Used versions

To Reproduce Steps to reproduce the behavior:

  1. Check order in magento and check transaction id
  2. See status "cancelled" because of payment not received
  3. Check order in Mollie: several payment attempts, one transaction succeed
  4. Compare transaction_id with transaction_id in magento = different

Expected behavior Each order that is successfully paid through mollie should be getting the correct status in magento

Actual behavior Some orders that are successfully paid, are not updated correctly in magento.

Screenshots Because of privacy concerns we can not share the order and transaction id's here, but are happy to share them through mail.

Sental commented 2 months ago

I am intermittently seeing this with orders created using the payment links as well.

patricksteenks commented 2 months ago

Is there any news on this? Is this investigated already?

Frank-Magmodules commented 2 months ago

Hello @patricksteenks and @Sental, we couldn't reproduce this issue directly, but we're still actively investigating, especially regarding your observation about it occurring since the Magento version update. I'll provide a follow-up shortly as this is a priority on our list.

Frank-Magmodules commented 2 months ago

HI here @patricksteenks and @Sental , can you please share environment details and/or logs regarding this, so we can take a look with you? As it seems we are unable to reproduce it atm.

Sental commented 2 months ago

@Frank-Magmodules Unfortunately there aren't any logs from the magento side for this problem but you should be able to recreate following these steps.

  1. create an order in the magento admin with the payment link payment method.
  2. Open the recieved link and then fail to sucessfuly pay for the order.
  3. try a second time to pay for the order using the same link and complete the payment.

The payment in mollie should then have a different transaction id to the one in the magento system. Meaning the link between the order & the mollie payment is broken and the transaction id of the paid order in mollie doesn't exist in magento and the magento order is left on pending payment.

I did also ask mollie support, their current answer is the only way to solve this is manually marking the order in magento as paid.

patricksteenks commented 2 months ago

I will do my best to share. But I agree with Mark, there aren't any concrete logs in magento that I can share. Except that I see in mollie that for each payment attempt new transaction_ids are created, which lead to a disconnect between the store transaction id in magento and the one in mollie. Because of the loss of this link, the transaction can not be updated in magento.

patricksteenks commented 1 month ago

Upon further examination I see in the orders that the first redirect to mollie after an order leads to a successfull payment. In the magento logs I see some minutes later that the customer is again lead to mollie, but that payment is not completed.

In magento after this second redirect to mollie, a new mollie transaction_id is connected to the order. But as this payment is not completed, the next day the order gets status cancelled.

Why is the customer redirecting to mollie after a successfull payment? I can provide you with the logs in a personal message @Frank-Magmodules

Frank-Magmodules commented 1 month ago

Hey @patricksteenks, thanks for your message. With input from @Sental, we've made good progress in tackling this issue. It's likely to be addressed in the upcoming release, which is currently in the manual Q&A testing phase. Once I can confirm it's sorted, I'll get back to you promptly. Thanks for your patience, again!

Frank-Magmodules commented 1 month ago

Hi There!

We just released a new version that addresses the bugs mentioned in this issue. Especially the comment from @Sental was very helpful, as it made the issue reproducible.

It turned out that resuming an older existing transaction or order could sometimes throw an error, which resulted in various other bugs. These bugs are now solved, and the transaction ID is updated when a new transaction is started.

We know for sure that the issue from @Sental should be fixed now. We think that the issue for @patricksteenks is also solved, but as we are unable to reproduce this issue it’s hard to say if this is really the case.

We would love your feedback on this! I will leave the issue open till you both confirm it's all alright now. Thanks people!

patricksteenks commented 1 month ago

Hey @patricksteenks, thanks for your message. With input from @Sental, we've made good progress in tackling this issue. It's likely to be addressed in the upcoming release, which is currently in the manual Q&A testing phase. Once I can confirm it's sorted, I'll get back to you promptly. Thanks for your patience, again!

Nice to hear! Sounds like this resolves our issue as well. I'll push it to our live environment and keep you posted.

Frank-Magmodules commented 1 month ago

Perfect, @Sental and @patricksteenks , Assuming everything went well, I'll close the issue for now. However, feel free to respond or reopen it if needed. Thank you for your cooperation and patience @patricksteenks and @Sental !

patricksteenks commented 1 month ago

Unfortunately, we still see orders that are paid, but lose the transaction id of mollie, and therefore get cancelled in magento. How can I get the correct information about these orders to you?