Testing

Overview

This guide provides comprehensive testing resources for your xMoney integration. Use our test cards, magic amounts to simulate various payment scenarios before going live.

All test transactions should be performed in the xMoney test environment using your test API credentials.

Test Mode vs Live Mode

Test ModeLive Mode
Use test credentials from your sandbox accountUse production credentials from your live account
No real money is transferredReal money is transferred
Simulated payment scenariosActual payment processing
Test API endpoint: https://api-stage.xmoney.comLive API endpoint: https://api.xmoney.com

Test Cards

Use these test cards to simulate different payment scenarios in your test environment.

Card BrandCard NumberExpiry DateCVV3DS CodeResult
Visa4111 1111 1111 1111Any future date12300000Successful payment
Mastercard5555 5555 5555 4444Any future date12300000Successful payment
Mastercard5555 5555 5555 559912/3412300000Successful payment (3DS2 Full)
Visa4111 1111 1111 111112/2612300000Successful payment (3DS2 Frictionless)
Mastercard5168 4948 9505 578012/2612300000Failed payment (3DS2 Frictionless)
Visa4000 0011 1111 111812/3012300000Successful payment (3DS2 Attempt)
Visa4444 5555 1111 333312/26123N/ASuccessful payment (SSL)
Checkout hosted pageCheckout hosted page

For 3DS test cards, use 00000 as the authentication code when prompted.

Testing Specific Scenarios

3D Secure Authentication

To test 3D Secure (3DS) authentication:

  1. Use a test card from above
  2. Set the transaction amount to 25.01 or higher
  3. When redirected to the 3DS page, use 00000 as the authentication code
  4. Complete the payment flow

3DS testing simulates both the card issuer authentication and the redirect flow your customers will experience.

Refunds

To test refund functionality:

  1. Make a successful test payment
  2. Use the Refund API to process a full or partial refund
  3. Verify the refund status through the API and webhooks

Recurring Payments

Test recurring payment scenarios:

  1. Create a successful initial payment with recurring: true
  2. Store the payment method token returned in the response
  3. Use the token to create subsequent payments
  4. Test different intervals and amounts

Debugging Tools

Response Codes

CodeStatusDescription
200OKTransaction processed successfully
201CreatedTransaction created (may require 3DS)
202AcceptedTransaction is being processed
400Bad RequestInvalid parameters or request format
401UnauthorizedInvalid API credentials
402Payment RequiredPayment failed (see failureReason)
403ForbiddenTransaction declined by issuer
404Not FoundResource not found
408TimeoutRequest timed out
422UnprocessableInvalid transaction data
500Server ErrorInternal server error
504Gateway TimeoutProcessing timeout

Webhook Testing

  1. Configure your webhook URL in the test environment
  2. Make test transactions to trigger webhook events
  3. Use the Webhook Logs in your dashboard to inspect delivery status
  4. Implement proper validation of webhook signatures

Always validate webhook signatures to ensure the authenticity of webhook events.

Common Testing Issues

IssuePossible CauseSolution
3DS not triggeredTransaction amount below thresholdUse amount > 25.00
Webhook not receivedIncorrect webhook URLVerify URL in dashboard
Invalid signatureWrong API key used for validationCheck signature calculation
Unexpected declineUsing production card in test modeUse test cards only
API connection failureIncorrect API endpointVerify test vs. production endpoint

Going Live Checklist

Before transitioning to the production environment:

  • Test all payment flows with test cards
  • Implement proper error handling for all scenarios
  • Test webhook integration and signature validation
  • Verify 3DS flows work correctly
  • Implement proper logging and monitoring
  • Update API endpoints from test to production
  • Update API credentials from test to production
  • Complete a test transaction in production environment

Never use your production API credentials in your development or staging environments.