P0intMaN / zbunker-website

zbunker-website is an open source project aimed at creating a website for the official ZBunker youtube channel. ZBunker is an open, community-based classroom run by a bunch of computer science undergrads with a motive to upskill youth and empower them to make quality, open source contributions
MIT License
6 stars 14 forks source link

Donations Gateway / Payment Integration #105

Open ashutoshkrris opened 2 years ago

ashutoshkrris commented 2 years ago

I would like to work on this issue. I'll use Instamojo as the payment service.

P0intMaN commented 2 years ago

Sounds awesome! I was thinking of using Stripe over Instamojo (Stripe's been in this industry way longer than Instamojo ig). Maybe its because I haven't done payment integration before. Would love your recommendation here as well.

Also, Stripe is waiving off usd 1000 worth of transactions (Github Student Developers Pack.. thought of grabbing it :p)

ashutoshkrris commented 2 years ago

No problem. We can go ahead with Stripe too.

ashutoshkrris commented 2 years ago

@P0intMaN Could you please elaborate how would you like the donation thing happen?

P0intMaN commented 2 years ago

Alright, the users can donate to zbunker-website if they find would like to support us. The donation is only a one time donation and can be accessed via applying for a Prime membership.

Now, we will store the prime members along with the ordinary users in the Users table. Users table will have an extra column called prime. Default value of it would be FALSE and the prime users will have it as TRUE.

P0intMaN commented 2 years ago

Now, login functionality is only for PRIME members. An ordinary user cannot login to our website. As you may have noticed.

ashutoshkrris commented 2 years ago

@P0intMaN So, after the user fills up the signup form and clicks on the signup button, the user should be created but the prime column should be set to FALSE. Instead of redirecting to login page, the user should first pay the fixed amount and on successful payment, they will be redirected to the login page. Also, the prime column should be changed to TRUE now. While logging in, we can check this prime field.

Is it okay?

P0intMaN commented 2 years ago

Exactly. you followed along correctly.

P0intMaN commented 2 years ago

So, what's it going to be? Stripe or Instamojo

ashutoshkrris commented 2 years ago

So, what's it going to be? Stripe or Instamojo

Stripe, as you suggested

ashutoshkrris commented 2 years ago

@P0intMaN There's a minor change in the workflow:

The signup will work as it is, i.e., the user will signup and get redirected to the login page. Whenever a user logs in, we check the prime field. If it's TRUE, the login works fine. If it's FALSE, user is redirected to a Payment page.

P0intMaN commented 2 years ago

Oh, my bad. Yes, you are absolutely right. My logic had flaws in it. We should check the prime field every time the user checks in. If its TRUE then he would be logged in and if its not, then redirect to Payment Page