#sarthak17_api

1 messages ยท Page 1 of 1 (latest)

green roostBOT
#

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

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

inner crest
#

hi there!

#

the PaymentIntent you are trying to capture does exist, but on a connected account

#

so you need to use the Stripe-Account header to create and also confirm that PaymentIntent

alpine pond
#

I tried that

inner crest
alpine pond
#

but it got falied error was (Status 400) (Request req_kXhjD9DCAezquh) Received unknown parameter: stripe_account

#

req_kXhjD9DCAezquh\

#

with different payment intent

inner crest
#

that's because you didn't correctly set the Stripe-Account header

alpine pond
#

I tried that
Stripe::PaymentIntent.capture('pi_xxxxxxxxxxxxxxxxx',{stripe_account: 'acct_xxxxxxxxx'})

#

((Status 400) (Request req_fZDSrjBRT2b06q) Received unknown parameter: stripe_account)
Request Id req_fZDSrjBRT2b06q

inner crest
#

that's not correct. it should be somehting like this:

Stripe::PaymentIntent.capture('pi_xxx', {}, {stripe_account: 'acct_xxx'})
alpine pond
#

okay let me try

#

it worked thanks. But why this format for capture and in other methods it work as i specified

inner crest
#

it's always the same format:

  • a parameter for the ID (when needed)
  • a parameter for any API parameters, like amount, currency, etc.
  • a parameter for other things, like the Stripe-Account header
#

if you creater a PaymentIntent, you don't need to set an ID, so you only need paremeter 2 and 3.

#

if you edit/confirm/capture an existing PaymentIntent, you need to set it's ID and then then other 2 parameters are the same

alpine pond
#

Okay I understand. Thanks for the help

inner crest
#

happy to help ๐Ÿ™‚

green roostBOT