PurchaseResponse   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A isSuccessful() 0 4 1
A isRedirect() 0 4 1
A getRedirectUrl() 0 4 1
1
<?php
2
/**
3
 * @link https://github.com/phpviet/omnipay-vnpay
4
 *
5
 * @copyright (c) PHP Viet
6
 * @license [MIT](https://opensource.org/licenses/MIT)
7
 */
8
9
namespace Omnipay\VNPay\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
     * Đường dẫn dẫn khách đến hệ thống VNPay để thanh toán.
22
     *
23
     * @var string
24
     */
25
    private $redirectUrl;
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    public function __construct(RequestInterface $request, array $data, string $redirectUrl)
31
    {
32
        $this->redirectUrl = $redirectUrl;
33
34
        parent::__construct($request, $data);
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40
    public function isSuccessful(): bool
41
    {
42
        return false;
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48
    public function isRedirect(): bool
49
    {
50
        return true;
51
    }
52
53
    /**
54
     * {@inheritdoc}
55
     */
56
    public function getRedirectUrl(): string
57
    {
58
        return $this->redirectUrl;
59
    }
60
}
61