PurchaseResponse   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 44
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A isSuccessful() 0 4 1
A getRedirectUrl() 0 4 1
A isRedirect() 0 4 1
1
<?php
2
/**
3
 * @link https://github.com/phpviet/omnipay-onepay
4
 *
5
 * @copyright (c) PHP Viet
6
 * @license [MIT](https://opensource.org/licenses/MIT)
7
 */
8
9
namespace Omnipay\OnePay\Message;
10
11
use Omnipay\Common\Message\RedirectResponseInterface;
12
use Omnipay\Common\Message\RequestInterface;
13
14
/**
15
 * @author Vuong Minh <[email protected]>
16
 * @since 1.0.0
17
 */
18
class PurchaseResponse extends Response implements RedirectResponseInterface
19
{
20
    /**
21
     * @var string
22
     */
23
    private $redirectUrl;
24
25
    /**
26
     * Khởi tạo đối tượng PurchaseResponse.
27
     *
28
     * @param  \Omnipay\Common\Message\RequestInterface  $request
29
     * @param $data
30
     * @param $redirectUrl
31
     */
32
    public function __construct(RequestInterface $request, $data, $redirectUrl)
33
    {
34
        parent::__construct($request, $data);
35
        $this->redirectUrl = $redirectUrl;
36
    }
37
38
    /**
39
     * {@inheritdoc}
40
     */
41
    public function isSuccessful(): bool
42
    {
43
        return false;
44
    }
45
46
    /**
47
     * {@inheritdoc}
48
     */
49
    public function getRedirectUrl(): string
50
    {
51
        return $this->redirectUrl;
52
    }
53
54
    /**
55
     * {@inheritdoc}
56
     */
57
    public function isRedirect(): bool
58
    {
59
        return true;
60
    }
61
}
62