isaacsichangi/mpesareceiptapi

This is a library to generate a pdf receipt for an mpesa transaction whichh can be sent as a link via sms or email to the customer.It can be integrated with the official safaricom/mpesa api

1.0.0 2018-09-19 23:18 UTC

This package is auto-updated.

Last update: 2024-04-21 19:12:26 UTC


README

This is a library to generate a pdf receipt for an mpesa transaction which can be sent as a link via sms or email to the customer.It can be integrated with the official safaricom/mpesa api.

REQUIREMENTS

  • PHP >=5.4.0

INSTALLATION

composer require isaacsichangi/mpesareceiptapi:1.0.0

HOW TO USE

require_once ('vendor/autoload.php');

//create mpesa receipt object

$mpesa = new MpesaReceiptGenerator("Bob Collymore", 3000, "0724XXXXXX", "MPJ54C33P", "Company XYZ", "https://www.companyxyz.com/");
try {

//generate receipt and return path of pdf receipt which can be sent as a link via sms or email message

$path = $mpesa->generateReceipt();

//view path

echo $path;

//handle exception

} catch (\Picqer\Barcode\Exceptions\BarcodeException $e) {
}

CREDITS

Isaac Sichangi - isaacsichangi@gmail.com

LIVE DEMO

Send 10ksh to MPESA till number 564305 to see a sample receipt