#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/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.
- tarantino-47_error, 3 days ago, 27 messages
๐ happy to help
hello
just an fyi, this thread contains additional info
I came up with a solution and want to consult with you
if you want to use capture_method: 'manual' on the backend
you also need to pass https://docs.stripe.com/js/elements_object/create_without_intent#stripe_elements_no_intent-options-captureMethod manual on the FE
why?
then I update it manually
elements.update({
mode: 'payment',
paymentMethodTypes: allowAffirm ? ['card', 'affirm'] : ['card'],
amount: formatPlatformPayPrice(amount),
captureMethod: isManualCapture ? 'manual' : 'automatic',
});
yes that's also one way to do it
I have a lot of payment flows, I use shared component for them
ok
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?
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
yes, I retrieve billing address from confirmation token, correct
let me know if you have any concerns for this approach
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
I'm not sure that's necessary
you can instead wait for the update-end event https://docs.stripe.com/js/element/events/on_update_end
before creating the Confirmation Token
will try
basicaly is it ok to create multiple confirmation tokens from the same single elements?
I think so, yes, never tried it before though
these confirmatino tokens won't be saved anywhere, right?
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?
they create a ctoken_xxx object https://docs.stripe.com/api/confirmation_tokens
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?
no
is it possible to check which capture method was used while creating a confirmation token?
yes
ok, thank you!
you can check the elements object