Paypal IPN simulator inconsistently works
<p>The Paypal IPN simulator seems to be very buggy. </p>

<p>The handshake between my listener and the simulator sometimes comes back <code>VERIFIED</code>, but then <code>INVALID</code> most of the other times. </p>

<p>I am using this <a href="https://github.com/Quixotix/PHP-PayPal-IPN/blob/master/ipnlistener.php" rel="nofollow">IPN script</a> to do the handshake:</p>

<pre><code>$listener = new IpnListener();
$listener-&gt;use_sandbox = true;

$verified = false;

try {
    $listener-&gt;requirePostMethod();
    $verified = $listener-&gt;processIpn();
} catch(Exception $e) {
    error_log($e-&gt;getMessage());
    exit(0);
}

if ($verified) {
    // do stuff with the database
} else {
    error_log($listener-&gt;getReport()); // when the handshake is INVALID, it goes here 
}
</code></pre>

<p>This is the kind of report that I would get:</p>

<pre><code>[10-Jun-2016 18:30:09 America/Denver] --------------------------------------------------------------------------------
[06/10/2016 6:30 PM] - https://www.sandbox.paypal.com/cgi-bin/webscr (curl)
--------------------------------------------------------------------------------
HTTP/1.1 200 OK

Date: Sat, 11 Jun 2016 00:30:08 GMT

Server: Apache

X-Frame-Options: SAMEORIGIN

Set-Cookie: c9MWDuvPtT9GIMyPc3jwol1VSlO=PbW-3Qmnqq_FObMy8QDFtFBB99ZEVawBnK4mxnzwaWVVzq5qcP4k87k_XI-FS_cYc0Bbv_GmFX28V2tZtfADGMNg2nmCXHnc9S5uc9CRyii4u3y-mayDWAiJDDVbPB_uPXNyRxEF2P7QWqKcwWEjLKbQU9ZFFCGM9SXUSLTR4oHBJ9nc3CcCkcHJUzlJQ5BneUx_cNqZdP887uPjbe6JoNnbMkHJxjneQyWLDhzdkSsgqCOUcx4awl7F3vCA7XTNv7BOr90BidPdRnulJmiDHAzEu9GfsjOdjRRl9fs3W6h-UmrvBKdwcFdV22pjxfTdA-j5tGaERsvyRhzJU1Wg4B8mFI3Rh7UotoQSrSPtL9WSH2J7SSUobFivI2YEdnXWEjsM3fYZZtQGtLFMvEczclH-sS0LOwNOlx9u60OMwrgKA14zeLcN773_Yxq; domain=.paypal.com; path=/; Secure; HttpOnly

Set-Cookie: cookie_check=yes; expires=Tue, 09-Jun-2026 00:30:09 GMT; domain=.paypal.com; path=/; Secure; HttpOnly

Set-Cookie: navcmd=_notify-validate; domain=.paypal.com; path=/; Secure; HttpOnly

Set-Cookie: navlns=0.0; expires=Mon, 11-Jun-2018 00:30:09 GMT; domain=.paypal.com; path=/; Secure; HttpOnly

Set-Cookie: Apache=10.72.108.11.1465605008753741; path=/; expires=Mon, 04-Jun-46 00:30:08 GMT

Vary: Accept-Encoding,User-Agent

X-Cnection: close

HTTP_X_PP_AZ_LOCATOR: sandbox.slc

Paypal-Debug-Id: 15636c1fb3bcc

Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.WEB.1%26silo_version%3D1880%26app%3Dappdispatcher%26TIME%3D2421906263%26HTTP_X_PP_AZ_LOCATOR%3Dsandbox.slc; Expires=Sat, 11 Jun 2016 01:00:09 GMT; domain=.paypal.com; path=/; Secure; HttpOnly

Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT

Strict-Transport-Security: max-age=14400

Transfer-Encoding: chunked

Content-Type: text/html; charset=UTF-8



INVALID
--------------------------------------------------------------------------------
payment_type             instant
payment_date             Fri Jun 10 2012 20:01:10 GMT-0400
payment_status           Completed
address_status           confirmed
payer_status             verified
first_name               John
last_name                Smith
payer_email              buyer@paypalsandbox.com
payer_id                 TESTBUYERID01
address_name             John Smith
address_country          United States
address_country_code     US
address_zip              95131
address_state            CA
address_city             San Jose
address_street           123 any street
business                 XXXXXXXXXXXXXX
receiver_email           seller@paypalsandbox.com
receiver_id              seller@paypalsandbox.com
residence_country        US
item_name                something
item_number              AK-1234
quantity                 1
shipping                 3.04
tax                      2.02
mc_currency              USD
mc_fee                   0.44
mc_gross                 12.34
mc_gross_1               9.34
</code></pre>

<p>Is there some sort of limitation on the number of requests that can be made using the simulator? I can't figure out why it works occasionally. </p>