maxio-com / chargify2

Chargify API V2 Ruby Wrapper
MIT License
13 stars 6 forks source link

Incorrect signature #27

Closed brandoncc closed 9 years ago

brandoncc commented 9 years ago

I have the following in my haml Rails view:

= chargify.direct.secure_parameters(data: {redirect_uri: 'http://requestb.in/14d7g2l1'}).to_form_inputs.html_safe

I have verified my api keys and the hidden input fields. I receive a message saying incorrect signature, which makes sense because when I copy and paste my secure data and api key directly from the hidden input values, into https://chargify-direct-signature.herokuapp.com, I get a different signature.

How do I make this gem generate the proper signature? Is this gem outdated?

jeremywrowe commented 9 years ago

@brandoncc Can you give the version of the chargify2 gem you are using? And if this is in a rails project perhaps the rails version? If we could see a larger snippet of code it would be helpful in debugging further. If this isn't a great place to do that due to sensitive data, please open a trouble ticket at http://help.chargify.com

brandoncc commented 9 years ago

Let's play can you spot the problem...

def chargify
  @chargify ||= Chargify2::Client.new(
    api_id: ENV['CHARGIFY_API_ID'],
    api_password: ENV['CHARGIFY_DIRECT_API_SECRET'],
    api_secret: ENV['CHARGIFY_API_PASSWORD']
  )
end

I had the secret and password swapped. I apologize, I was apparently tired. All is well now!

jeremywrowe commented 9 years ago

ha ha, no problem :)