mollie

How to handle payments where webhook retry schema fails everytime?


I want to integrate Mollie as a payment processor. In their documentation they are stating they have a retry schema for if the webhook fails to return a 200 status for example if there is a problem with the hosting service.

As payment is quite a sensitive subject. I'm wondering how to integrate Mollie and handle situations where every retry fails for whatever reason?


Solution

  • Mollie is trying to get 200 response from your server 10 times (source). If they don't get that response, they just stop calling the webhook. Whatever happened on Mollie side (e.g. payment received, refund created, etc.) still happened, just your app won't be notified about it anymore. You'll need to fetch the data manually from your app.

    If you're asking how to avoid problems with your app not knowing about payments/refunds that actually happened, you can periodically "reconcile" records from Mollie with your app. One thing that comes to mind is manually exporting a report from Mollie with payment ids, amounts, and statuses, and checking if they match the records in your app. You could do it every day/week/month, depending on how likely it is for your sever to fail 10 times in a row when Mollie calls it.

    It's also a good idea to have some downtime/error monitoring service set up (something like Pingdom, Sentry, Bugsnag, etc.). You'll generally know when your server is down, and in consequence, you'll know when to manually fetch payment data from Mollie.