#gustavonicot-Connect

1 messages · Page 1 of 1 (latest)

modern knot
#

You can clone customer from the Platform to the Connected Account, alongside with cloning PaymentMethod as well

#

But before that, what do you want to achieve at the first place?

spare stump
#

sorry, didn't see your text. we wanted to do a direct charge to a connected account and ensure that the stripes fees are charged to de connected account and not to the platform

spare stump
#

are you there? is this enough information?

modern knot
#

Hey, sorry I might be slow on getting back

#

What's your Connected Account type?

#

Express/Standard/Custom

spare stump
#

standard

modern knot
#

Okie, so Direct Charge is the correct way to way

spare stump
#

is this chat private?

modern knot
#

No, it's public

#

Sharing account id is fine, don't share sensitive info like key etcs

spare stump
#

I underestand it

#

our specific problem is that when processing the first payment for a customer the steps are 1- create a customer. and then create a payment intent with that customer. 3-the payment intent is used by an app (flutter). this works when processing in behalf of the connected account

#

but not in a direct charge

#

if we do a direct charge, it give us an error that the user does not exist in the connected account (the user was created on the platform). the recommended approach is cloning the user from the platform to the connected but that has another problem.

modern knot
#

Why wouldn't you create the Customer and create the PaymentIntent within your Connected Account at the first place?

spare stump
#

(I am writing based on my understanding that I am not assuming is correct)

spare stump
#

couldnt find it

#

tried but got an error

#

specially the customer creation

modern knot
#

Just use the normal Customer creation API, with the Stripe Account header

#

for example in Ruby

#
cus = Stripe::Customer.create({
  description: 'My First Test Customer (created for API docs)',
}, {
  stripeAcocunt: 'acct_xxx'
})
spare stump
spare stump
modern knot
#

yes

spare stump
#

when processing the intent I got an error that the customer does not exist

modern knot
#

When creating another PaymentIntent, you should also specify the stripeAccount

spare stump
#

const paymentIntentPayload = {
amount: req.body.amount,
currency: 'usd',
customer: order_request_response.customer,
automatic_payment_methods: {
enabled: true,
},
// payment_method_types: ['card'],
metadata: {
order_id: req.body.order_id || null,
user_id,
employee_id
},
// // application_fee_amount: 50,
// transfer_data: {
// destination: 'acct_1GpgeiHuGTwjv40R'
// }
}
const settings = {
stripeAccount: stripeConfig.SELLER_ACCOUNT,
}
const paymentIntent = await stripe.paymentIntents.create(paymentIntentPayload, settings);

#

is this correct?

modern knot
#

yes it should be correct

#

was it succeed?

spare stump
modern knot
#

Okie, debug by actually checking the ID on your Dashboard

#

Login to your Dashboard, then your Connected Account Dashboard, then paste the Customer Id to the Search bar to see it it exists

spare stump
#

thanks for the tips. I have been looking around but I cant find the created users anywere

modern knot
#

Do you have the request id of Customer Created?

#

it should be in your Connected Account

#

or simply paste me the Customer Id

spare stump
#

let me check

#

cus_KjRS7fOQ6L8o0Q

modern knot
#

It's on your Connect Account acct_1JsxiNLff3YZzI2e

spare stump
#

is it a test customer?

#

yes I am seeing it

#

are you seing the paymentIntenet creation attemps on the logs in your end?

modern knot
#

I only see the Customer creation request on this Account

#

Let me check out Platform Account

#

acct_1JmA6yE05DrzsTpY, right?

#

this one failed

#

so it failed on creating ephemeral_keys, maybe before the PaymentIntent creation?

spare stump
#

Was missing that. I think the issue is around the ephemeral key

#

to you have a piece of code for creating the ephemeral key on the connected account. Thanks for everything and the time by the way!

modern knot
#

Just do it normally like you do, but append the {stripeAccount: "your_connected_account_id"} to the call!

#

like you already wrote your PaymentIntent creation call!

spare stump
#

Thanks again! It finally completed. have a great night.