Bitcoin Forum
May 04, 2024, 11:20:19 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 [3] 4 5 »  All
  Print  
Author Topic: Bounty PAID: BITCOIN OPEN CART PAYMENT MODULE!  (Read 20634 times)
jga
Member
**
Offline Offline

Activity: 96
Merit: 10


http://btcgear.com


View Profile WWW
December 24, 2012, 10:20:29 PM
 #41

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.

Bitcoin simplified. - a new, simpler Bitcoin guide.
Bitcoin Hats and the newest styles from GUNNAR Optiks on sale now at BTC Gear.
1714864819
Hero Member
*
Offline Offline

Posts: 1714864819

View Profile Personal Message (Offline)

Ignore
1714864819
Reply with quote  #2

1714864819
Report to moderator
1714864819
Hero Member
*
Offline Offline

Posts: 1714864819

View Profile Personal Message (Offline)

Ignore
1714864819
Reply with quote  #2

1714864819
Report to moderator
In order to achieve higher forum ranks, you need both activity points and merit points.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714864819
Hero Member
*
Offline Offline

Posts: 1714864819

View Profile Personal Message (Offline)

Ignore
1714864819
Reply with quote  #2

1714864819
Report to moderator
SlickTheNick
Full Member
***
Offline Offline

Activity: 220
Merit: 100


View Profile
December 26, 2012, 08:50:43 AM
 #42

Been using this.. thanks for the work! Now I just need to wait for some actual BTC customers

Looking for a way to get some bitcoins for free? Check out http://earnfreebitcoins.com !
Get easy bitcoins at  https://coincontroller.com?r=eaef398b5 !
LiteBit
Legendary
*
Offline Offline

Activity: 1133
Merit: 1050


View Profile
January 13, 2013, 03:05:59 PM
 #43

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
Yurock
Sr. Member
****
Offline Offline

Activity: 462
Merit: 250


View Profile
January 13, 2013, 09:22:01 PM
 #44

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.
LiteBit
Legendary
*
Offline Offline

Activity: 1133
Merit: 1050


View Profile
January 14, 2013, 01:28:32 PM
 #45

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.
jga
Member
**
Offline Offline

Activity: 96
Merit: 10


http://btcgear.com


View Profile WWW
January 15, 2013, 10:14:26 PM
 #46

LiteBit,

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

Bitcoin simplified. - a new, simpler Bitcoin guide.
Bitcoin Hats and the newest styles from GUNNAR Optiks on sale now at BTC Gear.
LiteBit
Legendary
*
Offline Offline

Activity: 1133
Merit: 1050


View Profile
January 17, 2013, 01:03:54 PM
 #47

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.
LiteBit
Legendary
*
Offline Offline

Activity: 1133
Merit: 1050


View Profile
January 20, 2013, 06:41:34 PM
 #48

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)?
bitgold
Sr. Member
****
Offline Offline

Activity: 353
Merit: 250


View Profile
January 21, 2013, 12:16:07 AM
 #49

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?




Yurock
Sr. Member
****
Offline Offline

Activity: 462
Merit: 250


View Profile
January 21, 2013, 08:45:07 AM
 #50

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.
Yurock
Sr. Member
****
Offline Offline

Activity: 462
Merit: 250


View Profile
January 22, 2013, 08:45:08 AM
 #51

a special Bitcoin RPC test script
Code:
<?php
error_reporting 
(E_ALL);
ini_set ('display_errors'true);
ini_set ('html_errors'true);
echo 
'<?xml version="1.0" encoding="UTF-8"?>
';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Bitcoin RPC Test</title>
</head>
<body>
<?php
function rpc ($url$userpwd) {
 
$curl curl_init ($url);
 if (! 
$curl) {
  echo 
'<p>curl_init failed</p>';
  return;
 }
 
$id = (string) rand ();
 if (! 
curl_setopt ($curlCURLOPT_RETURNTRANSFERtrue)) {
  echo 
'<p>curl_setopt (CURLOPT_RETURNTRANSFER) failed: 'htmlspecialchars (curl_error ($curl)), '</p>';
  return;
 }
 if (
strlen ($userpwd) > 1)
  if (! 
curl_setopt ($curlCURLOPT_USERPWD$userpwd)) {
   echo 
'<p>curl_setopt (CURLOPT_USERPWD) failed: 'htmlspecialchars (curl_error ($curl)), '</p>';
   return;
  }
 if (! 
curl_setopt ($curlCURLOPT_POSTFIELDSjson_encode (array ('method' => 'getinfo''params' => array (), 'id' => $id)))) {
  echo 
'<p>curl_setopt (CURLOPT_POSTFIELDS) failed: 'htmlspecialchars (curl_error ($curl)), '</p>';
  return;
 }
 
$r curl_exec ($curl);
 if (
curl_errno ($curl)) echo '<p>curl_exec failed: 'htmlspecialchars (curl_error ($curl)), '</p>';
 if (
is_string ($r)) {
  
$d json_decode ($rtrue);
  
$e json_last_error ();
  if (
$e) echo "<p>JSON error: $e</p>";
  if (
is_array ($d)) {
   if (
array_key_exists ('id'$d)) {
    if (
$d ['id'] != $id) echo '<p>ID mismatch:<br />request: '$id'<br />response: '$d ['id'], '</p>';
   } else echo 
'<p>Response lacks ID.</p>';
   if (
array_key_exists ('result'$d)) echo '<h3>Result</h3><pre>'htmlspecialchars (var_export ($d ['result'], true)), '</pre>';
   else echo 
'<p>Response lacks result.</p>';
   if (
array_key_exists ('error'$d) && $d ['error']) echo '<h3>Error</h3><pre>'htmlspecialchars (var_export ($d ['error'], true)), '</pre>';
  }
  echo 
'<h3>Raw Response</h3><pre>'htmlspecialchars ($r), '</pre>';
 }
  echo 
'<h3>CURL Info</h3><pre>'htmlspecialchars (var_export (curl_getinfo ($curl), true)), '</pre>';
}
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 '<p>Warning: username contains a semicolon.</p>';
 
