Completed
Push — master ( 6076b7...14e5c9 )
by Aimeos
01:41
created

CompleteAuthorizeResponse::isPending()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 2
eloc 3
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
     * Gateway Reference
35
     *
36
     * @return null|string A reference provided by the gateway to represent this transaction
37
     */
38
    public function getTransactionReference()
39
    {
40
        return $this->getRequest()->getTransactionReference();
41
    }
42
}
43