PayPal integrates using IPN callback.
Note! This is description ofintegration with PayPal if you use PayPal buttons on your web pages. Ifyou use PayPal as a processing system in your shopping cart, use themethod for integrating with shopping cart, not these steps.
Also,make sure you don't already use PayPal IPN for another purpose, such assome kind of digital delivery or membership registration.

To integrate with PayPal, you have to turn on the PayPal IPN handling plugin in the merchant panel of Post Affiliate Pro (Network) in the 'Plugins' section. Then follow the steps below.

1.

Integration code

Now add the following code into EVERY PayPal button form

<input type="hidden" name="notify_url" value="http://URL_TO_PostAffiliatePro/plugins/PayPal/paypal.php">
<input type="hidden" name="custom" value="" id="pap_dx8vc2s5">
<script id="pap_x2s6df8d" src="http://URL_TO_PostAffiliatePro/scripts/notifysale.php" type="text/javascript">
</script>

This will tell PayPal that it should silently call http://URL_TO_PostAffiliatePro/plugins/PayPal/paypal.php script upon every sale, and it will pass all sale variables including the custom field to this script.

2.

Example

  <td valign="top">
    Example of updated PayPal form:<br /><br /> <code> &amp;lt;!-- Begin PayPal Button --&amp;gt;&amp;lt;br> &amp;lt;form action="https://www.paypal.com/cgi-bin/webscr" method="post"&amp;gt;&amp;lt;br> &amp;lt;input type="hidden" name="cmd" value="_xclick"&amp;gt;&amp;lt;br> &amp;lt;input type="hidden" name="business" value="paypalemail@yoursite.com"&amp;gt;&amp;lt;br style="font-weight: bold;">&amp;lt;span style="font-weight: bold;"> &amp;lt;/span>&amp;lt;input type="hidden" name="undefined_quantity" value="1"&amp;gt;&amp;lt;br> &amp;lt;input type="hidden" name="item_number" value="Product Name"&amp;gt;&amp;lt;br> &amp;lt;input type="hidden" name="amount" value="19.95"&amp;gt;&amp;lt;br> &amp;lt;input type="hidden" name="image_url" value="https://yoursite.com/images/paypaltitle.gif"&amp;gt;&amp;lt;br> &amp;lt;input type="hidden" name="no_shipping" value="1"&amp;gt;&amp;lt;br style="font-weight: bold;">&amp;lt;span style="font-weight: bold;"> &amp;lt;/span>&amp;lt;input type="hidden" name="return" value="http://www.yoursite.com/paypalthanks.html"&amp;gt;&amp;lt;br> &amp;lt;input type="hidden" name="cancel_return" value="http://www.yoursite.com"&amp;gt;&amp;lt;br style="font-weight: bold;">&amp;lt;span style="font-weight: bold;">&amp;lt;input type="hidden" name="notify_url" value="http://www.yoursite.com/affiliate/plugins/PayPal/paypal.php"&amp;gt;&amp;lt;/span>&amp;lt;br style="font-weight: bold;">&amp;lt;span style="font-weight: bold;">&amp;lt;input type="hidden" name="custom" value="" id="pap_dx8vc2s5"&amp;gt;&amp;lt;/span>&amp;lt;br style="font-weight: bold;">&amp;lt;span style="font-weight: bold;">&amp;lt;script id="pap_x2s6df8d" src="http://www.yoursite.com/affiliate/scripts/notifysale.php" type="text/javascript"&amp;gt;&amp;lt;/span>&amp;lt;br style="font-weight: bold;">&amp;lt;span style="font-weight: bold;">&amp;lt;/script&amp;gt;&amp;lt;/span>&amp;lt;br>&amp;lt;input type="image" src="http://images.paypal.com/images/x-click-but5.gif" border="0" name="submit"&amp;gt;&amp;lt;br> &amp;lt;/form&amp;gt;&amp;lt;br> &amp;lt;!-- End PayPal Button --&amp;gt;&amp;lt;br>&amp;lt;br></code>In notify_url is possible to use <span style="font-weight: bold;">additional parameters</span>: data1-data5, coupon code, channel Id, in this case notify_url will look so:<br /><br /><code>&amp;lt;span style="font-weight: bold;">http://www.yoursite.com/affiliate/plugins/PayPal/paypal.php?data1=value1&amp;data2=value2&amp;data3=value3&amp;data4=value4&amp;data5=value5&amp;coupon_code=coupon1&amp;channelId=mychannel&amp;lt;/span></code><br /><br />Notice, that if recurring commission is created, into data1 field will be inserted transactionId.<br />
  </td>
</tr>


This is all that is required. Now whenever there's sale, PayPal will use its IPN notification to inform our sale tracking script about new transaction, and system will generate commission for the affiliate.

Note: If you have more buttons at one page, you should use only the custom field code in each button. The script tag should be inserted only once per page.It even doesn't need to be in the button form, it can be somewhere in the body of the page. (click tracking is per page (have to be above all buttons), "custom" field is per button, "notify_url" is per button too ... PAP4 script calling notifysale.php is per page - have to be below all buttons)

3.

If you use just simple PayPal links like:

<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MWU1Y4K24N3HY">Click here to order</a>

then you have to skip the above given steps and do the integration the following way:

  • into each link add: id="paypallink"
    so the link would look like this:
    <a <u>id="paypallink"</u> href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MWU1Y4K24N3HY">Click here to order</a>

  • under the JavaScript version of click tracking code that is supposed to be in the footer of your page right above the </body> tag add the following code: <!-- Post Affiliate Pro Integration snippet --> <script> PostAffTracker.writeCookieToLink('paypallink', 'custom'); </script> <!-- /Post Affiliate Pro Integration snippet --> NOTE: The PayPal links must be in your page somewhere above the  <!-- PAP Integration snippet -->  line.

There is one last step behind and that is to set your PayPal's Notification URL to point to the PayPal Ipn Handling plugin of Post Affiliate Pro (Network).

So,  log in to your PayPal account,  navigate to Profile > Selling Preferences > Instant Payment Notification Preference, click 'Edit settings', enable the IPN messages by selecting 'Recieve IPN messages (Enabled)' and set the Notification URL to:

http://URL_TO_PostAffiliatePro/plugins/PayPal/paypal.php

That's it.