Search the Community
Showing results for tags 'ipn'.
-
I received an email from Paypal that I need to update from http 1.0 to http 1.1 for the ipn script? Any thoughts on what to do? Here is the message: "n a bulletin dated October 18, 2011, we announced that we were going to expand the number of IP addresses for www.paypal.com to improve our site’s performance, scalability and availability. As part of this transition, we planned to discontinue support for HTTP 1.0 protocol startingOctober 7, 2013. We have recently identified that this change may impact the ability of some of our merchants to perform IPN (Instant Payment Notification) post-back validation or PDT (Payment Data Transfer) posts to www.paypal.com and ipnpb.paypal.com. This happens when the IPN or PDT scripts use HTTP 1.0 protocol and do not include the “Host: www.paypal.com” or “Host:ipnpb.paypal.com” header in the HTTP request. " Thanks, Sam
-
I had this thing working okay at some point. Now it doesn't work at all. I have tested the listener script extensively - the script is out of the book except for the query stuff- and have located the point where it seems to be hanging up as noted below. I am testing this from a sandbox account. <?php // This page handles the Instant Payment Notification communications with PayPal. // Most of the code comes from PayPal's documentation. // This script is created in Chapter 6. // Require the configuration before any PHP code as the configuration controls error reporting: require ('includes/commonDefs.inc.php'); require(CONNECTION); $uid = "215"; // HARD WIRED IN FOR TESTING PURPOSES. THIS SAME $UID IS ALSO IN THE PAYPAL BUTTON // The config file also starts the session // Start by creating a request variable: $req = 'cmd=_notify-validate'; // Add each received key=value pair to the request: foreach ($_POST as $key => $value) { // Get all the POST vars from Paypal $value = urlencode(stripslashes($value)); $req .= "&$key=$value"; // the $req will be sent back to PP for confirmation } // Open a socket connection to PayPal: $fp = fsockopen ('ssl://www.sandbox.paypal.com', 443, $errno, $errstr, 30); // Test //$fp = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30); // Live if (!$fp) { trigger_error('Could not connect for the IPN!'); } else { // Send the request to PayPal: $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"; fputs ($fp, $header . $req); // Paypal must get back exactly what it sent // Read in the response: while (!feof($fp)) { // keep reading until no more to read // ================================= $res = fgets ($fp, 1024); // get the completed response from Paypal if (strcmp ($res, "VERIFIED") == 0) { // a-okay, proceed // ============ THE ABOVE CONDITIONAL HAS TESTED FOR TRUE // ============ THE CONDITIONAL BELOW NEVER SEEMS TO BE TRUE if ($_POST['payment_status'] == 'Completed'){ I PUT IN AN UPDATE QUERY HERE TO TEST TO SEE IF IT WAS GETTING WITHIN THIS CONDITIONAL. IT DOES NOT. ABOVE THIS CONDITIONAL, IT SEEMS TO WORK OKAY. THIS CONDITIONAL IS A DUPLICATE OF THE ONE IN THE SCRIPT RIGHT BELOW HERE } // ====== THE ABOVE CONDITIONAL NEVER SEEMS TO BE TRUE ===== // Check for the right values: if ( isset($_POST['payment_status']) && ($_POST['payment_status'] == 'Completed') && ($_POST['receiver_email'] == 'chopth_1337786135_biz@gmail.com') && ($_POST['mc_gross'] == 25.00) && ($_POST['mc_currency'] == 'USD') && (!empty($_POST['txn_id'])) ) { // Need the database connection now: // Check for this transaction in the database: $txn_id = mysqli_real_escape_string($dbc, $_POST['txn_id']); $q = "SELECT maaMembersID FROM payments WHERE trans_id='$txn_id'"; $r = mysqli_query ($dbc, $q);
-
Hey Guys, I learned everything I know from Larry's books, but this question is not directly from any of his books. But I really need some help! I've set up a script to listen for IPN from paypal. I see the IPN activity in my paypal IPN history. The listener script that I set up is supposed to change one row in my database (I'm adding a user_meta value to a wordpress user to flag him as a premium user). The database update is not happening. When I point my browser to the page where the ipn script is hosted, this is the error message I see: web browser to the page on which my ipn script is located, I get this php error message: Warning: fsockopen() [function.fsockopen]: unable to connect to ssl://www.paypal.com:443 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?) in /home/adven/avclients.com/belovedsamoa/latest/ipn.php on line 20 Does anyone have any advice at all? What more do you need in order to help me? phpinfo() output below: In full: http://avclients.com...est/phpinfo.php The highlights: PHP Version 5.3.6 SSL Version OpenSSL/0.9.8b System Linux webserver.adventuresdesign.com 2.6.18-164.11.1.el5xen #1 SMP Wed Jan 20 08:06:04 EST 2010 x86_64 Build Date Mar 23 2011 12:20:27 Configure Command './configure' '--disable-fileinfo' '--disable-phar' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--enable-libxml' '--enable-magic-quotes' '--enable-mbstring' '--enable-pdo=shared' '--enable-sockets' '--prefix=/usr' '--with-curl=/opt/curlssl/' '--with-curlwrappers' '--with-gd' '--with-gettext' '--with-imap=/opt/php_with_imap_client/' '--with-imap-ssl=/usr' '--with-jpeg-dir=/usr' '--with-kerberos' '--with-libdir=lib64' '--with-libxml-dir=/opt/xml2/' '--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-pcre-regex=/opt/pcre' '--with-pdo-mysql=shared' '--with-pdo-sqlite=shared' '--with-pic' '--with-png-dir=/usr' '--with-sqlite=shared' '--with-xpm-dir=/usr' '--with-zlib' '--with-zlib-dir=/usr'