#spanila

1 messages · Page 1 of 1 (latest)

buoyant oliveBOT
untold prism
opal glen
#

i found conflicting information about being able to do it, vs not being able to use paymentmethod user adds onto connected account

#

the flow of things im trying to do is:

  1. create customer
  2. if customer has paymentmethods, add it to paymentIntent, otherwise not.
  3. create directcharge paymentintend
  4. confirm on ui
  5. get paymentmethod from paymentintent on server
  6. attach paymentmethod to platform customer
  7. update paymentintent with customer id
  8. capture paymentintent
untold prism
#

it's bit hard to describe without more specific reference(for example you're not saying if those Customers/PaymentIntents/PaymentMethods etc are created on the platform or the connected account) so it's hard for me to comment on the flow.

but i need to have the paymentmethod already there
yes, you do.
generally it works something like

  • create Customer + SetupIntent on the platform
  • confirm SetupIntent to attach a PaymentMethod to the Customer on the platform
  • when you need to make a payment for that customer on a connected account, you clone their saved PaymentMethod
  • on the connected account you create a PaymentIntent to charge the cloned PaymentMethod, and confirm + capture that.
#

in that way you have a "master" Customer on the platform that stores the PaymentMethod and you clone it "on-demand" when a payment is needed. Alternatively you can create a Customer on the connected account and attach the cloned PaymentMethod to that, but then you have to replicate that across all accounts and keep it in sync etc and it's a lot more complex.

opal glen