|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Omnipay\Emp; |
|
4
|
|
|
|
|
5
|
|
|
use Omnipay\Common\AbstractGateway; |
|
6
|
|
|
|
|
7
|
|
|
/** |
|
8
|
|
|
* @author Ivan Kerin <[email protected]> |
|
9
|
|
|
* @copyright 2014, Clippings Ltd. |
|
10
|
|
|
* @license http://spdx.org/licenses/BSD-3-Clause |
|
11
|
|
|
*/ |
|
12
|
|
|
class Gateway extends AbstractGateway |
|
13
|
|
|
{ |
|
14
|
|
|
/** |
|
15
|
|
|
* @return string |
|
16
|
|
|
*/ |
|
17
|
1 |
|
public function getName() |
|
18
|
|
|
{ |
|
19
|
1 |
|
return 'eMerchantPay'; |
|
20
|
|
|
} |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* @return array |
|
24
|
|
|
*/ |
|
25
|
26 |
|
public function getDefaultParameters() |
|
26
|
|
|
{ |
|
27
|
|
|
return array( |
|
28
|
26 |
|
'clientId' => '', |
|
29
|
26 |
|
'apiKey' => '', |
|
30
|
26 |
|
); |
|
31
|
|
|
} |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* @return string |
|
35
|
|
|
*/ |
|
36
|
2 |
|
public function getClientId() |
|
37
|
|
|
{ |
|
38
|
2 |
|
return $this->getParameter('clientId'); |
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* @param string $value |
|
43
|
|
|
*/ |
|
44
|
27 |
|
public function setClientId($value) |
|
45
|
|
|
{ |
|
46
|
27 |
|
return $this->setParameter('clientId', $value); |
|
47
|
|
|
} |
|
48
|
|
|
|
|
49
|
|
|
/** |
|
50
|
|
|
* @return string |
|
51
|
|
|
*/ |
|
52
|
2 |
|
public function getApiKey() |
|
53
|
|
|
{ |
|
54
|
2 |
|
return $this->getParameter('apiKey'); |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
/** |
|
58
|
|
|
* @param string $value |
|
59
|
|
|
*/ |
|
60
|
27 |
|
public function setApiKey($value) |
|
61
|
|
|
{ |
|
62
|
27 |
|
return $this->setParameter('apiKey', $value); |
|
63
|
|
|
} |
|
64
|
|
|
|
|
65
|
|
|
/** |
|
66
|
|
|
* @return string |
|
67
|
|
|
*/ |
|
68
|
1 |
|
public function getProxy() |
|
69
|
|
|
{ |
|
70
|
1 |
|
return $this->getParameter('proxy'); |
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
|
|
/** |
|
74
|
|
|
* Set a proxy through which to pass all the requests. |
|
75
|
|
|
* E.g. usr:[email protected]:8888 |
|
76
|
|
|
* |
|
77
|
|
|
* @param string $value |
|
78
|
|
|
*/ |
|
79
|
27 |
|
public function setProxy($value) |
|
80
|
|
|
{ |
|
81
|
27 |
|
return $this->setParameter('proxy', $value); |
|
82
|
|
|
} |
|
83
|
|
|
|
|
84
|
|
|
/** |
|
85
|
|
|
* @return Threatmetrix |
|
86
|
|
|
*/ |
|
87
|
1 |
|
public function getThreatmetrix() |
|
88
|
|
|
{ |
|
89
|
1 |
|
return $this->getParameter('threatmetrix'); |
|
90
|
|
|
} |
|
91
|
|
|
|
|
92
|
|
|
/** |
|
93
|
|
|
* @param Threatmetrix $threatmetrix |
|
94
|
|
|
*/ |
|
95
|
1 |
|
public function setThreatmetrix(Threatmetrix $threatmetrix) |
|
96
|
|
|
{ |
|
97
|
1 |
|
return $this->setParameter('threatmetrix', $threatmetrix); |
|
98
|
|
|
} |
|
99
|
|
|
|
|
100
|
|
|
/** |
|
101
|
|
|
* @param array $parameters |
|
102
|
|
|
* @return Omnipay\Emp\Message\PurchaseRequest |
|
103
|
|
|
*/ |
|
104
|
4 |
|
public function purchase(array $parameters = array()) |
|
105
|
|
|
{ |
|
106
|
4 |
|
return $this->createRequest(__NAMESPACE__.'\Message\PurchaseRequest', $parameters); |
|
107
|
|
|
} |
|
108
|
|
|
|
|
109
|
|
|
/** |
|
110
|
|
|
* @param array $parameters |
|
111
|
|
|
* @return Omnipay\Emp\Message\RefundRequest |
|
112
|
|
|
*/ |
|
113
|
4 |
|
public function refund(array $parameters = array()) |
|
114
|
|
|
{ |
|
115
|
4 |
|
return $this->createRequest(__NAMESPACE__.'\Message\RefundRequest', $parameters); |
|
116
|
|
|
} |
|
117
|
|
|
} |
|
118
|
|
|
|