#sintonz-duplicate-cards
1 messages · Page 1 of 1 (latest)
@dire briar we don't do any de-duplication on our end. If you want to avoid this usually you would show the customer their existing card, like their last 4 + expiration like Amazon does and ask them if they want to re-use that card or add a new one for example
you can also detect duplicates by looking at the card's fingerprint
Oh ok thanks. I have a few other questions
what does expand=['latest_invoice.payment_intent'] mean when creating a subscription using stripe.Subscription.create
it should be covered in the docs you're reading in details but it means that you're also retrieving other objects in the API that will be helpful for the next step, it's related to the Expand feature documented in details at https://stripe.com/docs/expand
Ok thanks it has been a while since I wrote the code I need to rework things a bit now that I have multiple payment methods.
I have another question about my process and I am curious if you have any better ideas to improve it. I will pseudo code it for you one moment
sure ask your question!
ok almost done with the pseudo code
sure
Let me know if that process can be improved. I also have a few more questions about how I need to do a few things (like instead of storing the customer id in the db, query it with the stripe API using the db email and get the price id for the subscription from the stripe API rather than my db
Currently I am storing a customer id in my db for each user as soon as they signup for my website
Now I am thinking of not doing that and only create the customer id if they are a brand new user for my site and decide to pay. Otherwise if the customer id exists in stripe based on my user table db email, then use the same customer id for that email address to create the subscription
give me a min to read
k
yes so what you said makes sense
I need to do a few things (like instead of storing the customer id in the db, query it with the stripe API using the db email and get the price id for the subscription from the stripe API rather than my db
you can list Subscriptions on a Customer using the list Subscriptions endpoint: https://stripe.com/docs/api/subscriptions/list
that will get you all the subs on that Customer, from which you can get the Price ID(s)
I was thinking of doing this https://dpaste.org/ucex
Right now I am storing subscription id, price id, and customer id in my database
So instead I think I have to do those 2 things. As for subscription id, it will only get populated in my db stripe only table if the customer makes a successful payment
I want to avoid NULL columns as much as possible
I mean ideally you store all those (price, sub and customer) IDs on your end
so you your look ups are quicker
because if I make a stripe only db table and I populate a customer id in it, subscription id and price id will be NULL in that table
and you don't have to make multiple READ requests to Stripe
True that is another difference
So many tradeoffs now all because I added crypto payments which tbh is so much easier to add than the stripe api
All right I think I will continue on thinking about how I want to design my db. You helped me a lot in the past I think with Stripe with this massive code I have lol