Mock simulator
Introduction
The mock server for the acquiring system on SANDBOX (backend version 5.17.0) allows for the simulation of various backend responses by entering "magic numbers" as payment amount prefixes. These prefixes, when keyed into the terminal, force the MOCK server to return a predefined result, facilitating the testing of different application response scenarios.
Card Transactions
Magic Numbers: 42.XX - Simulation of Specific Response Codes
Mechanism: By entering an amount starting with 42. followed by a numeric code XX, the mock server returns the response code specified by XX. The client application's SDK maps these codes to localized user messages.
| Code (42.XX) | Response Code | Description |
|---|---|---|
| 42.00 | 00 | Approved |
| 42.06 | 06 | Sequence error |
| 42.09 | 09 | Processing |
| 42.10 | 10 | Partial approval |
| 42.11 | 11 | Invalid transaction |
| 42.21 | 21 | No action taken |
| 42.33 | 33 | Card expired |
| 42.43 | 43 | Stolen card |
| 42.55 | 55 | Incorrect PIN |
| 42.56 | 56 | No card in DB |
| 42.58 | 58 | Terminal unknown |
| 42.60 | 60 | PIN necessary |
| 42.61 | 61 | Exceeds limit |
| 42.67 | 67 | Cash limit |
| 42.77 | 77 | PIN try limit |
| 42.86 | 86 | Frequency limit |
| 42.87 | 87 | Purchase only |
| 42.97 | 97 | Security breach |
| 42.98 | 98 | Time not plausible |
| 42.99 | 99 | PAC error (PIN Authentication Code) |
| Any other | XX | General Decline |
Magic Numbers: 43.XX - Latency and Timeout Simulation
Mechanism: By entering an amount starting with 43. followed by a numeric value XX, the MOCK server simulates a successful transaction (corresponding to a Code 00) after a delay of XX seconds.
Behavior and Limits: If XX <= 30 seconds: Simulates a successful transaction after the specified delay. If XX > 30 seconds: The application or SDK, typically configured with a 30-second connection timeout, will throw a connection or timeout error.
Magic Numbers: 44.XX - Infrastructure Error Simulation
Mechanism: By entering an amount starting with 44. followed by a numeric value XX, the mock server forces a critical internal failure of the mock server itself.
Result: A server error is simulated (e.g., 500 Internal Server Error). The SDK will not receive a valid ISO-8583 response code; instead, a network or HTTP exception will be generated. There is no specific information detailing what XX values can be introduced to generate each particular error, as the error is simulated at the infrastructure level of the mock server.
APM Mockup on Sandbox Environment: Test Cases
| Trx Amount | Business Case |
|---|---|
| 0,10 | Checkin DECLINED after 5s |
| 0,11 | Checkin DECLINED after 10s |
| 0,20 | Checkin EXPIRED after 5s |
| 0,21 | Checkin EXPIRED after 10s |
| 0,30 | Checkin SUCCESSFUL after 10s |
| 0,31 | Checkin will never response |
| 0,40 | Payment DECLINED after 5s |
| 0,41 | Payment DECLINED after 10s |
| 0,50 | Payment EXPIRED after 5s |
| 0,51 | Payment EXPIRED after 10s |
| 0,60 | Payment SUCCESSFUL after 10s |
| 0,61 | Payment will never response |
| 0,70 | Error from SATA in qr checkin |
| 0,71 | Error from SATA in make |
| 0,72 | Error from SATA in status |
| 0,73 | Error from SATA in confirm |
| 0,74 | Error from SATA in reversal (can be validate on scheduler) |
| 1,00 | Refund CONFIRMED after 5s |
| 1,10 | Refund CANCELLED after 5s |
| 1,20 | Refund DECLINED after 5s |
| 1,30 | Refund left in ACCEPTED status (auto reversal success) |
| 1,70 | Error from SATA in makeRefund |
| 1,71 | Error from SATA in monitorRefund |
| 1,72 | Error from SATA in confirmRefund (possible only for SUCCESSFUL response)* |
| 1,73 | Error from SATA in cancelRefund (possible only in autoreversals) |
| 1,74 | PaymentNotification is sent after process ends: 10s |
Defaults
- Checkin: successful (CHECKINED) after 5s
- Payment: successful (ACCEPTED) after 5s
- Confirm/cancel: always succeed
- Refund: successful after 5s