#MiaAPancake - Invoice Authentication
1 messages ยท Page 1 of 1 (latest)
When you say "customer authentication" are you referring to a process where the ownership of the Invoice is verified or are you talking about something like 3D Secure?
Also, what do you mean by "re-attaching"?
It sounds like you're asking about 3D Secure-type authentication, but the terms you're using are ones I'm not familiar with, so wanted to confirm.
I think what it's referring to is 3D Secure? it's when I create a subscription via an attached payment_method, the invoice is unpaid and "requires authentication" so I assume 3DS?
Ah, gotcha. So what do you mean by re-attaching to the Customer? A payment requiring authentication does not detach the Payment Method from the Customer.
Are you talking about the Payment Method being removed from the Payment Intent associated with the Invoice?
well so what I currently do is fetch the payment intent client secret attached to the invoice to the client if this happens and go through the normal flow of creating a payment element from the elements api, but this requires the user to re-enter the payment information, and it attaches the card to the customer again. But what I would like to do is just confirm the payment with the already attached payment_method instead of pretty much creating a new one.
Gotcha. You need to do two things:
- On your server update the Payment Intent with the Payment Method you want to use: https://stripe.com/docs/api/payment_intents/update#update_payment_intent-payment_method
- On the client with the customer present call
stripe.confirmCardPaymentand pass in the Payment Intent's client secret: https://stripe.com/docs/js/payment_intents/confirm_card_payment#stripe_confirm_card_payment-attached
stripe.confirmPayment only works with the Payment Element and requires the customer to enter new payment information, which is what you specifically want to avoid. It must be the stripe.confirm*Payment method, where * is the method of payment being used.
but from what I gather in step 1 I just have to create my own paymentintent instead of using the one provided by the invoice?
or do I have to update the one provided by the invoice?
No, you use the existing Payment Intent in step 1.
ah okay thanks for clarifying
No problem! ๐
Always happy to help!
alright I managed to do one without the card being re-created.. but the customer still has to enter the cc number etc. when I create the element, am I forgetting something?
There is no Element involved here.
๐
I just realized the confirmCardPayment takes a secret, I suppose that opens it on it's own
Yep, it uses the Payment Intent's client secret to confirm the Payment Intent client-side using the already-associated Payment Method.
No Element is involved since no new payment info is involved, it's already on there.
Yeah I get it so to do the same with iDeal would be the same but just the stripe.confirmIDealPayment method
That's actually a lot more simple than I was thinking
Yep!
Thanks again, I tend to over complicate things in my head hehe