#S60-Cosminacho - bug
1 messages ยท Page 1 of 1 (latest)
email search is case sensitive via API
if my customer wrote for example that his email is: Cosmin@gmail.com and in a different form his email is cosmin@gmail.com
the search via API will just not give any results
if I search after "cosmin@gmail.com"
Interesting. Does the doc lay out that it should be case insensitive? I will check in to whether this is intended or not
I know that emails are almost always treated case-insensitive so that does sound like something we may want to change
so, if in the checkout session I write the email as "Cosmin@emedi.ro" then this is how the email will be set in the stripe database.
and this really makes some problems.
could you please give me an update here ? If the problem is soreted?
Apologies, was working on other threads, looking in to this now.
When I test this myself, the search is case insensitive
Can you try this as a curl command and see if it still turns up nothing? curl https://api.stripe.com/v1/search/customers -u sk_test_123: \ --data-urlencode "query=email:'Cosmin@gmail.com'" \ -H "Stripe-Version: 2020-08-27;search_api_beta=v1" \ -G
That call should be a GET. Can you send me the setup for the call that you are making that is not returning any customers when you try to search by email?
I used a get too ๐
I did change it to /v1/customers
This is a result of not finding anything. (with cosmin@emedi.ro as search.
This is the search done with: Cosmin@emedi.ro in query.
Hello! Catching up...
The local part of email addresses are case sensitive, so this is expected behavior.
what do you mean by "local part of email addresses?
The part before the @ is case-sensitive.
ahhhh
See here for more details: https://stackoverflow.com/questions/9807909/are-email-addresses-case-sensitive
wow...
Yep. My favorite comment on that one is:
I work at a large company and there is another person with the same first and last name. I discovered today that his local-part differs from mine only in capitalization. This has been working properly, so I was surprised to see "no widely used mail systems distinguish different addresses based on case". We use MS Exchange which I would call "widely used".
ok.
I need a workaround around this
is it possible that I can find out the email address of a completed checkout session?
Yes, it will be on the associated Customer: https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-customer
Let's see...I think I may be able to sort it out this way...:)
thank you so much.
Interesting case though...and even more interesting that you care about such an edge case ๐
Most email servers are configured with case-insensitive local parts, but not all, and if we didn't follow the spec here a non-trivial chunk of the Internet wouldn't work with Stripe. ๐