#joshuar_api

1 messages ยท Page 1 of 1 (latest)

violet monolithBOT
#

๐Ÿ‘‹ 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/1243446200070569995

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

kindred kraken
#

the customer (cus_QAB2RPkSoNJQYC) exists on the platform account, but you're trying to create a PaymentIntent (using the customer) on the connected account

wispy orbit
#

hmm no I have not tried this method before

kindred kraken
#

cloning only clones the PaymentMethod. You need to create a new Customer on the connected account if you want to reuse the cloned PaymentMethod on the connected account

wispy orbit
#

I see it says this is only suppported for card and bank accounts, but I need to support wallet payments (apple/google pay)

kindred kraken
#

Apple and Google Pay are considered as card payments. You can give it a try

wispy orbit
#

ah I see

#

oh I see, the initial creation of the payment method is left out of the code example

#

thanks, I will give this a try and see

kindred kraken
#

to summarize though, for direct charges, the payment is created on the connected account. On that same note, all relevant objects need to exist on the connected account when you create the payment

wispy orbit
#

that makes sense ๐Ÿ‘

#

one more question then, since I'm actually trying to do this in the paymentIntent, i.e. before I have the payment method, how should I handle this? Not set the customer upfront, but do something on the webhook?

kindred kraken
#

assuming that you want to save the PaymentMethod that you're creating to reuse, you can either :

  • create the Customer on the connected account first (if required) and pass it in when creating the PaymentIntent. Or,
  • create the Customer on the connected account (if required) after the payment (listen for the payment_intent.succeeded webhook) and then attach the PaymentMethod.
wispy orbit
#

how would I create a customer on the connected account?