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 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.
1
Choose separator
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
2
Paypal button
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".
This will ensure that referrer will be added to the custom field after the specified separator.
3
Integration with your IPN processing script - part 1
Now the IPN callback is pointed to your script. This callback has to be
forwarded also to PAP4 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.
4
Integration with your IPN processing script - part 2
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.
This is all that is required. Now whenever there's sale, PayPal will
use its IPN function to call your script and from there, the IPN is redirected to our sale tracking script, so the system will
generate commission for the affiliate.
NOTE: If you have more buttons at one page, you should insert only HTML
tags into button. The script tag should be only inserted once at the
whole page. It even doesn't need to be in the button form, it can be
somewhere in the body of the page.
Interrupted payments
2 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
2 years ago
Kaanon
@Kamen, actually IPN is done in the background. Users are sent to the the "Return" page.