https://github.com/mikegogulski/bitcoin-php(untested) Drupal usage example:
include_once("bitcoin.inc");
$bitcoin_client = new BitcoinClient($scheme, $username, $password, $hostname, $port, $certificate_path, $debuglevel);
if (TRUE !== ($fault = $bitcoin_client->can_connect()))
return watchdog('uc_bitcoin_cron', 'Unable to access Bitcoin server. Fault: !fault', $fault);
// loop through the open transactions
while ($my_order = db_fetch_object($result)) {
// check for transaction completion
$address = $my_order->bitcoin_address;
try {
$paid = $bitcoin_client->query("getreceivedbyaddress", $address, variable_get("uc_bitcoin_transaction_confirms", 1));
} catch (BitcoinClientException $e) {
return watchdog('uc_bitcoin', "Bitcoin server communication failed on getreceivedbyaddress !address with fault string !fault", array("!address" => $address, '!fault' => $e . message), WATCHDOG_ALERT);
}
- Abstracts away the underlying JSON-RPC interface
- Incorporates theymos's ports of the address and hash handling functions
- Includes unit tests
Forks welcome!