Search by

raziul / sslcommerz-laravel

Raziul

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

Package info

github.com/iRaziul/sslcommerz-laravel

Homepage

pkg:composer/raziul/sslcommerz-laravel

Fund package maintenance!

iraziul

Patreon

Statistics

Installs: 3 327

Dependents: 1

Suggesters: 0

Stars: 73

Open Issues: 0

v1.2.0 2026-04-20 08:13 UTC

This package is auto-updated.

Last update: 2026-09-09 04:52:18 UTC


README

Sslcommerz Laravel Package

SSLCommerz Laravel Package

🇬🇧 English🇧🇩 বাংলা

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.