Guides
MimicrSandbox control
Retries
When Pay4Fun tries to redeliver a webhook, how many times, and how to test failures and duplicates in Mimicr.
Pay4Fun redelivers the webhook on a temporary failure (timeout, URL down, 5xx error), with a limited number of attempts. Once they run out, the notification is not resent. The documentation doesn't say how many attempts or how far apart; the numbers below are Mimicr's.
The policy in Mimicr
| Attempt | When |
|---|---|
| 1 | When the event happens |
| 2 | 1 minute later |
| 3 | 5 minutes after the previous one |
| 4 | 15 minutes after the previous one |
| 5 | 1 hour after the previous one |
| Your server's response | Result |
|---|---|
Any 2xx | Delivered (success) |
5xx, a 10 s timeout or a network error | New attempt, up to the fifth; then failed |
4xx (or 3xx) | Ends at once, no new attempt (failed) |
Notifications of intents without a URL get the skipped status.
Follow them
bash
curl --url 'https://api.mimicr.dev/v1/pay4fun/deliveries?status=pending,failed' \ --header 'Authorization: Bearer mk_...'
Each delivery has attempts, max_attempts, next_attempt_at, last_status_code, last_duration_ms, last_error, last_response and the body sent.
Test without waiting
- Move the sandbox clock forward to make the next attempts due:
npx mimicr clock pay4fun +1h. - Resend a delivery now:
POST https://api.mimicr.dev/v1/pay4fun/deliveries/{id}/resend. A manual resend is a single attempt. - Make the first attempt fail with chaos:
webhookFailRateondepositorpayment. - Get the same notification twice:
webhookDuplicateRate.
bash
curl --request PUT \
--url https://api.mimicr.dev/v1/pay4fun/chaos/deposit \
--header 'Authorization: Bearer mk_...' \
--header 'Content-Type: application/json' \
--data '{ "enabled": true, "webhookFailRate": 100, "webhookDuplicateRate": 50 }'