Foros del Web » Programando para Internet » PHP »

paypal y php

Estas en el tema de paypal y php en el foro de PHP en Foros del Web. Por favor, si alguno trabajo con paypal y php querria pedirles si pueden guiarme ya que cuando la opreacion es concretada (uso sandbox, la plataforma ...
  #1 (permalink)  
Antiguo 18/12/2006, 18:00
 
Fecha de Ingreso: diciembre-2002
Mensajes: 473
Antigüedad: 21 años, 4 meses
Puntos: 0
paypal y php

Por favor, si alguno trabajo con paypal y php querria pedirles si pueden guiarme ya que cuando la opreacion es concretada (uso sandbox, la plataforma de testeo) no me devuelve bien los datos de la operacion.Que puede ser??
Saludos
  #2 (permalink)  
Antiguo 18/12/2006, 18:23
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 10 meses
Puntos: 2135
Re: paypal y php

Amigo si posteas tu codigo es mas facil identificar el problema, suponiendo no te ayudamos ni tu nos ayudas.
  #3 (permalink)  
Antiguo 19/12/2006, 09:29
 
Fecha de Ingreso: diciembre-2002
Mensajes: 473
Antigüedad: 21 años, 4 meses
Puntos: 0
Re: paypal y php

Gracias por responder GatorV.En realidad, es que probe varios codigos.Todo se da bien hasta que recibo (con auto reenvio ) a mi pagina.
Otro tema que me confunde es el codigo de token. No recuerdo bien cuando pero en la interfaz 'real' de paypal se me genero al hacer algun cambio. Pero ahora no se como generarlo, y en sandbox veo que no se puede crear.
-------------------------------------------------
El ultimo codigo que probe es este:
//no se bien de donde sacar $auth_token, probe con el anterior que usaba en forma real pero en sandbox no se cual ira

// Getting the authorization of PDT

$auth_token = "xxxxxxx";


// read the post from PayPal system and add 'cmd'
$PDTPost = 'cmd=_notify-synch';

// appending the 'tx' variable that was returned by paypal
$tx_token = $_GET['tx'];
$PDTPost .= "&tx=$tx_token&at=$auth_token";

// post back to PayPal system to validate
$header = '';
$header .= "POST /cgi-bin/webscr HTTP/1.0\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= "Content-Length: " . strlen($PDTPost) . "\r\n\r\n";

// fetching the PDT post URL
$PDTPostURL = 'www.sandbox.paypal.com';

// sending the data to the paypal
$fp = fsockopen ($PDTPostURL, 80, $errno, $errstr, 30);

if (!$fp) {
// HTTP ERROR
echo("error");
}
else {
echo("ok");
fputs ($fp, $header . $PDTPost);

// read the body data
$res = '';
$headerdone = false;

while (!feof($fp)) {
$line = fgets ($fp, 1024);
if (strcmp($line, "\r\n") == 0) {
// read the header
$headerdone = true;
}
else if ($headerdone){
// header has been read. now read the contents
$res .= $line;
}
}
// parse the data in array form
$lines = explode("\n", $res);
$tokensArray = array();

// If PDT is successful then only proceesd to success page
if (strcmp ($lines[0], "SUCCESS") == 0) {

//actuo con base de datos
echo("actuo con base de datos<br>");
echo($res."<br>");
}else{
//actuo con base de datos
echo("No actuo con base de datos<br>");
echo($res."<br>");
}
}//cierro gran if

-------------------------------------------------
Y me aparece:
ERROR
The requested URL could not be retrieved

--------------------------------------------------------------------------------

While trying to retrieve the URL: http://64.202.165.201/cgi-bin/webscr

The following error was encountered:

Connection Failed
The system returned:

(111) Connection refusedThe remote host or network may be down. Please try the request again.

Your cache administrator is webmaster.



--------------------------------------------------------------------------------

Generated Tue, 19 Dec 2006 16:21:28 GMT by wc04.inet.mesa1.secureserver.net (squid/2.5.STABLE12) Puede haber algo mal?

Última edición por tico74; 19/12/2006 a las 10:24
  #4 (permalink)  
Antiguo 17/07/2007, 11:54
 
Fecha de Ingreso: julio-2003
Ubicación: Buenos Aires
Mensajes: 96
Antigüedad: 20 años, 9 meses
Puntos: 0
Re: paypal y php

perdon por la pregunta, pero ¿en donde se puede obtener ese codigo?
  #5 (permalink)  
Antiguo 17/07/2007, 12:32
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 10 meses
Puntos: 2135
Re: paypal y php

Cual codigo?
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 16:05.