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

查看:73
本文介绍了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,激活帐户的时间实际上并不重要(请参阅

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天全站免登陆