PurchaseResponse::isRedirect()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

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
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Omnipay\Gtpay\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
    const DEMO_REDIRECT_URL = "https://gtweb2.gtbank.com/GTPay/tranx.aspx";
12
13
    const LIVE_REDIRECT_URL = "https://ibank.gtbank.com/GTPay/Tranx.aspx";
14
15 1
    public function getRedirectUrl()
16
    {
17 1
        return ($this->request->getParameters()['testMode'])?self::DEMO_REDIRECT_URL:self::LIVE_REDIRECT_URL;
18
    }
19
20
    public function getRedirectMethod()
21
    {
22
        return 'POST';
23
    }
24
25 1
    public function isSuccessful()
26
    {
27 1
        return false;
28
    }
29
30 1
    public function getRedirectData()
31
    {
32 1
        return $this->data;
33
    }
34
35 1
    public function isRedirect()
36
    {
37 1
        return true;
38
    }
39
}
40