Passed
Pull Request — master (#5)
by
unknown
14:45
created

AbstractRequest::getPurse()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
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\Message;
12
13
use Omnipay\Common\Exception\InvalidRequestException;
14
15
/**
16
 * RoboKassa Abstract Request.
17
 */
18
abstract class AbstractRequest extends \Omnipay\Common\Message\AbstractRequest
19
{
20
    protected $zeroAmountAllowed = false;
21
22
    /**
23
     * Get the InvId
24
     *
25
     * @return integer invid. Defaults to 0 (zero)
26
     */
27
    public function getInvId()
28
    {
29
        return $this->getParameter('InvId') ?? 0;
30
    }
31
32
    /**
33
     * Set the InvId value.
34
     *
35
     * @param integer $invid invid
36
     *
37
     * @return self
38
     */
39
    public function setInvId($value)
40
    {
41
        if (!is_numeric($value)) {
42
            throw new InvalidRequestException('Property InvId must be numeric');
43
        }
44
45
        return $this->setParameter('InvId', $value);
46
    }
47
48
    /**
49
     * Get the purse.
50
     *
51
     * @return string purse
52
     */
53
    public function getPurse()
54
    {
55
        return $this->getParameter('purse');
56
    }
57
58
    /**
59
     * Set the purse.
60
     *
61
     * @param string $purse purse
62
     *
63
     * @return self
64
     */
65
    public function setPurse($value)
66
    {
67
        return $this->setParameter('purse', $value);
68
    }
69
70
    /**
71
     * @return string
72
     */
73
    public function getClient()
74
    {
75
        return $this->getParameter('client');
76
    }
77
78
    /**
79
     * @param $value
80
     * @return \Omnipay\Common\Message\AbstractRequest
81
     */
82
    public function setClient($value)
83
    {
84
        return $this->setParameter('client', $value);
85
    }
86
87
    /**
88
     * @return string
89
     */
90
    public function getReceipt()
91
    {
92
        return $this->getParameter('receipt');
93
    }
94
95
    /**
96
     * @param $value
97
     * @return \Omnipay\Common\Message\AbstractRequest
98
     */
99
    public function setReceipt($value)
100
    {
101
        return $this->setParameter('receipt', $value);
102
    }
103
104
    /**
105
     * Get the payment currency label.
106
     *
107
     * @return string
108
     */
109
    public function getCurrencyLabel()
110
    {
111
        return $this->getParameter('currencyLabel');
112
    }
113
114
    /**
115
     * @param string $value
116
     * @return AbstractRequest
117
     */
118
    public function setCurrencyLabel($value)
119
    {
120
        return $this->setParameter('currencyLabel', $value);
121
    }
122
123
    /**
124
     * Get the secret key.
125
     *
126
     * @return string secret key
127
     */
128
    public function getSecretKey()
129
    {
130
        return $this->getParameter('secretKey');
131
    }
132
133
    /**
134
     * Set the secret key.
135
     *
136
     * @param string $key secret key
137
     *
138
     * @return self
139
     */
140
    public function setSecretKey($value)
141
    {
142
        return $this->setParameter('secretKey', $value);
143
    }
144
145
    /**
146
     * Get the secret key for notification signing.
147
     *
148
     * @return string secret key
149
     */
150
    public function getSecretKey2()
151
    {
152
        return $this->getParameter('secretKey2');
153
    }
154
155
    /**
156
     * Set the secret key for notification signing.
157
     *
158
     * @param string $value secret key
159
     *
160
     * @return self
161
     */
162
    public function setSecretKey2($value)
163
    {
164
        return $this->setParameter('secretKey2', $value);
165
    }
166
167
}
168