Post by glolar » Sun Sep 09, 2018 12:50 pm

Hello,

Using OpenCart 2.3.0.2, with PayPal Payments Standard enabled.

Everything has been running smoothly for over a year. Just recently, I switched web hosting providers. Everything was migrated, and appeared to be working. However, now, when a customer makes an order, the Order Status in OpenCart is ALWAYS "Canceled", and neither the customer, nor my store email address receives an Order email. This used to all be working fine. Not sure this has ANYTHING to do with migrating my site to a new host, but it sure is coincidental!

I found a post about the same subject here: viewtopic.php?f=185&t=184599 but there was no resolution.

I verified all my settings in the PayPal Payments Standard extension, both on the General Tab and Order Status Tab. Here are those settings:

General Tab:

E-Mail: the store's email address, which was set and has never been changed.
Sandbox Mode: None
Debug Mode: Enabled
Transaction Method: Sale (Would this ever be set to Authorization?)
Total: 0.01
Geo Zone: All Zones
Status: Enabled
Sort Order: 0

Order Status Tab:

All settings in the Order Status Tab match the status type, i.e., Completed Status = Completed, Canceled Reversal Status = Canceled Reversal, etc.

Is there some setting in my PayPal account itself that must be changed when I move my site to a new host? The URL for the site is the same. The site is just being hosted on a different server with a different company now.

NOTE: I created a REAL order myself, and it was created with an Order Status of Canceled. Then, I manually updated the Order Status to "Complete". Then I logged into the store's PayPal account and REFUNDED the payment. The Order Status in OpenCart SHOULD HAVE BEEN updated to "Refunded", and the ordered item SHOULD HAVE been added back into the store's inventory. Neither of those things happened. (I even tested this scenario a couple of weeks ago because I wanted to see if the inventory quantities were automatically updated after a refund, and it worked as expected when I tested it).

This is a critical issue that I need resolved ASAP, so ANY help from anyone would be greatly appreciated!

Thank you.

UPDATE: I found a post about PayPal IPN issues if you have your OpenCart store anywhere but the root of the site (which I do ... my site is in a \store subdirectory). In this case, you must append some code to the site's .htaccess file. I checked to make sure that when the new web hosting company migrated my site, they included the needed lines in the .htaccess file. For reference, here they are:

# SEO URL Settings
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/
RewriteCond %{HTTP_HOST} ^skyreadyrc\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.skyreadyrc\.com$
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^/?$ "https\:\/\/www\.skyreadyrc\.com\/store" [R=302,L]

So, I logged into my site's PayPal account and took a look at my IPN history. The last five orders have a Status of "Retrying" ... the status should be "Sent". A screen capture of my IPN history is attached illustrating what I am talking about (right click the attached image and select "View").

So, this explains why all recent orders in OpenCart have an Order Status of Cancelled, but WHAT is causing this IPN issue? Why does the status of all recent orders = Retrying? Does this have ANYTHING to do with me recently moving my site to a new web hosting company?

REALLY need to resolve this quickly. Thanks in advance for any help!

Attachments

ipn_history.jpg

ipn_history.jpg (168.79 KiB) Viewed 4806 times


User avatar
Active Member

Posts

Joined
Thu Jul 29, 2010 12:35 pm
Location - San Diego, CA

Post by MrPhil » Sun Sep 09, 2018 11:39 pm

Just a thought: you're coming in to PayPal (or returning to you) on a different IP address now, and perhaps they think it's fraudulent? You might check with PP about whether you need to tell them that your host has changed. They might even have some sort of update mechanism you can do from your account.

By the way, the .htaccess rewrite code isn't very clean, and might even be breaking certain URLs.

Code: Select all

RewriteCond %{HTTP_HOST} ^skyreadyrc\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.skyreadyrc\.com$
could be condensed to

Code: Select all

RewriteCond  %{HTTP_HOST} ^(www\.)?skyreadyrc\.com
and is needed only if you have subdomains or add-on domains. If skyreadyrc.com is your only domain, those lines are useless.

Code: Select all

RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
These lines are to avoid rewriting the URL if someone is looking for SSL validation files.

Code: Select all

RewriteRule ^/?$ "https\:\/\/www\.skyreadyrc\.com\/store" [R=302,L]
1. You shouldn't make the rewritten address a string. Just do this:

Code: Select all

RewriteRule  ^/?$  https://www.skyreadyrc.com/store  [R=302,L]
2. This will match only if the incoming URL is empty (just the domain) or just has a /. Is that what you intended, or should any incoming URL that doesn't include /store be rewritten? Actually, you shouldn't even see just a /, as a leading / should be stripped off the URI by this point.

Code: Select all

