corneltek/esunacq

EsunBank ACQ Payment API

1.0.0 2016-05-11 03:43 UTC

This package is auto-updated.

Last update: 2024-10-29 05:09:06 UTC


README

Latest Stable Version Latest Unstable Version Total Downloads

This payment library isn't tight coupled to the frameworks, models or db connections, you can use this library to build up the forms or verify the response separately.

Installation

composer require corneltek/esunacq

Usage

For the config variables, please check your documentation from Esunbank.

AuthRequestBuilder

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 = '...');

AuthResponseVerifier

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

See examples for more details.