Download the PHP package sslcommerz/laravel without Composer

On this page you can find all versions of the php package sslcommerz/laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel

SSLCOMMERZ Laravel Package

Table of Contents


Installation

Publish Configuration

Publish Routes (Optional)

Publish Everything


Configuration

Add these variables to your .env file:

Note: SSLCOMMERZ_SALT_KEY is required for recurring payments (Easycheckout).

Quick Start

Sandbox Test Credentials

Register at https://developer.sslcommerz.com/registration/ to get your sandbox credentials.

Test Card Numbers:

Card Type Number Expiry CVV
VISA 4111111111111111 12/36 111
Mastercard 5111111111111111 12/36 111
Amex 371111111111111 12/36 111

Mobile OTP: 111111 or 123456


Custom Controllers

You can easily override the default callback behavior.

  1. Publish the Controller Stub:

  2. Update Configuration: In your config/sslcommerz.php, update the controller option to point to your new controller:

  3. Customize Logic: Edit app/Http/Controllers/SslcommerzCallbackController.php to suit your needs.

Note: If you want to customize the URLs, you can also publish the routes: php artisan vendor:publish --tag=sslcommerz-routes

Payment Flow


Usage

Initiate Payment

Specialized Parameters (API v4)

Category Parameters
Airline pnr, hours_till_departure, flight_type, journey_from_to, third_party_booking
Travel hotel_name, length_of_stay, check_in_time, hotel_city
Telecom product_type, topup_number, country_topup
Logistics logistic_pickup_id, logistic_delivery_type

Recurring Payments (Easycheckout)

SSLCOMMERZ supports recurring payments via a schedule parameter.

1. Configure SALT Key: Add SSLCOMMERZ_SALT_KEY to your .env file. This key is provided by the SSLCOMMERZ team.

2. Initiate Recurring Payment:

3. Manage Subscriptions:

Validate Transaction

Refund

Query Transaction

Logging

By default, the package logs all gateway interactions using Laravel's default log configuration. You can disable logging by setting SSLCOMMERZ_LOG_ENABLED=false.


Callback Handling

The package registers these routes automatically:

Route Name Purpose
POST /ssl/success sslcommerz.success Successful payment
POST /ssl/fail sslcommerz.fail Failed payment
POST /ssl/cancel sslcommerz.cancel Cancelled payment
POST /ssl/ipn sslcommerz.ipn Instant Payment Notification

All routes exclude CSRF verification since SSLCOMMERZ sends POST requests.

By default, the prefix is ssl. You can change it via sslcommerz.routes.prefix in config/sslcommerz.php, or publish routes to customize paths.

Redirect URLs After Payment

Define your own routes and views to show the payment result to the user:


Events

Listen to these events in your EventServiceProvider:

Persistence (Handling Orders)

Since this package is database-agnostic, you should handle transaction persistence in your own application using listeners.

Example Listener:


Hash Verification

The package automatically verifies hash signatures on IPN callbacks. You can also verify manually:

Or use the middleware on your own routes:


Testing

Run Package Tests

Mock in Your Application Tests


API Reference

SSLCOMMERZ::initiate(PaymentRequestDTO|array $request): PaymentResponseDTO

Creates a payment session. If an array is passed, it is automatically converted to a DTO with sensible defaults.

SSLCOMMERZ::validate(string $valId): ValidationResponseDTO

Validates a transaction using the validation ID from callback/IPN.

SSLCOMMERZ::refund(RefundRequestDTO|array $request): RefundResponseDTO

Initiates a refund for a previously successful transaction.

SSLCOMMERZ::queryTransaction(string $tranId): TransactionQueryDTO

Queries all transactions associated with a merchant transaction ID.

SSLCOMMERZ::queryBySession(string $sessionKey): ValidationResponseDTO

Queries transaction status by SSLCOMMERZ session key.

SSLCOMMERZ::queryRefundStatus(string $refundRefId): RefundResponseDTO

Checks the current status of a refund request.

SSLCOMMERZ::verifyHash(array $data): bool

Verifies the MD5 hash signature of callback data.


Security

This package implements multiple layers of security:

  1. Hash Verification: All IPN callbacks are verified using SSLCOMMERZ's MD5 signature algorithm
  2. API Validation: Every successful payment is validated server-side via the Order Validation API
  3. CSRF Exemption: Only callback routes from SSLCOMMERZ are CSRF-exempt
  4. Logging: All gateway interactions are logged for audit trails
  5. Environment Isolation: Separate endpoints for sandbox and production

Best Practices


Troubleshooting

Issue Solution
"Invalid Store ID" Check SSLCOMMERZ_STORE_ID in .env
CSRF token mismatch Callback routes already exclude CSRF — check if you overrode routes
IPN not received Ensure your server is reachable from internet on port 80/443
Hash verification fails Verify SSLCOMMERZ_STORE_PASSWORD matches your SSLCOMMERZ dashboard
Connection timeout Whitelist SSLCOMMERZ IPs: 103.26.139.87 (sandbox), 103.26.139.81 (live)

License

MIT License. See LICENSE for details.


All versions of laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/http Version ^10.0|^11.0|^12.0|^13.0
illuminate/events Version ^10.0|^11.0|^12.0|^13.0
illuminate/log Version ^10.0|^11.0|^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sslcommerz/laravel contains the following files

Loading the files please wait ...