Triggering fulfilment
When integrating payments, it is critical to handle payment status updates reliably and securely before you fulfil an order or provide your customer access to a service.
Trigger fulfilment on the customer's return
When your customer is redirected to your website after they have successfully completed the payment, you can immediately trigger the fulfilment. Since webhooks may be delayed, this option provides the fastest possible experience for your customer.
Your customer may not always return to your website. Always make sure to listen to webhooks as a back-up.
Follow these steps:
- Make sure you add your identifier to the
redirectUrl
when creating the payment. You will need this when your customer is coming back to your site. - Store the
id
of the Mollie payment in your database. - Once the shopper comes back, retrieve your identifier from the url and look up the
id
of the Mollie Payment in your database. - Query the Payments API to retrieve the latest payment status.
- If the payment is successful, you can immediately trigger fulfilment or service activation.
If the payment is still
open
you can show a processing screen and call the Payments API after a short interval.
Trigger fulfilment based on a webhook
Even if you trigger fulfilment upon the customer's return, you must still set up webhook handling to ensure you handle payments where the customer never makes it back to your site.
Webhooks are critical for:
- Handling completed payments where the customer never returned to your site.
- Updating payment status if it changes after checkout. For example asynchronous payment methods like bank transfers.
- Ensuring your system remains in sync even if network conditions cause interruptions for your customer.
See the Webhooks section in our API Reference for more details.
Follow these steps to trigger fulfilment based on webhooks.
- Make sure to add a
webhookUrl
when creating the payment. - When the payment status changes, your webhook will be called with the
id
of the payment. - Use the
id
to query the Payments API to retrieve the latest payment status. - If the payment is successful, you can immediately trigger fulfilment or service activation.
Make sure that the fulfilment process is idempotent to prevent fulfilment multiple times for a single order.
Updated 2 days ago