mikegogulski (OP)
|
|
November 23, 2010, 08:12:12 PM |
|
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!
|
|
|
|
|
|
|
|
|
Each block is stacked on top of the previous one. Adding another block to the top makes all lower blocks more difficult to remove: there is more "weight" above each block. A transaction in a block 6 blocks deep (6 confirmations) will be very difficult to remove.
|
|
|
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
|
|
Hiro Protagonist
Newbie
Offline
Activity: 3
Merit: 0
|
|
December 30, 2010, 08:14:38 PM |
|
Hey Mike,
Thanks for the library. I was looking to roll a module for Ubercart to accept Bitcoin this weekend, and you saved me a lot of work. Any updates on your library? Or are there any other modules in the works already to do this?
|
|
|
|
mikegogulski (OP)
|
|
December 31, 2010, 12:16:22 AM |
|
Hello Hiro,
Check around here for uc_bitcoin, which uses the library and is already a working payment method for Ubercart.
I'm a bit behind on keeping the library synced to the latest API version, but that shouldn't be a problem as yet, since the deprecated label functions are still in bitcoin.
Peace, Mike
|
|
|
|
fabianhjr
Sr. Member
Offline
Activity: 322
Merit: 250
Do The Evolution
|
|
December 31, 2010, 04:02:11 AM |
|
Hey, by any chance had you seen a PrestaShop module? I am not a great coder and need this to get my shop to accept Bitcoins. Thanks for the library Mike.
|
|
|
|
mizerydearia
|
|
December 31, 2010, 07:09:05 PM |
|
Ah, I didn't notice this library before working on my Bitcoin Control Panel project. Nice job!
|
|
|
|
dduane
Newbie
Offline
Activity: 47
Merit: 0
|
|
January 03, 2011, 06:18:45 AM |
|
Also check out the btc_address module ( http://github.com/DarrellDuane/btc_address) for holding bitcoin addresses. I've also made a very rough release of the mtgox drupal module for being able to utilize the Mt. Gox Tradiing API. http://github.com/DarrellDuane/mtgoxI've just added code the the btc_address to check for the Bitcoin library and provide instructions for downloading it if it isn't downloaded on the Drupal status report. I'd encourage someone who's working on uc_bitcoin to copy my code and my README.txt and separate the bitcoin.inc library from the uc_bitcoin distribution. Not sure if Mike wants to do that or perhaps MizeryDearia might want to.
|
|
|
|
Hiro Protagonist
Newbie
Offline
Activity: 3
Merit: 0
|
|
January 03, 2011, 09:04:15 PM |
|
Hey, thanks for heads up on uc_bitcoin. I didn't find it in my initial search but found it by name. Thanks!
|
|
|
|
mikegogulski (OP)
|
|
January 21, 2011, 01:05:50 AM |
|
Pushed an update to Github today to bring this in line with the 0.3.19 API. Some functions lack unit tests, so be warned!
|
|
|
|
|