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.
?>
/* */
Blockchain API Issues
4 replies 24 views
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.
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.
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).
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
Related topics
- Erlay seems to have some issues here’s a better proposal for a bitcoin protocol without invites 3
- Extracting R values from blockchain signatures 14
- Twist Attack, Sub-Group Attack and Pollard-Rho Implementation Issues 4
- issues with bitcoin core database read error 2
- Issues connecting Bitcoin Full Node 3
- Bitcoin Core displaying coins (UTXOs) in a new tab 13