Jump to content

* * * * * 1 votes

Bitcoin Payment Module

bitcoin python bitcoind

  • Please log in to reply
5 replies to this topic

#1   weex

  • Members
  • 1 posts
  • Real Name:David Sterry

Posted 04 March 2012 - 20:54

Hello folks, I'm relatively new to osCommerce but have flirted with it in the past. I have an interest in Bitcoin and was surprised at how limited the support was in osCommerce for it. So I've created the module below. I'm interested to know the best way to release it officially for osCommerce users to get it as easily as possible.


- weex

osCommerce Bitcoin Payment Module v0.6

available at: https://github.com/w...ommerce-bitcoin

This module enables your osCommerce webstore to accept Bitcoin.


* Bitcoind and monitor.py can be run on a server other than the osCommerce hosting server
* Creates a unique payment address for each order
* Updates order to Delivered when payment is received (# of confirmations is configurable)
* Forwards Bitcoins to forwarding address once the local bitcoind has more than a threshold amount
* Python script monitors bitcoind and will restart it if it becomes unresponsive


osCommerce (tested so far only with v2.3.1)
Python with modules: MySQLdb and simplejson

Inspired by http://addons.oscommerce.com/info/8170 by phoenix.x742 / 2 Oct 2011
bpn.php modified from an osCommerce Paypal IPN script

#2   alistair.tweed

  • Members
  • 15 posts
  • Real Name:Alistair Tweed

Posted 02 October 2012 - 16:46

Hi Weex,

Is this Bitcoin Payment Module multi-currency - can I use it alongside a PayPal Payment Module?

Does it download exchange rates against BTC?



#3   chrischris

  • Members
  • 14 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Berlin

Posted 07 January 2013 - 15:54

Hey together!
I just downloaded the osCommerce-Bitcoin-Module and read the README. There are two points wich I don't understand. Maybe someone can help me out there..

* Enable the payment module throught your administration.
- Set up adress/port/username/passwd/cert file
- Set up the number of node you want for a payment to be considered as "valid"

Where do I get this "adress/port/username/passwd/cert file"? Do I have to register somewhere?
And what is this "number of node"?

Thanks for any help!

#4   chrischris

  • Members
  • 14 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Berlin

Posted 08 January 2013 - 14:34

Hm, I guess I got to run my own server somehow? And those "adress/port/username.." is where the RPC should land? Means, when I start my own bitcoind-daemon on the same server where osCommerce is running, I have to create this bitcoin.conf and set my own username/pass like


.. and then the host and port should be, right?

BUT what if I'm not allowed to run Python with modules: MySQLdb and simplejson, bitcoind? Is there any other way to get this running? Do I really have to go to something like Mt.Gox?

#5   chrischris

  • Members
  • 14 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Berlin

Posted 21 January 2013 - 09:43

Nobody has any clue on how to use any of those osCommerce-Modules??

I'm still lost... :( Any Help would be much appreciated!

I tried these, but I'm still confused about the Host/Port/Username/Password-stuff to fill in... ?!

Edited by chrischris, 21 January 2013 - 09:44.

#6   chrischris

  • Members
  • 14 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Berlin

Posted 09 April 2013 - 17:33

Hello together,
I never got this Module from weex running.. Anyway, now I'm using Paysius and it works..

I'm using http://addons.oscommerce.com/info/4843 to update my currencys. But BTC are not working for oanda or xe. So I added this function to get the current BTC-Rates automatically from the MTGox-Ticker.

function updateBTC() {
  $last = 0;
  $result = false;
  // for USD use this path
  //$url = "https://data.mtgox.com/api/2/BTCUSD/money/ticker";
  // EUR
  $url = "https://data.mtgox.com/api/2/BTCEUR/money/ticker";
  if ($curly = curl_init()) {
   curl_setopt($curly, CURLOPT_URL, $url);
   curl_setopt($curly, CURLOPT_RETURNTRANSFER, true);
   curl_setopt($curly, CURLOPT_SSL_VERIFYHOST, false);
   curl_setopt($curly, CURLOPT_SSL_VERIFYPEER, false);
   curl_setopt($curly, CURLOPT_TIMEOUT, 5);
   curl_setopt($curly, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MtGox PHP client; '.php_uname('s').'; PHP/'.phpversion().')');
   if ($output = curl_exec($curly)) {
    if ($result = json_decode($output, true)) {
	 if ($result['result'] == "success") {
	  $last = round(1/$result['data']['last']['value'], 8);
  $curly = NULL;
  return $last;

Edited by chrischris, 09 April 2013 - 17:40.