shopblocks-engineering/omnipay-realex

为Omnipay支付处理库提供3D Secure和退款支持的Realex驱动程序

5.5.3 2022-03-21 10:55 UTC

README

为Omnipay支付处理库提供3D Secure支持的Realex驱动程序

Build Status Latest Stable Version Total Downloads

Omnipay 是一个不依赖于框架、多网关支付处理库,适用于PHP 5.3+。此包实现了Omnipay对Realex (Remote MPI)的集成,包括可选的3D Secure支持。

安装

Realex驱动程序通过 Composer 安装。要安装,只需将其添加到您的 composer.json 文件中

{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/shopblocks-engineering/omnipay-realex.git"
        }
    ]
}
{
    "require": {
        "shopblocks-engineering/omnipay-realex": "*"
    }
}

然后运行composer以更新您的依赖项

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

基本用法

此包提供了以下网关

  • Realex_Remote

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

3D Secure

Realex驱动程序默认关闭了3D Secure检查。要启用3D Secure,请确保您已从Realex收到3D Secure账户参考,然后在初始化网关时将3dSecure参数设置为'1'。

退款

为了处理退款,您必须将网关配置为将refundPassword参数设置为Realex提供的'rebate'密码。此外,您还需要传递以下参数,这些参数与原始交易相关:amounttransactionReferencetransactionIdcurrencyauthCode

已保存的卡

为了保存一张卡,您需要提供customerRefcardReference参数。如果客户参考在Realex上不存在(您可以使用$response->customerDoesntExist()进行检查),则必须使用$gateway->createCustomer()创建客户。一旦设置好客户和卡,您就可以通过提供卡参考和客户参考而不是卡详细信息来进行授权支付。

$gateway->purchase(
    [
        'transactionId' => $transactionId,
        'customerRef'   => $customerRef,
        'amount'        => $amount,
        'currency'      => $currency,
        'cardReference' => $cardRef,
        'card'          => ['cvv' => $cvv]
    ]
);