CompletePurchaseResponse::getCode()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
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