which message? Security errorSecurity header is not valid?
this means the API details are not being accepted by PayPal.
this can happen for a few reasons:
1) you have not accepted the billing agreement
2) you are using live credentials but sand box mode is enable
3) you are using sandbox credentials, but live mode is enabled
sometimes paypal just generates bad APi details, if all else fails try regenerating the API Credentials.