PHPackages                             najmul/bkash-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. najmul/bkash-payment

ActiveLibrary[Payment Processing](/categories/payments)

najmul/bkash-payment
====================

Laravel package for bKash payment integration

v1.0.0(1y ago)03MITPHPPHP ^7.4|^8.0

Since Apr 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/dev-najmul-islam/bkash-payment)[ Packagist](https://packagist.org/packages/najmul/bkash-payment)[ RSS](/packages/najmul-bkash-payment/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Laravel bKash Payment Integration
=================================

[](#laravel-bkash-payment-integration)

A Laravel package to easily integrate bKash payment gateway into your application.
Built and maintained by **Najmul**.

---

📦 Installation
--------------

[](#-installation)

Install the package via Composer:

```
composer require najmul/bkash-payment:^1.0

⚙️ Configuration
If you're using Laravel 5.5+ with package auto-discovery, you're good to go.

Otherwise, manually register the service provider in config/app.php:

php

'providers' => [
    Najmul\BkashPayment\BkashServiceProvider::class,
];
🛠️ Environment Setup
Add the following to your .env file:

env

SANDBOX=true
BKASH_USERNAME=your_username
BKASH_PASSWORD=your_password
BKASH_APP_KEY=your_app_key
BKASH_APP_SECRET=your_app_secret

🚀 Usage
Once installed, the following routes are available in your Laravel application.

🔹 User Routes

Route	Description

/bkash-pay	Display payment form
/bkash-create	Create bKash payment
/bkash-callback	Handle payment callback
🔹 Admin Routes

Route	Description
/bkash-refund	View refund form
/bkash-refund (POST)	Process refund
/bkash-search	View transaction search form
/bkash-search (POST)	Search transaction
/bkash-query/{paymentID}	Query payment status by ID

📂 Views
The package includes basic Blade views for:

bkash.pay — Payment Form

bkash.success — Payment Success

bkash.fail — Payment Failed

bkash.refund — Refund Form

bkash.search — Search Form

To customize them, publish the views:

bash
php artisan vendor:publish --provider="Najmul\BkashPayment\BkashServiceProvider"
Views will be published to:

resources/views/vendor/bkash/

Publish the Views
php artisan vendor:publish --provider="Najmul\BkashPayment\BkashServiceProvider" --tag=views

🧠 How It Works
Token is fetched and stored in the bkash_token DB table.

Uses cURL to interact with bKash API endpoints.

Token refresh & caching are handled automatically.

Supports sandbox and live mode via .env.

✅ Testing
Enable sandbox mode in .env:

env

SANDBOX=true
Then simulate transactions using bKash's sandbox credentials.

📜 License
This package is open-sourced software licensed under the MIT license.

🙌 Author
Najmul Islam
GitHub: dev-najmul-islam
Email: devnajmulislam52@gmail.com
Laravel ❤️ bKash

Sandbox Testing

SANDBOX          = true
BKASH_USERNAME   = '01770618567'
BKASH_PASSWORD   = 'D7DaC
