waynerobinson / xeroizer

Xero accounting system API library.
http://waynerobinson.github.com/xeroizer
Other
238 stars 311 forks source link

BrandingTheme#payment_services memoization issue #478

Closed PericlesTheo closed 4 years ago

PericlesTheo commented 5 years ago

I've run into a problem where I'm requesting payment services for a number of themes. The issue is that regardless of the ID of the theme, it always returns the first result since it is memoized

See here

I'm happy to open a PR that either: 1) Remove the memoization 2) Builds a hash structure where the results are saved per ID. Any lookup on an existing ID will be cached or if it's a new ID it just returns the result.

Unless there is a particular reason, I prefer the former.

Cheers 😃

PericlesTheo commented 5 years ago

hey @waynerobinson any thoughts on the above? I can create a PR shortly after we agree on approach.