#sodium-paymentlink-tracking
1 messages ยท Page 1 of 1 (latest)
sodium-paymentlink-tracking
Hey @void dust, I'm not entirely sure I follow the ask. A PaymentLink usually is used to sell one thing to N people, not to identify a specific customer so I don't really get what UID you are referring to
context:
I'm selling a subscription to my product and on every customer request to my services, I need to know whether or not the customer is paying by querying stripe's api's with the customerID.
However, I have no way of knowing what the customerID of the user is if the customerID and userID aren't associated with each other in my database.
I need a way to associate the two fields together when a customer purchases a subscription.
yeah I don't really get it yet I'm sorry. If you use PaymentLink, you're going to like get a URL like https://buy.stripe.com/1234 and you're can like tweet this or something. There's no customer yet
if you already have an existing customer in your system and you want to start a subscription for them, you usually would use Checkout instead
forget the stripe link for a second --
when a customer buys a subscription to my product I need to know which userID in my database is associated with that customerID field from stripe so I can save the two together? Do you know how I can go about this
Usually you create the Customer https://stripe.com/docs/api/customers/create and get the cus_123 and then you store in your own database "oh my user koop123 is cus_ABC"
Or you can set your own customer id in metadata on that Customer https://stripe.com/docs/api/metadata
ok makes sense. and from there when the user decides to purchase the product I can generate a payment link asocaited with that customer id?
kind of. Really a PaymentLink is like a "factory for orders". You say "Oh I sell my book for $10, give me a link to email 50k people" you don't do a unique link per person.
So if your customer is on your app ready to pay, usually you just create a Checkout Session for their specific payment and tied to their Stripe Customer id already
right - so a stripe generated link wouldn't work in my case because that can be easily shared as it's meant to be a "factory", and wouldn't be able to associate a purchase with one particular customer.
I mean there are ways, but that doesn't seem like the right fit for you in the way you describe it at least
how are you sending the customer to the payment? Emailing them a link? Or they are on your app already ready to pay?
It's a small menubar app built in electron, so paying inside the window would be tough.
I guess emailing them a link, since I have this info, would be a good bet?
I mean not really, that's why I ask
If your customer is in your app and ready to pay, you redirect them to Checkout in real time
if your plan is to email them a link, it's different, because by default a Checkout Session's URL expires after 1 day so it wouldn't work
i can redirect them in real time but ~outside~ of my electron app, so i need a link that is associated with the customerID field from stripe
sorry if this isnโt making sense, kind of a niche use case
all good, you mostly really just need to use Checkout
https://stripe.com/docs/api/checkout/sessions/create and you can add whatever metadata you want and it will be reflected back after completion
does that make sense?
yes. I am creating a stripe customer when a user creates an account on my app.
when the user decides they want to buy the product, I create a checkout session passing in that customerID from stripe.
does that make sense? ๐
yes!
lol thank you
lmao
chill dingbot we good here
haha sorry we're testing a new feature ๐น
usually we have to join existing threads one by one and it takes like 4 clicks each time and @misty mantle just built a command for us that joins them all automatically
lol one day maybe
@misty mantle I have a fat angel check for dingbot spinoff. ya'll know where to find me...