Completed
Push — master ( 219a3a...fd86aa )
by Paweł
14:57
created

GetStatus::isPayedout()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sylius\Bundle\PayumBundle\Request;
13
14
use Payum\Core\Request\BaseGetStatus;
15
use Sylius\Component\Payment\Model\PaymentInterface;
16
17
class GetStatus extends BaseGetStatus
18
{
19
    /**
20
     * {@inheritdoc}
21
     */
22
    public function markNew()
23
    {
24
        $this->status = PaymentInterface::STATE_NEW;
25
    }
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    public function isNew()
31
    {
32
        return $this->status === PaymentInterface::STATE_NEW;
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38
    public function markSuspended()
39
    {
40
        $this->status = PaymentInterface::STATE_PROCESSING;
41
    }
42
43
    /**
44
     * {@inheritdoc}
45
     */
46
    public function isSuspended()
47
    {
48
        return $this->status === PaymentInterface::STATE_PROCESSING;
49
    }
50
51
    /**
52
     * {@inheritdoc}
53
     */
54
    public function markExpired()
55
    {
56
        $this->status = PaymentInterface::STATE_FAILED;
57
    }
58
59
    /**
60
     * {@inheritdoc}
61
     */
62
    public function isExpired()
63
    {
64
        return $this->status === PaymentInterface::STATE_FAILED;
65
    }
66
67
    /**
68
     * {@inheritdoc}
69
     */
70
    public function markCanceled()
71
    {
72
        $this->status = PaymentInterface::STATE_CANCELLED;
73
    }
74
75
    /**
76
     * {@inheritdoc}
77
     */
78
    public function isCanceled()
79
    {
80
        return $this->status === PaymentInterface::STATE_CANCELLED;
81
    }
82
83
    /**
84
     * {@inheritdoc}
85
     */
86
    public function markPending()
87
    {
88
        $this->status = PaymentInterface::STATE_PROCESSING;
89
    }
90
91
    /**
92
     * {@inheritdoc}
93
     */
94
    public function isPending()
95
    {
96
        return $this->status === PaymentInterface::STATE_PROCESSING;
97
    }
98
99
    /**
100
     * {@inheritdoc}
101
     */
102
    public function markFailed()
103
    {
104
        $this->status = PaymentInterface::STATE_FAILED;
105
    }
106
107
    /**
108
     * {@inheritdoc}
109
     */
110
    public function isFailed()
111
    {
112
        return $this->status === PaymentInterface::STATE_FAILED;
113
    }
114
115
    /**
116
     * {@inheritdoc}
117
     */
118
    public function markUnknown()
119
    {
120
        $this->status = PaymentInterface::STATE_UNKNOWN;
121
    }
122
123
    /**
124
     * {@inheritdoc}
125
     */
126
    public function isUnknown()
127
    {
128
        return $this->status === PaymentInterface::STATE_UNKNOWN;
129
    }
130
131
    /**
132
     * {@inheritdoc}
133
     */
134
    public function markCaptured()
135
    {
136
        $this->status = PaymentInterface::STATE_COMPLETED;
137
    }
138
139
    /**
140
     * {@inheritdoc}
141
     */
142
    public function isCaptured()
143
    {
144
        return $this->status === PaymentInterface::STATE_COMPLETED;
145
    }
146
147
    /**
148
     * {@inheritdoc}
149
     */
150
    public function isAuthorized()
151
    {
152
        return $this->status === PaymentInterface::STATE_AUTHORIZED;
153
    }
154
155
    /**
156
     * {@inheritdoc}
157
     */
158
    public function markAuthorized()
159
    {
160
        $this->status = PaymentInterface::STATE_AUTHORIZED;
161
    }
162
163
    /**
164
     * {@inheritdoc}
165
     */
166
    public function isRefunded()
167
    {
168
        return $this->status === PaymentInterface::STATE_REFUNDED;
169
    }
170
171
    /**
172
     * {@inheritdoc}
173
     */
174
    public function markRefunded()
175
    {
176
        $this->status = PaymentInterface::STATE_REFUNDED;
177
    }
178
179
    /**
180
     * {@inheritdoc}
181
     */
182
    public function isPayedout()
183
    {
184
        return $this->status === PaymentInterface::STATE_PAYEDOUT;
185
    }
186
187
    /**
188
     * {@inheritdoc}
189
     */
190
    public function markPayedout()
191
    {
192
        $this->status = PaymentInterface::STATE_PAYEDOUT;
193
    }
194
}
195