chargify / chargify_api_ares

A Chargify API wrapper for Ruby using ActiveResource
http://chargify.com
MIT License
161 stars 96 forks source link

entity expansion has grown too large error when retrieving statements for a subscription #170

Open ryoung opened 5 years ago

ryoung commented 5 years ago

I'm getting a RuntimeError (entity expansion has grown too large) when retrieving statements for a subscription using Chargify::Subscription.find(12345).statements. After some investigation, it looks like the XML response is too large to parse for some statements with a large number of transactions.

Is there a recommended solution here, other than to increase REXML::Document.entity_expansion_text_limit to a huge limit? Is there a way to use another XML parser?

Thanks

ryoung commented 5 years ago

It looks like we can change the format to JSON by doing Chargify::Base.format = :json. This gets around the XML parser runtime error.