PHPackages                             iamtiqbal/bkash-php-sdk - 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. iamtiqbal/bkash-php-sdk

ActiveLibrary

iamtiqbal/bkash-php-sdk
=======================

Unofficial PHP SDK and Laravel package for integrating bKash payment gateway in Bangladesh.

00PHP

Since Mar 18Pushed 1mo agoCompare

[ Source](https://github.com/IamTIqbal/bkash-php-sdk)[ Packagist](https://packagist.org/packages/iamtiqbal/bkash-php-sdk)[ RSS](/packages/iamtiqbal-bkash-php-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

bKash PHP SDK &amp; Laravel Package (Unofficial)
================================================

[](#bkash-php-sdk--laravel-package-unofficial)

⚠️ Disclaimer
This is an unofficial community-driven integration for bKash Tokenized Checkout.
This project is not affiliated with or endorsed by bKash or Bangladesh Bank.

> **Developer:** [Tamim Iqbal](https://tamimiqbal.com) — IT Manager &amp; AI Developer

A PHP SDK and Laravel package for **bKash Tokenized Checkout** (Bangladesh). Easily integrate bKash payments in any PHP or Laravel application.

Table of Contents
-----------------

[](#table-of-contents)

- [Features](#features)
- [Requirements](#requirements)
- [Installation](#installation)
- [Quick Start](#quick-start)
- [API Reference](#api-reference)
    - [Authentication](#authentication)
    - [Initiate Payment](#initiate-payment)
    - [Handle Callback](#handle-callback)
    - [Check Transaction Status](#check-transaction-status)
    - [Utilities](#utilities)
- [Payment Flow](#payment-flow)
- [Status Codes](#status-codes)
- [Gotchas &amp; Troubleshooting](#gotchas--troubleshooting)
- [Security Notes](#security-notes)
- [Testing](#testing)
- [License](#license)

Features
--------

[](#features)

- Unofficial bKash gateway for PHP &amp; Laravel
- Secure API communication with bKash Tokenized Checkout
- Redirect-based payment flow with callback handling
- Example usage for both plain PHP and Laravel

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

[](#requirements)

- PHP 7.4+ with cURL enabled
- For Laravel: Laravel 8+ (recommended)

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

[](#installation)

### Composer

[](#composer)

```
composer require iamtiqbal/bkash-php-sdk

```

### Manual Installation

[](#manual-installation)

1. Download or clone this repository: ```
    git clone https://github.com/IamTIqbal/bkash-php-sdk.git

    ```
2. Copy the `src/` folder into your project.
3. (For Laravel) Copy `config/bkash.php` to your config directory.
4. (For plain PHP) Copy `examples/php-config.php` and update with your credentials.
5. Require the classes in your code: ```
    require_once '/path/to/src/BkashClient.php';
    ```
6. Follow the usage examples in the README or `examples/` folder.

Quick Start
-----------

[](#quick-start)

- Configure your credentials (see config/bkash.php or examples/php-config.php)
- Initiate a payment using the SDK
- Redirect user to bKash
- Handle callback for payment confirmation

API Reference
-------------

[](#api-reference)

### Authentication

[](#authentication)

Authenticate using your bKash Tokenized Checkout credentials. See `BkashClient::getIdToken()`.

### Initiate Payment

[](#initiate-payment)

Create a payment and get the redirect URL. See `BkashClient::createPayment()`.

### Handle Callback

[](#handle-callback)

Handle the callback from bKash and execute the payment. See `BkashClient::executePayment()`.

### Check Transaction Status

[](#check-transaction-status)

Handled by `executePayment` during callback. Inspect the returned data for transaction status.

### Utilities

[](#utilities)

- Invoice generation (see examples)
- Payment metadata (extend as needed)

Payment Flow
------------

[](#payment-flow)

1. Customer initiates checkout
2. SDK authenticates and creates payment
3. Customer is redirected to bKash
4. bKash redirects to your callback URL
5. SDK executes payment and confirms status

Status Codes
------------

[](#status-codes)

- `Completed` = Success
- Other = Failed/Cancelled

Gotchas &amp; Troubleshooting
-----------------------------

[](#gotchas--troubleshooting)

- Store currency must be **BDT**
- Use correct credentials (test vs production)
- Ensure SSL is enabled for callback URL

Security Notes
--------------

[](#security-notes)

- Never hardcode credentials in code
- Use HTTPS for all callbacks and checkout pages

Testing
-------

[](#testing)

- Use bKash sandbox credentials for testing
- Test full payment flow (initiate, redirect, callback)

License
-------

[](#license)

MIT License. See LICENSE file for details.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance63

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/390ea4cda58e73946f5d33932c0079d999848318c5dc118eb1df0735fb260ddc?d=identicon)[IamTIqbal](/maintainers/IamTIqbal)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/iamtiqbal-bkash-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/iamtiqbal-bkash-php-sdk/health.svg)](https://phpackages.com/packages/iamtiqbal-bkash-php-sdk)
```

PHPackages © 2026

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