close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Regarding PayPal IPN listener page

Thread began 2/07/2023 7:16 am by Jared Lui | Last modified 2/10/2023 3:15 pm by Jared Lui | 1077 views | 14 replies

Ray BorduinWebAssist

Here is a function i wrote a while ago...

php:
<?php

function WA_isValidPayPal()     {
  
$retVal false;
  
$req 'cmd=_notify-validate';
  foreach (
$_POST as $key => $value) {
    
$value urlencode(stripslashes($value));
    
$req .= "&$key=$value";
  }
  
$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 ('www.paypal.com'80$errno$errstr30);
  if (!
$fp) {
    
$retVal false;
  }
  else {
    
fputs ($fp$header $req);
    while (!
feof($fp)) {
      
$res fgets ($fp1024);
      if (
strcmp ($res"VERIFIED") == 0) {
        
$retVal true;
      }
      else if (
strcmp ($res"INVALID") == 0) {
        
$retVal false;
      }
    }
    
fclose ($fp);
  }
  return 
$retVal;
}
?>



You could add that and then just use the trigger:

if (WA_isValidPayPal()) {
// insert code here
}

But my code is similar to theirs so it might not work either. The missing field values are probably because you have your form values wrong for your POST. You can probably get those better with something like:

file_put_contents("test.txt",json_encode($_POST));

Then your test.txt file will have all of the form fields posted and their values so you can pick through and see what you need.


Did this help? Tips are appreciated...

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...