bitpay / ruby-client

Powerful, flexible, lightweight SDK for the BitPay Bitcoin Payment Gateway API.
MIT License
79 stars 64 forks source link

GET /ledgers breaks client.get #40

Closed heisler3030 closed 9 years ago

heisler3030 commented 9 years ago

Because the /ledgers endpoint does not return an encapsulating data node in the json response, it breaks our assumption and causes a TypeError at runtime.

Test Case: client.get(path: "ledgers/BTC?startDate=2015-01-01&endDate=2015-02-01&token=#{client.instance_variable_get(:@tokens)['merchant']}")

Proposed Fix: Add if/then logic to include full body if no [data] element is found

philosodad commented 9 years ago

This is a fairly easy, high value fix. I recommend the fix is made to 2.3 and 2.4 releases this mission.

heisler3030 commented 9 years ago

Fix verified using test case above, thanks @philosodad