Get Token - Aslam97/laravel-bank-bca GitHub Wiki

Facades

use BcaAPI;

$getToken = BcaAPI::service('Authentication')
    ->AccessToken()
    ->toJson();

Helper

$getToken = bcaapi()
    ->service('Authentication')
    ->AccessToken()
    ->toJson();

Instead of requesting access_token everytime you make an API call. you should put the access token (first time you generate token) in your database. later you can check if token exists and not expired. then use token from database.

$getToken['access_token'];
$getToken['expires_in'];