PayPal 订阅 IPN 下一个计费日期 [英] PayPal Subscription IPN Next Billing Date

查看:28
本文介绍了PayPal 订阅 IPN 下一个计费日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网络应用使用 PayPal 每月订阅.我在付款、用户注册/取消等时收到 IPN 通知,这一切似乎都运行良好.

My web app uses PayPal monthly subscriptions. I receive IPN notifications when payments are made, users signup/cancel, etc and this all seems to work well.

IPN 消息中似乎缺少的一件事是关于下一个计费日期的任何指示.https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNandPDTVariables/#id091EB0901HT

One thing that appears to be missing from the IPN messages is any sort of indication about the next billing date. https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNandPDTVariables/#id091EB0901HT

起初我认为因为它是按月订阅,所以我可以简单地在前一天加上一个月,但 PayPal 似乎有一种计算下一个付款日期的时髦方式 - 它并不总是 30 或 31 天或月.

At first I thought that since it's a monthly subscription, I can simply add a month to the previous date, but PayPal seems to have a funky way of figuring out the next payment date - it's not always 30 or 31 days or a month.

下一个计费日期可从 PayPal 内部获得,但似乎不会在任何 IPN 消息中发送.

The next billing date is available from within PayPal itself, but doesn't seem to be sent along in any IPN messages.

有谁知道从 IPN 消息中可用的信息中解决这个问题的简单方法?

Does anyone know of a simple way to work this out from the information that is available in the IPN messages?

推荐答案

我最近也遇到了这个问题.我不确定人们能否就订阅一个月"的含义获得一致的方案.例如,如果您在 3 月 31 日注册服务,下一次付款是在 4 月 30 日还是 5 月 1 日到期?您只需要选择一个并将其清楚地传达给您的用户即可.不幸的是,PayPal 没有为我们提供这种礼遇.

I recently came across this issue too. I'm not sure one can get a consistent scheme as to what a "month" of subscription means. For instance, if you sign up for your service on the 31st of March, is the next payment due on the 30th of April or on the 1st of May? You just have to pick one and communicate clearly it to your users. Its unfortunate PayPal doesn't afford us this courtesy.

最后,我决定让用户可以访问该服务 32 天或 367 天,分别按月和按年订阅.我知道您可能会在一两天内失败",但我认为最好允许一些宽限期访问,而不是冒险给用户比付出的时间更少的时间.

In the end I decided to give the users access to the service for 32 days or 367 days, for monthly and annual subscriptions respectively. I know you may "lose" out on a day or two here and there but I think its better to allow some grace access rather than risk giving the user less time than paid for.

如果一切顺利,如果您还监听 subscr_eotsubscr_payment IPN(请参阅 https://stackoverflow.com/a/1195246/1852838).我从下一次付款之日起续订上述期限,以便订阅始终与 PayPal 付款周期同步.PayPal 会在最后一个付费期结束时向您发送 eot IPN,以便您可以在服务器端终止订阅.这意味着您决定给予他们多少恩典"并不重要.

If all goes well, it doesn't actually matter how long you activated the account for if you also listen for the subscr_eot and subscr_payment IPNs (see https://stackoverflow.com/a/1195246/1852838). I renew the above period from the date of the next payment so that the subscription is always in sync with the PayPal payment cycle. PayPal will send you the eot IPN when the last paid period ends so you can terminate the subscription on the server side. This means it doesn't matter so much how much "grace" you decide to give them.

就提供支付至"而言,我只会提供宽限期"日期,因为您是实际决定这多长时间的人.但是,我建议您也让他们知道他们应该按照下一次付款的最保守估计付款.这将是最后一次付款后的 30 天或月末(如果在它之后).

In terms of a providing a "paid until" I would simply provide the "grace" date as you are the one who actually decides how long this is. I would, however, recommend that you also let them know that they should make a payment by the next most conservative estimate for the next payment. This would be 30 days after the last payment or the end of the month if that falls after it.

这篇关于PayPal 订阅 IPN 下一个计费日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