PayPal Express Checkout (IPN used by other script)
Would you like to improve your affiliate software even more? Check out the PayPal Express Checkout (IPN used by other script) for Post Affiliate Pro.


Would you like to improve your affiliate software even more? Check out the PayPal Express Checkout (IPN & custom field) for Post Affiliate Pro.
The faster, safer way to send money, make an online payment, receive money or set up a merchant account.
PayPal Express Checkout integrates using IPN callback even if the callback and customfield is used by other system (e.g. shopping cart). Because of this you will have to choose separator which will separate our and 3rd party cookie value. We will use || in this example.
Note! This is description of integration with PayPal if you use PayPal buttons on your web pages. If you use PayPal as a processing system in your shopping cart, use the method for integrating with shopping cart, not these steps.
Choose separator which will separate our and 3rd party cookie value. We will use || in this example. You have to configure Paypal plugin to use this separator. Go to Plugins > Paypal > Configure > Custom Value Separator.
Now add the following code into EVERY PayPal button form. Please make sure that the custom field you have in your button has id=”pap_ab78y5t4a” :
<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.setAppendValuesToField('||');
PostAffTracker.writeCookieToCustomField('pap_ab78y5t4a');
</script>
This will ensure that referrer will be added to the custom field after the specified separator.
Now the IPN callback is pointed to your script. This callback has to be forwarded also to PAP paypal.php script, which url is http://www.yoursite.com/affiliate/plugins/PayPal/paypal.php .
In case, your paypal processing script is in PHP, you can use following code to accomplish that. You can place it at the beginning of your processing file:
/* PAP integration */
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://URL_TO_PostAffiliatePro/plugins/PayPal/paypal.php");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $_POST);
curl_exec($ch);
/* end of PAP integration */
The custom parameter is in format 3rdPartySystemValue||PapValue. In order for 3rd party system to work correctly you need to parse 3rdPartySystemValue from the custom parameter. To do this add following code right after PayPal IPN verification:
<?php
$separator = '||';
if ($_POST['custom'] != '') {
$explodedCustomValue = explode($separator, $_POST['custom'], 2);
if (count($explodedCustomValue) == 2) {
$_REQUEST['custom'] = $_POST['custom'] = $explodedCustomValue[0];
}
}
?>
This is all that is required. Now whenever there’s sale, PayPal Express Checkout will use its IPN function to call our sale tracking script, and system will generate commission for the affiliate.
Discover seamless PayPal Express Checkout integration with Post Affiliate Pro, featuring IPN callbacks and custom field handling. Maximize your affiliate marketing potential today.
Would you like to improve your affiliate software even more? Check out the PayPal Express Checkout (IPN used by other script) for Post Affiliate Pro.
Would you like to improve your affiliate software even more? Check out the PayPal (IPN used by other script) integration for Post Affiliate Pro.
Learn how to seamlessly integrate PayPal with Post Affiliate Pro to track sales, generate affiliate commissions, and manage transactions efficiently using IPN c...
Cookie Consent
We use cookies to enhance your browsing experience and analyze our traffic. See our privacy policy.