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.

1.

Add a custom code to order form

Find and edit the file

wp-content/plugins/easy-digital-downloads/includes/checkout/template.php

Find function _edd_user_infofields() 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">
  </script>
<!-- /Post Affiliate Pro integration snippet -->

Save your work.

2.

Integrate PayPal module 1

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

wp-content/plugins/easy-digital-downloads/includes/gateways/paypal-standard.php

Find line with text saying

'?edd-listener=IPN';

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.

3.

Integrate PayPal module 2

The second step of PayPal module integration is to add cURL code to IPN listener. Find function _edd_process_paypalipn() 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);
curl_exec($ch);
/* /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.