parsepesa/php
Composer 安装命令:
composer require parsepesa/php
包简介
Official PHP SDK for ParsePesa - The Stripe for M-Pesa SMS.
README 文档
README
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/guzzle7.0+
License
MIT
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-11