#dirtyred_api

1 messages ¡ Page 1 of 1 (latest)

eager prairieBOT
#

👋 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/1304200856144580649

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

sonic ether
#

Hello! Let me address each of your questions one at a time...

#

when using SetupIntent api flow to charge customers later, when creating customers and passing the same details, a new customer id is created every time even with the same exact customer details. Is this ok and the intended flow for creating customers?

That's normal, yes, although it's not recommended. If you have an existing Customer that already represents a particular person you should use that existing Customer instead of creating a new one.

#

Will this create a problem later if the same returning customer has multiple customer ids within the stripe system?

Probably, although it depends on your specific integration and context. It's possible it won't cause a problem, but it probably will.

#

The customer search functionality seems limited and may take up to an hour to update according to the documentation.

That's correct. It sounds like you're relying on the Search API to retrieve all Customer objects matching a specific person/details? Can you tell me more about what you're building?

wise sierra
#

sure, its a regular ecommerce flow and we are using stripe purely for credit cards (no apple or google or anything else). We dont really mind if stripe has multiple records of the same email and shipping address. We offer a post purchase up sell after the initial checkout and that is why we are using the SetupIntent api flow to charge them later based on if they take the post-purchase upsell or not.

what kind of problems do you see arising if we always create a new customer before charging them?

#

we will keep records of the tokens associated with the charge so later we can issue a refund if needed, but we wont really be using stripe as a CMS or anything like that. We will store the last 4 cc that we will get with the paymentmethod id

sonic ether
#

It sounds like you're using a Setup Intent followed immediately by a Payment Intent, both while the customer is present during the same session, correct?

wise sierra
#

ideally yes - but there may be edge cases where they simply close the browser after the initial checkout after they see the thank you page with the upsell offer. And in that case we will charge them the initial amount without the upsell - i think a few minutes after the initial checkout finished.

#

if they say no to the upsell, or say yes, then we charge them immediatley using the customer id and payment method server side

sonic ether
#

Is your primary goal to avoid two payments? You always want to charge them a single time?

wise sierra
#

correct

sonic ether
#

The approach you're taking isn't really recommended, but it should work alright. I think I'm missing some context, though... if customers aren't returning after this why are you getting multiple Customer objects with the same details?

wise sierra
#

its not within the same session - but returning customers.

say john doe with visa 123 from los angeles orders from us for the first time on his desktop pc. We create a customer within stripe to attach the setup intent to. everything works great.

john doe with visa 123 from LA comes back a week later and orders again but this time uses his cellphone instead of his desktop and inputs the same exact details. Same name, same address, same card and purchases again. everything works again but john doe now has two customer objects in stripe.

Does that cause issues somehow someway?

#

we offer guest checkout and users dont always sign in to their previous accounts

sonic ether
#

That depends on what you mean by "cause issues". It won't break anything on Stripe's end; it's fine to have multiple Customer objects with the same details. It might cause issues on your end if you try to do anything based on Customers, like reporting, migrations, etc.

wise sierra
#

if not found, create the customer, if found, use that id for the setup Intent

sonic ether
#

Recommended approach for what, exactly? For finding all of the Customer objects associated with a specific person?

#

Oh, you're asking about how to find the existing Customer?

#

So you can reuse it when someone returns?

wise sierra
#

correct

sonic ether
#

There are multiple approaches. Using the Search API is one way. Another way would be to use the List API, which doesn't have the data delay the Search API does, but is more limited: https://docs.stripe.com/api/customers/list

wise sierra
#

ok awesome - that makes more sense

#

thank you very much !