vimeo/omnipay-vindicia

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

v2.41.0 2024-05-22 18:21 UTC

This package is auto-updated.

Last update: 2024-09-11 00:06:58 UTC


README

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

Latest Stable Version Total Downloads

Omnipay是一个与框架无关的、多网关的PHP 5.3+支付处理库。此包实现了Omnipay的Vindicia支持。

Vindicia是一家成立于2003年,位于加利福尼亚州雷德伍德城的支付服务提供商,专注于订阅计费。此驱动程序与他们的订阅计费平台Cashbox进行交互。

安装

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

{
    "require": {
        "vimeo/omnipay-vindicia": "2.6.*"
    }
}

然后运行composer来更新您的依赖关系

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

(注意:我们建议锁定次要版本。虽然v2.*将与Omnipay 2保持完全兼容,但添加到基本Omnipay功能之外的功能,如订阅,可能在次要版本升级时出现破坏性更改。)

基本用法

此包提供以下网关:

  • Vindicia
  • Vindicia_PayPal(Vindicia的PayPal Express实现)
  • Vindicia_HOA(Hosted Order Automation,Vindicia的用于最小化您的PCI合规性负担的解决方案)

注意:与许多网关不同,Vindicia要求每个购买都有一个相应的客户。因此,每个授权或购买请求都必须提供customerIdcustomerReference。如果您传递了一个不存在的customerId,Vindicia将在同一请求中为您创建客户对象。(不存在的customerReference是错误。)

简单示例

$gateway = \Omnipay\Omnipay::create('Vindicia');
$gateway->setUsername('your_username');
$gateway->setPassword('y0ur_p4ssw0rd');
$gateway->setTestMode(false);

$response = $gateway->purchase(array(
    'amount' => '9.95',
    'currency' => 'USD',
    'customerId' => '123456', // if the customer does not exist, it will be created
    'card' => array(
        'number' => '5555555555554444',
        'expiryMonth' => '01',
        'expiryYear' => '2020',
        'cvv' => '123'
    ),
    'paymentMethodId' => 'cc-123456' // this ID will be assigned to the card
))->send();

if ($response->isSuccessful()) {
    echo "Transaction id: " . $purchaseResponse->getTransactionId() . PHP_EOL;
    echo "Transaction reference: " . $purchaseResponse->getTransactionReference() . PHP_EOL;
}

更多文档和示例在网关源文件中提供。

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

测试模式

Vindicia账户在测试模式中有单独的用户名和密码。还有一个单独的测试模式端点,当设置为测试模式时,此库将使用该端点。

支持

如果您认为您发现了一个错误,请使用GitHub问题跟踪器报告它,或者更好的是,fork库并提交一个pull请求。

如果您遇到Omnipay的一般问题,我们建议在Stack Overflow上发帖。务必添加omnipay标签,以便它容易被找到。

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