#beef_paymentelement-connect
1 messages ยท Page 1 of 1 (latest)
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- b33f_connect-webhooks, 53 minutes ago, 97 messages
- b33fb0n3_returning-customers, 3 days ago, 11 messages
- b33fb0n3_api, 6 days ago, 12 messages
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1239636928157188178
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
I got this error, but don't know what to do: 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.
I was inside the application settings, but what to do? I am using for the stripe promise the connected account (not the plattform account). Maybe that's the problem, but if I would use the plattform account the created payment intent (in the connectect account) can't be found.
beef_paymentelement-connect
Hey @arctic nimbus! There are many ways to integrate Stripe Connect in the first place. So the first step is to explain what flow of funds exactly you are trying to use (Destination Charges, Direct Charges or Separate Charges and Transfers)? Also what type of connected account do you use?
The connected account is a standard account. I don't charge anything, so no direct charges, no destination charges, no ..., ...
You are asking explicitly how to confirm a PaymentIntent on a connected account right? So you, as the platform, are actively charging a Customer for a certain amount and giving the funds to the connected account.
The plattform creates the paymentintent inside the connected account and the client (user on website) confirms it with his elements (payment element) and then the payment is confirmed and collected
Okay, so yes you as a platform collect payments. You said you don't but you do.
So now, how did you create the PaymentIntent, can you share the code?
The plattform account itself just handles the creation and confirmation. The money will only go on the connected account. Maybe I still collect payments but I guess that doesnt matter
The payment element is created inside the Elements
yeah what matters is your integration. You as the platform collect payments. It's important since you will have more questions in the future based on past threads so try to be clear that you are a platform with Standard accounts and you use Direct Charges
๐งโ๐ป How to format code on Discord
Inline code: wrap in single backticks (`)
This:
The variable `foo` contains the value `bar`.
Will turn into this:
The variable
foocontains the valuebar.
Code blocks: wrap in three backticks (```)
Also, you can specify the language after the first three backticks to get syntax highlighting.
This:
```javascript
function foo() {
return 'bar';
}
```
Will turn into this:
function foo() {
return 'bar';
}```
Notes about **code blocks**:
- Specifying the language is optional (e.g., you can omit `javascript` in the example above)
- If you don't specify the language you won't get syntax highlighting
- When you're inside a code block (after you type \`\`\`) the `Return`/`Enter` key will add a new line instead of sending your message
- Once you end the code block `Return`/`Enter` works normally again
You can [read more about message formatting on Discord's website.](https://support.discord.com/hc/en-us/articles/210298617)
inside the CheckoutForm there is the PaymentElement
Please read the instruction above to format code that isn't just a picture
alright. I am the plattform and I am using direct charges of 0 โฌ, because I don't charge anything, right?
I am using direct charges of 0 โฌ, because I don't charge anything, right?
PaymentIntents do not supportamount: 0and you said you use PaymentIntents, so that is impossible
Are you mixing up the words and using SetupIntents instead?
New Method
const stripePromise = loadStripe(process.env.NEXT_PUBLIC_STRIPE_API_KEY!, {stripeAccount: process.env.NEXT_PUBLIC_STRIPE_USED_ACCOUNT_ID})
export default function NewMethod({amount}: {amount: number}) {
const options = {
mode: 'payment',
currency: "eur",
amount: amount,
paymentMethodCreation: 'manual',
paymentMethodTypes: ["sepa_debit"],
} satisfies stripeJs.StripeElementsOptions;
return <Elements stripe={stripePromise} options={options}>
<CheckoutForm amount={amount}/>
</Elements>
}
Checkoutform
<form onSubmit={handleSubmit} className={"w-full"}>
<PaymentElement />
<LoadingButton type={"submit"} isLoading={!stripe || loading} className={"mt-6 w-full"}>
{formatEuro(amount)} zahlen
</LoadingButton>
{errorMessage && <div>{errorMessage}</div>}
</form>
Okay what's the value of process.env.NEXT_PUBLIC_STRIPE_USED_ACCOUNT_ID right now?
Let me create a clear example. Imagine two persons: B33fb0n3 and Peter.
B33fb0n3 create a stripe plattform account and is a developer.
Peter asked B33fb0n3 how he can collect payments. B33fb0n3 said, that he can do it for him. Peter created and connected his account to B33fb0n3's plattform account.
B33fb0n3 now tries to create paymentintents via B33fb0n3's api keys and also confirms them. The payments automatically on Peters Stripe account and the payouts as well.
The paymentintent creation does not contain any charges for Peter:
const intent = await stripe.paymentIntents.create({
amount: amount,
currency: 'eur',
payment_method_types: ["sepa_debit"],
});
Peter is now happy that everything works (future).
that depends on the enviorement. In developement it's acct_1PG2yQIYvs38dGkh in production it's acct_1N1ZkaGFAsQSXF4n
That PaymentIntent creation is incorrect. It would be created on your own platform and you want it on the connected account so you missed the propert option from https://stripe.com/docs/connect/authentication#stripe-account-header
the creation (on the connected account) works fine.
it doesn't, not with the code you shared
it does, because stripe will be initiated with the correct stripe account:
return require('stripe')(stripeKey, {stripeAccount: process.env.NEXT_PUBLIC_STRIPE_USED_ACCOUNT_ID});
ah my bad you hardcoded it in the client okay. Almost no one ever does that
oh I thought that would be the way to do it? Else the stripe (clientside) don't know where the paymentintent is created when not on plattform?
yeah sorry I'm really strugling to follow you right now ๐ฆ
Client-side code and server-side code are completely separate/unrelated. The way you initialize Stripe.js client-side is different from how you initialize the stripe-node SDK server-side.
oh sorry, my bad. Can I make my example more clear somewhere?
#1239636928157188178 message
Can you give me an example PaymentIntent id I could look at to check? That'll be faster than the back and forth
Yes, this is a paymentintent on a connected account: pi_3PG0rnGFAsQSXF4n14Rcq0V4
okay so it was created on the connected account so that worked fine.
So I guess now: what exactly is your issue?
Yes, my issue right now is, that the paymentelement does not load anymore and I get this error: #1239636928157188178 message
You mentioned this error when you started the thread
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.
What exactly is causing this error?
what exact line of code is failing?
There is no line mentioned, but I still got a stacktrace:
TypeError: Cannot read properties of undefined (reading 'dispatch')
at elementUnmounted (https://js.stripe.com/v3/fingerprinted/js/controller-8bd32ff63c911675aeb213bb7dc31161.js:1:688915)
at https://js.stripe.com/v3/fingerprinted/js/controller-8bd32ff63c911675aeb213bb7dc31161.js:1:695955
at n (https://js.stripe.com/v3/fingerprinted/js/controller-8bd32ff63c911675aeb213bb7dc31161.js:1:65184)
at Generator._invoke (https://js.stripe.com/v3/fingerprinted/js/controller-8bd32ff63c911675aeb213bb7dc31161.js:1:64937)
at Generator.next (https://js.stripe.com/v3/fingerprinted/js/controller-8bd32ff63c911675aeb213bb7dc31161.js:1:65366)
at a (https://js.stripe.com/v3/fingerprinted/js/controller-8bd32ff63c911675aeb213bb7dc31161.js:1:70671)
at o (https://js.stripe.com/v3/fingerprinted/js/controller-8bd32ff63c911675aeb213bb7dc31161.js:1:70843)
at https://js.stripe.com/v3/fingerprinted/js/controller-8bd32ff63c911675aeb213bb7dc31161.js:1:70921
at new Promise (<anonymous>)
at e.<anonymous> (https://js.stripe.com/v3/fingerprinted/js/controller-8bd32ff63c911675aeb213bb7dc31161.js:1:70808)
It seems like it's coming from a load event of the payment element, because there is a message saying Unhandled payment Element loaderror
Do you have a page I can look at directly?
this is the full error:
error {
"type": "invalid_request_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.",
"status": 403
}
yes, is ngrok fine for you?
yeah this error usually happens when you use the API key of an account that isn't a Connect platform
Are you sure you have the right Publishable key from your own Stripe account that is the platform?
well, I do that ๐
sure ngrok is fine
const stripePromise = loadStripe(process.env.NEXT_PUBLIC_STRIPE_API_KEY!, {stripeAccount: process.env.NEXT_PUBLIC_STRIPE_USED_ACCOUNT_ID})
Because the stripeAccount is the one of the connected account ๐
Alright. This is the url: https://635d-89-56-39-126.ngrok-free.app/payment
Pretty simple:
Enter any amount and click on the button. Then the elements will load (normaly)
yep exactly what I said, you're using the wrong API key
You need the Publishable API key from your platform, the one that all the connected accounts are connected to. You mixed up your API keys so you get that error
Sure thing!