#beastboy_customer-defaultpm

1 messages ¡ Page 1 of 1 (latest)

untold folioBOT
#

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

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

burnt jungleBOT
#

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.

final flicker
#

beastboy_customer-defaultpm

#

@charred mountain I don't really have a good recommendation here. If you don't set any concept of a default for your Customer then it mostly means there isn't a default. You can definitely look at their Subscription(s) and see if they have a default there but that doesn't mean that's the default they'd want to use for other payments

charred mountain
#

That's fair - I just want to verify that this approach is correct for doing so

final flicker
#

It works/seems fine yes

charred mountain
#

ok great. Thank you!

#

another question, sorry - im using stripe elements to allow users to update their PM on our site. It succeeds the first time but always fails the second time with the error: setup intent has already succeeded.

I tried to solve this by creating a new setup intent immediately after updating their PM via:

const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!, {});

const setupIntent = await stripe.setupIntents.create({
    customer: stripeCustomerId,
    payment_method_types: ['card'],
});

return setupIntent;

}

but I'm still getting the same error. However in the error it says the stripe elements are still using the old setup intent id. So I guess I just want to verify that this is most likely a coding problem on my end (where it's not properly using the newly created setup intent id) or is this not the correct way to approach this?

final flicker
#

I don't really follow what you are describing I'm sorry

charred mountain
#

eh its okay I'll figure it out

#

One last question:

const subscriptions = await stripe.subscriptions.list({
limit: 3,
});

calling this for a particular customer - what's the order in they're returned in?

#

(the subscriptions)