Configuration

Introduction

All of configuration you can register with class Otnansirk\SnapBI\Services\Config

Register Config

Before using php-snap-bi you must register all the necessary configurations.

<?php

use Otnansirk\SnapBI\Services\Config
...

Config::bca([
    "client_id"       => "a82s28bf-493a-4183-ba01-08129dd08432",
    "client_secret"   => "91424666-848d-40fb-8da3-c796eqdfa057",
    "ssh_private_key" => <<<SSHKEY
                        -----BEGIN PRIVATE KEY-----
                        MIIBIjANBgkqhkiG9w0B...
                        -----END PRIVATE KEY-----
                        SSHKEY,
    "ssh_public_key"  => <<<SSHKEY
                        -----BEGIN PUBLIC KEY-----
                        IIBCgKCAQEAw8VfUgnj3yc2GTgDtY...
                        -----END PUBLIC KEY-----
                        SSHKEY,
    "partner_id"      => "UATCORP001",
    "account_id"      => "0433tt5827",
    "bank_card_token" => "123dde37890",
    "channel_id"      => "1111",
    "base_url"        => "https://domainapi.klikbca.com",
]);

This configuration value is for example only.

Default Config Values

Chaining Support

The Config class offers the convenience of query chaining, allowing you to perform multiple operations without having to call them directly through methods.

To achieve this, you can utilize the "for" method provided by the Config class. Rather than invoking Config::bca([...]), you can adopt a more structured approach by using Config::for("bca")->register([...]).

<?php

use Otnansirk\SnapBI\Services\Config
...

Config::for("bca")->register([
    "client_id"       => "a82s28bf-493a-4183-ba01-08129dd08432",
    "client_secret"   => "91424666-848d-40fb-8da3-c796eqdfa057",
    "ssh_private_key" => <<<SSHKEY
                        -----BEGIN PRIVATE KEY-----
                        MIIBIjANBgkqhkiG9w0B...
                        -----END PRIVATE KEY-----
                        SSHKEY,
    "ssh_public_key"  => <<<SSHKEY
                        -----BEGIN PUBLIC KEY-----
                        IIBCgKCAQEAw8VfUgnj3yc2GTgDtY...
                        -----END PUBLIC KEY-----
                        SSHKEY,
    "partner_id"      => "UATCORP001",
    "account_id"      => "0433tt5827",
    "bank_card_token" => "123dde37890",
    "channel_id"      => "1111",
    "base_url"        => "https://domainapi.klikbca.com",
]);

This configuration value is for example only.

Method Support

Last updated