#tarantino-47_error
1 messages ¡ Page 1 of 1 (latest)
đ 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.
Hi there!
Can you share the ID (req_xxx) of the failing API request?
https://support.stripe.com/questions/finding-the-id-for-an-api-request
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
Thanks for sharing.
The most interesting part is that I cant reproduce it locally.
You need to update your PaymentElement and specify capture method manual too:
https://docs.stripe.com/js/elements_object/create_without_intent#stripe_elements_no_intent-options-captureMethod
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]);
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
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
You need to debug your integration first and see if you are setting it correctly or not.
You need to validate if this section is called and updating the element or not with manual cpature
You can call the unmount function:
https://docs.stripe.com/js/element/other_methods/unmount
And create a new one and mount it
ok, thank you, but overall you think this is front end issue?
Yes, as you need to create a confirmation token with manual capture