Open bitemyapp opened 8 years ago
Hey, I don't think any sensitive info would be transmitted in the error messages (certainly not API keys, although maybe customer ids - but those aren't understandable). I see nothing wrong with a ToJSON
instance for StripeError
, as long as consumers of this library know that it is for convenience purposes. Since StripeErrors
can only be received from stripe. The only alternative would be to wrap StripeError
in a newtype. So yea, ToJSON StripeError
sounds good to me. :+1:
Also,
@dmjio so, do you usually make one-off API types for this sort of thing?
Stripe's APIs don't accept JSON, but return it. A NewCard
is meant to be submitted as a form url-encoded query parameter.
@dmjio oh sure, I was thinking of recycling the datatype for inputs from our SPA client, reduce petty surface area.
@bitemyapp, Ah I see, I suppose we could add To/FromJSON instances to types like NewCard
. I can see how that would fit a use case. Would need to ensure the isomorphisms hold. Want to avoid user confusion though.
@bitemyapp would you want just NewCard
? Or others as well? I assume a lot of people are probably going to want to this as well ...
@dmjio well, sorta just plugging away as I go really. Think NewCard
, SubscriptionId
, and StripeError
would cover it for now.
Sounds like the beginnings of a branch, I'll start one.
@dmjio ty ty <3
:)
Is there ever sensitive information in the StripeError value? If not, could there be a ToJSON instance? It'd spare me playing data-relay with the error since I'd just be passing the same information down to the JS client.