Bitcoin Forum
April 19, 2014, 04:21:43 AM *
News: Due to the OpenSSL heartbleed bug, changing your forum password is recommended.
 
   Home   Help Search Donate Login Register  
Pages: [1] 2 3  All
  Print  
Author Topic: osCommerce Bitcoin Payment Module  (Read 7381 times)
weex
Hero Member
*****
Offline Offline

Activity: 793


Give me your tired, your poor, your huddled...


View Profile WWW

Ignore
March 03, 2012, 08:35:22 AM
 #1

This is a work in progress but the goal will be automated Bitcoin payment processing using just oscommerce, bitcoind running locally, and a bit of python. In regards to whether it's wise to store BTC locally, the python script will offload BTC to the shopkeeper's address of choice not long after it's confirmed.

https://github.com/weex/oscommerce-bitcoin

Part of the python script monitors bitcoind and restarts it if it doesn't answer.

Feel free to comment or make suggestions or ask questions or dismiss this entirely or code something better or hack another bitcoin service or ...

Update You can now see a working demo store using this module at http://owneo.com

Find a Bitcoin ATM location near you for cash exchange.
Buy eBooks, music, graphics, videos and more at CoinDL: https://www.coindl.com - Github: https://github.com/weex
1397881303
Hero Member
*
Offline Offline

Posts: 1397881303

View Profile Personal Message (Offline)

Ignore
1397881303
Reply with quote  #2

1397881303
Report to moderator
1397881303
Hero Member
*
Offline Offline

Posts: 1397881303

View Profile Personal Message (Offline)

Ignore
1397881303
Reply with quote  #2

1397881303
Report to moderator
Unbeatable Service & Product Support
Grab Your Miners at GAWMiners.com
Order Before April 25th to receive
Double your Hashing Power for 1 week!

Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1397881303
Hero Member
*
Offline Offline

Posts: 1397881303

View Profile Personal Message (Offline)

Ignore
1397881303
Reply with quote  #2

1397881303
Report to moderator
weex
Hero Member
*****
Offline Offline

Activity: 793


Give me your tired, your poor, your huddled...


View Profile WWW

Ignore
March 04, 2012, 09:40:43 AM
 #2

An update on current status..and this is exciting! Did you know there are 12,700 live osCommerce webstores?

This project now works with the following features and was tested against osCommerce v2.3.1

* 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

Todo:

* Update readme and write an installation guide with tips on configuring osCommerce with the BTC currency
* Include BTCUSD exchange rate update in python script
* Include a watchdog script to make sure monitor.py is running via cronjob.

It's been fun testing with 0 confirmations and seeing the order status update all by itself.  Cool

Find a Bitcoin ATM location near you for cash exchange.
Buy eBooks, music, graphics, videos and more at CoinDL: https://www.coindl.com - Github: https://github.com/weex
Grix
Sr. Member
****
Offline Offline

Activity: 325



View Profile WWW

Ignore
March 04, 2012, 06:33:14 PM
 #3

Enabling the module doesn't work for me. It redirects me to a blank page, and when I go back it doesn't show up in the payment module menu, even though under "install modules" it says that it is enabled.

weex
Hero Member
*****
Offline Offline

Activity: 793


Give me your tired, your poor, your huddled...


View Profile WWW

Ignore
March 04, 2012, 08:47:59 PM
 #4

This is fixed. I tested it by uninstalling the module and reinstalling it.

When I removed it in the half-installed state you encountered, it appeared to have removed another payment module. If you know more about how osCommerce determines if a module is installed, you might want to edit the sql directly. I'm thinking it's just removing the MODULE_PAYMENT_BITCOIN_ records from the configuration table.

Thanks for testing, create an issue at github if you run into any other problems.

-weex

Find a Bitcoin ATM location near you for cash exchange.
Buy eBooks, music, graphics, videos and more at CoinDL: https://www.coindl.com - Github: https://github.com/weex
koin
Hero Member
*****
Offline Offline

Activity: 868


View Profile

Ignore
March 04, 2012, 09:18:21 PM
 #5

is there a link to any site that uses this, to demonstrate?
Grix
Sr. Member
****
Offline Offline

Activity: 325



View Profile WWW

Ignore
March 04, 2012, 10:48:21 PM
 #6

Thank you for fixing the bug.

I'd like to use this on my website, but I am inexperienced with bitcoin servers.. I host my website on a webserver, so I can't run bitcoind and the python script there, right? Can I run bitcoind and the python script on my home computer that I turn off every night, or does it have to be online 24/7? Do I have to forward any ports?

Alternatively, are there any free or very cheap VPS's that I can use for this purpose?

weex
Hero Member
*****
Offline Offline

Activity: 793


Give me your tired, your poor, your huddled...


View Profile WWW

Ignore
March 05, 2012, 12:10:21 AM
 #7

Thank you for fixing the bug.

