
Webhooks
When our system sends a webhook callback to a merchant's endpoint and fails to receive a valid response, the system will automatically attempt to resend (retry) it. The goal is to ensure reliable communication between our system and the merchant, even during temporary disruptions like timeouts, service downtime, or other errors. Each retry is performed with a 1-minute interval between attempts. If the final attempt still fails, we will stop retrying and send a webhook failure notification to the merchant's email.
| Condition / HTTP Status | Handling Function | $retryCount Value | Maximum Retries | Description |
|---|---|---|---|---|
| 500 (Internal Server Error) | handleFailedHttpResponse() | 1 | 1 retry attempt | The merchant’s server is experiencing a problem. |
| 503 (Service Unavailable) | handleFailedHttpResponse() | 4 | 4 retry attempts | The merchant is temporarily inaccessible. |
| 400 / 404 (Bad Request / Not Found) | handleFailedHttpResponse() | 2 | 2 retry attempts | The endpoint might be incorrect or temporarily unavailable. |
| Redirect 307 / 308 | retryRedirect() | - | 5 retry attempts (redirect) | Redirects are followed up to 5 times. |
| Redirect 301 / 302 / 303 | handleFailedHttpResponse() | - | 0 (no retry) | Redirect is not followed (the endpoint needs to be updated). |
| Exception (including cURL error) | catch(Exception $e) | 1 | 1 retry attempt | For example, a timeout, DNS error, or connection failure. |
| Other (default case) | handleFailedHttpResponse() | 5 | 5 retry attempts | For other statuses not covered by the conditions above. |
| Attempt | Response Status | System Action | Delay Before Next Try |
|---|---|---|---|
| #1 | 503 | 1st Retry | 1 minute |
| #2 | 503 | 2nd Retry | 1 minute |
| #3 | 503 | 3rd Retry | 1 minute |
| #4 | 503 | 4th Retry | Done (no more retries) |
Total maximum retry time (if all attempts fail): approximately 4 minutes.
If the webhook still fails after the final retry attempt, our system will:
Merchants are advised to: