ruckus / quickbooks-ruby

Quickbooks Online REST API V3 - Ruby
MIT License
374 stars 302 forks source link

Intuit alternate JSON response #612

Open rchekaluk opened 2 months ago

rchekaluk commented 2 months ago

I empirically observed an intermittent alternate response when testing TaxService#create against an Intuit sandbox. This PR extends the gem to handle both forms of the response.

Typical Intuit response:

{"Fault":{"Error":[{"Message":"Duplicate Name Exists Error","Detail":"The name supplied already exists. : null","code":"6240"}],"type":"ValidationFault"},"time":"2024-06-23T04:29:11.688-07:00"}

Alternate Intuit response:

{"fault":{"error":[{"message":"Duplicate Name Exists Error","detail":"The name supplied already exists. : null","code":"6240"}],"type":"ValidationFault"},"batchItemResponse":[],"attachableResponse":[],"time":1719142418269,"cdcresponse":[]}

(note: the PR additionally adds a small workaround to make test cases pass)