Find the answer to your question
Advanced Search
I am receiving cut off/incomplete Notification Payloads from eBay. I am using simple php script which send a 200OK response header and then captures the php input stream with file_get_contents(php://input ), which then is written to a log file.
We have found problems with capturing PHP input stream, and writing the payload to files. As mentioned in our code sample at: https://ebaydts.com/eBayKBDetails?KBid=1164
Please use $GLOBALS["HTTP_RAW_POST_DATA"] to capture the payload instead of file_get_contents(php://input). We have problems like clients retrieving cut-off and incomplete payloads, when they capture the PHP input stream. (Note that eBay sent complete payloads to the clients, but the cut-off problem was at the client's end).
Also, Make sure that you acknowledge the request from eBay by sending proper response (headers) before capturing the payload. Depending on the size of the payload, the time taken to capture the payload might vary and in occasions of time consumed more than three secs, a time out happens.
Essentially the flow should be like:
<?php
headers("Status: 200 OK");
headers("Content-Type: text/html ");// this is optional as PHP send this header by default.
$payLoad = $GLOBALS["HTTP_RAW_POST_DATA"] ;
$file = 'notifications.log';
file_put_contents($file, $payLoad);
?>