Security header is not valid - Rails PayPal

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.

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.