PHPackages                             comestro/laravel-razorpay - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. comestro/laravel-razorpay

ActiveLibrary[Payment Processing](/categories/payments)

comestro/laravel-razorpay
=========================

An easy-to-use Razorpay Payment integration package for Laravel 13.

v1.1.3(1mo ago)11↑2900%MITPHPPHP ^8.2

Since Mar 27Pushed 1mo agoCompare

[ Source](https://github.com/sadique-cws/laravel-razorpay)[ Packagist](https://packagist.org/packages/comestro/laravel-razorpay)[ RSS](/packages/comestro-laravel-razorpay/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (6)Used By (0)

Laravel Razorpay
================

[](#laravel-razorpay)

An easy-to-use Razorpay integration package for Laravel 11/13 applications. It abstracts the Razorpay PHP SDK behind a simple Laravel Service and Facade so you can quickly create orders and verify payment signatures without boilerplate code.

Installation
------------

[](#installation)

Install the package via Composer:

```
composer require comestro/laravel-razorpay
```

Configuration
-------------

[](#configuration)

First, publish the configuration file to your `config/` directory:

```
php artisan vendor:publish --tag=razorpay-config
```

Then, add your Razorpay credentials to your `.env` file:

```
RAZORPAY_KEY=your_key_id_here
RAZORPAY_SECRET=your_key_secret_here
```

Usage
-----

[](#usage)

You can use the `Razorpay` facade to interact with the API anywhere in your controllers.

### 1. Creating an Order

[](#1-creating-an-order)

When a user initiates checkout, you must create a Razorpay order on the server. The package converts basic amounts (like INR 500) into paise automatically.

```
use Comestro\Razorpay\Facades\Razorpay;

// Create an order for ₹500
$order = Razorpay::createOrder(500, 'receipt_1234');

// Get the Order ID to pass to your frontend frontend JS
$orderId = $order->id;
```

### 2. Verifying a Payment Signature

[](#2-verifying-a-payment-signature)

After the user completes the payment on your frontend, Razorpay will submit a `razorpay_signature` to your success route. Always verify it to ensure the payload is authentic!

```
use Illuminate\Http\Request;
use Comestro\Razorpay\Facades\Razorpay;

public function verify(Request $request)
{
    $isValid = Razorpay::verifySignature(
        $request->input('razorpay_order_id'),
        $request->input('razorpay_payment_id'),
        $request->input('razorpay_signature')
    );

    if ($isValid) {
        return "Payment successful and verified!";
    }

    return "Signature verification failed.";
}
```

### 3. Accessing the Complete Razorpay API

[](#3-accessing-the-complete-razorpay-api)

This package officially wraps the full Razorpay REST SDK. You don't need to manually instantiate an `Api` object. Every Razorpay resource is available as a method directly on the `Razorpay` Facade!

```
use Comestro\Razorpay\Facades\Razorpay;

// Create a new Customer
$customer = Razorpay::customer()->create([
    'name'  => 'Gaurav Kumar',
    'email' => 'gaurav.kumar@example.com',
    'contact' => '9123456780',
]);

// Fetch a specific Payment
$payment = Razorpay::payment()->fetch('pay_29QQoUBi66xm2f');

// Refund a Payment
$refund = Razorpay::refund()->create([
    'payment_id' => 'pay_29QQoUBi66xm2f',
    'amount'     => 1000 // 1000 paise
]);

// Fetch all Orders
$orders = Razorpay::order()->all();

// Create a Subscription
$subscription = Razorpay::subscription()->create([
    'plan_id'     => 'plan_7wAosPWtrkjx6G',
    'customer_id' => 'cust_4t1YmEwb757Lw5',
    'total_count' => 6,
]);
```

#### Supported Endpoints &amp; Examples:

[](#supported-endpoints--examples)

The Facade natively exposes all these Razorpay endpoints. Here is a quick reference on how to use them:

```
use Comestro\Razorpay\Facades\Razorpay;

// 1. Payments
$payment = Razorpay::payment()->fetch('pay_29QQoUBi66xm2f');
$captured = Razorpay::payment()->fetch('pay_29QQoUBi66xm2f')->capture(['amount' => 50000]); // 500 INR

// 2. Orders
$order = Razorpay::order()->create([
    'receipt' => 'receipt_1', 'amount' => 50000, 'currency' => 'INR'
]);
$orders = Razorpay::order()->all();

// 3. Customers
$customer = Razorpay::customer()->create([
    'name' => 'Gaurav Kumar', 'email' => 'gaurav.kumar@example.com'
]);

// 4. Refunds
$refund = Razorpay::refund()->create([
    'payment_id' => 'pay_29QQoUBi66xm2f', 'amount' => 1000
]);

// 5. Tokens
$tokens = Razorpay::token()->all(['customer_id' => 'cust_1234']);

// 6. Cards
$card = Razorpay::card()->fetch('card_1234');

// 7. Transfers
$transfer = Razorpay::transfer()->create([
    'account' => 'acc_1234', 'amount' => 100, 'currency' => 'INR'
]);

// 8. Virtual Accounts
$va = Razorpay::virtualAccount()->create([
    'receiver_types' => ['bank_account'], 'description' => 'First Virtual Account'
]);

// 9. Addons
$addon = Razorpay::addon()->create([
    'subscription_id' => 'sub_1234', 'item' => ['name' => 'Extra', 'amount' => 30000, 'currency' => 'INR']
]);

// 10. Plans
$plan = Razorpay::plan()->create([
    'item' => ['name' => 'Premium', 'amount' => 50000, 'currency' => 'INR'],
    'period' => 'monthly', 'interval' => 1
]);

// 11. Subscriptions
$subscription = Razorpay::subscription()->create([
    'plan_id' => 'plan_1234', 'customer_id' => 'cust_1234', 'total_count' => 6
]);

// 12. Invoices
$invoice = Razorpay::invoice()->create([
    'type' => 'invoice', 'customer_id' => 'cust_1234',
    'line_items' => [['name' => 'Masterclass', 'amount' => 10000]]
]);
$issued = Razorpay::invoice()->fetch('inv_1234')->issue();

// 13. Items
$item = Razorpay::item()->create([
    'name' => 'Book', 'amount' => 50000, 'currency' => 'INR'
]);

// 14. QR Codes
$qr = Razorpay::qrCode()->create([
    'type' => 'upi_qr', 'name' => 'Store Front', 'usage' => 'single_use', 'fixed_amount' => true,
    'payment_amount' => 30000
]);

// 15. Payment Links
$link = Razorpay::paymentLink()->create([
    'amount' => 1000, 'currency' => 'INR', 'description' => 'Payment for service'
]);

// 16. Settlements
$settlements = Razorpay::settlement()->all();

// 17. Webhooks
$webhook = Razorpay::webhook()->create([
    'url' => 'https://example.com/webhook', 'events' => ['payment.authorized'],
    'secret' => 'my_secret_key'
]);

// 18. Fund Accounts
$fundAccount = Razorpay::fundAccount()->create([
    'customer_id' => 'cust_1234', 'account_type' => 'bank_account',
    'bank_account' => ['name' => 'Gaurav Kumar', 'ifsc' => 'HDFC0000053', 'account_number' => '765432123456789']
]);
```

### Accessing the Native SDK Configuration

[](#accessing-the-native-sdk-configuration)

If you ever need the raw bare-metal client instance for any reason:

```
$client = Razorpay::client();
```

License
-------

[](#license)

The MIT License (MIT).

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance90

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

5

Last Release

46d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/32757358?v=4)[sadique hussain](/maintainers/sadique-cws)[@sadique-cws](https://github.com/sadique-cws)

---

Top Contributors

[![sadique-cws](https://avatars.githubusercontent.com/u/32757358?v=4)](https://github.com/sadique-cws "sadique-cws (8 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/comestro-laravel-razorpay/health.svg)

```
[![Health](https://phpackages.com/badges/comestro-laravel-razorpay/health.svg)](https://phpackages.com/packages/comestro-laravel-razorpay)
```

###  Alternatives

[laraveldaily/laravel-invoices

Missing invoices for Laravel

1.5k1.3M4](/packages/laraveldaily-laravel-invoices)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
