lemonstand / omnipay-vantiv
为Omnipay支付处理库提供Vantiv支付驱动程序
v1.0.0
2016-03-28 14:00 UTC
Requires
- omnipay/common: ~2.0
Requires (Dev)
- omnipay/tests: ~2.0
This package is not auto-updated.
Last update: 2024-09-28 16:25:54 UTC
README
为Omnipay PHP支付处理库提供的Vantiv支付处理驱动程序
Omnipay 是一个针对PHP 5.3+的框架无关的多网关支付处理库。此软件包实现了Omnipay对Vantiv支付的支持。有关更多信息,请参阅完整的 Vantiv 文档。
安装
Omnipay 通过 Composer 安装。要安装,只需将其添加到您的 composer.json
文件中
{ "require": { "lemonstand/omnipay-vantiv": "~1.0" } }
然后运行Composer来更新您的依赖项
$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update
基本用法
此软件包提供以下网关
- 购买(销售)
- 授权
$gateway = Omnipay::create('Vantiv'); $gateway->setMerchantId($merchantId); $gateway->setUsername($username); $gateway->setPassword($password); // Test mode hits the sandbox endpoint, and pre-live mode hits that preLive endpoint // If both are set the pre-live endpoint takes precedence $gateway->setTestMode($testMode); $gateway->setPreLiveMode($preLiveMode); try { $params = [ 'transactionId' => $transactionId, 'orderId' => $orderId, 'customerId' => $customerId, 'reportGroup' => $reportGroup, 'amount' => $amount, 'currency' => $currency, 'card' => $validCard, 'description' => $description ]; $response = $gateway->purchase($params)->send(); if ($response->isSuccessful()) { // successfull } else { throw new ApplicationException($response->getMessage()); } } catch (ApplicationException $e) { throw new ApplicationException($e->getMessage()); }
有关通用使用说明,请参阅主要的 Omnipay 仓库。
支持
如果您在使用Omnipay时遇到一般问题,我们建议您在 Stack Overflow 上发表帖子。请确保添加 omnipay 标签,以便它容易被找到。
如果您想了解发布公告,讨论项目的想法或提出更详细的问题,还可以订阅 邮件列表。
如果您认为您已发现一个错误,请使用 GitHub问题跟踪器 报告它,或者更好的是,分叉库并提交一个pull请求。