#patrick_api
1 messages ยท Page 1 of 1 (latest)
๐ 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/1325937287409827841
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Backend:
const intent = await stripe.setupIntents.create({
customer: req.refresh_token_data.stripe_customer_id
})
return res.status(200).send(intent)
Hello
What happens if you try
const intent = await stripe.setupIntents.create({
customer: req.refresh_token_data.stripe_customer_id,
automatic_payment_methods: {
enabled: true
}
})
I get a type error:
No overload matches this call.
Overload 1 of 2, '(params?: SetupIntentCreateParams | undefined, options?: RequestOptions | undefined): Promise<Response<SetupIntent>>', gave the following error.
Object literal may only specify known properties, and 'automatic_payment_methods' does not exist in type 'SetupIntentCreateParams'.
Overload 2 of 2, '(options?: RequestOptions | undefined): Promise<Response<SetupIntent>>', gave the following error.
Object literal may only specify known properties, and 'customer' does not exist in type 'RequestOptions'.ts(2769)
(method) Stripe.SetupIntentsResource.create(params?: Stripe.SetupIntentCreateParams, options?: Stripe.RequestOptions): Promise<Stripe.Response<Stripe.SetupIntent>> (+1 overload)
Creates a SetupIntent object.
After the SetupIntent is created, attach a payment method and confirm to collect any required permissions to charge the payment method later.
In the latest API version, Stripe sets automatic_payment_methods by default - https://docs.stripe.com/changelog/2023-08-16/automatic-payment-methods
What stripe-node version are you using?
2022-08-01
That's the API version. What stripe-node SDK are you using on your backend?
https://github.com/stripe/stripe-node
ah you're on stripe-node 10.17.0
You need a newer SDK version
๐