PHP code example of corneltek / esunacq

1. Go to this page and download the library: Download corneltek/esunacq 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/ */

    

corneltek / esunacq example snippets


use EsunBank\ACQ\AuthRequestBuilder;
use EsunBank\ACQ\TxnType;

$builder = new AuthRequestBuilder('MAC KEY', [
    'MID' => '...',
    'CID' => '...',
    'U'   => '/path/to/response',
]);
$formFields = $builder->formFields('ORDER' . time(), 200, TxnType::INSTALLMENT, $ic = '...', $bpf = '...');

use EsunBank\ACQ\AuthResponseVerifier;
$verifier = new AuthResponseVerifier('MAC KEY', [
    'MID' => '...',
]);
$this->assertTrue($verifier->verify($_REQUEST));