#Matt11
1 messages · Page 1 of 1 (latest)
Yes, it will handle it automatically
because in my implementation it doesn't work
Can you elaborate on your current integration?
I'm basically doing this:
var stripe = Stripe('publishable_key;
var elements = stripe.elements();
var card = elements.create('card', {style: style});
card.mount('#card-element');
form.addEventListener('submit', function(event) {
event.preventDefault();
stripe.createToken(card).then(function(result) {
if (result.error) {
// Inform the user if there was an error.
var errorElement = document.getElementById('card-errors');
errorElement.textContent = result.error.message;
$('#payment-form input[type="submit"]').attr('disabled', false);
setTimeout(function () {
$("button[form='payment-form']").text($("button[form='payment-form']").first().data('originalLabel'))
$("button[form='payment-form']").attr('disabled', false)
}, 500);
} else {
form.submit();
}
});
});
with the createToken
there's a lot of documentations with different approaches, so I don't understand which one is the best way to do it.
If you can help it would be great! 🙂
That's an old integration using Token and Card Element
I would recommend migrating over the Payment Element instead: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements
As I see there's a chance to go outside the platform to confirm a 3DS, is it possibile to have the 3DS confirmation inside the same stripe form page?
Yes, if you use PaymentElement above
but here it says:
Your user may be first redirected to an intermediate site, like a bank authorization page, before being redirected to the return_url
So the user will leave the checkout page
I see, so you mean something like a modal, or an iframe?
exactly
so the user can confirm everything inside the checkout page and later I redirect him to the next page
Here are the steps to force display in an iframe inside your modal
Basically you control the redirected URL and display it yourself
very nice!! thank a lot @solemn gorge !! I'll try it