Completed
Push — master ( 079ef7...480dec )
by Marco
01:06
created

Response::isSuccessful()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Omnipay\Heidelpay\Message;
4
5
use Omnipay\Common\Message\AbstractResponse;
6
use Omnipay\Common\Message\RequestInterface;
7
8
/**
9
 * Response
10
 */
11
class Response extends AbstractResponse
12
{
13
    public function __construct(RequestInterface $request, $data)
14
    {
15
        $this->request = $request;
16
        $this->data = $data;
17
    }
18
19
    public function isSuccessful()
20
    {
21
        return $this->data['isSuccess'];
22
    }
23
24
    public function isRedirect()
25
    {
26
        return isset($this->data['redirectUrl']);
27
    }
28
29
    public function getRedirectUrl()
30
    {
31
        return $this->data['redirectUrl'];
32
    }
33
34
    public function isPending()
35
    {
36
        return $this->data['isPending'];
37
    }
38
39
    public function getTransactionReference()
40
    {
41
        if (isset($this->data['id'])) {
42
            return $this->data['id'];
43
        }
44
    }
45
}
46