Author

Topic: Bounty PAID: BITCOIN OPEN CART PAYMENT MODULE! (Read 20694 times)

full member
Activity: 189
Merit: 100
BitcoinStoreStarter.com
December 25, 2014, 12:52:20 PM
#92
If anyone uses wordpress, check out my product: https://bitcointalksearch.org/topic/m.9937935
newbie
Activity: 5
Merit: 0
Internal Server Error

Can I fix it?
Opencart opencart-1.5.5.1
OpenCart_Bitcoin-master
Debian
newbie
Activity: 30
Merit: 0
Hi again,

I'm also keen to know if there is any updated version of this. Thanks for your time and effort.

Regards.
newbie
Activity: 1
Merit: 0
Have you maybe released the github source of the fixed version, I have tried to fix it but haven't managed to.
hero member
Activity: 1582
Merit: 759
Can this be updated now that MTGox is no longer active? I need it to convert from GBP (£) on the newest OpenCart software. Willing to pay a bounty just PM me

PM'd. I'll fork and provide the source on Github.
newbie
Activity: 1
Merit: 0
Can this be updated now that MTGox is no longer active? I need it to convert from GBP (£) on the newest OpenCart software. Willing to pay a bounty just PM me
full member
Activity: 238
Merit: 100
KUPO!
dont suppose there are any of these confirmed as working on 1.5.6 are there?
I noticed they are only confirmed as working on lower versions
full member
Activity: 154
Merit: 100
Just sent to jga suggestion to fix strptime()
trying to use blockchain API...
sr. member
Activity: 462
Merit: 250
Hi, I wonder if I using your extension, that's mean I have to run bitcoin server on my computer 24/7?
I think, bitcoind is needed whenever a customer goes to checkout. But it does not have to run on your computer, it can be someone else's computer (e.g. DS/VDS).
full member
Activity: 154
Merit: 100
Hi, I wonder if I using your extension, that's mean I have to run bitcoin server on my computer 24/7?
newbie
Activity: 30
Merit: 0
This is great news, I will be testing it out soon. Thank you Smiley
jga
member
Activity: 96
Merit: 10
http://btcgear.com
Good news, friends! I found a way to do instant payment verification with the Blockchain JSON-RPC API!

Other features (added a countdown timer) and bugfixes are also in the latest version.

Check out https://github.com/btcgear/OpenCart_Bitcoin for the latest code and, as always, let me know if you have any issues by sending an email to [email protected].
newbie
Activity: 30
Merit: 0
Could you possibly make a version that shows a button "click here when you have sent payment", that will close the window and put the order through regardless of payment? I know this is not ideal but it would be no harder to check if the payment has been made than it would for say a bank transfer payment.
It makes sense to separate verification from the ordering process. The payment extension will only need to generate and display a new address for every order, which can be done in PHP. The extension can generate public keys using a deterministic wallet algorithm. The corresponding private keys can be generated locally on operator's computer. This scheme does not need a hot wallet or a third-party service.

In all honesty I would personally still check each payment had been made manually anyway, so for me this solution would be fine. I can understand how others may want the whole process to be automatic though, especially for digital goods.
sr. member
Activity: 462
Merit: 250
Could you possibly make a version that shows a button "click here when you have sent payment", that will close the window and put the order through regardless of payment? I know this is not ideal but it would be no harder to check if the payment has been made than it would for say a bank transfer payment.
It makes sense to separate verification from the ordering process. The payment extension will only need to generate and display a new address for every order, which can be done in PHP. The extension can generate public keys using a deterministic wallet algorithm. The corresponding private keys can be generated locally on operator's computer. This scheme does not need a hot wallet or a third-party service.
newbie
Activity: 30
Merit: 0
Well, friends, I have some bad news. It appears the Blockchain.info JSON-RPC API can not play nice with my payment module in its current incarnation. The payment module relies upon immediate acknowledgement of a transaction (0 confirmations) in order to function properly. There is a delay between sending payment to a Blockchain.info MyWallet address and Blockchain's acknowledgement of the transaction. It appears to wait until 1 confirmation. This means that it is impossible to do a slick immediate recognition of payment (as my payment module is programmed to do) with the Blockchain.info API at the present.

I could write an extension that would accept any order regardless of whether payment was ever sent, OR I could write an extension that would instruct the user to wait 10 or 15 minutes to see if their order went through. Both sound like a rather silly way of doing business, but unfortunately that's all that would be possible with the Blockchain.info JSON-RPC API (until they improve it).

This is a shame. Could you possibly make a version that shows a button "click here when you have sent payment", that will close the window and put the order through regardless of payment? I know this is not ideal but it would be no harder to check if the payment has been made than it would for say a bank transfer payment. Thanks for your time on this.
jga
member
Activity: 96
Merit: 10
http://btcgear.com
Well, friends, I have some bad news. It appears the Blockchain.info JSON-RPC API can not play nice with my payment module in its current incarnation. The payment module relies upon immediate acknowledgement of a transaction (0 confirmations) in order to function properly. There is a delay between sending payment to a Blockchain.info MyWallet address and Blockchain's acknowledgement of the transaction. It appears to wait until 1 confirmation. This means that it is impossible to do a slick immediate recognition of payment (as my payment module is programmed to do) with the Blockchain.info API at the present.

I could write an extension that would accept any order regardless of whether payment was ever sent, OR I could write an extension that would instruct the user to wait 10 or 15 minutes to see if their order went through. Both sound like a rather silly way of doing business, but unfortunately that's all that would be possible with the Blockchain.info JSON-RPC API (until they improve it).
jga
member
Activity: 96
Merit: 10
http://btcgear.com
Well, I finally figured out why it wasn't working with the Blockchain.info JSON-RPC API. It appears the JSON-RPC API returns Bitcoin values rounded to three decimal points (!) So... the smaller orders I was testing with returned 0.000 received when they should have returned 0.0001... There was some other weird behavior with the blockchain API so I need to test more thoroughly before I push out a fix.

I also have some other features (including a timer and a bit cleaner interface) and bugfixes that I'm hoping to roll out in the next day or two.
newbie
Activity: 30
Merit: 0
Sure. Well I'm using Electrum and it's possible to add a description to your payment. Will have to check if that's standard.

Eventually jga's module is what I need, because it's the only way to automate things. For small scale I think it can be done my way as well..

I have not tried Electrum yet, just having a look at it now and it seems quite impressive. My plan is to just dump all the BTC into an offline wallet each day/week.

From the standard bitcoin-qt client, I just had a look and it does not look like you can add a comment when sending a payment, only a label for yourself. Maybe I am missing something.
sr. member
Activity: 476
Merit: 250
Can somebody help me?
Have a problem with btc-usd exchange (bitcoin_update.php) with change by adding one line in index.php

Fatal error: Call to undefined function strptime()

running php version 5.4.3

Maybe can be replaced with date_parse_from_format() ?
newbie
Activity: 50
Merit: 0
I think the problem of providing just one address is that you will not know who has sent you the BTC :-/
With the current amount of orders I should be good for now  Roll Eyes. But I'll instruct my customers to add the ordernumber as a description. anyone can add a description to their payments right?

To be honest I'm not sure if you can add a comment/order number with a payment, maybe somebody else can let you know about this... I run a store that accepts bank transfer and that's what I do, get the customer to put the order number as the reference but 99% of the time the payment actually shows the customers name in my bank account anyway, on the odd occasion (I think when they go directly to my bank to make a deposit) it will only show the city/branch name and the reference/order number.

This is what I like about JGA's payment module, it makes a new address with the label as a prefix and the order number, so you could have a different prefix for different stores and still use the same wallet without it getting confusing, like in the screen shot below:

http://s24.postimg.org/4bcsocibp/btcrccri.png

  
Sure. Well I'm using Electrum and it's possible to add a description to your payment. Will have to check if that's standard.

Eventually jga's module is what I need, because it's the only way to automate things. For small scale I think it can be done my way as well..
newbie
Activity: 30
Merit: 0
I think the problem of providing just one address is that you will not know who has sent you the BTC :-/
With the current amount of orders I should be good for now  Roll Eyes. But I'll instruct my customers to add the ordernumber as a description. anyone can add a description to their payments right?

To be honest I'm not sure if you can add a comment/order number with a payment, maybe somebody else can let you know about this... I run a store that accepts bank transfer and that's what I do, get the customer to put the order number as the reference but 99% of the time the payment actually shows the customers name in my bank account anyway, on the odd occasion (I think when they go directly to my bank to make a deposit) it will only show the city/branch name and the reference/order number.

This is what I like about JGA's payment module, it makes a new address with the label as a prefix and the order number, so you could have a different prefix for different stores and still use the same wallet without it getting confusing, like in the screen shot below:

http://s24.postimg.org/4bcsocibp/btcrccri.png

  
newbie
Activity: 50
Merit: 0
I think the problem of providing just one address is that you will not know who has sent you the BTC :-/
With the current amount of orders I should be good for now  Roll Eyes. But I'll instruct my customers to add the ordernumber as a description. anyone can add a description to their payments right?
newbie
Activity: 30
Merit: 0
As for everyone else, if you're still having issues with my extension, email me at [email protected] and I'll see what I can do. I can make a test site and/or test bitcoind server available to one user at a time which can make troubleshooting much easier.

Thanks for the email. I have replied, hopefully this can be made to work with the blockchain.info JSON RPC API Smiley

Yes, it is my intention to be independent of the middle men. I haven't been as brave as you to try and install the payment module, and I'm not skilled enough to help you sorry. As my shop is just starting I'm thinking about just providing a fixed bitcoin address. I don't think that's any different from providing details about a bank account. for business it is cheaper though. Before I do that I want to be able to charge the customer for the transaction costs - to make it clear what the difference is between say paypal and bitcoin. I just learned paypal forbids you to separately add the transaction costs, and I'm curious if they're going to cut me off  Roll Eyes

I think the problem of providing just one address is that you will not know who has sent you the BTC :-/

As said above though just do a discount for BTC, many sites do this (10% off or similar) if you pay by bank transfer rather than CC Smiley
jga
member
Activity: 96
Merit: 10
http://btcgear.com

I'm dying for a module like this because if the strong fluctuations.. it only works if the standard valuta is USD - but mine has to be EUR.. I recon it's not too difficult to fork this module for the european market? I emailed the guy, and I just hope someone can explain me how to do it sooner rather then later Wink

Hey, sorry I didn't get back to you when you emailed about EUR support. I integrated it and then couldn't remember what e-mail address you contacted me through or if it had been a forum PM or whatever so I couldn't let you know I had gotten it working.

As for everyone else, if you're still having issues with my extension, email me at [email protected] and I'll see what I can do. I can make a test site and/or test bitcoind server available to one user at a time which can make troubleshooting much easier.
sr. member
Activity: 462
Merit: 250
Before I do that I want to be able to charge the customer for the transaction costs - to make it clear what the difference is between say paypal and bitcoin. I just learned paypal forbids you to separately add the transaction costs, and I'm curious if they're going to cut me off  Roll Eyes
One can provide a discount for Bitcoin payments instead, but who cares about PayPal? Grin
newbie
Activity: 50
Merit: 0
Yes, it is my intention to be independent of the middle men. I haven't been as brave as you to try and install the payment module, and I'm not skilled enough to help you sorry. As my shop is just starting I'm thinking about just providing a fixed bitcoin address. I don't think that's any different from providing details about a bank account. for business it is cheaper though. Before I do that I want to be able to charge the customer for the transaction costs - to make it clear what the difference is between say paypal and bitcoin. I just learned paypal forbids you to separately add the transaction costs, and I'm curious if they're going to cut me off  Roll Eyes
newbie
Activity: 30
Merit: 0
I have got this installed now (jga full version) and all seems to be working but it is not saying it has been paid or adding the order on my end?? I have 3 confirmations so far on a test payment of 0.001 BTC and the payment is in my wallet. I'm using the blockchain.info JSON RPC API login details to connect to my blockchain wallet, could this be the problem?:

Store front 1:
http://s24.postimg.org/eszb7p5zp/btc1.png

3 Confirmations:
http://s24.postimg.org/rbki20sd1/btc3.png

Store front 2:
http://s14.postimg.org/v6isvj3s1/btc2.png

It is adding the funds/address to my wallet but not adding the order or saying it has been paid on the website end:
http://s8.postimg.org/50rjt75cl/btc4.png

This was in my opencart error log:
Code:
2013-05-12 2:57:03 - PHP Notice:  Undefined variable: bitcoin_send_address in /home/*****/public_html/catalog/view/theme/default/template/payment/bitcoin.tpl on line 55

