mam-laka / payment-sdk
A PHP SDK for processing payments with Mamlaka.
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
pkg:composer/mam-laka/payment-sdk
Requires
- php: >=7.4
- guzzlehttp/guzzle: ^7.0
Requires (Dev)
- phpunit/phpunit: ^9.0
This package is not auto-updated.
Last update: 2025-12-29 20:41:22 UTC
README
Mamlaka SDK is a PHP library for integrating with the Mamlaka API.
Installation
Install using Composer:
composer require mama-laka/payment-sdk
Usage
1. Set up the MamlakaAPI object and authenticate
$api = new MamlakaAPI('production'); $response1 = $api->getToken('username', 'password'); if(!$response1['error']){ $response = $api->initiateMobilePayment( 'merchantid', 'KES', 1.0, '254768899729', 'M-Pesa', 'externalId3', 'https://b8ca-217-21-116-242.ngrok-free.app' ); print_r($response); } else { echo "Authentication failed "; }
3. Example API Methods
3.1. getToken
Authenticate and get the token:
$response = $api->getToken('username', 'password');
3.2. initiateMobilePayment
Initiate a mobile payment:
$response = $api->initiateMobilePayment( 'merchantid', 'KES', 1.0, '254768899729', 'M-Pesa', 'externalId', 'https://b8ca-217-21-116-242.ngrok-free.app' );
License
This project is licensed under the MIT License - see the LICENSE file for details.