Skip to content

How does one form the data to create a subscription with add-ons? #7

Description

@erichjrusch

For example,

I am trying to create a plan with multiple add-ons using node-recurly:

    var subscriptionData = {
           plan_code : planCode,
           account   : {
             account_code : organizationId,
             email        : accountInfo.email,
             first_name   : accountInfo.first_name,
             last_name    : accountInfo.last_name,
           },
           currency  : "USD",
           subscription_add_ons : [
             {
               subscription_add_on : {
                 add_on_code : "sfd-pack0001"
               }
             },
             {
               subscription_add_on : {
                 add_on_code : "bmi-pack0001"
               }
             }
           ]
         };

However it looks like js2xml treats the child nodes of subscription_add_ons as anonymous so the appear like so in the request:

<subscription_add_ons>
  <item>
    <subscription_add_on></subscription_add_on>
 </item>
  <item>
    <subscription_add_on></subscription_add_on>
 </item>
</subscription_add_ons>

I can make this work with one add-on only by doing a hash of hashes, but I'm not entirely sure what the correct way to do this is.

Any ideas? Are multiple add-ons not supported with this package?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions