PayPal (IPN and custom field used by other script) integration
The faster, safer way to send money, make an online payment, receive money or set up a merchant account.
PayPal integrates using IPN callback even if the callback and custom field is used by another system (e.g. shopping cart). Because of this you will have to attach the cookie value to the original notification URL and later to re-send it to your Post Affiliate Pro.
Paypal button
The first step is to make sure that each paypal button has the notify_url field. You have to add this code to the notify_url field, in every button:
id="pap_ab78y5t4a"
So the field looks like this:
<script id="pap_x2s6df8d" src="https://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">PostAffTracker.setAccountId('Account_ID');
PostAffTracker.writeCookieToCustomField('pap_ab78y5t4a', '', 'pap_custom');
</script>
This way we are sending the tracking cookie value to the processing script so we could use the value when sale is processed.
Integration with your IPN processing script
Now the IPN callback is pointed to your script. This callback has to be forwarded also to Post Affiliate Pro paypal.php script https://URL_TO_PostAffiliatePro/plugins/PayPal/paypal.php.
In case your PayPal processing script is PHP, you can use the following code to accomplish that. You can place it at the beginning of your processing file or beginning of the processing function.
/* Post Affiliate Pro integration snippet */
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://URL_TO_PostAffiliatePro/plugins/PayPal/paypal.php?pap_custom=".$_GET['pap_custom']);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $_POST);
curl_exec($ch);
/* /Post Affiliate Pro integration snippet */
This is it. Your PayPal is now integrated.
This is all that is required. Now whenever there’s a sale, PayPal will use its IPN function to call your script and from there, the IPN data will be redirected to our sale tracking script, so the system will generate a commission for appropriate affiliate.
NOTE: If you have more buttons at one page, you should only insert the id values into each button. The script tag should only be inserted once per page. It can be anywhere in body of the page.

Discover the essentials of clicks (referrals) tracking with our comprehensive guide. Learn about the importance of click tracking code, explore various code examples including simple, asynchronous, and PHP versions, and dive into advanced tracking options. Optimize your affiliate marketing strategy with expert tips on setting account IDs, managing cookies, and customizing tracking parameters. Visit now to enhance your click tracking implementation!
Discover Post Affiliate Pro's flexible pricing plans tailored to fit your business needs, with options for Pro, Ultimate, and Network packages. Enjoy a free trial with no credit card required, no setup fees, and the freedom to cancel anytime. Benefit from features like unlimited affiliates, advanced reporting, customizable interfaces, and lifetime support. Save up to 20% with annual billing and take advantage of more than 220 integrations. Perfect for businesses seeking to enhance their affiliate marketing efforts. Visit now to find the ideal plan for you!
Discover the power of the Lifetime Commissions plugin! Ensure lifetime referral tracking with unique customer identifiers, allowing affiliates to earn commissions on future sales without repeated clicks. Easily manage customer-affiliate relations and configure settings to suit your needs. Boost your affiliate program's efficiency with customizable options and ensure commissions for affiliates, even across different devices or channels. Explore seamless integration with eCommerce systems and enhance your marketing strategy today!