#sushbhat

1 messages · Page 1 of 1 (latest)

wicked caveBOT
cyan lantern
#

Hi could you elaborate a bit more? Which race condition specifically?

heavy obsidian
#

Lets say we get 2 build payment intents at same time for 2 different stripe accounts, if we change the Stripe.key at env level it could effect one request if its also in progress same time

cyan lantern
#

Not sure why you need 2 accounts here, but creating a PaymentIntent shouldn't take that much time.

#

What could be in progress?

heavy obsidian
#

its a business usecase due to which we are supposed to have 2 accounts.. yes I mean in general it should be fine but there is some latency right for the request to reach stripe create payment intent and getback a response and any other API level processing additionally we do.. so there could a rare corner case where this race condition could occur

cyan lantern
#

I would say you want to wait until the PaymentIntent creation API returns a response before switching over another key. But safer maybe you want to have 2 threads/process runs with 2 keys separately

heavy obsidian
#

is there anyway to send key at request level?

cyan lantern
#

Yes

heavy obsidian
#

we are using PaymentIntentCreateParams.builder() is it possible to pass in that?

cyan lantern
#

The link above is for Connect. If you don't use Connect I would recommend ignore it since you will be confused

heavy obsidian
#

request options isn't supported for normal payment intent?