PHP code example of elgibor-solution / laravel-payment-bri
1. Go to this page and download the library: Download elgibor-solution/laravel-payment-bri library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
elgibor-solution / laravel-payment-bri example snippets
$status = $qris->inquiryPayment(
originalReferenceNo: $qr->referenceNo,
terminalId: config('bri.qris.terminal_id')
);
// Use latestTransactionStatus (e.g., "00" for success) according to BRI docs
use ESolution\BriPayments\Events\QrisPaymentNotified;
use Illuminate\Support\Facades\Event;
Event::listen(QrisPaymentNotified::class, function ($event) {
// $event->payload, $event->headers, $event->validSignature
// Update your order/payment here
});
use ESolution\BriPayments\Events\BrivaPaymentNotified;
use Illuminate\Support\Facades\Event;
Event::listen(BrivaPaymentNotified::class, function ($event) {
// $event->payload, $event->headers, $event->validSignature
// Update your VA/payment here
});
use ESolution\BriPayments\Qris\QrisClient;
class PaymentController
{
public function createQris(QrisClient $qris)
{
$qr = $qris->generateQr('INV-2025-0001', '10000.00');
return response()->json([
'referenceNo' => $qr->referenceNo ?? null,
'qrContent' => $qr->qrContent ?? null,
]);
}
}