#sinoea - no such customer
1 messages · Page 1 of 1 (latest)
So Stripe objects like customers "live" on the account they were created on. It sounds like you may have made this customer object on the platform account and then tried to use it in a call on the connected account, you will need to recreate the customer on the connected account in order to use it in calls there
Also just mentioning that you can copy over card payment methods without re-collecting the details in case that is relevant here https://stripe.com/docs/payments/payment-methods/connect
Hello @pure pebble , thanks for the links. If want to only save customers to a connected acccount, each connected account will have its own customers. Do I need to create a customer for the master Stripe Connect acccount too?
Currently, I am generating a token using the connected account ID (Stripe-Account header)
and when creating a customer and attaching the payment method I also pass the Stripe-Account header
I am passing the Stripe-Account header on all API calls, thinking that the transaction, customer , payment method is isolated to the connected account
I am not saving customers on the platform account, is that even required?
This all depends on what you are trying to do.
To quickly clarify, are you taking mostly card payments here or are you using other payment methods as well?
Sorry still busy and jumping around between threads. Will be back in a minute
ok sure
So with cards it can often make sense to have a Custom record on your platform. Basically, you can copy card details from your platform to your connected accounts without having to re-collect details but you can't copy them the other way. https://stripe.com/docs/payments/payment-methods/connect
So storing the details on the platform can enable you to re-use cards more easily across accounts if that is desirable to you.
And to answer the rest of your questions, yes, each account that needs to interact with the Customer will need its own copy of the Customer object. This can get a bit complicated because the Customer details are not automatically copied between accounts. So you will need to manually update the details as needed. Sometimes it may make more sense to keep all of your customer data on your platform account or on your servers and pull from there instead of trying to keep everything update. But that is all up to you
let me see if I have the basics right first then. The secret and public key is set from the platform account, and I also include the connected account's ID in the header
that's what I do for all API transactions
Is that correct?
Yes. The key is for your platform so without the account ID header, all API calls will happen on your platform. To make a payment on the connected account, you will need to make calls to create the payment intent on the connected account and then a call to charge that payment method on the connected account
Actually, taking a step back. Are you using Standard, Express, or Custom connect?
Standard
So can I create customers, payment methods without passing in the connect account? Keeping them under the platform level?
and only when creating the payment intent I pass the connected account ID?
Gotcha. So what we are saying is still all relevant. Yes, that would make sense if you want to re-use the card across multiple platforms.
The other option would be working entirely on each connected account which can also work. The one difference would be that the user would need to input their card info again each time they are paying a new connected account.
ok
This is what I am going to do now, for all API transactions I will pass the secret and public key for the platform account
I will only include the connected account ID when creating a PaymentIntent and a SetupIntent
would that technically work?
- generate token including the connect account ID (and platform account's secret and public key)
- save, update, retrieve and delete customers and payment methods using ONLY platform account's secret and public key
- create/confirm PaymentIntent and SetupIntent including the connect account ID (and platform account's secret and public key)
do the above steps make sense? Would that work
Hey I actually have to step out but my colleague @boreal violet can check that out and help you going forward in this thread
thanks @boreal violet
But if you kept all the records/objects on the Platform account and used Destination charges (so the Charge is also on the Platform account) that would work and ensure all the right objects exist when you try to process payments.
if I do as you suggest, then the connected accounts cannot see saved customers/payment methods on their dashboard?
basically, this is what we want to achive, we are using Stripe connect because we want to monetise on our 35p application fee
the rest goes to the connected account
we want the connected account to be able to search for customers, transactions and payment methods on the Stripe dashboard
What would be the best and easiest way to achieve this?
I am reviewing my test account with Connect accounts and they can see charges created on the platform
A good way to test this out is to create some test Connect accounts and a number of charges. Then, in the dashboard, you can navigate to the Connect account and select "View Dashboard as this account" from the menu to see what your Connect accounts will be able to see.
Yes we have this set up actually
Ah, is it that the Customers do not propagate?
I will come back with further questions, but since deployements take time please confirm if this technically works:
- generate token including the connect account ID (and platform account's secret and public key)
- save, update, retrieve and delete customers and payment methods using ONLY platform account's secret and public key
- create/confirm PaymentIntent and SetupIntent including the connect account ID (and platform account's secret and public key)
for direct charges
yes we had problems saving customers, so we are going to do the above steps firs
Direct charges will not work because the Customers and Payment Methods will not exist on the Connect Acocunt
Where will they live? In the Platform Account?
Yes, based on Step 2 you just outlined
You have a choice between keeping everything on the Platform or everything on the Connect account
So if I achieve the above 3 steps, the next step is to clone the payment methods and customers to the connect account
would that then allow them to see customers and payment methods on the connect dashboard?
You would want to clone the customer/pm as step 3, before you attempt the payments
And yes, they would see the Customers and PMs
ok and when generating token we would need the connect account passed in?
When you say "generating token" what token are you referring to?
Stripe.js , we are usign stripe elements
var stripe = Stripe('<%= publicApiKey %>', {stripeAccount:'<%= connectAccount %>'});
maybe not necessarily generating a token
Ah you mean tokenizing the payment method?
yes
do we need to include the connect account Id there?
or just the platform's secret key will do?
- public key
You want to just use the Platform's Public Key since you are creating the PM on the platform before you clone it to the Connect account
ok fantastic
for new payments without saving card I need to clone the payment method and attach the payment method to the payment intent and pass the connect account ID?
when creating a payment intent
Yes you will want to use the Connect Account and provide the cloned Payment Method ID when creating the Payment Intent on the Connect Account
strange I getting no such payment intent error
👋 snufkin had to head out, but I can help!
before we even hit our own API or code, this is a straight call to Stripe's API using the platform's public key only
Hello @icy osprey trying to use Stripe Connecct
- generate tokenised payment using ONLY platform account's public key. This is for Stripe.js , Stripe elements
- save, update, retrieve and delete customers and payment methods using ONLY platform account's secret and public key
- create/confirm PaymentIntent and SetupIntent including the connect account ID (and platform account's secret and public key)[6:07 PM]for direct charges[6:08 PM]
trying to use stripe connect
and only include the connect account ID when creating a payment intent or set up intent
Can you share that Payment Intent ID from the screenshot you just sent over?
No such payment_intent: 'pi_3LFLnxJBGhqsviRV0yWU3WNX'
thats a new one
Any ideas @icy osprey /
So just sharing what I see so far - pi_3LFLnxJBGhqsviRV0yWU3WNX was created on a connect account (using the Stripe-Account header). The reason you get the error is because when you confirm it client-side, you're doing so with the publishable key from the platform account. You need to ALSO be confirming the payment client-side with the Stripe-Account header.
I'm not fully following why you're doing 1 and 2 here:
- generate tokenised payment using ONLY platform account's public key. This is for Stripe.js , Stripe elements
- save, update, retrieve and delete customers and payment methods using ONLY platform account's secret and public key
Is your goal to collect payment information on the platform and then clone it to the connect accounts?
yes that's my goal
Have you read this documentation yet? https://stripe.com/docs/connect/cloning-customers-across-accounts
yes let me read it again
i am geting this error now
com.stripe.exception.InvalidRequestException: No such PaymentMethod: 'pm_1LFMXYJBGhqsviRVCHbyfGY1'; code: resource_missing; request-id: req_Oo6FZLHhmyLVRb
Let's back up - what is the sequence of events you're going through now?
Maybe best to explain what we are trying to do
we want to use Stripe Connect with direct charges
we want to get our 35p application fee sent to the Platform account, and the rest to the connected account
the connected accounts are all Standard Account
we want the connected accounts to be liable for charge backs, refunds and Stripe fees
We the platform are only interested in our 35p
we also want the customer data and payment methods data to be visible on each of the connected accounts
customer and payment methods data should be separated by connect account ID
each connected account has its own customers/payment methods
Now we have Stripe integration in place and it is working for normal Standard Account integration
We now want to use Stripe Connect, and thought the integration would be the same as normal. All we need to do is to inckude the connect account id on all API calls
Maybe we are wrong?!
What's the easiest way to achieve our goal above?
Okay, so starting with that failed request you just sent over (req_Oo6FZLHhmyLVRb)- this is failing beause you're trying to retrieve a Payment Method that belongs to a connect account, using your platform account keys. The platform doesn't have any Payment Method pm_1LFMXYJBGhqsviRVCHbyfGY1, only the connect account does, so it makes sense that trying to retrieve this Payment Method as the platform fails.
Does that make sense?
So I need to retrieve the oayment method by passing in the connect account Id in th header?
Stripe-Account: xxx
Yes
ok that resolved t
now I am attaching the customer to the payment method and getting this error:
No such customer: 'cus_LxHRQyrHyVfb8Z'; code: resource_missing; request-id: req_dscvKN0IlpvofB
Again, you need the Stripe-Account header because that Customer is on the connected account.
ok
that resolved it
So if I pass always the connected account for any API call, what would be the problem?
Well it depends on what you're trying to do - Again, if you're making requests for the connect account then you'd use the Stripe-Account header. But if you're making requests for the platform, then you need to not set the Stripe-Account header.
It's really important that you understand when to call them
This is the card payment flow, I would guess all these requests are for the connected account?
The only moment we care about the platform is when we create the payment intent, where we populate the application fee
we have authorise and capture auth/cancel auth flow
save card details to the connected account
save customers to the connected acccount
everything is for the connected account
Then I guess all we need to do is to include the connect account ID on these calls?
we dont care about saving customers and payment methods on platform level
Yes, if you don't are about saving customers or payment methods on the platform level at all then you should be making all these requests with the connect accuont ID
Even the Payment Intent creation should also be happening on the connect account
fantastic, let me try thatt
I'm going to head out, but if you need anything else @atomic vector is here