{"id":19870165,"url":"https://github.com/alphaolomi/swahilies-php","last_synced_at":"2025-05-02T08:31:39.464Z","repository":{"id":63095826,"uuid":"562852372","full_name":"alphaolomi/swahilies-php","owner":"alphaolomi","description":"Swahilies for PHP","archived":false,"fork":false,"pushed_at":"2023-10-09T08:24:12.000Z","size":561,"stargazers_count":6,"open_issues_count":2,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-07T00:13:48.586Z","etag":null,"topics":["payments","php","swahilies"],"latest_commit_sha":null,"homepage":"https://alphaolomi.github.io/swahilies-php/","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/alphaolomi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"patreon":"alphaolomi"}},"created_at":"2022-11-07T11:52:47.000Z","updated_at":"2023-09-02T07:45:18.000Z","dependencies_parsed_at":"2023-02-16T05:30:56.167Z","dependency_job_id":null,"html_url":"https://github.com/alphaolomi/swahilies-php","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphaolomi%2Fswahilies-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphaolomi%2Fswahilies-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphaolomi%2Fswahilies-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphaolomi%2Fswahilies-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alphaolomi","download_url":"https://codeload.github.com/alphaolomi/swahilies-php/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252008834,"owners_count":21679648,"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":["payments","php","swahilies"],"created_at":"2024-11-12T16:08:12.550Z","updated_at":"2025-05-02T08:31:39.181Z","avatar_url":"https://github.com/alphaolomi.png","language":"PHP","funding_links":["https://patreon.com/alphaolomi"],"categories":[],"sub_categories":[],"readme":"# Swahilies for PHP\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/alphaolomi/swahilies-php.svg?style=flat-square)](https://packagist.org/packages/alphaolomi/swahilies-php)\n[![Tests](https://github.com/alphaolomi/swahilies-php/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/alphaolomi/swahilies-php/actions/workflows/run-tests.yml)\n[![Total Downloads](https://img.shields.io/packagist/dt/alphaolomi/swahilies-php.svg?style=flat-square)](https://packagist.org/packages/alphaolomi/swahilies-php)\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require alphaolomi/swahilies-php\n```\n\n## Usage\n\n```php\nuse Alphaolomi\\Swahilies\\Swahilies;\n\n$swahilies = new Swahilies([]);\n// Or\n$swahilies = Swahilies::create([\n    'apiKey' =\u003e 'csdheruvhhjdhvjadmvjehrve',\n    'username' =\u003e 'Company name',\n    'isLive' =\u003e false, // ie. sandbox mode\n]);\n\n$response = $swahilies-\u003epayments()-\u003erequest([\n    // TZS by default\n    'amount' =\u003e 50000,\n    // 255 is country code for Tanzania, Only Tanzania is supported for now\n    'orderId' =\u003e $order-\u003eid,\n    'phoneNumber' =\u003e \"255783262616\",\n    'cancelUrl' =\u003e \"https://yoursite.com/cancel\",\n    'webhookUrl' =\u003e \"https://yoursite.com/response\",\n    'successUrl' =\u003e \"https://yoursite.com/success\",\n    'metadata' =\u003e [],\n]);\n\nprint_r($response);\n\n// Output:\n// [\n//     \"payment_url\" =\u003e \"https://swahiliespay.invict.site/make-payment-1.html?order=jdhvjadmvjehrve\"\n// ]\n```\n\n```php\n// Webhooks\n// You can use the following code to verify the webhook signature\n\n$requestBody = /** get the request body from the webhook request **/;\n\n$isValid = $swahilies-\u003ewebhooks()\n    -\u003everify($request-\u003egetContent()); // true/false\n```\n\n## Available APIs\n\n### Payments\n\n-   `all()` - Get all payment transactions\n-   `directRequest($data)` - Make a direct Push USSD from your app\n-   `request($data)` -  Make a payment request\n-   `find($id)` - Get payment transaction information\n\n### Webhooks\n\n\u003e 🚧 Work in progress\n\n-   `getDisget($data)` - Generate requery body digest\n-   `verify($data)` - Verify request body\n\n## Testing\n\nUsing [PestPHP](https://pestphp.com/) for testing.\n\n```bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](https://github.com/alphaolomi/.github/blob/main/CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nPlease review [our security policy](../../security/policy) on how to report security vulnerabilities.\n\n## Credits\n\n-   [Alpha Olomi](https://github.com/alphaolomi)\n-   [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falphaolomi%2Fswahilies-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falphaolomi%2Fswahilies-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falphaolomi%2Fswahilies-php/lists"}