iamtiqbal/bkash-php-sdk 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

iamtiqbal/bkash-php-sdk

Composer 安装命令:

composer require iamtiqbal/bkash-php-sdk

包简介

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

README 文档

README

⚠️ 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 — IT Manager & 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

Features

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

Requirements

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

Installation

Composer

composer require iamtiqbal/bkash-php-sdk

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

  • 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

Authentication

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

Initiate Payment

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

Handle Callback

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

Check Transaction Status

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

Utilities

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

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

  • Completed = Success
  • Other = Failed/Cancelled

Gotchas & Troubleshooting

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

Security Notes

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

Testing

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

License

MIT License. See LICENSE file for details.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 7
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固