Any help is much appreciated. I'm using Opencart 1.5.5.1 and a blockchain.info wallet.
newbie
Activity: 50
Merit: 0
I would like to add a feature request and along with it 10 BTC bounty for this feature: Add an easy to implement hack into Opencart that adds Bitcoin as a currency and gives the user the choice to display prices in Bitcoin or any other currency.

Done. This is already in my latest version.  In the admin console upon install, you can choose whether or not to enable BTC as a user-visible currency.

Edit: I also have this available as a stand-alone module, but I haven't open sourced it yet.

Edit: now I have open sourced it and it is available at https://github.com/btcgear/Bitcoin_Exchange_Rate_OpenCart
This code is fully tested and has been in use at http://www.btcgear.com for months.

Please send bounty to 14dTC7bBphANAHzmK9aD7X7Wvo99rhHMTF
I'm dying for a module like this because if the strong fluctuations.. it only works if the standard valuta is USD - but mine has to be EUR.. I recon it's not too difficult to fork this module for the european market? I emailed the guy, and I just hope someone can explain me how to do it sooner rather then later Wink

I noticed the plugin has now been updated to use other currencies, did you manage to get it working? If possible could you PM me the URL of your store so I can see it in action? Thanks.
Thank you so much for telling me!! It works out of the box with my 1.5.5.1 install Grin I did already add BTC as a valuta before, keeping it up to date manually. This is such a relief!! You can visit my store by following the link in my profile..
newbie
Activity: 30
Merit: 0
I would like to add a feature request and along with it 10 BTC bounty for this feature: Add an easy to implement hack into Opencart that adds Bitcoin as a currency and gives the user the choice to display prices in Bitcoin or any other currency.

Done. This is already in my latest version.  In the admin console upon install, you can choose whether or not to enable BTC as a user-visible currency.

Edit: I also have this available as a stand-alone module, but I haven't open sourced it yet.

Edit: now I have open sourced it and it is available at https://github.com/btcgear/Bitcoin_Exchange_Rate_OpenCart
This code is fully tested and has been in use at http://www.btcgear.com for months.

Please send bounty to 14dTC7bBphANAHzmK9aD7X7Wvo99rhHMTF
I'm dying for a module like this because if the strong fluctuations.. it only works if the standard valuta is USD - but mine has to be EUR.. I recon it's not too difficult to fork this module for the european market? I emailed the guy, and I just hope someone can explain me how to do it sooner rather then later Wink

I noticed the plugin has now been updated to use other currencies, did you manage to get it working? If possible could you PM me the URL of your store so I can see it in action? Thanks.
newbie
Activity: 50
Merit: 0
I would like to add a feature request and along with it 10 BTC bounty for this feature: Add an easy to implement hack into Opencart that adds Bitcoin as a currency and gives the user the choice to display prices in Bitcoin or any other currency.

Done. This is already in my latest version.  In the admin console upon install, you can choose whether or not to enable BTC as a user-visible currency.

Edit: I also have this available as a stand-alone module, but I haven't open sourced it yet.

Edit: now I have open sourced it and it is available at https://github.com/btcgear/Bitcoin_Exchange_Rate_OpenCart
This code is fully tested and has been in use at http://www.btcgear.com for months.

Please send bounty to 14dTC7bBphANAHzmK9aD7X7Wvo99rhHMTF
I'm dying for a module like this because if the strong fluctuations.. it only works if the standard valuta is USD - but mine has to be EUR.. I recon it's not too difficult to fork this module for the european market? I emailed the guy, and I just hope someone can explain me how to do it sooner rather then later Wink
sr. member
Activity: 462
Merit: 250
perhaps opencart has had an update or something?
My extension is currently unmaintained due to lack of interest from users. I haven't tested it with latest OpenCart, but I'm going to do it as time permits.

is this thread still alive to try and help me debug the issues?
Sort of. You can also send me a PM or email.

Yurock I seemed to even just have errors pop up on trying to install the latest version of ur code... on installing bitcoin as payment method... just goes to white screen... can refresh the site and it looks to have installed anyway...
Code:
Notice: Error: Table 'opencart2btc.oc_bitcoind_bill' doesn't exist
Error No: 1146
Error in: C:\_websites\YourikBTCOpencartPlugin\admin\model\payment\bitcoind.php line 67
SELECT order_id,total,status,deadline,sent,payment_address,refund_address,IF(deadline,TIMESTAMPDIFF(SECOND,NOW(),deadline),NULL)AS time_left FROM oc_bitcoind_bill LIMIT 0,20 in C:\_websites\YourikBTCOpencartPlugin\system\database\mysql.php on line 54
During installation, the extension needs to create a table in the database. It seems like this step failed. Maybe the MySQL user account of OpenCart does not have the needed permission. If this is the case:
  • uninstall the extension;
  • grant CREATE privilege to the OpenCart database user on the OpenCart database;
  • install the extension again;
  • optionally revoke the CREATE privilege.
Alternatively, you can create the table manually:
Code:
CREATE TABLE`oc_bitcoind_bill`(`order_id`INT NOT NULL,`total`DECIMAL(16,8)NOT NULL,`status`ENUM('wait', 'timeout','receive','reverse','confirm','complete','cancel')COLLATE ascii_bin NOT NULL DEFAULT'wait',`deadline`DATETIME NOT NULL DEFAULT'0000-00-00 00:00:00',`sen
t`DECIMAL(16,8)NOT NULL DEFAULT 0,`payment_address`CHAR(34)COLLATE ascii_bin NOT NULL,`refund_address`CHAR(34)COLLATE ascii_bin NOT NULL,PRIMARY KEY(`order_id`),UNIQUE KEY(`payment_address`),INDEX(`status`));

but no currency added to the DB
It is not supposed to add the currency automatically. You need to add it manually and specify it in the extension settings. Also note that if you specify prices in another currency, you'll need to update BTC rate somehow.

otherwise nice code and simple plugin Cheesy
That's not about my extension. Smiley
legendary
Activity: 1420
Merit: 1010
Ok I tried to setup both versions of this BTC plugin and both fail Sad each at different points... perhaps opencart has had an update or something? is this thread still alive to try and help me debug the issues? or am I going to have to start from scratch?

any help will be very greatly appreciated

sites i'm trying on are

jga / btcgear version - http://opencart-btc.btc-music.com

