PHPackages                             helmab/bakong - 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. helmab/bakong

ActiveLibrary[Payment Processing](/categories/payments)

helmab/bakong
=============

Laravel package for Bakong Open API (National Bank of Cambodia)

1.0.0(2mo ago)01MITPHPPHP ^8.1

Since Mar 3Pushed 2mo agoCompare

[ Source](https://github.com/HELMAB/laravel-bakong)[ Packagist](https://packagist.org/packages/helmab/bakong)[ RSS](/packages/helmab-bakong/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

Laravel Bakong
==============

[](#laravel-bakong)

[![Latest Version on Packagist](https://camo.githubusercontent.com/40735359d132ef907b871db33b168527de28466e3c4e8366ad4cd3bb1e07ae3a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f68656c6d61622f62616b6f6e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/helmab/bakong)[![Total Downloads](https://camo.githubusercontent.com/e8996080fa0941c4e5eb4c5d76cdaac73e77c4e912f251b418d230c23b149130/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f68656c6d61622f62616b6f6e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/helmab/bakong)[![License](https://camo.githubusercontent.com/3320ddf357c4f5e90ece850867ac020735ac9fcbce87320e5673583a1a04ccee/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f68656c6d61622f62616b6f6e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/helmab/bakong)

Laravel package for the [Bakong Open API](https://api-bakong.nbc.gov.kh/document) (National Bank of Cambodia).

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

[](#requirements)

- PHP 8.1+
- Laravel 10, 11, or 12

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

[](#installation)

```
composer require helmab/bakong
```

Configuration
-------------

[](#configuration)

Publish the config file:

```
php artisan vendor:publish --tag=bakong-config
```

Add your credentials to `.env`:

```
BAKONG_EMAIL=your-registered-email@example.com
```

Optionally set a token manually to skip auto-renewal:

```
BAKONG_TOKEN=your-token-here
```

Usage
-----

[](#usage)

### Using the Facade

[](#using-the-facade)

```
use Helmab\Bakong\Facades\Bakong;

// Check transaction by MD5
$transaction = Bakong::checkTransactionByMd5('d60f3db96913029a2af979a1662c1e72');

$transaction->hash;
$transaction->fromAccountId;
$transaction->toAccountId;
$transaction->currency;
$transaction->amount;
$transaction->description;
$transaction->createdDateMs;
$transaction->acknowledgedDateMs;
```

### Check Transaction by Hash

[](#check-transaction-by-hash)

```
$transaction = Bakong::checkTransactionByHash('dcd53430d3b3005d9cda36f1fe8dedc3714ccf18f886cf5d090d36fee67ef956');
```

### Check Transaction by Short Hash

[](#check-transaction-by-short-hash)

```
use Helmab\Bakong\Enums\Currency;

$transaction = Bakong::checkTransactionByShortHash('8465d722', 1.0, Currency::USD);
```

### Check Transaction by Instruction Reference

[](#check-transaction-by-instruction-reference)

```
$transaction = Bakong::checkTransactionByInstructionRef('00001234');
```

### Check Transaction by External Reference

[](#check-transaction-by-external-reference)

```
$transaction = Bakong::checkTransactionByExternalRef('DEV123456ZTH');
```

### Check Bakong Account

[](#check-bakong-account)

```
$exists = Bakong::checkBakongAccount('user@bank'); // true or false
```

### Generate Deeplink

[](#generate-deeplink)

```
use Helmab\Bakong\DTOs\DeeplinkSource;

$result = Bakong::generateDeeplink('0002010....');

// With source info
$source = new DeeplinkSource(
    appIconUrl: 'https://example.com/icon.png',
    appName: 'My App',
    appDeepLinkCallback: 'https://example.com/callback',
);

$result = Bakong::generateDeeplink('0002010....', $source);

$result->shortLink; // https://bakong.page.link/...
```

### Batch Check Transactions

[](#batch-check-transactions)

```
// By MD5 list
$items = Bakong::checkTransactionByMd5List([
    '0dbe08d3829a8b6b59844e51aa38a4e2',
    '7b0e5c36486d7155eb3ee94997fe9bfb',
]);

foreach ($items as $item) {
    $item->md5;       // MD5 hash
    $item->status;    // SUCCESS, NOT_FOUND, STATIC_QR
    $item->message;
    $item->data;      // Transaction or null
}

// By hash list
$items = Bakong::checkTransactionByHashList([
    'f0ae142842181535e678900bc5be1c3bd48d567ced77410a169fb672792968c8',
    '9036688e95cb3d1b621a9a989ebe64629d8c118654cfbc47f4d4991d72fc3b44',
]);
```

### Token Renewal

[](#token-renewal)

```
$token = Bakong::renewToken();
```

Token is automatically renewed on the first API call or when a 401 response is received.

Exception Handling
------------------

[](#exception-handling)

```
use Helmab\Bakong\Exceptions\TransactionNotFoundException;
use Helmab\Bakong\Exceptions\TransactionFailedException;
use Helmab\Bakong\Exceptions\AuthenticationException;
use Helmab\Bakong\Exceptions\BakongException;

try {
    $transaction = Bakong::checkTransactionByMd5('...');
} catch (TransactionNotFoundException $e) {
    // Transaction not found (errorCode: 1)
} catch (TransactionFailedException $e) {
    // Transaction failed (errorCode: 3)
} catch (AuthenticationException $e) {
    // Unauthorized (errorCode: 6)
} catch (BakongException $e) {
    // Other API errors
    $e->responseCode;
    $e->errorCode;
    $e->responseMessage;
}
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance85

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

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

Unknown

Total

1

Last Release

77d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/471677a5a12c3838ee579ecfa5352c1def8b95314651338edd4bd62147a2394c?d=identicon)[HEL Mab](/maintainers/HEL%20Mab)

---

Top Contributors

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

---

Tags

bakongcambodiakhqrlaravelnbcpaymentlaravelpaymentbakongkhqrcambodianbc

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/helmab-bakong/health.svg)

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

###  Alternatives

[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4845.9k](/packages/sebdesign-laravel-viva-payments)[henryejemuta/laravel-monnify

A laravel package to seamlessly integrate monnify api within your laravel application

132.1k](/packages/henryejemuta-laravel-monnify)

PHPackages © 2026

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