JSON Response unordered - new semantics?
The semantics of a customer XML include that e.g. the first subscription listed is the current active one.
However when outputting JSON (such as from PHP's library's "toJson()"), the hash/dicts such as subscriptions (whose keys are subscription IDs) no longer have guaranteed ordering, as JSON does not support ordering of dicts.
How can we determine with a JSON output which subscription is the active one?
What other ordering-dependent aspects of the customer data will we need to find another way of determining?
Discussions are closed to public comments.
If you need help with Cheddar please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Marc Guyer on 17 May, 2011 04:00 PM
Interesting. I didn't know that.
The subscription with the latest createdDatetime is the current active subscription.
Probably invoices. Those are ordered by billingDatetime.
I know you guys aren't exclusively using the PHP wrapper but in there are convenience methods for getting the current subscription, current invoice, etc. Those methods return arrays but if you need json, you can reencode it after getting the desired item.
Dean closed this discussion on 16 Jan, 2013 05:15 PM.