Download the PHP package unipay/unipay-bd without Composer

On this page you can find all versions of the php package unipay/unipay-bd. 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 unipay-bd

Laravel Logo

UniPay BD โ€” Unified Bangladesh Payment Gateway & SaaS Billing for Laravel

The ultimate unified Laravel payment gateway & SaaS recurring billing engine for Bangladeshi MFS & Card Gateways (bKash, Nagad, Rocket, Upay, CellFin, SSLCommerz, Shurjopay & aamarPay).

Package Version License PHP Version Laravel Version Tests


๐Ÿ“Œ Table of Contents


๐Ÿš€ Overview

UniPay BD (unipay/unipay-bd) provides a seamless, developer-friendly driver-based payment integration and SaaS recurring subscription engine for Laravel applications operating in Bangladesh.

Inspired by Laravel's native driver pattern (FilesystemManager, CacheManager, Laravel Cashier), UniPay standardizes bKash, Nagad, Rocket, Upay, CellFin, SSLCommerz, Shurjopay, and aamarPay into an elegant, unified API syntax with complete support for Multi-Tenancy, Subscriptions, Wallets, FX Conversion, and Fraud Prevention.


๐Ÿ’ณ Supported Payment Gateways

UniPay BD natively supports 8 Bangladeshi payment providers + 1 offline mock driver:

Gateway Driver Provider / Channel Protocol & Security Supported Operations
bKash bkash bKash PGW Tokenized REST API v1.2 with Bearer token caching Single Payment, Agreement Recurring, Query, Refund
Nagad nagad Nagad MFS RSA OpenSSL Public Key Encryption & Private Key Signing Create, Complete, Verify, Refund
Rocket rocket Dutch-Bangla Bank (DBBL) Merchant API v1 with Terminal ID Create, Verify, Refund
Upay upay UCB Fintech Bearer Token REST API Create, Verify, Refund
CellFin cellfin Islami Bank (IBBL) Reference ID Checkout API Create, Verify, Refund
SSLCommerz sslcommerz SSL Wireless GWProcess v4 API & Validation API Create, Validate, Refund
Shurjopay shurjopay ShurjoMukhi Shurjopay API v2 Tokenized Create, Verify, Refund
aamarPay aamarpay aamarPay PGW Signature Key Secure JSON API Create, Query, Refund
Mock Driver mock Local Offline Test Zero-credential sandbox simulation Instant Create, Query, Refund

๐ŸŒŸ What's New in v2.0


โš™๏ธ Requirements


๐Ÿ“ฆ Installation

Install the package via Composer:

Run the Artisan installer to publish configuration and run database migrations:


๐Ÿ”ง Configuration

Add your payment gateway credentials to your application's .env file:


โšก Quick Start & Core Usage

1. Fluent Payment Initiation

You can construct a payment using the fluent PaymentRequest::builder():


2. Callbacks & Webhooks

UniPay automatically registers a unified callback route at /unipay/callback/{gateway}. When a customer finishes payment, the gateway redirects back to this endpoint, where UniPay verifies transaction status and dispatches events.


3. Listen to Payment Events

Decouple your order processing logic by listening to UniPay events in App\Providers\EventServiceProvider.php (or via Laravel 11 auto-discovery):


4. Process Refunds

Issue full or partial refunds directly:


5. Query Payment Status

Query any transaction status explicitly at any time:


๐Ÿข SaaS & Multi-Tenancy Architecture

UniPay BD v2.0 is built from the ground up to support multi-tenant SaaS applications where different tenants/vendors have their own merchant accounts or where platform fees must be retained.

Multi-Tenant Gateway Routing

Define a global tenant resolver in your AppServiceProvider:

Then initiate payments scoped to the tenant:

Runtime Gateway Config Overrides

You can also override credentials on the fly without using the tenant resolver:


๐Ÿ” Subscriptions & Recurring Billing (Cashier-Style)

UniPay BD provides an expressive, Cashier-inspired recurring billing engine using bKash Tokenized Agreements or automatic wallet deductions.

Using the Billable Trait

Add the Billable trait to your User or Organization model:

Create and Manage Subscriptions

Automatic Billing Cron Worker

UniPay provides a console command to automatically charge all active subscriptions that are due for renewal:

Schedule it in your routes/console.php (Laravel 11) or app/Console/Kernel.php (Laravel 10):


๐Ÿ”— Hosted Payment Links

Create instant, shareable payment links for invoices, donations, or custom orders:

When opened in a browser, customers see a clean checkout portal where they can pick a payment method. Alternatively, your frontend can fetch it via JSON:


๐Ÿ‘› Virtual Wallets & Credits

Enable micro-transactions, customer top-ups, and in-app credit systems:


๐Ÿ’ฑ Currency Conversion & FX Buffering

If your SaaS charges in USD, EUR, or GBP, UniPay converts international currencies to BDT with an optional safety margin buffer:


๐Ÿ›ก๏ธ Anti-Fraud & Rate-Limiting (UniPayShield)

Protect your platform from rapid bot carding and spam payments:

Throws \Unipay\BD\Exceptions\UnipayException if suspicious velocity or blacklisted identity is detected.


๐ŸŽจ Drop-in Checkout Blade Component

Render a ready-to-use payment selector widget in any Blade template:


๐Ÿฉบ System Health Doctor CLI

Troubleshoot payment issues, verify migrations, validate SSL certificates, and check merchant credentials with a single command:

Sample output:


๐Ÿงช Mock Gateway for Local Testing

Need to test your checkout flow in development or CI without active sandbox credentials?

Use the built-in mock driver:

Or programmatically:


๐Ÿ› ๏ธ Extending with Custom Drivers

You can easily register custom gateway drivers using Payment::extend():


โš ๏ธ Exception & Error Handling

UniPay provides a clean exception hierarchy:


๐Ÿงช Testing

UniPay BD includes a comprehensive test suite with 100% mocked HTTP and database coverage:


๐Ÿ”’ Security

If you discover any security-related issues, please email [email protected] instead of using the public issue tracker.


๐Ÿ“„ License

UniPay BD is open-sourced software licensed under the MIT License.


Crafted with โค๏ธ for the Bangladeshi Developer Community by Atik Hasan.


All versions of unipay-bd with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version ^10.0 || ^11.0
illuminate/contracts Version ^10.0 || ^11.0
guzzlehttp/guzzle Version ^7.5
ext-json Version *
ext-openssl Version *
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 unipay/unipay-bd contains the following files

Loading the files please wait ...