-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathalif.php
More file actions
41 lines (36 loc) · 1.07 KB
/
alif.php
File metadata and controls
41 lines (36 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
class Alif
{
private $secretkey;
public $key;
public $amount;
public $info;
public $orderId;
public $callbackUrl;
public $returnUrl;
public $email;
public $phone;
public $status;
public $transactionId;
public function __construct($key, $pass)
{
$this->key = $key;
$this->secretkey = hash_hmac('sha256', $pass, $key);
}
function token(){
$this->amount = number_format($this->amount, 2, '.', '');
if($this->amount !== '' && $this->key !== '' && $this->orderId !== '' && $this->callbackUrl !== ''){
return hash_hmac('sha256', $this->key.$this->orderId . $this->amount . $this->callbackUrl, $this->secretkey);
}
}
function callback(){
return hash_hmac('sha256', $this->orderId . $this->status . $this->transactionId, $this->secretkey);
}
function checkOrderToken(){
return hash_hmac('sha256', $this->key.$this->orderId, $this->secretkey);
}
function tokenInfo($jsn){
return hash_hmac('sha256', $jsn, $this->secretkey);
}
}
?>