#wojtek-issuing-connect

1 messages · Page 1 of 1 (latest)

kind rampartBOT
storm iron
#

I'm using this code on the server side:

#

Here's a full error

abstract quarry
#

wojtek-issuing-connect

#

The card is on the connected account and that request is made on the platform so it's expected it wouldn't work

#

you need to pass the stripeAccount option on that call too

storm iron
#

Alright, let me see

#

is it stripeAccount or stripe_account ?

#

Do you have some docs where do I need to pass that option? Creating stripe instance, generating ephemeralKey or where?

storm iron
#

I can't control the headers from stripe API, do I? I tried to set it on the client side, same error

abstract quarry
#

Did you read the doc I linked you to?

#

It explains exactly how to set the Stripe-Account header both client-side and server-side to indicate which account you are making a request on

storm iron
#

I'm using this, and it doens't work

abstract quarry
#

I don't get it

#

why are you looking at client-side

#

Sorry I'm just not following what's going on. I gave you the exact URL/section link with the exact bit of code you need

#

there's a language choice for every language, above that section you took a picture from

#

the EphemeralKey is created on the server not the client

storm iron
#

I know that. Let's take a step back

abstract quarry
storm iron
#

Step 1 create secure endpoint, I do have that. Same code but in nextjs, I can't specify headers here

#

Because the SDK creates the API call, I don't have any control over that

#

Step 2

#

Web API integration

#

CLIENT-SIDE

#

This is why I'm doing client side stuff

abstract quarry
#

stop

#

stop stop

#

Step 1: create the secure endpoint
=> That is where the bug is

#
    nonce: nonce,
    issuing_card: card_id,
  }, { apiVersion: '2022-11-15' });```
storm iron
#

How can I set a header there?

abstract quarry
#

that's the code you seem to have. Which is for an Issuing Card on your own account

#

What you need to do is create the EphemeralKey for a card on a connected account

#

Can you share the exact code you used to create that Issuing Card on the connected account?

storm iron
#

I don't have it, another team does that

#

Can I call this endpoint manually? Without your SDK?

abstract quarry
#

oh boy

#

I'm sorry, I'm trying to help you understand all of this but you are going a bit too fast and ignoring some crucial parts of your integration

#

It's really importnat to not just rush through the code and to understand the whole thing

#

When your team created the Issuing Card, they use the Create Issuing Card API: https://stripe.com/docs/api/issuing/cards/create. But they wanted the Card to be created on the connected account. So your team's developer read https://stripe.com/docs/connect/authentication#authentication-via-the-stripe-account-header to understand how you can indicate to our API "this API request I am making is not for my own platform it's for a specific connected account acct_123456". This uses the Stripe-Account header feature. But since they likely used one of our official server-side libraries, they made sure to use the relevant option that is explained in that doc linked above

#

Assuming you/they use Node.js they did const card = await stripe.issuing.cards.create({ cardholder: 'ich_1M05212eZvKYlo2COOthYoW2', currency: 'usd', type: 'virtual', },{ stripeAccount: 'acct_1234', });

#

This is how you pass the option on Node. And so you need to so a similar thing in your own code which creates an EphemeralKey for that Card

storm iron
#

This seems to work

#

Thanks

abstract quarry
#

And so you need to set that option for all the calls if they happen on a connected account

#

and you also need to make sure that client-side Stripe.js is initialized with the right option (the section you found earlier which is subtly different)

#

Does that make sense now?

#

Sorry it can be tricky when multiple developers own different parts of a Connect integration

#

that subtle "stripeAccount" feature is simple once you get it but it's super confusing if you have never seen it

storm iron
#

I understand that calls based on the platform/account, I just didn't know how to use your API to set it up. Thanks for the help

#

It returns all 0000 though

#

Task for another day, thanks for your help