Closed PierreZiegler closed 2 years ago
👋 @PierreZiegler thanks for reaching out. Since we direct folks to create Plans via the Control Panel, I'm curious how large of a use case this is... Can you elaborate on your workflow that results in you're needing to call plans.all for an account that has no plans?
I'm going to forward this on to the team responsible for our Recurring Billing product because we may want to surface this scenario differently, such as a validation error or 404. But if you have the time, I'd love to know more on your use case.
Wanted to provide an update, the engineering team responsible for this part of the API has merged a fix so that we're receiving an empty array when no plans exist for this type request. This should be deployed soon, so I'm going to go ahead an close this.
General information
Issue description
When trying to get all plans while not having plans create,
TypeError: Cannot set property 'success' of undefined
is thrown.My Code (from https://developer.paypal.com/braintree/docs/reference/request/plan/all):
Error:
node_modules/braintree/lib/braintree/plan_gateway.js:19-33
:So it seems like
response.plans
is not set when there are no plans.Expected Behavior
If there are no plans, I would expect an empty array
[]
or a proper error message.