maxio-com / chargify2

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

Chargify::Call#successful? broken #5

Closed vivienschilis closed 11 years ago

vivienschilis commented 12 years ago

It returns false all the time.

c.successful? #=> false
c.response['result']['status_code'] #=> '200'

Why not use c.success attribute instead ?

ryansch commented 12 years ago

Just ran into this as well. It appears that OpenCascade is falling apart.

Call#successful? is implemented with the following:

response.result.status_code.to_s == '200'

When stepping through with the debugger, response.result returns {}. The actual result can be fetched with:

response['result']['status_code'].to_s == '200'

We need a better way to do method access for hashes inside of chargify2.

vivienschilis commented 12 years ago

the issue is the monkey patch of Hash.symbolize_keys.

Lots of libs implement this function but some implementation does not do it recursively. So if chargify is not the last one getting 'required' then the lib breaks :)

warmwaffles commented 12 years ago

Anyone got a fix for this? Or will I just have to directly access the hash and work off of it

jeremywrowe commented 11 years ago

There is a new version of the gem coming out that fixes this issue - we don't yet have a release date for it but it will be soon.

ryansch commented 11 years ago

Thanks for the update. We're looking forward to it!

jeremywrowe commented 11 years ago

I have released a fix in version 0.2.6 =)