How to implement an offisite payment (Mollie) in the ShopAPI?

What is a best-practice to add the payment redirection when reaching complete_checkout endpoint? I’m trying to work this out with the Mollie plugin for Sylius.

I’m trying to somehow obtain a token, redirect to Mollie payment page and get back with a response but I have no idea how to achieve this in the API.

Can anyone help me?


you will have to run similar logic to this and return the URL to redirect in response API

and you’ll need to change the redirect URL here


Thanks for the help. I managed to send the user to the hosted payment gateway.
But how can I intercept the response (so I can manage the Payment)?

Via a new route? Overwrite the capture route? Or check the /notify webhookUrl?

If I change the redirectUrl, it will redirect. But if I want to verify the request it says:

HTTP 400 Bad Request

The current url xxx/payment/check/Fpzo3TeIrHHW8yNvO1rXdBiVnuF9M3HLad56BzKNFPo not match target url xxx/payment/capture/Fpzo3TeIrHHW8yNvO1rXdBiVnuF9M3HLad56BzKNFPo set in the token.