# Testing Cards

> In order to test your application without having to go live with cards and accounts, you can use [Moyasar's testing cards](https://docs.moyasar.com/guides/card-payments/test-cards/)) to simulate different transaction outcomes.

## Testing Environment

In order to test your application without having to go live with cards and accounts, you can use [Moyasar's testing cards](https://docs.moyasar.com/guides/card-payments/test-cards/)) to simulate different transaction outcomes.

The test cards should be used in a sandbox environment. This is also applicable if you are using the Stream's UI in sandbox mode and want to test the flow without having to use actual cards.

## Required Card Fields

Below are the values that need to be entered for the non-card number fields when testing:

| Field | Value |
| :--- | :--- |
| **Name** | Any name made of two words separated by a space (e.g., John Doe) |
| **Year** | Any **future** year |
| **Month** | Any month (or a future month if using the current year) |
| **CVC** | Any 3 digits (4 digits for American Express (AMEX)) |

---

## List of Test Cards and Expected Outcomes

Below is the list of test card numbers you can use in your test environment to simulate specific transaction statuses (Success/Failure) according to the card network.

### Mada

| Card Number | Status | Message | Response Code | 3DS Note |
| :--- | :--- | :--- | :--- | :--- |
| `4201320111111010` | **paid** | APPROVED | 00 | ---- |
| `4201320000013020` | **failed** | UNSPECIFIED FAILURE | 99 | ---- |
| `4201320000311101` | **failed** | INSUFFICIENT FUNDS | 51 | ---- |
| `4201320131000508` | **failed** | DECLINED: LOST CARD | 41 | ---- |
| `4201321234411220` | **failed** | DECLINED | 05 | ---- |
| `4201322267774310` | **failed** | DECLINED: EXPIRED CARD | 54 | ---- |
| `4201326324640570` | **failed** | DECLINED: EXCEEDS WITHDRAWAL LIMIT | 61 | ---- |
| `4201321144311528` | **failed** | DECLINED: STOLEN CARD | 43 | ---- |

### Visa

| Card Number | Status | Message | Response Code | 3DS Note |
| :--- | :--- | :--- | :--- | :--- |
| `4111114005765430` | **paid** | APPROVED | 00 | Frictionless Authentication |
| `4111111111111111` | **paid** | APPROVED | 00 | ---- |
| `4123120000000000` | **failed** | UNSPECIFIED FAILURE | 99 | ---- |
| `4123120001090000` | **failed** | INSUFFICIENT FUNDS | 51 | ---- |
| `4123450131000508` | **failed** | DECLINED: LOST CARD | 41 | ---- |
| `4123120001090109` | **failed** | DECLINED | 05 | ---- |
| `4123128518640738` | **failed** | DECLINED: EXPIRED CARD | 54 | ---- |
| `4123123033308648` | **failed** | DECLINED: EXCEEDS WITHDRAWAL LIMIT | 61 | ---- |
| `4123125276780003` | **failed** | DECLINED: STOLEN CARD | 43 | ---- |
| `4111118250252531` | **failed** | 3DS: attempted but not available, please ensure that you have enabled Online Purchase from your bank portal. | ---- | ECI 06 |
| `4111113343111067` | **failed** | 3DS service error occurred. | ---- | 3DS fails during enrollement check |
| `4111116611600661` | **failed** | The card is not enrolled in 3DS service. | ---- | ---- |
| `4111112205628150` | **failed** | 3DS service error occurred. | ---- | 3DS fails during authentication attempt |
| `4111115784228433` | **failed** | The authentication attempt was rejected by the issuer bank. | ---- | ---- |
| `4111115620358287` | **failed** | The authentication is unavailable, please try again later or contact issuer bank if problem persisted. | ---- | ---- |

### Mastercard

| Card Number | Status | Message | Response Code | 3DS Note |
| :--- | :--- | :--- | :--- | :--- |
| `5421080101000000` | **paid** | APPROVED | 00 | ---- |
| `5105105105105100` | **failed** | UNSPECIFIED FAILURE | 99 | ---- |
| `5457210001000092` | **failed** | INSUFFICIENT FUNDS | 51 | ---- |
| `5204010101000000` | **failed** | DECLINED: LOST CARD | 41 | ---- |
| `5204730000002514` | **failed** | DECLINED | 05 | ---- |
| `5105107550274126` | **failed** | DECLINED: EXPIRED CARD | 54 | ---- |
| `5105106475101067` | **failed** | DECLINED: EXCEEDS WITHDRAWAL LIMIT | 61 | ---- |
| `5105107304607225` | **failed** | DECLINED: STOLEN CARD | 43 | ---- |

### American Express (AMEX)

| Card Number | Status | Message | Response Code | 3DS Note |
| :--- | :--- | :--- | :--- | :--- |
| `340000000900000` | **paid** | APPROVED | 00 | ---- |
| `371111111111114` | **failed** | UNSPECIFIED FAILURE | 99 | ---- |
| `340033000000000` | **failed** | INSUFFICIENT FUNDS | 51 | ---- |
| `340012340501000` | **failed** | DECLINED: LOST CARD | 41 | ---- |
| `340033000000133` | **failed** | DECLINED | 05 | ---- |
| `340000018441278` | **failed** | DECLINED: EXPIRED CARD | 54 | ---- |
| `340000753060788` | **failed** | DECLINED: EXCEEDS WITHDRAWAL LIMIT | 61 | ---- |
| `340000418501838` | **failed** | DECLINED: STOLEN CARD | 43 | ---- |

---

## Testing Apple Pay

Unlike card payments where specific test card numbers are used, testing **Apple Pay** payments in the Stream's sandbox environment is based on the **amount** sent to the API (according to [Moyassar](https://docs.moyasar.com/guides/apple-pay/testing/)).

A **real card** must be added to an Apple Pay Wallet to test the process, but you must be using the sandbox environment to ensure no actual payment is made.

The following amounts will simulate different payment outcomes:

| Amount (Minor Unit) | Amount (SAR) | Status | Message | Response Code |
| :--- | :--- | :--- | :--- | :--- |
| `20000` to `30000` | `200.00` to `300.00` | **paid** | APPROVED | 00 |
| `100000` to `110000` | `1000.00` to `1100.00` | **failed** | UNSPECIFIED FAILURE | 99 |
| `110100` to `120000` | `1101.00` to `1200.00` | **failed** | INSUFFICIENT FUNDS | 51 |
| `120100` to `130000` | `1201.00` to `1300.00` | **failed** | DECLINED: LOST CARD | 41 |
| `130100` to `140000` | `1301.00` to `1400.00` | **failed** | DECLINED | 05 |
| `140100` to `150000` | `1401.00` to `1500.00` | **failed** | DECLINED: EXPIRED CARD | 54 |
| `150100` to `160000` | `1501.00` to `1600.00` | **failed** | DECLINED: EXCEEDS WITHDRAWAL LIMIT | 61 |
| `160100` to `170000` | `1601.00` to `1700.00` | **failed** | DECLINED: STOLEN CARD | 43 |

> **Note:** Moyasar accepts the payment amount in the **minor currency unit** (e.g., cents), and the test environment uses this amount to return different results.
---
> **Tip:** Using any other amount range than the stated above will result in the payment failing.
