#lesinar_best-practices

1 messages ยท Page 1 of 1 (latest)

fallen jacinthBOT
#

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

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

hazy estuaryBOT
storm radish
#

Hi, let me help you with this.

tribal lion
#

๐Ÿ‘‹๐Ÿป

storm radish
#

I will need a bit more details about the situation. What do you exactly mean by "payment" in this case?

tribal lion
#

give me a sec

#

All his payments.

storm radish
#

Sorry, this doesn't make it clearer.

#

I understand you already made some progress in the migration.
What kind of objects are you creating and how exactly?

#

Yes, it's totally possible to reuse the Customer object, but you will need to manually check if a Customer with a given email exists, and if yes, work with the existing Customer object, otherwise create a new one. But I will need more details to be able to provide more detailed advice.

tribal lion
#

I need to sync up with my colleague who worked on the setup, so I'll respond. Please don't close the thread, I'm waiting for his response.

storm radish
#

Okay. The thread will close automatically after some time, but I will keep it open while I'm here.

tribal lion
#

TY

hazy estuaryBOT
tribal lion
#

Example: We have 10 different customers(ids) with the same email address. Each has one successful payment. How we can use one customer, move payments from 9 others to this one and delete those other 9 customers. We want to clear duplicate customers, but currently each has one successful payment attached to it.

valid lance
#

you can't really, you can't move payments or objects from one customer to another. You'd just have to build some workaround layer over it in your database representation of the user("this user is associated with these 10 Stripe Customer objects")

#

you can just prevent it happening in future (by implementing checks like searching for existing customers with a given email address before calling customer.create(), etc)