<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[notifica ipn paypal]]></title><description><![CDATA[<p dir="auto">non so se sono nel posto giusto.<br />
è un po di tempo che cerco di risolvere un problema con la notifica di pagamento di paypal<br />
lo script è il seguente:<br />
$req = 'cmd=_notify-validate';<br />
foreach ($_POST as $key =&gt; $value)<br />
{<br />
$value = urlencode(stripslashes($value));<br />
$req .= "&amp;$key=$value";<br />
}<br />
$header = "POST /cgi-bin/webscr HTTP/1.0\r\n";<br />
$header .= "Host: ww.sandbox.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>
<pre><code>    $fp = fsockopen ('ssl://ww.sandbox.paypal_com, 443, $errno, $errstr, 30); 
    $subject = "Problema IPN1"; 
    $message = "Si è verificato un problema nella seguente transazione:\r\n\r\n"; 
    $message .=$errno. $errstr ; 
    mail(ADMIN_MAIL,$subject,$message,"From: noreply&lt;$from&gt;"); 
    if (!$fp) 
    { 
        // HTTP ERROR 
        // $errstr - $errno 
        $this-&gt;sendReport(); 
        return FALSE; 
    } 
    else 
    { 
        fputs ($fp, $header . $req); 
        while (!feof($fp)) 
        {   //$this-&gt;sendReport(); 
            $res = fgets ($fp, 1024); 
            $subject = "Problema IPN2"; 
            $message = "Si è verificato un problema nella seguente transazione:\r\n\r\n"; 
            $message .=$res. $fp ; 
            mail(ADMIN_MAIL,$subject,$message,"From: noreply&lt;$from&gt;"); 
            if (strcmp($res, "VERIFIED") == 0) 
            { 
                fclose ($fp); 
                return TRUE; 
            } 
            else if (strcmp ($res, "INVALID") == 0) 
            { 
                //se la procedura non è legittima invia un email all'amministratore 
                $this-&gt;sendReport(); 
                fclose ($fp); 
                return FALSE;  }}}
</code></pre>
<p dir="auto">mi arrivano 3 messaggi sia Problema IPN1 che Problema IPN2<br />
quindi lo script entra dentro il while è fa il controllo della variabile $res solo che è come se fosse vuota o nulla.<br />
ecco cosa mi arriva come dati nelle email:</p>
<ul>
<li>leggenda:<br />
a-&gt;$res<br />
b-&gt;$fp<br />
A-&gt;$errno<br />
B-&gt; $errstr</li>
</ul>
<p dir="auto">Problema IPN2 //e quindi siamo dentro il while<br />
a-&gt; Date: Wed, 07 Dec 2011 13:53:23 GMT<br />
b-&gt; Resource id #4</p>
<p dir="auto">Problema IPN1<br />
A -&gt;0<br />
B-&gt;</p>
<p dir="auto">Problema IPN2<br />
a-&gt; HTTP/1.0 500 Server closed connection without sending any data back<br />
b-&gt; Resource id #4</p>
<p dir="auto">qualcuno sa dirmi cosa devo fare affinche mi arrivi sta benedetta risposta (VERIFIED o INVALID) da paypal?</p>
]]></description><link>https://dev.connect.gt/topic/162546/notifica-ipn-paypal</link><generator>RSS for Node</generator><lastBuildDate>Wed, 25 Nov 2026 17:18:52 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/162546.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 07 Dec 2011 21:42:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to notifica ipn paypal on Fri, 09 Dec 2011 18:58:35 GMT]]></title><description><![CDATA[<p dir="auto">Avevo pensato che fosse un problema loro ma non mi rispondono è un host gratuito quindi devi fare un po da solo.<br />
Grazie comunque.</p>
]]></description><link>https://dev.connect.gt/post/1041292</link><guid isPermaLink="true">https://dev.connect.gt/post/1041292</guid><dc:creator><![CDATA[gio73lombo]]></dc:creator><pubDate>Fri, 09 Dec 2011 18:58:35 GMT</pubDate></item><item><title><![CDATA[Reply to notifica ipn paypal on Fri, 09 Dec 2011 15:45:09 GMT]]></title><description><![CDATA[<p dir="auto">Il codice che ti ho postato è fornito da PayPal, quindi prova a chiedere al tuo servizio hosting se nell'eventualità dipendesse da "loro".</p>
]]></description><link>https://dev.connect.gt/post/1041270</link><guid isPermaLink="true">https://dev.connect.gt/post/1041270</guid><dc:creator><![CDATA[web.designer]]></dc:creator><pubDate>Fri, 09 Dec 2011 15:45:09 GMT</pubDate></item><item><title><![CDATA[Reply to notifica ipn paypal on Fri, 09 Dec 2011 15:32:58 GMT]]></title><description><![CDATA[<p dir="auto">Ahhh ok.<br />
Comunque non funziona lo stesso non ho capito se è un problema di sandbox o del mio host server.</p>
]]></description><link>https://dev.connect.gt/post/1041291</link><guid isPermaLink="true">https://dev.connect.gt/post/1041291</guid><dc:creator><![CDATA[gio73lombo]]></dc:creator><pubDate>Fri, 09 Dec 2011 15:32:58 GMT</pubDate></item><item><title><![CDATA[Reply to notifica ipn paypal on Fri, 09 Dec 2011 15:21:55 GMT]]></title><description><![CDATA[<p dir="auto">Il forum non accetta link attivi, ecco perchè. <img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=12b9555a9a1" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:1.4em;width:auto;vertical-align:middle" title=":)" alt="🙂" /></p>
]]></description><link>https://dev.connect.gt/post/1041269</link><guid isPermaLink="true">https://dev.connect.gt/post/1041269</guid><dc:creator><![CDATA[web.designer]]></dc:creator><pubDate>Fri, 09 Dec 2011 15:21:55 GMT</pubDate></item><item><title><![CDATA[Reply to notifica ipn paypal on Fri, 09 Dec 2011 15:20:10 GMT]]></title><description><![CDATA[<p dir="auto">non cambia il risultato</p>
<p dir="auto">ma non ho capito perchè stacchi il link? (errore o voluto)?</p>
]]></description><link>https://dev.connect.gt/post/1041290</link><guid isPermaLink="true">https://dev.connect.gt/post/1041290</guid><dc:creator><![CDATA[gio73lombo]]></dc:creator><pubDate>Fri, 09 Dec 2011 15:20:10 GMT</pubDate></item><item><title><![CDATA[Reply to notifica ipn paypal on Wed, 07 Dec 2011 22:26:46 GMT]]></title><description><![CDATA[<p dir="auto">Ciao, prova con questo:</p>
<p dir="auto">$req = 'cmd=_notify-validate';</p>
<p dir="auto">foreach ($_POST as $key =&gt; $value) {<br />
$value = urlencode(stripslashes($value));<br />
$req .= "&amp;$key=$value";<br />
}</p>
<p dir="auto">// post back to PayPal system to validate<br />
$header .= "POST /cgi-bin/webscr HTTP/1.0\r\n";<br />
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";<br />
$header .= "Content-Length: " . strlen($req) . "\r\n\r\n";<br />
$fp = fsockopen ('ssl://www . <a href="http://paypal.com" rel="nofollow ugc">paypal.com</a>', 443, $errno, $errstr, 30);</p>
<p dir="auto">// 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 dir="auto">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<br />
}<br />
else if (strcmp ($res, "INVALID") == 0) {<br />
// log for manual investigation<br />
}<br />
}<br />
fclose ($fp);<br />
}<br />
?&gt;</p>
<p dir="auto">PS: ho staccato il link "www . <a href="http://paypal.com" rel="nofollow ugc">paypal.com</a></p>
]]></description><link>https://dev.connect.gt/post/1041268</link><guid isPermaLink="true">https://dev.connect.gt/post/1041268</guid><dc:creator><![CDATA[web.designer]]></dc:creator><pubDate>Wed, 07 Dec 2011 22:26:46 GMT</pubDate></item></channel></rss>