#pbj

1 messages ยท Page 1 of 1 (latest)

peak heronBOT
willow socket
#

Hello ๐Ÿ‘‹

  1. Know when it's been successful vs not
    You can retrieve the SetupIntent using the API in order to check its status manually
    https://stripe.com/docs/api/setup_intents/retrieve

Is succeeded the only state that lets me know its been used?
This status shows that the setup was successful. It may have other statuses such as the ones mentioned here which might show that usage of this SetupIntent has been attempted previously
https://stripe.com/docs/api/setup_intents/object#setup_intent_object-status

  1. Generate a new one if necessary?
    Catching up on your previous thread for more context.. hold on..
zinc tangle
#

Oh easy!

@willow socket to clarify:

  1. I can retrieve an existing Setup Intent
  2. Check if its been used already.
  3. If it has been used, create a new one.
  4. If it hasn't been used, good to go.

Separately, will users ever have more than one unused setup intents?

willow socket
#
  1. I can retrieve an existing Setup Intent
  2. Check if its been used already.
  3. If it has been used, create a new one.
  4. If it hasn't been used, good to go.
    Yup!

Separately, will users ever have more than one unused setup intents?
They could if they leave the flow in the middle, but it really depends on your integration.

zinc tangle
#

Ah okay. So for us that could be the case. Basically we create the customer and as soon as we have relevant info we create a setup intent.
Is there any risk to having multiple?

willow socket
#

No risks ๐Ÿ™‚

zinc tangle
#

oh you can cancel them!!! amainzg

#

Last question (hopefully)

@willow socket is it preferred to use the list or retrieval API for setup intents? Mostly asking as the list API doesn't require a publishable key

willow socket
#

is it preferred to use the list or retrieval API for setup intents? Mostly asking as the list API doesn't require a publishable key
It depends on where (client-side or server-side) you need access to this information really. Additionally, Retrieve API will only return one object as a result vs List API is equipped to return multiple objects

zinc tangle
#

ahh okay. Does the Retrieve API make any "smart" decision on which Intent to return if there are many? Sorry for all the extra questions!

willow socket
zinc tangle
#

you're the thank you!