-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcallback.php
More file actions
33 lines (25 loc) · 1.01 KB
/
callback.php
File metadata and controls
33 lines (25 loc) · 1.01 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
<?php
//These are the variable which will be returned as payment notifications
/*
$_POST['amount']
$_POST['bitcoin_address']
$_POST['category']
$_POST['foreign_order_id']
$_POST['number_of_confirmations']
$_POST['order_status']
$_POST['transaction_fee']
$_POST['transaction_timestamp']
$_POST['signature']
*/
$secureString = 'amount=' . $_POST['amount'] . 'bitcoin_address=' . $_POST['bitcoin_address']
. 'category=' . $_POST['category'] . 'foreign_order_id=' . $_POST['foreign_order_id']
. 'number_of_confirmations=' . $_POST['number_of_confirmations'] . 'order_status='
. $_POST['order_status'] . 'transaction_fee=' . $_POST['transaction_fee']
. 'transaction_timestamp=' . $_POST['transaction_timestamp'];
$secureString = hash('sha256','Your API Key' . $secureString);
if ($secureString == $_POST['signature']){
//Save the results of the POST to a database
//-----refer to variables listed at beginning of script
} else {
die('Unauthorized');
}