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