Does anyone know how to send a payment using php and the Blockchain.info api?
Here's the api link:
http://blockchain.info/api/json_rpc_apiIn there it gives a method for doing so:
Method: sendtoaddress
Parameters: (String bitcoinAddress, long amount)
Description: amount is a real and is rounded to 8 decimal places. Returns the transaction hash if successful. .
Returns: String
Second Password Required
But it says Second Password Required. So how do I pass my second password?
The second password is provided by first calling the walletpassphrase method.
This api is currently incompatible with two factor authentication and it must therefore be disabled.
So, how do I send a payment?
Two factor authentication must be disabled in Account Settings.
------
Assuming you only want to send you would be better off using
http://blockchain.info/api/blockchain_wallet_api. Very rough example
<?php
$wallet_identifier = 'abf66471-fe0a-6820-8977-55d7e8c1f6b2';
$address = 'Your Bitcoin address';
$password = 'Your Password';
$second_password = 'Your Second password'; //Only if double encryption is enabled in account settings
$amount = 100000000; //1 BTC in Satoshi
$response = file_get_contents("
https://blockchain.info/merchant/$wallet_identifier/payment?password=$password!&second_password=$second_password&to=$address&amount=$amount");
//Check response for errors
php?>