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

Response   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 7
lcom 1
cbo 1
dl 0
loc 35
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A isSuccessful() 0 4 1
A isRedirect() 0 4 1
A getRedirectUrl() 0 4 1
A isPending() 0 4 1
A getTransactionReference() 0 6 2
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