aliziodev/payid
Composer 安装命令:
composer require aliziodev/payid
包简介
Unified Laravel Payment Orchestrator for Indonesian Payment Gateways
README 文档
README
Unified Laravel Payment Orchestrator for Indonesian Payment Gateways
PayID adalah package Laravel yang menyatukan berbagai payment gateway Indonesia dalam satu API yang konsisten dan extensible. Integrasikan sekali, gunakan provider mana saja melalui model driver.
Tujuan, Cakupan, dan Batasan
Tujuan
- Menyediakan API pembayaran yang konsisten lintas provider untuk use case umum aplikasi.
- Mengurangi vendor lock-in dengan pendekatan driver dan capability-based contracts.
- Menstandarkan lifecycle pembayaran (charge, status, webhook, dsb.) agar mudah diuji dan dipelihara.
Cakupan
- Orkestrasi pembayaran pada layer aplikasi Laravel melalui facade/manager PayID.
- Standardisasi DTO, enum status, dan webhook normalization lintas driver.
- Ekstensi provider-specific melalui package driver terpisah (mis. Midtrans, Xendit, iPaymu, Nicepay).
- Integrasi opsional dengan stack transaksi/ledger lewat package pendamping.
Batasan
- PayID bukan payment gateway; eksekusi transaksi tetap dilakukan oleh provider masing-masing.
- Fitur provider-specific yang sangat khusus tidak selalu tersedia di API generic manager, dan diakses via extension method pada driver.
- Compliance, legal, settlement, rekonsiliasi bank, dan dispute handling tetap menjadi tanggung jawab aplikasi/operasional bisnis.
- Konfigurasi kredensial, endpoint, serta kebijakan retry/queue production harus ditetapkan di aplikasi host sesuai kebutuhan domain.
Requirements
- PHP 8.2+
- Laravel 11.x, 12.x, atau 13.x
Instalasi
Install PayID core:
composer require aliziodev/payid
Install driver provider yang diinginkan:
composer require aliziodev/payid-midtrans composer require aliziodev/payid-xendit
Publish konfigurasi:
php artisan vendor:publish --tag=payid-config
Opsional, gunakan installer interaktif:
php artisan payid:install
Installer akan memandu:
- pemilihan driver gateway
- pemilihan transaction stack:
payid-transactionsataumanual
Konfigurasi
Tambahkan ke .env:
PAYID_DEFAULT_DRIVER=midtrans MIDTRANS_ENV=sandbox MIDTRANS_SERVER_KEY=SB-Mid-server-xxxx MIDTRANS_CLIENT_KEY=SB-Mid-client-xxxx
Penggunaan Dasar
Membuat Transaksi
use Aliziodev\PayId\DTO\ChargeRequest; use Aliziodev\PayId\Enums\PaymentChannel; use Illuminate\Support\Facades\PayId; $response = PayId::charge(ChargeRequest::make([ 'merchant_order_id' => 'ORDER-001', 'amount' => 150000, 'currency' => 'IDR', 'channel' => PaymentChannel::Qris, 'customer' => [ 'name' => 'Alizio', 'email' => 'budi@example.com', ], ])); return redirect($response->paymentUrl);
Cek Status Transaksi
$status = PayId::status('ORDER-001'); if ($status->status->isSuccessful()) { // Tandai order sebagai dibayar }
Ganti Driver Saat Runtime
$response = PayId::driver('xendit')->charge($request);
Operasi Lain yang Tersedia
PayID manager/facade juga menyediakan:
directCharge(ChargeRequest $request)refund(RefundRequest $request)cancel(string $merchantOrderId)expire(string $merchantOrderId)approve(string $merchantOrderId)deny(string $merchantOrderId)createSubscription(SubscriptionRequest $request)getSubscription(string $providerSubscriptionId)updateSubscription(UpdateSubscriptionRequest $request)pauseSubscription(string $providerSubscriptionId)resumeSubscription(string $providerSubscriptionId)cancelSubscription(string $providerSubscriptionId)supports(Capability $capability)
Menangani Webhook
Daftarkan URL webhook ke dashboard provider:
https://yourdomain.com/payid/webhook/midtrans
Tangkap event di listener:
use Aliziodev\PayId\Events\WebhookReceived; use Aliziodev\PayId\Enums\PaymentStatus; Event::listen(WebhookReceived::class, function (WebhookReceived $event) { $webhook = $event->webhook; if ($webhook->status === PaymentStatus::Paid) { Order::markAsPaid($webhook->merchantOrderId); } });
Testing
$fake = PayId::fake(); $fake->fakeCharge(ChargeResponse::make([ 'provider_name' => 'midtrans', 'provider_transaction_id' => 'TRX-001', 'merchant_order_id' => 'ORDER-001', 'status' => PaymentStatus::Pending, 'payment_url' => 'https://example.com/pay', 'raw_response' => [], ])); // Jalankan kode yang memanggil PayId::charge(...) $fake->assertCharged();
Fake helper lain yang tersedia termasuk:
fakeDirectCharge,fakeStatus,fakeRefund,fakeCancel,fakeExpirefakeApprove,fakeDeny,fakeSubscription- assertion seperti
assertDirectCharged,assertStatusChecked,assertRefunded,assertNothingRecorded
Driver yang Tersedia
| Driver | Package | Status |
|---|---|---|
| Midtrans | aliziodev/payid-midtrans |
Stable |
| Xendit | aliziodev/payid-xendit |
Stable |
| iPaymu | aliziodev/payid-ipaymu |
Beta |
| Nicepay | aliziodev/payid-nicepay |
Stable |
| DOKU | aliziodev/payid-doku |
Coming Soon |
Dokumentasi
- R&D Document
- Technical Architecture
- Package Blueprint
- Implementation Roadmap
- README and Docs Structure Draft
- Production Readiness Checklist
- Driver Authoring Guide
- Driver Acceptance Checklist
- Midtrans Complete Usage Guide
- Xendit Complete Usage Guide
- Driver Feature Matrix (Midtrans vs Xendit vs iPaymu vs Nicepay)
- Xendit Extension API Quick Reference
- Midtrans Extension API Quick Reference
- iPaymu Complete Usage Guide
- iPaymu Extension API Quick Reference
- Nicepay Complete Usage Guide
- Nicepay Extension API Quick Reference
- Diagram Index
- PayID Complete System Flow Diagram
- Checkout and Payment Lifecycle Flow
- Webhook Processing Flow
- Subscription Flow
- Driver Extension Flow
- ADR: Core and Driver Separation
- ADR: Capability-based Contracts
- ADR: Immutable DTO
- ADR: Webhook Pipeline
Status Kesiapan
- Test suite: passing
- Static analysis (PHPStan): passing
- Coverage report: butuh coverage driver (Xdebug/PCOV/phpdbg-compatible) di environment
Known Limitations
- Coverage report belum dapat dijalankan jika environment belum memuat driver coverage.
- Driver iPaymu sudah tersedia pada level beta dan dapat dipakai untuk flow charge/status/webhook.
- Driver Nicepay sudah final dan berstatus stable, mencakup fitur SNAP + V2 melalui extension method.
- Fitur queue processing webhook disiapkan pada konfigurasi, tetapi implementasi orchestration async tetap perlu ditangani di aplikasi host.
Kontribusi
Lihat CONTRIBUTING.md untuk panduan berkontribusi.
Security
Untuk pelaporan vulnerability, lihat SECURITY.md.
Upgrade
Panduan upgrade antar versi tersedia di UPGRADE.md.
Changelog
Riwayat perubahan tersedia di CHANGELOG.md.
Lisensi
MIT License.
aliziodev/payid 适用场景与选型建议
aliziodev/payid 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 26 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「payment」 「gateway」 「laravel」 「indonesia」 「ipaymu」 「xendit」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 aliziodev/payid 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 aliziodev/payid 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 aliziodev/payid 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
repository php library
Payyo Gateway for the Omnipay payment processing library
Client library to send SMS using Comilio SMS Gateway API (https://www.comilio.it)
Alfabank REST API integration
GovPayNet driver for the Omnipay payment processing library
BlueSnap driver for the Omnipay payment processing library
统计信息
- 总下载量: 26
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 34
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-13