rebootonline / barclaycard
PHP 类,用于集成和处理 Barclaycard 直接链接
dev-master
2017-10-15 21:00 UTC
Requires
- php: >=5.4
Requires (Dev)
- guzzle/guzzle: ^3.9
- guzzlehttp/guzzle: ^6.3
- phpunit/phpunit: 5.2.*
This package is not auto-updated.
Last update: 2024-09-29 04:36:49 UTC
README
PHP 的全功能 Barclaycard 直接链接支付 API 类
类功能
- 符合 PSR-4 自动加载的结构
- 使用 PHPUnit 进行单元测试
- 易于在任何框架或纯 PHP 文件中使用
- 开源
- 允许处理可选字段
- 支持 UTF-8 内容和 8bit、base64、二进制和 quoted-printable 编码
- 与 PHP 5.5 及以上版本兼容
- 命名空间化以防止名称冲突
- 简单且最小化
安装与加载
您可以直接将软件包克隆到应用程序中,并运行 bash composer dump-autoload
git clone https://github.com/rebootonline/Reboot-barclaycard.git composer dump-autoload
使用 composer 在应用程序中安装软件包
composer require rebootonline/barclaycard
简单示例
use Reboot\Barclaycard; /* Step 1 : Instantiate/create your object */ $payment = new Barclaycard($pspid,$user_name, $password, $pw, $payemntUrl); /* Step 2 : Call the amount, card and orderId methods chaining them together in order Step 3 : Call the customer method for additional parameters Step 4 : Call pay method and your done */ $process=$payment->amount($amount, $currency) ->card($expiry_date, $card_number, $card_name, $cvc) ->orderId('abc123') ->customer($email, $phone, $address_1, $town, $postcode) ->pay(); /* To retrieve results call the response method */ echo $process->response(); /* Method 2: you can just pass parameters to pay method after instantiate class then call response method to retrieve results. */ $process=$payment->pay([ 'amount'=>'123', 'currency'=>'gbp', 'expiry_date'=>'10:10', 'card_number'=>'698655445', 'card_name'=>'bob', 'cvc'=>'321', 'order_id'=>'abc123', 'email'=>'ali@rebootonoline.com', 'phone'=>'079856422', 'address'=>'123 st road', 'town'=>'london', 'postcode'=>'e23 6sd' ]); echo $process->response();
许可证
此类开源软件根据 MIT 许可证 许可。