Sandbox
How to use sandbox
The sandbox provides a testing environment for merchants to simulate payments and ensure seamless integration of their applications with Antom product. This topic will guide you through the process of using the sandbox effectively.
Before you begin
Complete the following steps before testing in the sandbox:
- Login to Antom Dashboard, switch to Test mode, go to Developer > Quick start > Integration resources and tools, and select Integration resources to get the sandbox client ID, domain and public key.
- Download the test wallet app. Refer to the Test wallet for guidance.
Test in sandbox
In the sandbox, multiple ways are provided to make an API call simulation, and you can call each API multiple times. API calls are correlated with each other if you provide the corresponding information. For example, you first call the pay API to initiate a payment. Then you can call the refund API to initiate a refund against the payment by specifying the paymentId. The related transaction information still exists in the sandbox environment.
In addition, when you call the pay or consult API in the sandbox, the sandbox also simulates the redirection process between the merchant and the wallet in each terminal type of WEB, WAP, and APP.
For Checkout Payment/Auto Debit
To test Checkout Payment and Auto Debit, you can use the provided testing guides to simulate the payment and vaulting process across various payment methods. The sandbox can also simulate all error codes, even rare production environment scenarios via the tool Error scenario simulation. This enables developers to work with consistent system logic processing during testing.
Test for payment methods
Simulate error scenarios
Error scenario simulation provides simulations of different API results and returns the specified response for integration testing.
Before you start
Before conducting the error scenario simulation, log in to Antom Dashboard, enter the Key configuration page, and configure the settings for the sandbox environment.
- Go to Developer > Key Configuration, click Generate key. Or go to Developer > Quick start, find Integration resources and tools, select Integration resources, and click Generate key.
- Click Confirm. The keys are generated.
Note: Your private key is only displayed once and Antom does not store it. Make sure you save your private key for later use.
- If you decide to replace the keys, you can replace API keys with one click or by using tools. Go to Developer > Key configuration, click Replace keys. Or go to Developer > Quick start, find Integration resources and tools, select Integration resources, and click Replace keys.
Note:
- You can click Replace keys with one click to replace the old keys with the keys generated by Antom.
- Or you can generate your own public and private keys by using the offline tool popped up on the page after clicking Use your own public and private keys.
- Go to Developer > Notification URL. Select the Configuration tab. Click Add under Action and enter you URL under Notification URL for a notification interface.
Note: Instead of using API call simulation, you can also download Postman scripts to debug locally.
Error scenario simulation
Error scenario simulation can simulate all the result codes, including rare production environment scenarios. This helps developers to work with the same corresponding system logic processing in the test mode. The effective time of the results can be changed by adjusting the simulation time.
Antom designed different responses for indicating different result codes. By default, no response is specified. You can specify a response for the corresponding API.
API simulation will be turned off automatically when the duration time is up. The duration can be set as 30min, 60min, 90min, or 120min. The user can manually set the time for automatic shutdown.
After you specify a response, the specified response is always returned for the corresponding API when the API simulation is turned on. For details about API simulation process, see API simulation.
For Subscription Payment
In the sandbox, you can create, update, and cancel a subscription plan. The sandbox automatically speeds up the subscription deduction cycle to facilitate your verification process. The table below illustrates how it works.
periodRule.periodType | periodRule.periodCount | Sandbox acceleration interval (min) | Acceleration frequency |
|
| 3 | 12 |
| 3 | 12 | |
| 3 | 12 | |
|
| 3 | 12 |
|
| 3 | 12 |
| 15 | 12 | |
| 30 | 12 | |
|
| 60 | 12 |
For example, create a subscription plan with a subscription period of 31 days.
{
"subscriptionRequestId": "REQUEST_20240409141836419",
"subscriptionDescription": "Subscription test",
"paymentMethodType": "GCASH",
"env": {
"osType": "ANDROID",
"terminalType": "APP"
},
"orderInfo": {
"orderAmount": {
"currency": "PHP",
"value": "100"
}
},
"paymentAmount": {
"currency": "PHP",
"value": "100"
},
"periodRule": {
"periodCount": 31,
"periodType": "DAY"
},
"settlementStrategy": {
"settlementCurrency": "USD"
},
"subscriptionStartTime": "2024-04-09T14:18:36+08:00",
"subscriptionEndTime": "2074-04-09T14:18:36+08:00",
"subscriptionExpiryTime": "2024-04-09T14:48:36+08:00",
"subscriptionNotificationUrl": "https://www.baidu.com",
"subscriptionRedirectUrl": "https://alipay.com/subscriptionNotify",
"paymentNotificationUrl": "https://alipay.com/subscriptionPayNotify"
}
Follow the instructions of How to test Alipay+ wallet to complete the vaulting process in the sandbox, then you will start receiving deduction notifications every 3 minutes. The deduction cycle stops accelerating after the thirteenth deduction. The final deduction notification during the acceleration cycle is detailed below:
{
"paymentAmount": {
"currency": "PHP",
"value": "100"
},
"paymentCreateTime": "2024-04-08T23:59:00-07:00",
"paymentId": "202404091940108001001886J0299059200",
"paymentTime": "2024-04-08T23:59:03-07:00",
"periodEndTime": "2025-05-16T23:18:36-07:00",
"periodStartTime": "2025-04-15T23:18:36-07:00",
"phaseNo": "13",
"result": {
"resultCode": "SUCCESS",
"resultMessage": "success",
"resultStatus": "S"
},
"subscriptionId": "202404091900000000000009D0000004046",
"subscriptionRequestId": "REQUEST_20240409141836419",
"subscriptionNo": "13"
}