Sslcommerz
SSLCommerz Payment Gateway for Laravel
Install / Use
/learn @mahabubulhasan/SslcommerzREADME
SSLCommerz
SSLCommerz Payment gateway library for Laravel framework. Official documentation is here.
install
composer require uzzal/sslcommerz
publish
artisan vendor:publish
This command will create a sslcommerz.php file inside the config directory. Configure your parameters in your .env file
#sslcommerz
STORE_ID=your_store_id
STORE_PASSWORD=your_store_password
SUCCESS_URL=http://your-domain.at/success.php
FAIL_URL=http://your-domain.at/fail.php
CANCEL_URL=http://your-domain.at/cancel.php
SANDBOX_MODE=true
Initiating a Payment session
This initSession will give you a gateway url. With this url you will be able to continue the payment through sslcommerz.
$customer = new Customer('Mahabubul Hasan', 'mahabub@example.com', '0171xxxxx22');
$resp = Client::initSession($customer, 29); //29 is the amount
echo $resp->getGatewayUrl();
or with configuration
$customer = new Customer('Mahabubul Hasan', 'mahabub@example.com', '0171xxxxx22');
$config[SessionRequest::EMI] = '0';
$resp = Client::initSession($customer, 29, $config);
echo $resp->getGatewayUrl();
Request for Validation
This verifyOrder method takes a val_id as parameter which you will get in the IPN request.
$resp = Client::verifyOrder('180828114058np43AJdzJJOsYzc');
echo 'status: '.$resp->getStatus();
echo 'transaction: '.$resp->getTransactionId();
IPN Listener (Step 4,5)
After filling the card information and submission in the sslcommerz window it will send a IPN notificaion to your specified IPN url. To grab the notification use the following code. For more details see here
if(ipn_hash_varify(config('sslcommerz.store_password'))){
$ipn = new IpnNotification($_POST);
$val_id = $ipn->getValId();
$transaction_id = $ipn->getTransactionId();
$amount = $ipn->getAmount();
$resp = Client::verifyOrder($val_id);
}
SSLCommerz process flow

Related Skills
node-connect
341.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
341.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.4kCommit, push, and open a PR
