Difference between revisions of "WalletBit/API/Lookup"

From Bitcoin Wiki
Jump to: navigation, search
(Created page with "===Lookup deposit to Bitcoin address=== <source lang="php"> $fields = array( 'merchant' => 'owner@example.com', 'address' => '1BPeF1tGHQj1tHoyZkFps1QKCbnqdx2yHE' ); $fiel...")
 
Line 19: Line 19:
 
</source>
 
</source>
  
If successful $response returns a json encoded array containing amount, confirmations, txid and timestamp of deposit to the provided Bitcoin address, otherwise empty.
+
If successful $response returns a json encoded array containing batch number, amount, fee, confirmations, txid, address and timestamp of deposit to the provided Bitcoin address, otherwise empty.

Revision as of 17:19, 1 December 2012

Lookup deposit to Bitcoin address

$fields = array(
  'merchant' => 'owner@example.com',
  'address' => '1BPeF1tGHQj1tHoyZkFps1QKCbnqdx2yHE'
);
$fields['encrypted'] = strtoupper(hash('sha256', $fields['merchant'] . ':' . $fields['address'] . ':' . 'API Key'));

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://walletbit.com/api/lookup/deposit');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POST, count($fields));
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($fields));
$response = curl_exec($ch);
curl_close($ch);

If successful $response returns a json encoded array containing batch number, amount, fee, confirmations, txid, address and timestamp of deposit to the provided Bitcoin address, otherwise empty.