Home Integration Methods PayPal (IPN and custom field used by other script)

PayPal (IPN and custom field used by other script)

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.
1
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:
<input name="notify_url" value="http://www.somedomain.com/your_existing_ipn_processor.php" id="pap_ab78y5t4a" />
This way we are sending the tracking cookie value to the processing script so we could use the value when sale is processed.
2
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 http://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.
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.

Interrupted payments

7 years ago Kamen
What will happen if the customer does not visit our IPN script?
In my experience 2-3% of the customers close the browser before they are redirected to our site

Regarding IPN

6 years ago Kaanon
@Kamen, actually IPN is done in the background. Users are sent to the the "Return" page.

Affiliate

3 years ago mimo
How to assign the sale to an affiliateID

Re: How to assign the sale to an affiliateID

3 years ago Martin Pullmann
It will be done automatically within PayPal plugin in your Post Affiliate Pro or Post Affiliate Network.