RewriteCond  %{REQUEST_URI}  !^/store  [NC]
RewriteRule  ^(.*)$  https://www.skyreadyrc.com/store/$1  [R=302,L]
3. R=302 tells search engines that this is a temporary move, and not to catalog it. Is this what you intended? If it's a permanent change, use R=301.

User avatar
Active Member

Posts

Joined
Wed May 10, 2017 11:52 pm

Post by glolar » Sun Sep 09, 2018 11:49 pm

MrPhil,

Thank you for your feedback. As for all that .htaccess stuff, I lifted that right out of an OpenCart forum post years ago when I was having this exact same problem with Canceled PayPal orders. It fixed the problem at the time, so naturally the first thing I checked after migrating my site to the new host was that these .htaccess entries got migrated over to the new server. They did. This stuff is over my head, but I will take a look at your suggestions as soon as I resolve this current issue.

I am on hold with PayPal even as I type this. Been on hold for almost 30 minutes (sigh!) If I ever get thru to their support people, I will mention the fact that I am now on a different IP address.

If you (or anyone on the forum) can think of anything else that might help, I would be forever grateful. My business is dead in the water until I can resolve this issue.

Thank you.

User avatar
Active Member

Posts

Joined
Thu Jul 29, 2010 12:35 pm
Location - San Diego, CA

Post by glolar » Mon Sep 10, 2018 12:37 am

MrPhil,

Still on hold with PayPal (over an hour). I logged into my business PayPal account, and verified the callback URL (it hasn't changed), and made sure that IPN communication is still enabled (it is).

But I don't see anywhere in my PayPal account profile (My Selling Tools > Instant payment notifications) where an IP address is specified. The only configurable items are Notification URL (which hasn't changed), and Message delivery (which is still set to Enabled). I don't see anywhere else in the Profile that might be related to IPN.

I contacted support for my new Web Hosting account, and the said their is nothing on their server that would block IPN communications.

Anything else you can think of?

Thank you,

Larry

User avatar
Active Member

Posts

Joined
Thu Jul 29, 2010 12:35 pm
Location - San Diego, CA

Post by MrPhil » Tue Sep 11, 2018 4:32 am

You just recently changed hosting, so presumably you had to point your domain to new domain name servers. Have you allowed enough time for the changes to propagate throughout the world, including PayPal's local DNS server? Usually it's done within 72 hours. Any other changes, such as formerly http: and now https:, or the directory structure? Regarding unexpected IP address changes, they may handle that internally as a security measure, to see if someone might be spoofing you in order to hijack customer transactions. If you haven't already done so, you might ask PP if there is anything you need to do if you change hosting providers on an established account. Other than that, nothing comes to mind at this time.

User avatar
Active Member

Posts

Joined
Wed May 10, 2017 11:52 pm

Post by glolar » Tue Sep 11, 2018 12:42 pm

MrPhil,

Thanks for the reply. The first handful of PayPal transactions AFTER I changed my hosting account went thru fine. I filled out a ticket with PayPal, compared my site's IPN server logs to my PayPal IPN history, and sent that info to PayPal in the ticket. They replied saying it is a "known issue" and that they are working to fix it. So, it APPEARS it has nothing to do with me switching webhosts. What's the chances of something working fine for a year, and then shortly after I switch my hosting company, it breaks? I don't believe in coincidence, but PayPal swears that it is their issue.

Yeah, I first figured it was an issue with the DSN propogation not being complete, but it's been almost a week since the problem started. Hoping PayPal is quick to fix this issue.

Thanks again for all the help!

User avatar
Active Member

Posts

Joined
Thu Jul 29, 2010 12:35 pm
Location - San Diego, CA

Post by uksimon » Sun Nov 18, 2018 6:32 pm

I had the EXACT same issue however the fix for me was so much more simple than everyone makes it out to be.

I had a php.ini file within the installation file that was overriding my hosting php.ini file. Within this file it had all the extensions that were needed disabled. My hosting company deleted it allowing the hosting file to become default and it worked straight away without fault.

Check in opencart root folder for any php.ini files and either update them manually or delete them and let the hosting file become default and that should fix the issue!

Newbie

Posts

Joined
Fri Nov 16, 2018 8:19 am

Post by MrPhil » Sun Dec 30, 2018 1:01 am

Don't go deleting php.ini files willy-nilly. They are PHP settings that someone took the trouble to set in order to get some desired change in the system. It's true that any local php.ini or .user.ini may override (depending on system settings) server-level settings, but still, you should understand what each entry is doing and what it's there for, before commenting out or deleting any entries. Commenting-out entries one-by-one is a good way to debug. It's also entirely possible that your settings date back to several system PHP updates ago, so you should periodically review them. Same for .htaccess entries.

User avatar
Active Member

Posts

Joined
Wed May 10, 2017 11:52 pm
Who is online

Users browsing this forum: No registered users and 20 guests