callback_url:
- One in
application/x-www-form-urlencoded - One in
application/json
Deduplication strategy
The simplest method is to mark each processed transaction in your database and ignore subsequent calls for the same transaction.1
Extract your transaction_id
Parse
custom_data to extract your transaction_id via keyof_customdata. See Parse custom_data.2
Check whether it has already been processed
Before any processing, check whether this identifier already exists in your processed transactions table.
3
Process and mark atomically
If not yet processed, run your processing and mark the transaction as processed in the same database transaction. Atomicity avoids race conditions if the two requests arrive simultaneously.
Implementation
A database unique constraint is more reliable than a simple
SELECT followed by an INSERT — two simultaneous requests can both pass the SELECT before either has performed its INSERT.