PurchaseResponse::isRedirect()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * InterKassa driver for the Omnipay PHP payment processing library
4
 *
5
 * @link      https://github.com/hiqdev/omnipay-interkassa
6
 * @package   omnipay-interkassa
7
 * @license   MIT
8
 * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace Omnipay\InterKassa\Message;
12
13
use Omnipay\Common\Message\AbstractResponse;
14
use Omnipay\Common\Message\RedirectResponseInterface;
15
16
/**
17
 * InterKassa Purchase Response.
18
 */
19
class PurchaseResponse extends AbstractResponse implements RedirectResponseInterface
20
{
21
    /**
22
     * @var string URL to redirect client to payment system. Used when [[isRedirect]]
23
     */
24
    protected $_redirect = 'https://sci.interkassa.com/';
25
26
    /**
27
     * Always returns `false`, because InterKassa always needs redirect
28
     * {@inheritdoc}
29
     */
30 2
    public function isSuccessful()
31
    {
32 2
        return false;
33
    }
34
35
    /**
36
     * Always returns `true`, because InterKassa always needs redirect
37
     * {@inheritdoc}
38
     */
39 2
    public function isRedirect()
40
    {
41 2
        return true;
42
    }
43
44
    /**
45
     * {@inheritdoc}
46
     */
47 1
    public function getRedirectUrl()
48
    {
49 1
        return $this->_redirect;
50
    }
51
52
    /**
53
     * Always `POST` for InterKassa
54
     * {@inheritdoc}
55
     */
56 2
    public function getRedirectMethod()
57
    {
58 2
        return 'POST';
59
    }
60
61
    /**
62
     * {@inheritdoc}
63
     */
64 2
    public function getRedirectData()
65
    {
66 2
        return $this->data;
67
    }
68
}
69