Passed
Pull Request — master (#8)
by
unknown
04:36
created

UrlCreator   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 5
dl 0
loc 17
rs 10
c 0
b 0
f 0

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
    private $pin;
12
13
    public function __construct($pin)
14
    {
15
        $this->pin = $pin;
16
    }
17
18
    public function getPaymentUrl($payment)
19
    {
20
        return $payment->payment_url;
21
    }
22
23
    public function getPaymentUrlWithCHK($payment)
24
    {
25
        return $payment->payment_url.'&chk='.hash('sha256', ($this->pin.$payment->token));
26
    }
27
28
}