CompletePurchaseResponse   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 42
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 42
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A isSuccessful() 0 4 2
A getTransactionReference() 0 4 2
A getMessage() 0 4 2
A getCardType() 0 4 2
1
<?php
2
3
namespace Omnipay\BPOINT\Message;
4
5
use Omnipay\Common\Message\AbstractResponse;
6
use Omnipay\Common\Exception\InvalidResponseException;
7
8
/**
9
 * BPOINT Complete Purchase Response
10
 */
11
class CompletePurchaseResponse extends AbstractResponse
12
{
13
    /**
14
     * Is the response successful?
15
     *
16
     * @return boolean
17
     */
18 6
    public function isSuccessful()
19
    {
20 6
        return isset($this->data['ResponseCode']) && $this->data['ResponseCode'] == 0;
21
    }
22
23
    /**
24
     * Get the authorisation code if available.
25
     *
26
     * @return null|string
27
     */
28 6
    public function getTransactionReference()
29
    {
30 6
        return isset($this->data['AuthoriseId']) ? $this->data['AuthoriseId'] : null;
31
    }
32
33
    /**
34
     * Get the merchant response message if available.
35
     *
36
     * @return null|string
37
     */
38 6
    public function getMessage()
39
    {
40 6
        return isset($this->data['ResponseText']) ? $this->data['ResponseText'] : null;
41
    }
42
43
    /**
44
     * Get the card type if available.
45
     *
46
     * @return null|string
47
     */
48 6
    public function getCardType()
49
    {
50 6
        return isset($this->data['CardType']) ? $this->data['CardType'] : null;
51
    }
52
}
53