CompletePurchaseResponse   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 8
lcom 1
cbo 1
dl 0
loc 34
ccs 14
cts 14
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A isSuccessful() 0 8 3
A getTransactionReference() 0 8 2
A getCode() 0 4 1
A getMessage() 0 8 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