stripe-java icon indicating copy to clipboard operation
stripe-java copied to clipboard

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

Open Dretch opened this issue 4 years ago • 3 comments

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!

Dretch avatar Jan 29 '21 14:01 Dretch

@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!

remi-stripe avatar Jan 29 '21 16:01 remi-stripe

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.

michael-agilesrc avatar Jun 16 '22 12:06 michael-agilesrc

@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.

remi-stripe avatar Jun 16 '22 23:06 remi-stripe