hasinhayder/sslcommerz-laravel
Larablocks Analysis
hasinhayder/sslcommerz-laravel works with Laravel 10 to 13 (latest release v1.2.0, Oct 1, 2026).
Recommendation checks
PromisingPromising: maintained and up to date, meets 2 of 4 checks; not yet widely used.
- Works with Laravel 13, the current version
- Released in the last 12 months (Oct 1, 2026)
- 259 downloads a month (needs 10,000)
- 13 GitHub stars (needs 100)
State
Actively maintained- Last stable release: Oct 1, 2026.
- 3 releases in the last 12 months.
- First released: Mar 20, 2026.
- Monthly downloads: 259.
- 0 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Dec 5, 2026.
| Install | |
|---|---|
composer require hasinhayder/sslcommerz-laravel |
|
| Latest Version: | v1.2.0 |
| PHP: | ^8.2||^8.3||^8.4 |
| Laravel: | 10 – 13 |
| License: | MIT |
| Last Updated: | Oct 1, 2026 |
| Links: | GitHub · Packagist |
Sslcommerz Laravel Package
This package provides an easy and convenient way to integrate SSLCommerz payment gateway into your Laravel application. With features like payment processing, payment validation, refunds, and hash verification, this package offers a simple API for developers to quickly implement payment functionality.
🔥 Features
- Great Developer Experience
- Initiate payments via SSLCommerz
- Set callback URLs for success, failure, cancellation and IPN
- Validate payment transactions
- Refund payments and check refund status
- Verify hash from SSLCommerz responses
- Sandbox and live environment support
Requirements
- PHP 8.2 or above
- Laravel 10.0 through 13.x
- SSLCommerz Credentials
Installation
You can install the package via Composer:
composer require hasinhayder/sslcommerz-laravel
Once installed, the service provider will be registered automatically.
Configuration
Add the following environment variables to your .env file:
SSLC_SANDBOX=true # or false for live
SSLC_STORE_ID=your_store_id
SSLC_STORE_PASSWORD=your_store_password
SSLC_STORE_CURRENCY='BDT'
# SSLCommerz route names (optional)
SSLC_ROUTE_SUCCESS='sslc.success'
SSLC_ROUTE_FAILURE='sslc.failure'
SSLC_ROUTE_CANCEL='sslc.cancel'
SSLC_ROUTE_IPN='sslc.ipn'
Optionally, You can publish the configuration file using the following command:
php artisan sslcommerz-laravel:install
This will publish the sslcommerz.php file to your config directory.
✨ Getting Sandbox Credentials
SSLCommerz credentials are required to use this package. You can get sandbox credentials by following these steps:
-
Create Sandbox Account: Visit the https://developer.sslcommerz.com/registration/ page to create an account.
-
Obtain Credentials: After registration, you will receive your Store ID and Store Password via email or from the SSLCommerz dashboard.
-
Set Up in .env: Copy these credentials and paste them into your
.envfile as shown in the Configuration step.
[!IMPORTANT] Sandbox credentials are for testing purposes only. You should replace them with your live credentials and change SANDBOX=false before deploying to production.
💡 Usage
1. Defining Callback Routes
To handle different stages of the payment lifecycle, define your callback routes for success, failure, cancellation, and IPN (Instant Payment Notification):
Route::controller(SslcommerzController::class)
->prefix('sslcommerz') // prefix to avoid conflicts
->name('sslc.')
->group(function () {
Route::post('success', 'success')->name('success');
Route::post('failure', 'failure')->name('failure');
Route::post('cancel', 'cancel')->name('cancel');
Route::post('ipn', 'ipn')->name('ipn');
});
We defined the sslc.success, sslc.failure, sslc.cancel, and sslc.ipn routes according to the configured route names.
Now create the SslcommerzController controller and implement the success, failure, cancel, and ipn methods as required.
2. Initiating a Payment
Initiating a payment has never been easier. For example, you can use the following code:
use \HasinHayder\Sslcommerz\Facades\Sslcommerz;
$response = Sslcommerz::setOrder($amount, $invoiceId, $productName)
->setCustomer($customerName, $customerEmail, $customerPhone)
->setShippingInfo($itemsQuantity, $address)
->makePayment();
if ($response->success()) {
// payment initiated, redirect to payment page
return redirect($response->gatewayPageURL());
} else {
// Handle payment failure
}
3. Validating a Payment
To validate a payment after a successful transaction:
use \HasinHayder\Sslcommerz\Facades\Sslcommerz;
$isValid = Sslcommerz::validatePayment($requestData, $transactionId, $amount);
if ($isValid) {
// Payment is valid
} else {
// Payment is invalid
}
4. Refunds
If you need to refund a payment, you can do so easily:
$refundResponse = Sslcommerz::refundPayment($bankTransactionId, $amount, $reason);
You can also check the refund status:
$refundStatus = Sslcommerz::checkRefundStatus($refundRefId);
5. Hash Verification
To verify the authenticity of the response from SSLCommerz, use the verifyHash method:
if (Sslcommerz::verifyHash($request->all())) {
// Hash is valid
}
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.
Related Packages
Powerful PHP database abstraction layer (DBAL) with many features for database s...
Laravel Serializable Closure provides an easy and secure way to serialize closur...
Cli error handling for console/command-line PHP applications.
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v1.2.0 | ^8.2|| | ^10.0|| | MIT | |
| v1.1.1 | ^8.2|| | ^10.0|| | MIT | |
| v1.1.0 | ^8.2|| | ^10.0|| | MIT |