Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

MyVirtualMerchant and GoDaddy.


cplus

Recommended Posts

Posted

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

Posted

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

Posted

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

Posted
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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...