superbrave / omnipay-icepay-payments
Icepay Payments support (excluding Afterpay) for Omnipay payment processing library.
Installs: 1 365
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 3
Forks: 2
Open Issues: 2
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-11-19 22:48:18 UTC
README
Introduction
Omnipay is a framework agnostic, multi-gateway payment
processing library for PHP 7.2.9+. This package implements Icepay Payments support for Omnipay and it supports ICEX2.0. Therefore you need a SecretKey
and a ContractProfileId
(also known as UserId
).
Do note that this implementation does not support Authorise-Capture (for Afterpay) yet.
Installation
To install, simply add it to your composer.json
file:
$ composer require superbrave/omnipay-icepay-payments
Initialization
First, create the Omnipay gateway:
$gateway = Omnipay\Omnipay::create('\Omnipay\IcepayPayments\Gateway'); // or $gateway = new \Omnipay\IcepayPayments\Gateway(/* $httpClient, $httpRequest */);
Then, initialize it with the correct credentials:
$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);
Usage
For general usage instructions, please see the main Omnipay repository.
General flow
- Create a transaction.
- Check for the transaction status.
- Perform one refund(s) operations if needed.
Transaction
To create a new order, use the transaction
method:
$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();
Status
$data = [ 'ContractProfileId' => '85cf0581-36e2-45c7-8d8c-a24c6f52902c', 'AmountInCents' => 1337, 'CurrencyCode' => 'EUR', 'Reference' => '829c7998-6497-402c-a049-51801ba33662', ]; $request = $gateway->fetchTransaction($data); $response = $request->send();
Refund
Do note: refunds implementation has not been tested.
$data = [ 'ContractProfileId' => '85cf0581-36e2-45c7-8d8c-a24c6f52902c', 'AmountInCents' => 1337, 'CurrencyCode' => 'EUR', 'Reference' => '829c7998-6497-402c-a049-51801ba33662', ]; $request = $gateway->refund($data); $response = $request->send();
License
This omnipay gateway is under the MIT license. See the complete license.