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

ActiveLibrary[Payment Processing](/categories/payments)

roqianjas/doku-laravel
======================

Reusable Laravel-first integration for DOKU Checkout.

v0.1.1(2mo ago)01MITPHPPHP ^8.3CI failing

Since Apr 8Pushed 2mo agoCompare

[ Source](https://github.com/roqianjas/doku-laravel)[ Packagist](https://packagist.org/packages/roqianjas/doku-laravel)[ RSS](/packages/roqianjas-doku-laravel/feed)WikiDiscussions master Synced 2w ago

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

roqianjas/doku-laravel
======================

[](#roqianjasdoku-laravel)

Reusable Laravel-first integration for DOKU Checkout with Laravel-friendly contracts for checkout creation, status sync, and webhook verification.

What This Package Owns
----------------------

[](#what-this-package-owns)

- DOKU Checkout API request construction and signature generation.
- Non-SNAP status check request construction.
- Incoming webhook signature verification.
- Driver switch between `fake` and real `checkout` modes.
- Status normalization from DOKU provider states into Laravel app-friendly states.

What The Host App Still Owns
----------------------------

[](#what-the-host-app-still-owns)

- Order and payment persistence.
- Route registration for checkout return pages and webhook endpoints.
- CSRF exemption for the webhook route.
- Applying verified webhook payloads into your domain models.
- Trusting proxy headers when the app runs behind public tunnels or reverse proxies.

Install In Another Laravel App
------------------------------

[](#install-in-another-laravel-app)

Add the package with Composer, then publish config.

```
composer require roqianjas/doku-laravel
php artisan vendor:publish --tag=doku-config
```

If you are still developing locally from a monorepo or path repository, keep the current path repository setup and require `roqianjas/doku-laravel` until the package is moved to its own repository.

Detailed Integration Guide
--------------------------

[](#detailed-integration-guide)

If you need a host-app oriented setup guide with examples for checkout, webhook, status sync, and production hardening, read:

- `docs/INTEGRATION_GUIDE.id.md`

Minimal Config
--------------

[](#minimal-config)

```
DOKU_DRIVER=checkout
DOKU_ENV=sandbox
DOKU_CLIENT_ID=your-client-id
DOKU_SECRET_KEY=your-secret-key
DOKU_BASE_URL=https://api-sandbox.doku.com
DOKU_NOTIFICATION_URL=https://your-domain/webhooks/doku
DOKU_PAYMENT_DUE_DATE=60
DOKU_AUTO_REDIRECT=true
DOKU_PAYMENT_METHOD_TYPES=VIRTUAL_ACCOUNT_BRI
```

Core Services
-------------

[](#core-services)

Resolve these contracts from the Laravel container:

- `DokuLaravel\Contracts\CheckoutService`
- `DokuLaravel\Contracts\StatusService`
- `DokuLaravel\Contracts\WebhookVerifier`

Typical host-app usage:

1. Build `CreateCheckoutData` and call `CheckoutService::createCheckout()`.
2. Save checkout metadata into your local payment record.
3. Accept `POST /webhooks/doku` in your host app.
4. Pass headers, raw body, and request path into `WebhookVerifier::parseAndVerify()`.
5. Apply the normalized status to your own payment aggregate.
6. Offer `StatusService::checkStatus()` as a manual fallback for delayed notifications.

Security Notes
--------------

[](#security-notes)

- Exempt only the exact webhook route from Laravel CSRF protection.
- Keep webhook routes POST-only.
- Always verify DOKU signature before updating local payment state.
- Match incoming `Client-Id` with your configured `DOKU_CLIENT_ID`.
- Treat DOKU notifications as retryable and idempotent.
- Never expose `DOKU_SECRET_KEY` in browser code, screenshots, or client logs.

Package-local Testing
---------------------

[](#package-local-testing)

Once this package lives in its own repository:

```
composer install
composer test
```

This repository now includes:

- `phpunit.xml.dist`
- package-local unit tests under `tests/Unit`
- a lightweight manual test flow via `composer install` and `composer test`

Tunnel And Local Testing Notes
------------------------------

[](#tunnel-and-local-testing-notes)

When testing through `localhost.run` or a similar reverse proxy:

- point `APP_URL` and `DOKU_NOTIFICATION_URL` to the active tunnel domain,
- trust forwarded proxy headers in the host app,
- use built assets via `npm run build`,
- do not rely on `npm run dev` for public tunnel testing,
- keep the tunnel process alive during the payment flow.

Extraction Notes
----------------

[](#extraction-notes)

From the demo app monorepo, you can export this package into a standalone folder with:

```
.\scripts\export-doku-package.ps1
```

Before publishing this package publicly:

1. Confirm `roqianjas/doku-laravel` is the final Composer package name you want to publish.
2. Move `packages/doku-laravel` into its own repository root.
3. Copy this README and a license file into that repository.
4. Use manual package verification with `composer install` and `composer test`.
5. Replace path repository usage in host apps with normal Composer installation.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance85

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

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

2

Last Release

80d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/143056983?v=4)[Roki Anjas](/maintainers/roqianjas)[@roqianjas](https://github.com/roqianjas)

---

Top Contributors

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

---

Tags

laravelwebhookcheckoutpayment gatewayDoku

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k51.0M7.6k](/packages/larastan-larastan)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

76518.2M120](/packages/laravel-mcp)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

815320.5k3](/packages/defstudio-telegraph)[api-platform/laravel

API Platform support for Laravel

59156.3k11](/packages/api-platform-laravel)[calebdw/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

15104.9k4](/packages/calebdw-larastan)

PHPackages © 2026

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