rpc ($url"$user:$pass");
} else {
?>

<form method="post" target="result" action="<?php echo htmlspecialchars (basename ($_SERVER ['PHP_SELF'])); ?>"><table>
<tr><td align="right"><label for="proto">Protocol:</label></td><td align="left"><select name="proto" id="proto"><option value="http">HTTP</option><option value="https">HTTPS</option></select></td></tr>
<tr><td align="right"><label for="host">Hostname:</label></td><td align="left"><input name="host" id="host" /></td></tr>
<tr><td align="right"><label for="port">Port:</label></td><td align="left"><input name="port" id="port" value="8332" /></td></tr>
<tr><td align="right"><label for="user">Username:</label></td><td align="left"><input name="user" id="user" /></td></tr>
<tr><td align="right"><label for="pass">Password:</label></td><td align="left"><input name="pass" id="pass" type="password" /></td></tr>
<tr><td></td><td><input type="submit" value="Check" /></td></tr>
</table></form>
<h2>Result</h2>
<iframe name="result" style="width:100%;height:32em"></iframe>
<?php
}
?>

</body>
</html>
bitgold
Sr. Member
****
Offline Offline

Activity: 353
Merit: 250


View Profile
January 27, 2013, 02:02:41 PM
 #52

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?
Yurock
Sr. Member
****
Offline Offline

Activity: 462
Merit: 250


View Profile
January 27, 2013, 06:02:00 PM
 #53

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.
bitgold
Sr. Member
****
Offline Offline

Activity: 353
Merit: 250


View Profile
January 27, 2013, 06:53:53 PM
 #54

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

<!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 405 (Method Not Allowed)!!1</title>
  <style>
    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}
  </style>
  <a href=//www.google.com/><img src=//www.google.com/images/errors/logo_sm.gif alt=Google></a>
  <p><b>405.</b> <ins>That’s an error.</ins>
  <p>The request method <code>POST</code> is inappropriate for the URL <code>/</code>.  <ins>That’s all we know.</ins>

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.
Yurock
Sr. Member
****
Offline Offline

Activity: 462
Merit: 250


View Profile
January 28, 2013, 07:30:22 AM
 #55

Raw Response
It's a positive result.

Looks like this is another stupid SELinux issue
Believable. So, have you managed to communicate with bitcoind?
hashalfahalve
Member
**
Offline Offline

Activity: 100
Merit: 10

Support the bitcoin economy, use BTC merchants


View Profile
January 28, 2013, 10:17:17 PM
 #56

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?
bitgold
Sr. Member
****
Offline Offline

Activity: 353
Merit: 250


View Profile
January 29, 2013, 02:24:58 AM
 #57

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
Yurock
Sr. Member
****
Offline Offline

Activity: 462
Merit: 250


View Profile
January 29, 2013, 06:30:06 AM
 #58

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.
SynOps
Full Member
***
Offline Offline

Activity: 140
Merit: 100


BitFi Services


View Profile WWW
February 12, 2013, 01:38:16 PM
 #59

Still not working for after about 20 minuts

Yurock
Sr. Member
****
Offline Offline

Activity: 462
Merit: 250


View Profile
February 13, 2013, 01:31:17 AM
 #60

Still not working for after about 20 minuts
What exactly is not working?
Pages: « 1 2 [3] 4 5 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!