Bitcoin Forum

Bitcoin => Bitcoin Discussion => Topic started by: mikegogulski on November 20, 2010, 10:28:00 PM



Title: bitcoin-ubercart-drupal is coming
Post by: mikegogulski on November 20, 2010, 10:28:00 PM
I need to do some documentation work, testing and tidying before a release, but the basics are working:

https://github.com/mikegogulski/uc_bitcoin

Big thanks to the donors who have sent a total of BTC 154.05 in 4 separate donations. You folks rock!


Title: Re: bitcoin-ubercart-drupal is coming
Post by: nanaimogold on November 20, 2010, 10:42:50 PM
Hey Mike!

  Nice to see you drop in.

Shane


Title: Re: bitcoin-ubercart-drupal is coming
Post by: mikegogulski on November 20, 2010, 11:08:57 PM
Hey Mike!

  Nice to see you drop in.

Shane

Nice to be here :)

Anyone have a list of the most popular FOSS shopping cart systems?


Title: Re: bitcoin-ubercart-drupal is coming
Post by: Bimmerhead on November 21, 2010, 12:45:52 AM
Man, you've been busy makin' stuff.  Thanks!

Here's a list of the big oc cms'.  Though it's not shopping cart specific most of these would still have a use for bitcoin integration:

http://www.scribd.com/doc/23880441/2009-Open-Source-CMS-Market-Share-Report-Excerpt

And here's a list of some of the os commerce biggies:

http://php.opensourcecms.com/scripts/show.php?catid=3&category=eCommerce




Title: Re: bitcoin-ubercart-drupal is coming
Post by: jgarzik on November 21, 2010, 01:29:35 AM
Another 100BTC donation headed your way.

Working on shopping cart plug-ins for bitcoin is an important step in making bitcoin easy to use.


Title: Re: bitcoin-ubercart-drupal is coming
Post by: mikegogulski on November 21, 2010, 11:55:16 AM
@Bimmerhead: Thanks. The full report (which you have to go to their site and fill in a form with bogus data to download) was somewhat helpful.

@Jgarzik: W00t! Thank you :)

Looking at the lists I think I just identified another couple of niches that can be served easily by Bitcoin: membership sites and pay-per-article sites. "Join now! BTC 10.00" or "Send BTC 10.00 to access this content".

Meanwhile on shops I should probably go revisit WordPress simply because it has immense market share. My first stab at at Bitcoin payment system was a plugin to wp-e-commerce, but I ran into a wall where I decided it couldn't be done without hacking that plugin's core. But there are a couple other cart frameworks for WP to look at, too.

WordPress, at least, has a decent architecture and API from the developer perspective. I haven't even really seen Joomla's API in the course of writing that plugin, since I had to talk almost exclusively to VirtueMart (itself a bit of a nightmare, really). Drupal's API is slick and functional but based on a whack-ass model owing to its origins in the non-OO PHP4 days.

I'd welcome a project outside the PHP world, though. Been pondering Satchmo/Django/Python and Broadleaf/Java. Anyone got things to say about those?


Title: Re: bitcoin-ubercart-drupal is coming
Post by: davout on November 21, 2010, 08:21:55 PM
I'd welcome a project outside the PHP world, though. Been pondering Satchmo/Django/Python and Broadleaf/Java. Anyone got things to say about those?

Ever tried Ruby on Rails ?
Honestly I don't know your other options, but Rails amazes me every day, also Ruby is a really really nice language.


Title: Re: bitcoin-ubercart-drupal is coming
Post by: mikegogulski on November 22, 2010, 01:09:29 AM
I'd welcome a project outside the PHP world, though. Been pondering Satchmo/Django/Python and Broadleaf/Java. Anyone got things to say about those?

Ever tried Ruby on Rails ?
Honestly I don't know your other options, but Rails amazes me every day, also Ruby is a really really nice language.

I haven't used Ruby at all yet, but I'd have no trouble picking it up. Only thing is, I know Rails is fairly popular, but what's the e-commerce killer app that sits on top of it?


