Subscription plans

alex's Avatar

alex

08 Dec, 2010 11:29 PM

How many "plans" can a "subscription" have? The fact that the XML schema used by your API nests the "plan" under a "plans" element, seems to indicate that it could be more than one.

Is this the case? If not, do you have some additional information about the schema you're using? If so, can you please explain the circumstances that could lead to a subscription being created for multiple plans?


  <subscription id="7fc2f2e6-3e47-11df-8728-40407c9117fd">
    <plans>
      <plan id="e6eac5ee-e5e9-11df-86d5-40407c9117fd" code="PAID">
        <name>Paid</name>
       ...
      </plan>
    </plans>
 </subscription>
  1. Support Staff 1 Posted by Marc Guyer on 09 Dec, 2010 04:45 PM

    Marc Guyer's Avatar

    Hi Alex -- A subscription can only have one plan. It's nested within a <plans> node for consistency. Sorry if that's confusing. I've also attached a schema for the <customers> document.

  2. 2 Posted by alex on 09 Dec, 2010 05:49 PM

    alex's Avatar

    Thanks, Marc.

    The naming makes it a little more difficult to write a simple client. Client code cannot infer whether or not to create a collection of plans based on the schema (without reading the XSD). It would, in my opinion, be better if the <plans> node indicated a collection of plan objects, while a singular <plan> node indicated a reference to a singular plan object.

    Otherwise, we wind up with calls (in ruby) like customer.subscriptions.first.plans.first rather than the more accurate customer.subscriptions.first.plan.

    In order to fix this, the client maintainer needs to adjust the offending nodes in order to acheive the correct data structure. The schema doc will help with that, so thanks for sending it.

    Alex

  3. Support Staff 3 Posted by Marc Guyer on 09 Dec, 2010 08:24 PM

    Marc Guyer's Avatar

    We have heard the same complaint from some other ruby devs... Unfortunately it can't be changed. However, you might be interested to know that ExpectedBehavior is currently developing a new open source ruby wrapper which we will be officially supporting. We have had lengthy discussions with the devs over there and have full confidence that this wrapper will be well designed and will fully implement the API. It should be done within a few days.

  4. 4 Posted by alex on 09 Dec, 2010 08:27 PM

    alex's Avatar

    That's great news. We'll definitely check it out.

  5. alex closed this discussion on 09 Dec, 2010 08:29 PM.

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

Recent Discussions

28 Mar, 2024 10:45 PM
24 Jan, 2024 08:33 AM
11 Jan, 2024 07:13 AM
30 Nov, 2023 02:07 AM
22 Nov, 2023 08:41 AM