stripe-node
stripe-node copied to clipboard
Expose constants
Would it possible to expose constants on the relevant API endpoints (or in its own namespace)? For example:
stripe.constants.subscriptionStatuses = {
TRIALING: 'trialing',
ACTIVE: 'active',
PAST_DUE: 'past_due',
CANCELED: 'canceled',
UNPAID: 'unpaid',
};
This would make defining and maintaining such constants yourself unnecessary.
Hi @adamreisnz! This is a reasonable request, however our experience with other libraries has shown that it's fairly difficult to define those constants and keep them up-to-date manually. We do plan to add this in the future, but we want to do it in an automated manner.
I can't provide any ETA yet, but I'll leave this issue open and tag it as future
. We'll update here as soon as we have something to share.
Great thanks. Yes, you can imagine then how difficult it is for developers to keep the constants up-to-date and stay on top of any changes that occur. I thought if it's done in the official Stripe libraries at least it's closer to the source and probably better to have it concentrated in one place.
Going to close this one as the library has had Typescript definitions for a long time now which should mostly solve that problem: https://github.com/stripe/stripe-node#usage-with-typescript