Salami Gateway includes standalone PHP SDKs for each payment provider. These SDKs handle authentication, HTTP communication, and API operations independently of Laravel, making them reusable across projects.
[Standalone SDK] [laravel-payments Driver] [Salami Module]
packages/mpesa/MpesaClient --> Drivers/Mpesa/Ke/*/Driver.php --> modules/payments
packages/coop/CoopClient --> Drivers/Coop/Ke/*/Driver.php --> (config, views, routes)
packages/jenga/JengaClient --> Drivers/EquityBank/Ke/*/Driver
packages/airtel/AirtelClient -> Drivers/Airtel/Ke/*/Driver
Each SDK follows the same pattern:
| Component | Purpose |
|---|---|
| Client | Facade class with methods for each API operation |
| Config | Reads from Laravel config or accepts raw arrays |
| Authenticator | OAuth2 / JWT token management with in-memory caching |
| HttpClient | cURL-based HTTP (no Guzzle dependency) |
| Operations/ | One class per API endpoint |
| Exceptions/ | Typed exceptions for auth, validation, API errors |
| ServiceProvider | Laravel auto-discovery, config publishing |
| Package | Namespace | Provider | Operations |
|---|---|---|---|
deadangroup/mpesa |
DGL\Mpesa |
Safaricom M-Pesa (DARAJA) | 9 |
deadangroup/coop |
DGL\Coop |
Co-operative Bank of Kenya | 12 |
deadangroup/jenga |
DGL\Jenga |
Equity Bank (Jenga HQ) | 30+ |
deadangroup/airtel |
DGL\Airtel |
Airtel Money Kenya | 7 |
All SDKs work the same way:
use DGL\Coop\CoopClient;
// Pass config directly (standalone usage)
$client = new CoopClient([
'consumer_key' => '...',
'consumer_secret' => '...',
'account_number' => '...',
'is_sandbox' => true,
]);
// Or let it read from Laravel config('coop')
$client = new CoopClient();
// Call operations
$response = $client->stkPush([
'PhoneNumber' => '254712345678',
'Amount' => 1000,
]);
| SDK | Auth Method | Token Lifetime |
|---|---|---|
| M-Pesa | Basic Auth -> Bearer token | ~3600s |
| Co-op Bank | Basic Auth -> Bearer token | ~3500s |
| Jenga (Equity) | Merchant code + API key -> JWT | ~3500s |
| Airtel Money | client_credentials -> Bearer token | 180s |
accountNumber + amount + currencyCode + reference)./v1/rsa/encryption-keys.base64(shortcode + passkey + timestamp) password.