The Security Header is not valid error means paypal is not accepting the API Credentials.
It can happen if:
- you are using sandbox credetials for a live transaction or vice versa
- you have not accepted the billing agrement after generating the credentials
- the Api credentials could be just flat out bad, you may need to recreate them
at the end of the day, the probelm is:
Paypal is not accepting the credentials you have entered.