Completed
Pull Request — master (#13)
by
unknown
16:15 queued 12:45
created

PurchaseResponse::isRedirect()   A

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
namespace Omnipay\Paysera\Message;
4
5
use Omnipay\Common\Message\AbstractResponse;
6
use Omnipay\Common\Message\RedirectResponseInterface;
7
8
class PurchaseResponse extends AbstractResponse implements RedirectResponseInterface
9
{
10
    /**
11
     * Get the API endpoint.
12
     *
13
     * @return string
14
     */
15 1
    protected function getEndpoint()
16
    {
17 1
        return 'https://www.paysera.com/pay/';
18
    }
19
20
    /**
21
     * {@inheritdoc}
22
     */
23 1
    public function getRedirectUrl()
24
    {
25 1
        return $this->getEndpoint();
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31 1
    public function isSuccessful()
32
    {
33 1
        return false;
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39 1
    public function isRedirect()
40
    {
41 1
        return true;
42
    }
43
44
    /**
45
     * {@inheritdoc}
46
     */
47 1
    public function getRedirectMethod()
48
    {
49 1
        return 'POST';
50
    }
51
52
    /**
53
     * {@inheritdoc}
54
     */
55 1
    public function getRedirectData()
56
    {
57 1
        return $this->getData();
58
    }
59
}
60