Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Preserve metadata key order in PaymentIntentCreateParams (and similar classes) #1178

Open
Dretch opened this issue Jan 29, 2021 · 4 comments
Labels

Comments

@Dretch
Copy link

Dretch commented Jan 29, 2021

I have recently changed some code so that it no longer uses PaymentIntent.html#create(Map) and instead uses PaymentIntent.html#create(PaymentIntentCreateParams).

This latter is a bit more type-safe, which is nice.

I have noticed however, that the order of the metadata keys is no longer being maintained. I am passing a LinkedHashMap to putAllMetadata but the Builder uses HashMap internally so the order is lost.

This means the keys show up in the Stripe dashboard in a semi-random order, which is not very pretty.

Using the first API, that takes a Map, then the metadata key order is indeed preserved, and the Stripe dashboard is easy to read.

My feature request is therefore: make the two APIs consistent and use a LinkedHashMap or similar so that it is possible to set the metadata key order regardless of API being used.

Thanks!

@remi-stripe
Copy link
Contributor

@Dretch Thanks for reaching out! I can't promise we'll fix this as we conceptually never guarantee ordering of metadata in the API today but I agree that the fix should be straightforward enough that it is likely worth trying at least! We'll look into it!

@michael-agilesrc
Copy link

I wanted to follow up and see if there have been any updates in regards to this issue? I'm also using PaymentIntentCreateParams with putAllMetadata to add metadata to my payment intent, and I was hoping to have the ordering preserved on the stripe dashboard.

@remi-stripe
Copy link
Contributor

@michael-agilesrc It's unlikely to be something we'll tackle in the near future at least as it's almost never asked and we have a really large list of improvements we want to get to.

@ved-asole
Copy link

Hi @remi-stripe, is this something which I can work on? As per my understanding. I see that we just need to use LinkedHashMap interally than using HashMap for storing all our metadata values/objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants