I had the above issue where $payload would always be null.
Now, I just know just enough php to get myself into trouble but I was able to resolve it like so:
$data = $_REQUEST["payload"];
$unescaped_data = stripslashes($data);
$payload = json_decode($unescaped_data);
Obviously I could be opening up all kinds of issues but just wanted to make this visible.