Pagina 1 din 1

verificare plata Paypal cu php

Scris: Mie Mai 26, 2010 1:01 pm
de marian2oo7
As vrea sa folosesc codul de la :
http://net.tutsplus.com/tutorials/php/u ... -with-php/
pentru plata cu paypal, ceea ce vreau sa stiu este daca acesta este inca sigur, pt ca ce e publicat acolo e de anul trecut si poate sa mai schimbat ceva, si as vrea sa mai stiu in ce consta acel raspuns pe care il primesc de la paypal.

Cod: Selectaţi tot

<?php 
 
mysql_connect("localhost", "user", "password") or die(mysql_error()); 
mysql_select_db("PayPal") or die(mysql_error()); 
 
// read the post from PayPal system and add 'cmd' 
$req = 'cmd=_notify-validate'; 
foreach ($_POST as $key => $value) { 
$value = urlencode(stripslashes($value)); 
$req .= "&$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); 
 
if (!$fp) { 
// HTTP ERROR 
} else { 
fputs ($fp, $header . $req); 
while (!feof($fp)) { 
$res = fgets ($fp, 1024); 
if (strcmp ($res, "VERIFIED") == 0) { 
 
// PAYMENT VALIDATED & VERIFIED! 
 

 
else if (strcmp ($res, "INVALID") == 0) { 
 
// PAYMENT INVALID & INVESTIGATE MANUALY! 
 


fclose ($fp); 

?> 

Scris: Sâm Iul 10, 2010 11:40 pm
de bresti
foloseste plimus ca cu paypal o sa pierzi

Scris: Dum Iul 11, 2010 1:08 am
de Pirahna
Paypal are documentatie foarte detaliata ... ce ar fi sa te uiti pe ea inainte sa faci scripturi de plati online ?

Scris: Dum Iul 18, 2010 10:41 am
de alexandrul
dap are dreptate pirahna citeste documentatia in cateva cuvinte sunt 2-3 raspunsuri ca sa zic asa 1 functia cancel in cazul in care platitorul nu mai doreste sa realiz tranz 2 functia success in cazul in care platitorul a platit si de aici ai o gramada de posibilitati il trimiti pe o pagina faci update la baza de date trimiti email chestii de genu.