Skip to main content

Testing Guide

LuxCore provides a test mode that allows you to simulate transactions without processing real money. This guide covers how to use test mode effectively.

Test vs Production Mode

Test and production use the same API endpoint. The environment is determined by your API key prefix.
Key PrefixEnvironmentBehavior
qp_test_*TestSimulated transactions, no real money
qp_prod_*ProductionReal transactions, actual money movement

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_)
Contact developers@lux-core.io if you need test API keys.

Test Mode Behavior

Payments

  • Payments are created and go through normal status transitions
  • No actual bank transfers or card charges occur
  • Webhooks are delivered normally
  • All API responses mirror production behavior

Balance

  • Test mode uses a separate test balance
  • Initial test balance may be pre-funded for testing
  • Balance changes reflect test transactions only

Webhooks

  • Webhooks are delivered to your configured endpoints
  • Use webhook testing to verify your integration
  • Same signature verification as production

Simulating Payment Scenarios

Successful Deposit

Create a deposit payment - it will transition to completed status:
curl -X POST "https://api.lux-core.io/api/v1/payments" \
  -H "X-API-Key: qp_test_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 100000,
    "currency": "ARS",
    "method": "bank_transfer",
    "type": "deposit",
    "merchant_reference": "test_order_001",
    "customer": {
      "name": "Test Customer",
      "email": "test@example.com"
    }
  }'

Successful Withdrawal

Create a withdrawal payment (requires sufficient test balance):
curl -X POST "https://api.lux-core.io/api/v1/payments" \
  -H "X-API-Key: qp_test_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 50000,
    "currency": "ARS",
    "method": "bank_transfer",
    "type": "withdrawal",
    "merchant_reference": "test_payout_001",
    "customer": {
      "name": "Test Payout",
      "email": "payouts@example.com"
    },
    "payout": {
      "recipient_name": "Juan Perez",
      "bank_account": "0110012345678901234567"
    }
  }'

Testing Webhooks

Send Test Event

Use the test endpoint to send a test webhook to your server:
curl -X POST "https://api.lux-core.io/api/v1/webhooks/{webhook_id}/test" \
  -H "X-API-Key: qp_test_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "event_type": "payment.completed"
  }'

Local Development

For local development, use a tunneling service like ngrok to expose your local server:
# Start ngrok
ngrok http 3000

# Use the ngrok URL for your webhook endpoint
# https://abc123.ngrok.io/webhooks/luxcore

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

Ensure all checklist items pass in test mode
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_*) 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