PurchaseResponse::getRedirectUrl()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * @link https://github.com/phpviet/omnipay-vtcpay
4
 *
5
 * @copyright (c) PHP Viet
6
 * @license [MIT](https://opensource.org/licenses/MIT)
7
 */
8
9
namespace Omnipay\VTCPay\Message;
10
11
use Omnipay\Common\Message\RequestInterface;
12
use Omnipay\Common\Message\RedirectResponseInterface;
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  array  $data
30
     * @param  string  $redirectUrl
31
     */
32
    public function __construct(RequestInterface $request, array $data, string $redirectUrl)
33
    {
34
        $this->redirectUrl = $redirectUrl;
35
36
        parent::__construct($request, $data);
37
    }
38
39
    /**
40
     * {@inheritdoc}
41
     */
42
    public function isSuccessful(): bool
43
    {
44
        return false;
45
    }
46
47
    /**
48
     * {@inheritdoc}
49
     */
50
    public function isRedirect(): bool
51
    {
52
        return true;
53
    }
54
55
    /**
56
     * {@inheritdoc}
57
     */
58
    public function getRedirectUrl(): string
59
    {
60
        return $this->redirectUrl;
61
    }
62
}
63