quetzal-studio/snap-bi-laravel

SNAP BI package for Laravel

v0.0.6 2024-08-02 02:12 UTC

This package is auto-updated.

Last update: 2024-10-02 02:31:32 UTC


README

Laravel package for use SNAP BI API

Features

  • Get Access Token
  • Intrabank Transfer
  • ...

Example Usage

use QuetzalStudio\SnapBi\Amount;
use QuetzalStudio\SnapBi\Config;
use QuetzalStudio\SnapBi\IntrabankTransfer\Payload;
use QuetzalStudio\SnapBi\IntrabankTransfer\Transfer;

Config::load('bca');

$request = new Transfer(
    origin: config('app.url'),
    channelId: config('snap.providers.bca.channel_id'),
    externalId: 'YOUR EXTERNAL ID',
);

$response = $request->send(new Payload(
    partnerReferenceNo: 'TRX123',
    amount: new Amount(10000),
    beneficiaryAccountNo: '111111',
    sourceAccountNo: '999999',
    transactionDate: date(DATE_ATOM, time()),
    beneficiaryEmail: '',
    remark: '',
    currency: 'IDR',
    additionalInfo: [
        'economicActivity' => '',
        'transactionPurpose' => '',
    ],
));

// $response --> \Illuminate\Http\Client\Response