1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* ePayService driver for the Omnipay PHP payment processing library. |
4
|
|
|
* |
5
|
|
|
* @link https://github.com/hiqdev/omnipay-epayservice |
6
|
|
|
* @package omnipay-epayservice |
7
|
|
|
* @license MIT |
8
|
|
|
* @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/) |
9
|
|
|
*/ |
10
|
|
|
|
11
|
|
|
namespace Omnipay\ePayService; |
12
|
|
|
|
13
|
|
|
use Omnipay\Common\AbstractGateway; |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* Gateway for ePayService. |
17
|
|
|
*/ |
18
|
|
|
class Gateway extends AbstractGateway |
19
|
|
|
{ |
20
|
|
|
/** |
21
|
|
|
* {@inheritdoc} |
22
|
|
|
*/ |
23
|
1 |
|
public function getName() |
24
|
|
|
{ |
25
|
1 |
|
return 'ePayService'; |
26
|
|
|
} |
27
|
|
|
|
28
|
|
|
public function getAssetDir() |
29
|
|
|
{ |
30
|
|
|
return dirname(__DIR__) . '/assets'; |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* {@inheritdoc} |
35
|
|
|
*/ |
36
|
29 |
|
public function getDefaultParameters() |
37
|
|
|
{ |
38
|
|
|
return [ |
39
|
29 |
|
'purse' => '', |
40
|
29 |
|
'secret' => '', |
41
|
29 |
|
'testMode' => false, |
42
|
29 |
|
]; |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* Get the unified purse. |
47
|
|
|
* |
48
|
|
|
* @return string merchant purse |
49
|
|
|
*/ |
50
|
2 |
|
public function getPurse() |
51
|
|
|
{ |
52
|
2 |
|
return $this->getParameter('purse'); |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* Set the unified purse. |
57
|
|
|
* |
58
|
|
|
* @param string $purse merchant purse |
|
|
|
|
59
|
|
|
* |
60
|
|
|
* @return self |
61
|
|
|
*/ |
62
|
29 |
|
public function setPurse($value) |
63
|
|
|
{ |
64
|
29 |
|
return $this->setParameter('purse', $value); |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* Get the unified secret key. |
69
|
|
|
* |
70
|
|
|
* @return string secret key |
71
|
|
|
*/ |
72
|
2 |
|
public function getSecret() |
73
|
|
|
{ |
74
|
2 |
|
return $this->getParameter('secret'); |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* Set the unified secret key. |
79
|
|
|
* |
80
|
|
|
* @param string $value secret key |
81
|
|
|
* |
82
|
|
|
* @return self |
83
|
|
|
*/ |
84
|
29 |
|
public function setSecret($value) |
85
|
|
|
{ |
86
|
29 |
|
return $this->setParameter('secret', $value); |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* @param array $parameters |
91
|
|
|
* |
92
|
|
|
* @return \Omnipay\ePayService\Message\PurchaseRequest |
93
|
|
|
*/ |
94
|
3 |
|
public function purchase(array $parameters = []) |
95
|
|
|
{ |
96
|
3 |
|
return $this->createRequest('\Omnipay\ePayService\Message\PurchaseRequest', $parameters); |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* @param array $parameters |
101
|
|
|
* |
102
|
|
|
* @return \Omnipay\ePayService\Message\CompletePurchaseRequest |
103
|
|
|
*/ |
104
|
3 |
|
public function completePurchase(array $parameters = []) |
105
|
|
|
{ |
106
|
3 |
|
return $this->createRequest('\Omnipay\ePayService\Message\CompletePurchaseRequest', $parameters); |
107
|
|
|
} |
108
|
|
|
} |
109
|
|
|
|
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.