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

# Testing Process

> Complete guide to testing your Dodo Payments integration with test cards, UPI IDs, BNPL data, and digital wallets.

<Frame>
  <iframe className="w-full aspect-video rounded-md" src="https://www.youtube.com/embed/5CcUSE4L_cg" title="Test Transaction | Dodo Payments" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen />
</Frame>

## Overview

Test mode lets you simulate payments without processing real transactions. All test credentials only work in test mode — never use them in production.

<CardGroup cols={3}>
  <Card title="No Real Charges" icon="shield-check">
    Test transactions don't process actual payments or affect real accounts.
  </Card>

  <Card title="Full API Access" icon="code">
    All API endpoints work identically in test and live modes.
  </Card>

  <Card title="Webhook Testing" icon="webhook">
    Webhooks fire for test transactions just like production.
  </Card>
</CardGroup>

<Warning>
  Test credentials only work in test mode. Attempting to use them in live mode will result in payment failures.
</Warning>

## Test Cards

Use these card numbers to simulate successful and declined payments across different regions.

<Tabs>
  <Tab title="Successful Payments">
    | Region | Brand      | Card Number        | Expiry | CVV |
    | :----- | :--------- | :----------------- | :----- | :-- |
    | US     | Visa       | `4242424242424242` | 06/32  | 123 |
    | US     | Mastercard | `5555555555554444` | 06/32  | 123 |
    | India  | Visa       | `4576238912771450` | 06/32  | 123 |
    | India  | Mastercard | `5409162669381034` | 06/32  | 123 |
  </Tab>

  <Tab title="Declined Payments">
    | Region | Brand      | Card Number        | Scenario           |
    | :----- | :--------- | :----------------- | :----------------- |
    | US     | Visa       | `4000000000000002` | Generic decline    |
    | US     | Mastercard | `4000000000009995` | Insufficient funds |
    | India  | Visa       | `4706131211212123` | Generic decline    |
    | India  | Mastercard | `5105105105105100` | Generic decline    |
  </Tab>

  <Tab title="Subscription Failure Testing (Renewal/Upgrade/Downgrade)">
    | Card Number           | Expiry | CVC |
    | :-------------------- | :----- | :-- |
    | `4000 0000 0000 0341` | 12/34  | 123 |

    Use this card to test subscription Failure renewal, upgrade, and downgrade scenarios.
  </Tab>
</Tabs>

<Info>
  For all test cards, use expiry date **06/32** (or **12/34**) and CVV **123**.
</Info>

### How to Test Renewal Failure

<Steps>
  <Step title="Create a test subscription">
    Create a subscription with your test API keys using a **success** test card (for example, `4242 4242 4242 4242`). The initial charge should succeed and the subscription should become active.
  </Step>

  <Step title="Swap in the failure card via Customer Portal">
    Open the [Customer Portal](/features/customer-portal), find the subscription you just created, and click **Update Payment Method**. Enter the failure test card `4000 0000 0000 0341` (Expiry: `12/34`, CVC: `123`) and save it as the subscription's payment method.
  </Step>

  <Step title="Advance the next billing date (optional)">
    To trigger renewal immediately instead of waiting for the natural billing cycle, use the Update Subscription API to set `next_billing_date` to the current UTC time. The value must be an ISO 8601 / RFC 3339 UTC timestamp (the `Z` suffix is required).

    ```http theme={null}
    PATCH /subscriptions/{subscription_id}
    {
      "next_billing_date": "2026-05-03T00:00:00Z"
    }
    ```

    See the [Update Subscription API reference](/api-reference/subscriptions/patch-subscriptions#body-next-billing-date-one-of-0) for details.
  </Step>

  <Step title="Verify the failure">
    On the next billing attempt:

    * The renewal charge declines on the failure card
    * The subscription moves to **On-Hold** status
    * A `payment.failed` webhook event is delivered
    * The customer can return to the Customer Portal to update the payment method and retry
  </Step>
</Steps>

<Warning>
  This card is specifically for testing renewal failures. The charge will decline on the next billing date, allowing you to test payment retry logic, customer notifications, and failure handling.
</Warning>

## Test UPI

UPI testing uses special VPA (Virtual Payment Address) identifiers that simulate different payment outcomes.

| Status  | UPI ID        |
| :------ | :------------ |
| Success | `success@upi` |
| Failure | `failure@upi` |

### Requirements for UPI Testing

* Billing country must be set to `IN`
* Currency must be `INR`
* For non-Indian merchants: Adaptive Currency must be enabled

For complete UPI documentation including RBI mandate testing for subscriptions, see the [India Payment Methods](/features/payment-methods/india) page.

## Test BNPL

Buy Now Pay Later providers have specific test data requirements.

### Klarna Test Data

Use these details to simulate Klarna payments in test mode:

| Field             | Approved                                      | Denied                                                      |
| :---------------- | :-------------------------------------------- | :---------------------------------------------------------- |
| **Date of Birth** | 07-10-1970                                    | 07-10-1970                                                  |
| **First Name**    | Test                                          | Test                                                        |
| **Last Name**     | Person-us                                     | Person-us                                                   |
| **Email**         | [customer@email.us](mailto:customer@email.us) | [customer+denied@email.us](mailto:customer+denied@email.us) |
| **Street**        | Amsterdam Ave                                 | Amsterdam Ave                                               |
| **House Number**  | 509                                           | 509                                                         |
| **City**          | New York                                      | New York                                                    |
| **State**         | New York                                      | New York                                                    |
| **Postal Code**   | 10024-3941                                    | 10024-3941                                                  |
| **Phone**         | +13106683312                                  | +13106354386                                                |

<Note>
  Klarna requires a minimum transaction amount of **\$50.01** to appear as a payment option.
</Note>

### Afterpay Testing

<Steps>
  <Step title="Select Afterpay">
    Choose Afterpay as the payment method in checkout and click Pay.
  </Step>

  <Step title="Test successful payment">
    Use any valid email address and shipping address for successful payments.
  </Step>

  <Step title="Test failed authentication">
    To simulate failure, close the Afterpay modal window on the redirect page. The payment transitions from `requires_action` to `requires_payment_method`.
  </Step>
</Steps>

<Note>
  Afterpay requires a minimum transaction amount of **\$50.01** to appear as a payment option.
</Note>

### Sunbit Testing

<Steps>
  <Step title="Set billing country and currency">
    Ensure `billing_address.country` is `US` and `billing_currency` is `USD`.
  </Step>

  <Step title="Use a qualifying amount">
    Set the transaction amount between **$60.00 and $19,999.00**.
  </Step>

  <Step title="Complete the Sunbit flow">
    Select Sunbit at checkout and complete the financing application in the Sunbit modal.
  </Step>

  <Step title="Test failure">
    Close the Sunbit modal before completing the flow to simulate a declined application. Payment transitions to `requires_payment_method`.
  </Step>
</Steps>

<Note>
  Sunbit only appears for US customers paying in USD with an amount between **$60.00** and **$19,999.00**.
</Note>

For complete BNPL documentation including Billie B2B testing, see the [Buy Now Pay Later](/features/payment-methods/bnpl) page.

## Test Digital Wallets

### Apple Pay

<Steps>
  <Step title="Enable test mode">
    Use your Dodo Payments test API keys.
  </Step>

  <Step title="Add a card to Apple Wallet">
    Add a real card to your Apple Wallet. In test mode, the card won't be charged.
  </Step>

  <Step title="Complete test purchase">
    Open checkout on an Apple device and complete the Apple Pay flow.
  </Step>
</Steps>

<Warning>
  Apple Pay requires HTTPS. It won't appear on `localhost` without proper SSL setup. Domain verification must also be complete.
</Warning>

### Google Pay

<Steps>
  <Step title="Join the test card group">
    [Join the Google Pay test card group](https://groups.google.com/g/googlepay-test-mode-stub-data) to get test cards automatically added to your wallet.
  </Step>

  <Step title="Enable test mode">
    Use your Dodo Payments test API keys.
  </Step>

  <Step title="Complete test purchase">
    Select one of the test cards in Google Pay to complete the transaction.
  </Step>
</Steps>

### Amazon Pay, Cash App Pay & RevolutPay

Use your test API keys and follow the standard checkout flow. Test transactions are simulated without actual charges.

For complete digital wallet documentation including domain verification for Apple Pay, see the [Digital Wallets](/features/payment-methods/digital-wallets) page.

## Test European Methods

European payment methods (iDEAL, Bancontact, EPS, Multibanco) can be tested in sandbox mode.

<Steps>
  <Step title="Enable test mode">
    Use your Dodo Payments test API keys.
  </Step>

  <Step title="Set billing address">
    Set the billing address country to match the payment method:

    * `NL` for iDEAL
    * `BE` for Bancontact
    * `AT` for EPS
    * `PT` for Multibanco
  </Step>

  <Step title="Set currency">
    European methods require EUR currency.
  </Step>

  <Step title="Complete test flow">
    Follow the simulated bank authentication flow in the test environment.
  </Step>
</Steps>

For complete European payment methods documentation, see the [Europe](/features/payment-methods/europe) page.

## Testing Best Practices

<AccordionGroup>
  <Accordion title="Test all payment scenarios">
    Don't just test successful payments. Test declines, cancellations, and edge cases like insufficient funds.
  </Accordion>

  <Accordion title="Verify webhook handling">
    Ensure your webhook endpoints correctly process all event types, especially `payment.succeeded`, `payment.failed`, and subscription events.

    Use the [Dodo Payments CLI](/developer-resources/sdks/cli#webhook-testing) to test webhooks locally:

    * `dodo wh listen` forwards live test webhooks to your local server
    * `dodo wh trigger` sends mock payloads for all 22 event types
  </Accordion>

  <Accordion title="Test on real devices">
    For Apple Pay and Google Pay, test on actual iOS and Android devices. Simulators don't fully replicate wallet behavior.
  </Accordion>

  <Accordion title="Test regional methods with correct addresses">
    Regional payment methods (UPI, iDEAL, etc.) require matching billing addresses. A US billing address won't show iDEAL.
  </Accordion>

  <Accordion title="Verify minimum amounts">
    BNPL methods require \$50.01 minimum. Test that they correctly appear/hide based on cart total.
  </Accordion>
</AccordionGroup>

## Related Pages

<CardGroup cols={2}>
  <Card title="Cards" icon="credit-card" href="/features/payment-methods/cards">
    Card testing, 3D Secure, and saved payment methods.
  </Card>

  <Card title="Digital Wallets" icon="wallet" href="/features/payment-methods/digital-wallets">
    Apple Pay, Google Pay, Amazon Pay testing.
  </Card>

  <Card title="BNPL" icon="calendar-days" href="/features/payment-methods/bnpl">
    Klarna, Afterpay, and Billie testing.
  </Card>

  <Card title="India" icon="indian-rupee-sign" href="/features/payment-methods/india">
    UPI and RBI mandate testing.
  </Card>

  <Card title="Europe" icon="euro-sign" href="/features/payment-methods/europe">
    iDEAL, Bancontact, EPS, Multibanco testing.
  </Card>

  <Card title="Webhooks" icon="webhook" href="/developer-resources/webhooks">
    Set up webhooks for test events.
  </Card>

  <Card title="CLI Webhook Testing" icon="terminal" href="/developer-resources/sdks/cli#webhook-testing">
    Test webhooks locally with the Dodo Payments CLI.
  </Card>
</CardGroup>
