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

ActiveLibrary[Payment Processing](/categories/payments)

raselswe/bkash
==============

RaselSwe Bkash is payment gateway to accpent and refund bkash payment in marchent account

v1.0.2(2y ago)08MITPHP

Since Jul 29Pushed 2y ago1 watchersCompare

[ Source](https://github.com/RaselHasanSwe/laravel-bkash)[ Packagist](https://packagist.org/packages/raselswe/bkash)[ RSS](/packages/raselswe-bkash/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

Laravel Bkash Payment
=====================

[](#laravel-bkash-payment)

Laravel Bkash is a Laravel package that makes it easy to take bkash payment from customer and also refund payment to bkash account.

- Developer can integrate bkash payment very easy to his laravel application
- bkash payment and refund payment available in this package.

Installing Bkash Payment
------------------------

[](#installing-bkash-payment)

The recommended way to install Bkash

```
composer require raselswe/bkash
```

Setup Pakage
------------

[](#setup-pakage)

```
php artisan vendor:publish --provider="RaselSwe\Bkash\BkashServiceProvider"
```

You will get bkash.php file in your config directory.

Config .env or bkash.php file with required information
-------------------------------------------------------

[](#config-env-or-bkashphp-file-with-required-information)

```
// COPY AND PAST THIS CODE CONFIG CODE TO .env FILE OR SET CREDENTIAL TO config/bkash.php

BKASH_SENDBOX_BASE_URL = 'https://tokenized.*******'
BKASH_LIVE_BASE_URL = 'https://tokenized.pay.*********'
BKASH_USER_NAME = '****************'
BKASH_PASSWORD = '******************'
BKASH_APP_KEY = '******************'
BKASH_APP_SECRET ='*************'
BKASH_CALLBACK_URL = 'http://127.0.0.1:8000/bkash/execute-payment'
BKASH_PAYMENT_MODE = 'sendbox'  // in live mode set here 'live'

// TEST YOUR BKASH PAYMENT -- EXAMPLE CODE -- web.php

Route::get('/bkash/pay', [BkashPaymentController::class, 'pay']);
Route::get('/bkash/execute-payment', [BkashPaymentController::class, 'confirmPayment']); // This is callback url
Route::get('/bkash/refund-payment', [BkashPaymentController::class, 'refundPayment']);

// BkashPaymentController.php

namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use RaselSwe\Bkash\Payment;
use Illuminate\Http\Request;

class BkashPaymentController extends Controller
{
    public function pay( Payment $bkashPayment )
    {
        $paymentUrl = $bkashPayment->init(200);
        if($paymentUrl['error'] === true){
            //handle error with view page
            dd($paymentUrl);
        }
        return redirect($paymentUrl['payment_url']);
    }

    public function confirmPayment( Request $request, Payment $bkashPayment )
    {
        $executePayment = $bkashPayment->callback($request);
        if($executePayment['success'] === true){
            //$paymentID = $executePayment['response']['paymentID'];
            //$trxID = $executePayment['response']['trxID'];
            // MAKE DB OPERATION HERE
            dd($executePayment);
        }else{
            //handle payment cancel with message
            // $message = $executePayment['message']
            dd($executePayment);
        }
    }

    public function refundPayment( Request $request, Payment $bkashPayment )
    {
        $body_data = array(
            'paymentID' => $request->paymentID ?? 'TR0011drkTg341689422678392',
            'amount' => $request->amount ?? 1,
            'trxID' => $request->trxID ?? 'AGF20BG9YW',
            'sku' => 'sku',
            'reason' => $request->reason ?? 'Test Reason'
        );

        $refund = $bkashPayment->refundPayment($body_data);
        if($refund['success'] === true){
            // DB operation or your logic
            dd($refund);
        }else{
            //handle cancel refund
            dd($refund);
        }

    }
}
```

License
-------

[](#license)

LaravelBkash is made available under the MIT License (MIT).

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

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

3

Last Release

1016d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3fb55f2e7784b47cb85c4a4bd73aaa1bee976caea4c2803cfdb7ee3992e34d55?d=identicon)[RaselHasanSwe](/maintainers/RaselHasanSwe)

---

Top Contributors

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

---

Tags

phplaravelbkashbkash-paymentlaravel-bkash-payment

### Embed Badge

![Health badge](/badges/raselswe-bkash/health.svg)

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

###  Alternatives

[karim007/laravel-bkash-tokenize

This is bKash tokenize payment gateway for laravel

2221.1k](/packages/karim007-laravel-bkash-tokenize)

PHPackages © 2026

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