Download the PHP package laraditz/xendit without Composer
On this page you can find all versions of the php package laraditz/xendit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download laraditz/xendit
More information about laraditz/xendit
Files in laraditz/xendit
Package xendit
Short Description Laravel package for interacting with Xendit API.
License MIT
Homepage https://github.com/laraditz/xendit
Informations about the package xendit
Laravel Xendit
A Laravel package for seamless integration with Xendit payment gateway. Built from scratch using Laravel's HTTP client, this package provides a fluent API for creating payments, managing transactions, and handling webhooks - all with database persistence and event-driven architecture.
Features
- 🔥 Fluent API for creating payments
- 💳 Support for all payment methods (E-Wallet, Virtual Account, QR Code, Cards, OTC)
- 🗄️ Database persistence for payments, transactions, and webhooks
- 🔔 Automatic webhook handling with signature verification
- 🎯 Event-driven architecture (Payment, Refund, Token events)
- 🔗 Polymorphic relationships (attach payments to any model)
- 📦 Uses Laravel's HTTP client (no Guzzle dependency)
- 🛡️ Type-safe with PHP 8.2+ Backed Enums
- 💰 Complete refund management
- 🔑 Payment token (saved payment methods) support
- 🔗 Payment links generation
- 📊 Transaction querying and listing
- 🎫 Session management
- 🏷️ Custom HTTP headers on any API call (
for-user-id,with-split-rule, etc.)
API Coverage
- ✅ Payment Request - Create, get, cancel, simulate
- ✅ Payment - Get status, cancel, capture
- ✅ Payment Token - Create, get, deactivate
- ✅ Customer - Create, get, list, update
- ✅ Session - Create, get, cancel with DB persistence
- ✅ Refund - Create refunds
- ✅ Payment Link - Create and manage payment links
- ✅ Transaction - Get and list transactions
- ✅ Webhooks - All webhook events supported
- ✅ Logging - Outbound API call audit trail with retention/pruning
Requirements
- PHP 8.2+
- Laravel 10.x, 11.x, or 12.x
Installation
Install the package via composer:
Publish the configuration and migrations:
Run the migrations:
Run the seeder:
Add your Xendit credentials to .env:
Usage
Creating Payment Request (Fluent API)
Payment Request with Array
Payment Request with Specific Channels
Payment Request with Channel Properties
Attaching Payments to Models (Polymorphic)
Managing Payments
Working with Payment Tokens (Saved Payment Methods)
Creating Customers
Creating Sessions
Processing Refunds
Creating Payment Links
Querying Transactions
Per-Service API Versions
By default no api-version header is sent. You can configure per-service defaults in config/xendit.php, override them per call, or suppress them entirely:
Available config keys: payment_request, payment, payment_token, session, customer, refund, payment_link, transaction.
Custom HTTP Headers (Sub-accounts & Split Rules)
Any builder supports arbitrary request headers via withHeader() / withHeaders():
SessionBuilder and PaymentRequestBuilder also expose named shortcuts that set the header and persist the value to the database for filtering and auditing:
Querying Payments
Webhook Handling
Webhooks are automatically handled at /xendit/webhook. The package will:
- Verify webhook signature
- Log webhook to database
- Update payment status
- Dispatch Laravel events
Available Webhook Events
Listen to webhook events in your EventServiceProvider:
Example Listeners
Payment Event Listener:
Refund Event Listener:
Payment Token Event Listener:
Documentation
For detailed documentation on each service, please refer to:
- Payment Request - Complete guide to creating payment requests with fluent builder
- Payment - Managing payment status, cancellation, and capture
- Payment Token - Saving and managing customer payment methods
- Customer - Creating and managing Xendit customers with DB persistence
- Session - Creating secure payment sessions for checkout flows
- Refund - Processing full and partial refunds
- Payment Link - Generating shareable payment links for invoices
- Transaction - Querying and listing all transactions
- Webhooks - Handling webhook events and notifications
- Logging - Outbound API call audit trail with retention/pruning
Testing
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Raditz Farhan
- All Contributors
License
The MIT License (MIT). Please see License File for more information.