orly
orly copied to clipboard
Fix SubscriptionExpired error when the subscription is still valid
This PR fixes the SubscriptionExpired
error while the current subscription is still active. Turn out that when the subscription is still active, the response doesn't have a cancellation_date
value. So I skip the entire expiration check if cancellation_date
is empty.
Active subscription response example:
BillingInfo {
subscription: SubscriptionInfo {
cancellation_date: None,
},
trial: TrialInfo {
trial_expiration_date: Some(
"2019-11-17T04:02:39.550054Z",
),
},
}
Related discussion: https://github.com/hurlenko/orly/pull/5#issuecomment-1636152754