在 Recurly 网站上查看有效的非续订订阅时,例如
https://xxxxxx.recurly.com/subscriptions/xxxxxxxxba354d5b84812419xxxxxxxx
Recurly 网站显示如下信息:
状态:有效
开始日期:2016 年 2 月 9 日晚上 7:44 UTC
当前期间:2016 年 2 月 9 日 - 2016 年 3 月 9 日
下一张发票:不会续订
计费周期:剩余 0 次续订(共 1 次)
结束日期:2016 年 3 月 9 日世界标准时间下午 7:44
使用 Recurly API 查找相同的订阅,我不知道如何确定订阅是否会续订。这是 PHP,但语言无关紧要:
const TFORMAT = "D d M H:i:s \U\T\C Y";
$sub = Recurly_Subscription::get('xxxxxxxxba354d5b84812419xxxxxxxx');
echo $sub->state;
echo '<br>' . ($sub->activated_at ? $sub->activated_at->format(TFORMAT) : "nope");
echo '<br>' . ($sub->current_period_started_at ? $sub->current_period_started_at->format(TFORMAT) : "nope");
echo '<br>' . ($sub->current_period_ends_at ? $sub->current_period_ends_at->format(TFORMAT) : "nope");
echo '<br>' . ($sub->expires_at ? $sub->expires_at->format(TFORMAT) : "nope");
echo '<br>' . ($sub->canceled_at ? $sub->canceled_at->format(TFORMAT) : "nope");
这输出:
2016 年 2 月 9 日星期二 19:44:48 UTC 2016 年2月 9 日
星期二 19:44:48 UTC 2016 年3 月 9 日星期三 2016 年 3 月 9 日
星期三
19:44:48
不不不
如何确定此订阅是否会续订?