Thanks to visit codestin.com
Credit goes to github.com

Skip to content

lazervel/pgi

Repository files navigation

PGI - Payment Getway Integration

PGI is a PHP library that provides ready-to-use integrations for multiple payment gateways.

Total Downloads Latest Version Contributors Repository Size

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.

use Lazervel\PGI\Razorpay;

$rzp = new Razorpay;
$rzp->order(
  50,    // Amount In Rupees        [required]
  'INR', // Currency => default INR [optional]
  ['name' => 'Payment Getaway'] // Notes => default empty [] [optional]
);

Promises:

use Lazervel\PGI\Promises\Razorpay;

$rzp = new Razorpay;
$rzp->order(
  50,    // Amount In Rupees        [required]
  'INR', // Currency => default INR [optional]
  ['name' => 'Payment Getaway'] // Notes => default empty [] [optional]
)->then(function($data) {
  print_r($data);
})->catch(function($err) {
  print_r($err);
})->finally(function() {
  echo 'always run';
});

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.

use Lazervel\PGI\Razorpay;

$rzp = new Razorpay;

$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);

Promises:

use Lazervel\PGI\Promises\Razorpay;

$rzp = new Razorpay;

$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)->then(function($data) {
  print_r($data);
})->catch(function($err) {
  print_r($err);
})->finally(function() {
  echo 'always run';
});;

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

About

PGI — PHP library for easy multi-gateway payments integration.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages