Constants for possible decline_codes
Is there a place with constants of all the possible decline_codes, such that a consumer is able to use them without specifying a literal?
https://github.com/stripe/stripe-java/blob/f773212886e7da424e4d8ed7eb9c34e905646c5f/src/main/java/com/stripe/model/StripeError.java#L29
@eaglerainbow At the moment all enums or enum-like properties are represented as String in the library. We would like to add support for enums in the future so that all possible values are in the library but it requires some design decision before moving in that direction.
Decline codes are not in the library for that reason and you would need to build your own list instead.
Tagging as future as this is definitely something we want to tackle at some point though.
We would like to add support for enums in the future so that all possible values are in the library but it requires some design decision before moving in that direction.
Tagging as future as this is definitely something we want to tackle at some point though.
That's okay with me. Thanks for letting me know!
Upvoting since we would have the same request for Subscription.status, for example.
Reading the javadoc on the property:
Possible values are
incomplete,incomplete_expired,trialing,active,past_due,canceled, orunpaid.
It would be easier to just have this gathered under an enum.
Not sure why you closed the issue though, if it's not resolved?
Re-opened to make it easier to track in that case. We are definitely looking at how to support enums in our client libraries properly. This won't happen in the short term but it's on our roadmap!