CompleteAuthorizeResponse::isPending()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
namespace Omnipay\Sofort\Message;
4
5
use Omnipay\Common\Message\RedirectResponseInterface;
6
7
class CompleteAuthorizeResponse extends AbstractResponse implements RedirectResponseInterface
8
{
9
    /**
10
     * Is the response successful?
11
     *
12
     * @return boolean
13
     */
14
    public function isSuccessful()
15
    {
16
        return isset($this->data->transaction_details) &&
17
            false === in_array($this->data->transaction_details->status, array('pending', 'loss', 'refunded'));
18
    }
19
20
21
    /**
22
     * Is the payment pending?
23
     *
24
     * @return boolean
25
     */
26
    public function isPending()
27
    {
28
        return isset($this->data->transaction_details) &&
29
            $this->data->transaction_details->status == 'pending';
30
    }
31
32
33
    /**
34
     * Returns the transaction ID
35
     *
36
     * @return string
37
     */
38
    public function getTransactionId()
39
    {
40
        return $this->getRequest()->getTransactionId();
41
    }
42
43
44
    /**
45
     * Gateway Reference
46
     *
47
     * @return null|string A reference provided by the gateway to represent this transaction
48
     */
49
    public function getTransactionReference()
50
    {
51
        return $this->getRequest()->getTransactionReference();
52
    }
53
}
54