# Testing (/online/getting-started/testing)



Test your Checkout integration in the Tapaya sandbox before taking live payments. Sandbox payments use test cards, so no real money moves. Production Checkout accepts real payments from approved merchants.

<div className="fd-steps [&_h3]:fd-step">
  ### Point your server at the sandbox API [#point-your-server-at-the-sandbox-api]

  Set `TAPAYA_CHECKOUT_API_URL` to `https://api.sandbox.tapaya.com` and store a merchant checkout key in `TAPAYA_CHECKOUT_API_KEY`. Keep both on your server.

  ```bash title=".env"
  TAPAYA_CHECKOUT_API_URL=https://api.sandbox.tapaya.com
  TAPAYA_CHECKOUT_API_KEY=tapaya_test_...
  ```

  Complete [onboarding](/merchants/onboarding) with the online payments capability and check that the merchant is **Ready** in [Checkout settings](/online/integration/checkout_settings). Save return URLs if you use Hosted Checkout.

  ### Create a test session [#create-a-test-session]

  Create a session for a test order, exactly as in the [Quick Start Guide](./quick_start_guide). Store the returned
  `id` with the order before redirecting, so you can check the result even if the browser is closed.

  ### Pay with a test card [#pay-with-a-test-card]

  Open the session's `url` and pay with one of the cards below, any future expiry date, and CVC `123`.

  ### Verify from your server [#verify-from-your-server]

  Retrieve the session from your server and compare its order reference, amount, currency, and
  `paymentStatus` with the stored order. The browser returning to your success URL does not prove payment.
</div>

## Test cards [#test-cards]

Use these test cards.

| Scenario                                                      | Card number                                                      | Result                                                                                                              |
| :------------------------------------------------------------ | :--------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------ |
| <span className="whitespace-nowrap">Payment succeeds</span>   | <span className="whitespace-nowrap">`4242 4242 4242 4242`</span> | <Badge variant="success">successful</Badge> Fulfill the order once.                                                 |
| <span className="whitespace-nowrap">Card is declined</span>   | <span className="whitespace-nowrap">`4916 0184 7581 4056`</span> | <Badge variant="error">failed</Badge> The session stays `open`; the customer can try another card.                  |
| <span className="whitespace-nowrap">3D Secure required</span> | <span className="whitespace-nowrap">`4012 0018 0000 0016`</span> | <Badge variant="info">challenge</Badge> Complete the test challenge, then fulfill after retrieval confirms success. |

A processing-error card can pass tokenization and fail only when charged, so always check the retrieved status rather
than the card form's reaction.

## What the sandbox covers [#what-the-sandbox-covers]

* **Hosted Checkout:** cards, using the test cards above. Wallet buttons depend on the merchant's settings and the
  customer's device, so they may not appear in every test.
* **Embedded Checkout:** cards and wallets. Apple Pay needs a registered shop domain. See
  [Add Apple Pay and Google Pay](/online/integration/embedded_checkout#add-apple-pay-and-google-pay).
* **Sessions:** accept payments for 30 minutes. Use a new `merchantOrderId` for each test, because an order can be
  paid only once.
* **Wallets:** Google Pay's TEST sheet may record a simulated payment without charging money. Test wallet delivery
  and saving on real devices.

## Test saved cards and delivery [#test-saved-cards-and-delivery]

Use a new order reference for each test, and check every pending result from your server.

* [Customer details and delivery quotes](/online/integration/customer_and_shipping)
* [Saving a card](/online/integration/saved_payment_methods), including a zero-amount check
* Saved-card payments: the customer paying with 3-D Secure, and you charging later
* Manual capture: partial capture, release, expiry, and refunds
* Each language you support, including your saving terms

When these pass, work through the [QA Checklist](./checklist) for retries, lost responses, and customers who never
return.
