Passed
Push — master ( 22c4a0...baf55d )
by
unknown
03:13
created

PurchaseResponse   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 21
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A isRedirect() 0 3 1
A getRedirectMethod() 0 3 1
A isSuccessful() 0 3 1
A getRedirectUrl() 0 5 1
1
<?php
2
3
namespace Omnipay\SmartPay\Message;
4
5
use Omnipay\Common\Message\AbstractResponse;
6
use Omnipay\Common\Message\RedirectResponseInterface;
7
8
/**
9
 * Bank Muscat Redirect Response
10
 */
11
class PurchaseResponse extends AbstractResponse implements RedirectResponseInterface {
12
    public function isSuccessful()
13
    {
14
        return false;
15
    }
16
17
    public function isRedirect()
18
    {
19
        return true;
20
    }
21
22
    public function getRedirectUrl()
23
    {
24
//        echo '<pre>'; print_r($this->data['url']); echo '</pre>'; die;
25
26
        return $this->data['url'] ?? '';
27
    }
28
29
    public function getRedirectMethod()
30
    {
31
        return 'GET';
32
    }
33
}