lazervel / pgi
PGI is a PHP library that provides ready-to-use integrations for multiple payment gateways.
Fund package maintenance!
Github
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/lazervel/pgi
Requires
- php: ^7.2 || ^8.0
- lazervel/dotenv: ^1.0
- razorpay/razorpay: ^2.9
README
PGI is a PHP library that provides ready-to-use integrations for multiple payment gateways.
Composer Installation
Installation is super-easy via Composer
composer require lazervel/pgi
OR:
Click to Browse package
Payment Integrations
Razorpay Integration
Start accepting domestic and international payments from customers on your website using the Razorpay Payment Gateway. Razorpay has developed the Standard Checkout method and manages it. You can configure payment methods, orders, company logo and also select custom colour based on your convenience. Razorpay supports these payment methods and international currencies.
Configuration
use Lazervel\PGI\Razorpay; require 'vendor/autoload.php'; $rzp = new Razorpay;
Create an Order in Server
In the sample app, the index.php file contains the code for order creation using Orders API.
$rzp->order([ 'amount' => 50, // In Rupees [required] 'currency', // default INR [optional] 'notes' // default empty [] [optional] ]); // Error Handling $rzp->then(function($response) { print_r($response); })->catch(function($err) { die($err); });
Verify Payment Signature
This is a mandatory step that allows you to confirm the authenticity of the details returned to the checkout for successful payments.
$orderId = $_SESSION['razorpay_order_id']; // Where you stored $paymentId = $_SESSION['razorpay_payment_id']; // Where you stored $signature = $_SESSION['razorpay_signature']; // Where you stored // All parameter is required $rzp->verifySignature($orderId, $paymentId, $signature); // Error Handling $rzp->then(function($payment) { // Success payment print_r($payment); })->catch(function($err) { // Failed payment die($err); });
License
Licensed Under MIT
Copyright (c) 2025 Indian Modassir
Contributing
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.
Resources
Report issue and send Pull Request in the main Lazervel repository