paypronl/omnipay-paypro

Omnipay的PayPro网关

dev-master / 0.1.x-dev 2015-06-01 12:54 UTC

This package is not auto-updated.

Last update: 2024-09-14 17:58:50 UTC


README

Omnipay PHP支付处理库的PayPro网关

Software License Build Status

Omnipay 是一个与框架无关的多网关支付处理库,适用于PHP 5.3+。此包实现了Omnipay的PayPro支持。

这里应该是你的描述。尽量限制在一两段之内,并提及你支持的PSRs,以避免与用户和贡献者产生混淆。

安装

此网关可以使用 Composer 安装

$ composer require paypronl/omnipay-paypro:0.1.x@dev

使用方法

此包提供以下网关

  • PayPro

示例

require_once  __DIR__ . '/vendor/autoload.php';

use Omnipay\Omnipay;

/** @var \Omnipay\PayPro\Gateway $gateway */
$gateway = Omnipay::create('PayPro');

$gateway->initialize([
    'apiKey' => 'YOUR API KEY HERE',
    'productId' => null,
    'testMode' => true,
]);

$params = array(
    'amount' => 12.34,
    'description' => 'Payment test',
    'returnUrl' => 'www.your-domain.nl/return_here',
    'notifyUrl' => 'www.your-domain.nl/notify_here', //see http://www.paypro.nl/postback
    'transactionId' => 'abc12345',
    'issuer' => 'ideal/RABONL2U',
    'productId' => 12345,
    'card' => array(
        'email' => 'info@example.com',
        'name' => 'My name',
    ),
);

$response = $gateway->purchase($params)->send();

if ($response->isSuccessful()) {
    echo 'Success!';
} elseif ($response->isRedirect()) {
    $response->redirect();
} else {
    echo 'Failed';
}

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

参数

你可以设置以下参数

  • apiKey (必需):PayPro.nl API密钥
  • amount (必需):金额,作为浮点数/小数
  • productId:你的PayPro.nl产品ID
  • description:订单描述
  • transactionId:自定义transactionId
  • issuer:支付方式,见 http://www.paypro.nl/api 了解所有支付方式(选择get_all_pay_methods)
  • vat:增值税百分比
  • returnUrl:支付完成后显示的URL
  • notifyUrl:发布状态的URL(postback url)
  • testMode:表示测试的布尔值

卡信息

你可以使用卡对象设置以下信息。

  • name / firstName + lastName
  • email
  • address1 / billingAddress1
  • address2 / billingAddress2
  • postcode / billingPostcode
  • city / billingCity
  • country / billingCountry

有关更多信息,请参阅 http://omnipay.thephpleague.com/api/cards/

支付方式

你可以使用 fetchPaymentMethods() 获取所有可用的支付方式,并使用 fetchIssuers() 获取所有方法的可用发行商。可以将发行商ID传递给 purchase() 方法来直接配置支付方式。

$methods = $gateway->fetchPaymentMethods()->send()->getPaymentMethods();

/** @var \Omnipay\Common\PaymentMethod $method */
foreach ($methods as $method) {
    echo $method->getId();
    echo $method->getName();
}

$issuers = $gateway->fetchIssuers()->send()->getIssuers();

/** @var \Omnipay\Common\Issuer $issuer */
foreach ($issuers as $issuer) {
    echo $issuer->getId();
    echo $issuer->getName();
    echo $issuer->getPaymentMethod();
}

支持

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

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

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

变更日志

请参阅 CHANGELOG 以了解最近更改的内容。

测试

$ composer test

贡献

请参阅 CONTRIBUTING 了解详细信息。

安全

如果您发现任何安全相关的问题,请通过电子邮件 support@paypro.nl 而不是使用问题跟踪器。

致谢

许可协议

MIT 许可协议(MIT)。更多信息请参阅许可文件