#gabbe_connect-paymentintent

1 messages Β· Page 1 of 1 (latest)

devout stagBOT
#

πŸ‘‹ 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.

charred rainBOT
warm depot
#

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).

pale ginkgo
#

The customer object is cus_QrmcTKtJjpPmCg

warm depot
#

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

pale ginkgo
#

Here is teh request id req_DOUDLTMGRP9KYj

warm depot
#

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.

pale ginkgo
#

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

warm depot
pale ginkgo
#

Does this mean i need to create a new customer for each Connected account?

warm depot
#

Yup

pale ginkgo
#

Cool, alright

#

Thanks toby

warm depot
#

Any time!

pale ginkgo
#

Also, i would suggest updating the documentation since i followed the steps and it got me here

warm depot
#

Can you point me to which guide you followed? I'd be happy to have that reviewed.

warm depot
#

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.

pale ginkgo
#

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

warm depot
#

Hm, at the top of the page, are you in the "Web" tab or one of the other ones?

pale ginkgo
#

Oh, my bad

#

I am on the React Native page

warm depot
#

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!

pale ginkgo
#

Great

devout stagBOT
pale ginkgo
#

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

warm depot
#

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?

regal holly
#

gabbe_connect-paymentintent

pale ginkgo
#

req_HPIhNMv0cFkres

regal holly
#

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?

pale ginkgo
#

Yeah, the issue is on the client side

#

It is complaining that the payment intent can’t be found

regal holly
pale ginkgo
#

Yeah, probably. Thanks, will give it a try

#

Tried it, did not owrk

regal holly
#

Please share your exact updated code and the exact error you see with the req_1234 of the failure client-side

pale ginkgo
#

localizedMessage would translate to : "Unexpected error occured, try again in a few seconds"

#

message would translate to : "No such payment_intent: pi_xxxxxxx"

regal holly
#

Please share your exact updated code too

pale ginkgo
#

I receive no errors up until i invoke presentPaymentSheet

regal holly
#

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

pale ginkgo
#

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);
}

};

regal holly
#

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?

pale ginkgo
#

I tried it, didnt work so i undid it

regal holly
#

πŸ˜…

pale ginkgo
#

I'll redo it

#

Give me a sec

regal holly
#

Sure and please share that bit of the code

pale ginkgo
#

I think i will try something else, this does not feel like the correct aproach

regal holly
#

I can tell you that's the real bug

pale ginkgo
#

Ill trye the "Collect and pay out" option

#

Instead of "Enable customer to pay directly to business"

regal holly
#

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

pale ginkgo
#

Yeah, i will redo it and get back to you if i manage to succed

#

Wish me gl

#

Btw, should the accounts "express"?

regal holly
#

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.

pale ginkgo
#

I made it work πŸ™‚

#

I had implemented the integration based on two concepts mixed together, which now in heinsight feels stupid

regal holly
#

congrats!

pale ginkgo
#

Thank you

#

I appreciate all the help you guys provided