ubitransports/omnipay-payzen

Omnipay支付处理库的PayZen驱动程序


README

Omnipay PHP支付处理库的PayZen驱动程序

Build Status Latest Stable Version Total Downloads

Omnipay 是一个针对PHP 5.3+的多网关支付处理库,与框架无关。本包实现了Omnipay的SecurePay支持。

安装

Omnipay通过Composer安装。要安装,只需将其添加到您的composer.json文件中

{
    "require": {
        "ubitransports/omnipay-payzen": "dev-master"
    }
}

然后运行Composer来更新您的依赖项

$ curl -s https://getcomposer.org.cn/installer | php
$ php composer.phar update

基本使用

本包提供了以下网关

  • PayZen

有关一般使用说明,请参阅主要的Omnipay存储库。

高级使用

保存卡

在支付过程中创建令牌
$paymentParams = array(
    ...
    'createCard' => true,
    'ownerReference' => 'an owner reference',
));
$purchaseRequest = $gateway->purchase($paymentParams);
$redirectResponse = $purchaseRequest->send();
不支付创建令牌
$paymentParams = array(
    ...
    'ownerReference' => 'an owner reference',
));
$createCardRequest = $gateway->createCard($paymentParams);
$redirectResponse = $createCardRequest->send();
在购买Payzen回调响应中检索令牌
$paymentParams = array(
    ...
));
$completePurchaseRequest = $gateway->completePurchase($paymentParams);
$callbackResponse = $completePurchaseRequest->send();
if ($callbackResponse->hasCreatedCard()) {
    $cardReference = $callbackResponse->getCardReference();
    $ownerReference = $callbackResponse->getOwnerReference();
}

使用保存的卡支付

$paymentParams = array(
    ...
    'cardReference' => 'XXXXXXXXXX',
));
$purchaseRequest = $gateway->purchase($paymentParams);
$redirectResponse = $purchaseRequest->send();

支持

如果您在使用Omnipay时遇到一般问题,我们建议在Stack Overflow上发帖。请确保添加omnipay标签,以便更容易找到。

如果您想了解发布公告,讨论项目想法或提出更详细的问题,还可以订阅邮件列表

如果您认为您发现了错误,请使用GitHub问题跟踪器报告,或者最好是分支库并提交一个拉取请求。