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

PaymentKey   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 7
dl 0
loc 37
rs 10
c 1
b 0
f 1
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getPaymentKey() 0 3 1
A paymentUrl() 0 3 1
A __construct() 0 5 1
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