CompletePurchaseResponse::getMessage()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 2
1
<?php
2
3
namespace Omnipay\AllPay\Message;
4
5
class CompletePurchaseResponse extends Response
6
{
7 6
    public function isSuccessful()
8
    {
9 6
        if (isset($this->data['RespCode']) && $this->data['RespCode'] == '00') {
10 3
            return true;
11
        }
12
13 3
        return false;
14
    }
15
16 6
    public function getTransactionReference()
17
    {
18 6
        if (isset($this->data['transID'])) {
19 3
            return $this->data['transID'];
20
        }
21
22 3
        return null;
23
    }
24
25 6
    public function getCode()
26
    {
27 6
        return $this->data['RespCode'];
28
    }
29
30 6
    public function getMessage()
31
    {
32 6
        if (isset($this->data['RespMsg'])) {
33 3
            return $this->data['RespMsg'];
34
        }
35
36 3
        return null;
37
    }
38
}
39