Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //implementing the callback file
- $secret = "your_secret";
- if($_GET['secret'] != $secret)
- {
- die('Stop doing that');
- }
- else
- {
- //update DB
- $order_num = $_GET['invoice'];
- $amount = $_GET['value']; //default value is in satoshis
- //$amountCalc = $amount / 100000000; //optional convert to bitcoins
- $queryUpdate = "UPDATE orders SET paid = 1, recd = $amount WHERE orderid = '$order_num'";
- $doUpdate = mysqli_query($conn, $queryUpdate) or die(mysqli_error($conn));
- echo "*ok*"; // you must echo *ok* on the page or blockchain will keep sending callback requests every block up to 1,000 times!
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement