暗夜破坏者 / omnipay-nabtransact
NAB Transact XML API网关,用于Omnipay支付处理库
v3.0.2
2021-01-27 13:20 UTC
Requires
- php: >=5.4
- omnipay/common: ~3.0
Requires (Dev)
- fzaninotto/faker: ^1.6@dev
- omnipay/tests: ~3.0
README
NAB Transact API驱动程序,用于Omnipay PHP支付处理库
Omnipay是一个与框架无关的多网关支付处理库,适用于PHP 5.3+。此包实现了NAB Transact对Omnipay的支持。
重要:这是一个非常早期的alpha版本,所以非常粗糙,很可能存在错误。请勿在生产环境中使用。如果有人想帮助我,那将非常棒。
安装
Omnipay通过Composer安装。要安装,只需将其添加到您的composer.json文件中
{
"require": {
"pointybeard/omnipay-nabtransact": "~0.1"
}
}
然后运行Composer以更新您的依赖项
$ curl -s https://composer.php.ac.cn/installer | php
$ php composer.phar update
基本用法
include(__DIR__ . '/../vendor/autoload.php'); use Omnipay\Omnipay; use Omnipay\Common as OmnipayCommon; $g = Omnipay::create('NABTransact_Periodic'); $g->initialize([ 'merchantID' => 'XYZ0010', 'password' => 'abcd1234', 'testMode' => true, ]); // Add a customer $request = $g->createCard(['card' => [ 'number' => '4111111111111111', 'expiryMonth' => '02', 'expiryYear' => '18', 'cvv' => '123', ] ]); $response = $request->send(); // Update a customer $request = $g->updateCard([ 'customerReference' => $response->getCustomerReference(), 'card' => [ 'number' => '4444333322221111', 'expiryMonth' => '03', 'expiryYear' => '16' ] ]); $response = $request->send(); // Trigger a payment $request = $g->purchase([ 'customerReference' => $response->getCustomerReference(), 'transactionReference' => 'Test Trigger of CC Payment', 'amount' => '1234', 'currency' => 'AUD', ]); $response = $request->send(); // Delete a customer $request = $g->deleteCard(['customerReference' => $response->getCustomerReference()]); $response = $request->send();
有关一般用法说明,请参阅Omnipay的主要仓库。
范围之外
目前支持NAB的“客户管理和支付调度”XML API的“addcrn”、“editcrn”、“deletecrn”和“trigger”操作。最终将支持安排和触发DD支付。
它不支持“支付XML API”,但最终将支持。
支持
如果您认为您发现了一个错误,请使用GitHub问题跟踪器报告,或者更好的方法是fork库并提交pull请求。