ps: trying a new way of taking notes while building where i just jot down notes as i build something new

stripe integration

aim:

make purchase credits system which enables this

  • choose how many credits you want to buy ( in $ )
    • 1$ = 10,000 credits
  • get redirected to stripe’s dashboard
  • finish purchasing
  • and once done, you can view the credits available in the navbar of endeva

procedures:

will first make a backend procedure to enable to stripe redirect and callback thing and then add a new property to track the number of credits available on a user’s profile

and a getCredit trpc method which is getting fetched in the /feed page and shows the credit remaining in the navbar

build a popup on the frontend which will let you purchase more credits

steps:

  • going to read stripe docs and see how to integrate “payments”

installed stripe sdk, made new env vars for api key

then made a small component in the nav bar

which looks like this:

now i have to make buy more redirect to a page where the user can select how many credits to buy and pay for it

later from the next day 9 26 pm

was a good sprint, i finished most of it - just the part where you have to update karma is remaining

most of it was just copying code from stripe docs and changing thing here and there quite straight forward


references