#sai_rez-element
1 messages · Page 1 of 1 (latest)
Hi!
now the client secret is required to be added to the Elements wrapper outside of the submit handler
That's true, you need to create the SetupIntent before showing the Payment Element
if a user failed payments for whatever reason, would they require a new setup intent to be created?
You can create a new use, or use the existing one. It's doesn't really matter.
So if a user fails SCA for e.g. and wants to try again it;s okay to use the same setupIntent?
Yes absolutely.
Also, with confirmCardSetup, we are passing in other details such as billing details. with confirmSetup how would we pass that information?
billing details are automatically collected by the Payment Element, so there's nothing to do.
if you want to pass additional information, you could use this: https://stripe.com/docs/js/setup_intents/confirm_setup#confirm_setup_intent-options-confirmParams-payment_method_data
Thanks, and finally, last question is regarding the return_url param, we don't redirect with our existing setup, can we still keep a similar UX or does the PaymentElement redirect to a new tab?
when calling confirmSetup the return URL is mandatory. so users will be redirected when the payment succeeds.
During the payment process does the user get redirected somewhere?
hi @ashen halo I'm taking over for @sonic grail
depending on the payment method user might get a popup for 3DS (in the case of cards) or to confirm their payment method (connecting to bank etc.)
other than that the user would not be redirected away from your page until the success
Thanks for that
One last question, is there a way to check that all fields have information, we've CardInputs we had handlers on the onChange prop which we could get values, is the same possible with PaymentElements?
do you mean validation?
Yes, currently we only enable our submit button once all information is complete as we can get access to those values with CardInput, could the same be done with PaymentElement?
you should be able to use https://stripe.com/docs/js/element/events/on_change?type=paymentElement#element_on_change-handler-complete for that!