raziul/sslcommerz-laravel

SSLCommerz Laravel is a super easy package to integrate SSLCommerz on Laravel websites.
4,158 76
Install
composer require raziul/sslcommerz-laravel
Latest Version:v1.2.0
PHP:^8.2||^8.3||^8.4||^8.5
Laravel:10 – 13
License:MIT
Last Updated:Sep 9, 2026
Links: GitHub  ·  Packagist
Maintainer: Raziul

SSLCommerz Laravel Package

Latest Version on Packagist Laravel Compatibility GitHub Tests Action Status Total Downloads License

This package provides an elegant and convenient way to integrate the SSLCommerz payment gateway into your Laravel application. With features like fluent payment initiation, server-side transaction validation, refund processing, and MD5 hash verification, this package offers a clean API for developers to implement payments quickly and securely.


📑 Table of Contents


✨ Features

  • 🚀 Great Developer Experience with a fluent, chainable API
  • 💳 Seamless payment session creation via SSLCommerz Hosted Checkout
  • 🔄 Automatic callback routing for Success, Failure, Cancel, and IPN
  • 🛡️ Direct server-to-server transaction validation
  • 💸 Full & partial refund support with refund status tracking
  • 🔐 Response authenticity verification using MD5 digital signatures
  • 🧪 Sandbox and Live production environments
  • 💱 Multi-currency support (BDT, USD, EUR, GBP, etc.)
  • 🎯 Payment gateway filtering (e.g. restrict to bKash, Nagad, Visa)

📋 Requirements

  • PHP: 8.2 or higher (8.2, 8.3, 8.4, 8.5)
  • Laravel: 10.x, 11.x, 12.x, 13.x
  • SSLCommerz Account: Sandbox or Live Merchant credentials

📦 Installation

You can install the package via Composer:

composer require raziul/sslcommerz-laravel

Laravel's package discovery will register the service provider and Sslcommerz facade automatically.


⚙️ Configuration

1. Publish Configuration

Publish the config/sslcommerz.php configuration file:

php artisan sslcommerz:install

2. Environment Variables

Add your credentials to .env:

SSLC_SANDBOX=true # Set to false for live production
SSLC_STORE_ID=your_store_id
SSLC_STORE_PASSWORD=your_store_password
SSLC_STORE_CURRENCY=BDT

💡 Quick Start

1. Initiate a Payment

use Raziul\Sslcommerz\Facades\Sslcommerz;

$response = Sslcommerz::setOrder($amount, $invoiceId, 'Order #' . $invoiceId)
    ->setCustomer($name, $email, $phone, $address)
    ->setShippingInfo(1, $address)
    ->makePayment();

if ($response->success()) {
    return redirect($response->gatewayPageURL());
}

2. Validate the Payment

use Raziul\Sslcommerz\Facades\Sslcommerz;

$isValid = Sslcommerz::validatePayment($request->all(), $transactionId, $amount);

if ($isValid) {
    // Payment is authentic and verified
    $order->update(['status' => 'completed']);
}

📖 Documentation


Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

Related Packages

hasinhayder/sslcommerz-laravel

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

1,213 13
syedmahamudul/sslcommerz-laravel

The easiest SSLCommerz payment gateway package for Laravel with automatic valida...

14 4
doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

648,266,899 9,701
laravel/framework

The Laravel Framework.

604,216,237 34,982
laravel/tinker

Powerful REPL for the Laravel framework.

512,508,631 7,443

Version History

Version Released PHP Laravel License
v1.2.0 ^8.2||^8.3||^8.4||^8.5 ^10.0||^11.0||^12.0||^13.0 MIT
v1.1.0 ^8.2||^8.3||^8.4 ^10.0||^11.0||^12.0||^13.0 MIT
v1.0.2 ^8.2||^8.3||^8.4 ^10.0||^11.0||^12.0 MIT
v1.0.1 ^8.2 ^10.0||^11.0 MIT
v1 ^8.2 ^10.0||^11.0 MIT