PHP code example of shoket / laravel-shoket

1. Go to this page and download the library: Download shoket/laravel-shoket library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

shoket / laravel-shoket example snippets


return [
    // ...
];

use Shoket\Laravel\Facades\Shoket;

$chargeResponse = Shoket::makePaymentRequest([
    "amount" => "200",
    "customer_name" => "John Doe",
    "email" =>  "[email protected]",
    "number_used" => "255612345678",
    "channel" =>  "Tigo"
]);

// OR
$referenceId = "abcd124";
$chargeResponse = Shoket::verifyPaymentRequest($referenceId, [
    "provider_name" => "Vodacom",
    "provider_code" => "MPESA"
]);
// ...
bash
php artisan vendor:publish --tag="laravel-shoket-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="shoket-config"