Testing Voids
Voids cannot be performed on pre authorisations that have been collected (partial or full).
Card Void Scenarios (Positive Flow)
Important to Consider
- Ensure the Preauth Transactions permission is enabled on your API credentials.
- Ensure you have the correct receiptId for the original pre authorisation.
- This is required for you to process the void.
- Voids cannot be performed on pre authorisations that have expired, or been collected (partial or full).
To simulate voiding a pre authorised transaction:
Suggested Test Scenario | Expected Outcome | Tip |
|---|---|---|
Process a void on the full preAuth amount. | 200 Successful | Ensure you have the correct receiptId for the original pre authorisation. |
Request Parameters
Sandbox endpoint: https://api-sandbox.judopay.com/transactions/voids
HTTP Method: POST
Header Parameters:
For more information, see Authentication Methods.
API-Version: | 6.26 For the latest version of the Judopay Transaction API, see Latest Version. |
|---|---|
Content-Type: | application/json |
Accept: | application/json |
Authorization Method: TokenSecretAuth | In the Authorization Header:
Example: BasicTXpFdPdRSzWmSGk4djhxeTpjBTS4YjQ5OTdkZmO7CTk1YTE0OWEyMDg1MmY3YWYyZWEyZTcwYmQyZGY3O Replace {authstring} with base64 encoding of:
Example: MzPdkQK1mGi8v3ky:y158n4732dfc7595a149a20381f7af2ea2e70gr6df794b8rnwc019cc5f799kk3 |
Body Parameters:
Configuration Property Descriptions
Parameter | Description |
|---|---|
receiptId String Required | Judopay's reference for the pre authorisation that is to be voided. |
amount Decimal Required | The amount to void. Format:
For currencies using a different structure please contact Judopay for support. |
currency String Required | If specified, the currency must match the original pre authorisation. If not specified, the currency of the original pre authorisation will be used. Any ISO 4217 alphabetic currency code:
|
yourPaymentReference String Required | Your unique reference for this void. Format:
This is not the yourPaymentReference of the original pre authorisation. |
yourPaymentMetaData String Optional | Key-value map for additional metadata associated with this transaction. Will be stored but not processed or passed to gateways. Do not include sensitive information like card numbers. |
{
"receiptId": "675014982672486400",
"amount": 10.99,
"currency": "GBP",
"yourPaymentMetaData": {
"internalLocationRef": "Example",
"internalId": 99
},
"yourPaymentReference": "aa648425-2230-4e4e-8a61-27f06df54542",
}Card Void Scenarios (Negative Flow)
Declines can occur for various reasons, it can be impossible to simulate all the negative flows in a sandbox environment.
Important to Consider
- How your app handles negative flows
- Your customer's experience should a negative flow occur:
- Logic to communicate error messages
- Customise how your app responds
- How to maintain application consistency
Follow our suggested guidelines to simulate negative scenarios, to test your app’s error handling:
Suggested Negative Test Scenario | Expected Error Code | Error Description |
|---|---|---|
Attempt to void a preAuth that has already been voided. | 51 | Sorry, but it looks like the transaction you are trying to void has already been voided. |
Attempt to void a preAuth that has already been collected. | 52 | Sorry, but it looks like the transaction you are trying to void has already been collected. |
Attempt to void an amount that is different to the preAuth amount. | 53 | Sorry, but it looks like the void you are trying to process is for a different amount than the original preauth. |
Attempt to void an expired preAuth . | 42 | Sorry, it looks like the PreAuth you are referencing has expired. |
Attempt to void using the receiptId for a payment instead of a preAuth. | 68 | Sorry, but your void request is not valid. Please check your details and try again. |
Where the codes remain fixed, the descriptions may change. You should not build any error handling logic based on these descriptions.
For a list of possible error codes, types and descriptions, see Error Codes and Descriptions.