付款成功后验证新用户的最佳方式是什么?
我有一个会员注册流程,需要每月支付订阅费用。我正在运行一个脚本,可以使用 IPN 脚本更新我的会员数据库。我很好奇在新用户成功提交付款后验证他们的最佳方法。这是我为此过程设想的工作流程,但如果您以更直接的方式做了类似的事情,请告知。
步骤 1) 新用户填写注册表单,其中包括他们的用户名和密码。
- 此时,我将获取他们生成的密码并在数据库中对其进行操作。这样,如果他们尝试登录,他们将被拒绝访问。
步骤 2) 用户通过第三方处理机构提交信用卡付款。第三方处理器发送 IPN 来更新数据库。
- 使用 IPN 脚本,一旦验证了他们的付款方式,我会将密码设置回他们创建的密码。
第 3 步)用户通过成功付款进行验证。
- 由于他们的密码已恢复为最初想要的密码,因此用户可以登录。
我看不出有什么理由这行不通,但它看起来很笨重。有更好的办法吗?谢谢。
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.
- Since their password is back to the one they initially wanted, the user can login.
I don't see any reason this would not work, but it seems clunky. Is there a better way? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
与其不正确设置密码,为什么不添加一个名为“paid”的额外字段并将其默认为“0”,然后如果/当他们付款时将其设置为“1”。
然后,在登录脚本中,只需确保当他们尝试登录时该字段设置为“1”。
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.
我假设他们购买了 30 天的订阅?如果是这样,当付款到来时,将名为 DaysLeft 的字段设置为 30,然后每天从该字段中减去 1。当用户尝试登录时,它会获取他们的姓名并验证他们的密码,然后检查以确保他们还剩天数 DaysLeft > > 0. 这允许他们登录。
这将是一个简单的存储过程,您可以每天运行它,并处理每个用户。它还会跟踪他们需要再次付款的时间。您可以在登录时设置提醒,当他们还剩不到 5 天之类的时候。只是一些想法
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