PHP code example of mbah-dhaim / kampil-client

1. Go to this page and download the library: Download mbah-dhaim/kampil-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mbah-dhaim / kampil-client example snippets


   $processor = \CSI\Kampil\Client\ClientProcessor::of();
   

   $processor->getSetting()->setApiUrl(KAMPIL-API-URL)->setIssuerSecret(YOUR-SECRET-KEY)->setIssuerCode(YOUR-CODE)->setIssuerApiKey(YOUR-API-KEY);
   

   $data = new \CSI\Kampil\Client\Request\BaseRequest();
   $trackingNumber = 123456;
   $requestPayload = $processor->initRequest($trackingNumber)->withData($data)->buildPayload();
   $responsePayload = $processor->send($requestPayload);
   $response = $processor->parsePayload($responsePayload);   
   

   $data = new \CSI\Kampil\Client\Request\CreateVARequest();
   //  

   $data = new \CSI\Kampil\Client\Request\InquiryVARequest();
   // 

   $data = new \CSI\Kampil\Client\Request\TopupRequest();
   //  

   $data = new \CSI\Kampil\Client\Request\TransferRequest();
   // -NUMBER;
   $data->amount = TRANSFER-AMOUNT;