Testing

Complete guide to testing integration. Test data, scenarios, and validation checklist.

Thoroughly test your Localpayment integration before going live. This comprehensive guide provides test data, scenarios, and validation procedures to ensure your implementation works correctly across all payment methods and edge cases.

Prerequisites

Before you begin testing, ensure you have the following configured:


Sandbox Environment

The Stage environment is a complete replica of our production system, designed specifically for testing:

Realistic Processing

Simulates actual payment flows and timing.

No Real Money

All transactions use test data.

Full Feature Set

All payment methods and operations are available.

Isolated Testing

Your Stage data is kept separate from production.


Test Data

Card Payments

Test credit and debit card payments with various scenarios:

Card NumberScenarioExpected ResultTest Purpose
4242424242424242✅ Successful PaymentImmediate approvalBasic payment flow
4000000000000002❌ Card DeclinedDecline with reasonDecline handling
4000002500003155🔐 3D Secure RequiredAuthentication redirect3D Secure flow
4000000000009995⚠️ Processing ErrorTemporary failureBalance checks

Standard Card Details:

  • Expiry Date: Any future date (e.g., 12/2029)
  • CVC: Any 3-digit number (e.g., 123) for Mastercard and Visa cards or any 4-digit number (e.g., 1234) for American Express cards.
  • Cardholder Name: Any test name (e.g., "John Doe")

Error Scenario Testing

Validation Errors

  • Omit required fields (paymentMethod, amount)
  • Use invalid formats (wrong currency, invalid document numbers)
  • Test parameter constraints (amount limits, country restrictions)

Authentication Tests

  • Use expired access tokens
  • Test with invalid credentials
  • Verify IP whitelisting restrictions

Webhook Testing

Ensure your webhook endpoint correctly handles notifications:

Endpoint Configuration

  • Verify HTTPS requirement
  • Test signature verification
  • Confirm immediate 200 OK response

Event Processing

  • Test all event types (payins, payouts, virtual accounts)
  • Verify idempotency handling
  • Confirm async processing

Error Handling

  • Test timeout scenarios
  • Verify retry logic
  • Monitor delivery failures

Virtual Account Simulation (Stage)

For Virtual Account integrations, Localpayment provides a dedicated simulation endpoint to test the full lifecycle (Creation -> Funding -> Notification).

Virtual Account Payments (Simulation)

To simulate a successful payment in Stage, use the same beneficiary data — name, document type, and document ID — that was provided when creating the virtual account. There are no separate test identities required; the Simulate a Virtual Account Payment endpoint will validate the payer data against the information registered during account creation.

Core Test Scenarios:

ScenarioObjectiveRequirement
Verify StatusConfirm account activationCheck Get Virtual Account Status after creation.
Simulate Pay-InTrigger a mock paymentUse Simulate a Virtual Account Payment with the same beneficiary data from account creation.
Webhook DeliveryValidate listener logicEnsure payin.completed (status: COMPLETED) is received after simulation.
📘

Important

  • Field Mapping: For the simulation call, use the beneficiary.bank.account.number returned by Get Virtual Account Status to identify the target account. The externalId in the simulation request should be a unique identifier for the payin transaction — use a different value for each request. Also include your real accountNumber (Merchant ID) to identify the project.
  • Identities: Use the same beneficiary data — name, document type, and ID — that was provided when creating the virtual account. See the Full Simulation Guide for details.

Validation Checklist

Before moving to production, verify:

  • Payment Flows: Confirm that all payment methods behave correctly, including both success and error scenarios.
  • Webhook Handling: Ensure all webhook events are received, verified, and processed as expected.
  • Error Handling: Display clear error messages to users and implement proper retry logic where needed.
  • Security: Enforce HTTPS, verify signatures, and ensure all sensitive data is handled securely.
  • User Experience: Provide clear loading states, helpful messaging, and smooth redirect flows throughout the payment journey.

Testing Tools

Download our complete Postman collection with pre-configured test scenarios: