taiwan-pay/chb-payment

Payment library for CHB bank in Taiwan.

0.1 2019-03-16 07:37 UTC

This package is not auto-updated.

Last update: 2024-04-22 13:21:36 UTC


README

Build Status codecov

Payment library for CHB bank in Taiwan. It use simply web api for CHB bank.

Install

$ composer require taiwan-pay/chb-payment

Usage

  • initiate the payment
use TaiwanPay\CHBPayment;

$payment = new CHBPayment([
    'macKey' => $macKey,
    'key' => $key,
    'merID' => $merID,
    'MerchantID' => $MerchantID,
    'TerminalID' => $TerminalID,
    'MerchantName' => $MerchantName
], false);
  • authenticate an order
// get auth data and render form by yourself
$payment->auth($orderNumber, $amount, $type, $resUrl, $createTime, false);

// get auth form and render it
$payment->auth($orderNumber, $amount, $type, $resUrl, $createTime, true);
  • search an order
// get search data and render form by yourself
$payment->search($orderNumber, $amount, $resUrl, false);

// get search form and render it
$payment->search($orderNumber, $amount, $resUrl, true);

Note: All the response will be POST to $resUrl from bank.

License

MIT