I'd like to use this on my website, but I am inexperienced with bitcoin servers.. I host my website on a webserver, so I can't run bitcoind and the python script there, right? Can I run bitcoind and the python script on my home computer that I turn off every night, or does it have to be online 24/7? Do I have to forward any ports?

Alternatively, are there any free or very cheap VPS's that I can use for this purpose?

The python script and bitcoind will require shell access which is more likely to be available in a VPS or dedicated server. You should be able to get cheap VPS for $10-20 a month to try it out.

Starting out I would recommend bitcoind and the python script (monitor.py) be running 24x7 on the webserver. Running it only part time will not work and running it on your home computer will require a stable internet connection and the bitcoin RPC port to be opened on your firewall. Like I said, a cheap vps with everything running there is best.

Then you can set a FORWARDING_ADDRESS  and the script can forward any funds to your home or company wallet.

Find a Bitcoin ATM location near you for cash exchange.
Buy eBooks, music, graphics, videos and more at CoinDL: https://www.coindl.com - Github: https://github.com/weex
Daily Anarchist
Hero Member
*****
Offline Offline

Activity: 600



View Profile WWW

Ignore
March 05, 2012, 02:43:46 AM
 #8

There's already a pretty nice oscommerce Bitcoin payment module available here:

http://addons.oscommerce.com/info/8170

One of my forum members wrote it specifically for me. My oscommerce store section uses it and it works great. It generates a new address for each purchase.

Discover anarcho-capitalism today!
weex
Hero Member
*****
Offline Offline

Activity: 793


Give me your tired, your poor, your huddled...


View Profile WWW

Ignore
March 05, 2012, 03:16:01 AM
 #9

There's already a pretty nice oscommerce Bitcoin payment module available here:

http://addons.oscommerce.com/info/8170

One of my forum members wrote it specifically for me. My oscommerce store section uses it and it works great. It generates a new address for each purchase.

If it weren't for that module, I wouldn't have worked on this. It was a great starting point since the author appears to have known a lot more about oscommerce than I.

Find a Bitcoin ATM location near you for cash exchange.
Buy eBooks, music, graphics, videos and more at CoinDL: https://www.coindl.com - Github: https://github.com/weex
Daily Anarchist
Hero Member
*****
Offline Offline

Activity: 600



View Profile WWW

Ignore
March 05, 2012, 05:04:56 AM
 #10

There's already a pretty nice oscommerce Bitcoin payment module available here:

http://addons.oscommerce.com/info/8170

One of my forum members wrote it specifically for me. My oscommerce store section uses it and it works great. It generates a new address for each purchase.

If it weren't for that module, I wouldn't have worked on this. It was a great starting point since the author appears to have known a lot more about oscommerce than I.

Actually, he didn't know anything about oscommerce before he started the project.

What will your addition bring the to table that his currently doesn't?

Discover anarcho-capitalism today!
weex
Hero Member
*****
Offline Offline

Activity: 793


Give me your tired, your poor, your huddled...


View Profile WWW

Ignore
March 05, 2012, 05:18:19 AM
 #11

The module I started with asked bitcoind for a new address and associated it with an account name given by the buyer's email address and the osCommerce session id with which the purchase was made. At that point it was up to the store owner to monitor those addresses and update the order status. Maybe you had something more that wasn't released as part of that module?

The additions I made automate this process. The python script monitor.py periodically looks at the osCommerce database to find orders with order status Pending and that used the Bitcoin Payment module. It then queries bitcoind to see if enough funds have been sent to the addresses associated with Pending orders. If enough were sent it takes the next step.

That step is to call another part of this module called the bpn.php script. This script was derived from a Paypal IPN script (IPN is where Paypal can tell osCommerce at some later time that payment has been made, cleared, etc). When called with the notification key and an order id, it will fire off an email to the buyer and set the order status to Delivered. 

I'm actually not sure what is the best order status to change to but it's a simple change to make in the bpn.php script for anyone who wants to customize it.

Find a Bitcoin ATM location near you for cash exchange.
Buy eBooks, music, graphics, videos and more at CoinDL: https://www.coindl.com - Github: https://github.com/weex
Daily Anarchist
Hero Member
*****
Offline Offline

Activity: 600



View Profile WWW

Ignore
March 05, 2012, 05:40:27 AM
 #12

That sounds really badass. I'm looking forward to the update. Will it require the phoenix mod be installed underneath yours? Will yours include all of the phoenix mod? Will I have to delete the phoenix mod to get yours to work?

Right now when people order it puts them in pending status. It's a pain in the ass though because I have to log into my server every day and see if anybody has sent the coins, usually not. Most people order and then never send, I think it's because they ordered not knowing that I only accept Bitcoin as payment, and they're like "huh?"

When somebody does pay I put them in "processing" and send them a thank you email. After I've stuck the envelope in the mail I change it to delivered.

Discover anarcho-capitalism today!
weex
Hero Member
*****
Offline Offline

Activity: 793


Give me your tired, your poor, your huddled...


View Profile WWW

Ignore
March 05, 2012, 05:46:28 AM
 #13

