UrlCreator   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
eloc 5
c 2
b 0
f 0
dl 0
loc 32
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getPaymentUrl() 0 3 1
A getPaymentUrlWithCHK() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
namespace Evilnet\Dotpay\DotpayApi;
4
5
/**
6
 * Class UrlCreator
7
 * @package Evilnet\Dotpay\DotpayApi
8
 */
9
class UrlCreator
10
{
11
    /**
12
     * @var
13
     */
14
    private $pin;
15
16
    /**
17
     * UrlCreator constructor.
18
     * @param $pin
19
     */
20
    public function __construct($pin)
21
    {
22
        $this->pin = $pin;
23
    }
24
25
    /**
26
     * @param $payment
27
     * @return mixed
28
     */
29
    public function getPaymentUrl($payment)
30
    {
31
        return $payment->payment_url;
32
    }
33
34
    /**
35
     * @param $payment
36
     * @return string
37
     */
38
    public function getPaymentUrlWithCHK($payment)
39
    {
40
        return $payment->payment_url.'&chk='.hash('sha256', ($this->pin.$payment->token));
41
    }
42
}
43