How do I get the email addresses of multiple recipients from a PayPal IPN?
-
09-06-2021 - |
Question
I am using the Parrallel payment feature of the Adaptive Payment API. In some cases, I have more than one recipient.
Reading the paypal reference on IPN , there's no way to get more than one recipient email address. Is this true?
Solution
The Adaptive Payments reference on this page says:
transaction[n].receiver : The receiver’s email address for the transaction
where "n" should be the number of recipients, larger than 0 in parallel payments.
--UPDATE:
OK. The problem is that Paypal is sending an array within an array through POST. In PHP, $_POST shows an "Array", but it can't be read. I got a workaround to read the response:
$postdata = file_get_contents("php://input");
mail("my@email.com", "IPN response", $postdata);
it isn't a clean solution, but it works. Improvements are welcome ;)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow