Refactor form encoding#857
Conversation
|
r?+ @richardm-stripe |
9a8a16d to
df698a3
Compare
|
With the "I am not a Java programmer" caveat this seems sensible enough to me and the test suite seems thorough. Obviously passing something cyclical will make this blow up. |
As obvious as it is, I hadn't considered it before 😂 I think that would qualify as a user error and we don't need to go out of our way to catch it, but at the same time it might not be too hard to track the references we've already seen while flatting the parameters to make sure we're not processing the same reference twice. I'll give it a try. |
|
Merging this into a temporary integration branch for now. |
r? @brandur-stripe @remi-stripe
cc @stripe/api-libraries
Refactors how the library handles form encoding, by moving all form encoding related methods out of
LiveStripeResponseGetterand into a new utility classFormEncoder.This is similar to the architecture we use in stripe-dotnet.
The code itself is also very similar to stripe-dotnet, but stripe-dotnet's code was also based on stripe-java, so all in all it's not too different. The new code is a bit more clean and supports encoding a few more types that we didn't before (
Date, enums, arrays of primitives).None of the methods i removed from
LiveStripeResponseGetterwere public, so this is not a breaking change.