Download the PHP package elgibor-solution/laravel-payment-bri without Composer
On this page you can find all versions of the php package elgibor-solution/laravel-payment-bri. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download elgibor-solution/laravel-payment-bri
More information about elgibor-solution/laravel-payment-bri
Files in elgibor-solution/laravel-payment-bri
Package laravel-payment-bri
Short Description Laravel package for Bank BRI payments: QRIS MPM Dynamic (SNAP) + BRIVA Virtual Account (Non-SNAP) with push notification handlers.
License Apache-2.0
Informations about the package laravel-payment-bri
Laravel BRI Payments (QRIS MPM Dynamic + BRIVA Virtual Account)
Namespace: ESolution\BriPayments
License: Apache-2.0
This package provides a pragmatic Laravel integration for Bank BRI payments:
- QRIS MPM Dynamic (SNAP): B2B access token (RSA-SHA256), generate QR, inquiry, and a ready-to-wire webhook controller.
- BRIVA (Virtual Account, Non‑SNAP): OAuth token, create/get/update/delete VA, get payment status, reports, and a push-notification verifier.
It is designed to be production-friendly, with clear signatures, headers, and timestamps handled for you.
⚠️ Always verify the latest BRI docs for any contract changes. This package follows BRI’s official docs for the endpoints and headers.
Contents
- Requirements
- Installation
- Configuration
- Environment Variables
- QRIS (SNAP) Usage
- BRIVA (VA, Non-SNAP) Usage
- Webhooks
- QRIS Notification
- BRIVA Push Notification
- Examples
- Testing Tips (Postman/cURL)
- Production Notes & Security
- Versioning
- Support & Hiring
- Donations
- Easiest Ways to Receive Donations
- License
Requirements
- PHP 8.2+
- Laravel 10.x or 11.x
ext-openssl- Network access to BRI sandbox/production endpoints
Installation
This publishes a config file at config/bri.php.
Configuration
config/bri.php
Environment Variables
Keep keys outside your repository; do not commit secrets. Consider using a secret manager or encrypted storage.
QRIS (SNAP) Usage
Namespaces
ESolution\BriPayments\Qris\QrisClient
ESolution\BriPayments\Support\SnapSignature (internal)
1) Get Token (B2B, RSA-SHA256)
2) Generate Dynamic QR
3) Inquiry Payment
SNAP business requests sign with HMAC-SHA512 over canonical string; headers include
Authorization: Bearer <accessToken>,X-TIMESTAMP,X-SIGNATURE,X-PARTNER-ID,CHANNEL-ID, andX-EXTERNAL-ID(package also sendsX-EXTRENAL-IDfor compatibility).
BRIVA (VA, Non-SNAP) Usage
Namespace
ESolution\BriPayments\Briva\BrivaClient
1) Get OAuth Token (Non‑SNAP)
2) Create a VA
3) Get VA / Get Payment Status
4) Update VA or Mark as Paid/Unpaid
5) Delete VA
6) Reports
Non‑SNAP requests use
BRI-Signature=base64(HMAC_SHA256(payload, client_secret))andBRI-Timestamp(UTC). ForDELETE /v1/briva, BRI expectsContent-Type: text/plainwithinstitutionCode=&brivaNo=&custCode=body — the package handles this and signs exactly that body.
Webhooks
QRIS Notification
- Route:
POST /bri/qris/notify(can be changed inconfig/bri.php) - Controller:
ESolution\BriPayments\Http\Controllers\QrisNotificationController@handle - Event:
ESolution\BriPayments\Events\QrisPaymentNotified
Usage:
BRIVA Push Notification
- Route:
POST /bri/briva/notify(can be changed inconfig/bri.php) - Controller:
ESolution\BriPayments\Http\Controllers\BrivaNotificationController@handle - Event:
ESolution\BriPayments\Events\BrivaPaymentNotified
The controller verifies BRI-Signature. BRI’s push docs often sign using the absolute partner URL as path. Some integrations sign only the path (without scheme/host). The package verifies both for compatibility.
Usage:
Examples
Minimal Controller to Create QR (SNAP)
Minimal Controller to Create BRIVA
Testing Tips (Postman/cURL)
- Use BRI Sandbox credentials.
- For SNAP token, ensure your RSA private key matches the client key.
- For BRIVA, verify
BRI-Timestampis UTC (ISO 8601). - To test BRIVA DELETE, send
text/plainbody exactly as BRI expects. - For webhooks, expose your local URL using
ngrokand register it with BRI.
Production Notes & Security
- Rotate secrets regularly and do not log sensitive headers or bodies.
- Constrain webhook routes with IP allowlist or additional shared secrets if possible.
- Implement idempotency for webhook processing to avoid double credits.
- Add retries/backoff for intermittent gateway errors.
- Monitor and alert on non-
00statuses and signature mismatches.
Versioning
Semantic versioning (MAJOR.MINOR.PATCH). Breaking changes will bump MAJOR.
Support & Hiring
Need professional help or want to move faster? Hire the E-Solution / Elgibor team for integration, audits, or custom features.
📧 [email protected]
Donations
If this package saves you time, consider supporting development ❤️
License
Apache-2.0
All versions of laravel-payment-bri with dependencies
illuminate/support Version ^10|^11|^12
illuminate/http Version ^10|^11|^12
illuminate/contracts Version ^10|^11|^12
guzzlehttp/guzzle Version ^7.9