How do I implement login only after payment functionality using Firebase authentication/Firestore?

Viewed 25

I would like to know how I can implement "login only after payment" functionality using Firebase authentication and Firestore:

  1. user clicks on a link on my website, redirecting them to some payment page (could be PayPal or stripe for example).
  2. on the payment page, user fills the payment details and presses "submit"
  3. user is billed, the payment acceptance platform then calls the successUrl which was pre set to some cloud function end point.
  4. the cloud function executes and perform the following: 4.1) generates some strong password. 4.2) sends a link with the strong password to the paying user ("this is your initial password, enter the following link in order to set a new password").
  5. the paying user enters their email inbox Clicks the link that was sent and redirected to my website login page.
  6. on the login page, the UI presents an empty box for the initial password.
  7. the user enters the initial password and then the UI lets them choose a permanent password.
  8. user chooses the permanent password and presses "submit"
  9. the user is now logged with their permanent password and email.

Now, the user can log with their permanent password and email.

0 Answers
Related