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