#marc_connect-account-header

1 messages ยท Page 1 of 1 (latest)

dusky portalBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1257365632350163087

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

short tree
#

Hi ๐Ÿ‘‹

These error messages mean that you are attempting to access a Stripe object on the wrong account

forest kettle
#

Yes that's what I mentioned under "What have you already attempted?"

short tree
#

So you need to make the requet on the right account

#

The payment intent exists on the platform account so that's where you need to make the request

forest kettle
#

But I am using the platform's API key

#

Let me doube-check ...

short tree
#

Oh, sorry I got the IDs mixed up.

#

This is a Standard account

#

You need to use the Stripe Account header on the Refund request

forest kettle
#

Ah yes sorry ... I switched my integration from Standard to Express so older connected accounts are Standard

short tree
#

Oh yeah, so likely you are making Destination Charges on the Express accounts and, in that case, the objects exist on the platform

#

Easy to mix those flows up

forest kettle
#

Yes for standard accounts, I am using direct charges

short tree
#

Yeah those are both the recommended flows for each account type

forest kettle
#

OK if I add the header, will it cause refunds to payments made via Express connected accounts to fail?

#

... i.e. do I need to detect the type of connected account and conditionally add the header?

short tree
#

I'm afraid so

forest kettle
#

Hehe no worries

short tree
#

But, on the plus side, once you get that logic in place you can switch back and forth depending on which account types suite your use case

forest kettle
#

Yeah I'm not too worried ... it's like three lines of code ๐Ÿ˜…

short tree
#

Nice ๐Ÿ‘

forest kettle
#

I am using the Node.js SDK and I'm looking at the docs ... how do I set the account header?

#

Oh I found it I think

short tree
#

You should be able to set the language for the code snippets to Node

#

So you get something like this


const paymentIntent = await stripe.paymentIntents.create(
  {
    amount: 1000,
    currency: 'usd',
    automatic_payment_methods: {
      enabled: true,
    },
  },
  {
    stripeAccount: '{{CONNECTED_ACCOUNT_ID}}',
  }
);
#

The first object has the parameters for the API, the second contains headers

forest kettle
#

Yep perfect!

#

Thanks so much!!! Love Stripe ๐Ÿ’œ

short tree
#

Great ๐ŸŽ‰ I'm glad we could help ๐Ÿ™‚