PHP code example of alkhatibdev / laravel-sudani

1. Go to this page and download the library: Download alkhatibdev/laravel-sudani 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/ */

    

alkhatibdev / laravel-sudani example snippets




return [

    'base_url' => env('SUDANI_SERVER_BASE_API_URL'),

    'provider_key' => env('SUDANI_PROVIDER_KEY'),

    'service_code' => env('SUDANI_SERVICE_CODE'),

    'username' => env('SUDANI_USERNAME'),

    'password' => env('SUDANI_PASSWORD'),

    'enable_logging' => false,

];

use AlkhatibDev\LaravelSudani\Facades\Sudani;

// Initiate payment request
$response = Sudani::initiate($phone)


$response = Sudani::verify($otp, $requestId)



$response = Sudani::checkSubscription($phone)



$response = Sudani::unsubscribe($phone)


$token = Sudani::token()

// $token = getCachedToken()

$response = Sudani::withToken($token)->initiate($phone)
$response = Sudani::withToken($token)->verify($phone)
...
shell
php artisan vendor:publish --tag=laravel-sudani-config