[email protected] Posted February 15, 2008 Posted February 15, 2008 (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 February 15, 2008 by [email protected] Quote
[email protected] Posted February 15, 2008 Author Posted February 15, 2008 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. Quote
[email protected] Posted February 26, 2008 Author Posted February 26, 2008 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. Quote
Recommended Posts
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.