Authentication Issues
OAuth Token File Problems
After updating the SDK, you may experience authentication failures due to outdated temporary token files.Symptom
Symptom
- 401 Unauthorized errors
- “Invalid token” messages
- Authentication failures after SDK update
Solution
Solution
Delete your temporary token file to force regeneration:The SDK will automatically regenerate the token on the next API call.Important: Use different temporary folders for sandbox and production environments:
Invalid Credentials
Symptom
Symptom
- 401 Unauthorized on all requests
- “Authentication credentials not recognized” error
Solution
Solution
Verify your credentials are correct:Common mistakes:
- Using production credentials in sandbox (or vice versa)
- Trailing/leading whitespace in credentials
- Using Client Secret instead of API Key
- Expired API keys
- Log into your Mangopay Dashboard
- Navigate to API & Reports > API Keys
- Compare with your code
Wrong Environment
Symptom
Symptom
- Resources not found
- Different data than expected
- Authentication works but operations fail
Solution
Solution
Ensure you’re using the correct base URL:
SSL/TLS Issues
Certificate Verification Failures
Symptom
Symptom
- cURL error 60: SSL certificate problem
- “unable to get local issuer certificate”
Solution
Solution
Update your CA certificate bundle:For development only (not recommended for production):If you need to disable SSL verification temporarily:
- Download the latest CA bundle from curl.se
- Save it to a secure location
- Configure the SDK:
TLS Version Issues
Symptom
Symptom
- Connection errors
- “unsupported protocol” errors
Solution
Solution
Mangopay requires TLS 1.2 or higher. Ensure your PHP installation supports it:If using an older version, upgrade OpenSSL and recompile PHP with the latest version.
Timeout Issues
Request Timeouts
Symptom
Symptom
- cURL error 28: Operation timed out
- Requests fail after 30 seconds
Solution
Solution
Increase timeout values:
Some operations like KYC document uploads may require longer timeouts.
Script Execution Timeout
Symptom
Symptom
- PHP Fatal error: Maximum execution time exceeded
Solution
Solution
Increase PHP’s max execution time:Or in php.ini:
Type Errors and Object Issues
Money Object Errors
Symptom
Symptom
- “Expected Money object, got integer”
- Type mismatch errors with amounts
Solution
Solution
Always use Money objects for amounts:
Address Object Errors
Symptom
Symptom
- “Address required” validation errors
- Missing address fields
Solution
Solution
Ensure all required Address fields are set:
Null Reference Errors
Symptom
Symptom
- “Trying to get property of non-object”
- Null pointer exceptions
Solution
Solution
Always check for null before accessing nested properties:
API Response Errors
Invalid Field Errors
Symptom
Symptom
- “One or several required parameters are missing or incorrect”
- Field-specific validation errors
Solution
Solution
Check the error details for specific field issues:Common field issues:
- Invalid country codes (must be ISO 3166-1 alpha-2)
- Invalid currency codes (must be ISO 4217)
- Email format validation
- Birthday must be Unix timestamp
- Phone numbers must include country code
Resource Not Found
Symptom
Symptom
- 404 Not Found errors
- “Resource does not exist” messages
Solution
Solution
Common causes:
- Wrong environment: Resource exists in sandbox but not in production (or vice versa)
- Incorrect ID: Double-check the resource ID
- Deleted resource: The resource may have been deleted
Rate Limiting Errors
Symptom
Symptom
- 429 Too Many Requests
- “Rate limit exceeded” errors
Solution
Solution
Implement exponential backoff and rate limit monitoring:
SCA (Strong Customer Authentication) Issues
Missing SCA Redirect
Symptom
Symptom
- User not redirected for authentication
- SCA required but no redirect URL
Solution
Solution
Check for SCA requirement and handle redirect:
Missing Browser Info or IP Address
Symptom
Symptom
- “IpAddress is required” error
- “BrowserInfo is required” error
Solution
Solution
For 3DS2, you must provide browser information:
In a real application, you should collect this information from the client-side using JavaScript.
KYC Document Upload Issues
File Upload Failures
Symptom
Symptom
- Upload timeout
- File size errors
- Invalid file format
Solution
Solution
Ensure file meets requirements:File requirements:
- Maximum size: 7 MB per file
- Formats: JPEG, PNG, PDF
- Total pages: Maximum 10 per document
Document Validation Failures
Symptom
Symptom
- Document refused
- Status changed to VALIDATION_ASKED then REFUSED
Solution
Solution
Check the Flags field for specific refusal reasons:
Payment Issues
Card Registration Failures
Symptom
Symptom
- Invalid card data
- Registration fails
Solution
Solution
Follow the complete registration flow:
PayIn Failures
Symptom
Symptom
- PayIn status is FAILED
- Various result codes
Solution
Solution
Composer and Dependency Issues
Version Conflicts
Symptom
Symptom
- Composer cannot resolve dependencies
- PSR/Log version conflicts
Solution
Solution
The SDK supports psr/log versions 1.x through 3.x:
Autoloader Issues
Symptom
Symptom
- Class not found errors
- Autoload errors
Solution
Solution
Regenerate autoloader:Ensure you’re including the autoloader:
PHP Version Issues
Deprecated Features
Symptom
Symptom
- Deprecated warnings in PHP 7.4+
- Dynamic property warnings in PHP 8.2+
Solution
Solution
Ensure you’re using SDK version 3.45.1+ for PHP 8.2 compatibility.If you see deprecation warnings, they’re usually safe to ignore or can be suppressed:
Getting Additional Help
GitHub Issues
Report bugs or request features
API Documentation
Complete API reference
Result Codes
Error code reference
Support Portal
Contact Mangopay support
Debugging Tips
Enable Debug Mode
Inspect Raw API Responses
When debugging, you can inspect the raw response:If you’re still experiencing issues after trying these solutions, please open an issue on GitHub with:
- SDK version
- PHP version
- Complete error message
- Code snippet (remove sensitive data)