Dec 12

I bought the Paypal Rails Integration ebook by Benjamin Curtis here.

But upon running the sample application, I cannot get through the purchase step and always get the error “There was an error processing your payment: Security header is not valid”

After some playing-around, although in the PDF it says “The modified version of the plugin included with the sample application does have the signature support.”, it turns out that the application doesnt have signature support.

So simply use PEM file instead of signature, like this:

ActiveMerchant::Billing::PaypalGateway.pem_file = path/to/file.pem

And remove the :signature element from PAYPAL_API_CREDENTIALS.

One Response to “Security header is not valid – Rails PayPal”

  1. nicholash3ndra says:

    If you got the same issue when using a PayPal gateway like this instead of PEM file:

    ActiveMerchant::Billing::PaypalGateway.new(
    :login => ‘your_login’
    :password => ‘your_pass’,
    :signature => ‘the_signature’)

    Please MAKE SURE you filled the login, password and signature with the correct values from your Paypal account or Sandbox, for just testing you can use the code example from this rails cast http://bit.ly/OYjZy just copy paste this code into your script/console and it should be works. If you change one of this credential value then you’ll see error message “Security header is not valid”, it means this error will raise if you fill not valid credential values.

    Hope this help.

Leave a Reply

Security Code: