#mrobjectoriented_api

1 messages ยท Page 1 of 1 (latest)

lunar obsidianBOT
#

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

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

tight girder
#

hi there!

sturdy iron
#

hello!

tight girder
#

the request you shared is indeed updating an existing customer with a new email address

sturdy iron
#

hmm so why do I see two entries when I search for the customer name?

#

before updating, I only see one

tight girder
#

what are the two customers you see? can you share their ID?

sturdy iron
#

yes one sec

#

cus_QSJFpn7zN44M6Q
cus_QKoauGUEPLg8jj

#

hmmmm, I think the email I changed it to, there was already an existing customer with that email

#

does that have to do with why I see two entries?

tight girder
#

looks like it. one was created this month, the other last month.

sturdy iron
#

yeaah

#

hmm, so thats probably why I see two customers right?

tight girder
#

but these customers seemt o be using different emails?

#

where exactly do you see the two customers? in the Stripe dashboard?

#

after you searched for the email?

sturdy iron
#

I search for the customer name

#

so what I want is

#

when I search for the customer name, that customer to popup

#

in this case, the customer I wanted to update was called Hozier

#

it had an email email1

#

I updated it to email2

#

turns out email2 already existed on Stripe as a separate customer

#

now what has happened instead is that both cus 1 & 2 have the name Hozier

tight girder
#

well they have the same name, so it's expected that you see the two customers when searching for their name

sturdy iron
#

I see, so basically email is kind of an identifier in Stripe?

#

its not as if it is just another field in the customer object

#

emails are supposed to be singleton

#

thats why when I update it to something which already exists, it will first search if there is a customer already

#

and it basically updated the name of email2 to match Hozier

tight girder
#

I'm confused. you can create as many Customers as you'd like in Stripe, with zero restrictions on their name and/or email. like you could have 300 Customers obejcts all with the same name and email and it will work

sturdy iron
#

so here's the thing, I will explain again

#

there are two customers - 1 and 2

#

customer 1's name is Hozier

#

customer 2 - Idk, not relevant (but not Hozier)

#

customer1 has email id email1 and customer2 has email id email2

#

I update customer-1's email to email2

#

now there are two accounts with their email as email2 (atleast what I expect)

#

now I search for customers with name Hozier again

#

I see two customers

#

why?

#

earlier there was only one

tight girder
#

it's your code who sets the name of these two customers.

#

if that's not expected, you need to review your code.

sturdy iron
#

I see

#

thanks for the logs, I will check what my code is doing

tight girder
#

happy to help ๐Ÿ™‚

sturdy iron
#

btw is there a timeout for this thread to close?

#

if yes, what is it?

lunar obsidianBOT
tight girder
#

it depends, but after ~20 minutes of inactivity we usually close a thread

sturdy iron
#

seems that the issue is fixed

#

thank you @tight girder