<p>You need to run a local nodejs service. From there you can then integrate with php.  </p>

<p>As of January 2016 Blockchain.info made changes to the wallet API service that now require you to run a local nodeJS service to handle the calls. This will require you to have root access to your webserver so you will need to use a VPS instead of a basic shared web host. </p>

<ul>
<li>Create an account with blockchain.info, and register an email
address. </li>
<li>Request an API key here <a href="https://blockchain.info/api/api_create_code" rel="nofollow noreferrer">https://blockchain.info/api/api_create_code</a> </li>
<li>Login to your blockchain wallet, goto account settings, IP Restrictions and check the box to allow API access </li>
<li>Goto DigitalOcean, register, create a new droplet, goto one-click-install and choose the MEAN stack Other options are up to you, I chose $5/month and IPv6 </li>
<li>Open your console or SSH through putty </li>
<li>type <code>root</code>, enter your password, create a new password </li>
<li>Now you're in! </li>
<li>type <code>sudo apt-get update</code> </li>
<li>now install nodejs </li>
<li>type <code>sudo apt-get install nodejs</code> </li>
<li>press <code>y</code> to accept </li>
<li>install NPM </li>
<li>sudo <code>apt-get install npm</code></li>
<li><code>y</code> to accept </li>
<li>install blockchain-wallet </li>
<li>type <code>npm install -g blockchain-wallet-service</code> </li>
<li>if you see some warnings or errors, don't worry </li>
<li>once complete verify it installed </li>
<li>navigate to <code>usr/local/bin</code></li>
<li>type <code>node blockchain-wallet-service -V</code> </li>
<li>if installed it should return with the version number </li>
<li>you can now launch the service, but first we will want to install apache and PHP so we can interact with it outside of nodejs </li>
<li>Navigate back to root </li>
<li>Install Apache </li>
<li>type <code>sudo apt-get update</code> </li>
<li>type <code>sudo apt-get install apache2</code> </li>
<li>Install PHP </li>
<li>type <code>sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt</code> </li>
<li>Install curl </li>
<li>type <code>sudo apt-get install php5-curl</code> </li>
<li>Restart your VPS <code>reboot</code></li>
<li>Launch the blockchain-wallet-service </li>
<li>navigate to <code>usr/local/bin</code> </li>
<li>type <code>node blockchain-wallet-service start --port 3030</code> </li>
<li><p>Login to your wallet using the below code</p>

<p>$url = "<a href="http://127.0.0.1:3030/merchant/YOUR-GUID/login?password=YOUR-PASSWORD&amp;api_code=YOUR-API-CODE" rel="nofollow noreferrer">http://127.0.0.1:3030/merchant/YOUR-GUID/login?password=YOUR-PASSWORD&amp;api_code=YOUR-API-CODE</a>";<br>
$ch = curl_init();<br>
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);<br>
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);<br>
curl_setopt($ch, CURLOPT_URL, $url);<br>
$ccc = curl_exec($ch);<br>
$json = json_decode($ccc, true);<br>
var_dump($json); </p></li>
</ul>

<p>Save the above and run it on your server. The file should keep spinning and loading since blockchain doesn't recognize the IP address. Wait for it to timeout about 60 seconds, and then check your email. Blockchain should have sent you an API access attempt showing what IP tried to connect. Follow the link and authorize the attempt, also the IP address from the email and whitelist it in your wallet account settings. </p>

<p>Now try running the file again. 
If you did everything correctly you should see a response that lists your GUID followed by Success TRUE </p>

<p>Now you're connected and you can start sending requests with your wallet. </p>

<p>The calls work the same as version one, except you will send your requests through this service instead of get requests to blockchain.info.</p>

CC BY-SA 4.0
2018-09-06T08:15:04.413Z
dear, how we can run it on our servers as it is currently running on localhost. what should we've to do to run it from servers where should we'll be call it in our websites from any where?
Tashen Jazbi
CC BY-SA 3.0
2016-11-29T13:19:33.320Z
2016-11-29T16:53:11.847Z
2016-11-29T16:53:11.847Z
m1xolyd1an
<p>I have been using <a href="https://www.magentocommerce.com/magento-connect/bitcoin-json-rpc-for-blockchain-info.html" rel="nofollow noreferrer">Bitcoin (JSON-RPC) for Blockchain.info</a></p>

<p>this plugin for bitcoin transaction in <code>magento</code>. one day suddenly it stopped working due to update in block chain wallet version. so i switched to <code>spectrocoin</code>. Later i found that spectrocoin is not working the way i have expected .So i decided to get a fix for appmerce.Then i found this <a href="https://github.com/blockchain/service-my-wallet-v3" rel="nofollow noreferrer">Blockchain Wallet API V2</a></p>

<p>I went through it's documentation but i couldn't find a way to integrate this to magento. I can see lot of js files. So i'm open to suggestions.I would like to know how can i integrate  <code>Blockchain Wallet API V</code>2` to magento or PHP.</p>

CC BY-SA 3.0
2016-11-29T14:30:24.540Z
Please fix the spelling in your posts and use complete sentences.
Murch
<blockchain><blockchain.info><php>
How to integrate Blockchain Wallet API V2 to php
passion
# How to integrate Blockchain Wallet API V2 to php

(Asked by: username_0 on 2016-11-29)

I have been using [Bitcoin (JSON-RPC) for Blockchain.info](https://www.magentocommerce.com/magento-connect/bitcoin-json-rpc-for-blockchain-info.html)

this plugin for bitcoin transaction in `magento`. one day suddenly it stopped working due to update in block chain wallet version. so i switched to `spectrocoin`. Later i found that spectrocoin is not working the way i have expected .So i decided to get a fix for appmerce.Then i found this [Blockchain Wallet API V2](https://github.com/blockchain/service-my-wallet-v3)

I went through it's documentation but i couldn't find a way to integrate this to magento. I can see lot of js files. So i'm open to suggestions.I would like to know how can i integrate `Blockchain Wallet API V`2` to magento or PHP.

**Tags:** blockchain, blockchain.info, php

> **Comments:**
> **username_1**: Please fix the spelling in your posts and use complete sentences.  

---

## 1 answers

### Answer by username_2 on 2016-11-29. Score: 3 | Accepted answer

You need to run a local nodejs service. From there you can then integrate with php.

As of January 2016 Blockchain.info made changes to the wallet API service that now require you to run a local nodeJS service to handle the calls. This will require you to have root access to your webserver so you will need to use a VPS instead of a basic shared web host.

* Create an account with blockchain.info, and register an email
  address.
* Request an API key here <https://blockchain.info/api/api_create_code>
* Login to your blockchain wallet, goto account settings, IP Restrictions and check the box to allow API access
* Goto DigitalOcean, register, create a new droplet, goto one-click-install and choose the MEAN stack Other options are up to you, I chose $5/month and IPv6
* Open your console or SSH through putty
* type `root`, enter your password, create a new password
* Now you're in!
* type `sudo apt-get update`
* now install nodejs
* type `sudo apt-get install nodejs`
* press `y` to accept
* install NPM
* sudo `apt-get install npm`
* `y` to accept
* install blockchain-wallet
* type `npm install -g blockchain-wallet-service`
* if you see some warnings or errors, don't worry
* once complete verify it installed
* navigate to `usr/local/bin`
* type `node blockchain-wallet-service -V`
* if installed it should return with the version number
* you can now launch the service, but first we will want to install apache and PHP so we can interact with it outside of nodejs
* Navigate back to root
* Install Apache
* type `sudo apt-get update`
* type `sudo apt-get install apache2`
* Install PHP
* type `sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt`
* Install curl
* type `sudo apt-get install php5-curl`
* Restart your VPS `reboot`
* Launch the blockchain-wallet-service
* navigate to `usr/local/bin`
* type `node blockchain-wallet-service start --port 3030`
* Login to your wallet using the below code

  $url = "<http://127.0.0.1:3030/merchant/YOUR-GUID/login?password=YOUR-PASSWORD&api_code=YOUR-API-CODE>";  
  $ch = curl\_init();  
  curl\_setopt($ch, CURLOPT\_SSL\_VERIFYPEER, false);  
  curl\_setopt($ch, CURLOPT\_RETURNTRANSFER, true);  
  curl\_setopt($ch, CURLOPT\_URL, $url);  
  $ccc = curl\_exec($ch);  
  $json = json\_decode($ccc, true);  
  var\_dump($json);

Save the above and run it on your server. The file should keep spinning and loading since blockchain doesn't recognize the IP address. Wait for it to timeout about 60 seconds, and then check your email. Blockchain should have sent you an API access attempt showing what IP tried to connect. Follow the link and authorize the attempt, also the IP address from the email and whitelist it in your wallet account settings.

Now try running the file again.
If you did everything correctly you should see a response that lists your GUID followed by Success TRUE

Now you're connected and you can start sending requests with your wallet.

The calls work the same as version one, except you will send your requests through this service instead of get requests to blockchain.info.

> **Comments:**
> **username_3**: dear, how we can run it on our servers as it is currently running on localhost. what should we've to do to run it from servers where should we'll be call it in our websites from any where?  

---

