SarsTW / esunacq

玉山銀行信用卡網路收單金流 API Payment Library for Esun ACQ

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Payment Library for ESUN ACQ

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.

About

玉山銀行信用卡網路收單金流 API Payment Library for Esun ACQ


Languages

Language:PHP 100.0%