#nerder_checkout-customers-connect

1 messages ยท Page 1 of 1 (latest)

valid vergeBOT
#

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

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

exotic mauve
#

Hi ๐Ÿ‘‹

Stripe Search is not immediately concurrent. Our docs call this out

Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages.

https://docs.stripe.com/api/customers/search

supple glade
#

Oh ok

#

Should i rely on webhook for this?

#

my integration does the following:

  1. search for the customer
  2. if not found, creates it
  3. then create a checkout session with the customer id
exotic mauve
supple glade
#

should I instead do:

  1. search for the customer in our DB
  2. if not found, creates it
  3. listen to customer.created and create the entry in the DB
  4. then create a checkout session with the customer id
#

would this be a more reliable impl?

exotic mauve
#

That would ensure you have the data you are looking for.

Quick question: Why not use the Checkout Session to create the Customer? Is it that you need to attach metadata to the Stripe Customer object before you create the Checkout Session?

supple glade
#

I'm using the checkout session in setup mode here and basically we use this to support payment methods setup we don't want (yet) support natively

#

and usually yes, i need to attach the uid as a metadata of the customer created in the connect account

#

to retrieve all those customers from within different connected accounts

exotic mauve
#

Okay I can see how it would be necessary for tracking the Customer within your own system

supple glade
#

yes, in fact we keep track of customers as in customerId:stripeConnectedAccountId

exotic mauve
#

I think you could achieve the same thing by attaching the metadata to the Checkout Session and specifying customer_creation: 'always'.

Then you would listen for the checkout.session.succeeded event and update the new Customer object with the metadata on the Checkout Session

#

That would potentially reduce latency but it would be a bit more complicated

supple glade
#

actually is not that bad, I can avoid create the customer unecessarly

#

but the problem would be that the email field will be empty and editable then right?

exotic mauve
supple glade
#

interesting

#

so what you are proposing is the following:

  1. try to fetch the customerId from our DB
  2. if present, use that to create the Checkout Session
  3. is NOT present, then simply create the checkout session attaching the metadata to the Checkout Session and specifying customer_creation: 'always' setting customer_email
#

so in this case, if the customer attempts to open the checkout session, but doesn't end up setting up the payment method we avoid create the customer entirely

#

otherwise, we receive the webhook for customer.created with the metadata in it

#

i'm understanding this correctly?

exotic mauve
#

Close but not quite. For step 3, if the customer DOES complete the Checkout Session, you will want to listen for the checkout.session.completed webhook event.

This event will have the Checkout Session object with the customer ID and the metadata. You then use the Customer ID and the metadata on the Checkout Session to update the Customer object in Stripe: https://docs.stripe.com/api/customers/update

supple glade
#

ah ok, bummer

#

there is no way to pass the metadata for the customer that will be created by the checkout session?

exotic mauve
#

No, we don't have that available. I can raise a feature request for that parameter but I cannot guarantee if/when it would get developed.

supple glade
#

No worries

#

I think this will be a good solution anyhow

#

we are using checkout session for payments when done from the web

#

so we can reusue a similar approach

#

I'll take a note for this possible implementation

exotic mauve
#

Okay great

supple glade
#

Since we are talking about raising possible issues

#

I have another question regarding connect payment methods configuration

#

Should I open another thread?

exotic mauve
#

You can just mention it here

supple glade
#

ok so, if you take a look at this req

#

req_pP9HiDg10s4P1x

#

basically the checkout session is failing here because our integration request ideal

exotic mauve
#

Well.... it requests SEPA debit because you can only use IDEAL for one-off payments

supple glade
#

exactly yes

#

but SEPA should be active for that account

#

as we keep it on by default in our connected accounts config

exotic mauve
#

I am looking at the connected accounts payment methods configuration

#

sepa_debit is off

#

and the account does not have the sepa_debit_payments capability

supple glade
#

let me check

#

maybe I was looking in the wrong place

exotic mauve
#

It looks like there was an issue with getting some data for account verification

supple glade
#

Yes, they just connected recently

#

and they are fetching those documents

#

and i see on by default

#

for SEPA DD

exotic mauve
#

But that doesn't matter if they have not provided the required compliance information

#

The connected account will not have SEPA DD available until they provide the required information.

supple glade
#

Ok understood

#

I remember that back in the days there was a settings for iDeal

#

to be used for initiate recurring payments

#

that should be toggled on

#

I thought it was about this

#

actually is still there

#

When we activate iDeal for our Connected Accounts is this settings on or off?

exotic mauve
#

I'm not certain. These are screenshots of the dashboard and, on this server, we hardly ever interact with the dashboard. I can tell you that some payment methods require additional verification information and that, if we do not receive this information, we will de-activate the payment methods for the connected account.

The specific account here had the sepa_debit_payments capability in a pending status but then it transitions to inactive since we didn't get the information we needed

#

I recommend you review the requirements property on the account object as well as the capabilities property

supple glade
#

Ok it makes sense

#

should I reach out to support.stripe.com to verify if that setting is indeed enabled when we enable iDeal for our Connected Accounts?

exotic mauve
#

Yes. That team is well positioned to dig into the details for account verification

#

as well as your platform configuration

#

we focus on coding integrations with Stripe APIs here

supple glade
#

Ok

#

thank you so much @exotic mauve

#

always a pleasure

exotic mauve
#

Happy to do it!