Yrock version - http://opencart2-btc.btc-music.com

i have emailed jga directly but not had a reply with detailed info of my problems,

Yurock I seemed to even just have errors pop up on trying to install the latest version of ur code... on installing bitcoin as payment method... just goes to white screen... can refresh the site and it looks to have installed anyway... but no currency added to the DB, and the settings when clicking control and bills throws errors

Code:
Notice: bitcoind: RPC getinfo failed:curl_exec () failed: The requested URL returned error: 401 in C:\_websites\YourikBTCOpencartPlugin\admin\controller\payment\bitcoind.php on line 595Notice: bitcoind: RPC getaddressesbyaccount failed:curl_exec () failed: The requested URL returned error: 401 in C:\_websites\YourikBTCOpencartPlugin\admin\controller\payment\bitcoind.php on line 595
but bitcoind is def running on the server and i can do getinfo on it in a cmd

second error is only prob cause there has been no purchases yet...
Code:
Notice: Error: Table 'opencart2btc.oc_bitcoind_bill' doesn't exist
Error No: 1146
Error in: C:\_websites\YourikBTCOpencartPlugin\admin\model\payment\bitcoind.php line 67
SELECT order_id,total,status,deadline,sent,payment_address,refund_address,IF(deadline,TIMESTAMPDIFF(SECOND,NOW(),deadline),NULL)AS time_left FROM oc_bitcoind_bill LIMIT 0,20 in C:\_websites\YourikBTCOpencartPlugin\system\database\mysql.php on line 54

But I have had another issue... i have enabled the bitcoin as payment method, set the localhost and port info as well as username and pass, set the sort value to 1.  I checkout and get past stage 5... but on stage 6 of checkout I get the same error as on your test website?? is this a sign of something else broken? or have i not done something?

any advice??

otherwise nice code and simple plugin Cheesy
sr. member
Activity: 462
Merit: 250
Still not working for after about 20 minuts
What exactly is not working?
full member
Activity: 140
Merit: 100
BitFi Services
Still not working for after about 20 minuts
sr. member
Activity: 462
Merit: 250
I have to have a bitcoin client running and the blocks need to be up to date
Yes.

For some reason, the btc block download on this machine is VERY slow, MUCH slower than ltc client  Angry
A new Bitcoin node has to download and verify every block, which includes verifying every transaction. Every input of every transaction needs to be matched to an output of a previous transaction. Then it is necessary to make sure that these outputs were not spend earlier. So, to verify 1 block, it takes hundreds of database lookups. And in total, more than 200000 blocks need to be verified. Services like SatoshiDice make Bitcoin transaction history bloat. If you watch block count during initial download, you can see that pre-SatoshiDice part of transaction history gets downloaded quickly, then it takes very long time to download the heavy part.

To minimize pain of node setup, you can detach DB on your existing Bitcoin installation and copy blk* files to the server.
sr. member
Activity: 353
Merit: 250
Looks like this is another stupid SELinux issue
Believable. So, have you managed to communicate with bitcoind?

Yes,  It's working! Finally.  Thank you very much!

It looks like I have to have a bitcoin client running and the blocks need to be up to date, otherwise, it's going to wait forever. Is it true?

For some reason, the btc block download on this machine is VERY slow, MUCH slower than ltc client  Angry
member
Activity: 100
Merit: 10
Support the bitcoin economy, use BTC merchants
Yurock,

Using your test script I connect without issue, and from within opencart I can get data clicking on the "Control" button, but during transactions I get Server error. Please try again or contact us.

There are no details. Are logs kept somewhere to see what the error is?
sr. member
Activity: 462
Merit: 250
Raw Response
It's a positive result.

Looks like this is another stupid SELinux issue
Believable. So, have you managed to communicate with bitcoind?
sr. member
Activity: 353
Merit: 250
curl_exec failed: Failed to connect to 127.0.0.1: Permission denied
Try to connect to something other. For example:
Protocol: HTTP
Hostname: www.googe.com
Port:80
(empty username and password)
If it fails with the same error then I assume, connections are disabled by your web server configuration.
I got this:
Code:
JSON error: 4
Raw Response



 
 
  Error 405 (Method Not Allowed)!!1
 
  Google
 

405. That’s an error.
 

The request method POST is inappropriate for the URL /That’s all we know.

CURL Info

array (
  'url' => 'http://google.com:80',
  'content_type' => 'text/html; charset=UTF-8',
  'http_code' => 405,
  'header_size' => 226,
  'request_size' => 256,
  'filetime' => -1,
  'ssl_verify_result' => 0,
  'redirect_count' => 0,
  'total_time' => 0.164868,
  'namelookup_time' => 0.134401,
  'connect_time' => 0.144327,
  'pretransfer_time' => 0.144334,
  'size_upload' => 50,
  'size_download' => 959,
  'speed_download' => 5816,
  'speed_upload' => 303,
  'download_content_length' => 959,
  'upload_content_length' => 0,
  'starttransfer_time' => 0.16483,
  'redirect_time' => 0,
  'certinfo' =>
  array (
  ),
)



Looks like this is another stupid SELinux issue: if I run setenforce Permissive, it returns result, but takes a looooong time.
sr. member
Activity: 462
Merit: 250
curl_exec failed: Failed to connect to 127.0.0.1: Permission denied
Try to connect to something other. For example:
Protocol: HTTP
Hostname: www.googe.com
Port:80
(empty username and password)
If it fails with the same error then I assume, connections are disabled by your web server configuration.
sr. member
Activity: 353
Merit: 250
Yurock, thanks for the script. 

After running it, I got this:

Code:
curl_exec failed: Failed to connect to 127.0.0.1: Permission denied
CURL Info
array (
  'url' => 'http://localhost:8332',
  'content_type' => NULL,
  'http_code' => 0,
  'header_size' => 0,
  'request_size' => 0,
  'filetime' => -1,
  'ssl_verify_result' => 0,
  'redirect_count' => 0,
  'total_time' => 0,
  'namelookup_time' => 0.00074,
  'connect_time' => 0,
  'pretransfer_time' => 0,
  'size_upload' => 0,
  'size_download' => 0,
  'speed_download' => 0,
  'speed_upload' => 0,
  'download_content_length' => -1,
  'upload_content_length' => -1,
  'starttransfer_time' => 0,
  'redirect_time' => 0,
  'certinfo' =>
  array (
  ),
)

