0

I am able to to receive IPN Messages for receiving a payment but I don't receive any IPN messages for a MassPay call and there are no notifications in the sandbox. Has anyone had this issue? Here is the code I used for MassPay in PHP

$massPayRequest = new MassPayRequestType();
$massPayRequest->MassPayItem = array();

//Setup vars and loop through post
$payouts = array();
$account_mass_payees = array();
$rowCount = count($message_data);
foreach($message_data as $account_id) {
    try {
        $account_mass_payee = array();
        $account_mass_payee['account_id'] = $account->account_id;
        $account_mass_payee['user_id'] = $account->user_id;
        $account_mass_payee['username'] = $account->username;
        $account_mass_payee['account_type'] = $account->account_type;
        $account_mass_payee['balance'] = $account->balance;
        $account_mass_payee['paypal_email_address'] = $account_detail->paypal_email_address;
        $account_mass_payees[] = $account_mass_payee;

        //Create a mass pay item for this account
        $masspayItem = new MassPayRequestItemType();
        $masspayItem->Amount = new BasicAmountType("USD", $account_mass_payee['balance']);
        $masspayItem->ReceiverEmail = $account_mass_payee['paypal_email_address'];
        $massPayRequest->MassPayItem[] = $masspayItem;              
    } catch (\PPConnectionException $ex) {
        $result = array (
            "Status"=>"Error",
            "Description"=>$ex->getMessage()
            );
        return $result;
    }       
}

//Send out the group as a batch...
$massPayReq = new MassPayReq();
$massPayReq->MassPayRequest = $massPayRequest;
$paypalService = new PayPalAPIInterfaceServiceService(PayPalConfig::getAcctAndConfig());

/////////////////////////
// PayPal Payment Request
/////////////////////////
try {
    $massPayResponse = $paypalService->MassPay($massPayReq);
    error_log(print_r($massPayResponse), true);
} catch (Exception $ex) {
    $result = array (
    "Status"=>"Error",
    "Description"=>$ex->getMessage()
    );
    return $result;
}

Here is a sample result I receive in json:

{
    "Timestamp": "2013-12-11T19:13:16Z",
    "Ack": "Success",
    "CorrelationID": "9c60bcac3****",
    "Errors": null,
    "Version": "106.0",
    "Build": "8725992"
}

Any help is much appreciated.

Thanks!

JT_Dylan
  • 133
  • 4
  • 15
  • Have you checked the IPN history of the seller (in this case, sender) account to see if it's sending the IPN's but receiving an error code back? – Drew Angell Dec 11 '13 at 21:58
  • Yes, I (seller) receive notification in the history on PayPal and in my listener for Sale transactions but not for MassPay. Are there any links specific to MassPay and IPN that you think are relevant? – JT_Dylan Dec 13 '13 at 19:44
  • Again, have you checked your IPN history and your web logs to confirm? You could have an error in your code logic that handles the masspay txn_type, for example, but handles everything else just fine. I just ran a masspay request in my sandbox and I got the IPN as expected. If you've got IPN enabled and you're getting it for other things, then something must be wrong with the logic handling that particular txn_type. – Drew Angell Dec 14 '13 at 00:09
  • Hi, I checked the IPN History of the seller and I am seeing entries for Sales which I am also processing in my IPN listener but I don't see anything for MassPay. I am tailing my IPNListiner and have code so once it is hit I see log data. I see this log data for the Sale but not for MassPay. Is there a way to lookup based on correlation ID? Does the IPN simulator support testing MassPay? Thanks for the help. – JT_Dylan Dec 16 '13 at 19:37
  • Yeah, I get MassPay IPN's just fine. Are you using the MassPay API or are you uploading a file and doing it manually through the account? – Drew Angell Dec 17 '13 at 03:15
  • Hi, I was able to figure it out. It was in my configuration. Seems the sample code from each API (e.g. Sale versus MassPay) uses separate config file so when I checked the IPN history and didn't see anything it made me realize that I have this issue. I've updated the config data and now I see the IPN data for my seller. Odd this is that the seller I had in there prior I had deleted from my sandbox account so I think I should have received a fail. Thanks for all the help the IPN History led me down the right path. -J – JT_Dylan Dec 18 '13 at 18:53

0 Answers0