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

 

Body Parameters:

 

 

Request Example:

 

Response

Response Example:

 

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

 

Related Topics