#Jokezor-deletecards
1 messages · Page 1 of 1 (latest)
@compact quest SetupIntents have nothing to do with deleting cards. But yes you always generate a new one to add a new card
they're not persistent or anything and you don't need to save them after they're completed. You create one, confirm it to accept a card and save it, then that's it! If you want to save a new card in future it's an entirely new SetupIntent.
I see.
But if I want to setup a new card, do I need to do something more than creating a new setup intent for the customer?
(I want to show clearly to our users what is saved and not have stray data lying around)
Should I first detach and then create a new setup intent?
sure, if you want to replace their one saved card with one new one then you can detach the existing one and then add a new card via a SetupIntent
I'd probably do it after the second SetupIntent succeeded though, so you don't end up with a case where you detach the existing one but the second SetupIntent was abandoned and now the customer has nothing
I see.
Also what I've done previously is to save the SetupIntent in the backend.
But rather I should also save the Customer separately to not create a new customer for each SetupIntent since they should be 1 to 1 with our customers.
Thanks a lot. I'll get to clean up our flow 😛
you never need to store SetupIntents