### Installation Source: https://github.com/elgiborsolution/laravel-payment-bri/blob/main/README.md Install the package via Composer and publish the configuration file. ```bash composer require elgibor-solution/laravel-payment-bri php artisan vendor:publish --provider="ESolution\BriPayments\BriPaymentsServiceProvider" --tag=bri-payments-config ``` -------------------------------- ### Minimal Controller to Create QR (SNAP) Source: https://github.com/elgiborsolution/laravel-payment-bri/blob/main/README.md A minimal controller example to generate a QR code using the QrisClient. ```php 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, ]); } } ``` -------------------------------- ### QRIS Notification Usage Source: https://github.com/elgiborsolution/laravel-payment-bri/blob/main/README.md Example of listening to the QrisPaymentNotified event to update order or payment status. ```php 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 }); ``` -------------------------------- ### Get OAuth Token (Non‑SNAP) Source: https://github.com/elgiborsolution/laravel-payment-bri/blob/main/README.md Retrieves an OAuth token using the BrivaClient. ```php use ESolution\BriPayments\Briva\BrivaClient; /** @var BrivaClient $briva */ $briva = app(BrivaClient::class); $token = $briva->getToken(); ``` -------------------------------- ### Minimal Controller to Create BRIVA Source: https://github.com/elgiborsolution/laravel-payment-bri/blob/main/README.md A minimal controller example to create a Virtual Account (VA) using the BrivaClient. ```php use ESolution\BriPayments\Briva\BrivaClient; class VaController { public function create(BrivaClient $briva) { $res = $briva->createVa([ 'institutionCode' => config('bri.briva.institution_code'), 'brivaNo' => config('bri.briva.briva_no'), 'custCode' => 'CUST-ABC-001', 'nama' => 'Jane Doe', 'amount' => '150000', 'keterangan' => 'Order #12345', 'expiredDate' => now()->addDay()->format('Y-m-d H:i:s'), ]); return response()->json($res); } } ``` -------------------------------- ### Get Token (B2B, RSA-SHA256) Source: https://github.com/elgiborsolution/laravel-payment-bri/blob/main/README.md Obtain a B2B access token using the QrisClient. ```php use ESolution\BriPayments\Qris\QrisClient; /** @var QrisClient $qris */ $qris = app(QrisClient::class); $token = $qris->getToken(); ``` -------------------------------- ### Get VA / Get Payment Status Source: https://github.com/elgiborsolution/laravel-payment-bri/blob/main/README.md Retrieves VA details or checks the payment status for a given customer code. ```php $va = $briva->getVa(config('bri.briva.institution_code'), config('bri.briva.briva_no'), 'CUST001'); $status = $briva->getStatus(config('bri.briva.institution_code'), config('bri.briva.briva_no'), 'CUST001'); ``` -------------------------------- ### BRIVA Push Notification Usage Source: https://github.com/elgiborsolution/laravel-payment-bri/blob/main/README.md Example of listening to the BrivaPaymentNotified event to update VA or payment status. ```php 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 }); ``` -------------------------------- ### Generate Dynamic QR Source: https://github.com/elgiborsolution/laravel-payment-bri/blob/main/README.md Generate a dynamic QR code for a payment. ```php $qr = $qris->generateQr( partnerReferenceNo: 'INV-2025-0001', amount: '10000.00', currency: 'IDR' ); // $qr->qrContent, $qr->referenceNo ``` -------------------------------- ### Create a VA Source: https://github.com/elgiborsolution/laravel-payment-bri/blob/main/README.md Creates a Virtual Account (VA) with specified details. ```php $res = $briva->createVa([ 'institutionCode' => config('bri.briva.institution_code'), 'brivaNo' => config('bri.briva.briva_no'), 'custCode' => 'CUST001', 'nama' => 'John Doe', 'amount' => '25000', // string, numbers only 'keterangan' => 'Invoice INV-001', 'expiredDate' => '2025-12-31 23:59:59', // YYYY-MM-DD HH:mm:ss ]); ``` -------------------------------- ### Update VA or Mark as Paid/Unpaid Source: https://github.com/elgiborsolution/laravel-payment-bri/blob/main/README.md Updates VA information or manually marks a VA as paid or unpaid. ```php $update = $briva->updateVa([/* ...payload per BRI docs... */]); $mark = $briva->updateStatus( config('bri.briva.institution_code'), config('bri.briva.briva_no'), 'CUST001', 'Y' // Y = paid, N = unpaid (check docs) ); ``` -------------------------------- ### Reports Source: https://github.com/elgiborsolution/laravel-payment-bri/blob/main/README.md Retrieves transaction reports for a specified period or time range. ```php $report = $briva->getReport( config('bri.briva.institution_code'), config('bri.briva.briva_no'), '2025-01-01', '2025-01-31' ); $reportTime = $briva->getReportTime( config('bri.briva.institution_code'), config('bri.briva.briva_no'), '2025-01-01', '00:00', '2025-01-02', '23:59' ); ``` -------------------------------- ### Inquiry Payment Source: https://github.com/elgiborsolution/laravel-payment-bri/blob/main/README.md Inquire about the status of a payment using the original reference number. ```php $status = $qris->inquiryPayment( originalReferenceNo: $qr->referenceNo, terminalId: config('bri.qris.terminal_id') ); // Use latestTransactionStatus (e.g., "00" for success) according to BRI docs ``` -------------------------------- ### Delete VA Source: https://github.com/elgiborsolution/laravel-payment-bri/blob/main/README.md Deletes a Virtual Account (VA). ```php $del = $briva->deleteVa( config('bri.briva.institution_code'), config('bri.briva.briva_no'), 'CUST001' ); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.