I have been reading about this problem for over a year now. I have tried every single solution on this forum and am still having the problem where OpenCart (1.5.4) is not receiving or not understanding the IPN being sent by Paypal Standard. After re-reading and retrying everything, I think the problem might be my site layout but I'm not sure what to do about it.
My root folder has 2 folders in it - /wp/ for my wordpress website and /shop/ for my shopping cart. The root .htaccess file redirects the user from mysite.com to the /wp/ folder automatically. The /shop/ folder is pointed to by shop.mysite.com. How can I determine what return URL opencart is sending to paypal when it transfers over there for payment? Is it possible it is sending the root url instead of the url of the shopping cart and that is why the sale is never "completed". Paypal returns control to the correct page in my site - which is http://shop.mysite.com/index.php?route= ... cess...but the order in the database is "Missing/Canceled" and there is no indication that they have paid. (other than the email verification of payment).
My root folder has 2 folders in it - /wp/ for my wordpress website and /shop/ for my shopping cart. The root .htaccess file redirects the user from mysite.com to the /wp/ folder automatically. The /shop/ folder is pointed to by shop.mysite.com. How can I determine what return URL opencart is sending to paypal when it transfers over there for payment? Is it possible it is sending the root url instead of the url of the shopping cart and that is why the sale is never "completed". Paypal returns control to the correct page in my site - which is http://shop.mysite.com/index.php?route= ... cess...but the order in the database is "Missing/Canceled" and there is no indication that they have paid. (other than the email verification of payment).
have a look at paypal IPN history, it shows you where it is sending to.
The IPN history looks good - and it looks like it is sending to where it should go - this is why PayPal says the problem is not theirs - they say it must be the shopping cart.
Message ID6VK16577EX708033X
Date/time created12/2/2013 17:22 PST
Original/Resent Original
Latest delivery attempt date/time12/2/2013 17:22 PST
Notification URLhttp://shop.mysite.com/index.php?route=payment/pp_standard/callback
HTTP response code 200
Delivery statusSent
No. of retries0
Transaction ID8KH01824RN1xxxxxx
IPN typeTransaction made
Message ID6VK16577EX708033X
Date/time created12/2/2013 17:22 PST
Original/Resent Original
Latest delivery attempt date/time12/2/2013 17:22 PST
Notification URLhttp://shop.mysite.com/index.php?route=payment/pp_standard/callback
HTTP response code 200
Delivery statusSent
No. of retries0
Transaction ID8KH01824RN1xxxxxx
IPN typeTransaction made
looks good to me too. Is there anything that's stopping the callback? Perhaps your htaccess is pointing it away or something else?
That is exactly what I am asking/trying to find out...and have been trying to find out for over a year now. Everything else works 100%, the IPN is being sent, paypal transfers control back to the correct OpenCart page which says "Payment was successful, etc. The ONLY problem is the order is being coded as "Missing" instead of "Complete". The .htaccess file in the /shop/ directory, where shop.mysite.com points is as follows: (standard stuff - I haven't added anything)
RewriteEngine On
# Prevent Direct Access to files
<FilesMatch "\.(tpl|ini|log)">
Order deny,allow
Deny from all
</FilesMatch>
RewriteBase /shop/
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
RewriteEngine On
# Prevent Direct Access to files
<FilesMatch "\.(tpl|ini|log)">
Order deny,allow
Deny from all
</FilesMatch>
RewriteBase /shop/
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
It should be
RewriteBase /
instead of
RewriteBase /shop/
as you're running on shop.website.com and not website.com/shop
RewriteBase /
instead of
RewriteBase /shop/
as you're running on shop.website.com and not website.com/shop
I tried changing the .htaccess file within my /shop/ folder to a RewriteBase / instead of /shop/ but it made absolutely no difference. Then I tried removing .htaccess file altogether and that made no difference either.
Paypal's IPN is getting back to OpenCart. OpenCart is displaying it's success page at http://shop.mysite.com/index.php?route= ... d/callback with no problem, (regardless of the existence of an .htaccess file) but the orders table is not being updated to show that the order is complete. The paid order looks exactly the same in the database as an order that was not paid.
Anybody have any other ideas as to why this is happening? It has to be the opencart code, right? How can this possibly be working correctly for others?
Paypal's IPN is getting back to OpenCart. OpenCart is displaying it's success page at http://shop.mysite.com/index.php?route= ... d/callback with no problem, (regardless of the existence of an .htaccess file) but the orders table is not being updated to show that the order is complete. The paid order looks exactly the same in the database as an order that was not paid.
Anybody have any other ideas as to why this is happening? It has to be the opencart code, right? How can this possibly be working correctly for others?
pp_standard/callback should lead to a blank white page, no success page there.
Sorry, the actual URL of the page the customer returns to is:
http://shop.mysite.com/index.php?route= ... em_number=... which shows the message saying the customer has successfully paid.
http://shop.mysite.com/index.php?route= ... em_number=... which shows the message saying the customer has successfully paid.
Does your PayPal IPN history shows you a link that has 200 success, and when you load it manually, it shows a blank white page?
http://shop.mysite.com/index.php?route= ... d/callback
should be the correct IPN callback url
http://shop.mysite.com/index.php?route= ... d/callback
should be the correct IPN callback url
Yes, if I manually load this page http://shop.mysite.com/index.php?route= ... d/callback - indeed it gives me a blank white page. My complete IPN history is show above (4 or 5 posts up) and yes, it has a return code of 200.
next questions, curl working? ports open for it to communicate with paypal? firewall?
My ISP responded that yes, curl is working and all regular ports are open. They said there is no firewall. Do you know of a way that I can easily test the veracity of their replies?
UPDATE: I went through the pp_standard code line by line and inserted debugging emails. The problem occurs at line 94 and/or line 108 in the version I have installed (1.5.4). The encryption class obliterates the $order_id with garbage. This completely breaks the callback function. I am guessing that BLUEHOST does not have the mcrypt extension installed, so even though they have a special "simple script" to allow OpenCart installation, they don't really care whether it works or not. I tried their chat support and was told they don't offer support for that sort of thing! I have submitted a ticket to see if they will install this extension. In the meantime, my cart is broken - would it be possible to replace encryption.php with some simpler code that codes not rely on mcrypt (temporarily)?
Lindapoppleton,
Do a phpinfo dump and see if they have it installed. I bet they do.
I am with bluehost and it shows on my phpinfo dump:
Mike
Do a phpinfo dump and see if they have it installed. I bet they do.
I am with bluehost and it shows on my phpinfo dump:
Code: Select all
mcrypt support enabled
mcrypt_filter support enabled
Version 2.5.8
Api No 20021217
Supported ciphers cast-128 gost rijndael-128 twofish arcfour cast-256 loki97 rijndael-192 saferplus wake blowfish-compat des rijndael-256 serpent xtea blowfish enigma rc2 tripledes
Supported modes cbc cfb ctr ecb ncfb nofb ofb stream
cue4cheap not cheap quality
You are correct. The phpinfo dump shows mcrypt is there. Shoot...thought I had the problem identified at last! The problem still exists. The debug statements in pp_standard show that the loop that begins with "if ($order_info) {" below is never executed...even though everything up to this point is normal. Display of $order_id appears to be garbage.
public function callback() {
if (isset($this->request->post['custom'])) {
$order_id = $this->encryption->decrypt($this->request->post['custom']);
} else {
$order_id = 0;
}
$this->load->model('checkout/order');
$order_info = $this->model_checkout_order->getOrder($order_id);
if ($order_info) {
$request = 'cmd=_notify-validate';
foreach ($this->request->post as $key => $value) {
$request .= '&' . $key . '=' . urlencode(html_entity_decode($value, ENT_QUOTES, 'UTF-8'));
}
if (!$this->config->get('pp_standard_test')) {
$curl = curl_init('https://www.paypal.com/cgi-bin/webscr');
} else {
$curl = curl_init('https://www.sandbox.paypal.com/cgi-bin/webscr');
}
...
}
public function callback() {
if (isset($this->request->post['custom'])) {
$order_id = $this->encryption->decrypt($this->request->post['custom']);
} else {
$order_id = 0;
}
$this->load->model('checkout/order');
$order_info = $this->model_checkout_order->getOrder($order_id);
if ($order_info) {
$request = 'cmd=_notify-validate';
foreach ($this->request->post as $key => $value) {
$request .= '&' . $key . '=' . urlencode(html_entity_decode($value, ENT_QUOTES, 'UTF-8'));
}
if (!$this->config->get('pp_standard_test')) {
$curl = curl_init('https://www.paypal.com/cgi-bin/webscr');
} else {
$curl = curl_init('https://www.sandbox.paypal.com/cgi-bin/webscr');
}
...
}
In the callback function, After: $order_id = $this->encryption->decrypt($this->request->post['custom']);
ORDER_ID: üÿ‚Hõq?VŸºmþ‰±#Àx,„ÖM(&i@mUÎDC
After: $order_info = $this->model_checkout_order->getOrder($order_id);
ORDER_INFO: (blank or null)
so the rest of the callback function is never executed.
ORDER_ID: üÿ‚Hõq?VŸºmþ‰±#Àx,„ÖM(&i@mUÎDC
After: $order_info = $this->model_checkout_order->getOrder($order_id);
ORDER_INFO: (blank or null)
so the rest of the callback function is never executed.
just remove the encryption in your paypal standard controller. That's not needed
THanks. What exactly do you mean by "just remove the encryption in your paypal standard controller"? I'm not entirely sure how to do that without breaking something. I did try changing the codes below, but it did not fix the problem:
/catalog/controller/payment/pp_standard
in index, $this->data['custom'] = $this->encryption->encrypt($this->session->data['order_id']);
changed to $this->data['custom'] = $this->session->data['order_id'];
and in callback, $order_id = $this->encryption->decrypt($this->request->post['custom']);
changed to $order_id = $this->request->post['custom'];
/catalog/controller/payment/pp_standard
in index, $this->data['custom'] = $this->encryption->encrypt($this->session->data['order_id']);
changed to $this->data['custom'] = $this->session->data['order_id'];
and in callback, $order_id = $this->encryption->decrypt($this->request->post['custom']);
changed to $order_id = $this->request->post['custom'];
that change should totally fix the issue. Create a new order and give a test. Before confirming the order, use firebug to take a peek at the custom value being sent over
Who is online
Users browsing this forum: No registered users and 7 guests