PHPackages                             sntaks/daraja-mpesa - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. sntaks/daraja-mpesa

ActiveLibrary[API Development](/categories/api)

sntaks/daraja-mpesa
===================

A PHP library/Laravel Package for integrating with M-Pesa Daraja API

24PHP

Since Mar 18Pushed 1y ago1 watchersCompare

[ Source](https://github.com/L00P3R93/daraja-mpesa)[ Packagist](https://packagist.org/packages/sntaks/daraja-mpesa)[ RSS](/packages/sntaks-daraja-mpesa/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

M-Pesa Daraja PHP Library
=========================

[](#m-pesa-daraja-php-library)

This is a PHP library designed to integrate with the M-Pesa Daraja API, exclusively for Laravel users but also adaptable for non-Laravel PHP applications.

Installation
------------

[](#installation)

### For Laravel Users

[](#for-laravel-users)

Install the package using Composer:

```
composer require sntaks/daraja
```

### For Non-Laravel Users

[](#for-non-laravel-users)

If you are using plain PHP, you can install the package via Composer:

```
composer require sntaks/daraja
```

Then, manually include the Composer autoloader at the beginning of your script:

```
require __DIR__ . '/vendor/autoload.php';
```

Configuration
-------------

[](#configuration)

### Laravel Configuration

[](#laravel-configuration)

Publish the configuration file:

```
php artisan vendor:publish --tag=config
```

This will create a `config/mpesa.php` file where you can set your API credentials.

### For Non-Laravel Users

[](#for-non-laravel-users-1)

Install the package using Composer:

```
composer require sntaks/daraja
```

Since non-Laravel projects do not have automatic config publishing, you need to create a configuration file manually. Create a `config/mpesa.php` file in your project's root folder:

```
