PurchaseResponse   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 80%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 2
dl 0
loc 32
ccs 8
cts 10
cp 0.8
c 0
b 0
f 0
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getRedirectUrl() 0 4 2
A getRedirectMethod() 0 4 1
A isSuccessful() 0 4 1
A getRedirectData() 0 4 1
A isRedirect() 0 4 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