When viewing an active, non-renewing subscription on the Recurly website, such as
https://xxxxxx.recurly.com/subscriptions/xxxxxxxxba354d5b84812419xxxxxxxx
the Recurly website shows info like this:
Status: Active
Start Date: Feb 9, 2016 7:44 PM UTC
Current Period: Feb 09, 2016 — Mar 09, 2016
Next Invoice: Will not renew
Billing Cycles: 0 renewals remaining (of 1)
End Date: Mar 9, 2016 7:44 PM UTC
Looking up the same subscription using the Recurly API, I cannot figure out how to determine if the subscription will renew. This is PHP, but language doesn't matter:
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");
This outputs:
active
Tue 09 Feb 19:44:48 UTC 2016
Tue 09 Feb 19:44:48 UTC 2016
Wed 09 Mar 19:44:48 UTC 2016
nope
nope
How can I determine if this subscription will renew?