0% found this document useful (0 votes)
432 views2 pages

Scripthack

This document contains code to generate a Bitcoin payment address using the Blockchain.info API, set up a callback URL to receive notifications, and store received payments in a database. It includes code to: 1. Generate a Bitcoin payment address with the Blockchain.info API and specify a callback URL. 2. Define variables for the callback URL, API key, and payment address. 3. Handle the callback by validating the secret and storing the payment details in a database.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
432 views2 pages

Scripthack

This document contains code to generate a Bitcoin payment address using the Blockchain.info API, set up a callback URL to receive notifications, and store received payments in a database. It includes code to: 1. Generate a Bitcoin payment address with the Blockchain.info API and specify a callback URL. 2. Define variables for the callback URL, API key, and payment address. 3. Handle the callback by validating the secret and storing the payment details in a database.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

$object =

{"address":"19jJyiC6DnKyKvPg38eBE8R6yCSXLLEjqw","index":23,"callback":"https://myst
ore.com?invoice_id=058921123"}

curl "https://api.blockchain.info/v2/receive?
xpub=xpub6CWiJoiwxPQni3DFbrQNHWq8kwrL2J1HuBN7zm4xKPCZRmEshc7Dojz4zMah7E4o2GEEbD6Hgf
G7sQid186Fw9x9akMNKw2mu1PjqacTJB2&callback=https%3A%2F%2Fmystore.com%3Finvoice_id
%3D058921123&key=[yourkeyhere]"

$secret = 'ZzsMLGKe162CfA5EcG6j';
$my_xpub = '{YOUR XPUB ADDRESS}';
$my_api_key = '{YOUR API KEY}';

$my_callback_url = 'https://mystore.com?invoice_id=058921123&secret='.$secret;

$root_url = 'https://api.blockchain.info/v2/receive';

$parameters = 'xpub='.$my_xpub.&callback='.urlencode($my_callback_url).'&key =' .


$my_api_key;

$response = file_get_contents($root_url .'?'.$parameters);

$receive = "1EWRUEGseiF6hb36HM9JDRABxQZtzm3t7i";

$object = json_decode($response);

echo 'Send Payment To : ' . $object->address;

curl -H "Content-Type: text/plain" --data '{"key":"[your-key-


here]","addr":"183qrMGHzMstARRh2rVoRepAd919sGgMHB",
"callback":"https://mystore.com?
invoice_id=123","onNotification":"KEEP","op":"RECEIVE",
"confs":5}'

https://api.blockchain.info/v2/receive/balance_update

$real_secret = 'ZzsMLGKe162CfA5EcG6j';
$invoice_id = $_GET['invoice_id'];
$transaction_hash = $_GET['transaction_hash'];
$value_in_satoshi = $_GET['value'];
$value_in_btc = $value_in_satoshi / 100000000;

if($_GET['test'] == true){ return; }

try{
$database = new SQLiteDatabase('db.sqlite',0666,$error);
}
catch(Exception $e)
{
die($error); }

$stmt = $db->prepare("replace INTO


invoice_payments(invoice_id,transaction_hash,value) values(?,?,?)");
$stmt->bind_param("isd",$invoice_id,$transaction_hash,$value_in_btc);

if($stmt->execute()){

echo "*ok*";
}
Expected Callback

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy