Important: Note that this integration is not intended to be used for e-commerce systems that provide their own PayPal Payments Standard gateway.
This integrates Affiliates Pro with PayPal Payments Standard. Place any payment button on your website, the integration captures PayPal’s IPN messages to track sales referred by affiliates. It provides various flexible shortcodes as well as an API that are used to work with PayPal HTML forms:
- Buy Now buttons
- Add to Cart buttons
- Subscribe buttons
- Buy Gift Certificate buttons
- Automatic Billing buttons
- Installment Plan buttons
- Donate buttons
Integration with PayPal Payments Standard
Affiliates Pro for PayPal fully automates affiliate commissions for sales and provides additional features specific to the integration:
- Affiliate referrals are created automatically when a client makes a payment.
- Support for recurring payments. Recurring subscription payments are credited automatically to the affiliate who referred the subscription.
- Full refunds and reversed payments automatically reject referrals. Partial refunds put referrals on hold for review.
- Customizable notifications are sent to the site administrator when a new referral has been granted. PayPal transaction data can be included.
- Customizable affiliate notifications: affiliates are notified when new referrals are granted to them.
- Supports all the features of the Affiliates Pro plugin.
The integration with PayPal Payments Standard captures PayPal’s IPN messages to track sales referred by affiliates. It provides shortcodes that are used to work with PayPal button code.
Recommendation: use the sandbox mode for testing purposes.
- Carefully read the information about all settings on this page and adjust them adequately.
- Make sure to fill in the primary email address of your PayPal account below on this page under PayPal.
- Sign in to your PayPal account and in your account Profile’s Selling Preferences, enable Instant Payment Notifications and fill in the Notification URL. The URL to use is given on this page under URL.
- In your PayPal account’s Profile Website Preferences enable Auto Return for Website Payments and input the Return URL that points to the appropriate page here on your site.
- Enclose your PayPal buttons within the shortcode as outlined below or use any of the mentioned alternatives.
Enclosing PayPal button code
[affiliates_paypal_form] shortcode to enclose your PayPal button codes, like in this example for a Buy Now button:
Remember to switch the editor to HTML before pasting the PayPal button code on a page. Some buttons may require you to switch back to Visual and update your page (try that if you get an error message from PayPal after clicking on a button).
PayPal button code that is enclosed within
[affiliates_paypal_form]...[/affiliates_paypal_form] shortcodes will be modified and have the required data added automatically. This includes the notification URL for incoming IPN messages from PayPal, along with affiliate tracking information and optionally the Return URL and Cancel URL if set. All of these are added through hidden fields for the notify_url, custom, return and cancel_return IPN variables. Make sure that your button code does not already provide these fields.
Notification and tracking shortcodes
Alternatively, you can use the
[affiliates_paypal_custom] shortcodes to render the notification URL and affiliate tracking information.
Example – Add the following before the closing
</form> of your PayPal button code (you do not need to do this if you are using the [affiliates_paypal_form] shortcode explained above):
<input type="hidden" name="notify_url" value="[affiliates_paypal_notify_url]" />
<input type="hidden" name="custom" value="[affiliates_paypal_custom]" />
If you do not want to use shortcodes and prefer to make calls to the API directly, these class methods can be used to render the notification URL and affiliate tracking information:
Affiliates_PayPal_IPN_Integration::get_notify_url()to render the notification URL to be passed to the PayPal HTML variable notify_url.
Affiliates_PayPal_IPN_Integration::get_custom()to render the affiliate tracking information to be included in the PayPal HTML variable custom.
Example – Add the following fields before the closing
</form> of your PayPal button code:
<input type="hidden" name="notify_url" value="<php echo Affiliates_PayPal_IPN_Integration::get_notify_url(); ?>" />
<input type="hidden" name="custom" value="<php echo Affiliates_PayPal_IPN_Integration::get_custom(); ?>" />
PayPal and the PayPal logo are trademarks of PayPal, Inc.