beam-community / stripity-stripe

An Elixir Library for Stripe
Other
965 stars 344 forks source link

[Question] How to guarantee order of body params #808

Closed patrickberkeley closed 1 year ago

patrickberkeley commented 1 year ago

We're using Exvcr to test our stripity-stripe integration. Due to changes around maps in OTP 26, the order of params in the stripity-stripe request body has changed. This breaks all of our exvcr cassettes, and as far as I understand is not idempotent and can change from one invocation to the next.

Looking at this from the exvcr side, there is a pull request that addresses this if the body is a map by checking for the presence of each param instead of a string match. Stripity-stripe's body is an already serialized string so the only thing that could be matched on is & which seems brittle / error prone.

Do you have any suggestions on how to guarantee the request body is the same from one execution to the next on the stripity-stripe side?

patrickberkeley commented 1 year ago

We're going to address this downstream in exvcr since query param order shouldn't matter in a request.