#kevin_code

1 messages ยท Page 1 of 1 (latest)

fringe dustBOT
#

๐Ÿ‘‹ 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/1423596143660761178

๐Ÿ“ 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.

void vigil
#

hi there!

old perch
#

Hello ๐Ÿ˜ƒ

void vigil
#

looks like you are using the deferred flow, where you firt mount the Payment Element, and later create the PaymentIntent?

#

in this case, you need to make sure the parameters you set on the Payment Element match the parameters on the PaymentIntent

old perch
#

What do you mean by deferred flow? ๐Ÿค”

void vigil
#

I explained it: it's when you first mount the Payment Element and then later create the PaymentIntent.

#

in the regular flow you first create the PayemntIntent, and use the client secret of the PaymentIntent to mount the Payment Element.

old perch
#

Oh yes you're right, but how do I make the param match in the deferred flow? Because I put the correct param in my Elements component but I still have the error saying the capture method is not good ๐Ÿค”

void vigil
#

can you share:

  • The parameters you set in the Payment Element
  • The exact error message you see
  • The PaymentIntent ID (pi_xxx) you created?
old perch
#

Here are the params I set:

          locale: 'fr'
          mode: 'payment',
          setupFutureUsage: 'off_session',
          captureMethod: 'automatic',
          currency: 'eur'
          amount: 8070,
          paymentMethodTypes: ['card'],
          customerSessionClientSecret: 'cuss_secret_TAPnWFFO9bX5UQByUQCgasCk4zhyOySv4l2WnUDfhEB6Yih',

The error I see: The provided capture_method (manual) does not match the expected capture_method (automatic). Try confirming with a Payment Intent that is configured to use the same parameters as Stripe Elements.

The payment intent ID: pi_3SE4yDB3HPdpxoUr0yMXn8W1

void vigil
#

I mean the error is pretty clear:

  • in the Payment Element you set captureMethod: 'automatic'
  • but in the PaymentIntent you set capture_method: "manual"
#

both parameters need to match

#

so both should be automatic or both manual.

old perch
#

I know you're right the error is pretty clear, what isn't clear for me is how to make them match because I don't know where to set the capture method, I already did it in the Elements component, haven't I?

#

And in the confirmPayment function, I can't specify the capture method

void vigil
#

what isn't clear for me is how to make them match
do you want capture method manual or automatic?

old perch
#

I want it to be automatic

void vigil
#

then:

  • don't change your Payment Element code
  • but change your backend code that is creating the PaymentIntent with capture_method: automatic
old perch
#

Ooooh okay thanks a lot ๐Ÿ™

#

You can close the thread if you want ๐Ÿ˜ƒ