#eradicatevu - update PI
1 messages · Page 1 of 1 (latest)
Thanks.
No there's not a way to do this unfortunately. You can add your own field that would call the back-end and update the PaymentIntent. From there, you would have to tear down and rebuild the payment element for it to reflect the new price though
Okay. Yes I knew it was possible through the actual payment intent. I'm just not sure whether it's okay to temporarily store the paymentIntent on the client side? Currently the way I have it working is to: create a paymentintent and then return the clientSecrent and the paymentIntent to the client, then when our "place order" form is submitted the actual total is recalculated and we update the payment intent on the serverside. Then we go back to the client to complete the charge using the clientSecret. It works, but i'm not sure if its right?
Or can we update the paymentIntent using the clientSecret on the server side? that way I wouldn't have to store paymentIntent on the client side.
There's no issue storing the PaymentIntent ID (pi_123) on the client side
It's not sensitive data
Oh okay, we'll that would make things easier.
The only other way I could think of was, like you said, rebuilt the payment element. Is there a way to cancel a clientSecret (paymentIntent) from the client secret or it is okay to have 10s or 100's of incomplete paymentIntents that will never be completed? I think they dissappear eventually?
It would be easy to just recreate the element, but i know we will see lots of incomplete payment intents on our dashboard.
Hello! It's okay to have Payment Intents that will never be completed. Some people use those to track conversion rates and things like that. However, in your case, it sounds like you might be creating more Payment Intents than are required? The idea of a Payment Intent is that it's designed to track a single person's intent to pay you. If the amount changes you would change the amount on the existing Payment Intent, not create a new one.
Incomplete Payment Intents do not disappear, they stick around forever. I believe you can filter them out in the Dashboard though.