Bitcoin Forum
May 12, 2024, 12:20:44 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 [2]  All
  Print  
Author Topic: bitcoin-ubercart-drupal is coming  (Read 6228 times)
mizerydearia
Hero Member
*****
Offline Offline

Activity: 574
Merit: 507



View Profile
December 25, 2010, 04:42:28 AM
Last edit: December 25, 2010, 09:04:52 AM by mizerydearia
 #21

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:
Code:
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.
1715473244
Hero Member
*
Offline Offline

Posts: 1715473244

View Profile Personal Message (Offline)

Ignore
1715473244
Reply with quote  #2

1715473244
Report to moderator
1715473244
Hero Member
*
Offline Offline

Posts: 1715473244

View Profile Personal Message (Offline)

Ignore
1715473244
Reply with quote  #2

1715473244
Report to moderator
"This isn't the kind of software where we can leave so many unresolved bugs that we need a tracker for them." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715473244
Hero Member
*
Offline Offline

Posts: 1715473244

View Profile Personal Message (Offline)

Ignore
1715473244
Reply with quote  #2

1715473244
Report to moderator
1715473244
Hero Member
*
Offline Offline

Posts: 1715473244

View Profile Personal Message (Offline)

Ignore
1715473244
Reply with quote  #2

1715473244
Report to moderator
dduane
Newbie
*
Offline Offline

Activity: 47
Merit: 0



View Profile WWW
December 25, 2010, 08:42:39 AM
Last edit: December 25, 2010, 08:57:59 AM by dduane
 #22

I've just completed a beta of btc_address Drupal Module, for creating a CCK field type to hold and validate Bitcoin Addresses. Please give it a try and let me know if you have any problems.  It uses mikegogulski's bitcoin-php library which needs to be downloaded from github and installed per the README.txt instructions.  I'd recommend that any other bitcoin related modules that get created move to using this format for including this library.  

For now you can download it at https://github.com/DarrellDuane/btc_address  I'm planning on applying for a CVS account at Drupal.org with it once I get some feedback about how it works for others.  It uses the bitcoin: URI when displaying the addresses by default in the node view or via views. 

Also, I've started a Drupal Group for discussing Bitcoin issues there at http://groups.drupal.org/bitcoin, please join us!

Glad to see there's an IRC channel now and lots of other Drupal/Bitcoin cross-fertilization happening!
humble
Member
**
Offline Offline

Activity: 91
Merit: 11



View Profile
December 29, 2010, 05:03:04 AM
 #23

Fantastic to see that there's a Drupal/UC Bitcoin module.

You may be interested to know that the migration of Drupal to Git is scheduled to be completed by March.

http://groups.drupal.org/node/106224
mizerydearia
Hero Member
*****
Offline Offline

Activity: 574
Merit: 507



View Profile
December 29, 2010, 11:36:52 AM
 #24

Oooh, I may consider attending DrupalCon in Chicago
dduane
Newbie
*
Offline Offline

Activity: 47
Merit: 0



View Profile WWW
December 30, 2010, 07:27:25 PM
 #25

I'll definitely be at DrupalCon Chicago and I'll be hosting a Bitcoin Birds-of-a-Feather gathering.
humble
Member
**
Offline Offline

Activity: 91
Merit: 11



View Profile
January 12, 2011, 11:51:06 PM
 #26

Sweet. I won't be there but I'll be hosting a "DrupalMirrorCon" the following weekend, here in Vancouver, where we will screen a crowdsourced selection of the DrupalCon presentations.
mizerydearia
Hero Member
*****
Offline Offline

Activity: 574
Merit: 507



View Profile
January 18, 2011, 12:33:05 AM
 #27

http://drupal.org/node/1007138 hasn't been reviewed yet.  Also I just noticed http://bitcointalk.org/index.php?topic=2857
dduane
Newbie
*
Offline Offline

Activity: 47
Merit: 0



View Profile WWW
February 19, 2011, 01:08:23 AM
 #28


I've started a Drupal/Bitcoin thread at groups.drupal.org, please join us if interested:

http://groups.drupal.org/node/128389
Pages: « 1 [2]  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!