#_cho

1 messages · Page 1 of 1 (latest)

cyan sphinxBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

  • _cho, 34 minutes ago, 8 messages
pale crane
#

Hello

#

Sounds like you are using your own form to collect this data here?

#

Instead of using Stripe Elements?

tranquil delta
#

Yes, we already have styled elements which collect and validate the data. in the front-end

#

It does not validate payment information, it just validates that the data is provided in the right format

#

I think I am confused regarding the lifecycle of the setup Intent.

When my component mounts I create:
const stripe = useStripe()

in order to prepare to make the setupIntent and I read that I should use
stripe.confirmSetup(options)
to create the setup intent, but I am unsure where the API call should be made that is mentioned here: https://stripe.com/docs/api/setup_intents

pale crane
#

Yeah you can't do that

#

You can only use Stripe.JS with Stripe Elements

#

Not when collecting raw card data yourself.

#

You really shouldn't be handling this in your own components as then you are outside of the PCI Compliance that Stripe provides you

#

And you will have a heavy PCI burden

#

The only way to submit that card data that you collected in your own components is to do it server-side and you have to get approval through our Support team to do that as well.

#

Really you should just use Stripe Elements

tranquil delta
#

Okay, I'm in alignment to use the stripe elements liek so

pale crane
#

Oh

#

You are already using Stripe Elements

#

Okay

#

Then you use confirmCardSetup() here, not confirmSetup() since you are using Split Elements and not Payment Element

tranquil delta
#

Perfect, this leads to my bigger question, which is the client secret. I've tried reading up in the docs about the client secret

#

It told me that I have to make a Payment Intent and then extract the client secret from it

#

But I am trying to make a setup intent instead

pale crane
#

Yep that's fine

#

A SetupIntent generates a client_secret as well

tranquil delta
#

okay, so I think my confusion is:
stripe.confirmCardSetup(clientSecret,data?,options?)

this method you linked to me creates a setupintent

#

then what do I put for the clientSecret parameter?

pale crane
#

No that method confirms a SetupIntent

#

You create the SetupIntent in your backend

tranquil delta
#

Ahh I see

#

That makes more sense to me now

pale crane
#

👍

tranquil delta
#

Thank you so much