PaymentKey::__construct()   A
last analyzed

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
    private 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 string      $paymentKey
18
     * @param int|null    $code
19
     * @param string|null $message
20
     */
21
    public function __construct(string $paymentKey, ?int $code = null, ?string $message = null)
22
    {
23
        parent::__construct($code, $message);
24
25
        $this->paymentKey = $paymentKey;
26
    }
27
28
    /**
29
     * @return string
30
     */
31
    public function getPaymentKey(): string
32
    {
33
        return $this->paymentKey;
34
    }
35
36
    /**
37
     * @return string
38
     */
39
    public function paymentUrl(): string
40
    {
41
        return self::PAYMENT_PAGE . $this->paymentKey;
42
    }
43
}
44