# M-Pesa SDK for PHP
M-Pesa SDK for PHP is an unofficial library aiming to help develbusinesses integrating every M-Pesa operations to their PHP applications.
## Contents
- Features
- Usage
- Quickstart
- Receive Money from a Mobile Account
- Send Money to a Mobile Account
- Send Money to a Business Account
- Revert a Transaction
- Query the Status of a Transaction
- Examples
- Prerequisites
- Installation
- Using Composer
- Manual Installation
- Configuration
- Configuration Scenario 1
- Configuration Scenario 2
- Configuration Scenario 3
- Configuration Scenario 4
- Related Projects
- Dependencies
- Friends
- Alternatives
- Contributing
- Changelog
- Authors
- Credits
- License
## Features
- Receive money from a mobile account to a business account
- Send money from a business account to a mobile account
- Send money from a business account to a another business account
- Revert a transaction
- Query the status of a transaction
## Usage
### Quickstart
### Receive Money from a Mobile Account
```php
use Paymentsds\MPesa\Client;
$client = new Client([
'apiKey' => ' ', // API Key
'publicKey' => ' ', // Public Key
'serviceProviderCode' => ' ' // input_ServiceProviderCode
]);
$paymentData = [
'from' => '841234567', // input_CustomerMSISDN
'reference' => '11114', // input_ThirdPartyReference
'transaction' => 'T12344CC', // input_TransactionReference
'amount' => '10' // input_Amount
];
$result = $client.receive($paymentData);
if ($result->success) {
// Handle success
} else {
// Handle failure
}
```
### Send Money to a Mobile Account
```php
use Paymentsds\MPesa\Client;
$client = new Client([
'apiKey' => ' ', // API Key
'publicKey' => ' ', // Public Key
'serviceProviderCode' => ' ' // input_ServiceProviderCode
]);
$paymentData = [
'to' => '841234567', // input_CustomerMSISDN
'reference' => '11114', // input_ThirdPartyReference
'transaction' => 'T12344CC', // input_TransactionRefe …