Visualizzazione dei risultati da 1 a 3 su 3

Discussione: IPN - PayPal

  1. #1

    IPN - PayPal

    Ciao a tutti,ho un problema con la paypal ipn, nello specifico, al momento della validation creo un file. lo status della chiamata, lato paypal, � "Completed" con HTTP request 200, il file per� non viene creato. Estrapolando la creazione del file e inserendola fuori dallo script tutto funziona. Dove sbaglio?

  2. #2
    Moderatore di PHP L'avatar di Alhazred
    Registrato dal
    Oct 2003
    Messaggi
    12,445
    Senza vedere il codice è impossibile risponderti.

  3. #3
    Ciao,
    in realtà l'avevo postato. Provo ad inserirlo nuovamente:

    <?php

    // 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);
    $fp = fsockopen ('ssl://www.sandbox.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!
    $hour = date("g:ia");
    $fp = fopen("richieste_".date("d_m_Y").".txt", "a");
    fwrite($fp, "1,16,6.01,".$hour.";");
    }

    else if (strcmp ($res, "INVALID") == 0) {

    // PAYMENT INVALID & INVESTIGATE MANUALY!

    }
    }
    fclose ($fp);
    }
    ?>

Tag per questa discussione

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.