shoket/laravel-shoket

Laravel Shoket Intergation

v0.0.4 2022-05-25 09:25 UTC

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

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:

composer require shoket/laravel-shoket

You can publish the config file with:

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

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

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.