Note that there are some explanatory texts on larger screens.

plurals
  1. POPaypal - Securing non-encrypted buttons
    primarykey
    data
    text
    <p>I implemented a dynamic button "buy now" (not saved in my PayPal account) with IPN and it works fine (yeah!).</p> <p>Now I have a doubt about his security, because if someone change with firebug (for example) the amount value, the transaction is valid for paypal also if my IPN listener says there is a problem with amount.</p> <p>My question is "Can I encrypt the form with a php / codeigniter library?"</p> <p>Because I tried to check amount in the IPN listener, but the transaction on paypal continue correctly and It isn't blocked from IPN.</p> <p>Here, you find a part of my listener code:</p> <pre><code>private function isVerifiedIPN(){ $req = 'cmd=_notify-validate'; $posts = $this-&gt;input-&gt;post(); foreach ($posts as $key =&gt; $value){ $value = urlencode(stripslashes($value)); $req .= "&amp;$key=$value"; } if($this-&gt;config-&gt;item('SIMULATION')) $url = $this-&gt;config-&gt;item('SIMULATION_URL'); else $url = $this-&gt;config-&gt;item('PRODUCTION_URL'); if(!$this-&gt;isVerifiedAmmount() || !$this-&gt;isPrimaryPayPalEmail() || !$this-&gt;isNotProcessed()){ $req = ''; } $header = "POST /cgi-bin/webscr HTTP/1.0\r\n"; $header .= "Host: $url\r\n"; //443 $header .= "Content-type: application/x-www-form-urlencoded\r\n"; $header .= "Content-length: " . strlen($req) . "\r\n\r\n"; $fp = fsockopen ("ssl://$url", 443, $errno, $errstr, 30); if (!$fp) { $this-&gt;sendReport("Errore connessione socket"); return FALSE; } else { fputs ($fp, $header . $req); while (!feof($fp)) { $res = fgets ($fp, 1024); if (strcmp($res, "VERIFIED") == 0) { // transizione valida fclose ($fp); return TRUE; } else if (strcmp ($res, "INVALID") == 0) { $this-&gt;sendReport('Transizione non valida'); fclose ($fp); return FALSE; } } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload