#rdsdaw2022 - connect request
1 messages · Page 1 of 1 (latest)
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"
}
}
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Are you a developer?
I see. Are you trying to create destination charges?
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.
Take a look at that api spec
That's how you need to form your request
yeah, but we need to create direct charge using user's publishable key. I was looking the API for direct Charge using Stripe-Account header https://stripe.com/docs/connect/direct-charges
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
ok...I am trying to get one
Thanks
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
Hello! Catching up, hang on...
ok
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?
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
You did not supply a Stripe-Account header in that request.
Can you double-check your headers and try again?
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.
What do you mean when you say "payment elements did not get created"?
the elements that we see from stripe, to put credit card number, zip etc
the payment grid that payment_intents API creates
That sounds like a completely separate issue, correct? You only mentioned the Payment Request creation API call above, right?
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?
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?
because I do not see stripe-account value in the header when I see at the logs
Which logs?
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.
logs in the Dashboard. I do not see Stripe-Account name in there. I see others like Idempotency etc
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).
There are more details here: https://stripe.com/docs/connect/authentication
ok
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.
i see
Okay, so what's blocking you at this point?
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?
Yeah, if you're doing destination charges you would use your platform keys and no Stripe-Account header at all.
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.
What type of connected accounts are you using? Standard? Express?
Standard
With Standard accounts you should use direct charges.
ok
Destination is only recommended for Express and Custom.
Make sure you initialize Stripe.js with your platform's publishable key and the stripeAccount parameter.
oh, we need stripe-account even on the Stripe initization?
I was only using as header during request
Usually you do it during initialization of Stripe.js.
Server-side you typically do it per request.
i see
const stripe = Stripe(publishable_key); is what I was using. I need to pass the stripe-account as well here looks like