salymmbise / evpay
EvMak MNO Payment API PHP SDK
v1.0.2
2026-04-22 08:32 UTC
Requires
- guzzlehttp/guzzle: ^7.0
This package is auto-updated.
Last update: 2026-04-22 08:36:18 UTC
README
Lightweight PHP SDK for integrating with the EvPay MNO Payment Gateway. Supports payment requests, reconciliation, and callback handling.
๐ Installation
Install via Composer:
composer require salymmbise/evpay
โ๏ธ Requirements
- PHP 8.1+
- Composer
๐ฆ Basic Usage
1. Initialize Client
require 'vendor/autoload.php'; use EvMak\Client; $client = new Client( "https://your-evmak-api-url.com", "your-username" );
2. Send Payment Request
use EvMak\Payment; $payment = new Payment($client); $response = $payment->request([ "api_source" => "WEBHOSTTZ", "api_to" => "TigoPesa", // Mpesa, AirtelMoney, HaloPesa "amount" => 1000, "product" => "TestPayment", "callback" => "https://yourdomain.com/callback", "mobileNo" => "255686668866", "reference" => uniqid("EVM") ]); print_r($response);
3. Check Transaction (Reconciliation)
use EvMak\Reconciliation; $recon = new Reconciliation($client); $status = $recon->check("EVM123456"); print_r($status);
๐ Callback Handling
Your system must handle payment confirmation from EvMak.
Example (Laravel)
Route::post('/callback', function (\Illuminate\Http\Request $request) { $data = $request->all(); // Validate and store transaction // Recommended: verify hash and reference return response()->json([ "Status" => "Success" ]); });
๐ Hash Generation
The API uses MD5 hashing:
md5(username . '|' . date('d-m-Y'));
This is handled automatically by the SDK.
๐ฑ Supported Networks
- Mpesa
- TigoPesa
- AirtelMoney
- HaloPesa
โ ๏ธ Best Practices
- Always store transactions before sending requests
- Use unique references (
uniqid()or UUID) - Secure your callback endpoint
- Log all API responses
- Implement retries for failed requests
๐งช Testing
Use sandbox/test endpoint provided by EvMak before going live.
โ Error Handling
Typical response codes:
| Code | Meaning |
|---|---|
| 200 | Success |
| 403 | Authentication failed |
| 404 | Wrong destination |
| 500 | Server error |
๐ค Contributing
Pull requests are welcome. For major changes, open an issue first.
๐ License
MIT License