Skip to content

Add DOKU QRIS gateway and update Duitku Direct API - #7

Merged
akrindev merged 3 commits into
mainfrom
feat/gateway-payments-doku-duitku
May 28, 2026
Merged

akrindev merged 3 commits into
mainfrom
feat/gateway-payments-doku-duitku

Conversation

@akrindev

@akrindev akrindev commented May 28, 2026 •

Copy link
Copy Markdown
Member

Summary

This PR adds and hardens gateway payment support for Duitku and DOKU, while keeping the SDK's local QRIS transformation flow unchanged.

Main changes:

  • Add DOKU SNAP QRIS MPM adapter support for QR generation, status query, and webhook parsing.
  • Update Duitku integration to use Direct API /v2/inquiry with HMAC-SHA256 signatures.
  • Harden webhook verification for Duitku and DOKU:
    • strict invalid-signature behavior by default
    • safe { throwOnInvalid: false } fallback
    • DOKU raw body support
    • DOKU timestamp replay-window validation
    • Duitku merchantCode validation
  • Improve provider error handling by sanitizing exposed error messages while preserving raw provider data in cause.
  • Add gateway verification options through gateway.verify().
  • Align bilingual README/docs and update gateway references for Duitku/DOKU.

Security Notes

  • DOKU X-EXTERNAL-ID now uses cryptographically secure random bytes.
  • DOKU webhook verification supports raw request bodies to avoid signature mismatches from JSON reserialization.
  • DOKU webhook timestamps are rejected outside the configured skew window, defaulting to 5 minutes.
  • Duitku webhook verification validates both signature and merchant code.
  • Invalid Duitku/DOKU webhooks throw by default to avoid accidentally trusting fake normalized payment status.

Docs

  • Normalize Indonesian/English language switches.
  • Keep README.md as Indonesian and README.en.md as English.
  • Keep docs/ as Indonesian docs and docs/en/ as English mirror.
  • Update Duitku docs from old MD5/createInvoice references to Direct API HMAC-SHA256.
  • Add DOKU gateway/webhook docs.

Testing

  • bun run typecheck
  • bun test tests/providers/adapters/webhook.test.ts
  • git diff --check
  • Project markdown link sanity check passed for README/docs/examples.

akrindev added 3 commits May 28, 2026 17:25
- add DOKU SNAP QRIS adapter with B2B token, generate, query, and webhook verification
- register DOKU as built-in gateway provider with env-based config resolution
- update Duitku adapter to Direct API HMAC-SHA256 flow
- document gateway payments support and DOKU environment variables
- add gateway/webhook tests for DOKU and updated Duitku signatures
@akrindev
akrindev force-pushed the feat/gateway-payments-doku-duitku branch from 93b2925 to f3934d2 Compare May 28, 2026 10:29
@akrindev
akrindev merged commit 24eb404 into main May 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant