1
1
# Omnipay - EveryPay Gateway
2
2
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._
4
4
5
5
[ EveryPay] ( https://every-pay.com/ ) is an Estonian payment provider, currently working with LHV and SEB banks.
6
6
7
7
The package currently supports a limited set of essential features:
8
8
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
17
12
18
13
## Usage
19
14
@@ -24,27 +19,28 @@ $gateway = Omnipay::create('EveryPay')->initialize([
24
19
'username' => '', // EveryPay api username
25
20
'secret' => '', // EveryPay api secret
26
21
'accountId' => '', // merchant account ID
27
- 'testMode' => true, // production mode is not yet supported. coming soon !
22
+ 'testMode' => true, // set to false for production !
28
23
'locale' => 'en', // et=Estonian, see integration guide for more options.
29
24
]);
30
25
```
31
26
32
27
### Process a purchase (Gateway)
28
+
33
29
``` php
34
30
$purchase = $gateway
35
31
->purchase(['amount' => $amount])
32
+ ->setTransactionId(uniqid()) // unique order id for this purchase
36
33
->setClientIp($_SERVER['REMOTE_ADDR']) // optional, helps fraud detection
37
34
->setEmail('') // optional, helps fraud detection
38
35
->setCallbackUrl($callbackUrl) // payment callback where payment result will be sent (with PUT)
39
36
->setCustomerUrl($callbackUrl); // the url to redirect if the payment fails or gets cancelled
40
37
38
+ // Uncomment if you want to make the payment using a previously stored card token
39
+ // $purchase->setCardReference($token);
41
40
42
41
// Uncomment if you want to store the card as a token after the payment
43
42
// $purchase->setSaveCard(true);
44
43
45
- // Uncomment if you want to make the payment using a previously stored card token
46
- // $purchase->setCardReference($token);
47
-
48
44
$response = $purchase->send();
49
45
50
46
// IMPORTANT: Store this payment data somewhere so that we can validate / process it later
@@ -76,15 +72,16 @@ if ($card = $response->getCardToken()) {
76
72
}
77
73
```
78
74
79
- ### Process a purchase (Backend)
75
+ ### Make a token payment (Backend)
76
+
80
77
``` php
81
78
$purchase = $gateway
82
79
->purchase(['amount' => $amount, 'backend' => true])
83
80
->setClientIp($_SERVER['REMOTE_ADDR']) // optional, helps fraud detection
84
81
->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);
88
85
89
86
$response = $purchase->send();
90
87
@@ -98,6 +95,3 @@ if ($response->isSuccessful()) {
98
95
// Check $response->getMessage();
99
96
}
100
97
```
101
-
102
-
103
-
0 commit comments