Testing Collections
These scenarios do not include 3D Secure 2 authentication testing. See Testing 3D Secure 2 Flows for 3D Secure 2 authentication testing for your app.
Card Collections Scenarios (Positive Flow)
Collect funds previously reserved using the Testing Card PreAuths request.
Important to Consider
- Ensure you have the correct receiptId for the original pre authorisation.
- This is required for you to process the collection.
- The expiry time of the reserved pre authorised funds differs across acquirers. If not collected, the reserved funds are released and the collection request will be declined.
- To request the funds, attempt a /transactions/payments request instead.
- You can collect partial amounts or multiple partial amounts, as long as they do not exceed the amount of the original pre authorisation.
- Ensure the currency in the collection request matches the currency from the original pre authorisation.
To simulate collecting a pre authorised transaction:
Suggested Test Scenario | Expected Outcome | Tip |
|---|---|---|
Process a collection on the full preAuth amount. | 200 Successful | Ensure you have the correct receiptId for the original pre authorisation. |
Process a partial collection on the preAuth amount. | 200 Successful | Ensure you have the correct receiptId for the original pre authorisation. |
Process multiple partial collections on the preAuth amount. | 200 Successful | Ensure you have the correct receiptId for the original pre authorisation. Ensure the total multiple partial collections, do not exceed the amount of the original pre authorisation. |
Request Parameters
Sandbox endpoint: https://api-sandbox.judopay.com/transactions/collections
HTTP Method: POST
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 collected. |
amount Decimal Required | The amount to collect must not exceed the amount of the original pre authorisation. 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 collection. 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 Collections 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 collect a preAuth that has already been collected. | 65 | Sorry, but the collection request you've specified is not valid. Please check your details and try again. |
Attempt to collect an amount that is greater than the preAuth amount. | 46 | Sorry, but the amount you're trying to collect is greater than the pre-auth. |
Attempt to collect an expired preAuth. | 42 | Sorry, it looks like the PreAuth you are referencing has expired. |
Attempt to collect using the receiptId for a payment instead of a preAuth. | 43 | Sorry, it looks like you're trying to make a collection on an invalid transaction type. Collections can only be performed on PreAuths. |
Attempt to collect a preAuth that has already been voided. | 45 | Sorry, this transaction has been voided. You cannot perform a collection on a voided transaction. |
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.