#sarthak17_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/1271064897077116949
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
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
I tried that
can you share the request ID (req_xxx)? you can find it here https://dashboard.stripe.com/test/logs
but it got falied error was (Status 400) (Request req_kXhjD9DCAezquh) Received unknown parameter: stripe_account
req_kXhjD9DCAezquh\
with different payment intent
that's because you didn't correctly set the Stripe-Account header
you can see some correct examples here: https://docs.stripe.com/connect/authentication#stripe-account-header
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
that's not correct. it should be somehting like this:
Stripe::PaymentIntent.capture('pi_xxx', {}, {stripe_account: 'acct_xxx'})
okay let me try
it worked thanks. But why this format for capture and in other methods it work as i specified
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
Okay I understand. Thanks for the help
happy to help ๐