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.
- Features
- Requirements
- Installation
- Configuration
- Quick Start
- Documentation
- Changelog
- Contributing
- Security Vulnerabilities
- Credits
- License
- 🚀 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)
- PHP:
8.2or 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
You can install the package via Composer:
composer require raziul/sslcommerz-laravelLaravel's package discovery will register the service provider and Sslcommerz facade automatically.
Publish the config/sslcommerz.php configuration file:
php artisan sslcommerz:installAdd 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=BDTuse 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());
}use Raziul\Sslcommerz\Facades\Sslcommerz;
$isValid = Sslcommerz::validatePayment($request->all(), $transactionId, $amount);
if ($isValid) {
// Payment is authentic and verified
$order->update(['status' => 'completed']);
}- Getting Started (বাংলা)
- Basic Usage & Workflow (বাংলা)
- Validation & Security (বাংলা)
- Refunds (বাংলা)
- Advanced Configuration (বাংলা)
- API Reference (বাংলা)
- Complete Example (বাংলা)
- Testing & Troubleshooting (বাংলা)
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.