rahmatnurjaman99/brivaonline

Laravel package for BRI VA/SNAP integrations with WSDL inquiry/payment support.

Maintainers

Package info

github.com/rahmatnurjaman99/brivaonline

pkg:composer/rahmatnurjaman99/brivaonline

Statistics

Installs: 6

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.6 2026-03-07 19:12 UTC

This package is auto-updated.

Last update: 2026-05-04 10:08:07 UTC


README

Laravel package for BRI VA/SNAP integrations with WSDL inquiry/payment support.

Install

composer require rahmatnurjaman99/brivaonline

Publish config and migrations

php artisan vendor:publish --tag=briva-config
php artisan vendor:publish --tag=briva-migrations

Routes

Routes are registered automatically when briva.routes.enabled is true.

Test signing routes:

POST /_test/sign/access-token
POST /_test/sign/transaction

Access token signing body:

{
  "client_id": "your-client-id"
}

Transaction signing body:

{
  "path": "/snap/v1.0/transfer-va/payment",
  "method": "POST",
  "access_token": "your-access-token",
  "body": {
    "partnerServiceId": "00012345",
    "customerNo": "0000000000001",
    "virtualAccountNo": "000123450000000001",
    "virtualAccountName": "John Doe",
    "paymentRequestId": "REQ-1",
    "paidAmount": {
      "value": "200000.00",
      "currency": "IDR"
    },
    "additionalInfo": {
      "idApp": "TESTAPP1"
    }
  }
}

Usage

use RahmatNurjaman99\BrivaOnline\Clients\SnapClient;

$snap = app(SnapClient::class);
$token = $snap->accessToken();

Custom inquiry resolver

By default, inquiry data is fetched via WSDL. Your resolver must return the final response payload:

// config/briva.php
'inquiry_resolver' => App\Briva\MyInquiryResolver::class,

Example resolver return:

return [
    'responseCode' => '2002400',
    'responseMessage' => 'Successful',
    'virtualAccountData' => [
        'partnerServiceId' => '00012345',
        'customerNo' => '123456',
        'virtualAccountNo' => '00012345123456',
        'virtualAccountName' => 'John Doe',
        'inquiryRequestId' => 'REQ-1',
        'totalAmount' => ['value' => '1000.00', 'currency' => 'IDR'],
        'inquiryStatus' => '00',
        'inquiryReason' => ['english' => 'Success', 'indonesia' => 'Sukses'],
    ],
    'additionalInfo' => [],
];

Custom payment resolver

By default, payment is posted via WSDL. Your resolver must return the final response payload:

// config/briva.php
'payment_resolver' => App\Briva\MyPaymentResolver::class,

Example resolver return:

return [
    'responseCode' => '2002500',
    'responseMessage' => 'Successful',
    'virtualAccountData' => [
        'partnerServiceId' => '00012345',
        'customerNo' => '123456',
        'virtualAccountNo' => '00012345123456',
        'virtualAccountName' => 'John Doe',
        'paymentRequestId' => 'REQ-1',
        'paidAmount' => ['value' => '1000.00', 'currency' => 'IDR'],
        'paymentFlagStatus' => '00',
        'paymentFlagReason' => ['english' => 'Success', 'indonesia' => 'Sukses'],
    ],
    'additionalInfo' => [],
];