#sai-rez_two-step-confirmation

1 messages ยท Page 1 of 1 (latest)

vestal bladeBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1235965154219397160

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

gentle rampartBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

jagged tusk
#

Hi ๐Ÿ‘‹ a Payment Method will be created automatically when processing a Payment Intent or Setup Intent. It isn't something you need to explicitly do unless you plan to use details about the Payment Method to decide whether you want to progress with processing a payment. In those scenarios, you use the flow shown in this guide to get the Payment Method details, via a Confirmation Token, first:
https://docs.stripe.com/payments/build-a-two-step-confirmation

Add an optional review page or run validations after a user enters their payment details.

acoustic hearth
#

So I am trying to update our flow from card elements to payment elements, in our current flow we pass the payment method id to our backend to use in some logic. Is it possible to still create a payment method from payment elements?

jagged tusk
#

Yes, as I mentioned, the above guide walks through that.

acoustic hearth
#

Thanks I did have a look but not sure it satisfies the use case I'm describing as if I'm understanding correctly it suggest we create a confirmation token instead of a payment method to pass to the backend, however atm our backend specifically needs a payment method as we retrieve it using the id from the frontend.

jagged tusk
vestal bladeBOT
#

sai-rez_two-step-confirmation

acoustic hearth
#

Right, so say we use the payment method to get card fingerprints or to attach to a customer, would the new flow be something like this?

  • Load elements
  • create confirmation token and send to backend
  • In backend use payment method value of confirmation token object to retrieve payment method
  • use payment method in backend logic
jagged tusk
#

Almost, the first two parts are right.

In backend use payment method value of confirmation token object to retrieve payment method
use payment method in backend logic
These parts are off, as there won't be an actual Payment Method object to use. You will use the information contained within payment_method_preview in the Confirmation Token for your backend logic.

acoustic hearth
#

Ah right, so I can see there is a fingerprint value in the card preview, could payment_method_preview be used to attach a card to a customer?

jagged tusk
#

No, you won't explicitly attach the Payment Method to your customer, that will be handled automatically by the intent you process.

acoustic hearth
#

Ok and to double check that happens when you use .confirmPayment() correct?