Completed
Push — master ( 667b31...e64f5b )
by Leith
02:32
created

PurchaseResponse::getTransactionReference()   A

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\CapitaPay360\Message;
4
5
use Omnipay\Common\Message\AbstractResponse;
6
7
/**
8
 * CapitaPay360 Purchase Response
9
 */
10
class PurchaseResponse extends AbstractResponse
11
{
12 2
    public function isSuccessful()
13
    {
14 2
        return false;
15
    }
16
17 2
    public function isRedirect()
18
    {
19 2
        return $this->data->invokeResult->status == 'SUCCESS';
20
    }
21
22 2
    public function getTransactionReference()
23
    {
24 2
        return $this->data->scpReference;
25
    }
26
27 2
    public function getMessage()
28
    {
29 2
        return $this->isRedirect() ? null : $this->data->invokeResult->errorDetails->errorMessage;
30
    }
31
32 2
    public function getRedirectUrl()
33
    {
34 2
        return $this->isRedirect() ? $this->data->invokeResult->redirectUrl : null;
35
    }
36
37 2
    public function getRedirectMethod()
38
    {
39 2
        return 'GET';
40
    }
41
42 2
    public function getRedirectData()
43
    {
44 2
        return null;
45
    }
46
}
47