#_kevinx

1 messages · Page 1 of 1 (latest)

final rampartBOT
viral halo
#

Can you share the request ID that failed?

#

Most likely you're providing a customer that belongs to another account

cobalt oxide
#

sure, let me get it, it's a new customer created when they sign up on our platform

#

req_jE3uG2fZY2jVQp

viral halo
#

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

cobalt oxide
#

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

viral halo
#

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

cobalt oxide
#

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

viral halo
cobalt oxide
#

receipts

viral halo
cobalt oxide
#

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

viral halo
#

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

cobalt oxide
#

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

viral halo
#

Are you specifically trying to do direct charges on teh connected account?

viral halo
#

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

cobalt oxide
#
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,

viral halo
#

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

cobalt oxide
#

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

viral halo
#

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

cobalt oxide
#

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?

final rampartBOT
viral halo
#

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)

cobalt oxide
viral halo
#

COrrect

cobalt oxide
#

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?

random dragon
#

As the platform you will have API access to the payments on both accounts. So you can retrieve info on both

cobalt oxide
#

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

random dragon
#

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

cobalt oxide
#

so here is the issue lol

random dragon
#

That call can only take one ID and the portal can only show the info for one account at a time

cobalt oxide
#

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

random dragon
#

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

cobalt oxide
#

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'

random dragon
#

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

cobalt oxide
#

ok, I need some guidance here

  1. 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?
  2. What can be passed from connect customer to platform customer, how
#

thanks for your time btw

random dragon
#

So you can use that along with the create Customer call when you know you need a customer on the connected account

cobalt oxide
random dragon
#

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

cobalt oxide
#
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.

random dragon
#

Typically we don't recommend creating the Customer object until you intend to charge the customer on the connected account.

cobalt oxide
#

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

random dragon
#

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.

final rampartBOT
cobalt oxide
#

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

ocean stirrup
#

Hello! I'm taking over and catching up...

cobalt oxide
#

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

ocean stirrup
#

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.

cobalt oxide
#

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

ocean stirrup
#

Yep, I believe so.

cobalt oxide
#

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

ocean stirrup
#

Not sure I understand, can you provide more details? Why would it be painful and costly?

cobalt oxide
#

to collect the payment method from the first standard account purchase, how to determine it is the first time purchase

ocean stirrup
#

The purchase is going through your platform, correct?

cobalt oxide
#

yes

#

we use checkout pages

ocean stirrup
#

So your platform should be able to determine that, right?

cobalt oxide
#

how? that's the question haha

ocean stirrup
#

How do you identify your customers? Do they log in?

cobalt oxide
#

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

ocean stirrup
#

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.

cobalt oxide
#

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

ocean stirrup
#

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.

cobalt oxide
#

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

ocean stirrup
#

You want to collect it initially without a payment?

cobalt oxide
#

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

ocean stirrup
#

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?

cobalt oxide
#

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

ocean stirrup
#

We don't have anything that shows receipts all in one place, you would need to build that on your end.

cobalt oxide
#

there is a billiong portal where it takes in a customer id

ocean stirrup
#

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?

cobalt oxide
#

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

ocean stirrup
#

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?

cobalt oxide
#

Save payment info on Stripe's side, yes

ocean stirrup
#

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.

cobalt oxide
#

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

ocean stirrup
#

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.

cobalt oxide
#

oh, so it has to be when the new customer obj is created

ocean stirrup
#

You need to save the payment info on your platform first, then clone to the connected account to make a payment there.

cobalt oxide
#

so it is a one direction move

ocean stirrup
#

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.

cobalt oxide
#

how to collect payment info

ocean stirrup
#

I talked about that above. Can you ask a more specific question?

cobalt oxide
#

do we need to have the customer key in credit card numbers on our platform and save these data into our db?

ocean stirrup
#

What do you mean by "these data"?

cobalt oxide
#

credit card number, CCV, expiration date, billing address

ocean stirrup
#

Those details are typically stored in Stripe, not in your database.

cobalt oxide
#

yes!

#

that's what we want

ocean stirrup
#

They're represented by a Payment Method object.

#

And the Payment Method object lives on your platform account.

cobalt oxide
#

and how to collect payment method object then without having the customer key in these

cobalt oxide
#

Got you, what happens when the mode is setup, will there be a Stripe page shows up to collect all these CC data?

ocean stirrup
#

Yes.

cobalt oxide
#

ah, that's the answer then, lol