recurly-js icon indicating copy to clipboard operation
recurly-js copied to clipboard

getting all existing planAddons does not seem to work

Open arupadhy opened this issue 5 years ago • 0 comments

I am trying to write some test in our code base to fix the way we do billing using recurly..started writing some tests and stumbled on the call to get all addons configured in recurly.

getting list of plans works fine.

Here is the code

const Recurly = require('recurly-js/promise'); const defaultConfig = { API_KEY: process.env.API_KEY, SUBDOMAIN: process.env.SUBDOMAIN, ENVIRONMENT: 'SANDBOX', DEBUG: true }; const recurlyPromise = new Recurly(defaultConfig);

async function getRecurlyPlans() { return recurlyPromise.plans.list(); }

async function getRecurlyPlanAddOns() { return recurlyPromise.planAddons.list(); }

using recurly-js ^3.2.0 version here is the log for getRecurlyPlanAddOns() call

{ host: 'wickr-qa.recurly.com', port: 443, path: '/v2/plans/function (err, value) {\n if (promise === null) return;\n if (err) {\n var wrapped = wrapAsOperationalError(maybeWrapAsError(err));\n promise._attachExtraTrace(wrapped);\n promise._reject(wrapped);\n } else if (!multiArgs) {\n promise._fulfill(value);\n } else {\n var $_len = arguments.length;var args = new Array(Math.max($_len - 1, 0)); for(var $_i = 1; $_i < $_len; ++$_i) {args[$_i - 1] = arguments[$_i];};\n promise._fulfill(args);\n }\n promise = null;\n }/add_ons', method: 'GET', headers: { Authorization: 'Basic NzAxMTE2Yjg0MmE5NGM3Y2E2MDdlZGRkNDQyYzNjYWI=', Accept: 'application/xml', 'Content-Length': 0, 'Content-Type': 'application/xml; charset=utf-8', 'User-Agent': 'umayr/recurly-node/3.2.0' } }

arupadhy avatar Jun 12 '19 18:06 arupadhy