Implementation Guide
Testing Guide
Sandbox testing sequence, key test cases, and entity state machine testing for M2P Prepaid Platform integration.
Sandbox Environment
| Resource | URL |
|---|---|
| API Base URL | https://sandbox-api.m2pprepaid.com |
| Portal | https://sandbox-portal.m2pprepaid.com |
| OpenAPI Docs | https://sandbox-api.m2pprepaid.com/api-docs |
Sandbox is a full-featured replica of production with test BINs and simulated card network responses. Expect slightly higher latency than production.
Recommended Test Sequence
Follow this exact order to avoid dependency issues:
Authentication — Obtain JWT token with sandbox credentials.
BIN Setup — Create BIN → Create BIN Range.
Product Setup — Create Product with BIN mapping → Approve Product.
Customer Onboarding — Create Customer → Upload KYC → Approve KYC.
Issuance — Issue Card/Wallet → Verify status transitions (ALLOCATED → ACTIVE).
Load & Credit — Load wallet → Verify balance update.
Transaction Tests — ATM withdrawal, POS purchase, E-Commerce, UPI, P2P.
Fee Verification — Verify correct fee deduction per transaction type.
Limit Tests — Exceed daily/monthly limits → Verify decline.
Notification Tests — Verify SMS/Email/Push/Webhook delivery.
Card Lifecycle — Lock → Unlock → Block → Replace.
Account Closure — Close account → Verify balance refund.
Key Test Cases
| # | Test Case | Expected Result | Error If Failed |
|---|---|---|---|
| 1 | Create product without BIN | Error | PP_CORP_028 |
| 2 | Create product with valid BIN | Success | — |
| 3 | Issue card on active product | Kit in ALLOCATED status | — |
| 4 | Issue beyond BIN range | Error | PP_CORP_035 |
| 5 | Load wallet | Balance updated | — |
| 6 | Debit exceeding balance | Error | PPCUST_079 |
| 7 | Debit exceeding daily limit | Error | Limit exceeded |
| 8 | Transaction on locked card | Error | Card locked |
| 9 | Transaction on blocked MCC | Declined | MCC restricted |
| 10 | UPI on non-UPI product | Error | UPI not enabled |
| 11 | Forex load without LRS | Error | PP_CORP_116 |
| 12 | Card replacement | New kit issued | — |
| 13 | Webhook delivery | Webhook received at callback | — |
Entity State Machine Testing
Customer Status Transitions
Card Status Transitions
Common Sandbox Issues
| Issue | Cause | Resolution |
|---|---|---|
401 Unauthorized | Token expired | Re-authenticate (tokens expire in 3600s) |
TENANT_NOT_FOUND | Wrong X-TENANT-ID | Verify tenant ID in headers |
| Product creation fails | BIN not created first | Create BIN + Range before product |
| Transaction timeout | Sandbox latency | Retry; sandbox has higher latency |
| Webhook not received | URL unreachable | Ensure public HTTPS URL, check firewall |
