#mmansoor-connect-fee

1 messages · Page 1 of 1 (latest)

bitter oysterBOT
lean knoll
#

mmansoor-connect-fee

#

Hey @flat holly, we don't really do "web meet" but I'm happy to help! This is already documented in all our Connect docs as taking your own fee is the foundation of most platforms

flat holly
#

Yeah but that's causing huge headache for us

lean knoll
flat holly
#

Is there a tutorial that you can point us to?

#

Our use case is direct charges

lean knoll
flat holly
#

Thanks

#

Let me read it

#

So we had tried this and got the following error "OAuth key or Stripe-Account header was used but API request was provided with a platform-owned payment method ID. Please ensure that the provided payment method matches the specified account."

lean knoll
#

Sure and so that means you have something wrong with your code which is unrelated to the fee part right? You are passing an incorrect id somewhere

#

If you share an example Request id req_123 I can look and show you

flat holly
#

Here is one pm_1MyDzkC5sd7OOJiORiC64Cuq

lean knoll
#

Please make sure to take the time to read what I write. I asked for a request id req_123. That is a PaymentMethod id pm_123.

flat holly
#

Let me find out ... one sec

lean knoll
#

It looks like you create that PaymentMethod client-side with Stripe.js but on your own platform account, which will never work with the Direct Charges flow

flat holly
#

Where will I find a request Id

lean knoll
#

it's right there in the error , you can't miss it as the developer

#

That tells me you likely haven't read the docs I shared which are the foundation of how to use Direct Charges with Stripe Connect

#

My guess is that you are in a rush trying to make this work as fast as possible and so you're not really going through the right end to end tutorial unfortunately

#

Since you are using Standard accounts and Direct Charges, you need to make sure that everything related to a given payment happens directly on the connected account. This is done by making sure you pass the right connected account id acct_123 in the Stripe-Account header of your request(s)

You need to look at https://stripe.com/docs/connect/authentication#authentication-via-the-stripe-account-header which clearly documents how this works and you likely missed the step for the client-side code.

flat holly
#

If I understood properly. It looks like you create that PaymentMethod client-side with Stripe.js means that I need to generate PaymentMethod on server side. Right?

lean knoll
#

not at all, I never said or meant that

#

Are you the developer? If so, how did you create that PaymentMethod? What does are you following, which UI Element are you using?

flat holly
#

Can you add @potent storm to this chat .. he's the developer that I am working with

lean knoll
#

This is all public for everyone to see

flat holly
#

I didn't orginally coded the UI so trying to debug and sold this issue

#

solve this issue

lean knoll
#

it's best to have them come, but really they need to read the doc I shared above which clearly explains their mistake

flat holly
#

Let me check

#

Still looking

real bloom
#

👋 koopajah needed to step away but I'm around.

flat holly
#

Here is the req id "req_KbCo8OQIPEwZ4X"

real bloom
#

Let me know if you have any questions and I can help.

#

Yep so the issue here is as Koopajah mentioned above... you are trying to attach a PaymentMethod that was created on the Connected Account without using the Connected Account Header.

#

That indicates how you use the Stripe Account Header to make a request on your Connected Account

flat holly
#

Let me ask another question

#

Can i create a customer in the connected account?

#

i.e. From Platform to Connected Account

real bloom
#

Yes

#

You can use almost any of our API endpoints + the Stripe Account Header to make requests on your Connected Accounts

flat holly
#

How would that API would look like

real bloom
flat holly
#

Let me check

#

Same goes for payemntMethods.attach()

real bloom
#

Not sure if that is a question

flat holly
#

If I need to attached a payment method to a customer in the connected account; do I need to pass on the Stripe Account Header as always

#

for Connected Account

real bloom
#

Yes

#

Anytime you do anything on the Connected Account you need the Stripe Account Header

flat holly
#

Okay

#

Still working

#

Can you see this request id req_1ZaOvzFPf8ucVH

real bloom
#

Yep

#

Same issue. No Stripe Account Header

flat holly
#

In the payment request or payment_method request?

real bloom
#

On the GET request that is erroring

flat holly
#

