maxio-com / chargify2

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

`chargify/chargify_direct_example` won't show errors. (tl;dr Do a bundle update) #26

Closed nhance closed 9 years ago

nhance commented 9 years ago

I'm working on a new app using the direct API and all of the response methods are blank. I was able to trace it back to the method call on recursive_symbolize_keys which does not seem to exist.

There's no error shown for this because we're using the magic method_missing crap, so this was a huge pain in the butt to trace.

Without this, it means that chargify/chargify_direct_example is also broken. Please correct me if I'm wrong.

nhance commented 9 years ago

This is where the call fails: https://github.com/chargify/chargify2/blob/master/lib/chargify2/representations/call.rb#L21

ryansch commented 9 years ago

What version of chargify2 do you have installed? (Gemfile.lock)

ryansch commented 9 years ago

The corresponding method definition is here: https://github.com/chargify/chargify2/blob/master/lib/chargify2/utils.rb#L4

nhance commented 9 years ago

Fantastic support!! Thank you so much! Couldn't find that. You ROCK! @ryansch

nhance commented 9 years ago

I will close this shortly. The issue I'm seeing is that I can do an inspect on the call and see the hash values, but I'm not able to access through method chaining nor can I access via symbol. It's a very lightly modified version of the direct_example app.

Gemfile.lock:

GEM
  remote: https://rubygems.org/
  specs:
    activemodel (4.1.8)
      activesupport (= 4.1.8)
      builder (~> 3.1)
    activeresource (4.0.0)
      activemodel (~> 4.0)
      activesupport (~> 4.0)
      rails-observers (~> 0.1.1)
    activesupport (4.1.8)
      i18n (~> 0.6, >= 0.6.9)
      json (~> 1.7, >= 1.7.7)
      minitest (~> 5.1)
      thread_safe (~> 0.1)
      tzinfo (~> 1.1)
    builder (3.2.2)
    chargify2 (0.2.4)
      hashery (~> 2.1.0)
      hashie
      httparty
      rack
    chargify_api_ares (1.3.0)
      activeresource (>= 3.2.16)
    hashery (2.1.1)
    hashie (3.3.1)
    httparty (0.10.2)
      multi_json (~> 1.0)
      multi_xml (>= 0.5.2)
    i18n (0.6.11)
    json (1.8.1)
    minitest (5.4.3)
    multi_json (1.6.1)
    multi_xml (0.5.3)
    rack (1.5.2)
    rack-protection (1.3.2)
      rack
    rails-observers (0.1.2)
      activemodel (~> 4.0)
    sinatra (1.3.4)
      rack (~> 1.4)
      rack-protection (~> 1.3)
      tilt (~> 1.3, >= 1.3.3)
    thread_safe (0.3.4)
    tilt (1.3.3)
    tzinfo (1.2.2)
      thread_safe (~> 0.1)

PLATFORMS
  ruby

DEPENDENCIES
  chargify2
  chargify_api_ares
  sinatra
ryansch commented 9 years ago

According to that paste, you're running chargify2 v0.2.4 whereas v0.2.8 is the newest version. Here's a compare view: https://github.com/chargify/chargify2/compare/v0.2.4...v0.2.8

Glad to help!

nhance commented 9 years ago

Yep, an update fixed it. When I started this project I copied the files in from chargify_direct_example which must have grabbed an older version of the Gemfile.lock from that app. It could probably use a bundle update so others don't run into the same problem over there.

Thanks again Ryan, I really appreciate it!

ryansch commented 9 years ago

I'm glad you got it figured out! I've opened an issue on chargify_direct_example to update the dependencies. Thanks for bringing that up.