what permission is it talking about?
sr. member
Activity: 462
Merit: 250
a special Bitcoin RPC test script
Code:
error_reporting (E_ALL);
ini_set ('display_errors'true);
ini_set ('html_errors'true);
echo 
'
';
?>




Bitcoin RPC Test


function rpc ($url$userpwd) {
 
$curl curl_init ($url);
 if (! 
$curl) {
  echo 
'

curl_init failed

'
;
  return;
 }
 
$id = (string) rand ();
 if (! 
curl_setopt ($curlCURLOPT_RETURNTRANSFERtrue)) {
  echo 
'

curl_setopt (CURLOPT_RETURNTRANSFER) failed: 'htmlspecialchars (curl_error ($curl)), '

'
;
  return;
 }
 if (
strlen ($userpwd) > 1)
  if (! 
curl_setopt ($curlCURLOPT_USERPWD$userpwd)) {
   echo 
'

curl_setopt (CURLOPT_USERPWD) failed: 'htmlspecialchars (curl_error ($curl)), '

'
;
   return;
  }
 if (! 
curl_setopt ($curlCURLOPT_POSTFIELDSjson_encode (array ('method' => 'getinfo''params' => array (), 'id' => $id)))) {
  echo 
'

curl_setopt (CURLOPT_POSTFIELDS) failed: 'htmlspecialchars (curl_error ($curl)), '

'
;
  return;
 }
 
$r curl_exec ($curl);
 if (
curl_errno ($curl)) echo '

curl_exec failed: 'htmlspecialchars (curl_error ($curl)), '

'
;
 if (
is_string ($r)) {
  
$d json_decode ($rtrue);
  
$e json_last_error ();
  if (
$e) echo "

JSON error: $e

"
;
  if (
is_array ($d)) {
   if (
array_key_exists ('id'$d)) {
    if (
$d ['id'] != $id) echo '

ID mismatch:request: '$id'response: '$d ['id'], '

'
;
   } else echo 
'

Response lacks ID.

'
;
   if (
array_key_exists ('result'$d)) echo '

Result

'htmlspecialchars (var_export ($d ['result'], true)), '
'
;
   else echo 
'

Response lacks result.

'
;
   if (
array_key_exists ('error'$d) && $d ['error']) echo '

Error

'htmlspecialchars (var_export ($d ['error'], true)), '
'
;
  }
  echo 
'

Raw Response

'htmlspecialchars ($r), '
'
;
 }
  echo 
'

CURL Info

'htmlspecialchars (var_export (curl_getinfo ($curl), true)), '
'
;
}
foreach (array (
'proto''host''port''user''pass') as $n)
 
$GLOBALS [$n] = array_key_exists ($n$_REQUEST) ? $_REQUEST [$n] : '';
if (
strlen ($proto) && strlen ($host)) {
 if (
is_numeric (strpos ($host':'))) $host '[' $host ']';
 
$url "$proto://$host";
 if (
strlen ($port)) $url .= ":$port";
 if (
is_numeric (strpos ($user':'))) echo '

Warning: username contains a semicolon.

'
;
 
rpc ($url"$user:$pass");
} else {
?>

echo htmlspecialchars (basename ($_SERVER ['PHP_SELF'])); ?>">







Result



}
?>


sr. member
Activity: 462
Merit: 250
On my server side with a dedicated IP address: For port 8332 which protocol (UDP or TCP) and which direction (Inbound or Outbound)?
TCP is used for RPC communications.
For bitcoind, connections are inbound.
For OpenCart, connections are outbound.

I am having similar issue, there's no rpc traffic information in bitcoin debug.log.

opencart log has this:
2013-01-20 23:50:00 - PHP Notice:  Undefined variable: bitcoin_send_address in /var/www/html/opencart/catalog/view/theme/default/template/payment/bitcoin.tpl on line 51
2013-01-20 23:50:00 - PHP Notice:  Undefined variable: bitcoin_send_address in /var/www/html/opencart/catalog/view/theme/default/template/payment/bitcoin.tpl on line 53
2013-01-20 23:50:00 - PHP Notice:  Undefined variable: bitcoin_send_address in /var/www/html/opencart/catalog/view/theme/default/template/payment/bitcoin.tpl on line 55

when checkout after payment step, user always gets: "Error communicating with payment provider. Please contact the store for assistance."

bitcoind getinfo returns result after 20~30 seconds, I don't know why it takes so long, the error message was definitely displayed back to user in less than 5 seconds, so this seems to be a timeout issue, where should I change it?
Check that your scripts on the web server have ability to make TCP connections to other hosts on the internet.
Check that bitcoind allows connections from your web site (rpcallowip).
Check that inbound RPC connections are possible on the bitcoind side.
You can also try my extension and check OpenCart error log for relevant messages. Also, I am going to write a special Bitcoin RPC test script, so you won't have to install an OpenCart extension just for debugging.
sr. member
Activity: 353
Merit: 250
LiteBit

Check that RPC works:
bitcoind getinfo

Add
rpcallowip=127.0.0.1
You can leave rpcallowip with another address too.

What are the payment module settings?

Check OpenCart error log.

It looks like it's not talking back and forth.  I run bitcoind getinfo and get a ping in the debug.log file, but when I run it through my OC module checkout I'm still getting errors.  I'm going to run a curl script on it tonight and see what the hangup is.  I'll try rpcallowip= as well... that could be the issue.  Thx.

I am having similar issue, there's no rpc traffic information in bitcoin debug.log.

opencart log has this:
2013-01-20 23:50:00 - PHP Notice:  Undefined variable: bitcoin_send_address in /var/www/html/opencart/catalog/view/theme/default/template/payment/bitcoin.tpl on line 51
2013-01-20 23:50:00 - PHP Notice:  Undefined variable: bitcoin_send_address in /var/www/html/opencart/catalog/view/theme/default/template/payment/bitcoin.tpl on line 53
2013-01-20 23:50:00 - PHP Notice:  Undefined variable: bitcoin_send_address in /var/www/html/opencart/catalog/view/theme/default/template/payment/bitcoin.tpl on line 55

when checkout after payment step, user always gets: "Error communicating with payment provider. Please contact the store for assistance."

bitcoind getinfo returns result after 20~30 seconds, I don't know why it takes so long, the error message was definitely displayed back to user in less than 5 seconds, so this seems to be a timeout issue, where should I change it?




