{"id":13696993,"url":"https://github.com/karson/mpesa-php-sdk","last_synced_at":"2025-05-03T17:32:47.416Z","repository":{"id":38847277,"uuid":"233905790","full_name":"karson/mpesa-php-sdk","owner":"karson","description":"A PHP sdk for the new Vodacom Mpesa RESTful APIs :mozambique:","archived":false,"fork":false,"pushed_at":"2022-06-15T05:40:52.000Z","size":50,"stargazers_count":15,"open_issues_count":1,"forks_count":12,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-26T22:34:38.189Z","etag":null,"topics":["mpesa","mpesa-api","mpesa-apis","mpesa-online","mpesa-php-sdk","mpesa-sdk","online-payments","payment-gateway","php","sdk"],"latest_commit_sha":null,"homepage":"","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/karson.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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":"github:[karson]"},"created_at":"2020-01-14T18:14:02.000Z","updated_at":"2024-06-21T17:28:09.000Z","dependencies_parsed_at":"2022-08-09T06:16:00.612Z","dependency_job_id":null,"html_url":"https://github.com/karson/mpesa-php-sdk","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karson%2Fmpesa-php-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karson%2Fmpesa-php-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karson%2Fmpesa-php-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karson%2Fmpesa-php-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karson","download_url":"https://codeload.github.com/karson/mpesa-php-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252226922,"owners_count":21714898,"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":["mpesa","mpesa-api","mpesa-apis","mpesa-online","mpesa-php-sdk","mpesa-sdk","online-payments","payment-gateway","php","sdk"],"created_at":"2024-08-02T18:00:51.156Z","updated_at":"2025-05-03T17:32:47.120Z","avatar_url":"https://github.com/karson.png","language":"PHP","funding_links":[],"categories":["Bibliotecas"],"sub_categories":[],"readme":"# Mpesa Mozambique PHP SDK\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/karson/mpesa-php-sdk.svg?style=flat-square)](https://packagist.org/packages/karson/mpesa-php-sdk)\n[![Build Status](https://img.shields.io/travis/karson/mpesa-php-sdk/master.svg?style=flat-square)](https://travis-ci.org/karson/mpesa-php-sdk)\n[![Quality Score](https://img.shields.io/scrutinizer/g/karson/mpesa-php-sdk.svg?style=flat-square)](https://scrutinizer-ci.com/g/karson/mpesa-php-sdk)\n[![Total Downloads](https://img.shields.io/packagist/dt/karson/mpesa-php-sdk.svg?style=flat-square)](https://packagist.org/packages/karson/mpesa-php-sdk)\n\nThis package seeks to help php developers implement the various Mpesa APIs without much hustle. It is based on the REST API whose documentation is available on https://developer.mpesa.vm.co.mz/.\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require karson/mpesa-php-sdk\n```\n\n## Usage\n\n``` php\n// Set the api and public key as follows . Copy it from Mpesa Developer Console (https://developer.mpesa.vm.co.mz/) .\n$mpesa = new \\Karson\\MpesaPhpSdk\\Mpesa();\n$mpesa-\u003esetApiKey('your api key');\n$mpesa-\u003esetPublicKey('your public key');\n$mpesa-\u003esetServiceProviderCode('your public key');\n$mpesa-\u003esetEnv('test');// 'live' production environment \n\n//This creates transaction between an M-Pesa service provider code to a phone number registered on M-Pesa.\n$invoice_id = \"FT0001\"; // Eg: Invoice number\n$phone_number = \"258841234567\"; // Prefixed with country code (258)\n$amount = \"10\"; // Payment amount\n$reference_id = \"XBRAND001\"; // Should be unique for each transaction\n\n$result = $mpesa-\u003ec2b($invoice_id, $phone_number, $amount, $reference_id);\n\nvar_dump($result);\n```\n### Instalation in Laravel\n\n``` php\n// Set the api, public key, provider and environment secret as follows in your .env file\n\nMPESA_API_KEY =\"Your API Key\";\nMPESA_PUBLIC_KEY='You Public Key'\nMPESA_ENV='test' // 'live' production environment\nMPESA_SERVICE_PROVIDER_CODE=171717\n```\n\n### Testing\n\n``` bash\ncomposer test\n```\n\n### Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n### Security\n\nIf you discover any security related issues, please email karson@turbohost.co instead of using the issue tracker.\n\n## Credits\n\n- [Karson Adam](https://github.com/karson)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n## PHP Package Boilerplate\n\nThis package was generated using the [PHP Package Boilerplate](https://laravelpackageboilerplate.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarson%2Fmpesa-php-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarson%2Fmpesa-php-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarson%2Fmpesa-php-sdk/lists"}