#xephox-connect-paymentelement
1 messages ยท Page 1 of 1 (latest)
Hi there! What's FE in this case? What kind of request are you making when you receive this error?
oh sorry, Front End. I am trying to use stripe react elements from react-stripe-js package to show a save card portal on my web application. But On passing the stripe publishable key, I get this error
I am kind of sure that I am using a connected accounts publishable key here
I was wondering if there were anything other than not using a connected account that could trigger this error message?
Hmmm
Do you have the connected account ID, or do you have a request ID for your request to create a SetupIntent?
This is a standard account, created by a platform in test mode. It's connected to the platform.
oh is this not a connect acount?
It is, but it's of "standard" type
whats the difference and what account do i need it to be
Standard connected accounts usually go hand in hand with direct charges. This means you'll want to use the platform's publishable key and include the standard connected account ID when creating the PI and on your FE: https://stripe.com/docs/connect/direct-charges#create-a-charge
whats the difference and what account do i need it to be
I recommend reading through this if you haven't already: https://stripe.com/docs/connect/accounts
As well as this, which goes over different charge types: https://stripe.com/docs/connect/charges
oh
just quick question, od you know the type of account that just takes the publishable key, setup_intent ?
If you're creating a charge on a platform account, or if you've created a standalone standard account on stripe.com (no Connect involved)
alright, final question, could you tell me what type of account this is acct_1Mo7yyQcZzljEnGz ?
This is also a standard connected account, controlled/owned by the same platform as the one above
but for the above one i can just use the stripe publishable key, stripe account and client secret
why is this not working for the first account id?
Thanks for this
I am using the same method to access both account details
<Elements stripe={stripePromise} options={options}>
<AddCardForm hashedId={setupIntent.payment_id} />
</Elements>
But for the first account id I get an error
๐ what exact error do you pass? What's the problem in details?
xephox-connect-paymentelement
oh sorry, lemme summerize
I read the thread, just all you said is that it works with one and not the other and that's it
Yeah pretty much, I am trying to debug this to figure out whats wrong here
Sure, but to help you I would need more specific information like exact code, exact error, where the error happens, etc.
cool, give me a second
On the front end, I am trying to show a add card page, and I am using the code below to get this result
const options = {
appearance,
clientSecret: setupIntent?.client_secret,
metadata: { hashed_id: setupIntent.payment_id },
};
const stripePromise = loadStripe(stripePublishableKey || "", {
stripeAccount: setupIntent?.stripe_account,
});
<Elements stripe={stripePromise} options={options}>
<AddCardForm hashedId={setupIntent.payment_id} />
</Elements>
Can you give me an example PaymentIntent + account id where it doesn't work?
for the account id : acct_1NBP4pGbrA47duwb
i get the following error:
"error": {
"code": "platform_account_required",
"doc_url": "https://stripe.com/docs/error-codes/platform-account-required",
"message": "Only Stripe Connect platforms can work with other accounts. If you specified a client_id parameter, make sure it's correct. If you need to setup a Stripe Connect platform, you can do so at https://dashboard.stripe.com/account/applications/settings.",
"type": "invalid_request_error"
}
}```
i can get you a setup intent, does that work?
I do not get this error for this account : acct_1Mo7yyQcZzljEnGz
SetupIntent works fine, I need both that id and the associated account id
seti_1NDZ78QcZzljEnGz1VBoA1Sy_secret_NzYDjNvHONSfiQ2aGZhiYzn524NNkrO this is the setup intent
what is the associated account id?
Ah sorry, this is quite crucial for you to understand. You seem to act as a platform. You have your own API key and you have connected accounts that you want to create Direct Charges on, is that not the case?
oh sorry, we do have connected accounts that have customers. My intention here is to get card details and add a card to these customers.
I don't want to charge anything
Yes sorry, just we have our own vocabulary that is quite fundamental to get right, especially as a platform
But okay, you have a SetupIntent, you created it directly on the connected account. Then what? What do you do client-side? What's the exact error you get?
After getting the setup intent, we run this code:
` const options = {
appearance,
clientSecret: data?.client_secret,
metadata: { hashed_id: setupIntent.payment_id },
};
const stripePromise = loadStripe(stripePublishableKey || "", {
stripeAccount: data?.stripe_account,
});
<Elements stripe={stripePromise} options={options}>
<AddCardForm hashedId={setupIntent.payment_id} />
</Elements> The add card form component has these stripe elements in it( in the pic ). and the error is :{
"error": {
"code": "platform_account_required",
"doc_url": "https://stripe.com/docs/error-codes/platform-account-required",
"message": "Only Stripe Connect platforms can work with other accounts. If you specified a client_id parameter, make sure it's correct. If you need to setup a Stripe Connect platform, you can do so at https://dashboard.stripe.com/account/applications/settings.",
"type": "invalid_request_error"
}
}`
Basically, I use the setupintent to make the add card from
does that help?
a little bit
what exact part of the code is throwing that error? And what exact id are you passing in data?.stripe_account,?
its this account acct_1Mo7yyQcZzljEnGz
and setupintent is : seti_1NDZ78QcZzljEnGz1VBoA1Sy_secret_NzYDjNvHONSfiQ2aGZhiYzn524NNkrO
status code 403
with the above error msg as response
I think some part of the PaymentElement and AddressElement component from react-stripe-js library is throwing the error
your client secret is completely different from the one you shared in that request URL
you seem to be mixing up your ids/secret somewhere
ah sorry, i just reloaded it, this is the new one,
setup intent : seti_1NDaF0GbrA47duwb9oTkclkZ_secret_NzZNDpfZHmswbVYWpFqn5Jr8oljgK75
sorry you each time only give me 1% of the info ๐
Try and give me all actionable things at once. If you look closely the account id acct_123 and the client secret seti_ABC_XXX are in the URL above and they have to match
yeah very sorry about this, give me second, I juggling multiple things here
sorry about this, again but here is a matching one,
"client_secret":"seti_1NDbpEGbrA47duwb1soZYLpT_secret_Nzb1n4hvBeFHputVcRZLGMNU4Sso7q6","stripe_account":"acct_1NBP4pGbrA47duwb"
yeah unfortunately I don't understand what the problem is then and I still need a lot more details. Is there any way for me to reproduce somewhere so that I can look at it?
shoot
yeah, lemme try to fix this again on my end, I am as confused as you are as I didn't work on this lol. Anyways, I'll ping here if I need anything. Thanks for the help! sorry for taking up your time.
@humble fern there's no way for me to just view it live somewhere for a few minutes? ngrok link could work for example
also curious if you get the same error without the AddressElement though it shouldn't
oh wait I see it
the API key you use is wrong
pk_test_51NAmyHJfUIHb6mUZcnr6lMJQHNymuuiaBi9JPsrLZwcyBOJ3U14gLLKX7d40FuQre5uptk7HaVWptw14cuNTL88V00rTMHg5U6 that's what I see in your request URL earlier, that's from a different Stripe account that isn't a platform
that's your bug, I was too focused on the SetupIntent + connected account id and I didn't think to check the API key
so is this not a connected account from our platform ?
no
oh I see
I am working this out for a client, so I cannot confirm this, is it possible for you to check if this account's ( acct_1NBP4pGbrA47duwb ) test publishable key is ``` pk_test_51NAmyHJfUIHb6mUZcnr6lMJQHNymuuiaBi9JPsrLZwcyBOJ3U14gLLKX7d40FuQre5uptk7HaVWptw14cuNTL88V00rTMHg5U6
so you seem to be mixing up the Publishable API keys somewhere. but I can't really give you more information than this
Right now that API key is for a separate Stripe account that is not a Connect platform and not connected to any platform, so that's your mixup
Thanks a bunch, this helps a lot