PHPackages                             rublex/laravel-doku-gateway - 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. rublex/laravel-doku-gateway

ActiveLibrary[Payment Processing](/categories/payments)

rublex/laravel-doku-gateway
===========================

A Laravel payment gateway package for DOKU

1.0.0(1mo ago)042MITPHP

Since Jul 11Pushed 1mo agoCompare

[ Source](https://github.com/rublexgit/laravel-doku-gateway)[ Packagist](https://packagist.org/packages/rublex/laravel-doku-gateway)[ RSS](/packages/rublex-laravel-doku-gateway/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (10)Versions (3)Used By (0)

Laravel DOKU Gateway
====================

[](#laravel-doku-gateway)

[![Latest Version](https://camo.githubusercontent.com/34e695c6016bc2a934a96bed696e29b2f2ab562a7134d65a55d00653cd506bea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e302d626c75652e737667)](https://packagist.org/packages/rublex/laravel-doku-gateway)[![License](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](LICENSE)

A Laravel payment gateway package for DOKU (DOKU Checkout, Non-SNAP) integration.

Features
--------

[](#features)

- Payment initiation (hosted **DOKU Checkout / Redirect** flow)
- Independent transaction verification via the Check Status API
- Secure callback route with single-use keys and idempotent forwarding
- Configurable via environment variables
- Built on `rublex/laravel-core-gateway` contracts

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

[](#installation)

```
composer require rublex/laravel-doku-gateway
```

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

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish --provider="Doku\DokuServiceProvider" --tag="doku-config"
```

Add credentials to your `.env` file:

```
DOKU_BASE_URL=https://api-sandbox.doku.com
DOKU_CLIENT_ID=
DOKU_SECRET_KEY=
```

> Use `https://api.doku.com` for production. The `Client ID` and `Secret Key` are found in the DOKU Back Office. The Secret Key is the HMAC signing key — it is not the Client ID.

Quick Start
-----------

[](#quick-start)

```
use Doku\Services\DokuGatewayService;
use Rublex\CoreGateway\Data\DynamicDataBag;
use Rublex\CoreGateway\Data\PaymentRequestData;

$gateway = app(DokuGatewayService::class);

$result = $gateway->initiate(new PaymentRequestData(
    gatewayCode: $gateway->code(),
    orderId: 'INV-1774369486',
    amount: '150000',
    currency: 'IDR',
    callbackUrl: 'https://example.com/payment/final-callback',
    meta: new DynamicDataBag([
        'return_url' => 'https://example.com/thank-you',
        'cancel_url' => 'https://example.com/cancelled',
        'payment_due_date' => 60,
        'buyer_name' => 'Putu Made',
        'buyer_email' => 'buyer@example.com',
        'buyer_phone' => '628121212121',
    ])
));

// PaymentInitResultData:
//   status()           => PaymentStatus::PENDING
//   transactionId()    => DOKU session_id
//   redirectUrl()      => DOKU Checkout page URL (redirect the payer here)
//   gatewayReference() => DOKU token_id
//   raw()              => full provider payload
```

Redirect the payer to `redirectUrl()`. DOKU sends an HTTP Notification to the package callback route when the payment completes; the verified outcome is then forwarded to your `callbackUrl`.

Currency
--------

[](#currency)

DOKU settles in **IDR only**. `initiate()` throws a `ValidationException` for any other currency. The amount is expected to already be denominated in IDR and is rounded to a whole rupiah (IDR has no minor units).

Signature (Non-SNAP)
--------------------

[](#signature-non-snap)

Both request and notification signatures use the same scheme:

```
component = "Client-Id:...\nRequest-Id:...\nRequest-Timestamp:...\nRequest-Target:[\nDigest:]"
Signature = "HMACSHA256=" . base64(hmac_sha256(component, SECRET_KEY))

```

- The `Digest` line is present for requests carrying a body (POST) only.
- `Request-Target` is the endpoint path (for notifications, the callback path).
- The secret is the DOKU Secret Key, not the Client ID.

Backward Compatibility
----------------------

[](#backward-compatibility)

- `verifyPayment()` and `getPaymentStatus()` are explicit package methods and still throw not-implemented exceptions — status is confirmed internally via the Check Status API during callback handling.

Documentation
-------------

[](#documentation)

For installation and usage instructions, see [USAGE.md](USAGE.md).

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance92

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

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

39d ago

### Community

Maintainers

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

---

Tags

laravelpaymentgatewayDokurublex

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rublex-laravel-doku-gateway/health.svg)

```
[![Health](https://phpackages.com/badges/rublex-laravel-doku-gateway/health.svg)](https://phpackages.com/packages/rublex-laravel-doku-gateway)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

79227.1M230](/packages/laravel-mcp)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9922.4M146](/packages/roots-acorn)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k161.4k2](/packages/mike-bronner-laravel-model-caching)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

265.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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