Skip to content

Iconia7/parsepesa-php-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ParsePesa PHP SDK 🐘

The official PHP SDK for ParsePesa - The Stripe for M-Pesa SMS. Convert raw M-Pesa messages into structured JSON in milliseconds.

Installation

Install the package via Composer:

composer require parsepesa/php

Quick Start

use ParsePesa\ParsePesa;

$sdk = new ParsePesa('your_api_key');

// Parse a single message
$result = $sdk->parse("Confirmed. You have received KES 500.00 from JOHN DOE...");

echo $result['amount']; // 500
echo $result['counterparty']; // JOHN DOE

Features

1. Single Parsing

$result = $sdk->parse($message);

2. Batch Parsing

$results = $sdk->batchParse([$msg1, $msg2]);

3. Account Balance

$balance = $sdk->getBalance();
echo "KES " . $balance;

4. Handling Webhooks

Use this in your callback URL endpoint:

$data = $sdk->handleWebhook();
// Process $data['type'], $data['amount'], etc.

Requirements

  • PHP 7.4 or higher
  • guzzlehttp/guzzle 7.0+

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages