#delgesu1745_api

1 messages ยท Page 1 of 1 (latest)

tacit zenithBOT
#

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

๐Ÿ“ 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.

hardy ether
#

Hello

#

You would pass something like invoice_settings[default_payment_method]=pm_123456789 in the body of your request

neon yew
#

Huh that's what I'

#

I'm doing. Must be messing up the quotes or something.

#

the error I'm getting back is something like "invoice_settings" is not a valid parameter.

hardy ether
#

Do you have a request ID for the error you are seeing?

#

Should be in the response headers or you can look in your Dashboard logs

neon yew
#

It'

#

It's not recognizing the [

hardy ether
#

Yep looks like you have extra quotes

#

Should just be:

invoice_settings: {
    default_payment_method: "pm_1RH7MiK4OwuAC0l7j0pEMOA3"
    }```
#

In terms of what you would see in the request's POST body for the log

neon yew
#

Ok got it to work. When I inspect the request though the param value I'm trying to change isn't updted:
req_EoltVUpoED0IIp

hardy ether
#

That request didn't update the invoice_settings at all.

#

Nothing was passed in the body

neon yew
#

Oh right hahaha missed that. That's weird

#

Can I not pass it as JSON or does it have to be url-encoded?

hardy ether
#

It has to be URL encoded if you are not using our SDKs

neon yew
#

Gotcha

hardy ether
neon yew
#

and can I pass it as query params or does it have to be in the body?

hardy ether
#

I believe either should work

#

I never hit the API directly so I don't actually remember ๐Ÿ˜…

neon yew
#

Can I se the SDK on the client side, or does it have to be server side?

#

I know I can get things like the setupintent retrieved client side, but what about updating customers and the like?

hardy ether
#

You should never call our API client-side as that exposes your secret key client-side and makes your account insecure.

#

You should only use our Stripe.JS SDK client-side or otherwise you should call our API server-side.

#

It is recommended to just use one of our server side client libraries as that makes all of this much easier as well.

neon yew
#

Yeha no sorry I meant client side SDK I've used to get back setupintents, but what about to update customers and the like?

hardy ether
#

You only update Customers server-side.

#

As that requires your secret key

neon yew
#

ok yeah thta's what I figured