digitickets/omnipay.verifone
Composer 安装命令:
composer require digitickets/omnipay.verifone
包简介
Custom OmniPay driver for Verifone
README 文档
README
Verifone driver for the Omnipay PHP payment library
Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.3+.
This package implements only Verifone support for Omnipay 2.x Off-sites, where the customer is redirected to enter payment details
Installation
This package is installed via Composer. To install, simply add it
to your composer.json file:
{
"require": {
"digitickets/omnipay.verifone": "^0.*"
}
}
And run composer to update your dependencies:
$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update
Basic Usage
The following gateways are provided by this package:
- Verifone
For general usage instructions, please see the main Omnipay repository.
This is a sample code of standard Off-site controller using the driver.
Request a payment
// Gateway setup
$gateway = $this->gatewayFactory('Verifone');
// Pluigns specific parameters
gateway->setMerchantId('00000001');
$gateway->setSystemGuid('12333312322');
$gateway->setTemplateId(123);
//base64 encoded key
$gateway->setKey('asd123asd123=');
$gateway->setKeyName('key_name');
$gateway->setAccount('account');
$gateway->setTestMode(true);
// Create or fetch your product transaction
$transaction = $this->createTransaction($request);
// Get the data ready for the payment
// Please note that even off-site gateways make use of the CreditCard object,
// because often you need to pass customer billing or shipping details through to the gateway.
$cardData = $transaction->asOmniPay;
$itemsBag = $this->requestItemsBag($request);
// Authorize request
$request = $gateway->purchase(array(
'amount' => $transaction->amount,
'currency' => $transaction->currency,
'card' => $cardData,
'returnUrl' => $this->generateCallbackUrl(
'Verifone',
$transaction->id
),
'transactionId' => $transaction->id,
'description' => $transaction->description,
'items' => $itemsBag,
));
// Send request
$response = $request->send();
// Process response
$this->processResponse($response);
Process payment result
// Fetch transaction details
$transaction = Transaction::findOrFail($transactionId);
// Gateway setup
$gateway = $this->gatewayFactory('Verifone');
// Pluigns specific parameters
gateway->setMerchantId('00000001');
$gateway->setSystemGuid('12333312322');
$gateway->setTemplateId(123);
//base64 encoded key
$gateway->setKey('asd123asd123=');
$gateway->setKeyName('key_name');
$gateway->setAccount('account');
$gateway->setTestMode(true);
// Get the data ready to complete the payment. Since this is typically a stateless callback
// we need to first retrieve our original product transaction details
$params = [
"amount" => $transaction->amount,
"currency" => $transaction->currency,
'returnUrl' => $this->generateCallbackUrl(
'Verifone',
$transaction->id
),
'transactionId' => $transaction->id,
'transactionReference' => $transaction->ref,
];
// Complete purchase request
$request = $gateway->completePurchase($params);
// Send request
$response = $request->send();
// Process response
$this->processResponse($response);
digitickets/omnipay.verifone 适用场景与选型建议
digitickets/omnipay.verifone 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 42.01k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 08 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「omnipay」 「verifone」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 digitickets/omnipay.verifone 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 digitickets/omnipay.verifone 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 digitickets/omnipay.verifone 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Verifone (Ocius) driver for the Omnipay payment processing library
Verifone (Ocius) Web Service driver for the Omnipay payment processing library
Verifone Checkout driver for the Omnipay payment processing library
Payyo Gateway for the Omnipay payment processing library
Yandex.Kassa driver for Omnipay payment processing library
2Checkout PHP SDK by Verifone
统计信息
- 总下载量: 42.01k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2019-08-22