➿ Prevent Duplicates
- When using a payment page in the process there is a basic prevent duplicates that can be activated and set in the payment page settings by - transaction amount , credit card number and other possibilities like - order, reference etc.
- Preventing duplicate on charges will be valid only until the current transmission date sent to the account - after that, the mechanism will be reset.
When integrating with our API to make a new direct charge, it is important to consider the possibility of duplicate transactions.
This can occur in various scenarios, especially in asynchronous or retry-based workflows where the remote server may inadvertently repeat a request due to:
- Network timeouts or communication errors
- Server-side logic errors
- Retry mechanisms triggered without verifying previous outcomes
- Lack of idempotency in the integration logic
Recommended Approach: Idempotency Keys
To address this, we recommend using idempotency keys in your API requests. An idempotency key is a unique identifier (e.g., UUID or hash) that you generate on the client side for each distinct operation.
When the same key is sent multiple times with the same request payload, the server ensures that the operation is only performed once, even if the request is received multiple times.
Methods -
ChargeSimple , ChargeSimple/Full , SaleChargeToken
Send in request parameters:
'RequestReference'
Send a unique key
'PreventDuplicates = true'
The prevent duplicates mechanism is activated
Best Practices
- Always generate a new key for each unique action.
- Do not re-use keys across unrelated operations.
- You can store the keys and their associated results (if your client may need to reference them later).
- Implement retry logic only when appropriate, and ensure it respects the idempotency mechanism.
Updated 11 days ago