Testing Guide

Validate your EcobankPay integration before going live

Overview

Testing your EcobankPay integration is a critical step before accepting real payments. This guide covers the testing process, including:

  • Setting up your sandbox environment
  • Test credentials and data
  • Testing different payment methods
  • Simulating successful and failed transactions
  • Verification and validation processes

Sandbox Environment

EcobankPay provides a dedicated sandbox environment for testing your integration:

EnvironmentBase URLPurpose
Sandboxhttps://sandbox.ecobankpay.com/api/v1Testing and development
Productionhttps://api.ecobankpay.com/api/v1Live transactions

Obtaining Sandbox Credentials

To access the sandbox environment:

  1. Contact EcobankPay support at support@ecobankpay.com to request sandbox access
  2. You will receive a Sandbox Merchant Key and Secret
  3. These credentials are different from your production credentials
  4. Use these sandbox credentials for all your testing

Important:

Never use production credentials in your development or testing environments, and never use sandbox credentials in production.

Test Data for Payment Methods

Mobile Money Test Data

Use these test phone numbers for simulating mobile money payments:

ProviderTest Phone NumbersSimulated Result
MTN Mobile Money+233200000001Successful payment
MTN Mobile Money+233200000002Failed payment (insufficient funds)
AirtelTigo Money+233270000001Successful payment
AirtelTigo Money+233270000002Failed payment (user cancelled)
Telecel Cash+233500000001Successful payment
Telecel Cash+233500000002Failed payment (timeout)

Card Payment Test Data

Use these test cards for simulating card payments:

Card TypeCard NumberExpiryCVVResult
VISA4111 1111 1111 1111Any future date123Successful
VISA (3DS)4242 4242 4242 4242Any future date123Successful with 3DS
MasterCard5555 5555 5555 4444Any future date123Successful
VISA (Declined)4000 0000 0000 0002Any future date123Declined
MasterCard (Declined)5105 1051 0510 5100Any future date123Declined

3D Secure Testing:

For cards that trigger 3D Secure in the sandbox, use any value for the authentication code. In the sandbox, 3D Secure simulations always succeed when you provide any value.

Testing Scenarios

To thoroughly test your integration, implement these test scenarios:

1. Basic Payment Flows

  • Successful payment with each supported payment method
  • Failed payment with each supported payment method
  • Cancelled payment (customer abandons payment)
  • Expired transaction (payment not completed within time limit)

2. Notification Handling

  • IPN (webhook) received and processed correctly
  • Success URL redirect handling
  • Cancelled URL redirect handling
  • Status check API integration working properly

3. Error Scenarios

  • Missing required parameters (e.g., merchant_key, invoice_id, total)
  • Invalid secure_hash verification
  • Duplicate invoice_id handling
  • Network timeout and retry mechanisms

4. Edge Cases

  • Very small transaction amounts (e.g., 0.01)
  • Large transaction amounts (e.g., 9999.99)
  • Special characters in description, invoice_id, etc.
  • Multiple concurrent transactions

Simulating Specific Scenarios

You can simulate specific payment scenarios in the sandbox by using special values:

ScenarioHow to Simulate
Transaction TimeoutUse an amount of exactly 0.01 in the total field
Network ErrorUse an amount of exactly 0.02 in the total field
Insufficient FundsUse an amount of exactly 0.03 in the total field
Customer CancellationUse an amount of exactly 0.04 in the total field
Delayed ProcessingUse an amount of exactly 0.05 in the total field

Integration Verification Checklist

Before going live, verify that your integration meets these requirements:

CategoryVerification Item
AuthenticationSecure hash implementation works correctly
Payment FlowAll supported payment methods can be initiated successfully
NotificationsIPN webhook endpoint receives and processes notifications
Status ChecksPayment status verification is implemented correctly
Error HandlingApplication handles failed payments gracefully
IdempotencySystem prevents duplicate order processing
UI/UXUser interface clearly communicates payment status
SecurityMerchant credentials are stored securely (not in source code)
EnvironmentCode to switch between sandbox and production environments exists

Going Live Checklist

When you're ready to move from sandbox to production:

  1. Complete all testing: Ensure all test scenarios pass in the sandbox environment
  2. Request production credentials: Contact EcobankPay support to obtain production credentials
  3. Update configuration: Change API endpoints and credentials to production values
  4. Implement logging: Ensure comprehensive logging is in place for troubleshooting
  5. Set up monitoring: Implement alerts for payment failures or abnormal patterns
  6. Perform a test transaction: Make a small real payment to verify the production setup
  7. Document the process: Create internal documentation for handling payment issues

Production Support:

Once live, EcobankPay's support team can be reached at support@ecobankpay.com or by phone at +233 XX XXX XXXX for urgent issues.