1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Omnipay\CapitaPay360; |
4
|
|
|
|
5
|
|
|
use Omnipay\Common\AbstractGateway; |
6
|
|
|
use Omnipay\CapitaPay360\Message\CompletePurchaseRequest; |
7
|
|
|
use Omnipay\CapitaPay360\Message\PurchaseRequest; |
8
|
|
|
|
9
|
|
|
/** |
10
|
|
|
* CapitaPay360 Redirect Gateway |
11
|
|
|
*/ |
12
|
|
|
class RedirectGateway extends AbstractGateway |
13
|
|
|
{ |
14
|
1 |
|
public function getName() |
15
|
|
|
{ |
16
|
1 |
|
return 'Capita Pay360 Redirect'; |
17
|
|
|
} |
18
|
|
|
|
19
|
27 |
|
public function getDefaultParameters() |
20
|
|
|
{ |
21
|
|
|
return array( |
22
|
27 |
|
'scpId' => '', |
23
|
|
|
'siteId' => '', |
24
|
|
|
'hmacKeyId' => '', |
25
|
|
|
'hmacKey' => '', |
26
|
|
|
'testMode' => false, |
27
|
|
|
); |
28
|
|
|
} |
29
|
|
|
|
30
|
2 |
|
public function getScpId() |
31
|
|
|
{ |
32
|
2 |
|
return $this->getParameter('scpId'); |
33
|
|
|
} |
34
|
|
|
|
35
|
4 |
|
public function setScpId($value) |
36
|
|
|
{ |
37
|
4 |
|
return $this->setParameter('scpId', $value); |
38
|
|
|
} |
39
|
|
|
|
40
|
2 |
|
public function getSiteId() |
41
|
|
|
{ |
42
|
2 |
|
return $this->getParameter('siteId'); |
43
|
|
|
} |
44
|
|
|
|
45
|
4 |
|
public function setSiteId($value) |
46
|
|
|
{ |
47
|
4 |
|
return $this->setParameter('siteId', $value); |
48
|
|
|
} |
49
|
|
|
|
50
|
2 |
|
public function getHmacKeyId() |
51
|
|
|
{ |
52
|
2 |
|
return $this->getParameter('hmacKeyId'); |
53
|
|
|
} |
54
|
|
|
|
55
|
4 |
|
public function setHmacKeyId($value) |
56
|
|
|
{ |
57
|
4 |
|
return $this->setParameter('hmacKeyId', $value); |
58
|
|
|
} |
59
|
|
|
|
60
|
2 |
|
public function getHmacKey() |
61
|
|
|
{ |
62
|
2 |
|
return $this->getParameter('hmacKey'); |
63
|
|
|
} |
64
|
|
|
|
65
|
4 |
|
public function setHmacKey($value) |
66
|
|
|
{ |
67
|
4 |
|
return $this->setParameter('hmacKey', $value); |
68
|
|
|
} |
69
|
|
|
|
70
|
2 |
|
public function purchase(array $parameters = array()) |
71
|
|
|
{ |
72
|
2 |
|
return $this->createRequest('\Omnipay\CapitaPay360\Message\PurchaseRequest', $parameters); |
73
|
|
|
} |
74
|
|
|
|
75
|
2 |
|
public function completePurchase(array $parameters = array()) |
76
|
|
|
{ |
77
|
2 |
|
return $this->createRequest('\Omnipay\CapitaPay360\Message\CompletePurchaseRequest', $parameters); |
78
|
|
|
} |
79
|
|
|
} |
80
|
|
|
|