开发者

What is the Best Way to Validated New User after Successful Payment?

I have a member sign-up process which requires a monthly subscription payment. I have a script running which can update my member's database using an IPN script. I am curious about the best way to go about validating a new user once they have successfully submitted payment. Here is the work flow that I have envisioned for this process, but please advise if you have done something similar in a more direct fashion.

Step 1) New User completes signs up form which includes their username and password.

  • At this point I would take the the password they generated and manipulate it in the database. This way if they tried to log in they would be denied access.

Step 2) User submits credit card payment through a third party processor. Third party processor sends out IPN to update database.

  • Using the IPN script, once their payment method is validated I would set the password back to the one that they created.

Step 3) User is validated with a successful payment.

I don't see any reason this would not work, but it seems clunky. Is there a better way? Thanks.


Rather than not setting their password correctly, why not just have an extra field named 'paid' and default that to '0' and then if/when they pay it's set to '1'.

Then in the login script simply make sure that field is set to '1' when they try to login.


I'm assuming they buy 30 days of subscription? If so when the payment comes in set a field called DaysLeft to 30, then every day you subtract 1 from that field. When a user tries to log in, it gets their name and verifies their password, then check to make sure they have days left DaysLeft > 0. This allows them to log in.

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