Overview
The PayMaya Android SDK supports two environments: Sandbox for testing and Production for live transactions. Proper environment configuration is essential for secure and reliable payment processing.Environment Types
The SDK provides two environment options through thePayMayaEnvironment enum:
PayMayaEnvironment.kt
Sandbox Environment
UsePayMayaEnvironment.SANDBOX for:
- Development and testing
- Integration testing with test credit cards
- QA and staging environments
- Demo applications
Production Environment
UsePayMayaEnvironment.PRODUCTION for:
- Live production applications
- Real customer transactions
- Processing actual payments
Client Public Keys
Each environment requires its own public API key:Sandbox Keys
Sandbox Keys
- Prefix:
pk-test- - Used for: Testing and development
- Obtain from: PayMaya Developer Dashboard
Production Keys
Production Keys
- Prefix:
pk-live- - Used for: Live transactions
- Obtain from: PayMaya Business Account
- Requires verification and approval
Best Practices for API Keys
Use Build Variants
Store different keys for debug and release builds using BuildConfig or gradle.properties
Secure Storage
Never commit API keys to version control. Use environment variables or secure key storage
Key Rotation
Regularly rotate your production keys and update your applications
Separate Keys
Use different keys for different applications or services
Log Levels
Configure logging verbosity using theLogLevel enum to control SDK output:
LogLevel.kt
Log Level Recommendations
| Environment | Recommended Level | Purpose |
|---|---|---|
| Development | DEBUG or VERBOSE | Full visibility of HTTP requests and responses |
| QA/Testing | INFO or DEBUG | Moderate logging for debugging |
| Production | ERROR or WARN | Minimal logging, errors only |
Examples by Payment Type
Environment-Specific Configuration
Using Gradle Build Types
Recommended approach for managing environment-specific configuration:build.gradle
Switching Between Environments
Next Steps
Testing Guide
Learn how to test your integration using sandbox environment
Result Handling
Implement proper handling of payment results