jundelleb / laravel-usaepay
这是一个PHP库,允许您连接到USAePay网关,并运行配置需求较少的交易。
v2.1.1
2021-08-20 13:09 UTC
Requires
- illuminate/support: ^5|^6|^7|^8
This package is auto-updated.
Last update: 2024-09-20 19:37:18 UTC
README
安装
使用composer安装
composer require jundelleb/laravel-usaepay
在app/config/app.php
中添加服务提供者
PhpUsaepay\ServiceProvider::class,
配置
现在发布配置文件到config/usaepay.php
$ php artisan vendor:publish
此包支持通过位于config/usaepay.php
的配置文件进行配置
用法
USAePay的基本用法
<?php $sourcekey = 'your_source_key'; $sourcepin = 'your_source_pin'; $sandbox = true; $options = [ 'debug' => true, ]; $usaepay = new \PhpUsaepay\Client($sourcekey, $sourcepin, $sandbox, $options);
示例
此包负责创建ueSecurityToken
。
使用searchCustomerID
方法查找CustNum
<?php $custID = '21021'; $custNum = $usaepay->searchCustomerID($custID);
参考: https://wiki.usaepay.com/developer/soap-1.6/methods/searchcustomerid
使用runTransaction
方法运行销售
<?php $request = [ 'Command' => 'sale', 'AccountHolder' => 'John Doe', 'Details' => [ 'Description' => 'Example Transaction', 'Amount' => '4.00', 'Invoice' => '44539' ], 'CreditCardData' => [ 'CardNumber' => '4444555566667779', 'CardExpiration' => '0919', 'AvsStreet' => '1234 Main Street', 'AvsZip' => '99281', 'CardCode' => '999' ] ]; $result = $usaepay->runTransaction($request);
参考: https://wiki.usaepay.com/developer/soap-1.6/methods/runtransaction
有关方法完整列表的链接: http://wiki.usaepay.com/developer/soap-1.6/Support#methods