opendns / merchant-esolutions-php
此软件包已被废弃,不再维护。未建议替代包。
Merchant e-Solutions 支付网关和其他 API 的客户端库
v0.1.2
2014-11-19 21:27 UTC
Requires
- php: >= 5.3.3
- guzzlehttp/guzzle: ~3.0
Requires (Dev)
- apigen/apigen: 4.0.0-RC3
- phpunit/phpunit: ~3.7
This package is not auto-updated.
Last update: 2021-06-23 20:48:47 UTC
README
介绍
merchant-esolutions-php 旨在简化使用 Merchant e-Solutions 提供的各种支付 API。
如果您发现任何错误,或有功能请求,请在GitHub 中提交问题或打开拉取请求。
安装
Composer
请确保您的机器上已安装 composer。您需要在应用程序的根目录中创建一个 composer.json
文件。
{ "require": { "opendns/merchant-solutions-php": "~0.1" } }
创建 composer.json
文件后,按照 composer 的步骤来安装 merchant-esolutions-php 软件包。
Composer 会创建自己的自动加载器。将 vendor/autoload.php
包含在您的应用程序配置文件中,您将完全访问 merchant-esolutions-php 客户端。
APIs
此说明文件包含 API 的简短描述和每个 API 的示例,但该项目 GitHub 页面上还有完整的API 参考。
Trident
Trident 是支付网关 API,提供大多数卡片操作。一个简单的交易可能看起来像这样
use OpenDNS\MES\Trident\Sale; $response = Sale::factory(Sale::ENV_TEST) ->setAuthenticationInfo('xxxxxxxxxxx', 'yyyyyyy') ->setAmount(13.37) ->setCardNumber('3499-999999-99991') ->setCardExpiration(12, 2018) ->setCvv2(1234) ->execute(); echo $response['transaction_id'];
报告
报告 API 提供了对 MeS 网关任何报告的完整访问,以 CSV 数据形式。以下是一个示例报告
use OpenDNS\MES\Reporting\Report; $response = Report::factory(Report::ENV_PROD) ->setAuthenticationInfo('xxxxxxxxxxx', 'yyyyyyy') ->setNodeId('zzzzzzzzzz') ->setReportId(Report::REPORT_SETTLEMENT_SUMMARY) ->setBeginDate(new \DateTime('-1 week', new \DateTimeZone('UTC'))) ->setEndDate(new \DateTime('now', new \DateTimeZone('UTC'))) ->setIncludeTridentTransactionId(true) ->execute(); $stream = $response->getResponseBodyStream(); while ($row = fgetcsv($stream)) { echo implode(',', $row); }
周期性计费
周期性计费 API 允许您创建和管理周期性计费配置文件。
注意:如果您正在构建新应用程序,最好使用 Trident API 存储卡片并对它执行额外的销售交易
进一步注意:周期性计费 API 的支持是实验性的,如果您使用它,请随时打开错误/拉取请求。