Location: PHPKode > scripts > WebsiteMemberManager > members-section/paypal_ipn/paypal_ipn_notify.php
<?php
if ( !isset($_POST['invoice']) ) exit();
// ignore IPN if for subscription signup - all recordable action happens when actual payments are confirmed
if ( isset($_POST['txn_type']) AND ($_POST['txn_type']=="subscr_signup") ) exit();

include("../php-lib/config.inc.php");
include("../php-lib/constants.php");
include("websitemembermanager-classes.php");// all input sanitised here
include("db-class.php");
include("member-class.php");

foreach ($_POST as $key => $value) $$key = clean_input($value);

$array_invoice = explode("-",$invoice);//invoice is sent as: $id-$time, ie. 1110637056-1110637251
$id = $array_invoice[0];

$member=new WMMmembers();
$customer_row=$member->get($id);
if (count($customer_row)<1) errorLog("PayPal IPN/WMM ERROR - id ($id) not found!","WMMpin01","paypal_ipn",1);//check id is there, bail out if not found
foreach ($customer_row AS $key => $value) $$key = $value;

$WMMAdmin= new WMMAdmin();
$admin_email=$WMMAdmin->contactEmail;

if (paypal_notification_success())//paypal_nofication_success checks the request is secure and trusted
{  //its a renewal, or subscription payment if already activated
  if ($customer_row['activated']) $WMMAdmin->IPNrenewMember($_POST,$customer_row);
  else//its a new member
  {
   $their_password=$WMMAdmin->IPNactivateMember($_POST,$customer_row);
   if ($their_password)
   {
    if ($WMMAdmin->autoActivate) include("../members/php/__email_login_details.php");
    else include("../members/php/__email_admin_new_member.php");
   } 
  }
}
else include("email_admin_failed_payment.php");
?>
Return current item: WebsiteMemberManager