Download the PHP package bensondevs/laravel-midtrans without Composer
On this page you can find all versions of the php package bensondevs/laravel-midtrans. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bensondevs/laravel-midtrans
More information about bensondevs/laravel-midtrans
Files in bensondevs/laravel-midtrans
Package laravel-midtrans
Short Description Laravel wrapper for Midtrans Payments — simple, clean integration for Snap, Core API, and subscription billing.
License MIT
Homepage https://github.com/bensondevs/laravel-midtrans
Informations about the package laravel-midtrans
Laravel Midtrans
A modern, testable, and fluent Laravel wrapper for the Midtrans API.
Supports:
- Snap payments
- Subscription billing
- Card registration
- GoPay partner account creation
- Laravel auto-discovery and configuration publishing
🚧 Project Status
This package is currently in alpha testing phase.
The development process has encountered several challenges, particularly with GoPay-related integration, due to inconsistencies and gaps in the official Midtrans documentation. Please expect some rough edges, especially around GoPay functionality.
Your feedback and contributions are highly appreciated as the package stabilizes.
🔧 Installation
You can install the package via Composer:
If you want to publish the config file:
⚙️ Configuration
After publishing, configure your .env:
💳 Billable Trait
To make a model (like User) billable, use the Billable trait:
This trait provides:
snapCharge(array $order)refund(TransactionDetails $order, ?int $amount = null, ?string $reason = '')subscribe(Subscribable $subscribable, PaymentType|string $paymentType, string $token)gopaySubscribe(Subscribable $subscribable, GopayPaymentOption|string|null $paymentOption)registerCard(...)viaHasRegisteredCardscreateGopayAccount()andgetGopayToken(...)viaHasGopayAccounts
Ensure your model implements Customer, and optionally Subscribable or TransactionDetails.
🚀 Usage Examples
Snap Payment
Refund
Create Subscription (Credit Card)
Create Subscription (GoPay)
Register Credit Card
Create GoPay Partner Account
✅ Testing
Make sure to set valid sandbox credentials in your .env.
📦 Roadmap
- [x] Snap charge
- [x] Subscription API
- [x] Card registration
- [x] GoPay partner creation
- [ ] Refunds & Transaction status
- [ ] Event handling (webhooks)
🤝 Contributing
Contributions, issues, and feature requests are welcome!
Feel free to open an issue or submit a pull request.
📄 License
MIT © Simeon Benson
All versions of laravel-midtrans with dependencies
illuminate/broadcasting Version ^10.0|^11.0|^12.0
illuminate/events Version ^10.0|^11.0|^12.0
illuminate/http Version ^10.0|^11.0|^12.0
illuminate/queue Version ^10.0|^11.0|^12.0
illuminate/support Version ^10.0|^11.0|^12.0
symfony/http-foundation Version ^6|^7