Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
v:2.0:webhooks [2019/11/05 13:48] – [Sending Webhooks & Automatic Retries] marija | v:2.0:webhooks [2019/11/06 05:29] – external edit 127.0.0.1 | ||
---|---|---|---|
Line 14: | Line 14: | ||
===== Sending Webhooks & Automatic Retries ===== | ===== Sending Webhooks & Automatic Retries ===== | ||
- | When a new transaction is placed and your webhooks are triggered, Foxy will wait for 1 minute for a response from your webhook endpoint. If a webhook fails to respond successfully (that is, if we don't receive a // | + | When a new transaction is placed and your webhooks are triggered, Foxy will wait for 1 minute for a response from your webhook endpoint. If a webhook fails to respond successfully (that is, if we don't receive a HTTP response code of '' |
===== PayPal, Amazon Pay, and other Hosted Gateways ===== | ===== PayPal, Amazon Pay, and other Hosted Gateways ===== | ||
Line 136: | Line 136: | ||
==== Example Payload ==== | ==== Example Payload ==== | ||
- | The JSON payload will follow much the same structure as our Hypermedia API. Most of the objects will include the API's '' | + | The JSON payload will follow much the same structure as our Hypermedia API. Most of the objects will include the API's '' |
The source of the payload data is our Hypermedia API, so you can use [[https:// | The source of the payload data is our Hypermedia API, so you can use [[https:// | ||
Line 657: | Line 657: | ||
if (is_array($parsedData)) { | if (is_array($parsedData)) { | ||
// Handle the payload | // Handle the payload | ||
- | | + | |
if ($event == " | if ($event == " | ||
// The following is an example of working with the transaction/ | // The following is an example of working with the transaction/ | ||
Line 685: | Line 685: | ||
} | } | ||
} | } | ||
- | | + | |
} else { | } else { | ||
// JSON data not found | // JSON data not found | ||
Line 706: | Line 706: | ||
return halt 500, " | return halt 500, " | ||
end | end | ||
- | + | ||
post '/ | post '/ | ||
request.body.rewind | request.body.rewind | ||
Line 714: | Line 714: | ||
parsedData = JSON.parse(data) | parsedData = JSON.parse(data) | ||
- | | + | |
# Handle the payload | # Handle the payload | ||
puts parsedData[' | puts parsedData[' |