Skip to content
Discussion options

You must be logged in to vote

The Core Solution: Exponential Backoff and Retry

Since you are mandated to poll for the authoritative data, you must assume the data might not be ready immediately. Instead of a single poll, your handler needs to poll repeatedly until the expected state is confirmed or a timeout is reached.Process Flow:

  1. Receive Webhook: Event transaction.completed is received.

  2. Start Retry Loop: Begin a loop with a maximum number of attempts (e.g., 5-10) and a total timeout (e.g., 30 seconds).

  3. Poll API: Call the third-party API to fetch the transaction details.

  4. Check State:
    • Success: If the returned data confirms the expected state (e.g., status: 'completed'), break the loop and process the data.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@KRSNA-BLR
Comment options

Answer selected by Litis-Trion250
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API and Webhooks Discussions related to GitHub's APIs or Webhooks Question Ask and answer questions about GitHub features and usage
3 participants