#tarantino-47_error

1 messages ¡ Page 1 of 1 (latest)

slate tulipBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1383012233696645180

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

west terrace
modern lark
#

I confirm Payment Intent using confirmation token I created in the beginning like this:

      const { error, paymentIntent } = await stripe.confirmPayment({
        clientSecret,
        confirmParams: {
          confirmation_token: confirmationTokenRef.current?.id,
          return_url: window.location.href,
        },
        redirect: 'if_required',
      });
#

req_TJ9fJSMss14hyh

west terrace
#

Thanks for sharing.

modern lark
#

The most interesting part is that I cant reproduce it locally.

west terrace
modern lark
#

yea, I tried this. But the thing is it works fine locally.

#

is there anything you can recommend me?

#

this is how I update Payment Element on the FE:

  useEffect(() => {
    const isManualCapture = manualCaptureEndpoints.includes(paymentIntentUrl);
    if (elements) {
      elements.update({
        captureMethod: isManualCapture ? 'manual' : 'automatic',
      });
    }
  }, [paymentIntentUrl, elements]);
west terrace
#

Have you had a chance to debug your integration and see if it's really passing manual capture ?

#

Probably it's not updated.

#

Because the confirmation token is create with automatic capture

#

req_oXztkJERrY4DfF

modern lark
#

I didn't set up any logging for this part in prod yet.

#

just an fyi, I initialize stripe like this

const stripePromise = loadStripe(appConfig.stripeKey);
const options = {
  currency: 'usd',
  loader: 'always',
  mode: 'setup',
};

and then update it later if the UI flow needs manual capture

west terrace
#

You need to debug your integration first and see if you are setting it correctly or not.

west terrace
modern lark
#

ok

#

is there a way to reset Payment Element completely?

west terrace
#

And create a new one and mount it

modern lark
#

ok, thank you, but overall you think this is front end issue?

west terrace
#

Yes, as you need to create a confirmation token with manual capture

slate tulipBOT