#chung-yi_best-practices

1 messages ¡ Page 1 of 1 (latest)

rancid smeltBOT
#

👋 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/1352696989367926814

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

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.

real belfry
#

For more details, our previous flow works like this:

  • [client] Tokenize the card
  • [server] stripe_customer.sources.create(source: token)
  • [server] Stripe::PaymentIntent.create(payment_method: credit_card_id)
#

I wonder if the answer is to create a setup intent in step 1.

frank pendant
#

Hi, your understanding is correct. What is your business use case exaclty so I can better assist?

real belfry
#

After the step of collecting payment method details, we are already able to persist the payment method in our system (e.g. for future use), even when the buyer drops off and does not finish checkout.

#

Is the solution with Confirmation Token now to create a setup intent (which will create the payment method) right away when we want to persist it?

frank pendant
#

So this flow, https://docs.stripe.com/payments/build-a-two-step-confirmation is specifically for use cases where you attain additional informaiton after collecting the payment method to then decided to either use or ask for a new payment method.

Your flow is specifically is looking to accept a payment and the save the payment method for future use. I do not think you'll necessarily need to use that two step approach.

We document this flow: https://docs.stripe.com/payments/accept-a-payment?platform=web&ui=elements and here is how you can specify to then save the payment method: https://docs.stripe.com/payments/accept-a-payment?platform=web&ui=stripe-hosted#save-payment-method-details for future use

real belfry
#

In our case, it's more similar to the 2-step confirmation. We ask buyers to add a payment method first, review details later, and then at the end submit the payment.

#

We don't want to wait until the end (submission) to create the payment method (when we create a payment intent and provide the confirmation token) because payment methods provided in the previous step will be lost if buyers don't finish submission.

#

To create and save the payment method early, I wonder if we have to create a setup intent.

frank pendant
#

I see. Yeah, in that case you'd need to use SetupIntents

real belfry
#

Yeah, now I think about it setup intent makes sense too. Thank you for talking through it!

frank pendant
#

Sure