Testing Refunds

Card Refund Scenarios (Positive Flow)

Important to Consider

  • Ensure the Refund Payments permission is enabled on your API credentials.

  • Ensure you have the correct receiptId for the original payment or collection.

    • This is required for you to process the refund.

  • You can make multiple partial refund requests, up to the original transaction amount.

  • These scenarios can be used on:

    • Card

    • Apple Pay™

    • Google Pay™

    test transactions.

 

To simulate a full or partial refund on the original transaction amount:

Suggested Test Scenario

Expected Outcome Tip

Process a partial refund.

 

You can also make multiple test partial refund requests.

200

Successful

Ensure you have the correct receiptId for the original payment or collection, to process the partial refund.

 

If you are testing multiple partial refund requests, ensure the combined requests do not exceed the original transaction amount.

Process a full refund.

200

Successful

Ensure you have the correct receiptId for the original payment or collection, to process the full refund.

 

Request Parameters

Sandbox endpoint: https://api-sandbox.judopay.com/transactions/refunds

HTTP Method: POST

 

Body Parameters:

Ensure you have the correct receiptId for the original transaction to process the full or partial refund.

 

 

Request Example:

 

Response

Response Example:

 

Card Refund 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 a refund on a preAuth that has not yet been collected.

 

For a preAuth that has not yet been collected, follow the void scenarios.

67

Sorry, but your refund request was not valid.

Please check that the original transaction was a Sale or Collection, has not previously been refunded, was not for a lesser amount than your refund request.

Attempt a refund on a preAuth that has already been voided.

48

Sorry, this transaction has been voided. You cannot perform a refund on a voided transaction.

Attempt a larger refund amount than the original transaction amount.

49

Sorry, but the amount you're trying to refund is greater than the original transaction.

Attempt a refund using the incorrect receiptId.

Use the preAuth receiptId to simulate the error.

(For a positive flow, the correct receiptId would be for the original payment or collection).

 

47

Sorry, but it looks like the transaction you are trying to refund is invalid.

Refunds can only be performed on Sales and Collections.

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