Testing

Complete guide to testing Localpayment 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.

Overview

Testing is crucial for ensuring a smooth payment experience for your customers. Localpayment's sandbox environment provides complete testing capabilities that mirror production functionality without processing real transactions.


Prerequisites

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

Stage Environment

Your application points to Stage base URLs:
https://api.stage.localpayment.com

API Credentials

Stage credentials issued and authentication implemented in your code

Webhook Endpoint

Public HTTPS webhook endpoint configured to receive test notifications

IP Whitelisting

Your Stage environment IP addresses whitelisted in the dashboard


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 available.
  • Isolated Testing: Your Stage data is 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

Validation Checklist

Before moving to production, verify:

✅ Payment Flows

All payment methods work correctly, including success and error scenarios

✅ Webhook Handling

Webhooks are received, verified, and processed correctly for all event types

✅ Error Handling

Proper error messages displayed to users, appropriate retry logic implemented

✅ Security

HTTPS enforced, signatures verified, sensitive data handled properly

✅ User Experience

Clear loading states, appropriate messaging, smooth redirect flows


Testing Tools

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


Next Steps