Blockchain API Issues

4 replies 24 views
sat2018Member
Posts: 2 · Reputation: 80
#1Mar 11, 2017, 07:24 AM
So, my code isn't working and I'm not able to get Bitcoin addresses. Anyone have a fix for this? I could really use some help here. /* * * Here's how to use a basic programming function: blockchain * Shared by 0x32 * */ First off, you need to place an order here: https://www.blockchain.com/api/request Then, you should tweak this code for your setup: /* */ <?php $api_key = "api"; // your API key $xpub = "xpub"; // your xpub $secret = "your_secret"; // this can be anything you choose $rootURL = "your site"; $orderID = uniqid(); // your website $callback_url = $rootURL."/callback.php?invoice=".$orderID."&secret=".$secret; $receive_url = "https://api.blockchain.info/v2/receive?key=".$api_key."&xpub=".$xpub."&callback=".urlencode($callback_url); $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_URL, $receive_url); $ccc = curl_exec($ch); $json = json_decode($ccc, true); $payTo = $json['address']; echo $payTo; // This is where your random address will show up. ?> /* */
7 Reply Quote Share
eric_diamondFull Member
Posts: 99 · Reputation: 687
#2Mar 11, 2017, 12:20 PM
Which errror/response are you getting from the API? Where is the uniqid() function coming from? thanks PowerGlove, wasn't aware of php functions.
2 Reply Quote Share
tom.satoshiFull Member
Posts: 87 · Reputation: 549
#3Mar 11, 2017, 03:20 PM
uniqid() is part of PHP (see: Miscellaneous Functions). BTW, I'd take a peek at this user's trust page before deciding whether or not they're worth helping.
6 Reply Quote Share
eric_diamondFull Member
Posts: 99 · Reputation: 687
#4Mar 11, 2017, 07:07 PM
Wait, is bud literally asking for help to create a fake-wallet phishing scam? Godammit. Thanks for the warning (trust not showing up by default on this board etc).
6 Reply Quote Share
bull_2019Senior Member
Posts: 296 · Reputation: 1992
#5Mar 13, 2017, 03:13 PM
I did try it on laravel also.. Although there's no toomuch difference but there was no repetition only with the second & last value... uniqid() is a bad choice Cryptography
4 Reply Quote Share

Related topics