#Matt11

1 messages · Page 1 of 1 (latest)

lusty urchinBOT
solemn gorge
#

Yes, it will handle it automatically

lucid hull
#

because in my implementation it doesn't work

solemn gorge
#

Can you elaborate on your current integration?

lucid hull
#

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! 🙂

solemn gorge
#

That's an old integration using Token and Card Element

lucid hull
#

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?

solemn gorge
#

Yes, if you use PaymentElement above

lucid hull
#

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

solemn gorge
#

I see, so you mean something like a modal, or an iframe?

lucid hull
#

exactly

#

so the user can confirm everything inside the checkout page and later I redirect him to the next page

solemn gorge
#

Here are the steps to force display in an iframe inside your modal

#

Basically you control the redirected URL and display it yourself

lucid hull
#

very nice!! thank a lot @solemn gorge !! I'll try it