1. Go to this page and download the library: Download manuelgeek/mpesab2c library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
manuelgeek / mpesab2c example snippets
$Amount ='300';
$CommandID = 'BusinessPayment';
$PartyB = '254708374149';
$Remarks = 'Payed well';
//Using the Facade
$response = \B2C::sendMpesaMoney($Amount,$CommandID,$PartyB, $Remarks);
//or the function
$response = sendMpesaMoney($Amount,$CommandID,$PartyB, $Remarks);
nt ='300';
$CommandID = 'BusinessPayment';
$PartyB = '254708374149';
$Remarks = 'Payed well';
$mpesa = new \Manuelgeek\MpesaB2C\B2C();
$response = $mpesa->sendMpesaMoney($Amount,$CommandID,$PartyB, $Remarks);