Contact Forms for WordPress Just Don't Get Any Easier than Gravity Forms


GravityForms with PayPal

If you want to track paypal payments through your GravityForms, you have to follow these few steps.

The first step is to login to your FTP where your WordPress is installed at and find file wp-content/plugins/gravityforms/form_display.php

Edit the file and find this line:

return $footer;

Paste this code above the line:

$footer .="<input type='hidden' name='custom' value='' id='pap_dx8vc2s5' />
  <script id='pap_x2s6df8d' src='http://URL_TO_PostAffiliatePro/scripts/notifysale.php' type='text/javascript'>

Save your work.


GravityForms with PayPal 2

Now, edit file wp-content/plugins/gravityformspaypal/class-gf-paypal.php

(if you have no 'class-gf-paypal.php' file, then you may have a 'paypal.php' file only)

and find the following line of code:
$ipn_url = urlencode(get_bloginfo("url") . "/?page=gf_paypal_ipn");

Add this code below the line:

  /* Post Affiliate Pro integration snippet */
  $ipn_url .= urlencode("&pap_custom=".$_POST['custom']);
  /* /Post Affiliate Pro integration snippet */

Now find this line:

private static function verify_paypal_ipn(){

and paste this code right below the line:

/* Post Affiliate Pro integration snippet */
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $_POST);
/* /Post Affiliate Pro integration snippet */

Do not forget to integrate your WordPress with the click tracking code - best practice is to place it to footer file, using Appearance> Edit