Pages:
Author

Topic: Bounty PAID: BITCOIN OPEN CART PAYMENT MODULE! - page 3. (Read 20655 times)

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
Pages:
Jump to: