Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

'PayPal Website Payments Pro (US) Direct Payments' - no response from paypal gateway on confirm order


Recommended Posts

Posted (edited)

I installed oscommerce-2.2rc2a and turned all of the payment modules off except 'PayPal Website Payments Pro (US) Direct Payments'. I created a sandbox paypal pro account and configured the 'PayPal Website Payments Pro (US) Direct Payments' module to point to it. When I click on the confirm button at the end of the checkout process it redirects me to the shopping cart (with no errors) instead of the finished page and the order is not placed. The follow is what is in the address bar after hitting the confirm button:

 

"https://www.mystore.com/catalog22_1/shopping_cart.php?error_message="

 

The error message is blank in the url. I debugged the code a bit and found in ./catalog/includes/modules/payment/paypal_direct.php that the variable $result in the function call '$result = curl_exec($curl);' on line 258 (which sends the transaction to Paypal's gateway) truly is blank after the call. This call is in 'sendTransactionToGateway($url, $parameters)'. I took the values of that functions parameters ($url and $parameters) and manually placed them in the address bar and hit enter and the payment went to my sandbox account with no problems.

 

I thought it might be a curl problem so I wrote a small curl php script but it worked fine.

 

Also, when I try to use the 'PayPal Express Checkout' module and click on the express checkout payment button in the checkout process, I get the same redirection problem.

 

Here is some more info on my configuration:

- Web host: Hostmonster

- I purchased and installed an SSL cert on my site

- Server OS: Linux 2.6.22-9_1.BHsmp

- Database: MySQL 5.0.45-community-log

- HTTP Server: Apache/2.2.6 (Unix) mod_ssl/2.2.6 OpenSSL/0.9.8g DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635

- PHP Version: 4.4.7 (Zend: 1.3.0)

 

Any help is much appreciated.

Edited by [email protected]
Posted

Some more info:

 

I just did the same install and config on x10hosting.com (a free webhost) and it "worked". Instead of no error I get:

 

"Exception in webservicesproxy: Failed to receive response from service NVPAcquiringServ operation DoDirectPayment version 1.0 endpoint 10.6.192.92:30939: (null), correlation id=d6a6841f3f7c".

 

I'm sure this is some proxy setting I have to set up on x10hosting.com but I'm not interesting in getting it to work on x10hosting.com - I need it running on my web host. So it looks like some setting/config with Hostmonster, but I still need direction on which setting.

 

Thanks.

  • 2 weeks later...
Posted

For those who are interested - I found the following work around to my problem:

 

I changed the following on line 350 of paypal_direct.php

 

from

 if (function_exists('curl_init')) {

to

if (!function_exists('curl_init')) {

 

Here is the section of code:

 

	  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);

	curl_close($curl);
  } else {
	exec(escapeshellarg(MODULE_PAYMENT_PAYPAL_DIRECT_CURL) . ' -d ' . escapeshellarg($parameters) . ' "' . $server['scheme'] . '://' . $server['host'] . $server['path'] . (isset($server['query']) ? '?' . $server['query'] : '') . '" -P ' . $server['port'] . ' -k', $result);
	$result = implode("\n", $result);
  }

 

This forced it to go into the else statement which doesn't seem to use curl and it worked. So from this workaround, it looks to be a curl issue on my webhost. I also had to make the same change to the paypal express checkout module.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...