PHPackages                             rajtika/sslcommerz - 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. rajtika/sslcommerz

ActiveLibrary[Payment Processing](/categories/payments)

rajtika/sslcommerz
==================

SSLCommerce Payment gateway Integration library for laravel

21051[2 PRs](https://github.com/jewel-rana/sslcommerz/pulls)PHP

Since Apr 14Pushed 2y agoCompare

[ Source](https://github.com/jewel-rana/sslcommerz)[ Packagist](https://packagist.org/packages/rajtika/sslcommerz)[ RSS](/packages/rajtika-sslcommerz/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (3)Used By (0)

sslcommerz
==========

[](#sslcommerz)

SSLCommerz payment gateway integration

[![Latest Stable Version](https://camo.githubusercontent.com/ed170b27d08ca63e90906eb80fd8e59693c01968da5da75dfb2c9948eaba7b72/68747470733a2f2f706f7365722e707567782e6f72672f72616a74696b612f73736c636f6d6d65727a2f762f737461626c65)](https://packagist.org/packages/rajtika/sslcommerz)

This package will make your integration to SSLCommerz payment gateway simple and easy

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

[](#installation)

You can install the package via composer:

```
    composer require rajtika/sslcommerz
```

### Publish Configuration

[](#publish-configuration)

Publish configuration file

```
    php artisan vendor:publish
```

### Setup and configure

[](#setup-and-configure)

Update your app environment (.env)

```
SSL_LOCALHOST=[TRUE/FALSE]
SSL_SANDBOX_MODE=[TRUE/FALSE]
SSL_STORE_ID=[YOUR SSLCOMMERZ STORE ID]
SSL_STORE_PASSWORD=[YOUR SSLCOMMERZ STORE_PASSWORD]
SSL_SUCCESS_URL=sslcommerz/success
SSL_CANCEL_URL=sslcommerz/cancel
SSL_FAIL_URL=sslcommerz/fail
SSL_IPN_URL=sslcommerz/ipn
SSL_STORE_CURRENCY=[STORE CURRENCY eg. BDT]

```

Create four `POST` routes for SSLCommerz

```
    Route::post('sslcommerz/success','SSLPaymentController@success');
    Route::post('sslcommerz/fail','SSLPaymentController@fail');
    Route::post('sslcommerz/cancel','SSLPaymentController@cancel');
    Route::post('sslcommerz/ipn','SSLPaymentController@ipn');
```

**NOTE** These routes are being used in .env file

Add exception in `app\Http\Middleware\VerifyCsrfToken.php`

```
    protected $except = [
        'sslcommerz/*'
    ];
```

**NOTE** This will be the initial group of those four routes

After done configuraing

```
    php artisan config:cache
```

Usage
-----

[](#usage)

### Make Payment

[](#make-payment)

Now you can call for payment from Route or Controller method:

***Route Way***

```
Route::post('make-payment', function() {
	SSLCommerz::setParams([
	    'tran_id' => 'your_unique_transaction_id',
	    'product_name' => 'Name of your product',
	    'product_category' => 'Product category',
	    'product_profile' => 'general',
	    'total_amount' => 100,
	    'currency' => 'BDT',
	    'cus_name' => 'John Doe',
	    'cus_email' => 'customer@example.com',
	    'cus_phone' => '01911XXXXXX',
	    'cus_add1' => 'Dhaka'
	]) //Shipping is required when your order need shipment
	->setShippingInfo([
	    'shipping_method' => "YES",
	    'num_of_item' => 2
	])
	->makePayment()
	->hosted(); //this method will redirect your customer to ssl commerz payment page
	//or
	->checkout(); //this method will return a json response for your checkout popup
});
```

***Controller Way***

```
use Rajtika\SSLCommerz\SSLCommerz;

class PaymentController extends Controller
{
    public function paymentRedirectWay()
    {
        ...
        //  DO YOU ORDER SAVING PROCESS TO DB OR ANYTHING
        ...

        // You can generate an unique transaction id by using uniqueid()

        $transaction_id = uniqid(); //this transaction id must save your order or payment table for referencing / validate payment status

        return SSLCommerz::setParams([
            'tran_id' => $transaction_id,
            'product_name' => 'Name of your product',
            'product_category' => 'Product category',
            'product_profile' => 'general',
            'total_amount' => 100,
            'currency' => 'BDT',
            'cus_name' => 'John Doe',
            'cus_email' => 'customer@example.com',
            'cus_phone' => '01911XXXXXX',
            'cus_add1' => 'Dhaka'
        ]) //Shipping is required when your order need shipment
        ->setShippingInfo([
            'shipping_method' => "YES",
            'num_of_item' => 2
        ])
        ->makePayment()
        ->hosted(); //this method will redirect your customer to ssl commerz payment page
    }
    //or
    public function popupWay()
    {
        ...
        //  DO YOU ORDER SAVING PROCESS TO DB OR ANYTHING
        ...

        // You can generate an unique transaction id by using uniqueid()

        /*
        * this transaction id must save your order or payment table
        * for referencing / validate payment status
        * You can make this more unique by passing prefix to it
        */
        $transaction_id = uniqid();

        return SSLCommerz::setParams([
            'tran_id' => $transaction_id,
            'product_name' => 'Name of your product',
            'product_category' => 'Product category',
            'product_profile' => 'general',
            'total_amount' => 100,
            'currency' => 'BDT',
            'cus_name' => 'John Doe',
            'cus_email' => 'customer@example.com',
            'cus_phone' => '01911XXXXXX',
            'cus_add1' => 'Dhaka'
        ])
        //Shipping is required when your order need shipment
        ->setShippingInfo([
            'shipping_method' => "YES",
            'num_of_item' => 2
        ])
        ->makePayment()
        ->checkout(); //this method will return a json response for your checkout popup
    }
}
```

**NOTE** This is the minimalist basic need to perform a payment.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e9dcf443dff096d3af939a7f000435227ec4b2487a8c9a0bad221731e088f97b?d=identicon)[jewelrana.dev](/maintainers/jewelrana.dev)

---

Top Contributors

[![jewel-rana](https://avatars.githubusercontent.com/u/23020274?v=4)](https://github.com/jewel-rana "jewel-rana (22 commits)")

### Embed Badge

![Health badge](/badges/rajtika-sslcommerz/health.svg)

```
[![Health](https://phpackages.com/badges/rajtika-sslcommerz/health.svg)](https://phpackages.com/packages/rajtika-sslcommerz)
```

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

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