Skip to main content

Testing Guide

Before running payment tests, arrange an isolated testing setup and approved recipient data with your account manager. A test-looking key prefix alone is not a guarantee that a request is simulated.

Test vs Production Mode

Test and production use the same API endpoint. Your account manager must confirm the environment and permitted test scenarios before you create payments.

Getting Test API Keys

Test API keys are provided by the LuxCore team during onboarding. Once you have access:
  1. Log in to your Merchant Dashboard
  2. Navigate to Settings → API Keys
  3. Copy your test API key (starts with qp_test_sk_)
Contact developers@lux-core.io if you need test API keys.

Confirm the Setup Before Testing

Confirm the endpoint, credentials, enabled currencies/methods, permitted recipients and expected statuses with your account manager. Only create payments after the isolated testing setup has been confirmed. Do not use live recipients or production credentials for example requests. Use the webhook test endpoint to test signature verification without creating a payment. Test notifications must not trigger order fulfilment or balance changes in your application; check X-Webhook-Test: true.

Agreed Payment Test Scenarios

Successful Deposit

In the confirmed testing setup, create a deposit and verify the expected status with your account manager:

Successful Deposit (AUD with PayID)

Create a deposit using PayID for near-instant processing:

Successful Withdrawal

Use only the approved test recipient in the confirmed testing setup. Verify the required balance before submitting a withdrawal:

Testing Webhooks

Send Test Event

Use the test endpoint to send a test webhook to your server:
Your server receives the same webhook envelope used by automatic payment webhooks:
The response from the test API includes request.body and request.headers so you can compare the delivered payload and signature headers with what your endpoint logged.

Local Development

For local development, use a tunneling service like ngrok to expose your local server:

Integration Checklist

Before going live, verify your integration handles these scenarios:
  • Create deposit payments successfully
  • Create withdrawal payments successfully
  • Handle validation errors gracefully
  • Store transaction IDs for tracking
  • Retrieve payment status by ID
  • List payments with filters
  • Cancel pending payments
  • Receive webhook notifications
  • Verify webhook signatures
  • Handle payment.completed events
  • Handle payment.failed events
  • Process events idempotently
  • Handle 401 (unauthorized) errors
  • Handle 400 (bad request) errors
  • Handle 429 (rate limit) errors
  • Handle network timeouts
  • Check balance before withdrawals
  • Handle insufficient balance errors

Going Live

1

Complete Testing

Verify the agreed test scenarios and all checklist items
2

Request Live API Key

Contact your LuxCore account manager or developers@lux-core.io to request production credentials
3

Update Configuration

Replace test API key with live API key in your production environment
4

Update Webhook URLs

Ensure webhooks point to your production server
5

Monitor

Watch the dashboard for your first live transactions
Never use live API keys in development or testing environments. Always keep test and production credentials separate.

Common Testing Mistakes

Using Live Keys in Dev

Always use test keys (qp_test_sk_*) in development

Skipping Webhook Verification

Always verify signatures, even in test mode

Not Testing Errors

Test error scenarios, not just happy paths

Hardcoding Keys

Use environment variables for API keys

Need Help?

Developer Support

Contact our team if you have questions about testing