eventcollect / omnipay-eventcollect
EventCollect driver for the Omnipay PHP payment processing library
Package info
github.com/EventCollect/omnipay-eventcollect
pkg:composer/eventcollect/omnipay-eventcollect
Requires
- php: >=7.4
- ext-json: *
- omnipay/common: ^3
Requires (Dev)
- omnipay/tests: ^4.1
- phpro/grumphp: ^1.4
- squizlabs/php_codesniffer: ^3.6
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
EventCollect payment processing driver for the Omnipay PHP payment processing library
Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements EventCollect support for Omnipay.
Installation
Omnipay is installed via Composer. To install, simply require league/omnipay and eventvollect/omnipay-eventcollect with Composer:
composer require league/omnipay EventCollect/omnipay-eventcollect
Basic Usage
The following gateways are provided by this package:
- EventCollect
For general usage instructions, please see the main Omnipay repository.
$gateway = Omnipay::create('EventCollect'); $gateway->setApiKey('[API_KEY]');
Credit card payments
try { $params = array( 'amount' => 10.00, 'card' => $card, 'payment_method' => 'card' ); $response = $gateway->purchase($params)->send(); if ($response->isSuccessful()) { // successful } else { throw new ApplicationException($response->getMessage()); } } catch (ApplicationException $e) { throw new ApplicationException($e->getMessage()); }
ACH / bank account payments
Bank accounts are charged through the same purchase() request — pass a bankAccount instead of a card:
$response = $gateway->purchase([ 'amount' => 50.00, 'currency' => 'USD', 'bankAccount' => [ 'accountNumber' => '123456789', 'routingNumber' => '021000021', 'accountType' => 'checking', // checking | savings 'accountHolderType' => 'individual', // individual | business ], 'billingFirstName' => 'Jane', 'billingLastName' => 'Doe', 'billingAddress1' => '1 Main St', 'billingCity' => 'Boston', 'billingPostcode' => '02101', ])->send();
bankAccount, card and source are mutually exclusive — a request carries exactly one of them. Malformed bank account details throw an InvalidBankAccountException before the request is sent.
Two further rules are enforced by the API rather than the driver, and surface through $response->getMessage():
- ACH is available for
USDandCADonly, and the currency must be enabled for bank account payments on your API key. billingCompanyis required whenaccountHolderTypeisbusiness.
Bank accounts cannot be stored as payment sources, so createCard() and updateCard() remain card-only.
Support
If you are having general issues with Omnipay, we suggest posting on Stack Overflow. Be sure to add the omnipay tag so it can be easily found.
If you want to keep up to date with release announcements, discuss ideas for the project, or ask more detailed questions, there is also a mailing list which you can subscribe to.
If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.