Mass Pay Paypal IPN sample?

Discussion in 'PayPal' started by BDazzler, Jul 10, 2008.

  1. #1
    Is anybody aware of a good IPN sample (in PHP) that processes the results of Mass Payment? All of the IPN samples I see are for call backs after a purchase is made.

    I've scanned the developer area of paypal, but couldn't find exatly what I was looking for.
     
    BDazzler, Jul 10, 2008 IP
  2. astersmitem

    astersmitem Peon

    Messages:
    35
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I've looked and looked and I just can't find anything. It's frustrating that no one would put any information out on this. Surely, somebody somewhere is processing their mass pay IPNs. I'm going to make a shot at figuring it out on my own. Looking at the IPN tag I receive from a masspay, it looks like it should be possible to parse out this information for processing. If anybody else has already done this - please post an example of how you accomplised parsing all the values out of the IPN post from paypal.
     
    astersmitem, Jul 28, 2008 IP
  3. astersmitem

    astersmitem Peon

    Messages:
    35
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    ok, I found a way to parse the information passed from paypal in a masspay IPN. Here's the snippet from my IPN script.

    
    if ($_POST['txn_type'] == "masspay"){
    	$i = 1;
    	$this_reciever_email = "receiver_email_".$i;
    	while ($_POST[$this_reciever_email] != ""){
    		$this_mc_fee ="mc_fee_".$i;
    		$this_mc_gross ="mc_gross_".$i;
    		$this_masspay_txn_id ="masspay_txn_id_".$i;
    		$this_payment_fee ="payment_fee_".$i;
    		$this_payment_gross ="payment_gross_".$i;
    		$this_status ="status_".$i;
    		$this_mc_currency ="mc_currency_".$i;
    		$this_unique_id ="unique_id_".$i;
    
    		$mc_fee=$_POST[$this_mc_fee];
    		$mc_gross=$_POST[$this_mc_gross];
    		$masspay_txn_id=$_POST[$this_masspay_txn_id];
    		$payment_fee=$_POST[$this_mpayment_fee];
    		$payment_gross=$_POST[$this_mpayment_gross];
    		$status=$_POST[$this_mstatus];
    		$mc_currency=$_POST[$this_mc_currency];
    		$unique_id=$_POST[$this_unique_id];
    					
    		// All the masspay specific variables above ...
    		// Your Masspay Processing Here
    
    		$i++;
    		$this_reciever_email = "receiver_email_".$i;
    	}// end while
    } // end if
    
    Code (markup):
    There it is. Hope that helps all you folks who are having difficulty finding samples of how to do this like I was!
     
    astersmitem, Jul 28, 2008 IP
    BDazzler likes this.