#patrick_api

1 messages ยท Page 1 of 1 (latest)

crimson urchinBOT
#

๐Ÿ‘‹ 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.

little remnant
#

Backend:

    const intent = await stripe.setupIntents.create({
        customer: req.refresh_token_data.stripe_customer_id
    })

    return res.status(200).send(intent)
nova cipher
#

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
            }
        })
little remnant
#

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.

nova cipher
little remnant
#

2022-08-01

nova cipher
#

ah you're on stripe-node 10.17.0

#

You need a newer SDK version

little remnant
#

Ah ok I am using 10.15.0

#

Ill update

nova cipher
#

๐Ÿ‘

little remnant
#

Ok so the type error is now gone

#

I'll try running the process again

#

Ok so it seems like it worked

#

Thank you Hanzo