Easy Digital Downloads is a complete e-commerce solution for selling digital products in a light, performant, and easy to use plugin. Rather that attempting to provide every feature under the sun, Easy Digital Downloads makes selling digital simple and complete by providing just the features you need.

The integration method integrates Easy Digital Downloads payment gateways directly.


Add a custom code to order form

Find and edit the file


Find function edd_user_info_fields() and add the following code right after </fieldset> tag:

<!-- Post Affiliate Pro integration snippet -->
  <input type="hidden" name="pap_custom" value="" id="pap_dx8vc2s5" />
  <script id="pap_x2s6df8d" src="http://URL_TO_PostAffiliatePro/scripts/notifysale.php" type="text/javascript">
<!-- /Post Affiliate Pro integration snippet -->

Save your work.


Integrate PayPal module 1

To integrate PayPal module, you will have to take two steps. The first is to edit file


Find line with text saying


and change this exact text (not line!) to this:

'?edd-listener=IPN&pap_custom='.$_POST['pap_custom']; // Post Affiliate Pro integration snippet

If you cannot find the above mentioned line (probably you use a newer version of EasyDigitalDownloads plugin), then try to look up the following line:
'notify_url' => $listener_url,

and change it to this:
'notify_url' => $listener_url.'&pap_custom='.$_POST['pap_custom'],

Continue to the next step, we stay in the same file.


Integrate PayPal module 2

The second step of PayPal module integration is to add cURL code to IPN listener. Find function edd_process_paypal_ipn() and add the following code right to the function beginning.

/* Post Affiliate Pro integration snippet */
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://URL_TO_PostAffiliatePro/plugins/PayPal/paypal.php?pap_custom='.$_GET['pap_custom']);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $_POST);
/* /Post Affiliate Pro integration snippet */

Save your work and you are done. The PayPal module has just been integrated.

The last step is to activate your PayPal plugin in your Post Affiliate Pro merchant panel.

Do not forget to integrate your WordPress with the click tracking code.