PHPackages                             trocho/laravel-paytm - 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. trocho/laravel-paytm

ActiveLibrary[Payment Processing](/categories/payments)

trocho/laravel-paytm
====================

Payment Integration with Paytm.

v1.0.6(9y ago)063MITPHPPHP &gt;=5.5.9

Since Oct 6Pushed 9y ago1 watchersCompare

[ Source](https://github.com/trocho/laravel-paytm)[ Packagist](https://packagist.org/packages/trocho/laravel-paytm)[ RSS](/packages/trocho-laravel-paytm/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (11)Used By (0)

Paytm Payment Library For Laravel 4.2 and 5
===========================================

[](#paytm-payment-library-for-laravel-42-and-5)

Introduction
------------

[](#introduction)

It simplifies the payment flow with the defined methods. You can pay through paytm just writing few lines of codes. Before you start installing this service, please complete your Paytem setup at [on Paytm](http://paywithpaytm.com).

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

[](#installation)

First, you'll need to require the package with Composer:

```
composer require trocho/laravel-paytm
```

Aftwards, run `composer update` from your command line.

Then, update `config/app.php` by adding an entry for the service provider.

```
'providers' => [
	// ...
	'Trocho\LaravelPaytm\PaytmServiceProvider',
];
```

Then, register class alias by adding an entry in aliases section

```
'aliases' => [
	// ...
	'Paytm' => 'Trocho\LaravelPaytm\Facades\Paytm',
];
```

Finally, from the command line again, run `php artisan vendor:publish` to publish the default configuration file. This will publish a configuration file named `paytm.php` which includes your Paytm authorization keys and aditional settings.

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

[](#configuration)

You need to fill in `paytm.php` file that is found in your applications `config` directory.

Usage
-----

[](#usage)

### Request for Payment

[](#request-for-payment)

You can easily send a message to all registered users with the command

```
$request = array('CUST_ID' => 1 ,'TXN_AMOUNT'=> 1 );
Paytm::pay($request);
```

`CUST_ID` and `TXN_AMOUNT` fields value are pass to Paytm and redirect to callback URL.

### After redirect to callback URL

[](#after-redirect-to-callback-url)

Once we redirected to callback URL we need to verify whether transaction `Success` or `Fail`.

#### Example

[](#example)

Suppose, your callback URL is `https://your-app.io/payment/callback`Paytm `POST` respone on your URL. we need to get response.

In `routes.php` add a post method.

```
Route::post("payment/callback", "PaymentController@callback");
```

In `PaymentController` create a method

```
public function callback(Request $Request)
{
$paymentResponse =  $Request->all();
$paymentData     = Paytm::verifyPayment($paymentResponse);
}
```

`$postData` gives transcation details. after, use your business logic to save.

### Check Transaction Status

[](#check-transaction-status)

```
Paytm::transactionStatus($orderID);
```

`$orderID` is the Unique ID generated for the transaction by merchant

### Initiate Refund Process

[](#initiate-refund-process)

```
Paytm::initiateTransactionRefund($orderID,$amount,$txnType);
```

`$orderID`: Transaction Order Id by merchant.

`$amount`: Amount to refund.

`$txnType`; Any one of below values: `REFUND` `CANCEL`

Please refer to [Documentation](http://paywithpaytm.com/developer/paytm_api_doc). for all customizable parameters.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 57.1% 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 ~6 days

Total

8

Last Release

3512d ago

Major Versions

v0.0.1 → v1.02016-10-06

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9249585?v=4)[Patryk Trochowski](/maintainers/Trocho)[@trocho](https://github.com/trocho)

---

Top Contributors

[![princealikhan](https://avatars.githubusercontent.com/u/6194551?v=4)](https://github.com/princealikhan "princealikhan (8 commits)")[![trocho](https://avatars.githubusercontent.com/u/9249585?v=4)](https://github.com/trocho "trocho (6 commits)")

---

Tags

laravelpaymentgatewayindiapaytm

### Embed Badge

![Health badge](/badges/trocho-laravel-paytm/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[laravel/ai

The official AI SDK for Laravel.

1.0k2.1M163](/packages/laravel-ai)[moonshine/moonshine

Laravel administration panel

1.3k239.9k76](/packages/moonshine-moonshine)[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4849.3k](/packages/sebdesign-laravel-viva-payments)[parsisolution/gateway

A Laravel package for connecting to all Iraninan payment gateways

231.7k](/packages/parsisolution-gateway)

PHPackages © 2026

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