# Testing source: https://developer.mastercard.com/mastercard-checkout-solutions/documentation/testing/index.md Use the resources on this page to test your integration with Mastercard Checkout Solutions APIs in the Sandbox environment. Choose a testing workflow to configure your request, call the relevant APIs, and verify the response. Tip: Start all validation in Sandbox before moving to Production ## Choose a Testing Method {#choose-a-testing-method} Choose a testing method that best matches how you want to validate requests: * [Reference Application](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/developer-tools/ref-app/index.md) - a working implementation you can run and inspect. * [Postman Collection](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/developer-tools/postman-collection/index.md) --- pre-built requests; configure the environment and OAuth authentication, and set up payload encryption where required. * [Insomnia Collection](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/developer-tools/insomnia-collection/index.md) --- an alternative API client with a ready-to-use workspace. * Custom API client generated as per guidance in the [API Basics](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/api-basics/index.md). ## Recommended Testing Workflows {#recommended-testing-workflows} The recommended flows give you coverage across the full suite of Mastercard Checkout Solutions products. Use the following sequences to validate the main endpoint families with a realistic flow. ### Click to Pay {#click-to-pay} 1. Initialize the SDK and check whether the consumer is recognized. 2. For a first-time consumer, look up their identity, encrypt their card, and enroll it. 3. Call `checkout()` and complete the consumer interaction. 4. Retrieve and decrypt the payment payload, then submit it for authorization. 5. Send the payment confirmation. **Failure check:** Enter an incorrect OTP four times; verify the user sees the too-many-attempts message and is directed to guest checkout. See [Scenario 4](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/testing/test_cases/click_to_pay_case/index.md#scenario-4). See [Click to Pay test cases](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/testing/test_cases/click_to_pay_case/index.md) for requests, responses, and returning-user and failure scenarios. ### Secure Card on File {#secure-card-on-file} 1. Enroll a tokenization-eligible card and verify the response contains `srcDigitalCardId` and `maskedCard`. 2. Call Checkout using the enrolled card's `srcDigitalCardId`. 3. Decrypt the checkout payload and verify it contains a token and cryptogram. 4. Submit the token, cryptogram, and token expiry date for payment authorization. **Failure check:** Enroll a tokenization-ineligible card; verify status `400`, reason `INVALID_STATE`, and error detail `TOKENIZATION_INELIGIBLE`. See [Scenario 2](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/testing/test_cases/secure_card_on_file/index.md#scenario-2). See [Secure Card on File test cases](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/testing/test_cases/secure_card_on_file/index.md) for requests, responses, and failure scenarios. ### Mastercard Merchant Presented QR: SRC {#mastercard-merchant-presented-qr-src} 1. Enroll a tokenization-eligible card and verify the response contains `srcDigitalCardId` and `maskedCard`. 2. Present the merchant QR code and call Checkout using the enrolled card's `srcDigitalCardId`. 3. Verify the summary checkout response contains `maskedCard` and `maskedConsumer`. 4. Verify the acquirer receives the encrypted payment payload and responds with `200`. **Failure check:** Enroll a card using an invalid `srcClientID`; verify status `403` and reason `PERMISSION_DENIED`. See [Scenario 2](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/testing/test_cases/ma_merchant_presented_qr/index.md#scenario-2). See [Mastercard Merchant Presented QR: SRC test cases](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/testing/test_cases/ma_merchant_presented_qr/index.md) for requests, responses, and failure scenarios. ### Guest Checkout Tokenization {#guest-checkout-tokenization} 1. Encrypt a tokenization-eligible test card. 2. Call Checkout with the encrypted card and request a cryptogram. 3. Decode the `checkoutResponseJWS`, decrypt the payload, and verify it contains a token and cryptogram. 4. Use the token and cryptogram to process the payment. **Failure check:** Submit a tokenization-ineligible test card; verify the `TOKENIZATION_INELIGIBLE` response. See [Test Cards](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/testing/test_cases/guest_checkout_tokenization/index.md#tokenization-of-ineligible-cards). See [Guest Checkout Tokenization test cases](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/testing/test_cases/guest_checkout_tokenization/index.md) for requests, responses, and test cards. ### Mastercard Virtual Card Tokens {#mastercard-virtual-card-tokens} 1. Enroll a tokenization-eligible card and verify the response contains `srcDigitalCardId` and `maskedCard`. 2. Call Checkout with the `srcDigitalCardId` and request a Dynamic Token Verification Code (DTVC). 3. Verify the response contains the virtual card token, expiration date, and one-time DTVC. 4. Use the token and DTVC to complete checkout at a supported merchant. **Failure check:** Request a token for a merchant configured to receive only PANs; verify the `403` response includes error detail `RESTRICTED`. See [Scenario 4](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/testing/test_cases/mastercard_virtualcard_tokens/index.md#scenario-4). See [Mastercard Virtual Card Tokens test cases](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/testing/test_cases/mastercard_virtualcard_tokens/index.md) for requests, responses, and test cards. ## Next Steps {#next-steps} * Consult the [API Reference](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/api-reference/apis/index.md) for complete endpoint specification, request and response schemas, and environment URLs. * If you run into issues, see [Codes and Formats](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/code-and-formats/index.md) for error guidance or visit [Support](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/support/index.md) for FAQs and assistance.