#tarantino-47_error

1 messages ยท Page 1 of 1 (latest)

rigid micaBOT
#

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

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

fast patrol
#

๐Ÿ‘‹ happy to help

terse dust
#

hello

#

just an fyi, this thread contains additional info

#

I came up with a solution and want to consult with you

fast patrol
#

if you want to use capture_method: 'manual' on the backend

terse dust
#

yes

#

so I render Payment Element in React without any manual_capture params first

terse dust
#

then I update it manually

        elements.update({
          mode: 'payment',
          paymentMethodTypes: allowAffirm ? ['card', 'affirm'] : ['card'],
          amount: formatPlatformPayPrice(amount),
          captureMethod: isManualCapture ? 'manual' : 'automatic',
        });
fast patrol
#

yes that's also one way to do it

terse dust
#

I have a lot of payment flows, I use shared component for them

fast patrol
#

ok

terse dust
#

so heres the thing

#

when a user uses Google pay or Apple pay I need to retrieve his billing address from Gpay first, then I pass that address along with other user form data to my backend.

so I render the form with no client secret
if the given payment flow urlshould use manual_capture - I update the stripe form
user fills out stripe payment element form and clicks submit
then I do await elements.submit();
then await stripe.createConfirmationToken({ elements });
then retrieve billing address and send it to my BE
BE returns clientSecret and payment intent id
I confirm PI with the confirmation token I created

#

sometimes this doesn't work, like in 5% of our payments.
I want to create a sefeguard, where if the payment failed I'll re-create confirmation token and re-confirm the payment intent.
what do you think?

fast patrol
#

when a user uses Google pay or Apple pay I need to retrieve his billing address from Gpay first, then I pass that address along with other user form data to my backend.
but they get automatically sent via the confirmation token

terse dust
#

yes, I retrieve billing address from confirmation token, correct

terse dust
fast patrol
#

what are your concerns?

#

I'm failing to understand what you're trying to validate

terse dust
#

let me explain

#

so the thing is sometimes the payment element is not being updated with needed capture method properly.
in this case I want to do following:

re-update elements like this again: elements.update({ captureMethod: 'manual' });
re-create confirmation token like this: stripe.createConfirmationToken({ elements })
re-confirm the payment intent using fresh and properly configured confirmation token

fast patrol
#

I'm not sure that's necessary

#

before creating the Confirmation Token

terse dust
#

will try

#

basicaly is it ok to create multiple confirmation tokens from the same single elements?

fast patrol
#

I think so, yes, never tried it before though

terse dust
#

these confirmatino tokens won't be saved anywhere, right?

fast patrol
#

they are saved

#

otherwise how would you be able to use them?

terse dust
#

sorry, I meant, if I create 4 confirmation tokens, but confirm payment intent using the only one. the only one will be saved ot 4?

fast patrol
terse dust
#

I see

#

even if i don't use it , confirmation token will be saved anyways, got it

#

is possible to not save them, just wondering if there is such an option. I think not, right?

fast patrol
#

no

terse dust
#

is it possible to check which capture method was used while creating a confirmation token?

fast patrol
#

yes

terse dust
#

ok, thank you!

fast patrol
#

you can check the elements object