#ebellotpu6_code

1 messages ¡ Page 1 of 1 (latest)

shell saddleBOT
pallid canopyBOT
#

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.

shell saddleBOT
#

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

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

shy dawn
hexed juniper
#

sorry

#

Can I create like this, and then when the user fill the payment method and I call my API to get the clientSecret, add it to the elementOptions without loosing the payment method?

#

this.stripe = await loadStripe(this.stripePublishableKey);
this.elementsOptions = {
mode: "setup",
paymentMethodTypes: ["card"],
// Fully customizable with appearance API.
appearance: appearance,
};
// Set up Stripe.js and Elements to use in checkout form, passing the client secret
this.elements = this.stripe.elements(this.elementsOptions);

shy dawn
#

I'm sorry I don't understand. can you clarify what you are trying to do and what's the issue exactly?

hexed juniper
#

I am trying to create a web page where user have to fill it's personal data and a paymentElement of mode 'setup', for future payments. The problem is that I don't have the clientSecret until both forms are filled, because I need first to create the customer on stripe and then return it's clientSecret to attach it on the paymentElementOptions.

shy dawn
hexed juniper
#

but this is creating a paymentintent instead of a setupintent no?

shy dawn
hexed juniper
#

I don't think I understand correctly, do I have to create the setupintent on the server? But then how do I assign the payment method entered by the user?

shy dawn
#
  • first you mount the Payment Element
  • then when the user submits the form, then you create the SetupIntent and confirm it
hexed juniper
#

then when the user submits the form, then you create the SetupIntent and confirm it - on the server right?