Download the PHP package gusmanwidodo/laravel-billing-midtrans without Composer
On this page you can find all versions of the php package gusmanwidodo/laravel-billing-midtrans. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gusmanwidodo/laravel-billing-midtrans
More information about gusmanwidodo/laravel-billing-midtrans
Files in gusmanwidodo/laravel-billing-midtrans
Package laravel-billing-midtrans
Short Description Midtrans (Snap) payment provider for gusmanwidodo/laravel-billing. Implements the PaymentProvider contract: Snap charge, SHA512 webhook verification, status mapping, and refund.
License MIT
Homepage https://github.com/gusmanwidodo/laravel-billing-midtrans
Informations about the package laravel-billing-midtrans
Laravel Billing — Midtrans
Midtrans (Snap) payment provider for
gusmanwidodo/laravel-billing.
It implements the billing PaymentProvider contract, so once installed you can
charge invoices through Midtrans and settle them from verified webhooks.
Features
- Snap charge — opens a Snap transaction and returns its token + redirect URL.
- Webhook verification — validates the Midtrans SHA512
signature_key(order_id + status_code + gross_amount + serverKey). Forged/tampered notifications are rejected. - Status mapping — settlement/capture(accept) → succeeded, pending → pending, deny → failed, cancel/expire → canceled, refund → refunded.
- Refund — calls the Midtrans refund endpoint.
- Auto-registers itself into laravel-billing's provider registry.
Requirements
- PHP
^8.3 gusmanwidodo/laravel-billing^0.4- Laravel 12
- A Midtrans account (server + client keys)
Installation
Set your keys in .env:
Usage
On a verified settlement/capture(accept) notification, a real Payment is
recorded and the invoice becomes paid automatically. Settlement is idempotent
(Midtrans may resend), keyed by the intent's external_id (the order_id).
Amounts & currency
laravel-billing stores money as integer minor units. Midtrans gross_amount
is whole rupiah. This package converts using MIDTRANS_DECIMALS (default 2):
1_000_000 minor units → gross_amount = 10000. Set MIDTRANS_DECIMALS=0 if
your invoices already store whole rupiah.
Security
Webhook signature verification is mandatory — Billing::handleWebhook('midtrans', ...) throws if the SHA512 signature_key does not match, so a forged or tampered
notification never records a payment. Always also confirm status_code=200,
fraud_status=accept, and a settlement/capture status (this package's mapping
already enforces the fraud/status logic).
Testing
License
MIT © Gusman Widodo. See LICENSE.
All versions of laravel-billing-midtrans with dependencies
gusmanwidodo/laravel-billing Version ^0.4
illuminate/http Version ^12.0
illuminate/support Version ^12.0