Bitcoin Forum
May 29, 2024, 07:16:42 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitping API; HTML=POST  (Read 517 times)
WorldOfBitcoin (OP)
Member
**
Offline Offline

Activity: 102
Merit: 10



View Profile
November 29, 2012, 05:44:08 AM
Last edit: November 29, 2012, 05:57:58 AM by WorldOfBitcoin
 #1

I'm drawing a blank on some basic HTML stuff.

Bitping.net API sends a POST. I have a php script set up from twilio that sends a txt any time it is loaded. I have it set on a link now anytime I click it I get a text sent to my cell.

How do set it up so anytime I get a HTML POST from Bitping sent to my page it loads/runs this PHP script?


"from bitping.net "

To get the full benefit of BPN you need to implement the HTTP POST api callback.

We provide a simple example in PHP to receive the events below, please note that the secret value is unique to your account, and should be kept secret.
If you build a module for a webshop, the secret value should be user editable.

When you choose to receive HTTP POST events for a order, we will contact your webserver when a payment has received the required amount of confirmations.
The HTTP POST event will contain the following variables

Code:
 <?php

             $address       
$_POST["to_address"];
              
$amount        $_POST["amount"];
              
$btc           $_POST["btc_amount"];
              
$confirmations $_POST["confirmations"];
              
$txhash        $_POST["txhash"];
              
$block         $_POST["block"];
              
$sig           $_POST["signature"];
              
$mysig sha1(
                
$address .
                
$amount .
                
$confirmations .
                
$txhash .
                
$block .
                
"f632c83ad0f5a44d9a1XXXXXXXXXXXX"
                
);

                if (
$mysig === $sig)
                {
                  
//check if number of confirmations is ok
                  //update order/send user notification
                
} else {
                  
//log all post data, send warning email to administrator
                
}
                   
?>

also;
What is that "$block "f632c83ad0f5a44d9a1XXXXXXXXXXXX"




bitping
https://bitcointalk.org/index.php?topic=55923.0


I can post the twilio php if that helps.
 
rex
Newbie
*
Offline Offline

Activity: 52
Merit: 0


View Profile
March 11, 2013, 07:53:31 AM
 #2

+1

I have the same question.
first I though this secret should be my account password, but if I use that, the sha1.haxdigest() doesn't match with the signature. What is this exactly?

rex
Newbie
*
Offline Offline

Activity: 52
Merit: 0


View Profile
March 11, 2013, 08:05:20 AM
 #3

Finally i sort this out. the "secret key" is just the one that on our api page (in the example the site shows to us)
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!