How to use Africa's Talking PHP Package v2

Africa’s talking released their own SDK, removing the need of manually generating the calls. This has now become a wrapper that offers efficiency and helper functions.

Installation

Pull in the package using composer:

composer require smodav/africastalking
lipa na mpesa

How To Use MPesa PHP Package Version 3

The popular package SmoDav M-Pesa has been updated to use the current API provided by Safaricom. Being a major upgrade, this version will not be 100% backward compatible with version 2. So what are we waiting for, let's get started!

So far We've implemented the C2B section of the API by providing Register URL, Identity and STK Push. Just as the previous versions, this package works with both Laravel and Vanilla PHP or any other framework. When using vanilla PHP, we have a helper script that will copy the required files to ease the configuration process. You can either run it manually or leverage composer to do it for you as a post-update command:


"scripts": { "post-update-cmd": [ "SmoDav\\Mpesa\\Support\\Installer::install" ] }
How to use Africa's Talking PHP Package

How to use Africa's Talking PHP Package

Hey, I finally got tired of using Africa's talking "PHP file" and finally decided to make a clean fluent package to make life easier. The package is fully compatible with Laravel and Vanilla PHP. If using another framework, you just need to import it and use the native implementation. So let's get started. If using vanilla PHP, add the following installer script so that the package can copy for you the config file once installation is complete. Laravel users don't need to add the post-update script as Laravel handles the configs pretty well.

"scripts": {
"post-update-cmd": [
"SmoDav\\Mpesa\\Support\\Installer::install"
]
},

Pull in the package using composer:

composer require smodav/africastalking
How to use M-Pesa PHP Package version 2

How to use M-Pesa PHP Package version 2

We created a good PHP package to interact with M-Pesa API. This package can be pulled in via composer or directly downloaded from github. The API allows a merchant to initiate C2B online checkout (PayBill via web) transactions. The merchant submits authentication details, transaction details, callback URI and callback method. After request submission, the merchant receives instant feedback with validity status of their requests. The C2B API handles customer validation and authentication via USSD push. The customer then confirms the transaction. If the validation of the customer fails or the customer declines the transaction, the API makes a callback to the merchant. Otherwise, the transaction is processed and its status is made through a callback.

Installing the package.

When you're using vanilla php, you can leverage the installer script included in the package by adding the following to the scripts section of composer.json:

"scripts": {
"post-update-cmd": [
"SmoDav\\Mpesa\\Support\\Installer::install"
]
}