RefundResponse::getCode()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 0
crap 2
1
<?php
2
3
namespace Omnipay\Emp\Message;
4
5
use Omnipay\Common\Message\AbstractResponse;
6
use Omnipay\Common\Message\RequestInterface;
7
8
/**
9
 * @author    Ivan Kerin <[email protected]>
10
 * @copyright 2014, Clippings Ltd.
11
 * @license   http://spdx.org/licenses/BSD-3-Clause
12
 */
13
class RefundResponse extends AbstractResponse
14
{
15
    /**
16
     * @return boolean
17
     */
18 2
    public function isSuccessful()
19
    {
20 2
        return ($this->getResponse() === 'A');
21
    }
22
23
    /**
24
     * @return string|null
25
     */
26 2
    public function getTransactionReference()
27
    {
28 2
        if (isset($this->data['trans_id'])) {
29 1
            return $this->data['trans_id'];
30
        }
31 1
    }
32
33
    /**
34
     * @return string|null
35
     */
36 3
    public function getResponse()
37
    {
38 3
        if (isset($this->data['response'])) {
39 2
            return $this->data['response'];
40
        }
41 1
    }
42
43
    /**
44
     * @return string|null
45
     */
46 3
    public function getCode()
47
    {
48 3
        if (isset($this->data['responsecode'])) {
49 2
            return $this->data['responsecode'];
50
        }
51 1
    }
52
53
    /**
54
     * @return string|null
55
     */
56 3
    public function getMessage()
57
    {
58 3
        if (isset($this->data['responsetext'])) {
59 2
            return $this->data['responsetext'];
60
        }
61 1
    }
62
}
63