getTransactionReference()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

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