mongodb - How to keep track of users making Stripe Payments -


i'm trying figure out way mean stack application keep track of users have paid grant them access portion of webpage. i've considered several options: stripe customer id, mongodb record, , html attribute can update.

my mean stack keeps track of users jwt, , appears stripe assigns them own customer id isn't ideal. can done jwt opposed forced cutomer id?

mongodb record. i'm thinking might best option. when new user has been created, i'll give attribute of haspaid = no. update record of customer when payment submitted. guess run script set unpaid each day?

html element/attribute. don't know if possible; cool create key carried during html session after payment received. if person closers browser session closed?

i'm looking guidance on 3 options determine if they're best solution. also, if has suggestions alternatives, i'm ears!

thanks in advance.

speaking generally, common approach second one: use attribute in data model indicates whether user has paid/should granted access. when charge created [0] successfully, update model indicate so, filter access based on attribute.

[0] https://stripe.com/docs/api/node#create_charge


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -