close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

IPN Verification Postback to HTTPS

Thread began 2/21/2017 1:16 pm by Dave Buchholz | Last modified 9/14/2021 9:01 am by Dave Buchholz | 2435 views | 6 replies

Ray BorduinWebAssist

It looks like we have updated the function at some point.

We now use:

php:
<?php

function WA_isValidPayPal()     {
  
// STEP 1: read POST data
  // Reading POSTed data directly from $_POST causes serialization issues with array data in the POST.
  // Instead, read raw POST data from the input stream.
  
$raw_post_data file_get_contents('php://input');
  
$raw_post_array explode('&'$raw_post_data);
  
$myPost = array();
  foreach (
$raw_post_array as $keyval) {
    
$keyval explode ('='$keyval);
    if (
count($keyval) == 2)
      
$myPost[$keyval[0]] = urldecode($keyval[1]);
  }
  
// read the IPN message sent from PayPal and prepend 'cmd=_notify-validate'
  
$req 'cmd=_notify-validate';

  foreach (
$myPost as $key => $value) {
    
$value urlencode($value);
    
$req .= "&$key=$value";
  }

  
// Step 2: POST IPN data back to PayPal to validate
  
$ch curl_init('https://ipnpb.paypal.com/cgi-bin/webscr');
  
curl_setopt($chCURLOPT_HTTP_VERSIONCURL_HTTP_VERSION_1_1);
  
curl_setopt($chCURLOPT_POST1);
  
curl_setopt($chCURLOPT_RETURNTRANSFER,1);
  
curl_setopt($chCURLOPT_POSTFIELDS$req);
  
curl_setopt($chCURLOPT_SSL_VERIFYPEER1);
  
curl_setopt($chCURLOPT_SSL_VERIFYHOST2);
  
curl_setopt($chCURLOPT_FORBID_REUSE1);
  
curl_setopt($chCURLOPT_HTTPHEADER, array('Connection: Close'));
  
// In wamp-like environments that do not come bundled with root authority certificates,
  // please download 'cacert.pem' from "https://curl.haxx.se/docs/caextract.html" and set
  // the directory path of the certificate as shown below:
  // curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . '/cacert.pem');
  
if ( !($res curl_exec($ch)) ) {
    
// error_log("Got " . curl_error($ch) . " when processing IPN data");
    
curl_close($ch);
    exit;
  }
  
curl_close($ch);
  return (
strcmp ($res"VERIFIED") == 0);
}



You could try updating it on your end and see if that fixes the problem. It looks like you have it manually updated on line 1332 of the eCart Definition include.


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...