Download the PHP package alkhatibdev/laravel-sudani without Composer
On this page you can find all versions of the php package alkhatibdev/laravel-sudani. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alkhatibdev/laravel-sudani
More information about alkhatibdev/laravel-sudani
Files in alkhatibdev/laravel-sudani
Package laravel-sudani
Short Description Sudani SPay API integration
License MIT
Homepage https://github.com/alkhatibdev/laravel-sudani
Informations about the package laravel-sudani
Sudani SPay API integration with Laravel
Introduction
Laravel Sudani is Sudani SPay API integration with Laravel, made to simplify the process and API calls and let developers focus on other integration parts and logic. See also Laravel Zain.
Installation
Requirements
- PHP >=
7.4.x
- Laravel >=
7.x
install via composer
Publish Configs
A laravel-sudani.php
config file will be published on your configs
directory, with the following content:
Don't forget to set all these variables on your .env
file
Usage
Initial Payment/Subscription
When the initiate
payment request is successfully sent, an SMS with an OTP
code will be sent to the $phone
number, and $response
will contain a requestId
and you should save it to the next step verify
.
Verify Payment/Subscription
Check Subscription
Unsubscribe
Login and Cache SPay token
Out of the box, the package will encrypt the password and login automatically and get the token
and use it for each action initiate
, verify
..etc per request.
If you want to cache the token and use it for further requests, you can request a token
like this:
And you can cache it and use it for each request for the next 24 hours, for example:
Logging
You can enable logging from the package config file
Other Packages
-
Laravel Zain DSP API Integration
License
Laravel Sudani is open-sourced software licensed under the MIT license.