11# Omnipay - EveryPay Gateway
22
3- * Disclaimer : This package is ** not** an official package by EveryPay AS nor by omnipay.*
3+ _ Disclaimer : This package is ** not** an official package by EveryPay AS nor by omnipay._
44
55[ EveryPay] ( https://every-pay.com/ ) is an Estonian payment provider, currently working with LHV and SEB banks.
66
77The package currently supports a limited set of essential features:
88
9- - Charging through Gateway API
10- - Charging through Backend API (using tokens)
11- - Requesting card tokens
12-
13- ** WARNING:** Not production ready yet!
14-
15- - [ ] Add production endpoints
16- - [ ] Fix remaining todos
9+ - Charge cards through the Gateway API (redirect)
10+ - Requesting card tokens (Gateway API only)
11+ - Token payments using Backend API
1712
1813## Usage
1914
@@ -24,27 +19,28 @@ $gateway = Omnipay::create('EveryPay')->initialize([
2419 'username' => '', // EveryPay api username
2520 'secret' => '', // EveryPay api secret
2621 'accountId' => '', // merchant account ID
27- 'testMode' => true, // production mode is not yet supported. coming soon !
22+ 'testMode' => true, // set to false for production !
2823 'locale' => 'en', // et=Estonian, see integration guide for more options.
2924]);
3025```
3126
3227### Process a purchase (Gateway)
28+
3329``` php
3430$purchase = $gateway
3531 ->purchase(['amount' => $amount])
32+ ->setTransactionId(uniqid()) // unique order id for this purchase
3633 ->setClientIp($_SERVER['REMOTE_ADDR']) // optional, helps fraud detection
3734 ->setEmail('') // optional, helps fraud detection
3835 ->setCallbackUrl($callbackUrl) // payment callback where payment result will be sent (with PUT)
3936 ->setCustomerUrl($callbackUrl); // the url to redirect if the payment fails or gets cancelled
4037
38+ // Uncomment if you want to make the payment using a previously stored card token
39+ // $purchase->setCardReference($token);
4140
4241// Uncomment if you want to store the card as a token after the payment
4342// $purchase->setSaveCard(true);
4443
45- // Uncomment if you want to make the payment using a previously stored card token
46- // $purchase->setCardReference($token);
47-
4844$response = $purchase->send();
4945
5046// IMPORTANT: Store this payment data somewhere so that we can validate / process it later
@@ -76,15 +72,16 @@ if ($card = $response->getCardToken()) {
7672}
7773```
7874
79- ### Process a purchase (Backend)
75+ ### Make a token payment (Backend)
76+
8077``` php
8178$purchase = $gateway
8279 ->purchase(['amount' => $amount, 'backend' => true])
8380 ->setClientIp($_SERVER['REMOTE_ADDR']) // optional, helps fraud detection
8481 ->setEmail(''); // optional, helps fraud detection
85-
86- // Uncomment and pass a valid card token here
87- // $purchase->setCardReference($token);
82+
83+ // Pass a valid card token here
84+ $purchase->setCardReference($token);
8885
8986$response = $purchase->send();
9087
@@ -98,6 +95,3 @@ if ($response->isSuccessful()) {
9895 // Check $response->getMessage();
9996}
10097```
101-
102-
103-
0 commit comments