luciditv / globalpayments-php-sdk
由globalpayments/php-sdk派生
8.0.1
2023-06-13 07:09 UTC
Requires
- php: >= 7.1
- ext-curl: *
- ext-dom: *
- ext-intl: *
- ext-json: *
- ext-mbstring: *
- ext-openssl: *
- ext-zlib: *
Requires (Dev)
- brianium/paratest: 4.0.0 || ^v6.6
- phpstan/phpstan: ^0.12
- phpunit/phpunit: ^7.5 || ^8.5 || ~9.4
- squizlabs/php_codesniffer: 2.*
This package is auto-updated.
Last update: 2024-09-13 09:46:18 UTC
README
Global Payments & Heartland PHP SDK
此SDK使您的PHP应用程序与我们的无卡和有卡API集成变得简单。
解决方案
通用 / 全渠道
- API支付处理
- Apple Pay & Google Pay
- 安全卡存储与客户管理
- 订阅 / 定期收费解决方案
- 信用卡,借记卡,礼品卡与忠诚度,以及电子支票/ACH
无卡(电子商务 & MOTO)特定
- 使用托管支付解决方案最小化PCI合规性要求
- 140+ 授权货币 & 16 结算货币
- 150+ 全球本地支付方式
- 账户更新器
- 内置欺诈预防规则
- 3D Secure,AVS和CVV检查
- 260+ 全球企业欺诈规则
有卡(终端 & POS)特定
- 安全端到端加密
要求
- PHP 7.1.0+
- OpenSSL 1.0.1+
- PHP Curl扩展
- PHP DOM扩展
- PHP OpenSSL扩展
安装
将SDK安装到您的解决方案中通常是通过使用Composer/Packagist,或者将项目添加到您的解决方案中并直接引用它来完成的。
composer require globalpayments/php-sdk
通过直接下载安装
下载并解压,或使用Git,从GitHub 克隆仓库。有关如何克隆仓库的更多信息,请参阅如何克隆仓库。
git clone https://github.com/globalpayments/php-sdk
文档和示例
您可以在Global Payments和Heartland开发者社区中找到最新的SDK文档以及代码示例和测试卡Global Payments和Heartland。
此外,您还可以在我们的示例代码仓库中找到工作示例。
快速提示:包含的测试套件可以成为使用SDK的代码示例的绝佳来源!
处理支付示例
$card = new CreditCardData(); $card->number = "4111111111111111"; $card->expMonth = "12"; $card->expYear = "2025"; $card->cvn = "123"; try { $response = $card->charge(129.99) ->withCurrency("EUR") ->execute(); $result = $response->responseCode; // 00 == Success $message = $response->responseMessage; // [ test system ] AUTHORISED } catch (ApiException $e) { // handle errors }
测试卡数据
测试异常
在您的集成过程中,您将希望测试特定的发卡行响应,例如“卡被拒绝”。因为我们的沙箱环境实际上并没有联系发卡行进行授权,所以有一些特定的交易金额和/或卡号将触发网关和发卡行的响应。请联系您的支持代表以获取用于模拟交易AVS/CVV结果、拒绝、错误和其他可在您的代码中捕获的响应的值的完整列表。示例错误处理代码
try { $response = $card->charge(129.99) ->withCurrency("EUR") ->execute(); } catch (BuilderException $e) { // handle builder errors } catch (ConfigurationException $e) { // handle errors related to your services configuration } catch (GatewayException $e) { // handle gateway errors/exceptions } catch (UnsupportedTransactionException $e) { // handle errors when the configured gateway doesn't support // desired transaction } catch (ApiException $e) { // handle all other errors }
贡献
我们的所有代码都是开源的,我们鼓励其他开发者贡献并帮助改进它!
- 分支
- 创建您的功能分支(
git checkout -b my-new-feature
) - 确保SDK测试通过
- 提交您的更改(
git commit -am 'Add some feature'
) - 推送到分支(
git push origin my-new-feature
) - 创建新的Pull Request
许可证
本项目采用GNU通用公共许可证v2.0。有关更多详细信息,请参阅位于项目根目录的LICENSE.md。