Completed
Push — master ( 8fe2d8...225854 )
by Andrii
20:54 queued 20:54
created

PurchaseResponse   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 80%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 5
c 2
b 0
f 0
lcom 0
cbo 1
dl 0
loc 50
ccs 8
cts 10
cp 0.8
rs 10

5 Methods

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