Title: Re: bitcoin-ubercart-drupal is coming
Post by: mizerydearia on December 24, 2010, 10:42:51 AM
I suggest you to establish a project page at drupal.org - See http://drupal.org/cvs-application/requirements also http://drupal.org/node/7765
I am working on a drupal-based project that I will use your module for and could provide feedback on and possibly assistance with development.


Title: Re: bitcoin-ubercart-drupal is coming
Post by: mikegogulski on December 24, 2010, 01:52:35 PM
I suggest you to establish a project page at drupal.org - See http://drupal.org/cvs-application/requirements also http://drupal.org/node/7765
I am working on a drupal-based project that I will use your module for and could provide feedback on and possibly assistance with development.

Hey there.

Doing that would involve putting the loathesome GPL on my code, reformatting it to meet Drupal's hideous coding standards, and doing a lot of work to support internationalization that I don't really have the motivation for.

That said, if someone else puts that effort in, I might become a maintainer...


Title: Re: bitcoin-ubercart-drupal is coming
Post by: hippich on December 24, 2010, 10:17:05 PM
Hm.. Drupal coding standards are not hideous at all. As I understand, this code is public domain and I can take it, reformat or do anything to be accepted in drupal.org and put it under GPLv2+? If so I might consider to fork it and post it under my account. But for you to become co-maintainer you still need to apply for a CVS account on drupal.org.


Title: Re: bitcoin-ubercart-drupal is coming
Post by: jgarzik on December 24, 2010, 10:28:50 PM
Hm.. Drupal coding standards are not hideous at all. As I understand, this code is public domain and I can take it, reformat or do anything to be accepted in drupal.org and put it under GPLv2+? If so I might consider to fork it and post it under my account. But for you to become co-maintainer you still need to apply for a CVS account on drupal.org.

CVS???  That's quite hideous.


Title: Re: bitcoin-ubercart-drupal is coming
Post by: hippich on December 24, 2010, 10:37:39 PM
they still use CVS for developing drupal and all extensions. There are talks about moving everything into GIT, but that's tons of work and can't be done really easily. All infrastructure built about CVS right now and it will take some time to rewrite code to use GIT.


Title: Re: bitcoin-ubercart-drupal is coming
Post by: mizerydearia on December 24, 2010, 10:45:18 PM
It is convenient to have the project integrated into drupal.org website though.


Title: Re: bitcoin-ubercart-drupal is coming
Post by: mikegogulski on December 24, 2010, 11:33:25 PM
Hm.. Drupal coding standards are not hideous at all. As I understand, this code is public domain and I can take it, reformat or do anything to be accepted in drupal.org and put it under GPLv2+? If so I might consider to fork it and post it under my account. But for you to become co-maintainer you still need to apply for a CVS account on drupal.org.

My code is public domain, so please go do what you want with it. In fact, it's not even mine any more, it's yours!

Meanwhile, drupal.org wants me to do bogus shit like this:

Code:
if (condition1 || condition2) {
  action1;
}
elseif (condition3 && condition4) {
  action2;
}
else {
  defaultaction;
}

when this would suffice quite neatly:

Code:
if (condition1 || condition2) action1;
elseif (condition3 && condition4) action2;
else  defaultaction;

I minimize code for my own benefit, not for that of others who can't deal with where to stick a // when they need to get a little job done. Selfish, I know.

So, frankly I don't care to swim in that pool. Call it a religious dispute if you will.

The MUCH bigger issue is that I'm not going to put out first-release code of my own under the awful GPL, which is a requirement to register a project at drupal.org. I'm *never* going to try to compel people, under state penalty, to do anything with what I publish.


Title: Re: bitcoin-ubercart-drupal is coming
Post by: mikegogulski on December 24, 2010, 11:35:12 PM
It is convenient to have the project integrated into drupal.org website though.

That's true. Go make it happen?


