What is the best way to verify a new user after a successful payment?

I have a membership registration process that requires a monthly subscription fee. I have a script that can update my member database using an IPN script. I’m curious how best to test a new user after successfully sending a payment. Here is the workflow that I provided for this process, but please let me know if you did something like this in a more direct way.

Step 1) The new user completes the registration of the form, which includes their username and password.

  • At this point, I would take the password that they generated and manipulate it in the database. Thus, if they try to log in, they will be denied access.

Step 2) The user sends a credit card payment through a third-party processor. A third-party processor sends an IPN to update the database.

  • Using an IPN script, once their payment method is verified, I will return the password back to the one they created.

Step 3) The user is verified with a successful payment.

  • Since their password returns to the one they originally wanted, the user can log in.

I see no reason why this should not work, but it seems awkward. Is there a better way? Thanks.

+4
source share
2 answers

Instead of not setting your password correctly, why not just add an extra field with the name "paid", and the default is "0", and then if / when they pay it the value "1".

Then in the login script just make sure the field is set to "1" when they try to log in.

+4
source

I assume they buy a 30 day subscription? If this happens when the payment is set in the field named DaysLeft to 30, then every day you subtract 1 from this field. When a user tries to log in, he gets his name and checks his password, and then checks that they have days remaining DaysLeft> 0. This allows them to log in.

It would be a simple stored procedure that you can run every day and process each user. It also keeps track of how long they will have to pay again. You can set a login reminder when they have less than 5 days left or something like that. Just some ideas

+2
source

Source: https://habr.com/ru/post/1369009/


All Articles