PHPackages                             jagdish-j-p/billdesk-hmac - 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. jagdish-j-p/billdesk-hmac

ActiveLibrary[Payment Processing](/categories/payments)

jagdish-j-p/billdesk-hmac
=========================

Package to integrate BillDesk Payment gateway with HMAC Encryption in Laravel

v1.3.5(3y ago)0912[1 issues](https://github.com/Jagdish-J-P/billdesk-hmac/issues)[1 PRs](https://github.com/Jagdish-J-P/billdesk-hmac/pulls)MITPHPPHP &gt;=7.2

Since Feb 3Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Jagdish-J-P/billdesk-hmac)[ Packagist](https://packagist.org/packages/jagdish-j-p/billdesk-hmac)[ Fund](https://paypal.me/jagdishjptl)[ Fund](https://www.buymeacoffee.com/jagdish.j.ptl)[ RSS](/packages/jagdish-j-p-billdesk-hmac/feed)WikiDiscussions main Synced yesterday

READMEChangelog (1)Dependencies (7)Versions (11)Used By (0)

BillDesk Payment Gateway with HMAC Encryption implementation in Laravel
=======================================================================

[](#billdesk-payment-gateway-with-hmac-encryption-implementation-in-laravel)

Repository has been developed to integrate BillDesk Payment Gateway with HMAC Encryption in Laravel.

This repository is currently in development. There might be some exception.

Become a sponsor
----------------

[](#become-a-sponsor)

[![](.github/assets/support.png)](https://github.com/sponsors/Jagdish-J-P)

Your support allows me to keep this package free, up-to-date and maintainable. Alternatively, you can **[spread the word!](http://twitter.com/share?text=I+am+using+this+cool+PHP+package&url=https://github.com/jagdish-j-p/billdesk-hmac&hashtags=PHP,Laravel,BillDesk)**

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

[](#installation)

You can install the package via composer:

```
composer require jagdish-j-p/billdesk-hmac
```

Then run the publish command to publish the config files and support controller and view

```
php artisan billdesk:publish
```

This will generate the following files

- The config file with default setup for you to override `billdesk.php`
- The controller that will receive payment response and any host-to-host events `Http/Controllers/BilldeskHmac/Controller.php`
- The assets in public directory.
- The view file with default html for you to override `payment.blade.php`. Note do not change form action URL `billdesk.payment.auth.request`.

Setups
------

[](#setups)

1. Add your response urls and your Merchant Id, Client Id and HMAC Key to the `.env` file.

```
BILLDESK_TRANSACTION_RESPONSE_PATH=billdesk/payments/transactions/callback
BILLDESK_MANDATE_RESPONSE_PATH=billdesk/payments/mandates/callback
BILLDESK_WEBHOOK_PATH=billdesk/payments/webhook

BILLDESK_MERCHANT_ID=
BILLDESK_CLIENT_ID=
BILLDESK_HMAC_KEY=
BILLDESK_MERCHANT_LOGO="${APP_URL}/assets/img/logo.jpg"
BILLDESK_RETRY_COUNT=3
BILLDESK_CHILD_WINDOW=false
BILLDESK_ITEM_CODE=DIRECT
BILLDESK_UAT_PREFIX="test-prefix"
```

2. Run migration to add the transactions table

```
php artisan migrate
```

Usage
-----

[](#usage)

1. You can visit [](http://app.test/billdesk/initiate/payment) for the payment flow demo of web integration.
2. Handle the payment response in `Http/Controllers/BilldeskHmac/Controller.php`

```
    /**
     * This will be called after the user approve the mandate
     * @param Request $request
     *
     * @return Response
     */
    public function mandateCallback(MandateModifyResponseRequest $request, $id = null)
    {
        $response = $request->handle($id);

        if ($response['response_format'] == 'JSON') {
            return response()->json(['response' => $response, 'billdesk_response' => $request->all()]);
        }

        dd($response, $request); // Remove this line and modify as per your needs.
    }

    /**
     * This will be called after the user approve the payment
     * on the bank side
     *
     * @param Request $request
     * @return Response
     */
    public function callback(Request $request)
    {
        $response = $request->handle();

        if ($response['response_format'] == 'JSON')
            return response()->json(['response' => $response, 'billdesk_response' => $request->all()]);

        dd($response, $request); // Remove this line and modify as per your needs.
        // Update your order status
    }

    /**
     * This will handle any direct call from BillDesk
     *
     * @param Request $request
     * @return string
     */
    public function webhook(Request $request)
    {
        $response = $request->handle();

        // Update your order status

        return 'OK';
    }

```

3. Check Status of all pending transactions using command

```
php artisan billdesk:transaction-status
```

4. Check Status of specific transaction using command pass comma saperated order reference ids.

```
php artisan billdesk:transaction-status --orderid=orderid1 --orderid=orderid2 --orderid=orderid3
```

5. Check transaction status from Controller

```
use JagdishJP\BilldeskHmac\Facades\BilldeskHmac;

/**
 * Returns status of transaction
 *
 * @param string $orderid reference order id
 * @return array
 */
$status = BilldeskHmac::getTransactionStatus($orderid);
```

You can also override `payment.blade.php` with your custom design to integrate with your layout. but do not change `name` attribute of html controls and `action` URL of form.

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Contrubuters are welcome and will be given full credit.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Jagdish-J-P](https://github.com/jagdish-j-p)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

Packagify
---------

[](#packagify)

This package was generated using the [Packagify](https://github.com/jagdish-j-p/packagify).

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.1% 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 ~12 days

Recently: every ~2 days

Total

9

Last Release

1152d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4e7c021b8f19406056e9a24ec8d268cec00f1a9d77bd72d8cc5cb0a6fbc6a178?d=identicon)[Jagdish-J-P](/maintainers/Jagdish-J-P)

---

Top Contributors

[![Jagdish-J-P](https://avatars.githubusercontent.com/u/20887370?v=4)](https://github.com/Jagdish-J-P "Jagdish-J-P (58 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")

---

Tags

billdeskhmac-authenticationhmac-sha256payment-gatewaypayment-integration

### Embed Badge

![Health badge](/badges/jagdish-j-p-billdesk-hmac/health.svg)

```
[![Health](https://phpackages.com/badges/jagdish-j-p-billdesk-hmac/health.svg)](https://phpackages.com/packages/jagdish-j-p-billdesk-hmac)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[pantheon-systems/terminus

A command line interface for Pantheon

3391.5M18](/packages/pantheon-systems-terminus)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M577](/packages/shopware-core)[buckaroo/sdk

Buckaroo payment SDK

12233.3k15](/packages/buckaroo-sdk)

PHPackages © 2026

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