<?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[[PAYPAL] Messaggio di Errore anche a Pagamento Avvenuto]]></title><description><![CDATA[<p dir="auto">ciao a tutti!<br />
sto cercando di venir fuori da un problema che mi assilla ormai da una settimana...</p>
<p dir="auto">questo è il codice di esempio che lo stesso paypal fornisce:</p>
<pre><code class="language-html">&lt;?
// read the post from PayPal system and add 'cmd'
$req = 'cmd=_notify-validate';

foreach ($_POST as $key =&gt; $value) {
  $value = urlencode(stripslashes($value));
  $req .= "&amp;$key=$value";
}

// post back to PayPal system to validate
$header .= "POST /cgi-bin/webscr HTTP/1.0\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= "Content-Length: " . strlen($req) . "\r\n\r\n";
$fp = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30);

// assign posted variables to local variables
$item_name = $_POST['item_name'];
$item_number = $_POST['item_number'];
$payment_status = $_POST['payment_status'];
$payment_amount = $_POST['mc_gross'];
$payment_currency = $_POST['mc_currency'];
$txn_id = $_POST['txn_id'];
$receiver_email = $_POST['receiver_email'];
$payer_email = $_POST['payer_email'];

if (!$fp) {
  // HTTP ERROR
} else {
  fputs ($fp, $header . $req);
  
  while (!feof($fp)) {
    $res = fgets ($fp, 1024);
    if (strcmp ($res, "VERIFIED") == 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('mail@mail.it','Pagamento OK','Pagamento Avvenuto con Successo');
    } else if (strcmp ($res, "INVALID") == 0) {
      // log for manual investigation
      mail('mail@mail.it','Pagamento FAIL','Pagamento Non Avvenuto');
    }
  }
  fclose ($fp);
}
?&gt;
</code></pre>
<p dir="auto">ebbene, nonostante il pagamento venga effettuato senza problemi, mi vengono inviate sempre due mail: la prima di pagamento effettuato e la seconda di errore nel pagamento.</p>
<p dir="auto">ho provato a stampare tutte le variabili ma viene restituito effettivamente il valore SUCCESS quindi non capisco come faccia ad entrare nella condizione di INVALID.</p>
<p dir="auto">qualcuno ha già avuto a che fare con questo codice o simile per l'integrazione di paypal nel suo sito?</p>
<p dir="auto">grazie!</p>
]]></description><link>https://dev.connect.gt/topic/82364/paypal-messaggio-di-errore-anche-a-pagamento-avvenuto</link><generator>RSS for Node</generator><lastBuildDate>Fri, 27 Nov 2026 22:59:06 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/82364.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 12 Sep 2008 18:26:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [PAYPAL] Messaggio di Errore anche a Pagamento Avvenuto on Fri, 12 Sep 2008 18:41:58 GMT]]></title><description><![CDATA[<p dir="auto">allora... aggiungo che ho fatto un nuovo copia ed incolla di tutto il codice indicato da paypal. il risultato è che ora va sempre in errore. questi i valori stampati:</p>
<p dir="auto">HTTP/1.1 200 OK<br />
Date: Fri, 12 Sep 2008 18:54:44 GMT<br />
Server: Apache<br />
Content-Length: 7<br />
Set-Cookie: cookie_check=yes; expires=Mon, 10-Sep-2018 18:54:44 GMT; <a href="http://domain=.paypal.com" rel="nofollow ugc">domain=.paypal.com</a>; path=/<br />
Set-Cookie: navcmd=_notify-validate; <a href="http://domain=.paypal.com" rel="nofollow ugc">domain=.paypal.com</a>; path=/<br />
Set-Cookie: navlns=0; expires=Thu, 07-Sep-2028 18:54:44 GMT; <a href="http://domain=.paypal.com" rel="nofollow ugc">domain=.paypal.com</a>; path=/<br />
Set-Cookie: Apache=10.190.8.11.1221245684214133; path=/; expires=Thu, 31-Jul-02 12:26:28 GMT<br />
Keep-Alive: timeout=5, max=100</p>
<p dir="auto">Connection: Keep-Alive<br />
Content-Type: text/html; charset=UTF-8<br />
INVALID</p>
]]></description><link>https://dev.connect.gt/post/758806</link><guid isPermaLink="true">https://dev.connect.gt/post/758806</guid><dc:creator><![CDATA[mattiasoragni]]></dc:creator><pubDate>Fri, 12 Sep 2008 18:41:58 GMT</pubDate></item></channel></rss>