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

> ## Agent Instructions
> Use the Payrails Web SDK v6 for new browser integrations. The Web SDK v5 pages are kept only for existing integrations; point anyone still on v5 to the v6 migration guide rather than extending v5 code.
> Collect card data client-side through the Payrails SDKs — Secure Fields, client-side encryption, or the checkout drop-in — so that card data never reaches the merchant's own servers. Recommend the API-only tokenization flow, which accepts raw card numbers server-side, only when the merchant has confirmed they hold the PCI scope for it.
> Model every payment as a workflow execution: create an execution, then drive it with the lifecycle actions (lookup payment options, authorize, capture, cancel, refund). Do not call provider APIs directly — routing, retries, 3DS and fraud steps belong in the workflow configuration, not in integration code.
> Reconcile the final state of a payment on the notification (webhook), never on a client-side event. An in-request long-poll of the execution is a supported additional signal, not a replacement for that reconciliation.
> Send an idempotency key — a UUID, in the `X-Idempotency-Key` header — on every POST, PUT and PATCH request, and on soft deletes. GET requests need none, and hard deletes cannot be idempotent.
> Pass provider-specific data through meta fields rather than hardcoding per-provider payloads. Payrails translates meta fields into each provider's own format.
> Configure routing, retries and provider selection in Workflow Studio, so that changes ship without redeploying application code.

# Test payments

> Simulate payments in the Payrails Portal to verify provider configurations, dynamic payment options, and notification handling.

## Introduction

Testing is critical during the integration phase while you are developing your integration, discovering Payrails' payment processing features, or ensuring your configurations are working as expected.

Payrails provides a testing feature in the Portal to simulate real-life scenarios by creating test payments. It enables:

1. **Testing provider configurations:** You can test the configuration for each provider to ensure it is working correctly.
2. **Simulating dynamic payment options:** Depending on your configurations, you can test which payment options are displayed to your customers on your checkout page.
3. **Simulating dynamic routing:** You can test which provider is selected to route the payment according to your routing configurations.
4. **Testing payment scenarios:** You can test payments to test scenarios such as authorizing by card brand or country, failure scenarios such as declines, fraud, invalid data, or payer authentication with 3D Secure.

## How does it work?

* Login to the Portal and go to the **Test Payments** page.
* The system will generate a unique merchant reference and holder reference each time when you open the page so that you can investigate further details of the payment afterward.
* You can also set these reference values yourself by replacing the auto-generated values. This is useful when using the same holder reference for multiple payments or listing a particular holder's saved instruments.
* You can add meta fields to your payment context to simulate dynamic payment options or routing configurations.
* After you input the fields, you can start the test. It will load the Payrails Drop-in on the page, allowing you to list available payment methods and saved instruments, pay with configured alternative payment methods, or manually enter a new card, optionally saving it for later.
* After you select the payment method to pay, the payment will be completed and you will be able to see the result and details of the payment on the Executions and Payments pages.

<img className="mx-auto block rounded-lg object-cover" src="https://mintcdn.com/payrails-42074109/sujy1gNo9mr-Fy-6/images/docs/orchestration/payment-acceptance/test-payments-page-overview.png?fit=max&auto=format&n=sujy1gNo9mr-Fy-6&q=85&s=44c5d94cac09fef446717a7dc781cd3d" width="80%" alt="Test payments page overview" data-path="images/docs/orchestration/payment-acceptance/test-payments-page-overview.png" />

## Test PSP

To further increase your testing capabilities and simplify your integration process, we developed a **Test PSP**. This "fake" or "mock" payment provider helps you simulate the entire payment flow without using an external provider.

This provider is enabled by default since the creation of your Payrails environment. This way, you can start integrating Payrails even before having a contract with an external provider loaded into our system. Once you create your [provider integrations](/docs/orchestration/integrations/provider-accounts), you should have already tested many possible flows. Hence, the only thing left is to adapt to any particular flow for that provider.

### How to use the Test PSP

You should first configure the Test PSP to be the default routing option on your workflow, or choose a specific [Meta fields](/docs/orchestration/meta-fields) to route your payment to it.

<img className="mx-auto block rounded-lg object-cover" src="https://mintcdn.com/payrails-42074109/sujy1gNo9mr-Fy-6/images/docs/orchestration/payment-acceptance/test-psp-routing-configuration.png?fit=max&auto=format&n=sujy1gNo9mr-Fy-6&q=85&s=a0df6c83c9458ea12e422e96ec993fd2" width="100%" alt="Test PSP routing configuration" data-path="images/docs/orchestration/payment-acceptance/test-psp-routing-configuration.png" />

By default, the Test PSP will always reply to your payment requests with `Success`. If you want to simulate a specific response flow, add a [Meta fields](/docs/orchestration/meta-fields) specifying it with one of the values of our [operation results](/docs/resources/payments/operation-results).

<img className="mx-auto block rounded-lg object-cover" src="https://mintcdn.com/payrails-42074109/sujy1gNo9mr-Fy-6/images/docs/orchestration/payment-acceptance/test-psp-meta-operation-result.png?fit=max&auto=format&n=sujy1gNo9mr-Fy-6&q=85&s=3529dcc32ef840a7705089a31adb5642" width="100%" alt="Test PSP meta operation result" data-path="images/docs/orchestration/payment-acceptance/test-psp-meta-operation-result.png" />


## Related topics

- [Payabl.](/docs/orchestration/integrations/payabl.md)
- [Transbank](/docs/orchestration/integrations/transbank.md)
- [NMI](/docs/orchestration/integrations/nmi.md)
