{"id":14975339,"url":"https://github.com/alkhatibdev/laravel-sudani","last_synced_at":"2025-10-27T13:30:30.326Z","repository":{"id":45759824,"uuid":"514271826","full_name":"alkhatibdev/laravel-sudani","owner":"alkhatibdev","description":"Sudani SPay API integration with Laravel, was made to simplify the process and API calls and let developers focus on other integration parts and logic.","archived":false,"fork":false,"pushed_at":"2024-01-23T06:08:06.000Z","size":40,"stargazers_count":19,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-01T05:41:17.808Z","etag":null,"topics":["laravel","laravel-framework","php"],"latest_commit_sha":null,"homepage":"https://github.com/alkhatibdev/laravel-sudani","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alkhatibdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-07-15T13:02:54.000Z","updated_at":"2024-05-31T01:11:59.000Z","dependencies_parsed_at":"2024-01-23T07:22:19.750Z","dependency_job_id":"bc00a9bb-ea3a-43e9-979e-d944205bf78d","html_url":"https://github.com/alkhatibdev/laravel-sudani","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"503d7b52879cf9996ad2abc1ad81c468ed092e08"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alkhatibdev%2Flaravel-sudani","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alkhatibdev%2Flaravel-sudani/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alkhatibdev%2Flaravel-sudani/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alkhatibdev%2Flaravel-sudani/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alkhatibdev","download_url":"https://codeload.github.com/alkhatibdev/laravel-sudani/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238497668,"owners_count":19482296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["laravel","laravel-framework","php"],"created_at":"2024-09-24T13:51:53.542Z","updated_at":"2025-10-27T13:30:29.994Z","avatar_url":"https://github.com/alkhatibdev.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"/socialcard.png\" alt=\"Social Card of Laravel Sudani Package\"\u003e\u003c/p\u003e\n\n# Sudani SPay API integration with Laravel\n\n[![Latest Version](https://img.shields.io/github/release/alkhatibdev/laravel-sudani.svg?style=flat-square)](https://github.com/alkhatibdev/laravel-sudani/releases)\n![Packagist Downloads (custom server)](https://img.shields.io/packagist/dt/alkhatibdev/laravel-sudani)\n[![MIT Licensed](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)\n\n# Introduction\nLaravel 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](https://github.com/alkhatibdev/laravel-zain).\n\n# Installation\n\n## Requirements\n\n- PHP \u003e= `7.4.x`\n- Laravel \u003e= `7.x`\n\n## install via composer\n\n```shell\ncomposer require alkhatibdev/laravel-sudani\n```\n\n## Publish Configs \n\n```shell\nphp artisan vendor:publish --tag=laravel-sudani-config\n```\n\nA `laravel-sudani.php` config file will be published on your `configs` directory, with the following content:\n\n```php\n\u003c?php\n\nreturn [\n\n    'base_url' =\u003e env('SUDANI_SERVER_BASE_API_URL'),\n\n    'provider_key' =\u003e env('SUDANI_PROVIDER_KEY'),\n\n    'service_code' =\u003e env('SUDANI_SERVICE_CODE'),\n\n    'username' =\u003e env('SUDANI_USERNAME'),\n\n    'password' =\u003e env('SUDANI_PASSWORD'),\n\n    'enable_logging' =\u003e false,\n\n];\n```\n\nDon't forget to set all these variables on your `.env` file\n\n```env\nSUDANI_SERVER_BASE_API_URL=http://196.1.241.110/SPayAPI/Service/\nSUDANI_PROVIDER_KEY=xxxxxxxx\nSUDANI_SERVICE_CODE=xxxxx-xxxx-xxxx-xxxx-xxxxxxxxx\nSUDANI_USERNAME=xxxxxx\nSUDANI_PASSWORD=xxxxxx\n```\n\n# Usage\n\n## Initial Payment/Subscription\n\n```php\nuse AlkhatibDev\\LaravelSudani\\Facades\\Sudani;\n\n// Initiate payment request\n$response = Sudani::initiate($phone)\n```\n\nWhen 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`.\n\n## Verify Payment/Subscription\n\n```php\n\n$response = Sudani::verify($otp, $requestId)\n\n```\n\n## Check Subscription\n\n```php\n\n$response = Sudani::checkSubscription($phone)\n\n```\n\n## Unsubscribe\n\n```php\n\n$response = Sudani::unsubscribe($phone)\n\n```\n\n## Login and Cache SPay token\n\nOut 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.\nIf you want to cache the token and use it for further requests, you can request a `token` like this:\n\n```php\n$token = Sudani::token()\n```\n\nAnd you can cache it and use it for each request for the next 24 hours, for example:\n\n```php\n// $token = getCachedToken()\n\n$response = Sudani::withToken($token)-\u003einitiate($phone)\n$response = Sudani::withToken($token)-\u003everify($phone)\n...\n```\n\n## Logging\nYou can enable logging from the package config file \n\n```\n'enable_logging' =\u003e true,\n```\n\n# Other Packages\n- ### [Laravel Zain](https://github.com/alkhatibdev/laravel-zain) DSP API Integration\n\n# License\n\nLaravel Sudani is open-sourced software licensed under the [MIT license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falkhatibdev%2Flaravel-sudani","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falkhatibdev%2Flaravel-sudani","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falkhatibdev%2Flaravel-sudani/lists"}