Skip to content

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.

License

IsaacSichangi/MPESA-RECEIPT-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MPESA RECEIPT API PHP

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

About

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.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages