mollie / magento2

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

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

Open nh-mdev opened 6 months ago

nh-mdev commented 6 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 6 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 5 months ago

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

Frank-Magmodules commented 5 months ago

Same idea @fjbender ; on the list!