Paypal 订阅 IPN - 用户多次订阅的问题

发布于 2024-08-26 13:23:47 字数 739 浏览 10 评论 0原文

我正在使用 PayPal 订阅和即时付款通知 (IPN) 来处理我网站上的订阅者。

在大多数情况下,它运行良好,但我偶尔遇到一个问题。

通常,如果用户取消订阅,我会等待“期限结束”(subscr_eot) 通知,然后再禁用对我的网站的访问。

因此,如果他们预付整个月的费用,然后立即取消,他们仍然可以使用该月剩余的时间(理应如此)。

但有些用户遇到了这个问题:

  1. 取消订阅
  2. 在达到“期限结束”之前,他们决定重新订阅
  3. 当第一次订阅达到“期限结束”时,我的应用程序收到通知并启动向用户发送一封电子邮件,内容类似于“您的帐户已被禁用,如果您想再次注册,可以通过单击此处重新订阅”。
  4. 这让他们感到困惑,因为他们在想……这很奇怪,我以为我一周前就订阅了(他们确实订阅了)。所以他们又去订阅了。现在他们对我的网站有两个并发运行的订阅,我在一两个月内收到一封支持电子邮件(“天哪,这个月你给我开了两次帐单!!”)

所以我还没有找到解决这个问题的好方法。我想最好的解决方案是在收到“期限结束”通知时进行额外的 API 调用,该通知会询问 paypal“嘿,这个人已经重新订阅了吗?”。如果是这样,则无需关闭该电子邮件。但我还没有找到任何方法来执行此 API 调用。

另一个解决方案是在他们取消时立即禁用他们的帐户(“subscr_cancel”通知),但随后我收到不同的愤怒的支持电子邮件“嘿,我预付了整个月,为什么我的帐户已经被禁用了!!”。

还有其他人解决了这个问题吗?

I'm using paypal subscriptions and the instant payment notification (IPN) to handle subscribers on my site.

For the most part it works well but there is one occasional problem I've encountered.

Usually if a user cancels their subscription, I wait for the "end of term" (subscr_eot) notification before disabling access to my site.

So if they prepay for the whole month, and then cancel right away, they still have access for the rest of the month (as it should be).

But some users are having this problem where they:

  1. Cancel their subscription
  2. Before the "end of term" is reached they decide to re-subscribe
  3. When the "end of term" is reached for their first subscription, my app receives the notification and fires off an email to the user with something like "your account has been disabled, if you ever want to sign up again, you can re-subscribe by clicking here".
  4. This confuses them because they are thinking...that's weird, I thought I subscribed like a week ago (and they did). So they go subscribe AGAIN. Now they have two concurrent running subscriptions to my site and I get a support email in a month or two ("wtf you billed me twice this month jerk!!")

So I haven't found a good way to fix this. I guess the best solution would be to do an additional API call when the "end of term" notification is received which asks paypal "hey did this person already re-subscribe?". If so then no need to fire off that email. But I haven't seen any way to do this API call yet.

Another solution is to disable their account immediately when they cancel (the "subscr_cancel" notification) but then I get different angry support emails "hey I prepaid for the whole month why was my account disabled already!!".

Anyone else solved this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

温柔戏命师 2024-09-02 13:23:47

我知道这是一个旧线程,但我还没有看到这个问题的实际答案,所以如果有人碰巧像我一样想知道这个问题,这里有一个解决方案。

如果有人在学期结束(subscr_eot)之前取消他们的帐户(subscr_cancel),我会在我的数据库中设置它来处理它。例如,如果数据库中有一个“Users”表,只需添加一个新的“int”字段并将其命名为“Term”。默认情况下,该字段应设置为“0”。然后,在 IPN 内部进行设置,以便如果用户在期限结束之前取消订阅,则会将该用户的“期限”字段设置为“1”。如果该用户返回并重新订阅您的服务,请让 IPN 将该用户的“期限”字段更新回“0”。

然后,在您的邮件脚本内,让它在学期结束时检查该用户的“学期”字段。如果它设置为“0”,则不发送电子邮件。如果它设置为“1”,则发送电子邮件说“再见!”

I know this is an old thread, but I haven't seen an actual answer to this question, so if someone happens to wonder across this like I did, here's a solution.

If someone cancels their account (subscr_cancel) before their end of term (subscr_eot) I would set it up in my database to handle it. For instance, if you have a "Users" table in your database, just add a new "int" field and call it "Term." By default, this field should be set to "0." Then, inside of your IPN, set it up so that if a user cancels their subscription before the end of the term, it sets the "Term" field for that user to "1." If that user goes back and re-subscribes to your services, have the IPN update the "Term" field for that user back to "0."

Then, inside of your mailing script, just have it check the "Term" field for that user when it runs for the end of term. If it's set to "0" then don't send the email. If it's set to "1" then send the email saying, "Adios!"

岛徒 2024-09-02 13:23:47

据我所知,如果您使用网站支付标准/专业按钮(我假设您是这样),则没有 paypal api 可以检查订阅。

我通过在数据库中保留活动/取消/重新订阅状态来处理这个问题,并根据我从 paypal 获得的 IPN 消息更新状态。我使用按钮中的自定义字段将 IPN 消息映射到我的用途,该字段会在每条 IPN 消息上发回。

还有很多第三方可以帮助您管理此流程,因为 paypal 的 api 在这方面有点薄弱。 Recurly 是我研究过并计划实施的一个,还有其他的。

As far as I know there is no paypal api to examine subscriptions if you are using website payment standard/pro buttons, which I assume you are.

I deal with this by keeping the active/cancel/resubscribe state in my database and update the state based on the IPN messages I get from paypal. I map the IPN messages to my uses with the custom field in the button, which is sent back on every IPN message.

There are also a lot of third parties which help you manage this process since paypal's api is a little weak in this area. Recurly is one I've looked at and plan to implement, and there are others out there as well.

忘东忘西忘不掉你 2024-09-02 13:23:47

引用:回复:subscr_eot 何时发布?

如果您在 2009 年 11 月之后开始接受订阅,订阅者 ID 将以“I-”开头 - 并且在其时间结束时不会返回“subscr_eot”。 Paypal 希望您记下他们的订阅时间,并在该期限到期时更新帐户以降级(或其他),除非客户在此期间再次付款。

Cite: Re: When is subscr_eot issued?

If you started accepting subscriptions after November 2009, the subscriber ID's will start 'I-' - and will not return a 'subscr_eot' at the end of their time. Paypal expect you to keep note of how long they are subscribed for and update the account to downgrade (or whatever) when that period expires, unless the customer pays again in the meantime.

|煩躁 2024-09-02 13:23:47

如何防止重复的 PayPal 付款?

您需要添加一个唯一标识符“发票”参数;并在“个人资料”> 中启用“阻止重复付款”您位于 www.paypal.com 的帐户中的“我的销售工具”部分

How to prevent duplicate PayPal payments?

You would want to add a unique identifier to the "invoice" parameter; and enable "Block duplicate payments" within the 'Profile' > 'My selling tools' section on your account at www.paypal.com

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文