arbory / omnipay-everypay
Every Pay omnipay package
Installs: 1 009
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
Requires
- php: >=7.2.0
- omnipay/common: ~3.0
Requires (Dev)
- omnipay/tests: ^3.1
- php-coveralls/php-coveralls: ^2.2
- php-vcr/php-vcr: ^1.4
- phpro/grumphp: ^0.19.1
- phpunit/phpunit: ^6.0
- squizlabs/php_codesniffer: ^3.5
This package is auto-updated.
Last update: 2024-12-04 06:58:15 UTC
README
Usage
Require the package using composer:
composer require arbory/omnipay-everypay
Initialize the gateway
$gateway = Omnipay::create('EveryPay')->initialize([ 'username' => '', // EveryPay api username 'secret' => '', // EveryPay api secret 'accountName' => '', // merchant account name 'gatewayUrl' => 'https://igw-demo.every-pay.com/api/v3', // use merchant provided url for production ]);
Process a authorize (Gateway)
$authorize = $gateway ->authorize([ 'amount' => '1.28', 'transactionId' => uniqid(), 'email' => 'user@example.com', 'customerIp' => '1.2.3.4', 'callbackUrl' => 'https://shop.example.com/cart', 'customerUrl' => 'https://shop.example.com/cart' ]); $response = $authorize->send(); // Gateway transaction reference $response->getTransactionReference(); return $response->redirect(); // this will call redirect to payment portal
Complete Payment (handle Gateway redirect from EveryPay)
EveryPay will return to your callback url with a GET
request once the payment is finalized.
You need to validate this response and check if the payment succeeded.
// Here, pass the payment array that we previously stored when creating the payment $response = $gateway->completeAuthorize(['transactionReference' => 'foo')->send(); if ($response->isSuccessful()) { // Payment succeeded! } // Payment succeeded! // Here's your payment reference number: $response->getTransactionReference()