#vlajke-duplicate-customers

1 messages ยท Page 1 of 1 (latest)

balmy socket
#

Hello! Do you have examples of two customer IDs that you believe are duplicates?

charred tinsel
#

I do, how do I share that with you?

#

Just the IDs?

balmy socket
#

Yup, you can just share the IDs here

charred tinsel
#

Sure thing and thanks for helping me out!

cus_Kx8FTey2tcMfOg

cus_KwT1DoYAiahjFF

balmy socket
#

So those two customers were created more than 24 hours apart from each other - do you have any logic on your end to check if you have an existing customer with that specific email before creating a new one? Idempotency is more useful when you want to retry requests that you aren't sure were successful the first time around.

charred tinsel
#

Yes, we are in fact checking if the email exists or no on our system. In fact, they have to be logged in upon profile creation to create the subscription

#

However, that's rarely happening (even though we are not sure why), what is happening more often is canceled transactions

#

This is the same customer

#

everything happened within 3 minutes

balmy socket
#

Something about your logic is not correctly picking up on the fact that you already have an existing customer with that email address so that would be something you'd have to look into more closely on your end.

#

For the canceled transactions, can you send me one of those Payment Intent IDs so I can take a look?

charred tinsel
#

Sure thing

#

pi_3KHQSHL6EaNAw2aw0SxHPniH

balmy socket
#

So looking at that specific Payment Intent it looks like you were attempting to create a Subscription but it failed (since the customer had no payment method at the time) so we immediately cancelled the payment intent.

charred tinsel
#

Which is really weird, do you happen to see what request we sent through API? It's exactly the same for everyone

balmy socket
charred tinsel
#

If we send multiple API requests in a single query, will that confuse the system? For example, if we are creating an account and its subscription in a single query, will that be a problem?

balmy socket
#

What do you mean by a single query?

charred tinsel
#

Like if we send 3 different posts to the api at the same time

balmy socket
#

I don't think that's necessarily the issue here though - from what I can see, the issue here is just that this customer has not default source or payment method on it at all

charred tinsel
#

I just think we are not sending the right customer information to stripe and therefore the method is missing

#

There's no way we wouldn't send (it's required) the method

#

Slightly off topic: Would you mind helping me where/how to add this \Stripe\Stripe::setMaxNetworkRetries(2);

#

We are using codeigniter 4 with Stripe library

balmy socket
#

Are you directly using the Stripe php library?

charred tinsel
#

Yes, stripe php library

charred tinsel
balmy socket
#

For setting max network retries, you can just set that after you set your API key

charred tinsel
balmy socket
#

Yes, those two requests are the same but the Customers that you're using in the request are different. The customer cus_KxTYW6XWyE1sIp for request req_T8VoWy74SfH62b does not have any default source or payment method while the customer cus_KxTk3pDHTZA0IS for request req_HDKOtzemo1vOcK does. You can compare the creation requests for the two customers and see the difference:

charred tinsel
#

Gotcha, so we didn't send any payment information through API?

balmy socket
#

Correct - you never sent any payment information

charred tinsel
#

Would you mind sending me which api we should use to send the payment info? Just want to confirm if we are using the right one

balmy socket
#

There are multiple ways to do that - your integration is currently using tokens so you can set source when you create a customer to have it automatically set as the default on the customer. We do generally recommend that users now use Payment Method instead of Tokens/Sources, but that would require some changes on your end to support

charred tinsel
#

Would you mind sending me the link for the method you've recommended?

balmy socket
charred tinsel
#

Thank you, I will go through this

#

I have few more questions for you if you don't mind, shall I create a new topic?

balmy socket
#

If you have more question feel free to continue them here! I'm heading out, but @candid helm is around to help

candid helm
#

Hello ๐Ÿ‘‹

charred tinsel
#

Hey Pompey, thanks for reaching out!

So, we are using an account that is integrated on few different locations (websites/applications), and we would like to run a report through API that's only related to the products for a specific website. Is there anyway we could do that with specific product ID or category?

candid helm
#

Good question. Do each of the websites sell different sets of products?

charred tinsel
charred tinsel
candid helm
#

Thank you for the clarification. Looking in to how you may do this.

charred tinsel
#

Thank you very much

candid helm