Skip to main content

Test payment data

If your integration leverages Tesouro’s acquiring solution for payment processing, use the test card number generator to simulate different transaction responses, AVS results, and security code verification outcomes. If you are leveraging your own payment processing solution, follow your processor’s testing guidance and coordinate with Tesouro as needed for end-to-end validation. Use your product’s Sandbox environment to test your integration with Tesouro. All test scenarios described on this page are designed to run in a non-production environment — they will not work in production.

Common test scenarios

When you first connect to Tesouro in Sandbox, validate the following end-to-end flows:
  • Create a test transaction using your product’s standard UI or API calls, and confirm that Tesouro accepts the request, returns the expected response payload and status, and persists the transaction in your reporting or back-office tools.
  • Confirm a transaction lifecycle from creation through completion (for example: created → pending → succeeded/failed) and verify that each status update is surfaced correctly in your product and stored in your own database or logs.
  • Test idempotency and retries by resending the same request with the same idempotency key and confirming that no duplicate transactions are created and responses remain consistent across retries.
Run these scenarios with several combinations of amounts, currencies (where applicable), and customer data to cover typical production usage.

Error simulation

In addition to happy-path flows, verify how your integration behaves when Tesouro returns errors or delays:
  • Simulate declines — Use documented test data that causes Tesouro to return common decline codes. Confirm that your product surfaces a clear error message and logs the decline reason.
  • Simulate timeouts — Configure requests that intentionally exceed time limits or use Tesouro-provided test parameters that trigger delayed responses. Verify that your integration applies reasonable timeouts and implements safe retries without creating duplicate transactions.
  • Test validation errors — Send requests with missing required fields, invalid formats, or unsupported parameter values. Confirm that Tesouro returns structured error details and your integration parses and logs them.

Webhook testing

If your integration relies on webhooks for asynchronous events (for example, transaction status updates or payout events), use Sandbox to validate your webhook consumer:
  • Configure a Sandbox webhook endpoint — Register a dedicated non-production URL with Tesouro for receiving events.
  • Verify event handling — Confirm that your service validates webhook signatures (if provided), parses the payload, and handles re-delivered events idempotently.
  • Test retries and failure behavior — Temporarily configure your endpoint to return non-2xx responses and verify how Tesouro retries webhook deliveries in Sandbox.