req_HplgSte7TIfoml

#

I have passed the Account Header

#

with the request

real bloom
#

You haven't. Otherwise you would not get that error message. And you can pull up the request in your platform Dashboard to look at it as well and see that wasn't the case.

#

Perhaps your code is cached?

#

Or you forgot to save? Or forgot to restart your server?

#

Could be many things, but no Stripe Account Header is present

bitter oysterBOT
flat holly
#

let me chck

#

it will be on the dashboard

fierce raptor
#

not sure what you mean with

  • it will be on the dashboard *
flat holly
#

Neve rmind

#

Can you tell how will I pass on Stripe Account Header in Attach Payment

fierce raptor
#

that should have code snippets to explain what you need to do in your code

#

you're using Node, what does your code snippet look like, can you paste just the code snippet for retrieving PaymentMethods? (pls don't paste secret key etc)

flat holly
#

`return await Stripe.paymentMethods.attach(

token,

{ customer: customerId },

{ stripeAccount: "acct_1NL....RJE9" }

);`

fierce raptor
#

that's not the request you shared earlier?

This is a PaymentMethod Attach POST request, the failing requests you shared were GET requests to fetch a PaymentMethod?

flat holly
#

Yeah ... this is a different one

#

req_HovGPCqcjuwCxX

fierce raptor
#

you shared another GET

#

but the code you shared is for POST

#

sorry we're going in circles

flat holly
#

Please accept my apologies

fierce raptor
#

gotcha, ok that's the POST, no worries so ...

#

I'll lay things out

1/ Platform - acct_1M2ctlC5sd7OOJiO
2/ connected accounts - acct_1NLAR0Fs2Ku7RJE9

3/ your Customer was created on Platform = WRONG
4/ your PaymentMethod was created on connected accounts = RIGHT

5/ your request is made on the Platform where Customer exists but not PaymentMethod = WRONG

Assuming you want both Customer to live on the connected account and also the PaymentMethod to live on connected account then you need to fix step 3 and step 5

#

is my assumption right?

#

depends on whether you're using Direct Charges or Destination Charges

flat holly
#

Let me review ....

#

Still working

potent storm
#

req_fgWCI3l6zk2nWN. This is new req id. can you kindly look it up

flat holly
#

req_96wGyezA75AcQy

bitter oysterBOT
fierce raptor
#

ok the two requests shared earlier are still not exactly the right ones.

Taking a step back, let's take things one at a time. You shared a PaymentIntent creation and a PaymentMethod GET request.

Let's start with

3/ your Customer was created on Platform = WRONG
fixing that one first

and then

5/ your request is made on the Platform where Customer exists but not PaymentMethod = WRONG
fixing that one

my colleague@dense osprey is here and they can help you but let's take things one at a time

flat holly
#

We updated 3 & 5

fierce raptor
#

but you shared requests that were not for 3 and 5

a/ so pls first share the updated code snippet for step 3
b/ and a successful request ID for step 3
and then we can fix the next step

flat holly
#

I thin we addressed all of the issues

#

Payments are happening

fierce raptor
#

yes I understand but I'm trying to make sure we're progressing in a systematic manner, my goal is to map out that after steps 1-5, what are steps 6-10 etc

and clearly lay out which ones are working, which ones are not, etc

it is easier to consolidate information that way and reexplain it to everyone

#

I get you're saying payments are happening but if you share requests, I can understand what fund flow it even is

flat holly
#

See this

fierce raptor
#

that's my point, you're sharing one off things and I can't form a state from there. This was an Application Fee creation event

ok let's take a step back:

Payments are happening

ok where are you blocked next?

flat holly
#

I think we aren't blocked anymore ... can you see this final request : req_2NyrSdlSJOSOO8

fierce raptor
#

yes I can see that, a successful request, what did you want to learn about it

flat holly
#

I want to say thank you for the guidance

#

and support

fierce raptor
#

that is a Direct Charge request taking a $2 Application Fee

#

ah got it, sorry I hadn't realized you are unblocked, my bad!

#

sorry about the confusion, you had moved much faster and unblocked!