shoket / php-shoket
Shoket is a PHP client for the Shoket Payment API.
Fund package maintenance!
Patreon
Requires
- php: ^8.0
- guzzlehttp/guzzle: ^7.4
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.6
- pestphp/pest: ^1.21
This package is auto-updated.
Last update: 2024-10-23 21:57:59 UTC
README
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.
Documentation
You can find the documentation for this package on Docs
Installation
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
Usage
// 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" => "john@user.com", "number_used" => "255612345678", "channel" => "Tigo", ]); // Print the response print_r($response);
API Available
- makePaymentRequest
- verifyPayment
Make payment request API
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" => "john@user.com", "number_used" => "255612345678", "channel" => "Tigo", ]); // Print the response var_dump($response);
verifyPayment API
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);
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.