台湾支付/chb-payment

台湾CHB银行的支付库。

0.1 2019-03-16 07:37 UTC

This package is not auto-updated.

Last update: 2024-09-23 15:19:27 UTC


README

Build Status codecov

台湾CHB银行的支付库。它使用简单的CHB银行Web API。

安装

$ composer require taiwan-pay/chb-payment

使用

  • 发起支付
use TaiwanPay\CHBPayment;

$payment = new CHBPayment([
    'macKey' => $macKey,
    'key' => $key,
    'merID' => $merID,
    'MerchantID' => $MerchantID,
    'TerminalID' => $TerminalID,
    'MerchantName' => $MerchantName
], false);
  • 验证订单
// 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);
  • 搜索订单
// 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);

注意:所有响应都将通过银行POST到 $resUrl

许可证

MIT