PayPal IPN Messaging - Receive for payment but not for MassPay

513 views Asked by At

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!

0

There are 0 answers