#tarantino-47_error

1 messages ¡ Page 1 of 1 (latest)

sharp bisonBOT
#

👋 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/1351829620122718241

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

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.

rancid geyser
#

hello, so yesterday stripe support team member was not able to reproduce this. But here's the thing

stuck meadow
#

Hi, let me help you with this.

rancid geyser
#

I display Payment Element to a user, at this point captureMethod is automatic.
Then user fills in his new credit card details
Then I change captureMethod to manual
The error pops up

stuck meadow
#

Then I change captureMethod to manual
How do you do that exactly?

rancid geyser
#

I do set the same captureMethod on PI on the BE while creating it

#

const elements = useElements();

if (typeof isManualCapture === 'boolean') {
elements.update({
captureMethod: isManualCapture ? 'manual' : 'automatic',
});
}

stuck meadow
#

At which point do you get the error exactly?

rancid geyser
#

after stripe confirm

#

I also have options.paymentMethodCreation = 'manual'; just an fiy

stuck meadow
#

So when you create the PaymentIntent, correct?
You probably update the captureMethod on the Payment Element, but don't forward the new value to the backend when you're creating the PaymentIntent.
Could you please share the relevant backend code?

rancid geyser
#

you know what, I think I found the issue, thank you

#

hm

#

turned out I didn't find the issue yet

#

here's request log id:
req_mDN8EpnXIZMVut?t=1742372615

stuck meadow
#

Yes, I see that you're creating the PaymentIntent with capture_method=manual, but it seems like the Payment Element was created with the default value of captureMethod, which is automatic.
Again, as I said, you need to make sure the values are exactly the same in both places.

rancid geyser
#

that's true, Payment Element was created with the default value of captureMethod, which is automatic.

#

hm I call await elements.submit(); first and then trying to update the elements options. I think that could be the reason

stuck meadow
#

You need to go over your code and make sure you provide the same values in all cases.

rancid geyser
#

// here I create confirmation token
const {
error: stripeConfirmationTokenError,
confirmationToken,
} = await stripe.createConfirmationToken({ elements });

// here I confirm the Payment
const { error: stripePIError, paymentIntent } = await stripe.confirmPayment({
clientSecret,
confirmParams: {
confirmation_token: confirmationToken.id,
return_url: typeof window !== 'undefined' ? window.location.href : 'https://app.usmobile.com',
},
redirect: 'if_required',
});

#

do you know if there any place where I can pass "captureMethod"?

#

I know that's probably not, but was just wondering.

stuck meadow
#

It's not here.
It's when you create the Payment Element on the frontend and create the PaymentIntent on the backend.

rancid geyser
#

yea, I know, I thought these methods also accept that

#

ok, nevermind, I got you, thanks again

stuck meadow
#

Happy to help.