Security Error "Security header is not valid"

Help
2007-04-21
2013-04-22
  • Andy Cottrell
    Andy Cottrell
    2007-04-21

    I am attempting to implement your app on a clients website.  I am using their PayPal credentials and using your doDirectPayment example but I am getting a Security error "Security header is not valid".  The response is as follows:

    object(stdClass)#10 (6) {
      ["Timestamp"]=>
      string(20) "2007-04-21T16:25:57Z"
      ["Ack"]=>
      string(7) "Failure"
      ["CorrelationID"]=>
      string(13) "2201973126444"
      ["Errors"]=>
      object(stdClass)#11 (4) {
        ["ShortMessage"]=>
        string(14) "Security error"
        ["LongMessage"]=>
        string(28) "Security header is not valid"
        ["ErrorCode"]=>
        string(5) "10002"
        ["SeverityCode"]=>
        string(5) "Error"
      }
      ["Version"]=>
      string(8) "2.400000"
      ["Build"]=>
      string(6) "1.0006"
    }

    Any help resolving this would be greatly appreciated.

    Thanks.

     
    • drew22
      drew22
      2007-05-26

      I get the same problem too when I take the sample test file out of the phppaypalpro directory.

      I had path problems with the require_once calls, so i made absolute paths:

      paypal_base.php:
      define('PHP_PPPRO_BASE_PATH', dirname(__FILE__).'/');
      require_once(PHP_PPPRO_BASE_PATH.'config.inc.php');
      require_once(PHP_PPPRO_BASE_PATH.'paypal_types.php');

      And added PHP_PPPRO_BASE_PATH to all require calls:
      require_once(PHP_PPPRO_BASE_PATH.'dodirectpayment.php');

      the sample test file works in when its in the phppaypalpro directory, but when i take it out I get the secuity "Security header is not valid" message

       
    • drew22
      drew22
      2007-05-26

      Got it working. it was just a typo in my $API_USERNAME value;

      I also replaced all require_once calls with require.  require_once should be avoided if possible because it has a lot of overhead.

      AW

       
    • Micah Mitchell
      Micah Mitchell
      2009-02-13

      I am having this same problem Security Header Invalid

      I've checked and re-checked my credentials and dont' get what's wrong.

      The steps I took were
      download it, move it to my server
      change to live in the config.inc.php on line 57
      change to my credentials in examples.php on lines 145,147,149

      Am I missing something?

      Thanks in advance!