mollie / magento2

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

[ISSUE] Webhook fails for orders with shipped and unshipped items #655

Closed nh-mdev closed 1 year ago

nh-mdev commented 1 year ago

Describe the bug Whenever an order is in a shipped-/unshipped state, i.e. some items are marked as "completed" (shipped) and some as "paid" (unshipped), the webhook starts failing with an 503 "{ error: true }" exception.

Used versions

To Reproduce Steps to reproduce the behavior:

  1. Go to Magento Admin.
  2. Create new order, with at least two items
  3. Make a successful payment (e.g. through mollie checkout portal)
  4. Go to the order view in magento.
  5. Ship only one item. At least one or more items must remain unshipped.
  6. Wait around 5 minutes.
  7. Go to the mollie dashboard and open the orders details.
  8. On the right side, you should see multiple failed webhook attempts under "History"

Expected behavior The webhook should work for orders with mixed items of shipped/unshipped state.

Actual behavior The webhook throws an 503 "{ error: true}" exception.

Screenshots image image

image image image

Magento error
image

Additional context We upgraded from 2.22.0 to 2.26.0 on May 30th.
Never encountered this error before the upgrade.

As you can see inside the "History" screenshot, interestingly enough, the initial webhook after a first item/multiple items are shipped, succeeds. All following afterwards fail.

Frank-Magmodules commented 1 year ago

Hello there, @nh-mdev! It appears that I'm unable to replicate this issue directly. Could you kindly provide me with the product types you are utilizing? 

I noticed that the "Rezeptgebühr" is the only item line with a price, while the first item appears to be a free item that can still be shipped. Please share the most relevant information with me so that I can reproduce and debug this issue effectively.

nh-mdev commented 1 year ago

@Frank-Magmodules hey, my bad, i should have provided more details regarding the involved products.

The products involved in this particular case are:

  1. Fibulo-Tape 5 Schwarz rechts => configured product
  2. Rezeptgebühr => virtual product

A bit of domain context: These type of orders happen quite frequently. Customers can get a doctors prescription, which qualifies them to have at least one product for free, hence the 0€ for the configured product. Additionally, there is always a so called "prescription fee" associated with such a process, which is the virtual product.

Let me know if you need more input, happy to help.

Frank-Magmodules commented 1 year ago

Hello, @nh-mdev! I’m pleased to inform you that we have addressed this scenario in the most recent release of the Mollie plugin. We’ve made sure to cover your issue, and we hope it resolves any concerns you had. I will go ahead and close this matter for now, but please feel free to reopen it if you need any further assistance or have any other questions.