PHPackages                             otnansirk/laravel-dana - 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. otnansirk/laravel-dana

ActiveLibrary[Payment Processing](/categories/payments)

otnansirk/laravel-dana
======================

This Laravel wrapper for DANA Payment API

v3.0.0(9mo ago)333705MITPHPPHP ^8.1

Since Nov 1Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/otnansirk/laravel-dana)[ Packagist](https://packagist.org/packages/otnansirk/laravel-dana)[ GitHub Sponsors](https://github.com/otnansirk)[ RSS](/packages/otnansirk-laravel-dana/feed)WikiDiscussions 3.x Synced 1mo ago

READMEChangelog (7)Dependencies (4)Versions (13)Used By (0)

Laravel DANA Payment Package
============================

[](#laravel-dana-payment-package)

This Laravel wrapper/library for DANA Payment API. Visit  for more information about the product and see documentation at  for more technical details.

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

[](#requirements)

- PHP 8.1 or higher
- Laravel 9.x, 10.x, 11.x, or 12.x

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

[](#installation)

#### 1. You can install the package via composer.

[](#1-you-can-install-the-package-via-composer)

```
composer require otnansirk/laravel-dana
```

#### 2. The service provider will automatically get registered. Or you may manually add the service provider in your `config/app.php` file.

[](#2-the-service-provider-will-automatically-get-registered-or-you-may-manually-add-the-service-provider-in-your-configappphp-file)

```
'providers' => [
    // ...
    Otnansirk\Dana\DanaCoreServiceProvider::class,
];
```

#### 3. You should publish the `config/dana.php` config file with this php artisan command.

[](#3-you-should-publish-the-configdanaphp-config-file-with-this-php-artisan-command)

```
php artisan vendor:publish --provider="Otnansirk\Dana\DanaCoreServiceProvider" --tag="dana-config"
```

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

[](#configuration)

All configuration are stored in `config/dana.php`. Customize everything you need.

Make sure to set the following environment variables in your `.env` file:

```
DANA_ENV=development
DANA_ACTIVE=false
DANA_API_URL=https://api-sandbox.saas.dana.id
DANA_WEB_URL=https://m.sandbox.dana.id
DANA_MARCHANT_ID=your_merchant_id
DANA_CLIENT_ID=your_client_id
DANA_CLIENT_SECRET=your_client_secret
DANA_ORDER_NOTIFY_URL=your_notify_url
DANA_PAY_RETURN_URL=your_return_url
DANA_PUB_KEY=your_public_key
DANA_PRIVATE_KEY=your_private_key
```

Usage
-----

[](#usage)

### 1. Create order | `DANAPay::createOrder($orderData)`

[](#1-create-order--danapaycreateorderorderdata)

```
$orderData = [
    "order" => [
        "orderTitle" => "Dummy product",
        "orderAmount" => [
            "currency" => "IDR",
            "value" => "100"
        ],
        "merchantTransId" => "201505080001",
        "merchantTransType" => "dummy transaction type",
        "orderMemo" => "Memo",
        "goods" => [
            [
                "merchantGoodsId" => "24525635625623",
                "description" => "dummy description",
                "category" => "dummy category",
                "price" => [
                    "currency" => "IDR",
                    "value" => "100"
                ],
                "unit" => "Kg",
                "quantity" => "3.2",
                "merchantShippingId" => "564314314574327545",
                "snapshotUrl" => "[http://snap.url.com]",
                "extendInfo" => [
                    "key" => "value",
                ]
            ]
        ]
    ],
    "merchantId" => "216820000000006553000",
    "subMerchantId" => "12345678",
    "productCode" => "51051000100000000001"
];

DANAPay::createOrder($orderData);
```

About all possible payloads for `$orderData` please check the official DANA documentation.
Ref:

### 2. Get Transaction by acquirementId | `DANAPay::queryOrder($acquirementId)`

[](#2-get-transaction-by-acquirementid--danapayqueryorderacquirementid)

```
$acquirementId = "20240125111212800110166050101920928";
DANAPay::queryOrder($acquirementId);
```

You can get transaction detail and status transaction with this method
Ref:

### 3. Get oAuth URL | `DANAPay::generateOauthUrl($terminalType, $redirectUrl)`

[](#3-get-oauth-url--danapaygenerateoauthurlterminaltype-redirecturl)

```
$terminalType = "WEB";
$redirectUrl  = "https://your-app-url.com/oauth/callback";
DANAPay::generateOauthUrl($terminalType, $redirectUrl);
```

For more information please check the official DANA documentation.
Ref:

### 4. Get Token and Refresh Token | `DANAPay::getToken($authToken)`

[](#4-get-token-and-refresh-token--danapaygettokenauthtoken)

```
$authToken = "your-auth-token";
DANAPay::getToken($authToken);
```

You can get value of `$authToken` from oAuth callback process.
From this function you will receive `token` and `refresh_token`.
Ref:

### 5. Get User Profile | `DANAPay::profile($accessToken)`

[](#5-get-user-profile--danapayprofileaccesstoken)

```
$accessToken = "your_user_profile_access_token";
DANAPay::profile($accessToken);
```

You can get value for `$accessToken` from `DANAPay::getToken` function
Ref:

### 6. Unbinding Access Token | `DANAPay::unBindAllAccount()`

[](#6-unbinding-access-token--danapayunbindallaccount)

```
DANAPay::unBindAllAccount();
```

This function used for revoke or unbind all access token registered from the merchant.
Ref:

### 7. Function for provide callback response

[](#7-function-for-provide-callback-response)

```
$status = true;
DANAPay::responseFinishNotifyCallback($status);
```

This function will generate valid response for DANA API.
`$status` is boolean data type.

### 8. Function for calculation MDR

[](#8-function-for-calculation-mdr)

```
$payAmount = 100000;
$payMethod = 'BALANCE';
DANACalculation::calculateMDR($payAmount, $payMethod);
```

This function will calculate MDR fee for DANA. You will get value `$payMethod` and `$payAmount` from callback DANA.

Testing
-------

[](#testing)

```
composer test
```

Laravel Version Compatibility
-----------------------------

[](#laravel-version-compatibility)

This package supports multiple Laravel versions:

Laravel VersionPHP VersionStatusLaravel 9.xPHP 8.1+✅ SupportedLaravel 10.xPHP 8.1+✅ SupportedLaravel 11.xPHP 8.2+✅ SupportedLaravel 12.xPHP 8.2+✅ SupportedChangelog
---------

[](#changelog)

Please see [CHANGELOG.md](CHANGELOG.md) for a list of what has changed since the last version.

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

[](#contributing)

This project is far from perfect. Many DANA APIs that have not been implemented. I would be very happy if any of you could contribute to this project.

License
-------

[](#license)

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

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance58

Moderate activity, may be stable

Popularity25

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 97.4% 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 ~92 days

Recently: every ~141 days

Total

12

Last Release

278d ago

Major Versions

v1.0.0 → v2.0.02023-07-17

2.x-dev → 3.x-dev2025-08-14

### Community

Maintainers

![](https://www.gravatar.com/avatar/ed75e1d144306f1723ecced0981c684ee7702fe4cb3ab538139b04d6f239d471?d=identicon)[otnansirk](/maintainers/otnansirk)

---

Top Contributors

[![otnansirk](https://avatars.githubusercontent.com/u/30102523?v=4)](https://github.com/otnansirk "otnansirk (38 commits)")[![wachidmudi](https://avatars.githubusercontent.com/u/15440315?v=4)](https://github.com/wachidmudi "wachidmudi (1 commits)")

---

Tags

danalaravellaravel-danalaravel-dana-payment-gatewaylaravel-packagepackagespayment-gatewaypayment-integrationpayment-methodspaymentpayment gatewayotnansirklaravel-DANADANA Laraveldana payment gateway

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/otnansirk-laravel-dana/health.svg)

```
[![Health](https://phpackages.com/badges/otnansirk-laravel-dana/health.svg)](https://phpackages.com/packages/otnansirk-laravel-dana)
```

###  Alternatives

[shetabit/multipay

PHP Payment Gateway Integration Package

291348.2k3](/packages/shetabit-multipay)[tsaiyihua/laravel-linepay

linepay library for laravel

102.9k](/packages/tsaiyihua-laravel-linepay)

PHPackages © 2026

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