#MarkyMark

1 messages · Page 1 of 1 (latest)

midnight pilotBOT
tepid rover
#

Not sure but am checking in to this and will get back to you

tepid rover
#

@primal harness apologies for dropping off this. As far as I can tell this should be a valid parameter for that call. Are you using our official react-stripe-js library or is something else? https://github.com/stripe/react-stripe-js

primal harness
#

yes, that's the one i'm using

tepid rover
#

And the code is erroring out if you try to provide the client secret? Or is this more about the IDE not recognizing it?

primal harness
#

react-stripe-js version "1.16.4"

#

these are the only definitions i see for confirmSetup

midnight pilotBOT
tepid rover
#

Ah I wonder if it is a version issue. The functionality that uses the clientSecret param is relatively new so it may have been added in a later version

primal harness
#

v1.50.0

tepid rover
#

Thank you! Was just starting to look through the releases

#

So that is good that it is a minor version upgrade at least. It should be relatively easy to upgrade if you are looking to use that flow

primal harness
#

do you know if it will use the new secret

#

if an old one is specified in elements?

#

or will i still need to re-render elements?

#

docs say "required unless a secret is specified in elements" but it is not clear what will happen if the flag is passed AND one is specified in elements

#

which one will be used

tepid rover
#

Taking a step back, can you tell me what you are trying to do here?

#

Why are there two intents?

#

I think the intention is one or the other, not sure if we support an override like this, but there may be a simpler solution.

primal harness
#

ok, how do i create elements in react without a secret?

#

the case is: the intent succeeds but something on our BE fails, so we keep the page up and want to submit another intent if the user changes their card.

#

so i need to create another setupintent, and use that new secret

tepid rover
#

This is the deferred intent guide that this param was added for: https://stripe.com/docs/payments/accept-a-payment-deferred
You can now specify the shape of the intent before rendering the element

  const options = {
    mode: 'payment',
    amount: 1099,
    currency: 'usd',
    // Fully customizable with appearance API.
    appearance: {/*...*/},
  };

  return (
    <Elements stripe={stripePromise} options={options}>
      <CheckoutForm />
    </Elements>
  );
};
#

I am still a bit unclear on your use-case, what is going wrong on the BE where need to create another intent?

#

If the intent has already succeeded, it should be possible to use the PaymentMethod that it created. So this may be more of a question of recovery logic

primal harness
#

i see, ok so the main issue is that i need to upgrade so i init elements without the secret and then pass it in later. perfect. thanks!

tepid rover
#

Yes, and that doc shows it with payment intents but you can do the same thing with setup intents. I thought we had a doc for deferred Setup Intents but am not finding it. Let us know if you have any questions when adapting that

primal harness
#

i didn't even know deferred intents was an option.