<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Paypal IPN from the sandbox not working</title>
	<atom:link href="http://www.blograndom.com/blog/2008/09/paypal-ipn-from-the-sandbox-not-working/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.blograndom.com/blog/2008/09/paypal-ipn-from-the-sandbox-not-working/</link>
	<description>Technology, website development, reviews and how-to's</description>
	<lastBuildDate>Sun, 22 Jan 2012 14:15:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: vance</title>
		<link>http://www.blograndom.com/blog/2008/09/paypal-ipn-from-the-sandbox-not-working/comment-page-1/#comment-7205</link>
		<dc:creator>vance</dc:creator>
		<pubDate>Wed, 11 Jan 2012 20:10:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.blograndom.com/blog/?p=67#comment-7205</guid>
		<description>thanks Tiziano, i spend weeks with this and was close to give up. Paypal sucks! anyone knows of a better solution with no signup fees?</description>
		<content:encoded><![CDATA[<p>thanks Tiziano, i spend weeks with this and was close to give up. Paypal sucks! anyone knows of a better solution with no signup fees?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tiziano</title>
		<link>http://www.blograndom.com/blog/2008/09/paypal-ipn-from-the-sandbox-not-working/comment-page-1/#comment-7189</link>
		<dc:creator>Tiziano</dc:creator>
		<pubDate>Fri, 02 Dec 2011 11:59:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.blograndom.com/blog/?p=67#comment-7189</guid>
		<description>Well I found the reasons it is not working. But PayPal is not clear at all!!!
Even in Sandbox can work properly. 

I mean: not only with the test IPN page.
It&#039;s necessary to go in sandbox then: test Accounts =&gt; Enter Sandbox text Site

a new window appears and, inside it, another login it&#039;s required.
Click on profile
Instant Payment Notification Preferences
Insert your test site with the script and give ok.

everything works also in sandbox in this manner.

I employed nights to find solution. it&#039;s not explained properly on their manual neither in internet sites.</description>
		<content:encoded><![CDATA[<p>Well I found the reasons it is not working. But PayPal is not clear at all!!!<br />
Even in Sandbox can work properly. </p>
<p>I mean: not only with the test IPN page.<br />
It&#8217;s necessary to go in sandbox then: test Accounts =&gt; Enter Sandbox text Site</p>
<p>a new window appears and, inside it, another login it&#8217;s required.<br />
Click on profile<br />
Instant Payment Notification Preferences<br />
Insert your test site with the script and give ok.</p>
<p>everything works also in sandbox in this manner.</p>
<p>I employed nights to find solution. it&#8217;s not explained properly on their manual neither in internet sites.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tiziano</title>
		<link>http://www.blograndom.com/blog/2008/09/paypal-ipn-from-the-sandbox-not-working/comment-page-1/#comment-7188</link>
		<dc:creator>Tiziano</dc:creator>
		<pubDate>Wed, 30 Nov 2011 20:11:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.blograndom.com/blog/?p=67#comment-7188</guid>
		<description>I&#039;m sorry the first part of the code was cut by the system here.
I report the first completed lines (if they are not cut again!):

&lt;code&gt;
// read the post from PayPal system and add &#039;cmd&#039;
$req = &#039;cmd=_notify-validate&#039;;

foreach ($_POST as $key =&gt; $value) {
$value = urlencode(stripslashes($value));

&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>I&#8217;m sorry the first part of the code was cut by the system here.<br />
I report the first completed lines (if they are not cut again!):</p>
<p><code><br />
// read the post from PayPal system and add 'cmd'<br />
$req = 'cmd=_notify-validate';</p>
<p>foreach ($_POST as $key =&gt; $value) {<br />
$value = urlencode(stripslashes($value));</p>
<p></code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tiziano</title>
		<link>http://www.blograndom.com/blog/2008/09/paypal-ipn-from-the-sandbox-not-working/comment-page-1/#comment-7187</link>
		<dc:creator>Tiziano</dc:creator>
		<pubDate>Wed, 30 Nov 2011 19:55:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.blograndom.com/blog/?p=67#comment-7187</guid>
		<description>BTW I found this code and I isntalled it.
What happens is that: testing the IPN from the TEST window of Sandbox, the script works, the only one thing I get always INVALID, but variables are passed through.
Instead of, when I make a transaction (alwasy in Sandbox) the variables are empty. Nothing is passed through.

Here please the script
&lt;code&gt;

 $value) {
$value = urlencode(stripslashes($value));
$req .= &quot;&amp;$key=$value&quot;;
}

// post back to PayPal system to validate
	
$header = &quot;POST /cgi-bin/webscr HTTP/1.0\r\n&quot;;
 
	// If testing on Sandbox use: 
$header .= &quot;Host: www.sandbox.paypal.com:443\r\n&quot;;
//$header .= &quot;Host: ipnpb.paypal.com:443\r\n&quot;;
$header .= &quot;Content-Type: application/x-www-form-urlencoded\r\n&quot;;
$header .= &quot;Content-Length: &quot; . strlen($req) . &quot;\r\n\r\n&quot;;

	// If testing on Sandbox use:
	$fp = fsockopen (&#039;ssl://www.sandbox.paypal.com&#039;, 443, $errno, $errstr, 30);
//$fp = fsockopen (&#039;ssl://ipnpb.paypal.com&#039;, 443, $errno, $errstr, 30);

// assign posted variables to local variables
$item_name = $_POST[&#039;item_name&#039;];
$item_number = $_POST[&#039;item_number&#039;];
$payment_status = $_POST[&#039;payment_status&#039;];
$payment_amount = $_POST[&#039;mc_gross&#039;];
$payment_currency = $_POST[&#039;mc_currency&#039;];
$txn_id = $_POST[&#039;txn_id&#039;];
$receiver_email = $_POST[&#039;receiver_email&#039;];
$payer_email = $_POST[&#039;payer_email&#039;];

if (!$fp) {
// HTTP ERROR
} else {
fputs ($fp, $header . $req);
while (!feof($fp)) {
$res = fgets ($fp, 1024);
if (strcmp ($res, &quot;VERIFIED&quot;) == 0) {
// check the payment_status is Completed
// check that txn_id has not been previously processed
// check that receiver_email is your Primary PayPal email
// check that payment_amount/payment_currency are correct
// process payment

$mail_From = &quot;From: TEST-IPN PayPal@paypal.com&quot;;
$mail_To = &quot;my_account@mydomain.com&quot;;
$mail_Subject = &quot;VERIFIED IPN&quot;;
$mail_Body = $req;

foreach ($_POST as $key =&gt; $value){
$emailtext .= $key . &quot; = &quot; .$value .&quot;\n\n&quot;;
}

mail($mail_To, $mail_Subject, $emailtext . &quot;\n\n&quot; . $mail_Body, $mail_From);

} else if (strcmp ($res, &quot;INVALID&quot;) == 0) {
// log for manual investigation

$mail_From = &quot;From: TEST-IPN PayPal@paypal.com&quot;;
$mail_To = &quot;my_account@mydomain.com&quot;;
$mail_Subject = &quot;INVALID IPN&quot;;
$mail_Body = $req;

foreach ($_POST as $key =&gt; $value){
$emailtext .= $key . &quot; = &quot; .$value .&quot;\n\n&quot;;
}

mail($mail_To, $mail_Subject, $emailtext . &quot;\n\n&quot; . $mail_Body, $mail_From);

}
}
fclose ($fp);
}

?&gt;
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>BTW I found this code and I isntalled it.<br />
What happens is that: testing the IPN from the TEST window of Sandbox, the script works, the only one thing I get always INVALID, but variables are passed through.<br />
Instead of, when I make a transaction (alwasy in Sandbox) the variables are empty. Nothing is passed through.</p>
<p>Here please the script<br />
<code></p>
<p> $value) {<br />
$value = urlencode(stripslashes($value));<br />
$req .= "&amp;$key=$value";<br />
}</p>
<p>// post back to PayPal system to validate</p>
<p>$header = "POST /cgi-bin/webscr HTTP/1.0\r\n";</p>
<p>	// If testing on Sandbox use:<br />
$header .= "Host: <a href="http://www.sandbox.paypal.com:443" rel="nofollow">http://www.sandbox.paypal.com:443</a>\r\n";<br />
//$header .= "Host: ipnpb.paypal.com:443\r\n";<br />
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";<br />
$header .= "Content-Length: " . strlen($req) . "\r\n\r\n";</p>
<p>	// If testing on Sandbox use:<br />
	$fp = fsockopen ('ssl://www.sandbox.paypal.com', 443, $errno, $errstr, 30);<br />
//$fp = fsockopen ('ssl://ipnpb.paypal.com', 443, $errno, $errstr, 30);</p>
<p>// assign posted variables to local variables<br />
$item_name = $_POST['item_name'];<br />
$item_number = $_POST['item_number'];<br />
$payment_status = $_POST['payment_status'];<br />
$payment_amount = $_POST['mc_gross'];<br />
$payment_currency = $_POST['mc_currency'];<br />
$txn_id = $_POST['txn_id'];<br />
$receiver_email = $_POST['receiver_email'];<br />
$payer_email = $_POST['payer_email'];</p>
<p>if (!$fp) {<br />
// HTTP ERROR<br />
} else {<br />
fputs ($fp, $header . $req);<br />
while (!feof($fp)) {<br />
$res = fgets ($fp, 1024);<br />
if (strcmp ($res, "VERIFIED") == 0) {<br />
// check the payment_status is Completed<br />
// check that txn_id has not been previously processed<br />
// check that receiver_email is your Primary PayPal email<br />
// check that payment_amount/payment_currency are correct<br />
// process payment</p>
<p>$mail_From = "From: TEST-IPN <a href="mailto:PayPal@paypal.com">PayPal@paypal.com</a>";<br />
$mail_To = "my_account@mydomain.com";<br />
$mail_Subject = "VERIFIED IPN";<br />
$mail_Body = $req;</p>
<p>foreach ($_POST as $key =&gt; $value){<br />
$emailtext .= $key . " = " .$value ."\n\n";<br />
}</p>
<p>mail($mail_To, $mail_Subject, $emailtext . "\n\n" . $mail_Body, $mail_From);</p>
<p>} else if (strcmp ($res, "INVALID") == 0) {<br />
// log for manual investigation</p>
<p>$mail_From = "From: TEST-IPN <a href="mailto:PayPal@paypal.com">PayPal@paypal.com</a>";<br />
$mail_To = "my_account@mydomain.com";<br />
$mail_Subject = "INVALID IPN";<br />
$mail_Body = $req;</p>
<p>foreach ($_POST as $key =&gt; $value){<br />
$emailtext .= $key . " = " .$value ."\n\n";<br />
}</p>
<p>mail($mail_To, $mail_Subject, $emailtext . "\n\n" . $mail_Body, $mail_From);</p>
<p>}<br />
}<br />
fclose ($fp);<br />
}</p>
<p>?&gt;<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tiziano</title>
		<link>http://www.blograndom.com/blog/2008/09/paypal-ipn-from-the-sandbox-not-working/comment-page-1/#comment-7186</link>
		<dc:creator>Tiziano</dc:creator>
		<pubDate>Wed, 30 Nov 2011 17:46:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.blograndom.com/blog/?p=67#comment-7186</guid>
		<description>I&#039;m testing the simulator to a PHP Page (as example here: http://www.mydomain.com/mypage.php) that simply detects what is in the variable $_POST. The scope is to check if the array $_POST is fileld in, and in what manner the variables are sent to my site.

The routine, write the array into a .TXT file.
I just accepted the test PayPal Sandbox gives. just clicking on Send IPN.

Well ... the file is written but it&#039;s empty.

At this point I had put a condition: if ($_POST){ etc etc;) else { mail_to_me }.

It was emailing me everytime. It means: the POST variable was empty.

Whats up with me ? :-(</description>
		<content:encoded><![CDATA[<p>I&#8217;m testing the simulator to a PHP Page (as example here: <a href="http://www.mydomain.com/mypage.php" rel="nofollow">http://www.mydomain.com/mypage.php</a>) that simply detects what is in the variable $_POST. The scope is to check if the array $_POST is fileld in, and in what manner the variables are sent to my site.</p>
<p>The routine, write the array into a .TXT file.<br />
I just accepted the test PayPal Sandbox gives. just clicking on Send IPN.</p>
<p>Well &#8230; the file is written but it&#8217;s empty.</p>
<p>At this point I had put a condition: if ($_POST){ etc etc;) else { mail_to_me }.</p>
<p>It was emailing me everytime. It means: the POST variable was empty.</p>
<p>Whats up with me ? <img src='http://www.blograndom.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Marchant</title>
		<link>http://www.blograndom.com/blog/2008/09/paypal-ipn-from-the-sandbox-not-working/comment-page-1/#comment-7184</link>
		<dc:creator>Rob Marchant</dc:creator>
		<pubDate>Mon, 14 Nov 2011 08:34:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.blograndom.com/blog/?p=67#comment-7184</guid>
		<description>Sometimes, even the sandbox IPN simulator doesn&#039;t work properly.  It was running fine for me yesterday morning, then all of a sudden stopped working.  Obviously I assumed that I had broken something in the code, but couldn&#039;t spot anything.  Went back to it in the afternoon without making any changes, and hey presto, the IPN files were being received.  Frustrating to say the least.

Currently I&#039;m sat here cursing paypal because it&#039;s not fucking working again.</description>
		<content:encoded><![CDATA[<p>Sometimes, even the sandbox IPN simulator doesn&#8217;t work properly.  It was running fine for me yesterday morning, then all of a sudden stopped working.  Obviously I assumed that I had broken something in the code, but couldn&#8217;t spot anything.  Went back to it in the afternoon without making any changes, and hey presto, the IPN files were being received.  Frustrating to say the least.</p>
<p>Currently I&#8217;m sat here cursing paypal because it&#8217;s not fucking working again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthew Fox</title>
		<link>http://www.blograndom.com/blog/2008/09/paypal-ipn-from-the-sandbox-not-working/comment-page-1/#comment-7178</link>
		<dc:creator>Matthew Fox</dc:creator>
		<pubDate>Sat, 22 Oct 2011 22:17:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.blograndom.com/blog/?p=67#comment-7178</guid>
		<description>Michael is right. Ensure your host runs on port 80 or port 443 before you try anything else. Paypal didn&#039;t send me anything using the IPN simulator when my handler was on ports 8000 or 8080, but it worked fine on ports 80 or 443.</description>
		<content:encoded><![CDATA[<p>Michael is right. Ensure your host runs on port 80 or port 443 before you try anything else. Paypal didn&#8217;t send me anything using the IPN simulator when my handler was on ports 8000 or 8080, but it worked fine on ports 80 or 443.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://www.blograndom.com/blog/2008/09/paypal-ipn-from-the-sandbox-not-working/comment-page-1/#comment-7177</link>
		<dc:creator>John</dc:creator>
		<pubDate>Wed, 19 Oct 2011 10:25:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.blograndom.com/blog/?p=67#comment-7177</guid>
		<description>I had my code working and receiving messages from IPN on Monday. Today I came back to run more tests, and even though the sandbox reports the messages as having been sent, my logs are showing them as not coming in. 

I did fall for trap #1, but worked that out myself. And I can &#039;call&#039; the IPN code by entering the url into my browser, it fails but then that is expected, but importantly it produces the logs, so I know it is accessible. As for points #3 and #4, I&#039;m not sure. It worked nicely on Monday, and nothing changed in that code between then and now.

I&#039;ve seen the IPN simulator mentioned a few times, but I don&#039;t know where to find it. PayPal doesn&#039;t seem to mention it in their docs. Can anyone help?</description>
		<content:encoded><![CDATA[<p>I had my code working and receiving messages from IPN on Monday. Today I came back to run more tests, and even though the sandbox reports the messages as having been sent, my logs are showing them as not coming in. </p>
<p>I did fall for trap #1, but worked that out myself. And I can &#8216;call&#8217; the IPN code by entering the url into my browser, it fails but then that is expected, but importantly it produces the logs, so I know it is accessible. As for points #3 and #4, I&#8217;m not sure. It worked nicely on Monday, and nothing changed in that code between then and now.</p>
<p>I&#8217;ve seen the IPN simulator mentioned a few times, but I don&#8217;t know where to find it. PayPal doesn&#8217;t seem to mention it in their docs. Can anyone help?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://www.blograndom.com/blog/2008/09/paypal-ipn-from-the-sandbox-not-working/comment-page-1/#comment-7168</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Thu, 15 Sep 2011 01:40:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.blograndom.com/blog/?p=67#comment-7168</guid>
		<description>Another thing to check when using the IPN simulator is to make sure your listener is on port 80 or 443. The simulator will not connect to URLs listening on non-standard ports. I had to find this out the hard way talking to a PayPal tech this afternoon. 

On a side note, I&#039;m also experiencing the issue of IPN not getting sent when I place an order in the sandbox. The only way to test my code right now is by using the simulator. What a pita.</description>
		<content:encoded><![CDATA[<p>Another thing to check when using the IPN simulator is to make sure your listener is on port 80 or 443. The simulator will not connect to URLs listening on non-standard ports. I had to find this out the hard way talking to a PayPal tech this afternoon. </p>
<p>On a side note, I&#8217;m also experiencing the issue of IPN not getting sent when I place an order in the sandbox. The only way to test my code right now is by using the simulator. What a pita.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: abc</title>
		<link>http://www.blograndom.com/blog/2008/09/paypal-ipn-from-the-sandbox-not-working/comment-page-1/#comment-7162</link>
		<dc:creator>abc</dc:creator>
		<pubDate>Tue, 23 Aug 2011 09:41:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.blograndom.com/blog/?p=67#comment-7162</guid>
		<description>abcdef</description>
		<content:encoded><![CDATA[<p>abcdef</p>
]]></content:encoded>
	</item>
</channel>
</rss>

