Passed
Push — master ( 025568...a4d989 )
by Orkhan
01:44 queued 11s
created

PaymentKey::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 3
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Orkhanahmadov\Goldenpay\Response;
4
5
class PaymentKey extends Response
6
{
7
    public const PAYMENT_PAGE = 'https://rest.goldenpay.az/web/paypage?payment_key=';
8
9
    /**
10
     * @var string
11
     */
12
    private $paymentKey;
13
14
    /**
15
     * PaymentKey constructor.
16
     *
17
     * @param int $code
18
     * @param string $message
19
     * @param string $paymentKey
20
     */
21
    public function __construct(int $code, string $message, string $paymentKey)
22
    {
23
        parent::__construct($code, $message);
24
25
        $this->paymentKey = $paymentKey;
26
    }
27
28
    /**
29
     * @return string
30
     */
31
    public function paymentUrl(): string
32
    {
33
        return self::PAYMENT_PAGE.$this->paymentKey;
34
    }
35
36
    /**
37
     * @return string
38
     */
39
    public function getPaymentKey(): string
40
    {
41
        return $this->paymentKey;
42
    }
43
}
44