Fasapay XML API client

Fasapay XML API client - 1

[ad_1]

To get this product on 50 % contact me on this link

 

LIVE PREVIEWBUY FOR $12

Fasapay XML API client

API client which works with fasapay XML API https://www.fasapay.com/en/apiguide/index

Features

  • Simple and OOP styled library
  • Work with transactions API (switch cash, get transaction particulars, get transactions historical past)
  • Work with accounts API (get information about account, get account stability)
  • PHP7x help
  • High high quality clear and self documented code
  • Full unit examined
  • Can use as composer library

How so as to add Fasapay XML API help

  • Login into your fasapay account
  • Move to Account Access (API) -> Account API
  • Press button Add API
  • Fill API title and API_SECRETWORD fields

Fasapay XML API client - 1

Requirements

  • PHP7x
  • Ext-SimpleXML
  • Ext-Curl

Install

  • Download archive from storage
  • Unzip
  • Move information to your mission folder
  • Add this string in your script require_once ’/path-to-library/vendor/autoload.php’;

For small dimension this zip archive packed after composer set up—no-dev command and unit assessments is not going to works, for repair this use composer set up from root library listing

Configure

See examples folder

    require_once '/path-to-library/vendor/autoload.php';

    $config = (new KachitFasapayAPIConfig())
        ->setApiKey('API key')
        ->setApiSecretWord('API secret phrase')
    ;
    $client = new KachitFasapayAPIClient($config);
    

Work with transactions

    //Get transactions historical past
    $filter = (new KachitFasapayAPIResourceTransactionsHistoryFilter())
        ->setStartDate('2018-08-01')
        ->setEndDate('2018-08-02')
    ;
    $response = $client->transactions()->historical past($filter);

    $information = $response->getData();
    
    /* Response */
    Array
    (
        [history] => Array
            (
                [page] => Array
                    (
                        [total_item] => 2
                        [page_count] => 1
                        [current_page] => 0
                    )

                [detail] => Array
                    (
                        [0] => Array
                            (
                                [batchnumber] => TR0123456789
                                [datetime] => 2016-09-28 12:49:33
                                [type] => Transfer In
                                [to] => FP000001
                                [from] => FP00002
                                [amount] => 800000.000
                                [note] => Store remark
                                [status] => FINISH
                                [currency] => IDR
                                [fee] => 0
                            )

                        [1] => Array
                            (
                                [batchnumber] => TR0123456789
                                [datetime] => 2016-09-28 10:06:56
                                [type] => Transfer In
                                [to] => FP000001
                                [from] => FP000002
                                [amount] => 200000.000
                                [note] => Store remark
                                [status] => FINISH
                                [currency] => IDR
                                [fee] => 0
                            )
                    )

        [@attributes] => Array
            (
                [id] => 123456789
                [date_time] => 2016-03-21T21:31:36+07:00
            )

    )

    
    //Get transaction by exterior IDs
    $filter = (new KachitFasapayAPIResourceTransactionsDetailsFilter())
        ->setDetails(['TR0123456789']);
    ;
    $response = $client->transactions()->particulars($filter);

    $information = $response->getData();
    
    /* Response */
    Array
    (
        [detail] => Array
            (
                [batchnumber] => TR0123456789
                [date] => 2016-07-31
                [time] => 20:58:08
                [from] => FP000001
                [to] => FP000002
                [amount] => 500000.000
                [total] => 500000.00
                [currency] => IDR
                [note] => Store remark
                [status] => FINISH
                [fee] => 0
                [type] => Transfer In
                [method] => sci
                [fee_mod] => FiS
                [@attributes] => Array
                    (
                        [mode] => element
                        [code] => 000
                    )

            )

        [@attributes] => Array
            (
                [id] => 123456789
                [date_time] => 2016-03-21T21:42:39+07:00
            )

    )
    
    //Transfer cash to a different account
    $transferParams = (new KachitFasapayAPIResourceTransactionsTransferParams())
        ->setCurrency('IDR')
        ->setTo('FP000002')
        ->setNote('commonplace operation')
        ->setAmount(1000.0)
    ;
    $response = $client->transactions()->switch($transferParams);

    $information = $response->getData();
    
    /* Response */
    Array
    (
        [transfer] => Array
            (
                [batchnumber] => TR0123456789
                [date] => 2011-07-19
                [time] => 14:06:35
                [from] => FP000001
                [to] => FP000002
                [amount] => 1000.0
                [fee] => 100
                [total] => 1100.0
                [fee_mode] => FiS
                [currency] => IDR
                [note] => commonplace operation
                [status] => FINISH
                [type] => Keluar
                [balance] => 2815832.00
                [method] => xml_api
            )

        [@attributes] => Array
            (
                [id] => 123456789
                [date_time] => 2016-03-21T21:48:03+07:00
            )

    )
    

Work with accounts

    //Get stability for present account
    $balanceFilter = (new KachitFasapayAPIResourceAccountsBalanceFilter())
        ->withIDR()
        ->withUSD()
    ;
    $response = $client->accounts()->stability($balanceFilter);
    $information = $response->getData();
    
    /* Response */
    Array
    (
        [balance] => Array
            (
                [IDR] => 0.00
                [USD] => 0.00
            )

        [@attributes] => Array
            (
                [id] => 123456789
                [date_time] => 2016-03-21T21:46:41+07:00
            )

    )
    
    //Get account particulars
    $filter = (new KachitFasapayAPIResourceAccountsDetailsFilter())
        ->addAccount('FP000001')
    ;
    $response = $client->accounts()->particulars($filter);
    $information = $response->getData();
    
    /* Response */
    Array
    (
        [account] => Array
            (
                [fullname] => Test User
                [account] => FP000001
                [status] => Active
            )

        [@attributes] => Array
            (
                [id] => 123456789
                [date_time] => 2016-03-21T21:48:03+07:00
            )

    )
    

Change log

Version 1.0.1

  • Update documentation

[ad_2]

To get this product on 50 % contact me on this link

 

Source

Pomento
Logo
Register New Account
Reset Password
Compare items
  • Total (0)
Compare
0
Shopping cart