1 | <?php |
||
7 | class Signature |
||
8 | { |
||
9 | /** |
||
10 | * Endpoint to the public key. |
||
11 | * |
||
12 | * @var string |
||
13 | */ |
||
14 | const ENDPOINT = 'http://www.paysera.com/download/public.key'; |
||
15 | |||
16 | /** |
||
17 | * Generate the signature. |
||
18 | * |
||
19 | * @param string $data |
||
20 | * @param string $password |
||
21 | * @return string |
||
22 | */ |
||
23 | 9 | public static function generate($data, $password) |
|
27 | |||
28 | /** |
||
29 | * Determine the whole signature is valid. |
||
30 | * |
||
31 | * @param array $data |
||
32 | * @param string $password |
||
33 | * @param \Omnipay\Common\Http\ClientInterface $client |
||
34 | * @return bool |
||
35 | */ |
||
36 | 7 | public static function isValid(array $data, $password, ClientInterface $client) |
|
40 | |||
41 | /** |
||
42 | * Determine the SS1 is valid. |
||
43 | * |
||
44 | * @param array $data |
||
45 | * @param string $password |
||
46 | * @return bool |
||
47 | */ |
||
48 | 7 | protected static function isValidSS1(array $data, $password) |
|
52 | |||
53 | /** |
||
54 | * Determine the SS2 is valid. |
||
55 | * |
||
56 | * @param array $data |
||
57 | * @param \Omnipay\Common\Http\ClientInterface $client |
||
58 | * @return bool |
||
59 | */ |
||
60 | 6 | protected static function isValidSS2(array $data, ClientInterface $client) |
|
72 | } |
||
73 |