superbrave / omnipay-icepay-payments
Omnipay支付处理库的Icepay Payments支持(不包括Afterpay)。
1.5.0
2022-01-03 13:23 UTC
Requires
- php: ^7.2.9
- ext-json: *
- league/omnipay: ^3.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.15
- php-http/mock-client: ^1.3
- phpunit/phpunit: ^8.1
- dev-master
- 1.5.0
- 1.4.4
- 1.4.3
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.0
- 1.2.1
- 1.2.0
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.0
- 0.1.0
- dev-dependabot/composer/guzzlehttp/psr7-1.9.1
- dev-dependabot/composer/guzzlehttp/guzzle-6.5.8
- dev-refactor-icepaypayments
- dev-readme
- dev-transaction-status-fix
- dev-3ds-authentication
- dev-query-string
This package is auto-updated.
Last update: 2024-09-19 22:34:10 UTC
README
简介
Omnipay 是一个适用于PHP 7.2.9+的多网关支付处理库,不依赖于任何框架。本包实现了Omnipay的Icepay Payments支持,并支持ICEX2.0。因此,你需要一个 SecretKey
和一个 ContractProfileId
(也称为 UserId
)。
请注意,此实现目前尚不支持授权-捕获(适用于Afterpay)。
安装
要安装,只需将其添加到您的 composer.json
文件中
$ composer require superbrave/omnipay-icepay-payments
初始化
首先,创建Omnipay网关
$gateway = Omnipay\Omnipay::create('\Omnipay\IcepayPayments\Gateway'); // or $gateway = new \Omnipay\IcepayPayments\Gateway(/* $httpClient, $httpRequest */);
然后,使用正确的凭据初始化它
$gateway->initialize([ 'secretKey' => $secretKey, // The given secret key. 'contractProfileId' => $contractProfileId, // The given contract profile id or user id. 'testMode' => false // Optional, default: true ]); // or $gateway->setSecretKey($secretKey); $gateway->setContractProfileId($contractProfileId);
使用方法
有关一般使用说明,请参阅主要的 Omnipay 存储库。
一般流程
交易
要创建新的订单,请使用 transaction
方法
$data = [ 'Contract' => [ 'ContractProfileId' => '85cf0581-36e2-45c7-8d8c-a24c6f52902c', 'AmountInCents' => 1337, 'CurrencyCode' => 'EUR', 'Reference' => '829c7998-6497-402c-a049-51801ba33662', ], 'Postback' => [ 'UrlCompleted' => 'https://www.superbrave.nl/return-url', 'UrlError' => 'https://www.superbrave.nl/cancel-url', 'UrlsNotify' => [ 'https://www.superbrave.nl/notify-url', ], ], 'IntegratorFootprint' => [ 'IPAddress' => '127.0.0.1', 'TimeStampUTC' => '0', ], 'ConsumerFootprint' => [ 'IPAddress' => '127.0.0.1', 'TimeStampUTC' => '0', ], 'Fulfillment' => [ 'PaymentMethod' => 'IDEAL', 'IssuerCode' => 'ABNAMRO', 'AmountInCents' => 1337, 'CurrencyCode' => 'EUR', 'Consumer' => [ 'Address' => [ 'CareOf' => null, 'City' => 'Bree duh', 'CountryCode' => 'NL', 'HouseNumber' => null, 'PostalCode' => '4817 HX', 'Street' => 'Quite 18', ], 'Category' => 'Person', ], 'Timestamp' => '2019-03-09T12:00:00Z', 'LanguageCode' => 'nl', 'CountryCode' => 'NL', 'Reference' => '829c7998-6497-402c-a049-51801ba33662', 'Order' => [ 'OrderNumber' => '12345AB', 'CurrencyCode' => 'EUR', 'TotalGrossAmountCents' => 1337, 'TotalNetAmountCents' => 1337, ], 'Description' => '829c7998-6497-402c-a049-51801ba33662', ], ]; $request = $gateway->authorize($data); $response = $response->send();
状态
$data = [ 'ContractProfileId' => '85cf0581-36e2-45c7-8d8c-a24c6f52902c', 'AmountInCents' => 1337, 'CurrencyCode' => 'EUR', 'Reference' => '829c7998-6497-402c-a049-51801ba33662', ]; $request = $gateway->fetchTransaction($data); $response = $request->send();
退款
请注意:退款实现尚未经过测试。
$data = [ 'ContractProfileId' => '85cf0581-36e2-45c7-8d8c-a24c6f52902c', 'AmountInCents' => 1337, 'CurrencyCode' => 'EUR', 'Reference' => '829c7998-6497-402c-a049-51801ba33662', ]; $request = $gateway->refund($data); $response = $request->send();
许可
此Omnipay网关采用MIT许可。请参阅完整的许可协议。