This is my current workflow upon user filling in the sign up form and clicking on the sign up button:
If user exists (but has not paid), delete the user and log user out
Sign up user
Redirect to Stripe payment page
I included step 1 because sometimes users abort the payment and retries, and step 2 cannot run again because the user already exists.
But somehow there are some users who complete payment but the user is NOT created (I suspect it’s due to Step 1 that deleted it). I’m not sure how this happens - maybe the user clicks Back after payment or something.
Any idea how to resolve this? Or any documentation on the proper workflow for signing up users? Thanks!
Also, I guess we need to store the user-entered details (name, email, password) somewhere before the payment is actually made? Specifically, it would be difficult to store the password in a temporary data type other than in User?