#gabbe_connect-paymentintent
1 messages Β· Page 1 of 1 (latest)
π 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/1285611614724161556
π Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there π do you have the ID of the Customer object that you were trying to use that resulted in that error?
Typically that error is thrown because the Customer object you're trying to reference doesn't exist, or it exists on a different Stripe account (this latter is more common with Connect scenarios).
The customer object is cus_QrmcTKtJjpPmCg
Gotcha, thank you for that detail. Apologies for not asking all at the same time, but can you also provide either your Stripe account ID, or the ID of the request that failed and returned that error?
Request IDs can be found through your Stripe dashboard:
https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support site 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.
Here is teh request id req_DOUDLTMGRP9KYj
Thank you, taking a closer look!
The problem here is that you created the Customer on your Platform account, and are then creating a Payment Intent on your Connected Account via a direct charge pattern. With Direct Charges all the objects reside on your Connected Accounts, but your Connected Account can't reference objects from your Platform account.
Since the Payment Intent is being created on the Connected Account our system looks for the provided Customer on the Connected Account as well, and then throw an error because the Customer doesn't exist there.
For this to work you'll need to create the Customer object on your Connected Account.
Thank you for finding out why this issue occurs
Could you provide me with a solution suggestion?
How would i add a Customer connected to the Connected account
When you create the Customer object, which you did in this request:
https://dashboard.stripe.com/test/logs/req_hsgmSGfmtJbUqG
You'd use the stripeAccount header to make that request for your Connected Account (rather than your Platform account).
https://docs.stripe.com/api/connected-accounts?lang=node
Does this mean i need to create a new customer for each Connected account?
Yup
Any time!
Also, i would suggest updating the documentation since i followed the steps and it got me here
Can you point me to which guide you followed? I'd be happy to have that reviewed.
Ah, yeah that guide doesn't touch on using customer parameter with Payment Intents (focused more on one-time payments), which is why it doesn't go into this detail there. I'll take that feedback into consideration and think on whether we have a good spot to raise the need to create Customers in this fashion with Direct Charges.
I am not sure if i understood you there, are you saying that customer is not used with Payment intents?
Because a screenshot from that documentation cleary shows that customer is being used together with the payment intent
Hm, at the top of the page, are you in the "Web" tab or one of the other ones?
Ah, yup, I see the bug in the code on that page! Thanks for the clarification, I'll be sure to get this flagged to be fixed!
Great
However, one more thing
Now it is saying that the payment intent is missing; pi_3Q03eD07kXxLPhdq0oxbBZAG
Which is wierd since i can se that multiple payments have been initiaded in the customer on the connected account
What is saying the Payment Intent is missing? Are you seeing that in response to a request you're making, and can you share that request ID if so?
gabbe_connect-paymentintent
req_HPIhNMv0cFkres
that's a request that succeeded. So what's the problem? You say the PaymentIntent is missing? Is this happening client-side in Javascript or somewhere else?
Yeah, the issue is on the client side
It is complaining that the payment intent canβt be found
Gotcha, it's likely because you forgot to pass the connected account id in the stripeAccount option there. See https://docs.stripe.com/connect/authentication#adding-the-connected-account-id-to-a-client-side-application
Please share your exact updated code and the exact error you see with the req_1234 of the failure client-side
localizedMessage would translate to : "Unexpected error occured, try again in a few seconds"
message would translate to : "No such payment_intent: pi_xxxxxxx"
Please share your exact updated code too
okay so that's a picture of code. Can you share code as text moving forward? Easier to talk about.
Please show me where you changed/fixed your client-side code to have the right connected account id
const initializePaymentSheet = async () => {
setLoading(true);
try {
if (!user) throw new Error("User not found");
const host = await getUserById(matchmaking.host);
if (!host?.stripeAccountId) throw new Error("Host not found");
const paymentIntent = await API.createPaymentIntent({
accountId: host.stripeAccountId,
amount: 2400,
customerEmail: user.email,
currency: matchmaking.booking?.currency?.toLowerCase() ?? "usd",
});
if (!paymentIntent) throw new Error("Payment intent not found");
const { error } = await initPaymentSheet({
merchantDisplayName: "Padel Fast",
paymentIntentClientSecret: paymentIntent.secret,
customerEphemeralKeySecret: paymentIntent.ephemeralKey,
customerId: paymentIntent.customerId,
allowsDelayedPaymentMethods: true,
returnURL: `padelfast://join?id=${matchmaking.id}&key=${matchmaking.key}`,
});
setLoading(false);
if (error) throw new Error("Error initializing payment sheet");
} catch (error) {
setLoading(false);
}
};
Yeah sorry that's the same exact code. That's not what you need to do. The link I shared explains exactly what needs to happen client-side. Did you do that step? If so, can you share the code related to that step to show me you did it?
I tried it, didnt work so i undid it
π
Sure and please share that bit of the code
I think i will try something else, this does not feel like the correct aproach
I can tell you that's the real bug
Ill trye the "Collect and pay out" option
Instead of "Enable customer to pay directly to business"
I triple-checked your logs. You are a platform, you create a PaymentIntent on the connected account A and then you try to load the PaymentIntent on your platform and it fails.
You can't do "collect then pay out" unless you completely change your integration and the type of connected accounts you use. Never do this with Standard accounts
Yeah, i will redo it and get back to you if i manage to succed
Wish me gl
Btw, should the accounts "express"?
Yes Express is the best choice. It's close enough to Standard. But they won't have any real Dashboard access, they can't do anything themselves. Also you will now hold all liability for their negative balance, for fraud, etc.
I made it work π
I had implemented the integration based on two concepts mixed together, which now in heinsight feels stupid
congrats!