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

UrlCreator::getPaymentUrl()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 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
}