https://github.com/alphaolomi/laravel-shoket
Shoket Laravel integration
https://github.com/alphaolomi/laravel-shoket
laravel package php shoket
Last synced: about 1 year ago
JSON representation
Shoket Laravel integration
- Host: GitHub
- URL: https://github.com/alphaolomi/laravel-shoket
- Owner: alphaolomi
- License: mit
- Created: 2022-02-12T08:02:27.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-10-09T17:10:26.000Z (almost 3 years ago)
- Last Synced: 2025-04-07T00:14:27.440Z (over 1 year ago)
- Topics: laravel, package, php, shoket
- Language: PHP
- Homepage: https://alphaolomi.github.io/laravel-shoket
- Size: 58.6 KB
- Stars: 7
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
# Laravel Shoket Integration
[](https://packagist.org/packages/shoket/laravel-shoket)
[](https://github.com/alphaolomi/laravel-shoket/actions?query=workflow%3Arun-tests+branch%3Amain)
[](https://github.com/shoket/laravel-shoket/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain)
[](https://packagist.org/packages/shoket/laravel-shoket)
A simple integration of Shoket's Payments API into your Laravel application.
From Shokets website
"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."
## Installation
> Requiremnts PHP 8.0+ and Laravel 8+
You can install the package via composer:
```bash
composer require shoket/laravel-shoket
```
You can publish the config file with:
```bash
php artisan vendor:publish --tag="shoket-config"
```
- Update the env adding the `SHOKET_API_SECRET`
## Usage
You can use the `Shoket::makePaymentRequest([...])` method to accept payments.
### Simple and direct
```php
use Shoket\Laravel\Facades\Shoket;
$chargeResponse = Shoket::makePaymentRequest([
"amount" => "200",
"customer_name" => "John Doe",
"email" => "john@user.com",
"number_used" => "255612345678",
"channel" => "Tigo"
]);
// OR
$referenceId = "abcd124";
$chargeResponse = Shoket::verifyPaymentRequest($referenceId, [
"provider_name" => "Vodacom",
"provider_code" => "MPESA"
]);
// ...
```
## Avaibale Commands
The package is bundled with 2 commands
- AcceptPayment [WIP]
- VerifyPayment [WIP]
## Testing
```bash
composer test
```
## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## Credits
- [Alpha Olomi](https://github.com/alphaolomi)
- [All Contributors](../../contributors)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.