This post will discuss how to debug IPN issues that may come up between Paid Memberships Pro and PayPal.
IPN stands for “Instant Payment Notification” and it is used by PayPal Express, PayPal Standard, and PayPal Website Payments Pro to send information about PayPal orders and subscriptions to your website. (Payflow Pro does NOT use IPN. If you are using Payflow, make sure you are also using the Payflow Pro recurring orders addon.)
If PayPal is not able to send IPN messages to your site or those messages are not being processed well, you could run into one or more of the following issues:
- Recurring subscription orders NOT showing up in the PMPro orders list.
- Emails about failed payments NOT being sent to your members.
- Cancellations at PayPal NOT canceling memberships in WordPress/PMPro.
- PayPal Standard checkouts NOT updating a user’s membership after payment clears in PayPal.
First Make Sure That IPN Is Turned On
The IPN service is on by default, but it might have been turned off for some reason. Our article here has instructions for logging into PayPal to make sure that the IPN service is “turned on”.
These two steps are useful when troubleshooting IPN issues and can be used when working on any of the solutions below.
1. By adding the line below to your wp-config.php, you will tell PMPro to email the WP admin user whenever the IPN URL is loaded.
If you have this set and DO NOT receive any emails about the IPN handler, (you might have email issues on your site or…) your IPN URL is probably not being loaded by PayPal. You can test this by navigating to the IPN URL directly. Point your browser to /wp-admin/admin-ajax.php?action=ipnhandler on your site. You should see something like the following, which will also be sent to the admin email address:
Logged On: 06/28/2015 20:41:43 Array ( ) FP! VERIFIED ERROR: receiver_email (N/A) and business email (N/A) did not match (firstname.lastname@example.org) -------------
Important: Don’t be alarmed by the error here. This is normal since you are not PayPal.
You can also change the IPN log email to go to other emails addresses by specifying them in the constant. e.g.
2. PayPal saves a history of IPN messages and information about if the message went through or if there were any errors in the “PayPal IPN History”.
You can find instructions for locating the IPN History here.
These are some common issues that we’ve seen people run into and how to go about fixing it.
1. Your IPN URL is being cached by your WordPress install or your host.
If you visit your IPN URL twice in a row, you should see a different timestamp at the beginning. If not, your IPN URL may be cached, which would keep some messages from getting to your site from PayPal.
To fix this, make sure to exclude your IPN URL from any caching plugins running on your site or caching systems installed on your host.
2. Your host is blocking PayPal from accessing the URL.
If you get a normal response when accessing your IPN URL (a timestamp and error message) but see error codes in your PayPal IPN History, it’s possible that your host is blocking PayPal from accessing the IPN URL.
Usually an email like the following will clear this up with your host:
Dear host, I believe that PayPal may be blocked from accessing the IPN URL on my site. The URL is _____. Can you please make sure that posted messages from PayPal will reach this URL?
3. You have imported subscriptions from an old non-PMPro membership plugin or switched domains while using Paid Memberships Pro.
Imported subscriptions will still be hitting the old IPN URL from when the subscription was setup. If you switched domains while using Paid Memberships Pro, you may still need to foward messages to the old domain to your new domain.
Here are a couple scripts to forward IPN requests from other membership systems to the PMPro IPN URL format. These scripts may need to be installed on the same site as your PMPro site or on an older site if you switched domains.
s2member (related blog post here)
Similar scripts can be created for other services or domain switches. Just post to our member forums and we’ll help you out.
4. Your business email address is different in your PayPal and PMPro settings.
There are various reasons this could be. You’ll notice an error like “receiver_email (N/A) and business email (N/A) did not match (email)” in your IPN log emails. Sometimes you can simply update the Gateway Account Email setting in the PMPro payment settings. Sometimes you’ll need to use code like this to allow the PMPro IPN handler to process requests from different email addresses.
Note the receiver_email or business_email values from your IPN logs and use them to tweak this script. Add it to your active theme’s functions.php or a custom plugin:
5. Something else.
If you are having IPN issues with PMPro and this document doesn’t help you to figure things out, please submit a ticket in our support area (paid membership required). We’ll also update this post over time as new information comes out.