|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Omnipay\ZipPay; |
|
4
|
|
|
|
|
5
|
|
|
use Omnipay\Common\AbstractGateway; |
|
6
|
|
|
use Omnipay\ZipPay\Message\RestAuthorizeRequest; |
|
7
|
|
|
use Omnipay\ZipPay\Message\RestCompleteAuthorizeRequest; |
|
8
|
|
|
use Omnipay\ZipPay\Message\RestCaptureRequest; |
|
9
|
|
|
use Omnipay\ZipPay\Message\RestCancelRequest; |
|
10
|
|
|
use Omnipay\ZipPay\Message\RestRefundRequest; |
|
11
|
|
|
|
|
12
|
|
|
/** |
|
13
|
|
|
* ZipPay Gateway |
|
14
|
|
|
*/ |
|
15
|
|
|
class RestGateway extends AbstractGateway |
|
16
|
|
|
{ |
|
17
|
3 |
|
public function getName() |
|
18
|
|
|
{ |
|
19
|
3 |
|
return 'ZipPay Rest'; |
|
20
|
|
|
} |
|
21
|
|
|
|
|
22
|
98 |
|
public function getDefaultParameters() |
|
23
|
|
|
{ |
|
24
|
|
|
return array( |
|
25
|
98 |
|
'apiKey' => '', |
|
26
|
36 |
|
'key' => '', |
|
27
|
36 |
|
'testMode' => true, |
|
28
|
36 |
|
); |
|
29
|
|
|
} |
|
30
|
|
|
|
|
31
|
3 |
|
public function getApiKey() |
|
32
|
|
|
{ |
|
33
|
3 |
|
return $this->getParameter('apiKey'); |
|
34
|
|
|
} |
|
35
|
|
|
|
|
36
|
18 |
|
public function setApiKey($value) |
|
37
|
|
|
{ |
|
38
|
18 |
|
return $this->setParameter('apiKey', $value); |
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
3 |
|
public function getKey() |
|
42
|
|
|
{ |
|
43
|
3 |
|
return $this->getParameter('key'); |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
18 |
|
public function setKey($value) |
|
47
|
|
|
{ |
|
48
|
18 |
|
return $this->setParameter('key', $value); |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* @return Message\RestAuthorizeRequest |
|
53
|
|
|
*/ |
|
54
|
12 |
|
public function authorize(array $parameters = array()) |
|
55
|
|
|
{ |
|
56
|
12 |
|
return $this->createRequest(RestAuthorizeRequest::class, $parameters); |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
12 |
|
public function completeAuthorize(array $options = array()) |
|
60
|
|
|
{ |
|
61
|
12 |
|
return $this->createRequest(RestCompleteAuthorizeRequest::class, $options); |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
12 |
|
public function capture(array $options = array()) |
|
65
|
|
|
{ |
|
66
|
12 |
|
return $this->createRequest(RestCaptureRequest::class, $options); |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
12 |
|
public function void(array $options = array()) |
|
70
|
|
|
{ |
|
71
|
12 |
|
return $this->createRequest(RestCancelRequest::class, $options); |
|
72
|
|
|
} |
|
73
|
|
|
|
|
74
|
12 |
|
public function refund(array $options = array()) |
|
75
|
|
|
{ |
|
76
|
12 |
|
return $this->createRequest(RestRefundRequest::class, $options); |
|
77
|
|
|
} |
|
78
|
|
|
} |
|
79
|
|
|
|