A Truly simple payments for your business. Shoket makes online payments more easier for all kind of business in Tanzania. From startups, small businesses to medium and large businesses.
You can find the documentation for this package on Docs
Requires PHP 8.0 or higher
For Laravel users there is a dedicated intergration package laravel-shoket
You can install the package via composer:
composer require shoket/php-shoket
// Create a new instance of the client
$shoket = new Shoket(['apiSecret' => 'your-api-key']);
// Make a payment request
$response = $shoket->makePaymentRequest([
"amount" => "5000",
"customer_name" => "John Doe",
"email" => "[email protected]",
"number_used" => "255612345678",
"channel" => "Tigo",
]);
// Print the response
print_r($response);
- makePaymentRequest
- verifyPayment
Example
// Create a new instance of the client
$shoket = new Shoket(['apiSecret' => 'your-api-key']);
// Make a payment request
$response = $shoket->makePaymentRequest([
"amount" => "5000",
"customer_name" => "John Doe",
"email" => "[email protected]",
"number_used" => "255612345678",
"channel" => "Tigo",
]);
// Print the response
var_dump($response);
Example
$shoketClient = new Shoket(['apiSecret' => 'your-api-key']);
// Get the payment reference from the a successful payment request
// Sample: adz49dS428b7kbDTdG4MN
$reference = 'your-reference-number';
$response = $shoketClient->verifyPaymentRequest($reference,[
"provider_name"=> "Vodacom",
"provider_code"=> "MPESA"
]);
var_dump($response);
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.