weex (OP)
Legendary
Offline
Activity: 1102
Merit: 1014
|
|
March 03, 2012, 08:35:22 AM Last edit: March 17, 2012, 02:53:12 AM by weex |
|
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-bitcoinPart 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
|
|
|
|
weex (OP)
Legendary
Offline
Activity: 1102
Merit: 1014
|
|
March 04, 2012, 09:40:43 AM |
|
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.
|
|
|
|
Grix
|
|
March 04, 2012, 06:33:14 PM |
|
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 (OP)
Legendary
Offline
Activity: 1102
Merit: 1014
|
|
March 04, 2012, 08:47:59 PM |
|
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
|
|
|
|
koin
Legendary
Offline
Activity: 873
Merit: 1000
|
|
March 04, 2012, 09:18:21 PM |
|
is there a link to any site that uses this, to demonstrate?
|
|
|
|
Grix
|
|
March 04, 2012, 10:48:21 PM |
|
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 (OP)
Legendary
Offline
Activity: 1102
Merit: 1014
|
|
March 05, 2012, 12:10:21 AM |
|
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.
|
|
|
|
Daily Anarchist
|
|
March 05, 2012, 02:43:46 AM |
|
There's already a pretty nice oscommerce Bitcoin payment module available here: http://addons.oscommerce.com/info/8170One 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.
|
|
|
|
weex (OP)
Legendary
Offline
Activity: 1102
Merit: 1014
|
|
March 05, 2012, 03:16:01 AM |
|
There's already a pretty nice oscommerce Bitcoin payment module available here: http://addons.oscommerce.com/info/8170One 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.
|
|
|
|
Daily Anarchist
|
|
March 05, 2012, 05:04:56 AM |
|
There's already a pretty nice oscommerce Bitcoin payment module available here: http://addons.oscommerce.com/info/8170One 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?
|
|
|
|
weex (OP)
Legendary
Offline
Activity: 1102
Merit: 1014
|
|
March 05, 2012, 05:18:19 AM |
|
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.
|
|
|
|
Daily Anarchist
|
|
March 05, 2012, 05:40:27 AM |
|
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.
|
|
|
|
weex (OP)
Legendary
Offline
Activity: 1102
Merit: 1014
|
|
March 05, 2012, 05:46:28 AM |
|
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.
|
|
|
|
weex (OP)
Legendary
Offline
Activity: 1102
Merit: 1014
|
|
March 05, 2012, 07:21:52 AM |
|
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
|
|
|
|
Grix
|
|
March 05, 2012, 03:49:43 PM |
|
When do you expect this to be finished/good enough for long term reliable use?
|
|
|
|
weex (OP)
Legendary
Offline
Activity: 1102
Merit: 1014
|
|
March 05, 2012, 04:48:17 PM Last edit: March 05, 2012, 05:03:29 PM by weex |
|
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
|
|
|
|
|
Grix
|
|
March 06, 2012, 03:21:10 PM |
|
I don't know if I've set up everything correctly, but when I run the monitor.py, I get this message: [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
Legendary
Offline
Activity: 1372
Merit: 1002
|
|
March 06, 2012, 03:46:06 PM |
|
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 (OP)
Legendary
Offline
Activity: 1102
Merit: 1014
|
|
March 06, 2012, 04:51:53 PM |
|
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.
|
|
|
|
|