#Gerarda Cautillo-connect

1 messages · Page 1 of 1 (latest)

cyan depot
#

yes that won't work, as the error says

#

you can't use a pm_xxx created on the platform account on a connected account in a call to create a customer like that

#

you have to clone it first

#
  • create PM on the frontend using the platform
  • attach to a Customer on the platform account
  • clone that Customer's PaymentMethod to the connected account
  • attach the cloned PaymentMethod to a new Customer on the connected account
crisp raven
#

in order to clone a payment method I have to attached a customer, so basically I create a customer first

cyan depot
#

yeah but you're creating it on the connected account there, which won't work as mentioned above

#

you need to get rid of requestOptionsCustomer1 in that snippet

crisp raven
#

when i create a payment intent i have this error: No such PaymentMethod: 'pm_1JbidmErWLFb1tAhlx7tOi3b'; code: resource_missing; request-id: req_3Dc3TNbI5G7TIf

cyan depot
#

yes because you're creating the PaymentIntent on the platform account in that code

#

you need to pass requestOptions1 to PaymentIntent.create there if you're trying to process the payment on the connected account with the cloned PM

crisp raven
#

ok I createad a first payment intent! Thank you!!!

#

Regarding the second payment intent I have to clone the same payment method right=

cyan depot
#

is the second on this same connected account or a different one?

crisp raven
#

in a different one

cyan depot
#

then you'd have to clone a PM from the platform to that other account, yep, repeating the process

crisp raven
#

ok perfect, thank you so much! I created two payment intent for the two connected accounts

#

why cannot i to see these payment into a dashboard?

cyan depot
#

did you confirm the PaymentIntents to process the payment?

#

just creating the PaymentIntents doesn't process a charge, you have to confirm them (which in practise means sending them back to the frontend to confirmCardPayment though in test mode you could cheat a little by adding setConfirm(true) to the params).

crisp raven
#

ok, on frontend I called stripe.confirmCardPayment(clientSecret from backend) but I receive this error No such payment_intent: 'pi_3Jbk6wCz5n0FQ62603N0PjDa'

#

I read that for the function confirmCardPayment only the client secret is required

cyan depot
#

you need to pass stripeAccount on the frontend because the PaymentIntent is on the connected account

#
var stripePlatform = Stripe(data.publicKey);
var stripeConnectedAccount = Stripe(data.publicKey,  {stripeAccount: "acct_1JClrVCz5n0FQ626"});

...

stripePlatform.createPaymentMethod(...)

...
// send PaymentMethod to the backend and clone it and create a PaymentIntent on the connected account
stripeConnectedAccount.confirmCardPayment(client_secret)
#

in that example you see how I create two different instances of the Stripe() global and use the one that was initialised with the stripeAccount option for the PaymentIntent confirmation

crisp raven
#

ok now it's working

#

thank you so much! you have been a great help

cyan depot
#

happy to help!

crisp raven
#

the last question 🙂 i created in july a connected accounts in stripe dashboard but now there are little changes and I cannot create anymore more connected account

cyan depot
#

what kind of problem/changes are you running into exactly?

crisp raven
#

I have two platform account. for one I can see the voice "connect" in the menu and if I click I can see the connected accounts and I can create other connected accounts

cyan depot
#

ok, and you can't in the other?

crisp raven
#

for the other one I cannot see the voice "Connect"

cyan depot
#

Also there's a "More" menu with a dropdown, so maybe Connect is in there.

crisp raven
#

ooh i can see