承接 silahkosgei/mpesa 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

silahkosgei/mpesa

最新稳定版本:1.1.7

Composer 安装命令:

composer require silahkosgei/mpesa

包简介

Laravel M-PESA Integration Package

README 文档

README

A Laravel package for integrating with Safaricom's M-PESA STK Push and B2C APIs. Simple, extensible, and production-ready.

Installation

composer require SilahKosgei/mpesa:^1.1

Then publish the configuration file:

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

Configuration

Add these to your .env file:

MPESA_ENV=sandbox                      # or production
MPESA_SHORTCODE=601234
MPESA_BUY_GOODS_TILL=174379
MPESA_SHORTCODE_TYPE=PayBill          # or BuyGoods
MPESA_PASSKEY=YOUR_PASSKEY_HERE
MPESA_CONSUMER_KEY=YOUR_CONSUMER_KEY
MPESA_CONSUMER_SECRET=YOUR_CONSUMER_SECRET
MPESA_CALLBACK_URL=https://yourapp.com/api/complete-payment
MPESA_CONFIRMATION_URL=https://yourapp.com/api/confirmation-payment

Usage

Initiate STK Push

use SilahKosgei\Mpesa\Mpesa;

$mpesa = new Mpesa();

$response = $mpesa->initiateStkPush(
    '254712345678',                  // phone
    100,                             // amount
    'ORDER-12345',                   // account reference
    'Payment for Order #12345',      // description
    12345                            // reference ID for callback
);

Lookup STK Push Payment

$response = $mpesa->lookupPayment('ws_CO_123456789');

👤 Author

Silh Kosgei
📧 silakosy@gmail.com
🔗 GitHub: @silahkosgei

Version

v1.1.1

统计信息

  • 总下载量: 26
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-07-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固