#timmmy - customer mapping
1 messages ยท Page 1 of 1 (latest)
What problems does this cause? It's really up to you. You could create the customer before you create the checkout session and associate them right away, and delete any that don't complete checkout
Okay so I have been told that its best practice to assign the Stripe Customer id to my db user once that event gets triggered
The problem is that the event only knows the Stripe Customer Id and not which db user the customer belongs to
So how do people usually go about this?
I was thinking about manually creating the Stripe Customer once a user tries to initiate a checkout session (And assign the user the Stripe Customer id)
I just dont how that is supposed to work
How should I save the Customer ID in my db if I dont know to which user it belongs
When you create the session you can set your own customer db id in the metadata, for example
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Then when you receive the webhook you can map these together
๐