Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SubscriptionExpired error when the subscription is still valid #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

IrvanFza
Copy link

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: #5 (comment)

@IrvanFza
Copy link
Author

P.S.: This is the first time I read and write code in Rust, so please share your thoughts if the code is bad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant