Open MonikaMahanthappa opened 9 years ago
Hello Chargify team,
I am @MonikaMahanthappa's colleague and I ran into same issue (nil @status_code
resulting in response.successful? to be false even though the API call was successful). This time, it was the POST /allocations API of V2.
When I switched our code to hit API V1 Allocations endpoint, it started working.
I suspect something has changed recently in API V2 which is causing this bug in this gem. I will try to report to Chargify support and see what I can find.
Meanwhile, we have stopped using this gem and fallen back to our custom Chargify api client.
Thanks for the report @bhavinjavia. We will look into the issue further. If you find any more information please let us know.
In case of
404
status_code
is not getting set in response. Im are usingapi_v2
branch.chargify = Chargify2::Client.new(api_id: <masked>, api_password: <masked>, base_uri: 'https://api.chargify.com/api/v2')
chargify.customers.read(1)
<Chargify2::Response:0x007f8c1d878ec0 @resource=#<Chargify2::Customer>, @meta=#<Hashie::Mash errors=[#<Hashie::Mash attribute=nil kind="not_found" message="The requested Customer could not be found.">]>, @status_code=nil, @errors=[#<Hashie::Mash attribute=nil kind="not_found" message="The requested Customer could not be found.">]>
When I tried to hit the api directly, i could see status_code being sent in the chargify api response. So guessing the issue to be in the gem.