cplus Posted May 15, 2008 Posted May 15, 2008 So it looks like the MyVirtualMerchant payment module also needs the proxy address to work on the Godaddy servers. It needs the same thing as the paypal payment module but I do not know where to add it. Can anyone help me out? That would be great. thanks! Josh
BryceJr Posted May 16, 2008 Posted May 16, 2008 This might help. http://www.oscommerce.com/forums/index.php?&showtopic=298596
cplus Posted May 16, 2008 Author Posted May 16, 2008 Yeah I tried that but I get this error when I go to submit a payment: Warning: curl_setopt(): supplied argument is not a valid cURL handle resource in /home/content/c/o/i/coinsplus/html/coinsplus/catalog/includes/modules/payment/virtualmerchant_cc.php on line 504 And line 504 is the line I added into the file. josh
bpopelar Posted May 16, 2008 Posted May 16, 2008 Post the cURL logic from your code here so we can look at it. Ben
cplus Posted May 16, 2008 Author Posted May 16, 2008 Wasn't sure how much of it you needed but here you go: function sendTransactionToGateway($url, $parameters) { $server = parse_url($url); if (isset($server['port']) === false) { $server['port'] = ($server['scheme'] == 'https') ? 443 : 80; } if (isset($server['path']) === false) { $server['path'] = '/'; } if (isset($server['user']) && isset($server['pass'])) { $header[] = 'Authorization: Basic ' . base64_encode($server['user'] . ':' . $server['pass']); } $connection_method = 0; // GoDaddy hosted website proxy patch curl_setopt($ch, CURLOPT_PROXY, "http://proxy.shr.secureserver.net:3128"); // End of GoDaddy proxy patch if (function_exists('curl_init')) { $curl = curl_init($server['scheme'] . '://' . $server['host'] . $server['path'] . (isset($server['query']) ? '?' . $server['query'] : '')); curl_setopt($curl, CURLOPT_PORT, $server['port']); curl_setopt($curl, CURLOPT_HEADER, 0); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_FORBID_REUSE, 1); curl_setopt($curl, CURLOPT_FRESH_CONNECT, 1); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $parameters); $result = curl_exec($curl); //echo $result; //die(); curl_close($curl); } else { exec(escapeshellarg(MODULE_PAYMENT_VIRTUALMERCHANT_CC_CURL) . ' -d ' . escapeshellarg($parameters) . ' "' . $server['scheme'] . '://' . $server['host'] . $server['path'] . (isset($server['query']) ? '?' . $server['query'] : '') . '" -P ' . $server['port'] . ' -k', $result); $result = implode("\n", $result); } return $result; } } ?> Josh
bpopelar Posted May 16, 2008 Posted May 16, 2008 Wasn't sure how much of it you needed but here you go: function sendTransactionToGateway($url, $parameters) { $server = parse_url($url); if (isset($server['port']) === false) { $server['port'] = ($server['scheme'] == 'https') ? 443 : 80; } if (isset($server['path']) === false) { $server['path'] = '/'; } if (isset($server['user']) && isset($server['pass'])) { $header[] = 'Authorization: Basic ' . base64_encode($server['user'] . ':' . $server['pass']); } $connection_method = 0; // GoDaddy hosted website proxy patch curl_setopt($ch, CURLOPT_PROXY, "http://proxy.shr.secureserver.net:3128"); // End of GoDaddy proxy patch if (function_exists('curl_init')) { $curl = curl_init($server['scheme'] . '://' . $server['host'] . $server['path'] . (isset($server['query']) ? '?' . $server['query'] : '')); curl_setopt($curl, CURLOPT_PORT, $server['port']); curl_setopt($curl, CURLOPT_HEADER, 0); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_FORBID_REUSE, 1); curl_setopt($curl, CURLOPT_FRESH_CONNECT, 1); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $parameters); $result = curl_exec($curl); //echo $result; //die(); curl_close($curl); } else { exec(escapeshellarg(MODULE_PAYMENT_VIRTUALMERCHANT_CC_CURL) . ' -d ' . escapeshellarg($parameters) . ' "' . $server['scheme'] . '://' . $server['host'] . $server['path'] . (isset($server['query']) ? '?' . $server['query'] : '') . '" -P ' . $server['port'] . ' -k', $result); $result = implode("\n", $result); } return $result; } } ?> Josh Change: // GoDaddy hosted website proxy patch curl_setopt($ch, CURLOPT_PROXY, "http://proxy.shr.secureserver.net:3128"); // End of GoDaddy proxy patch if (function_exists('curl_init')) { $curl = curl_init($server['scheme'] . '://' . $server['host'] . $server['path'] . (isset($server['query']) ? '?' . $server['query'] : '')); curl_setopt($curl, CURLOPT_PORT, $server['port']); curl_setopt($curl, CURLOPT_HEADER, 0); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_FORBID_REUSE, 1); curl_setopt($curl, CURLOPT_FRESH_CONNECT, 1); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $parameters); $result = curl_exec($curl); to: if (function_exists('curl_init')) { $curl = curl_init($server['scheme'] . '://' . $server['host'] . $server['path'] . (isset($server['query']) ? '?' . $server['query'] : '')); curl_setopt($curl, CURLOPT_PORT, $server['port']); curl_setopt($curl, CURLOPT_HEADER, 0); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_FORBID_REUSE, 1); curl_setopt($curl, CURLOPT_FRESH_CONNECT, 1); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $parameters); // GoDaddy hosted website proxy patch curl_setopt($curl, CURLOPT_PROXY, "http://proxy.shr.secureserver.net:3128"); // End of GoDaddy proxy patch $result = curl_exec($curl); Ben
Recommended Posts
Archived
This topic is now archived and is closed to further replies.