#Ludvig-element-clientSecret

1 messages ยท Page 1 of 1 (latest)

silver depot
#

Hi there ๐Ÿ‘‹ yes that is correct, there isn't currently a way to change clientSecret on the fly.

dim field
#

Alrighty! Thanks ๐Ÿ™‚

#

What about the stripe promise?

#

If I remove and add the <Element> provider in order to set a new clientSecret, can I give the same stripe promise?

silver depot
#

Sorry for the delay, had to confirm with a teammate, yes you can reuse the stripe promise.

dim field
#

Everytime my client's cart changes, I'm creating a new paymentIntent and reload my <Elements> provider including everything in it.
This is a workaround to stripe not currently having a smooth way of updating a paymentIntent with a new price amount.

However, this bombards my payments under the dashboard with new paymentIntents everytime someone make a change in the cart (although only while on my checkoutpage).

What can I do about this? Should I just live with it? It enables the functionality that I want but it's the drawback of logging of so many new paymentIntents that I'm wondering if I can do anything about?

#

Thinking about it, I think there might be something I can do on my side (to atleast make them fewer)

silver depot
#

Yeah, I ended up with something similar in my test account when I was building my demo of the new Payment Element. Had it render on page load and it flooded my account with incomplete Payment Intents. They didn't hurt anything except my sanity when I was going through the dashboard. I ended up putting the element rendering behind a button, but that makes the flow a little less seamless so it ends up being a trade-off where you have to decide what works best for you.

dim field
# silver depot Yeah, I ended up with something similar in my test account when I was building m...

So you've been through the exact pain ๐Ÿ˜› Alright, yeah, I think I will put it behind a paymentMethod radio-button to select stripe as payment method and only then create a new paymentIntent.
It would be nice if in the dashboard, there was a way to see client sessions, so a client session can have many paymentIntents, but then you know it's the same client creating them and then you could see shopping done by a single session instead (paymentIntents failed and succeded). If that makes sense