定制 mossey/mpesa 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

mossey/mpesa

Composer 安装命令:

composer require mossey/mpesa

包简介

A PHP package for Mpesa API

README 文档

README

This package has been abandoned please use https://github.com/safaricom/mpesa-php-sdk

Introduction

This package seeks to help php developers implement the various Mpesa APIs without much hustle. It is based on the REST API whose documentation is available on http://developer.safaricom.co.ke.

Installation using composer
composer require mossey/mpesa

Configuration
At your project root, create a .env file and in it set the consumer key and consumer secret as follows
consumer_key= [consumer key]
consumer_secret=[consumer secret]
For Laravel users, open the Config/App.php file and add \Mossey\Mpesa\MpesaServiceProvider::class under providers and 'Mpesa'=> \Mossey\Mpesa\MpesaServiceProvider::class under aliases.

Usage

Confirmation and validation urls

B2C Payment Request

This creates transaction between an M-Pesa short code to a phone number registered on M-Pesa.

$mpesa= new \Mossey\Mpesa\Mpesa();

$b2cTransaction=$mpesa->b2c( $ShortCode, $CommandID, $Amount, $Msisdn, $BillRefNumber );

Account Balance Request

This is used to enquire the balance on an M-Pesa BuyGoods (Till Number)

$mpesa= new \Mossey\Mpesa\Mpesa();

$balanceInquiry=$mpesa->accountBalance($CommandID, $Initiator, $SecurityCredential, $PartyA, $IdentifierType, $Remarks, $QueueTimeOutURL, $ResultURL);

Transaction Status Request This is used to check the status of transaction.

$mpesa= new \Mossey\Mpesa\Mpesa();

$trasactionStatus=$mpesa->transactionStatus($Initiator, $SecurityCredential, $CommandID, $TransactionID, $PartyA, $IdentifierType, $ResultURL, $QueueTimeOutURL, $Remarks, $Occasion);

B2B Payment Request

This is used to transfer funds between two companies.

$mpesa= new \Mossey\Mpesa\Mpesa();

$b2bTransaction=$mpesa->b2b($ShortCode, $CommandID, $Amount, $Msisdn, $BillRefNumber );

STK Push Simulation

This is used to initiate online payment on behalf of a customer.

$mpesa= new \Mossey\Mpesa\Mpesa();

$stkPushSimulation=$mpesa->STKPushSimulation($BusinessShortCode, $LipaNaMpesaPasskey, $TransactionType, $Amount, $PartyA, $PartyB, $PhoneNumber, $CallBackURL, $AccountReference, $TransactionDesc, $Remarks);

STK Push Status Query

This is used to check the status of a Lipa Na M-Pesa Online Payment.

$mpesa= new \Mossey\Mpesa\Mpesa();

$STKPushRequestStatus=$mpesa->STKPushQuery($checkoutRequestID,$businessShortCode,$password,$timestamp);

Confirmation and Validation

These are required in order to complete most of the transaction. Without these the transactions won't be complete. Therefore, register your URLS in the developer portal and soon as you're done be sure to ensure your validation URL and confirmation URL contain the following.

Validation

$mpesa= new \Mossey\Mpesa\Mpesa();

$b2bTransaction=$mpesa->validate();

Confirmation

$mpesa= new \Mossey\Mpesa\Mpesa();

$b2bTransaction=$mpesa->confirm();

统计信息

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

GitHub 信息

  • Stars: 6
  • Watchers: 5
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: mit
  • 更新时间: 2017-10-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固