承接 roqianjas/doku-laravel 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

roqianjas/doku-laravel

Composer 安装命令:

composer require roqianjas/doku-laravel

包简介

Reusable Laravel-first integration for DOKU Checkout.

README 文档

README

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

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

  • 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

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

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

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

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

  • 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

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

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

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.

roqianjas/doku-laravel 适用场景与选型建议

roqianjas/doku-laravel 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 08 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「checkout」 「laravel」 「webhook」 「payment-gateway」 「Doku」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 roqianjas/doku-laravel 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 roqianjas/doku-laravel 我们能提供哪些服务?
定制开发 / 二次开发

基于 roqianjas/doku-laravel 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 21
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-08