$my_address = "1LisLsZd3bx8U1NYzpNHqpo8Q6UCXKMJ4z";
$desiredConfirmations = 3;
// If you're using a secret, put it in here
$secret = "7j0ap91o99cxj8k9";
if(!isset($_GET['secret'])) {
if ($_GET["secret"] !== $secret) die();
// Make sure we have all the POST variables we want to get
if(!isset($_POST['input_address']) || !isset($_POST['input_transaction_hash']) || !isset($_POST['transaction_hash']) || !isset($_POST['value']) || !isset($_POST['confirmations']) || !isset($_POST['destination_address'])) {
die('One of more of the POST variables was not set in the request to our callback url.');
if ($_POST["destination_address"] !== $my_address) die();
// Now we can show them the 200 status code as they've passed our checks
$input_address = $_POST["input_address"];
$input_transaction_hash = $_POST["input_transaction_hash"];
$transaction_hash = $_POST["transaction_hash"];
$value_in_btc = $_POST["value"];
$confirmations = $_POST["confirmations"];
// Confirmation check to make sure the confirmations is above our desired amount
if($confirmations >= $desiredConfirmations) {
// We should store the payment as soon as we receive it inside this callback file
// We can later update details such as confirms if needed
// {{ Do your magic here }}
// Transaction has not reached our desired number of confirmations.
// Keep waiting for confirmations to be larger