> ## Documentation Index
> Fetch the complete documentation index at: https://docs.momentco.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Integration Testing

> Learn how to simulate payments during development

### Overview

To ensure your integration with Moment APIs functions correctly, you can simulate payment flows during development. This allows you to test various scenarios without any real money movement.

## Testing Cards

When testing card payments, always use [test API keys](/api-reference/getting-started/authentication#operating-modes). Only use the specified test cards listed below. **Do not use real card** information under any circumstances.

> Note: The 3DS challenge page will not be displayed during testing, as the flow is being simulated to mimic a frictionless authentication experience.

### Supported card test scenarios

✅ **Success scenarios**

| Test Card Number    | CVC         | Pin         | Date            | Description            |
| :------------------ | :---------- | ----------- | :-------------- | :--------------------- |
| 4242 4242 4242 4242 | Any 3 digit | -           | Any future date | Valid Test Visa card   |
| 5555 5555 5555 4444 | Any 3 digit | -           | Any future date | Valid Test Master card |
| 5060 9900 0008 4242 | Any 3 digit | Any 4 digit | Any future date | Valid Test Verve card  |

❌ **Error scenarios**

| Test Card Number    | Error Code          | Decline Code         | Description                                                          |
| :------------------ | :------------------ | :------------------- | :------------------------------------------------------------------- |
| 5555 5568 7936 0005 | `card_declined`     | `do_not_honor`       | The card was declined by the issuer for unknown reason.              |
| 5555 5515 3049 0051 | `card_declined`     | `insufficient_funds` | The card does not have sufficient funds to complete the transaction. |
| 5555 5553 1674 0043 | `card_declined`     | `stolen_card`        | The card was reported stolen.                                        |
| xxxx xxxx xxxx xxxx | `invalid_test_card` | `N/A`                | The card used is not a test card.                                    |

## Testing APM payment methods

Success and failure scenarios for APM (Alternative Payment Methods) payments can be simulated by initiating a payment with a specific amount. The amount should be specified in [minor units](https://localhost:3001/api-reference/basics/monetary_amounts#minor-units-explained).

### Supported APM test scenarios

✅ **Success scenarios**

| Test Amount | Webhook Fired |
| :---------- | :------------ |
| 100001      | Yes           |

❌ **Error scenarios**

| Test Amount | Webhook Fired | Error Code            |
| :---------- | :------------ | :-------------------- |
| 100002      | Yes           | `insufficient_funds`  |
| xxxxxx      | No            | `invalid_test_amount` |

## Webhook Responses

1. [Payment Session Update](/api-reference/collect/payment_sessions/webhook/updated) - When testing through the Payment Session API, an update will be triggered and delivered to your configured webhook endpoint via the `payment_session_updated` event.
