#chip

1 messages ยท Page 1 of 1 (latest)

dusky wrenBOT
verbal gyro
#

Hello ๐Ÿ‘‹
Are you implementing Separate Charges and Transfers flow?

elfin holly
#

Yes.

verbal gyro
#

Happy to answer any follow up questions you might have

elfin holly
#

Ah, okey, nice. Failed to read that section last time ๐Ÿ˜„

Btw, I read a bit about paymentIntents and that the recommendation was to only create one paymentIntent per order. As of right now, we create a new paymentIntent each time the customer goes to our checkout page. Since there aren't any expiry on a paymentIntent, as far as I can see, only a way to cancel them, is the current way of handling it a optimal way? From what I see it just ends up in a lot of incomplete payments lol

#

Although we store the paymentIntent id and clientSecret in our db with related product data, and a isActive column to "handle" expiry. Just trying to understand if there's any other best practices except what you recommended from paymentIntent api docs

verbal gyro
#

You could create the PaymentIntent when the customer is about to checkout instead. Until then keep the product info in your cart (localStorage or similar) & when they click checkout, that's when you create the PaymentIntent for the cart total

elfin holly
#

Yes, that's exactly what happens now ๐Ÿ˜„ I meant checkout page as the actual checkout ๐Ÿ™‚

#

but we should probably find a way to cancel those intents after a period of time imo

#

Is there any specific reason to why there is no expiry date on these intents?

verbal gyro
#

The intents are supposed to be reused, even in case of declines ๐Ÿ™‚ Some of the declines occur after ~days for delayed notification payment methods

#

incomplete payment intents are not going to affect your integration as such really.

However, you can create a script to list and cancel the PaymentIntents that were created some time ago
https://stripe.com/docs/api/payment_intents/list
https://stripe.com/docs/api/payment_intents/cancel

elfin holly
#

Yeah, alright! Thanks, this gives me some more clarification on how to handle certain things ๐Ÿ˜„