Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8608801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:42:31+00:00 2026-06-12T03:42:31+00:00

I just realized that my paypal ipn handler in php doesn’t work anymore (and

  • 0

I just realized that my paypal ipn handler in php doesn’t work anymore (and I change nothing), I use the sample php script provided by paypal.

I tried to isolate the problem by making several test, and at this time I can say that the problem is not the “VERIFIED” or the “INVALID” thing but comes from these lines:

[…]

fputs ($fp, $header . $req);
    while (!feof($fp))
    {
        $res = fgets ($fp, 1024);
        if (strcmp ($res, "VERIFIED") == 0)
        {
        // check the payment_status is Completed

[…]

Anyone know if paypal change something or why it doesn’t work?

thanks’

ps: if I put my code before all the paypal tests (before the line “if (!$fp)”) it just works fine

This is my code, I comment where the “database process” works and where it doesn’t.

<?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.sandbox.paypal.com', 443, $errno, $errstr, 30);

// assign posted variables to local variables
$payment_status = $_POST['payment_status'];


// DATABASE PROCESS WORKS (BEFORE THE PAYPAL TESTS)



if (!$fp)
{
    // HTTP ERROR
}
else
   {

// DATABASE PROCESS WORKS

    fputs ($fp, $header . $req);
    while (!feof($fp))
    {
        $res = fgets ($fp, 1024);
        if (strcmp ($res, "VERIFIED") == 0)
        {
            // check the payment_status is Completed
            // check that txn_id has not been previously processed
            // check that receiver_email is your Primary PayPal email
            // check that payment_amount/payment_currency are correct
            // process payment


// DATABASE PROCESS NOT WORKING

        }
        else if (strcmp ($res, "INVALID") == 0)
        {
            // log for manual investigation

// DATABASE PROCESS NOT WORKING
        }
    }
fclose ($fp);
}

?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T03:42:33+00:00Added an answer on June 12, 2026 at 3:42 am

    try using the updated script on x.xom
    https://www.x.com/instant-payment-notification-4

    it uses CURL instead of fsock

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've just realized that when I use write.table() for saving a data frame in
I had the sample facebook login implementation, and just realized that it stopped working:
I just realized that if I use this code to round only the top
I just realized that CF3.5 doesn't support the binary formatter. I'm using it to
I just realized that in different Activities, I use different SharedPreferences. For example, I
I just realized that DBUnit doesn't create tables by itself (see How do I
I've posted a question yesterday but I just realized that the answer doesn't seem
I just realized that TextReader, the type of Console.In, doesn't have a BeginRead-method. How
I just realized that you can't just use an if statement on a function,
I just realized that I fundamentally don't understand how .NET/SQL Server transactions work. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.