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 Mode | Live Mode |
---|---|
Use test credentials from your sandbox account | Use production credentials from your live account |
No real money is transferred | Real money is transferred |
Simulated payment scenarios | Actual payment processing |
Test API endpoint: https://api-stage.xmoney.com | Live API endpoint: https://api.xmoney.com |
Test Cards
Use these test cards to simulate different payment scenarios in your test environment.
Card Brand | Card Number | Expiry Date | CVV | 3DS Code | Result |
---|---|---|---|---|---|
Visa | 4111 1111 1111 1111 | Any future date | 123 | 00000 | Successful payment |
Mastercard | 5555 5555 5555 4444 | Any future date | 123 | 00000 | Successful payment |
Mastercard | 5555 5555 5555 5599 | 12/34 | 123 | 00000 | Successful payment (3DS2 Full) |
Visa | 4111 1111 1111 1111 | 12/26 | 123 | 00000 | Successful payment (3DS2 Frictionless) |
Mastercard | 5168 4948 9505 5780 | 12/26 | 123 | 00000 | Failed payment (3DS2 Frictionless) |
Visa | 4000 0011 1111 1118 | 12/30 | 123 | 00000 | Successful payment (3DS2 Attempt) |
Visa | 4444 5555 1111 3333 | 12/26 | 123 | N/A | Successful payment (SSL) |


For 3DS test cards, use 00000
as the authentication code when prompted.
Testing Specific Scenarios
3D Secure Authentication
To test 3D Secure (3DS) authentication:
- Use a test card from above
- Set the transaction amount to
25.01
or higher - When redirected to the 3DS page, use
00000
as the authentication code - 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:
- Make a successful test payment
- Use the Refund API to process a full or partial refund
- Verify the refund status through the API and webhooks
Recurring Payments
Test recurring payment scenarios:
- Create a successful initial payment with
recurring: true
- Store the payment method token returned in the response
- Use the token to create subsequent payments
- Test different intervals and amounts
Debugging Tools
Response Codes
Code | Status | Description |
---|---|---|
200 | OK | Transaction processed successfully |
201 | Created | Transaction created (may require 3DS) |
202 | Accepted | Transaction is being processed |
400 | Bad Request | Invalid parameters or request format |
401 | Unauthorized | Invalid API credentials |
402 | Payment Required | Payment failed (see failureReason) |
403 | Forbidden | Transaction declined by issuer |
404 | Not Found | Resource not found |
408 | Timeout | Request timed out |
422 | Unprocessable | Invalid transaction data |
500 | Server Error | Internal server error |
504 | Gateway Timeout | Processing timeout |
Webhook Testing
- Configure your webhook URL in the test environment
- Make test transactions to trigger webhook events
- Use the Webhook Logs in your dashboard to inspect delivery status
- Implement proper validation of webhook signatures
Always validate webhook signatures to ensure the authenticity of webhook events.
Common Testing Issues
Issue | Possible Cause | Solution |
---|---|---|
3DS not triggered | Transaction amount below threshold | Use amount > 25.00 |
Webhook not received | Incorrect webhook URL | Verify URL in dashboard |
Invalid signature | Wrong API key used for validation | Check signature calculation |
Unexpected decline | Using production card in test mode | Use test cards only |
API connection failure | Incorrect API endpoint | Verify 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.