Make Request

All responses to requests are in the form of objects with the format depending on the bank's service provider.

Before use this SnapBi make sure to setup configuration.

<?php

use Otnansirk\SnapBI\Services\SnapBi;
...

$snap = SnapBi::bca();

// Or use chaining method
$snap = SnapBi::for('bca');

Actually, apart from the bca method and key, there are still several banks that can be used later. Take a look at the bank support currently available.

So, the method or key params for method depend on key of bank support currently available.

Headers

Headers may be added to requests using the withHeaders method. This withHeaders method accepts an array of key / value pairs:

SnapBi::bca()->withHeaders([
    "X-EXTERNAL-ID" => "111111"
]);

The withHeaders method merges new headers into the request's existing headers.

Body

Body may be added to requests using the withBody method. This withBody method accepts an array of key / value pairs:

SnapBi::bca()->withBody([
    "X-PARTNER-ID" => "111111"
]);

The withBody method merges new body into the request's existing body.

Call available method

SnapBi::bca()
->withHeaders([
    "X-EXTERNAL-ID" => "111111"
])
->withBody([
    "X-PARTNER-ID" => "111111"
])
->vaInquiry();

Apart from vaInquiry, you can also use the available functions. You can check here for more available functions details

Last updated