Download the PHP package elgiosoft/elgiopay-php-sdk without Composer
On this page you can find all versions of the php package elgiosoft/elgiopay-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download elgiosoft/elgiopay-php-sdk
More information about elgiosoft/elgiopay-php-sdk
Files in elgiosoft/elgiopay-php-sdk
Package elgiopay-php-sdk
Short Description PHP SDK for ElgioPay Service - Mobile Money payments for Cameroon and West Africa
License MIT
Informations about the package elgiopay-php-sdk
ElgioPay PHP SDK
PHP SDK for integrating with the ElgioPay API. Optimized for mobile money payments in Cameroon and West Africa.
Features
- π¨π² Cameroon-First: Optimized for XAF currency and Cameroon phone formats
- π± Mobile Money: MTN Mobile Money and Orange Money support
- π Auto-Retry: Built-in payment retry mechanism with exponential backoff
- β Phone Validation: Automatic phone number normalization for Cameroon
- π‘οΈ Error Handling: Comprehensive error handling with detailed messages
- π Webhooks: Easy webhook integration for payment status updates
- π° Multi-Currency: Support for XAF, XOF, and EUR currencies
Installation
Requirements
- PHP 8.0 or higher
- Guzzle HTTP client
Table of Contents
- Features
- Installation
- Quick Start for Cameroon
- Usage
- Basic Setup
- MTN Mobile Money
- Orange Money
- Connected Merchants
- Payment Status
- Payment Verification
- Supported Payment Methods
- Configuration
- Error Handling
- Webhooks
- Testing
- Support
Usage
Basic Setup
Using Environment Variables (Recommended)
Create a .env file in your project root:
Manual Configuration
Constructor signature: new ElgioPayClient(?string $environment = null, ?string $apiKey = null). Both fall back to ELGIOPAY_ENV / ELGIOPAY_API_KEY env vars when omitted.
Creating a payment
Every payment β MTN, Orange, current markets and any we add later β
goes through a single method: initiatePayment(). Pick the
payment_method you need and pass the payload.
Provide either payment_method or channel_code (a code from
listChannels()). With channel_code, the currency comes from the channel:
MTN Mobile Money (Cameroon)
Orange Money (Cameroon)
Normalising Cameroon phone numbers
If your customer input arrives in mixed formats (677β¦, 237β¦,
+237β¦), pipe it through normalizeCameroonPhone() before calling
initiatePayment().
Channels
List the payment channels available to your app (mobile money, bills,
cash-in). Pass a channel's code as channel_code on initiatePayment() /
createPayout(). The provider that fulfils a channel is internal and never
returned.
Connected Merchants (platform apps)
If your merchant is a platform, you can onboard sub-merchants, charge on
their behalf and settle them. Two things must both be true or the API answers
403 NOT_A_PLATFORM: the merchant is a platform, and the specific app whose
key you're using is flagged as a platform app. A platform's own storefront app
is deliberately not one.
A connected merchant lives inside exactly one app: the app whose key created
it. There's no app parameter, and a merchant created with app A's key is
invisible to app B's key β listing, lookup, balance, payouts and
sub_merchant_id charges are all scoped to the calling app.
Branch on the machine-readable code rather than the message:
Codes: NOT_A_PLATFORM, NOT_YOUR_MERCHANT, MERCHANT_INACTIVE,
PAYOUT_FAILED, VALIDATION_ERROR, and on a charge β
SUB_MERCHANT_NOT_FOUND / _NOT_CONNECTED / _NOT_YOURS / _INACTIVE.
Webhooks (connected_merchant.created, .kyc.submitted, .kyc.approved,
.kyc.rejected, .payout.paid, .payout.failed, .deactivated,
.reactivated) are delivered to the platform's webhook URL, never the
sub-merchant's.
Two current limitations. There's no hosted KYC link yet, so a sub-merchant can't verify itself through the API β approval happens operator-side. And
capabilitiesis advisory: a merchant reportingcharges_enabled: falsecan still take payments, because the charge path doesn't check KYC status. Don't treat it as a block.
Check Payment Status
Verify Payment
Payment with Retry
Supported Payment Methods
- MTN Mobile Money: Available in Cameroon, CΓ΄te d'Ivoire, Burkina Faso, Ghana
- Orange Money: Available in Cameroon, CΓ΄te d'Ivoire, Burkina Faso, Mali, Senegal
Supported Currencies
- XAF (Central African CFA Franc) - Primary currency for Cameroon
- XOF (West African CFA Franc) - For other West African countries
- EUR (Euro) - For international transactions
Phone Number Formats
Cameroon: +237 6XX XXX XXX or +237 7XX XXX XXX
- Examples:
+237677123456,237677123456,677123456
Quick Start for Cameroon
Configuration
API Keys
You only need two things to get started:
- API Key: Get your API key from the ElgioPay dashboard
- Environment: Choose between sandbox (testing) or live (production)
Environment Variables (Recommended)
Then in your code β both are picked up automatically:
Error Handling
The SDK throws ElgioPayException for all API-related errors:
Webhook Handling
Set up webhooks in your application to receive payment status updates:
Testing
Sandbox Environment
Use sandbox API keys (starting with pk_test_) for testing. All sandbox transactions are simulated and no real money is processed.
Getting API Keys
- Sign up at sandbox.elgiopay.com
- Create a new application
- Copy your API keys:
pk_test_...for testingpk_live_...for production
Test Phone Numbers
For sandbox testing, use these test phone numbers:
- MTN:
677123456,677123457,677123458 - Orange:
677123456,677123457,677123458
All sandbox payments will automatically succeed after a few seconds.
Support
- π Documentation: https://docs.elgiopay.com
- π Issues: GitHub Issues
- π¬ Support: [email protected]
- π Website: https://elgiopay.com
Contributing
We welcome contributions! Please feel free to submit a Pull Request.
License
MIT License - see the LICENSE file for details.
About Elgiosoft
ElgioPay PHP SDK is developed by Elgiosoft Ltd, a leading fintech company specializing in mobile money solutions for Africa.