iamfmjk / etsy

A friendly Ruby interface to the Etsy API
https://github.com/kytrinyx/etsy
MIT License
170 stars 113 forks source link

cannot generate request token #78

Closed williamcodes closed 10 years ago

williamcodes commented 10 years ago

We are using the rubygems version of the gem, not the github version, with Ruby v2.1.1. We get an OpenSSL error. I've changed them in this issue for obvious reasons but the real api key and secret work using PostMan and HTTParty.

irb(main):002:0> Etsy.api_key = 'x03ho6jzhg4g7m5obqqqwer134kad' => "xertuy67ihg4g7m5oq4rq345d" irb(main):003:0> Etsy.api_secret = 'kt5p1gbe02' => "kt5p1gbe02" irb(main):004:0> request = Etsy.request_token OpenSSL::SSL::SSLError: hostname does not match the server certificate from /usr/lib/ruby/1.9.1/openssl/ssl-internal.rb:129:in post_connection_check' from /usr/lib/ruby/1.9.1/net/http.rb:801:inconnect' from /usr/lib/ruby/1.9.1/net/http.rb:755:in do_start' from /usr/lib/ruby/1.9.1/net/http.rb:744:instart' from /usr/lib/ruby/1.9.1/net/http.rb:1284:in request' from /home/flatiron/recommendsy/shared/bundle/ruby/1.9.1/gems/oauth-0.4.7/lib/oauth/consumer.rb:161:inrequest' from /home/flatiron/recommendsy/shared/bundle/ruby/1.9.1/gems/oauth-0.4.7/lib/oauth/consumer.rb:194:in token_request' from /home/flatiron/recommendsy/shared/bundle/ruby/1.9.1/gems/oauth-0.4.7/lib/oauth/consumer.rb:136:inget_request_token' from /home/flatiron/recommendsy/shared/bundle/ruby/1.9.1/gems/etsy-0.2.6/lib/etsy/secure_client.rb:36:in request_token' from /home/flatiron/recommendsy/shared/bundle/ruby/1.9.1/gems/etsy-0.2.6/lib/etsy/verification_request.rb:13:inrequest_token' from /home/flatiron/recommendsy/shared/bundle/ruby/1.9.1/gems/etsy-0.2.6/lib/etsy.rb:151:in request_token' from (irb):4 from /home/flatiron/recommendsy/shared/bundle/ruby/1.9.1/gems/railties-4.1.0.rc2/lib/rails/commands/console.rb:90:instart' from /home/flatiron/recommendsy/shared/bundle/ruby/1.9.1/gems/railties-4.1.0.rc2/lib/rails/commands/console.rb:9:in start' from /home/flatiron/recommendsy/shared/bundle/ruby/1.9.1/gems/railties-4.1.0.rc2/lib/rails/commands/commands_tasks.rb:69:inconsole' from /home/flatiron/recommendsy/shared/bundle/ruby/1.9.1/gems/railties-4.1.0.rc2/lib/rails/commands/commands_tasks.rb:40:in run_command!' from /home/flatiron/recommendsy/shared/bundle/ruby/1.9.1/gems/railties-4.1.0.rc2/lib/rails/commands.rb:17:in<top (required)>' from bin/rails:8:in require' from bin/rails:8:in

'irb(main):005:0>

kytrinyx commented 10 years ago

The GitHub version of the gem is what is currently up on Rubygems, so there should be no difference between the two.

I'll dig into this to see if I can reproduce it, and let you know what I find out. It might take a couple days, as there's a lot going on right now.

williamcodes commented 10 years ago

Awesome, thanks. If you want to steer me in the right direction, I'm happy to try to figure it out and make a pull request.

kytrinyx commented 10 years ago

It looks like Etsy's sandbox API no longer exists. The default value for Etsy.host is development in the current gem, which points to the sandbox.

I took a look at the developer documentation, and it no longer mentions a sandbox. They also say that you are to test against production, but set your account to "test mode", which will not charge you (or any customers that accidentally stumble across the shop).

It seems like the fix would be to just get rid of the whole environment idea and hard-code the host to the production one.

This should still be configurable, since it also looks like they're beta-testing a v3 of the API, and I imagine that v3 will be accessible in parallel to v2.

Want to take a stab at this, or should I go ahead and make the change?

williamcodes commented 10 years ago

Hey Katrina,

Absolutely, love to help, I'm working on a side project with a couple friends using the Etsy API, so I'm copying them. We'll take a stab at it and might have questions for you, we're all pretty junior ruby devs.

Thanks,

William

On Fri, May 16, 2014 at 11:06 AM, Katrina Owen notifications@github.comwrote:

It looks like Etsy's sandbox API no longer exists. The default value for Etsy.host is development in the current gem, which points to the sandbox.

I took a look at the developer documentation, and it no longer mentions a sandbox. They also say that you are to test against production, but set your account to "test mode", which will not charge you (or any customers that accidentally stumble across the shop).

It seems like the fix would be to just get rid of the whole environmentidea and hard-code the host to the production one.

This should still be configurable, since it also looks like they're beta-testing a v3 of the API, and I imagine that v3 will be accessible in parallel to v2.

Want to take a stab at this, or should I go ahead and make the change?

— Reply to this email directly or view it on GitHubhttps://github.com/kytrinyx/etsy/issues/78#issuecomment-43342127 .

irosenb commented 10 years ago

@williamcodes I can make you a contributor. @kytrinyx is that okay?

williamcodes commented 10 years ago

You should add @sunwooz and @wontaeyang too!

kytrinyx commented 10 years ago

Yes, absolutely!