mollie / magento2

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

[BUG] No Online Refund button after payment in Credit Memo #779

Closed flagbird closed 4 weeks ago

flagbird commented 1 month ago

Describe the bug When I order a product in the shop and pay with credit card, I can't do an Credit Memo online refund, because the Refund button isn't available.

Some research showed me that the transaction id isn't available in the Invoice (It's checked in Magento\Sales\Block\Adminhtml\Order\Creditmemo\Create\Items), which is why the button won't appear. To be able to do further research about this do I have a question: Where and at which step does the invoice get the transaction id in the Mollie module? I want to be 100% sure if this is a bug of an issue with the Magento project itself with the answer to this question.

Used versions

To Reproduce Steps to reproduce the behavior:

  1. Create a regular order in the shop like a customer and use credit card payment
  2. Go to the Magento backend and log in
  3. Sales ->Orders
  4. Open the order you've created for this test
  5. Create an invoice with Online capture
  6. Click the created invoice and go to Credit Memo

Expected behavior A "Refund" button is next to the "Offline Refund" button

Actual behavior Only the "Offline Refund" button is available (Because the Invoice has no transaction id)

Frank-Magmodules commented 1 month ago

Hi @flagbird,

Thank you for raising this issue. I attempted to reproduce the problem following your steps, but I couldn't replicate the results. I tested both the Mollie Hosted Payment page and the Credit Card Components integration. Can you reproduce this in test/sandbox mode as well? Please contact us directly so we can investigate and debug this further, as it seems I need more debug/log information. Thanks!

flagbird commented 1 month ago

Thank you for your help.

Where and at which step does the invoice get the transaction id in the Mollie module?

Can you please help me with this question? I'd like to verify if this is an issue with the module or just happens on certain circumstances with the module, so I can give a reproduceable test.

Frank-Magmodules commented 1 month ago

Hi @flagbird, once the webhook returns successfully from Mollie, you can verify the webhook flow within your Mollie dashboard. Simply go to the payments section in your Mollie dashboard and check the webhook flow on the right. If the call was successful, it should look like this;

Scherm­afbeelding 2024-05-22 om 11 14 14
flagbird commented 1 month ago

@Frank-Magmodules Thank you for the help. In fact, I don't have a webhook call in the history:

Auswahl_016

May I ask you if you have any information where I can look into to find what the problem is?

Frank-Magmodules commented 1 month ago

The status check with Mollie is triggered at 2 moments in the whole flow: The moment that a customer returns from the (external) payment page, which may be flakey due to closing the browser too early, and by the webhook. Next to that, there is a “Fetch Status” button on the order page in the backend, which triggers the same process. See below.

Scherm­afbeelding 2024-05-23 om 13 41 15

To answer your question: Whenever we create the invoice, an transaction ID should be set. This exact moment depends on your setting. For Klarna this can be at different times, eg after creating the shipment, for other methods this is usually when the status check is done as described earlier.

flagbird commented 1 month ago

Whenever we create the invoice, an transaction ID should be set. This exact moment depends on your setting. For Klarna this can be at different times, eg after creating the shipment, for other methods this is usually when the status check is done as described earlier.

Thank you. TODO for myself: Check the Mollie settings in their backend.

Frank-Magmodules commented 1 month ago

Sure, @flagbird. Just to confirm, is this issue resolved now? :) If so, please feel free to close the issue.

Frank-Magmodules commented 4 weeks ago

Hi @flagbird, since there has been no response, I consider this issue resolved and am closing it.

flagbird commented 2 weeks ago

It is resolved. Custom Code in the project was the reason for why the invoice was missing + some local dev issues with the webhooks that aren't directly related with mollie/magento2.

Thank you for your assistance. :bouquet:

Frank-Magmodules commented 2 weeks ago

Thanks for confirming that @flagbird ! Have a good day!