mollie / magento2

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

[FEATURE REQUEST] - Order API - Support for "payment.webhookUrl" request parameter #727

Closed nh-mdev closed 4 months ago

nh-mdev commented 11 months ago

Describe the new feature

Initial Issue

Using the Order API for orders, e.g. via Payment Link, never triggers webhook requests for the associated transaction payments.

Support for "payment.webhookUrl" parameter for Order API requests.
See https://docs.mollie.com/reference/v2/orders-api/create-order#payment-specific-parameters

Describe the solution to be implemented

Two possible approaches: a. Per default extend the Order API request paramaters by the current value of the configred webhook url. b. Introduce an additional admin setting, e.g. checkbox, to allow flexible control of this behaviour.

nh-mdev commented 11 months ago

@Frank-Magmodules short update:

Based on @michielgerritsen 's initial input towards a quick-fix (via discord), we added the new request parameter to the following payload: https://github.com/mollie/magento2/blob/master/etc/di.xml#L98C52-L113

This works, meaning, the mollie order now properly shows the webhook url value on it detail page.

However, the magento module's webhook logic seems to lack the required funtionality to handle this type of use case, i.e. receiving related order payment transaction updates via the webhook url.

It throws the following error: image

This makes "sense", since the related DB entry for this order/transaction is based on the transaction id of the mollie order entity.
image

Implementing this seems out of reach for us, cause it looks like new state has to be persisted in the DB for this to work.
Or maybe you see a way forward for us to "fix" this ourselves?

Thanks for the help so far!

fjbender commented 9 months ago

Maybe worth investigating the handling of "unknown" webhook payloads when investigating #729?

Frank-Magmodules commented 9 months ago

Same idea @fjbender ; on the list!

Frank-Magmodules commented 4 months ago

Hi @nh-mdev,

Thank you for your patience on this issue. After further investigation and reviewing the upcoming changes to the Mollie Order and Payment API, we have decided not to develop this feature within the OrderAPI at this time. We will consider adding this to our roadmap once the API changes are fully deployed. For now, we will close this request. Thanks again for opening this issue here!