#ashish_best-practices

1 messages ¡ Page 1 of 1 (latest)

neon heartBOT
#

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

📝 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.

north jay
#

This document is doing the same thing.

It's creating a subscription first and then using client secret to collect the payment
subscription.latest_invoice.payment_intent.client_secret

#

What I want is opposite, collect the payment and create the subscription afterward.

modern grove
#

That doc collects payment details and doesn't create subscriptoin until the customer submits the form

#

Why does that not work exactly?

#

Do you need to run server side validations on the payment method or something prior to creating the Subscription?

north jay
#

what I don't understand is the flow after customer submits the form

#

where do I exactly get the details like success or failed, and after success create subscription

modern grove
#

You would get basic card/format validations in:

  const {error: submitError} = await elements.submit();
  if (submitError) {
    handleError(submitError);
    return;
  }```