Will it require the phoenix mod be installed underneath yours? Will yours include all of the phoenix mod? Will I have to delete the phoenix mod to get yours to work?

When the update is ready, you can probably just remove the phoenix mod as this one includes (really was built from) that one.

When somebody does pay I put them in "processing" and send them a thank you email. After I've stuck the envelope in the mail I change it to delivered.

Processing does make more sense. I'm going to change that with the next update.

Find a Bitcoin ATM location near you for cash exchange.
Buy eBooks, music, graphics, videos and more at CoinDL: https://www.coindl.com - Github: https://github.com/weex
weex
Hero Member
*****
Offline Offline

Activity: 793


Give me your tired, your poor, your huddled...


View Profile WWW

Ignore
March 05, 2012, 07:21:52 AM
 #14

The module has been updated with the following:

* Exchange rate updated periodically from mtgox with fallback to bitcoinexchangerate.org
* Payment recieved sets order status to Processing instead of Delivered

https://github.com/weex/oscommerce-bitcoin

Find a Bitcoin ATM location near you for cash exchange.
Buy eBooks, music, graphics, videos and more at CoinDL: https://www.coindl.com - Github: https://github.com/weex
Grix
Sr. Member
****
Offline Offline

Activity: 325



View Profile WWW

Ignore
March 05, 2012, 03:49:43 PM
 #15

When do you expect this to be finished/good enough for long term reliable use?

weex
Hero Member
*****
Offline Offline

Activity: 793


Give me your tired, your poor, your huddled...


View Profile WWW

Ignore
March 05, 2012, 04:48:17 PM
 #16

When do you expect this to be finished/good enough for long term reliable use?
That's a good question and I suppose it's ready for someone running a test store or someone with php/python/mysql experience. I've been testing it as I go and it is based in part on some code that has seen long term use. I'll setup a test store in the next couple days so people can try it out.

To get this ball rolling, I'll start a bounty of 2 BTC for the first person other than myself who gets a store running. Contribute if you'd like:
1D3NrskpzB5Ydzs2RByDavbqqenbksgNoB  (Bounty thread)

Thanks,

weex

Find a Bitcoin ATM location near you for cash exchange.
Buy eBooks, music, graphics, videos and more at CoinDL: https://www.coindl.com - Github: https://github.com/weex
Grix
Sr. Member
****
Offline Offline

Activity: 325



View Profile WWW

Ignore
March 05, 2012, 07:57:34 PM
 #17

I'm trying to get bitcoind on a VPS to work, but oh my is it hard.. If anyone are willing to help, I've made a thread here: https://bitcointalk.org/index.php?topic=67472.msg784871

Grix
Sr. Member
****
Offline Offline

Activity: 325



View Profile WWW

Ignore
March 06, 2012, 03:21:10 PM
 #18

I don't know if I've set up everything correctly, but when I run the monitor.py, I get this message:

Code:
[root@grixserver python]# ./monitor.py &
[1] 7588
[root@grixserver python]# Traceback (most recent call last):
  File "./monitor.py", line 169, in <module>
    d.check()
  File "./monitor.py", line 52, in check
    p = Popen(command, stdout=PIPE)
  File "/usr/lib/python2.6/subprocess.py", line 639, in __init__
    errread, errwrite)
  File "/usr/lib/python2.6/subprocess.py", line 1228, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Raoul Duke
aka psy
Global Moderator
Hero Member
*
Offline Offline

Activity: 1078


XBT.pt - BTC/DOGE


View Profile WWW

Ignore
March 06, 2012, 03:46:06 PM
 #19

Using your quote, 12700 oscommerce shops. Do you realise those numbers are very low?
Prestashop has more than 80,000 active shops and yet we don't see much of them using bitcoin.
Also, Prestashop is still in active development.
I suspect you targeted the wrong platform.
Nonetheless: Great work!

weex
Hero Member
*****
Offline Offline

Activity: 793


Give me your tired, your poor, your huddled...


View Profile WWW

Ignore
March 06, 2012, 04:51:53 PM
 #20

Using your quote, 12700 oscommerce shops. Do you realise those numbers are very low?
Prestashop has more than 80,000 active shops and yet we don't see much of them using bitcoin.
Also, Prestashop is still in active development.
I suspect you targeted the wrong platform.
Nonetheless: Great work!

Thanks, this is what I'm hearing and after a bit of browsing of the example shops I think many links are dead. Still, this project was sparked by a request from someone who needs it so I don't feel it is diminished.

Much of the code in monitor.py can be reused to support Prestashop, Zencart, and others. What I've found is several modules that are not comfortable talking to bitcoind and this one may help on that front.

One shopping in cart in particular that is interesting is Shopify. To support them you pretty much have to run bitcoind for anyone who wants to add your app.

Find a Bitcoin ATM location near you for cash exchange.
Buy eBooks, music, graphics, videos and more at CoinDL: https://www.coindl.com - Github: https://github.com/weex
Pages: [1] 2 3  All
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!