legendary
Activity: 1133
Merit: 1050
Can you answer this so I set everything up right?
On my server side with a dedicated IP address: For port 8332 which protocol (UDP or TCP) and which direction (Inbound or Outbound)?
legendary
Activity: 1133
Merit: 1050
LiteBit,

Which module are you using? Mine or Yurock's?

Yours.  I think it's a port issue.  My provider locks down ports unless I have a dedicated IP.  I'm going to wait til that takes affect and try it once more with 8332 and 9332 open.  Will let you know.
jga
member
Activity: 96
Merit: 10
http://btcgear.com
LiteBit,

Which module are you using? Mine or Yurock's?
legendary
Activity: 1133
Merit: 1050
LiteBit

Check that RPC works:
bitcoind getinfo

Add
rpcallowip=127.0.0.1
You can leave rpcallowip with another address too.

What are the payment module settings?

Check OpenCart error log.

It looks like it's not talking back and forth.  I run bitcoind getinfo and get a ping in the debug.log file, but when I run it through my OC module checkout I'm still getting errors.  I'm going to run a curl script on it tonight and see what the hangup is.  I'll try rpcallowip= as well... that could be the issue.  Thx.
sr. member
Activity: 462
Merit: 250
LiteBit

Check that RPC works:
bitcoind getinfo

Add
rpcallowip=127.0.0.1
You can leave rpcallowip with another address too.

What are the payment module settings?

Check OpenCart error log.
legendary
Activity: 1133
Merit: 1050
I'm having trouble getting this working.  Any help?

Here's what I'm doing:
I've got the module installed on my OpenCart (running 1.5.4)
I've got version 0.7.2 of Bitcoin running on a local computer
I've got a bitcoin.conf file in my User/AppData/Roaming/Bitcoin folder that looks like this:

rpcuser=username
rpcpassword=password
rpcallowip=ip_address
rpcport=9332
daemon=1
server=1
gen=0

My ip address in the above .conf file is my local computer's ip address which is a static ip address.
I've got the module in OpenCart filed in with the above information
I've got US Dollar set as my default currency and it's value set at 1.00000
I've got Bitcoin as a currency in my Localisation settings and it's value is set as 0.07042125

Ok, that's what I'm doing.
The problem I'm getting is on testing the checkout functions.
I put in a false order with a user I set up.  I have the currency showing BTC. I get to step 5 of the checkout (payment method) with Bitcoin selected.  I check my TOC box and click "Continue"... 
Problem #1: Nothing happens.

I click "Continue" a second time and I get a signal that it's processing the order
On step 6 of the checkout (confirm order) I get what looks to be a summary of my order. 
Problem #2: About 10 seconds after this a message at the bottom of the order that says "Error communicating with payment provider. Please contact the store for assistance."

Questions:
1. Is it ok to have this pointing to a local computer or does it need to be on a server?
2. If it does need to be on a server how do I actually do that? Do I "install" bitcoin program somehow?
3. Can I have special characters %#@ in my RPC username and RPC password?
4. Should my bitcoin.conf file show my IP as 127.0.0.1 and my RPC host on the module in my OpenCart Admin show my actual IP of the computer?

Any and all help is greatly appreciated!
Cheers,
LiteBit
full member
Activity: 220
Merit: 100
Been using this.. thanks for the work! Now I just need to wait for some actual BTC customers
jga
member
Activity: 96
Merit: 10
http://btcgear.com
You can check out a demo version currently running at http://test154.btcgear.com.
On the checkout page I got an alert box that says "object". Then payment details appeared as expected.

Yeah, sorry about that. I had a development version installed. The production version is now loaded and ready to rock.
sr. member
Activity: 462
Merit: 250
You can check out a demo version currently running at http://test154.btcgear.com.
On the checkout page I got an alert box that says "object". Then payment details appeared as expected.
jga
member
Activity: 96
Merit: 10
http://btcgear.com
I've been busy updating the OpenCart module at https://github.com/btcgear/OpenCart_Bitcoin. It now has a much cleaner user interface, a QR code, and a URI link. It also automatically redirects to the checkout/success page upon receipt of payment.

You can check out a demo version currently running at http://test154.btcgear.com.

More info is here: http://blog.btcgear.com/2012/12/10/opencart_bitcoin-version-1-3-1/

Here's a screenshot:

sr. member
Activity: 462
Merit: 250
However, one problem we could not solve is that the keypool is being depleted unless they manually unlock bitcoind's wallet on a regular basis.
Use large key pool. Add something like
Code:
keypool=10000
to bitcoin.conf
https://en.bitcoin.it/wiki/Running_Bitcoin

Can you replenish the keypool without manual intervention?
Key pool cannot be refilled without unlocking the wallet, because it uses a symmetric cypher. So, the passphrase is needed to encrypt newly created keys.
newbie
Activity: 3
Merit: 0
I have talked to the guys at SlySoft and they have their own implementation of a bitcoin shop integration because they have their own clunky shop software.  However, one problem we could not solve is that the keypool is being depleted unless they manually unlock bitcoind's wallet on a regular basis.  As I don't have a clue about OpenCart internals, I have not looked at your implementation yet.  Can you replenish the keypool without manual intervention?  Do you use a different wallet?
sr. member
Activity: 462
Merit: 250
New version. Added Bitcoin URI support, improved recalculation of total amount after order editing. Demo site is still up.
jga
member
Activity: 96
Merit: 10
http://btcgear.com
I would like to add a feature request and along with it 10 BTC bounty for this feature: Add an easy to implement hack into Opencart that adds Bitcoin as a currency and gives the user the choice to display prices in Bitcoin or any other currency.

Done. This is already in my latest version.  In the admin console upon install, you can choose whether or not to enable BTC as a user-visible currency.

Edit: I also have this available as a stand-alone module, but I haven't open sourced it yet.

Edit: now I have open sourced it and it is available at https://github.com/btcgear/Bitcoin_Exchange_Rate_OpenCart
This code is fully tested and has been in use at http://www.btcgear.com for months.

Please send bounty to 14dTC7bBphANAHzmK9aD7X7Wvo99rhHMTF

Bounty paid - thank you! Cheesy

Confirmed! Thanks!
sr. member
Activity: 462
Merit: 250
Someone registered an account named "ss" with email address [email protected] and ordered 50¢ Mt.Gox Code. As email cannot be delivered to that address, the order was cancelled, and bitcoins were returned. Anyway, thanks for the participation in testing. Smiley



