1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Omnipay\WindcaveHpp; |
4
|
|
|
|
5
|
|
|
use Omnipay\Common\AbstractGateway; |
6
|
|
|
use Omnipay\WindcaveHpp\Message\AcceptNotification; |
7
|
|
|
use Omnipay\WindcaveHpp\Message\CompletePurchaseRequest; |
8
|
|
|
use Omnipay\WindcaveHpp\Message\PurchaseRequest; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* Windcave HPP Payment Gateway |
12
|
|
|
*/ |
13
|
|
|
class Gateway extends AbstractGateway |
14
|
|
|
{ |
15
|
|
|
/** |
16
|
|
|
* Get name |
17
|
|
|
* |
18
|
|
|
* @return string |
19
|
|
|
*/ |
20
|
|
|
public function getName() |
21
|
|
|
{ |
22
|
|
|
return 'Windcave Hpp'; |
23
|
|
|
} |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* Get default parameters |
27
|
|
|
* |
28
|
|
|
* @return array |
29
|
|
|
*/ |
30
|
|
|
public function getDefaultParameters() |
31
|
|
|
{ |
32
|
|
|
return []; |
33
|
|
|
} |
34
|
|
|
|
35
|
|
|
public function setApiUsername($value) |
36
|
|
|
{ |
37
|
|
|
return $this->setParameter('apiUsername', $value); |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
public function getApiUsername() |
41
|
|
|
{ |
42
|
|
|
return $this->getParameter('apiUsername'); |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
public function setApiKey($value) |
46
|
|
|
{ |
47
|
|
|
return $this->setParameter('apiKey', $value); |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
public function getApiKey() |
51
|
|
|
{ |
52
|
|
|
return $this->getParameter('apiKey'); |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* Purchase |
57
|
|
|
* |
58
|
|
|
* @param array $parameters Parameters |
59
|
|
|
* |
60
|
|
|
* @return Omnipay\WindcaveHpp\Message\PurchaseRequest |
|
|
|
|
61
|
|
|
*/ |
62
|
|
|
public function purchase(array $parameters = []) |
63
|
|
|
{ |
64
|
|
|
return $this->createRequest( |
|
|
|
|
65
|
|
|
PurchaseRequest::class, |
66
|
|
|
$parameters |
67
|
|
|
); |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* Complete a purchase process |
72
|
|
|
* |
73
|
|
|
* @param array $parameters |
74
|
|
|
* |
75
|
|
|
* @return Omnipay\WindcaveHpp\Message\CompletePurchaseRequest |
|
|
|
|
76
|
|
|
*/ |
77
|
|
|
public function completePurchase(array $parameters = array()) |
78
|
|
|
{ |
79
|
|
|
return $this->createRequest( |
|
|
|
|
80
|
|
|
CompletePurchaseRequest::class, |
81
|
|
|
$parameters |
82
|
|
|
); |
83
|
|
|
} |
84
|
|
|
|
85
|
|
|
public function acceptNotification(array $parameters = []) |
86
|
|
|
{ |
87
|
|
|
return $this->createRequest( |
88
|
|
|
AcceptNotification::class, |
89
|
|
|
$parameters |
90
|
|
|
); |
91
|
|
|
} |
92
|
|
|
} |
93
|
|
|
|