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

ActiveLibrary

karim007/sslcommerz-laravel
===========================

SSLCommerz - Laravel Library

v2.4(8mo ago)3580↓50%21MITPHP

Since Jan 6Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/karim-007/sslcommerz-laravel)[ Packagist](https://packagist.org/packages/karim007/sslcommerz-laravel)[ RSS](/packages/karim007-sslcommerz-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)DependenciesVersions (10)Used By (1)

SSLCommerz Payment Gateway for PHP/Laravel Framework
====================================================

[](#sslcommerz-payment-gateway-for-phplaravel-framework)

[![Downloads](https://camo.githubusercontent.com/9e59e971e58a037d5d71ee410474833078521438c94332d49990cd0e3a6dbed7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b6172696d3030372f73736c636f6d6d65727a2d6c61726176656c)](https://packagist.org/packages/karim007/sslcommerz-laravel)[![Starts](https://camo.githubusercontent.com/1c630bdf960a09d7e2bef35957f59a36b6f56d6ba0bfe070b2a3bcf202ea51c2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f73746172732f6b6172696d3030372f73736c636f6d6d65727a2d6c61726176656c)](https://packagist.org/packages/karim007/sslcommerz-laravel)

Features
--------

[](#features)

This is a php/laravel wrapper package for [SSLCommerz](https://sslcommerz.com)

Requirements
------------

[](#requirements)

- PHP &gt;=7.4
- Laravel &gt;= 6
- ext-curl '\*'

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

[](#installation)

```
composer require karim007/sslcommerz-laravel
```

### vendor publish (config)

[](#vendor-publish-config)

```
#it will publish config file in your config folders
php artisan vendor:publish --provider="Karim007\SslcommerzLaravel\SslcommerzLaravelServiceProvider" --tag="config"
```

After publish config file setup your credential. you can see this in your config directory sslcommerz.php file

```
'sandbox' => env("SSLCOMMERZ_SANDBOX", false), // For Sandbox, use "true", For Live, use "false"
'middleware' => 'web',//you can change this middleware according to you
'store_id' => env("SSLCOMMERZ_STORE_ID"),
'store_password' => env("SSLCOMMERZ__STORE_PASSWORD"),
'success_url' => '/sslcommerz/success',
'failed_url' => '/sslcommerz/fail',
'cancel_url' => '/sslcommerz/cancel',
'ipn_url' => '/sslcommerz/ipn',
'return_response' => 'html', //html or json html means blade return json means json data return

```

### Set .env configuration

[](#set-env-configuration)

```
SSLCOMMERZ_SANDBOX=true #For Sandbox, use "true", For Live, use "false"
SSLCOMMERZ_STORE_ID=
SSLCOMMERZ__STORE_PASSWORD=

```

For development purposes, you can obtain sandbox 'Store ID' and 'Store Password' by registering at

### publish SslCommerzPaymentController.php controller

[](#publish-sslcommerzpaymentcontrollerphp-controller)

```
#it will publish controllers file in your app\Http\Controllers folders

php artisan vendor:publish --provider="Karim007\SslcommerzLaravel\SslcommerzLaravelServiceProvider" --tag="controllers"
```

### this is your routes list

[](#this-is-your-routes-list)

```
Route::group(['middleware'=>[config('sslcommerz.middleware','web')]], function () {
    Route::get('/sslcommerz/example1', [SslCommerzPaymentController::class, 'exampleEasyCheckout']);
    Route::get('/sslcommerz/example2', [SslCommerzPaymentController::class, 'exampleHostedCheckout']);

    Route::post('/sslcommerz/pay', [SslCommerzPaymentController::class, 'index']);
    Route::post('/sslcommerz/pay-via-ajax', [SslCommerzPaymentController::class, 'payViaAjax']);

    Route::post('/sslcommerz/success', [SslCommerzPaymentController::class, 'success']);
    Route::post('/sslcommerz/fail', [SslCommerzPaymentController::class, 'fail']);
    Route::post('/sslcommerz/cancel', [SslCommerzPaymentController::class, 'cancel']);

    Route::post('/sslcommerz/ipn', [SslCommerzPaymentController::class, 'ipn']);
});
```

### Add exceptions for VerifyCsrfToken middleware accordingly.

[](#add-exceptions-for-verifycsrftoken-middleware-accordingly)

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

### For payment ( All functionality already append in SslCommerzPaymentController)

[](#for-payment--all-functionality-already-append-in-sslcommerzpaymentcontroller)

```
$post_data = array();
$post_data['total_amount'] = '10'; # You cant not pay less than 10
$post_data['currency'] = "BDT";
$post_data['tran_id'] = uniqid(); // tran_id must be unique

$sslc = new SslCommerzNotification();

//for hosted payment
$payment_options = $sslc->makePayment($post_data, 'hosted');
#or
//for api/popup payment
$payment_options = $sslc->makePayment($post_data, 'checkout', 'json');
```

### for other info append(optional)

[](#for-other-info-appendoptional)

```
    $post_data = array();
    $post_data['total_amount'] = '10'; # You cant not pay less than 10
    $post_data['currency'] = "BDT";
    $post_data['tran_id'] = uniqid(); // tran_id must be unique

    $customer = array();
    $customer['name'] = 'Ab Karim';
    $customer['email'] = 'customer@mail.com';
    $customer['address_1'] = 'Dhaka';
    $customer['address_2'] = "";
    $customer['city'] = "";
    $customer['state'] = "";
    $customer['postcode'] = "";
    $customer['country'] = "Bangladesh";
    $customer['phone'] = '8801XXXXXXXXX';
    $customer['fax'] = "";

    $s_info = array();
    $s_info['shipping_method'] = 'Yes'; // string (50)	Mandatory - Shipping method of the order. Example: YES or NO or Courier
    $s_info['num_of_item'] = 1; // integer (1)	Mandatory - No of product will be shipped. Example: 1 or 2 or etc
    $s_info['ship_name'] = 'Abc'; // string (50)	Mandatory, if shipping_method is YES - Shipping Address of your order. Not mandatory but useful if provided
    $s_info['ship_add1'] = 'Dhaka';; // string (50)	Mandatory, if shipping_method is YES - Additional Shipping Address of your order. Not mandatory but useful if provided
    $s_info['ship_add2'] = ''; // string (50)	Additional Shipping Address of your order. Not mandatory but useful if provided
    $s_info['ship_city'] = 'Dhaka'; // string (50)	Mandatory, if shipping_method is YES - Shipping city of your order. Not mandatory but useful if provided
    $s_info['ship_state'] = ''; // string (50)	Shipping state of your order. Not mandatory but useful if provided
    $s_info['ship_postcode'] = '1215'; // string (50)	Mandatory, if shipping_method is YES - Shipping postcode of your order. Not mandatory but useful if provided
    $s_info['ship_country'] = 'Bangladesh'; // string (50)	Mandatory, if shipping_method is YES - Shipping country of your order. Not mandatory but useful if provided

    $sslc = new SslCommerzNotification();
    $sslc->setCustomerInfo($customer)->setShipmentInfo($s_info);

    //then you can call
    $sslc->makePayment($post_data, 'hosted');
    //or
    $sslc->makePayment($post_data, 'checkout', 'json');
```

### if you want you can publish orders migration

[](#if-you-want-you-can-publish-orders-migration)

```
#if you already have orders or this related table then skip it
#it will publish order migrations file in your database\migrations folders
php artisan vendor:publish --provider="Karim007\SslcommerzLaravel\SslcommerzLaravelServiceProvider" --tag="migrations"

php artisan migrate
```

### you can also publish views(optionals)

[](#you-can-also-publish-viewsoptionals)

```
#it will publish order migrations file in your resource\views\sslcommerz folders
php artisan vendor:publish --provider="Karim007\SslcommerzLaravel\SslcommerzLaravelServiceProvider" --tag="views"
```

Contributions to the SSLCommerz Payment Gateway package you are welcome. Please note the following guidelines before submitting your pull request.

- Follow [PSR-4](http://www.php-fig.org/psr/psr-4/) coding standards.
- Read SSLCommerz API documentations first. Please contact with SSLCommerz for their api documentation and sandbox access.

License
-------

[](#license)

This repository is licensed under the [MIT License](http://opensource.org/licenses/MIT).

Copyright 2023 [md abdul karim](https://github.com/karim-007). We are not affiliated with SSLCommerz and don't give any guarantee.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance60

Regular maintenance activity

Popularity21

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity51

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 ~121 days

Recently: every ~201 days

Total

9

Last Release

254d ago

Major Versions

v1.0.3 → v2.02023-06-16

PHP version history (3 changes)v1.0.0PHP ^7.4|^8.0|^8.1

v1.0.3PHP ^7.4|^8.0|^8.1|^10

v2.3PHP ^7.4|^8.0|^8.1|^8.2|^10

### Community

Maintainers

![](https://www.gravatar.com/avatar/1628a1636c45e8e246f880d1f2401497d66af3f657dba80a0f189b102e4b4ce7?d=identicon)[karim.cse007](/maintainers/karim.cse007)

---

Top Contributors

[![karim-007](https://avatars.githubusercontent.com/u/54572884?v=4)](https://github.com/karim-007 "karim-007 (19 commits)")

---

Tags

sslcommerzSSLCommerz laravelSSLCommerz payment getwayComposer package for SSLCommerz payment

### Embed Badge

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

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

###  Alternatives

[raziul/sslcommerz-laravel

SSLCommerz Laravel is a super easy package to integrate SSLCommerz on Laravel websites.

691.4k1](/packages/raziul-sslcommerz-laravel)

PHPackages © 2026

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