-1

I'm trying to write a custom listener for PayPal Instant Payment Notifications. I've defined a page callback in hook_menu as

$items['paypal-listener'] = array(
    'title' => 'PayPal IPN Listener',
    'description' => 'Simple test for receiving PayPal notifications',
    'page callback' => 'ipn_test',
    'access arguments' => array('access content'),
    'type' => MENU_CALLBACK,
);

and my custom callback is

function ipn_test() {
    var_dump($_POST);
    watchdog('paypal_ipn', print_r($_POST, TRUE));
}

but it's always empty. When testing with postman the response is always

array(0) {}

Is there something I'm missing? Something that empties out the $_POST array?

The $_POST from PayPal is Content-Type: application/x-www-form-urlencoded in case that matters.

I have already checked this question, this question and this one but none seem to have the answer to why the data is gone.

This doesn't work either

$data = file_get_contents("php://input");
$data = json_decode($data, TRUE);

Update:

OK, it seems as if the chrome app postman can't send POST varibale to a local server properly. I created a simple php script with just var_dump($_POST) and while it works fine on an online server, it is empty on my local server.

0

There must have been some kind of bug or I set it up wrong because the next day it started working fine.

Not the answer you're looking for? Browse other questions tagged or ask your own question.