On the second screenshot, first 2 entries in the order history are in Russian. They were added automatically by the payment extension. I suppose, the buyer was using Russian interface.



Here are some tips for those who use my demo site.
There is a language switch at the top.
To receive codes, specify your email address.
To make a donation, "order" these items.
To try the refund feature, "order" this item.
full member
Activity: 178
Merit: 100
I would like to add a feature request and along with it 10 BTC bounty for this feature: Add an easy to implement hack into Opencart that adds Bitcoin as a currency and gives the user the choice to display prices in Bitcoin or any other currency.

Done. This is already in my latest version.  In the admin console upon install, you can choose whether or not to enable BTC as a user-visible currency.

Edit: I also have this available as a stand-alone module, but I haven't open sourced it yet.

Edit: now I have open sourced it and it is available at https://github.com/btcgear/Bitcoin_Exchange_Rate_OpenCart
This code is fully tested and has been in use at http://www.btcgear.com for months.

Please send bounty to 14dTC7bBphANAHzmK9aD7X7Wvo99rhHMTF

Bounty paid - thank you! Cheesy
sr. member
Activity: 462
Merit: 250
Congrats jga!
jga
member
Activity: 96
Merit: 10
http://btcgear.com
Bounty paid!  Thanks cablepair.
sr. member
Activity: 462
Merit: 250
Bitcoind is up, you can check out the demo site. And here are more screenshots from the store back.

sr. member
Activity: 462
Merit: 250
How are you polling bitcoind?
listtransactions to catch new incoming transactions; then getreceivedbyaddress and getbalance for all outstanding invoices to catch transaction reversal.
BCB
vip
Activity: 1078
Merit: 1002
BCJ
How are you polling bitcoind?
sr. member
Activity: 462
Merit: 250
Here is another extension that satisfies the given requirements: code, demo.
It does not update BTC rate automatically. I believe, it should be done in a separate module. The payment module just uses the current rate from OpenCart settings.
The extension is designed to work together with a cron job that processes outstanding invoices. However, the cron job is optional: bills can be processed manually from admin panel.
Why cron job? Bitcoind does not have an option to notify us when a new block arrives. So, it is necessary to poll bitcoind for changes. Under normal circumstances, the payment transaction arrives while the customer has the site open in browser; so this event is processed automatically. After that we don't hold the customer any longer, and they are free to browse away without waiting for confirmations. This is where I rely on the cron job to check if the transaction gets confirmed or reversed and change the order status accordingly. If cron job is not installed, a store operator has to open an outstanding bill's page, click "Process" and see the final status of the payment.

Update: VPS with bitcoind went down. Sad I will make an update when it will be up, so you all can try the demo site.

In the meantime, here is a screenshot of the settings page:


Update: Bitcoind is up, demo site should be fully functional now.
hero member
Activity: 896
Merit: 1000
Buy this account on March-2019. New Owner here!!
sorry been super busy - I  promise I will test this tomorrow and pay the bounty if it meets requirements.

thanks.
jga
member
Activity: 96
Merit: 10
http://btcgear.com


I just remembered I have to check this one out.

(Sorry Doug Tongue )

That's cool. Also, who's Doug? Huh I'm John. Although, pay me 50 bitcoins and you can call me whatever you want.  Wink

Some feature requests:
- Bitcoin URIs support
- Something like Bitcoin SCI ( connected with blockexplorer/blockchain.info APIs ) to avoid bitcoind.

I'm not going to use your great module, but I think that someone will like these features Smiley


The URI support is a good idea. I'm also looking into the best way to add QR codes to the mix.

The Bitcoin SCI integration would be a lower-priority feature because the main idea behind this was to help merchants avoid third parties. However, if someone wants to throw some money at this, I'll get it done. My long-term vision for this module is a one-stop shop for OpenCart merchants to get FULL Bitcoin integration anywhere they could possibly want it. I even have aspirations of forking OpenCart and creating an out-of-the-box full Bitcoin merchant solution.
staff
Activity: 4270
Merit: 1209
I support freedom of choice
Some feature requests:
- Bitcoin URIs support
- Something like Bitcoin SCI ( connected with blockexplorer/blockchain.info APIs ) to avoid bitcoind.

I'm not going to use your great module, but I think that someone will like these features Smiley
hero member
Activity: 896
Merit: 1000
Buy this account on March-2019. New Owner here!!
Dear Friends,


Bit-pay has been DDOS'd for awhile now, and a lot of us merchants who depend on them are losing money.

I am personally offering a bounty of 50 BTC for someone to develop an opensource payment module for Opencart that will interact with Bitcoind.

There already is a payment module like this for zencart but it is very very primitive.

This Module should:

Allow to be installed like regular opencart plugin
interact with Bitcoind on local or remote server
be able to convert prices from USB to BTC correctly for invoice
should be able to generate new btc address for every transaction
should be completely integrated with Opencart


if any other merchants would like to contribute to this bounty please feel free.

thank you.

As I'm certain the code I've written (you can find it at https://github.com/btcgear/OpenCart_Bitcoin) fills and exceeds the requirements, please send the bounty to 12ctRXVVPAXQ6CQyEXkBhvi33K7kP4CMB5 .

There are a few other features that I'm continuing to work on, so stay tuned. Also, let me know if you have any issues and I will work diligently to fix them.

I am still accepting feature requests with and without bounty (obviously, the bounty ones will be higher priority). Let me know what features you would like to see.

1 block bounty Wink

I would purchase this module once completed.

You are certainly welcome to donate.

I just remembered I have to check this one out.

(Sorry Doug Tongue )
hero member
Activity: 896
Merit: 1000
Buy this account on March-2019. New Owner here!!
gangsta.

I will test this tomorrow and if it works I will pay the bounty promptly.

thanks

Tom
jga
member
Activity: 96
Merit: 10
http://btcgear.com
Dear Friends,


Bit-pay has been DDOS'd for awhile now, and a lot of us merchants who depend on them are losing money.

I am personally offering a bounty of 50 BTC for someone to develop an opensource payment module for Opencart that will interact with Bitcoind.

There already is a payment module like this for zencart but it is very very primitive.

This Module should:

Allow to be installed like regular opencart plugin
interact with Bitcoind on local or remote server
be able to convert prices from USB to BTC correctly for invoice
should be able to generate new btc address for every transaction
should be completely integrated with Opencart


if any other merchants would like to contribute to this bounty please feel free.

thank you.

As I'm certain the code I've written (you can find it at https://github.com/btcgear/OpenCart_Bitcoin) fills and exceeds the requirements, please send the bounty to 12ctRXVVPAXQ6CQyEXkBhvi33K7kP4CMB5 .

There are a few other features that I'm continuing to work on, so stay tuned. Also, let me know if you have any issues and I will work diligently to fix them.

I am still accepting feature requests with and without bounty (obviously, the bounty ones will be higher priority). Let me know what features you would like to see.

1 block bounty Wink

I would purchase this module once completed.

You are certainly welcome to donate.
BCB
vip
Activity: 1078
Merit: 1002
BCJ
Do you have a demo link?
For example, I think, GADJA | shop uses that WalletBit extension.

Thanks.

Very nice.

sr. member
Activity: 462
Merit: 250
Do you have a demo link?
For example, I think, GADJA | shop uses that WalletBit extension.
jga
member
Activity: 96
Merit: 10
http://btcgear.com
I would like to add a feature request and along with it 10 BTC bounty for this feature: Add an easy to implement hack into Opencart that adds Bitcoin as a currency and gives the user the choice to display prices in Bitcoin or any other currency.

Done. This is already in my latest version.  In the admin console upon install, you can choose whether or not to enable BTC as a user-visible currency.

Edit: I also have this available as a stand-alone module, but I haven't open sourced it yet.

Edit: now I have open sourced it and it is available at https://github.com/btcgear/Bitcoin_Exchange_Rate_OpenCart
This code is fully tested and has been in use at http://www.btcgear.com for months.

Please send bounty to 14dTC7bBphANAHzmK9aD7X7Wvo99rhHMTF
BCB
vip
Activity: 1078
Merit: 1002
BCJ
Kris

Do you have a demo link?
donator
Activity: 640
Merit: 500
Probably not what you want, but I just wanted to let you know it exist.

https://walletbit.com/connect/OpenCartPaymentModule.zip
full member
Activity: 178
Merit: 100
I would like to add a feature request and along with it 10 BTC bounty for this feature: Add an easy to implement hack into Opencart that adds Bitcoin as a currency and gives the user the choice to display prices in Bitcoin or any other currency.
BCB
vip
Activity: 1078
Merit: 1002
BCJ
cablepair

Is that working for you?
jga
member
Activity: 96
Merit: 10
http://btcgear.com
hero member
Activity: 490
Merit: 500
jga
member
Activity: 96
Merit: 10
http://btcgear.com
see it in action at http://test154.btcgear.com

EDIT: My bitcoind server is currently down so this isn't currently working properly. The code is good, though.

EDIT: This is now back up and running. Current code now gives an error message if it can't communicate.

EDIT: This is now running the most recent version and I created a $0.05 product so you can test it fully.  PM me with the address you sent the $0.05 worth of bitcoins to and I'll get them back to you... if you're cheap like that.
jga
member
Activity: 96
Merit: 10
http://btcgear.com
jga
member
Activity: 96
Merit: 10
http://btcgear.com
September 20, 2012, 08:12:13 PM
#9
EDIT: UPDATED

and boom goes the dynamite.

http://www.btcgear.com/OpenCart_Bitcoin_v1.1.1.zip

I will be putting this up in a GitHub repo shortly and adding some other features that I'd like to have, but this satisfies the initial requirements set forth by cablepair.

edit: file updated... a couple times.

EDIT: Version 1.1.0 checks for sent bitcoins before creating an order.
legendary
Activity: 1552
Merit: 1047
September 20, 2012, 07:47:48 PM
#8
Here is my current setting page, please let me know if there is anything important I have forgotten.


Closing in on this now, guess we'll have to see who finishes off first, I will complete it regardless.

As for the price, currently I have created a cron job, so I'm thinking it could run every 10 minutes to fetch price from mtgox. As you can see I have also added some minimum and maximum prices to protect shop owner from potential flash crashes in the market. The script automatically creates the BTC currency, and if you choose to disable mtgox price fetch you may adjust the price manually in the currency section of open cart, otherwise it will be updated through cron.

Any comments on this solution is welcome, I'm open for any suggestions.
jga
member
Activity: 96
Merit: 10
http://btcgear.com
September 20, 2012, 06:05:04 PM
#7
I'm pretty far along as well. I will be open sourcing my code once it's functional.
legendary
Activity: 1552
Merit: 1047
September 20, 2012, 09:17:43 AM
#6
I'm getting close to finish, coding this atm.
sr. member
Activity: 462
Merit: 250
September 20, 2012, 09:07:13 AM
#5
I work on an OpenCart payment module that uses bitcoind. You can take a look at work in progress here. After it will be finished, I can adapt it to suit your requirements.

There is a topic about it in Russian.
sr. member
Activity: 298
Merit: 252
September 20, 2012, 08:48:13 AM
#4
Did someone already do this for you? If not we already have a working module for WHMCS that is automatic bitcoind payment, it converts current market price from mtgox at that moment and creates a new address for each payment. Along with confirming payments after. If someone hasn't already made this we have it already done for another system, it wouldn't be too hard to move it over to opencart.
legendary
Activity: 1190
Merit: 1000
www.bitcointrading.com
September 19, 2012, 09:43:18 PM
#3
1 block bounty Wink

I would purchase this module once completed.
jga
member
Activity: 96
Merit: 10
http://btcgear.com
September 19, 2012, 07:59:47 PM
#2
I'm taking a look at this. I already have some of this functionality in existing code that I might be able to adapt.
hero member
Activity: 896
Merit: 1000
Buy this account on March-2019. New Owner here!!
September 19, 2012, 11:35:39 AM
#1

Bit-pay has been DDOS'd for awhile now, and a lot of us merchants who depend on them are losing money.

I am personally offering a bounty of 50 BTC for someone to develop an opensource payment module for Opencart that will interact with Bitcoind.

There already is a payment module like this for zencart but it is very very primitive.

This Module should:

Allow to be installed like regular opencart plugin
interact with Bitcoind on local or remote server
be able to convert prices from USB to BTC correctly for invoice
should be able to generate new btc address for every transaction
should be completely integrated with Opencart


if any other merchants would like to contribute to this bounty please feel free.

thank you.
Jump to: