It’s essential to validate your integration. This section explains how to test in the sandbox environment, including using stub data, simulating different scenarios, and ensuring your setup works as expected.
Sandbox setup
Before you start testing in Sandbox, please ensure you have completed the Sandbox Setup described here. This setup is a mandatory prerequisite for successful testing.
Testing authentication API
When setting up your sandbox environment, you generated and stored a sandbox refresh token. This token is used to obtain an access token, which is required to authenticate all subsequent API requests.
- Call the Get Access Token endpoint using your sandbox refresh token.
- Use this token in the Authorization header for all subsequent API calls.
- The access token is valid for 6 minutes. After it expires, you must request a new access token using the refresh token.
Testing payments API
Payments can be processed using various payment methods, each with different characteristics and outcomes. To facilitate testing, the sandbox environment includes predefined scenarios that can be triggered by specifying an order amount.
These scenarios and their corresponding behaviors are described in the section below.
iDEAL
Test Scenarios
| Amount (in cents) | Results in transaction status: |
|---|---|
| 100 | SUCCESS |
| 200 | CANCELLED |
| 300 | EXPIRED |
| 400 | IN PROGRESS (20 min) --> EXPIRED |
| 500 | FAILURE |
| 600 | IN PROGRESS (1 min) --> SUCCESS |
| Any other amount triggers a successful transaction.
Test example
- Create an order announcement with amount = 100
- Open the checkout page using the URL provided in the Create Order response.
- Select iDEAL as the payment method
- The transaction will automatically receive the SUCCESS status
- The shopper is redirected back to your webshop
- Verify that the order status is correctly retrieved and processed on your side
iDEAL snel bestellen
To test iDEAL Snel Bestellen, you can use the same scenarios as the general iDEAL scenarios. Note that additional fields are required in the Create order announcement call
Test example
- Create an order announcement with amount = 100 and include the following fields:
- paymentBrand = 'IDEAL'
- paymentBrandForce = 'FORCE_ALWAYS'
- shippingCost.amount required
- shippingCost.currency required
- requiredCheckoutFields required
- Open the checkout page using the URL provided in the Create Order response.
- The transaction will automatically receive the status SUCCESS,
- The shopper is redirected back to your webshop.
- Retrieve the order status and checkout details using the Get order details endpoint
- Process the order status and checkout details to complete the transaction flow
Credit & Debit cards
Test cards
| Brand | Card number | Expiry date | CVC |
|---|---|---|---|
| Mastercard | 5500000000000004 | 12/25 | 000 |
| Visa | 4111111111111111 | 12/25 | 000 |
| Maestro | 6333333333333333336 | 12/25 | n.a. |
| Bancontact | 4370000000000061 | 12/25 | n.a. |
| Note: Apple Pay and Click to Pay are currently not supported in sandbox
Test Scenarios
| Amount (in cents) | Results in transaction status: |
|---|---|
| 1000 | SUCCESS |
| 5000 | FAILURE |
| Any other amount triggers a successful transaction.
Test example
- Create an order announcement with amount = 1000
- Open the checkout page using the URL provided in the Create Order response.
- Select credit or debit card as the payment method
- Enter the following details: • card details (see test cards) • Name: e.g. John Doe • Email: e.g. [email protected]
- After clicking "Pay", the transaction receives the status SUCCESS
- Verify that the order status is correctly retrieved and processed on your side
Card on File
Card on File is a feature within card payments. It allows shoppers to store payment details for future use. The test cards and test scenarios for credit and debit cards also apply to Card on File. Note that there are additional required fields in the Order Announcement request to enable Card on File.
Test example
- Create an order announcement with amount = 1000 and include the following fields:
- EmailAddress required
- shopperRef required
- enableCardOnFile = TRUE
- Open the checkout page using the URL provided in the Create Order response.
- Select credit or debit card as the payment method
- Enter the following details:
- card details (see test cards)
- Name: e.g. John Doe
- Email: e.g. [email protected]
- Opt in for 'Save this card for future purchases'
- After clicking “Pay”, the transaction status changes to SUCCESS, and the payment details are stored against the shopperRef.
- Verify that the order status is correctly retrieved and processed on your side
- (Optional) Manage stored payment details using the Get Payment Details and Delete Payment Details endpoints. See the instructions in the “Shopper Scenarios” section below.
Bancontact
Test card
| Brand | Card number | **Expiry date | CVC |
|---|---|---|---|
| Bancontact | 67034200554565015 | 12/25 | n.a. |
Test Scenarios
| Amount (in cents) | Results in transaction status: |
|---|---|
| 1000 | SUCCESS |
| 5000 | FAILURE |
| Any other amount triggers a successful transaction.
Test example
- Create an order announcement with amount = 1000
- Open the checkout page using the URL provided in the Create Order response.
- Select credit or debit card as the payment method
- Enter the following details: • card details (see test cards) • Name: e.g. John Doe • Email: e.g. [email protected]
- After clicking "Pay", the transaction receives the status SUCCESS
- Verify that the order status is correctly retrieved and processed on your side
PayPal
| Amount (in cents) | Results in transaction status: |
|---|---|
| 100 | SUCCESS |
| 200 | CANCELLED |
| 500 | FAILURE |
| Any other amount triggers a successful transaction.
Test example
- Create an order announcement with amount = 100
- Open the checkout page
- Select PayPal as the payment method
- The transaction immediately receives the status SUCCESS
- The shopper is redirected back to your webshop
- Verify that the order status is correctly retrieved and processed on your side
Get order status
In the sandbox environment, transaction and order data are fully persisted, reflecting production behavior.
Test example
- Complete an order in the sandbox with one of the scenarios described above.
- Verify that your webhook URL receives the notification.
- Use the token from the notification to call Get Order Status.
- Check if the order data corresponds with the testing scenario.
Get order details
Test example
- Complete an order and note the Order ID from the announcement.
- Call Get order details with that ID.
- Check if the order data corresponds with the testing scenario.
Testing refunds API
Refund scenarios are stubbed. There are static requests that will retrieve a standard stubbed response.
Get refundable details
The following transactions ID will generate the following reponse
| Transaction ID | Results in transaction status: |
|---|---|
| 6b07e860-3b61-11ed-a6a1-a7d3128de7f2 | Refundable amount = €50 |
| 3d4788c-8b1a-11ec-a720-074492bc17bb | NON EXISTING TRANSACTION |
| Any other transaction ID returns a refundable amount of €50,00.
Test example
- Perform a Get refundable details call using the transaction ID 6b07e860-3b61-11ed-a6a1-a7d3128de7f2.
- Verify that you receive the a reponse with refundable amount = €50.
Create refund
Use the transaction ID 6b07e860-3b61-11ed-a6a1-a7d3128de7f2 to simulate a refund with a refundable amount of €50.00.. The refund status responses are triggered based on the amount (in cents) you submit.
| Amount (in cents) | Results in transaction status: |
|---|---|
| 100 | SUCCESS |
| 400 | PENDING |
| 500 | FAILED |
| 600 | UNKNOWN |
| >5000 | MAXIMUM_REFUNDABLE_AMOUNT_EXCEEDED |
| Any other amount triggers a successful refund.
Test example
- Perform a Create Refund call using the transaction ID 6b07e860-3b61-11ed-a6a1-a7d3128de7f2.
- Set the refund amount to 100.
- Verify that you receive the status SUCCESS.
Get refund details
Test example
- Peform the Get refund details call by using the following data
- Transaction ID: 6b07e860-3b61-11ed-a6a1-a7d3128de7f2
- Refund ID: Take the refund ID from the Create Refund response.
- Verify the response
Testing shopper API
During checkout, the shopper can choose to save their payment details for future use. The functionality described below allows you to manage stored card details by:
- Retrieving saved payment details
- Deleting saved payment details
For testing, you must use identifiers provided in the Create Order response, as these are stored in the sandbox environment.
Get payment details
Key Requirement: Before you can retrieve payment details, you must simulate a shopper storing a card during checkout. Refer to the “Card on File” section to mimic this process.
Test example
- Call the Get payment details endpoint. Include:
- shopperRef for the shopper with stored payment details.
- Confirm that the response contains the stored payment details (e.g., card type, masked card number, expiry date)
Delete payment details
Key Requirement: Before you can retrieve payment details, you must simulate a shopper storing a card during checkout. Refer to the “Card on File” section to mimic this process.
Test example:
- Call the Delete payment details endpoint. Include:
- shopperRef for the shopper with stored payment details.
- The id returned from the Get Payment Details response.
- Verify that the card is no longer available in the shopper’s stored payment details.