One suggestion for improvement which doesn't really affect anything other than to meet the same style as other drupal modules:
Use table uc_bitcoin_payment instead of uc_payment_bitcoin
I'm working on a code snippet for adding the bitcoin address to the order in the "view orders" admin page. I'll submit it here shortly.
Here it is:
function uc_bitcoin_order_pane() {
$panes[] = array(
'id' => 'bitcoin_address',
'callback' => 'uc_bitcoin_pane_bitcoin_address',
'title' => t('Bitcoin Address'),
'desc' => t('View the order\'s Bitcoin address for receipt of payment.'),
'class' => 'pos-left',
'weight' => 4,
'show' => array('view', 'edit', 'invoice', 'customer'),
);
return $panes;
}
/**
* Handle the "Products" order pane.
*/
function uc_bitcoin_pane_bitcoin_address($op, $arg1) {
switch ($op) {
case 'view':
case 'customer':
case 'edit-theme':
return uc_bitcoin_bitcoin_address($arg1);
}
}
/**
* Return a Bitcoin address from an order object.
*
* @param $order
* An order object.
*/
function uc_bitcoin_bitcoin_address($order) {
if (is_array($order)) $oid = $order['order_id']['#value']; else $oid = $order->order_id;
$result = db_query("SELECT bitcoin_address FROM {uc_payment_bitcoin} WHERE order_id = %d", $oid);
$address = db_fetch_object($result);
if ($address->bitcoin_address != FALSE) {
return $address->bitcoin_address;
}
return FALSE;
}
Note when viewing admin/store/orders/# that an additional pane appears. I was considering adding the data to the existing "Payment" pane as it is more suitable there. Perhaps I will work on writing code for that next unless someone else does it first.
Also I noticed when permanently deleting an order from the site the bitcoin address associated with the order is preserved. While it may be useful to preserve the bitcoin address for a kind of reference it doesn't seem to be helpful to have as reference if there is no further data to associate it with. Perhaps it would be a good idea to add a hook for deleting an order to also delete the associated entry in the bitcoin address table?
I
requested a CVS account at drupal.org and I recommend anyone else to do so as well to co-maintain the development of the module.