PHP Code for SWP Responses


The following topic provides a sample PHP code for viewing Secure Web Pay response messages. Use this sample code in conjunction with the Secure Web Pay Integration Guide, specifically the chapter on Secure Web Pay Checkout.

PHP Sample Code

                <?php if ($_SERVER['REQUEST_METHOD'] == 'POST')
  {
    echo $_POST;
    echo "<br />";
    print "CONTENT_TYPE: " . $_SERVER['CONTENT_TYPE'] . "<BR /> <BR />"; 
       $SWPdata = file_get_contents('php://input');
    print "Secure Web Pay(SWP) Response Data: <pre>";
       var_dump($SWPdata);
       var_dump($_POST);
    print "</pre>";
  }
?>