Title: Re: bitcoin-ubercart-drupal is coming
Post by: mikegogulski on December 24, 2010, 11:37:20 PM
CVS???  That's quite hideous.

No doubt, right? CVS is against Gh0d's plan for H1s creatures.


Title: Re: bitcoin-ubercart-drupal is coming
Post by: mizerydearia on December 25, 2010, 12:35:49 AM
Maybe add a price handler?  Something like:

Code:
function uc_bitcoin_uc_price_handler() {
  return array(
    'alter' => array(
      'title' => t('Bitcoin price handler'),
      'description' => t('Handles Bitcoin pricing alteration.'),
      'callback' => 'uc_store_price_handler_alter',
    ),
    'format' => array(
      'title' => t('Bitcoin price handler'),
      'description' => t('Handles Bitcoin price formatting.'),
      'callback' => 'uc_store_price_handler_format',
    ),
    'options' => array(
      'sign' => 'BTC',
      'sign_after' => TRUE,
      'prec' => 2,
      'dec' => '.',
      'thou' => ',',
      'label' => FALSE,
    )
  );
}

Perhaps you could contribute your code to http://www.ubercart.org/contrib instead of drupal site.

I created #drupal-bitcoin on FreeNode IRC network if you'd like to collaborate about developments.


Title: Re: bitcoin-ubercart-drupal is coming
Post by: hippich on December 25, 2010, 01:47:12 AM
Perhaps you could contribute your code to http://www.ubercart.org/contrib instead of drupal site.

ubercart.org site's contribution part is not good place. It do not have versioning control, it do not integrate with Drupal's update subsystem (read - no way to autoupdate module through drush), etc. The only good place to put module if we are serious about it is Drupal.org.


Title: Re: bitcoin-ubercart-drupal is coming
Post by: hippich on December 25, 2010, 01:54:36 AM
My code is public domain, so please go do what you want with it. In fact, it's not even mine any more, it's yours!

That's cool. That means I understood right this unlicensed "license" =) So I will do this at some point (if no one will do it before, 'cos I am a way slow... true programmer =))


Meanwhile, drupal.org wants me to do bogus shit like this:


Yeah. We can debate a lot about how it's right to write code, but most important - to keep same style in every bit of project, especially when you deal with such big project as Drupal. For example, wordpress do not have so strict rules and as a result - there is tons of low quality, non maintained code. And often same functionality done slightly differently by different plugins.

Anyway, this was just a bit of support of drupal-way dealing with contributed code. =)


Title: Re: bitcoin-ubercart-drupal is coming
Post by: mizerydearia on December 25, 2010, 04:42:28 AM
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 (http://drupal.org/node/1007138) at drupal.org and I recommend anyone else to do so as well to co-maintain the development of the module.


Title: Re: bitcoin-ubercart-drupal is coming
Post by: dduane on December 25, 2010, 08:42:39 AM
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!


Title: Re: bitcoin-ubercart-drupal is coming
Post by: humble on December 29, 2010, 05:03:04 AM
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


Title: Re: bitcoin-ubercart-drupal is coming
Post by: mizerydearia on December 29, 2010, 11:36:52 AM
Oooh, I may consider attending DrupalCon in Chicago


Title: Re: bitcoin-ubercart-drupal is coming
Post by: dduane on December 30, 2010, 07:27:25 PM
I'll definitely be at DrupalCon Chicago and I'll be hosting a Bitcoin Birds-of-a-Feather gathering.


Title: Re: bitcoin-ubercart-drupal is coming
Post by: humble on January 12, 2011, 11:51:06 PM
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.


Title: Re: bitcoin-ubercart-drupal is coming
Post by: mizerydearia on January 18, 2011, 12:33:05 AM
http://drupal.org/node/1007138 hasn't been reviewed yet.  Also I just noticed http://bitcointalk.org/index.php?topic=2857


Title: Re: bitcoin-ubercart-drupal is coming
Post by: dduane on February 19, 2011, 01:08:23 AM

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

http://groups.drupal.org/node/128389