#_kevinx
1 messages · Page 1 of 1 (latest)
Can you share the request ID that failed?
Most likely you're providing a customer that belongs to another account
sure, let me get it, it's a new customer created when they sign up on our platform
req_jE3uG2fZY2jVQp
ok, yes, you're making a direct charge request to the connected account here
and the customer belongs to the platform
you'd need to specify a customer belonging to the connected account, in this scenario
A little bit confused about the customer belongs to the platform, what is the logic here, can't a customer make any purchase they want?
and how to specify a customer to a group (platform or connected account)
so a platform customer can NOT make a purchase with connect account?
what if it's the same user but need to make two different purchases, one is from the platform, and another is from connect account
i meant, the customer is an object created on the paltform account
objects exist in only one account
you can also create a customer on the connected account, and use that
but the same customer object eg cus_123 cannot be used both by the platform and a connected account
so I need to create a new customer for the connect account, what if this customer needs to see the purchase receipts etc
are these paperwork provided by the connect account?
I need some help to understand why a new customer needed for connect account
even though it's the same person, why do we need to create two objects for the same thing
Not sure what paper work you're referring to, that sounds like something you'd manage/provide, depending on how your platform works
receipts
Because you're trying to use it in two different contexts, your platform and the connected account
ok, if a customer wants to see the purchase receipts or make changes on his/her credit card information, for the connected account purchase, are these done with the connected account or the platform, I'm trying to build the billing portal for the customer
Thanks for the info btw
It depend on your platform model, and how you manage customers. This might be somehting you want to manage at the platform level (say if you have them use payment details across multiple conencted accounts) or if your customers are contained to a single account they could exist just there
ok, here is what we are doing, when a new user signs up, we create a stripe customer obj, and use this id for stripe customer id. Now, it seems this id alone doesn't work with both direct charge and connected account? and we need to create another customer id for connected account? how to achieve that?
the customer might make direct purchase on the platform, or make connect account purchase
Are you specifically trying to do direct charges on teh connected account?
i see
So in that case you're likely going to want to create it on the platform, and manage a "cloned" customer on relevant connected accounts if they make payments there
You'd manually create a corresponding customer on the connected account if you need one there
and optionally "clone" any payment methods needed for payment to attach to that customer
const paymentMethod = await stripe.paymentMethods.create({
customer: '{{CUSTOMER_ID}}',
payment_method: '{{PAYMENT_METHOD_ID}}',
}, {
stripeAccount: '{{CONNECTED_ACCOUNT_ID}}',
});
Thanks, when we create the new stripe customer when they sign up, there is no payment_method to record as it is a brand new customer,
Sure that's fine -- you can still crea teh customer on the conected account to mirror the customer on the platform
Note that if the checkout session is done on the connected account as a direct charge, you won't be able to clone the payment method "upward" to the platform, you can only to that "downward" from platform to connected account
here is the flow happing on the connect account we are using, I think it is direct charges as you mentioned, and it is alright if just clone/connect from platform to connect
How to achieve that?
You'd create a "full" customer with all the details you want on the platform, then a copy customer on the connected account
Any detaisl you need to sync are up to you, there's no automatic sync of customer details
Then depending on the payment you use either the platform or conencted account version of the customer
Like I mentioned, when the customer was created, besides an email, there isn't much to make it a 'full' customer
and how to copy the customer on the connected account?
by cloning the paymentMethod?
No you just create a customer on the conencted account -- the cloning is just for teh payment method itself (if one exists to be copied)
so there will be two customer ids link to a single customer, one is for the platform and another is for connect account?
COrrect
if this customer makes two purchase, one is on the platform, and another is from connected account, and he/she needs the purchase receipts, does he/she need to go to two different places to get them?
As the platform you will have API access to the payments on both accounts. So you can retrieve info on both
ok, I'm trying to build a billing portal here to allow the customers to get receipts, or update their credit card info etc.
const session = await stripe.billingPortal.sessions.create({
customer: '{{CUSTOMER_ID}}',
return_url: 'https://example.com/account',
});
It takes in a customer id, or can I give it an array of ids?
if there are two customer ids for each customer
how to manage it
Ah, if you are using the Customer Portal, that will only show the Invoices for the version of the Customer that is on the specific account that you create it on
so here is the issue lol
That call can only take one ID and the portal can only show the info for one account at a time
we need a single stop to allow the customer get all their receipt, payment update etc
if will confuse them if there have to be two portals, one is for platform, and another is for connect
Unfortunately it is not possible to do that with the Customer Portal. You can build your own custom page to display this info but the Customer Portal cannot do what you want here unfortunately
Got you, we figure out a way, one more question, synthrider mentioned that we can copy the customer from platform to connect, how to achieve that
obviously if I use the existing customer id on the connect purchase, stripe doesn't recognize it as a customer, it's in the first message here
No such customer: 'cus_OaN5DVRuKSd0pT'
Data on the Customer object itself is not clonable. The typical way to do it is to create a Custoemr object on the connected account and pass in the info that you have saved on the Customer object on the platform account. That is what synthrider was getting at with this
You'd manually create a corresponding customer on the connected account if you need one there
ok, I need some guidance here
- Create a customer obj on the connected account, when and how? currently when a user signs up, we create a new customer obj, save it in the db, so whenever the customer create a checkout session, we pull in the customer id, but, this doesn't work for connect account obviously, so how to create a customer for connect account?
- What can be passed from connect customer to platform customer, how
thanks for your time btw
You can use this to specify a specific Connected account to make API calls as https://stripe.com/docs/api/connected_accounts
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
So you can use that along with the create Customer call when you know you need a customer on the connected account
Our API ref shows the info that is on a customer object, you can choose which fields to copy over depending on which ones matter to you https://stripe.com/docs/api/customers/object
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Thanks, this seems like a retrieving a customer, not create one, right?
That is the entry for the customer object itself, the entries for creating and retrieving customers are just below it in the doc
There is also a sidebar on the left side of the page for looking up and navigating those calls
const customer = await stripe.customers.create(
{
email: 'person@example.com',
},
{
stripeAccount: '{{CONNECTED_ACCOUNT_ID}}',
}
);
ok, it needs an stripe connected account id to create a customer ... well, if there are 100 conntected account, and there have to be 100 customer id, one for each of them?
well, the way stripe handles this customer object in this case is a bit confusing
so there is no way to setup a billing portal for connect customer, as there might be a thousands of customer id flowing out there for connect accounts.
Typically we don't recommend creating the Customer object until you intend to charge the customer on the connected account.
alright, here is the bottom question lol, how should a platform manage the connect customers then
does the platform need to monitor if this is the first purchase the customer makes on the connect account, then record the customer obj, then pull that obj out from db for future purchase reference?
that would be a super painful process
Up to you but yes that is a common way to handle it. The other main way would be creating a new customer on the connected account each time but as you can imagine that can cause clutter the customer dashboard.
this is the first time we have to work with connect Standard account, how do people normally monitor the first connect account purchase?
from a customer
Hello! I'm taking over and catching up...
Hello Rubeus, just a recap here to make it easier for you
We have customers that might make purchase on the platform, also make purchases from connect Standard account
we create a new customer obj when a new user signs up and use this obj for all future checkout session creations
but there is a problem, when the customer makes connect account purchase, Stripe doesn't recognize the customer id
and it requires a new customer id that links to the connected account id
and we also want to provide a billing portal, where the customer can see their recetips and make update on their payment menthod
seems impossible now
Gotcha. With Standard connected accounts you should be using direct charges, which means all of the payment objects (Payment Intents, Payment Methods, etc.) live on the connected account, not your platform account. Usually what platforms do if they want to save payment info and use it across many connected accounts with direct charges is they have a Customer on the platform with the Payment Method attached there, then they clone the Payment Method to each connected account for each individual payment.
With no Customers on the connected accounts.
This would also allow your customers to manage everything at the platform level, and you wouldn't have to worry about keeping Customer objects on connected accounts in sync.
ok, so we need to collect the payment method from the customer when they make the first purchase wherever and whenever? and clone the payment method each time the customer makes a new purchase with connect account?
and manage the receipts and payment method updates from this single mother customer obj? is my understanding here correct
Yep, I believe so.
or we need to collect the payment method when creating a new customer
to monitor first purchase for each and every single customer would be a painful and costly operation lol
Not sure I understand, can you provide more details? Why would it be painful and costly?
to collect the payment method from the first standard account purchase, how to determine it is the first time purchase
The purchase is going through your platform, correct?
So your platform should be able to determine that, right?
how? that's the question haha
How do you identify your customers? Do they log in?
yes, they log in, they can log in and browsing without make any purchase, or they can make a purchase the first time logging in
they can return
and make another purchase
to collect payment method and link it to the customer obj, is there a Stripe portal to do that? because we don't have to store those data
Okay, so when they create their account on your end I recommend you create a Customer object for them on Stripe, on your platform account, and save their Stripe Customer ID in your database. Then, when they log in again, you'll be able to associate their payments and activity with that Stripe Customer on your platform.
That's exactly what we are doing now
we have an existing stripe customer id
the problem is, this id can not be used for Connect Account checkout session
we have to collect the payment method, then clone the payment method to the customer obj that works with the connect account, per your suggestion
and the issue is how to collect this payment method and make it consistant
Once you have the Customer with the attached Payment Method on your platform you then clone just the Payment Method to the connected account and create a payment there.
There is no Customer on the connected account.
Just a cloned Payment Method and Payment Intent.
oh, ok, thanks for the clarification, here is how to clone right?
const paymentMethod = await stripe.paymentMethods.create({
customer: '{{CUSTOMER_ID}}',
payment_method: '{{PAYMENT_METHOD_ID}}',
}, {
stripeAccount: '{{CONNECTED_ACCOUNT_ID}}',
});
if so, the question would be how to collect the payment method before cloning it
You want to collect it initially without a payment?
ideally not
we don't want to store or collect these data if not needed, that's why I was asking if stripe has a portal where a new customer and payment method can be created
if we have to collect the payment method without purchase initially, this is the way I guess
Let's back up a bit. Can you expand on the "we don't want to store or collect these data if not needed" part? I was under the impression you wanted to collect and store payment info on your platform so it could be used with multiple different connected accounts in the future?
oh, we want to clone the payment method from the platform to connect, so that there will be a billing portal where the customer can see all their receipts or update their card info in one place
but there is no plan to store customer credit card information on our side
We don't have anything that shows receipts all in one place, you would need to build that on your end.
there is a billiong portal where it takes in a customer id
For the other part, I'm confused. You said "update their card info" but you also said "there is no plan to store customer credit card information on our side" which seem to directly conflict with each other?
The Customer Portal does not show receipts.
How can people update their card info if you're not saving it?
Here is the customer portal I was talking about
where the customer can update their payment info, such as credit cards info, as well as getting all their invoices receipts, in one place
Right. Invoices are not receipts (we have a different thing called receipts that are not related to Invoices). Also still not sure about the conflict above. Do you want to save payment info for future use or do you not want to do that?
Save payment info on Stripe's side, yes
Okay, so the recommended way to do that with Standard connected accounts and direct charges is to have Customers on your platform account with attached Payment Methods that get cloned to those connected accounts as needed.
You can create Customer Portal sessions on your platform account so your customers can manage their Payment Methods.
That way, if they make a change, the next payment will clone their updated Payment Method.
If payments only happen on the connected accounts, not on your platform, you would collect the payment details and save them on your platform without taking a payment. You can use a Setup Intent or Checkout in setup mode to do that.
yes, the question is when and how to attach this Payment Methods
when the new customer obj is created? or when they make their first purchase
Whenever it makes sense for your use case, business needs, etc.
You can't do it during their first purchase, though, unless you take the payment directly on your platform account.
You can't clone from a connected account to your platform.
So you can't create a direct charge on a Standard account and then clone that Payment Method up to your platform.
oh, so it has to be when the new customer obj is created
You need to save the payment info on your platform first, then clone to the connected account to make a payment there.
so it is a one direction move
The Customer needs to be created before the Payment Method can be saved to it. The Customer creation can happen at any time before you collect payment info.
how to collect payment info
I talked about that above. Can you ask a more specific question?
do we need to have the customer key in credit card numbers on our platform and save these data into our db?
What do you mean by "these data"?
credit card number, CCV, expiration date, billing address
Those details are typically stored in Stripe, not in your database.
They're represented by a Payment Method object.
And the Payment Method object lives on your platform account.
and how to collect payment method object then without having the customer key in these
You can use Stripe Checkout in setup mode.
There's a guide here: https://stripe.com/docs/payments/save-and-reuse?platform=web&ui=checkout
Got you, what happens when the mode is setup, will there be a Stripe page shows up to collect all these CC data?
Yes.
ah, that's the answer then, lol