#chrisdaviesweb

1 messages · Page 1 of 1 (latest)

buoyant jungleBOT
fierce pier
#

Hi there, can you share with me the payment intent ID?

agile bone
#

Hi Jack. pi_3MABRJDc29ZOZKeN0vBGik6P

fierce pier
#

Yes you are right, this PI requires 3DS and the 3DS authentication was not successfully.

agile bone
#

Thank you, Jack.

#

So there isn't any need to update the following:

#

var card = elements.create('card', {
hidePostalCode: false
});

card.mount('#card-element');

card.addEventListener('change', function(event) {
var displayError = document.getElementById('card-errors');
if (event.error) {
displayError.textContent = event.error.message;
} else {
displayError.textContent = '';
}
});

var cardButton = document.getElementById("checkout_complete");

cardButton.addEventListener('click', function(event) {
event.preventDefault();

var card_name = document.getElementById('card_name').value;

stripe.createPaymentMethod("card", card, {
    billing_details: {
        name: card_name
    }
}).then(function(result) {
    if (result.error) {
        var errorElement = document.getElementById('card-errors');
        errorElement.textContent = result.error.message;
    } else {                    
        var input = document.createElement("input");
        input.setAttribute("type", "hidden");
        input.setAttribute("name", "payment-method-id");
        input.setAttribute("value", result.paymentMethod.id);
        document.getElementById("checkout_payment_form").appendChild(input);
        document.getElementById("checkout_payment_form").submit(); 
    }
});

});

fierce pier
#

This code is not complete right? I don't see any invocation of stripe.confirmCardPayment()

agile bone
#

I'm using 'createPaymentMethod' instead.

fierce pier
#

I don't think calling createPaymentMethod would trigger a 3DS flow. You still need to call confirmCardPayment to start 3DS when payment_intent status is requires_action

agile bone
#

Can you take a look at 'pi_3M9q1ADc29ZOZKeN2ydfF603' - The same code is used for this

#

3D Secure seems to be working with this code. I am using a pre-made e-commerce module, which this form submits to

#

Does the activity on these payments sit inline with how things should be?

fierce pier
#

OK. there's a possibility that the e-commerce module handles the 3DS redirect for you so that you don't need to call confirmCardPayment()

agile bone
#

Thanks, Jack. I will try and confirm with the e-commerce module developers - but in the meantime, if this payment and others are showing as '3D Secure succeeded', then is it safe to presume that everything is working as it should?

fierce pier
#

If 3DS is succeeded, the merchant can enjoy liability shift, which means when a customer files a dispute, the liability for chargeback shifts from merchant to card issuer.

agile bone
#

Great. As long as that all looks good. Thank you for your help.