Bloackchain
Bloackchain
try {
//create or open the database
$database = new SQLiteDatabase('db.sqlite', 0666, $error);
} catch(Exception $e) {
die($error);
}
if($stmt->execute()) {
echo "*ok*";
}
curl "https://api.blockchain.info/v2/receive/checkgap?
xpub=[yourxpubhere]]&key=[yourkeyhere]"
{"gap":2}
curl "https://api.blockchain.info/v2/receive/callback_log?callback=https%3A%2F
%2Fmystore.com%3Finvoice_id%3D05892112%26secret
%3DZzsMLGKe162CfA5EcG6j&key=[yourkeyhere]"
[
{
"callback": "https://mystore.com?
invoice_id=058921123&secret=ZzsMLGKe162CfA5EcG6j&key=[yourkeyhere]",
"called_at": "2015-10-21T22:43:47Z",
"raw_response": "*bad*",
"response_code": 200
},
{
"callback": "http://mystore.com?
invoice_id=058921123&secret=ZzsMLGKe162CfA5EcG6j&key=[yourkeyhere]",
"called_at": "2015-10-21T22:43:55Z",
"raw_response": "*bad*",
"response_code": 200
}
]
if ($_GET['confirmations'] >= 6) {
//Insert into confirmed payments
echo '*ok*';
} else {
//Insert into pending payments
//Don't print *ok* so the notification resent again on next confirmation
}