Completed
Push — master ( 69d984...0eb511 )
by Claude
03:26
created

AbstractResponse::isSuccessful()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
nc 1
cc 1
eloc 2
nop 0
crap 1
1
<?php
2
3
namespace Omnipay\Payline\Message;
4
5
/**
6
 * AbstractResponse
7
 */
8
abstract class AbstractResponse extends \Omnipay\Common\Message\AbstractResponse
9
{
10 6
    public function isSuccessful()
11
    {
12 6
        return $this->getCode() === '00000';
13
    }
14
15 6
    public function getCode()
16
    {
17 6
        if (isset($this->data->result->code)) {
18 6
            return $this->data->result->code;
19
        }
20
    }
21
22 6
    public function getMessage()
23
    {
24 6
        if (isset($this->data->result->shortMessage)) {
25 6
            return $this->data->result->shortMessage;
26
        }
27
    }
28
29 6
    public function getLongMessage()
30
    {
31 6
        if (isset($this->data->result->longMessage)) {
32 6
            return $this->data->result->longMessage;
33
        }
34
    }
35
36 6
    public function getToken()
37
    {
38 6
        if (isset($this->data->token)) {
39 6
            return $this->data->token;
40
        }
41
    }
42
}
43