PHPackages                             faysal0x1/lara-payment - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. faysal0x1/lara-payment

ActiveLibrary[Payment Processing](/categories/payments)

faysal0x1/lara-payment
======================

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

0.2(1y ago)25MITPHPPHP ^8.0|^8.1|^8.2|^8.3CI passing

Since May 20Pushed 1y ago1 watchersCompare

[ Source](https://github.com/faysal0x1/lara-payment)[ Packagist](https://packagist.org/packages/faysal0x1/lara-payment)[ Docs](https://github.com/faysal0x1/lara-payment)[ RSS](/packages/faysal0x1-lara-payment/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (14)Versions (3)Used By (0)

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless
========================================================================================================

[](#a-laravel-package-that-makes-implementation-of-multiple-payment-gateways-endpoints-and-webhooks-seamless)

[![Latest Version on Packagist](https://camo.githubusercontent.com/18736ec9e5d9c008a0f9455ef35bfd677c7d8606558e07e9c60f50ac9bd67f6a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f66617973616c3078312f6c6172612d7061796d656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/faysal0x1/lara-payment)[![PHP from Packagist](https://camo.githubusercontent.com/9c674d934143239c433127dc359c6a70e20c6df7126df99f767f0b85635aa19c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f66617973616c3078312f6c6172612d7061796d656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/faysal0x1/lara-payment)[![Laravel Version](https://camo.githubusercontent.com/3c845acf050e00a9d9eb02e81f4582a52df854a05ea2a04ac5ec5ff5b4458322/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d382e782c253230392e782c25323031302e782c25323031312e782d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/faysal0x1/lara-payment)[![Test Status](https://camo.githubusercontent.com/d032e374c28e524c7e5cce8a5fcd58c287dd6c4592e29384a478e93efd9abfb5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f66617973616c3078312f6c6172612d7061796d656e742f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d5465737473)](https://camo.githubusercontent.com/d032e374c28e524c7e5cce8a5fcd58c287dd6c4592e29384a478e93efd9abfb5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f66617973616c3078312f6c6172612d7061796d656e742f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d5465737473)[![Code Style Status](https://camo.githubusercontent.com/3e78546d4d0ac6de2c66a526e08f039e730d7f2e4159557e7257b8be8847b5f2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f66617973616c3078312f6c6172612d7061796d656e742f7068707374616e2e796d6c3f6272616e63683d6d61696e266c6162656c3d436f64652532305374796c65)](https://camo.githubusercontent.com/3e78546d4d0ac6de2c66a526e08f039e730d7f2e4159557e7257b8be8847b5f2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f66617973616c3078312f6c6172612d7061796d656e742f7068707374616e2e796d6c3f6272616e63683d6d61696e266c6162656c3d436f64652532305374796c65)[![Total Downloads](https://camo.githubusercontent.com/02508060a58818c94f46b5e1bcc86b16cb8d6f3100f70db70feea018dd5bc560/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f66617973616c3078312f6c6172612d7061796d656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/faysal0x1/lara-payment)

The `lara-payment` package provides a convenient way to handle payments through multiple payment gateways in a **Laravel 8, 9 and 10 application**. The package currently supports multiple gateways such as **Paystack**, **Flutterwave** and **Stripe**. The package offers an easy to use interface that abstracts the complexities of integrating with these payment gateways. It also provides a way to handle webhooks from the payment gateways.

Documentation
-------------

[](#documentation)

A comprehensive documentation is available to help you get started with the package [here](https://lara-payment-xi.vercel.app)

Testing
-------

[](#testing)

```
php artisan test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Faysal0x1](https://github.com/Faysal0x1)
- [Cybernerdie](https://github.com/cybernerdie)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Laravel SSLCommerz Payment Gateway Integration
==============================================

[](#laravel-sslcommerz-payment-gateway-integration)

A Laravel package for integrating SSLCommerz payment gateway into your Laravel application. This package provides a simple and flexible way to handle payments through SSLCommerz in your Laravel projects.

Features
--------

[](#features)

- Easy checkout and hosted checkout options
- AJAX payment support
- IPN (Instant Payment Notification) handling
- Success, fail, and cancel URL handling
- Order validation
- Sandbox mode support
- Multiple payment methods support
- EMI payment support
- Customizable payment forms
- Comprehensive error handling

Requirements
------------

[](#requirements)

- PHP &gt;= 7.4
- Laravel &gt;= 8.0
- SSLCommerz merchant account

Installation
------------

[](#installation)

1. Install the package via Composer:

```
composer require faysal0x1/lara-payment
```

2. Publish the configuration file:

```
php artisan vendor:publish --provider="Faysal0x1\LaraPayment\SslcommerzLaravelServiceProvider" --tag="config"
```

3. Publish the controller:

```
php artisan vendor:publish --provider="Faysal0x1\LaraPayment\SslcommerzLaravelServiceProvider" --tag="controllers"
```

4. Publish the views:

```
php artisan vendor:publish --provider="Faysal0x1\LaraPayment\SslcommerzLaravelServiceProvider" --tag="views"
```

5. Publish the migrations:

```
php artisan vendor:publish --provider="Faysal0x1\LaraPayment\SslcommerzLaravelServiceProvider" --tag="migrations"
```

6. Run the migrations:

```
php artisan migrate
```

Configuration
-------------

[](#configuration)

Add the following environment variables to your `.env` file:

```
SSLCOMMERZ_SANDBOX=true
SSLCOMMERZ_STORE_ID=your_store_id
SSLCOMMERZ__STORE_PASSWORD=your_store_password
```

The configuration file (`config/sslcommerz.php`) contains the following options:

```
return [
    'sandbox' => env("SSLCOMMERZ_SANDBOX", false),
    'middleware' => 'web',
    'store_id' => env("SSLCOMMERZ_STORE_ID"),
    'store_password' => env("SSLCOMMERZ__STORE_PASSWORD"),
    'success_url' => '/sslcommerz/success',
    'failed_url' => '/sslcommerz/fail',
    'cancel_url' => '/sslcommerz/cancel',
    'ipn_url' => '/sslcommerz/ipn',
    'return_response' => 'html', // html or json
];
```

Usage
-----

[](#usage)

### Basic Payment Integration

[](#basic-payment-integration)

1. Using the Facade:

```
use Faysal0x1\LaraPayment\Facade\SSLCommerzPayment;

// Make payment
$data = [
    'total_amount' => 100,
    'currency' => 'BDT',
    'tran_id' => uniqid(),
    'product_category' => 'Test Category'
];

$customer = [
    'name' => 'John Doe',
    'email' => 'john@example.com',
    'address_1' => 'Dhaka',
    'phone' => '8801XXXXXXXXX',
    'country' => 'Bangladesh'
];

$shipment = [
    'shipping_method' => 'Yes',
    'ship_name' => 'John Doe',
    'ship_add1' => 'Dhaka',
    'ship_city' => 'Dhaka',
    'ship_country' => 'Bangladesh'
];

$response = SSLCommerzPayment::makePayment($data)
    ->setCustomerInfo($customer)
    ->setShipmentInfo($shipment);
```

2. Using the Controller:

Visit `/example1` for AJAX payment or `/example2` for hosted payment.

### Available Routes

[](#available-routes)

```
Route::get('/example1', [SslCommerzPaymentController::class, 'exampleEasyCheckout']);
Route::get('/example2', [SslCommerzPaymentController::class, 'exampleHostedCheckout']);
Route::post('/pay', [SslCommerzPaymentController::class, 'index']);
Route::post('/pay-via-ajax', [SslCommerzPaymentController::class, 'payViaAjax']);
Route::post('/success', [SslCommerzPaymentController::class, 'success']);
Route::post('/fail', [SslCommerzPaymentController::class, 'fail']);
Route::post('/cancel', [SslCommerzPaymentController::class, 'cancel']);
Route::post('/ipn', [SslCommerzPaymentController::class, 'ipn']);
```

### Advanced Features

[](#advanced-features)

1. EMI Payment Support:

```
$sslc = new SslCommerzNotification();
$sslc->enableEMI(3, 12, false); // 3 months installment, max 12 months, not restricted to EMI only
```

2. Airline Ticket Profile:

```
$airlineInfo = [
    'hours_till_departure' => '24',
    'flight_type' => 'domestic',
    'pnr' => 'ABC123',
    'journey_from_to' => 'Dhaka to Chittagong'
];
$sslc->setAirlineTicketProfile($airlineInfo);
```

3. Travel Vertical Profile:

```
$travelInfo = [
    'hotel_name' => 'Grand Hotel',
    'length_of_stay' => 3,
    'check_in_time' => '14:00',
    'hotel_city' => 'Dhaka'
];
$sslc->setTravelVerticalProfile($travelInfo);
```

4. Telecom Vertical Profile:

```
$telecomInfo = [
    'product_type' => 'prepaid',
    'topup_number' => '8801XXXXXXXXX',
    'country_topup' => 'Bangladesh'
];
$sslc->setTelecomVerticleProfile($telecomInfo);
```

### Response Handling

[](#response-handling)

1. Success Response:

```
return SSLCommerzPayment::returnSuccess($transId, "Transaction is successfully Completed", '/');
```

2. Failure Response:

```
return SSLCommerzPayment::returnFail($transId, "Transaction is Failed", '/');
```

Database Structure
------------------

[](#database-structure)

The package creates an `orders` table with the following structure:

```
Schema::create('orders', function (Blueprint $table) {
    $table->id();
    $table->string('name', 191)->nullable();
    $table->string('email', 191)->nullable();
    $table->string('phone', 60)->nullable();
    $table->double('amount')->default(0);
    $table->text('address')->nullable();
    $table->string('status', 20)->default('Pending');
    $table->string('transaction_id', 191);
    $table->string('currency', 20)->nullable()->default('BDT');
    $table->timestamps();
});
```

Security Considerations
-----------------------

[](#security-considerations)

1. Always use environment variables for sensitive data
2. Enable SSL on your production environment
3. Validate all incoming data
4. Use proper error handling
5. Keep your store credentials secure

Testing
-------

[](#testing-1)

1. Set `SSLCOMMERZ_SANDBOX=true` in your `.env` file for testing
2. Use test credentials provided by SSLCommerz
3. Test all payment scenarios (success, fail, cancel)
4. Verify IPN handling
5. Test with different currencies and amounts

Support
-------

[](#support)

For any issues or questions, please create an issue in the GitHub repository.

License
-------

[](#license-1)

This package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance46

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

410d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/64875731?v=4)[MD. Faysal Rahman](/maintainers/faysal0x1)[@faysal0x1](https://github.com/faysal0x1)

---

Top Contributors

[![faysal0x1](https://avatars.githubusercontent.com/u/64875731?v=4)](https://github.com/faysal0x1 "faysal0x1 (17 commits)")

---

Tags

laravelstripelaravel-packagepaymentspayment gatewaypaystackflutterwaveMulti Payment Gatewayslaravel paystackpaystack laravelcybernerdielaravel-multipayment-gatewaysLaravel Multi Payment GatewaysLaravel FlutterwaveFaysal0x1lara-payment

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/faysal0x1-lara-payment/health.svg)

```
[![Health](https://phpackages.com/badges/faysal0x1-lara-payment/health.svg)](https://phpackages.com/packages/faysal0x1-lara-payment)
```

###  Alternatives

[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

882.2k1](/packages/musahmusah-laravel-multipayment-gateways)[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M165](/packages/spatie-laravel-health)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5021.9k](/packages/simplestats-io-laravel-client)[nativephp/mobile

NativePHP for Mobile

1.1k75.1k93](/packages/nativephp-mobile)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.8k3](/packages/defstudio-telegraph)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
