#rdsdaw2022 - connect request

1 messages · Page 1 of 1 (latest)

calm stone
#

Hi there. Can you share the request ID?

warm verge
#

from where do I get the request_id?

#

{
"error": {
"code": "parameter_missing",
"doc_url": "https://stripe.com/docs/error-codes/parameter-missing",
"message": "Can only apply an application_fee_amount when the PaymentIntent is attempting a direct payment (using an OAuth key or Stripe-Account header) or destination payment (using transfer_data[destination]).",
"param": "application_fee_amount",
"type": "invalid_request_error"
}
}

calm stone
warm verge
#

I do not have access to the logs unfortunately

#

or the dashboard

calm stone
#

Are you a developer?

warm verge
#

yes I am

#

but with no access to the dashboard 🙂

calm stone
#

I see. Are you trying to create destination charges?

warm verge
#

yeah. I have passed Stripe-Account header. My manager connected a user account to the base account and gave me the account_id for the user account that I passed as Stripe-Account header value

#

I was able to send payments to Account1 (user account) before. But now I need to give application_fee to the platform account. She connected user account to platform account from Dashboard Connect.

calm stone
#

Take a look at that api spec

#

That's how you need to form your request

warm verge
calm stone
#

Oh direct charge

#

Above you answered yes to "are you using destination charges"

#

Gotcha. One moment

#

Beyond that I will need a request id to see what you're doing wrong

warm verge
#

ok...I am trying to get one

calm stone
#

Thanks

warm verge
#

I cannot find the request_id because I do not see it in the logs at all for the request I just sent

#

Let me try sending another request to see if it pops up in the log

#

actually no, that one was trying to using destination_charges. never mind ...I will try again

#

req_s4YuLlwq4U42fc

#

This is the request id: req_s4YuLlwq4U42fc

brazen breach
#

Hello! Catching up, hang on...

warm verge
#

ok

brazen breach
#

Okay, this request is to create a Payment Intent, and you're specifying application_fee_amount, but you're not specifying where that 2¢ should go. Is your intention to create a destination charge with a connected account?

warm verge
#

I did supply Stripe-Account in the header of my request with the account_id to which the payment should go to

#

Stripe-Account is the Name and account_id is the value

#

intention is to send direct charge to the user's account

#

with applifaction_fee_amount to our base platform account

brazen breach
#

You did not supply a Stripe-Account header in that request.

#

Can you double-check your headers and try again?

warm verge
#

ok...I used stripe-account all lower case, and I see that the status is 200OK. request_id = req_97JhfsVvtwfXI1. However, payment elements did not get created.

brazen breach
#

What do you mean when you say "payment elements did not get created"?

warm verge
#

the elements that we see from stripe, to put credit card number, zip etc

#

the payment grid that payment_intents API creates

brazen breach
#

That sounds like a completely separate issue, correct? You only mentioned the Payment Request creation API call above, right?

warm verge
#

actually, I was wrong. I am still not able to send Stripe-Account as the header

#

what is the correct header name? Stripe-Account or stripe-account?

brazen breach
#

Capitalization does not matter, but you did successfully send the Stripe-Account header in that last request (req_97JhfsVvtwfXI1).

#

Not sure why you said you didn't send it?

warm verge
#

because I do not see stripe-account value in the header when I see at the logs

brazen breach
#

Which logs?

warm verge
#

to make it clear for me. if my platform account1 (pb_1, sk_1) has another connected account2 (pb_2,sk_2), i use stripe-account with account2_id, correct? And then I use pb_2 and sk_2, right, to call the payment intent request. Perhaps, I am not understanding clearly.

warm verge
brazen breach
#

If you want to create a direct charge on a connected account you would use your platform's secret key and the Stripe-Account header to create the Payment Intent on the connected account (which you did in that last request mentioned above).

warm verge
#

ok

brazen breach
#

We do not show the Stripe-Account header in the request logs in the Dashboard. The fact that the Payment Intent exists on the account you specified in the Stripe-Account header is what indicates that header was set correctly.

warm verge
#

i see

brazen breach
#

Okay, so what's blocking you at this point?

warm verge
#

now I understand that the publishable keys need to be of the platform account. But even though I got the payment_intent_id, I could not see the payment elemensts rendered on my checkout page.

#

thanks so much for clearing it to me. Even if we try to use destination charges, the publishable and client keys should be of platform account?

brazen breach
#

Yeah, if you're doing destination charges you would use your platform keys and no Stripe-Account header at all.

warm verge
#

because I was using account specific publishabel and client keys for each account before, and it was working great. Now I need to include applicaiton_fee which is confusing me a lot.

brazen breach
#

What type of connected accounts are you using? Standard? Express?

warm verge
#

Standard

brazen breach
#

With Standard accounts you should use direct charges.

warm verge
#

ok

brazen breach
#

Destination is only recommended for Express and Custom.

warm verge
#

ok

#

the users want to login and see their logs etc, so we need standard accounts

brazen breach
#

Make sure you initialize Stripe.js with your platform's publishable key and the stripeAccount parameter.

warm verge
#

oh, we need stripe-account even on the Stripe initization?

#

I was only using as header during request

brazen breach
#

Usually you do it during initialization of Stripe.js.

#

Server-side you typically do it per request.

warm verge
#

i see

#

const stripe = Stripe(publishable_key); is what I was using. I need to pass the stripe-account as well here looks like

warm verge
#

Thanks much

#

You have a very very great day...I was stuck all day. I will try this tomorrow now.