If you feel you have completed all the integration steps correctly and have also activated the PayPal IPN Handling plugin in your Post Affiliate Pro (Network), but still cannot see any commission in your PAP, then this article should help you.
Required Knowledge
Let's first explain how the PayPal integration generally works. The primary purpose of the PayPal integration is to retrieve the value of the PAPVisitorId cookie—which is assigned to the customer after they click an affiliate link—and pass it to Post Affiliate Pro along with information from PayPal's IPN notification. There are 3 different ways this can be accomplished, depending on your PayPal button configuration:
- Simple PayPal button integration consists of adding two input fields (custom and notify_url) to your PayPal button and a JavaScript code for writing the cookie into the "custom" input field. This writes the cookie directly into PayPal's IPN notification and instructs PayPal to send the IPN notification to PAP's PayPal IPN Handling plugin, which reads the notification and creates a commission based on it.
- Integration of PayPal button with notify_url input field already used by another system consists of adding just the custom input field and the script for writing the cookie. Another part of the integration involves resending the received notification to PAP from the script to which PayPal's IPN notification is sent.
- Integration of PayPal button with both notify_url and custom input fields already used by other systems consists of adding an id attribute to your notify_url input field and a special script that appends the cookie to the notify_url as a GET parameter. Another part of the integration involves receiving the GET parameter and resending the notification to PAP along with the cookie information from the script to which PayPal's IPN notification is sent.
We should take into account that if your installation is running with a cron job, it may take 2–3 cron job runs before a click or commission is saved.
For accounts hosted with us, it takes 5–15 minutes for the commission to appear after an order is placed. The same time frame applies for the Event logs or Sale requests log to display the request.
You can speed up this process by forcing the requests to process.
Debugging
Click an affiliate link and ensure a click was tracked in the Transactions > Clicks list. Remember the cron job may delay this. If your click isn't tracked, follow the click debugging article. Without this, tracking will not work.
When you reach the PayPal button page, use your browser's developer tools to inspect your button and check whether the cookie ID (a 32-character-long string) was added to the "custom" or "notify_url" input field:
You should see something similar to the example above, or the same string added to the "notify_url" field if you are using the third PayPal integration method.
Copy the string, but exclude the account ID (for example, "default1" in this example), so omit the first 8 characters. Next, look for it in your merchant panel under Tools > Visitor affiliates. If you find a record marked as Actual, you can be sure that the visitor was referred by an affiliate and will create a commission if other settings match and the IPN notification reaches PAP.
If you do not see this value filled in, or the cookie ID cannot be found in Tools > Visitor affiliates, then one of the following issues may be the cause:
- The URL to the notifysale.php/salejs.php script (depending on the integration) is incorrect.
- The PayPal button is on an HTTPS-secured website while the script URL is added as HTTP only.
- If the script URL is HTTPS, then Post Affiliate Pro might not be accessible via HTTPS (you do not have an SSL certificate on your domain).
- The "custom" or "notify_url" input fields do not contain the necessary ID attribute by which the script tries to locate the input field—such as pap_dx8vc2s5 or pap_ab78y5t4a (depending on the integration method).
- There is no click tracking code on the website, or no affiliate link was clicked, so the cookie ID written into the field is for an unreferred visitor only. IDs of unreferred visitors cannot be found in the Visitor affiliates list.
- In the case of Post Affiliate Network, you do not have the correct account IDs in the click tracking and notifysale.php/salejs.php scripts. Make sure you have copied the integration codes from the panels of your actual PAN merchants.
If you have resolved this problem and have the correct cookie ID written in the PayPal button, proceed with the payment.
After the cron job has run, check Tools > Event logs in your merchant panel and search for PayPal. If you see an entry from the time you made the purchase, you can copy the group ID of this log message and search for it to see the entire log for the PayPal plugin. If there are no issues, especially with visitorId, the commission should be saved or at least located in Tools > Sale requests log, so use that method to debug further.
If you do not see any log with "PayPal," then the IPN notification was not sent to Post Affiliate Pro (Network).
This can occur if IPN is not enabled in your PayPal account. Please follow the PayPal guide to set it up and ensure it is enabled. The URL entered there is less important, as it will be overridden by the "notify_url" input field of your button, but IPN must be enabled for the notification to be sent. If this is enabled and you still cannot see any PayPal log, try searching the PayPal IPN history in your PayPal account to see whether the IPN notification was sent to your PAP or your processing script without any errors.
If the IPN was sent and you still do not see any PayPal log, and you use your own custom IPN handling script (integrated with the cURL code from the second and third PayPal integration methods), the issue is most likely that cURL functionality is not working on your server or you have not added the cURL call to the correct file/function that actually handles the IPN.