-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add support for cancelling subscriptions #46
base: main
Are you sure you want to change the base?
Conversation
@arusahni Thank you for your review |
I'll open another branch to main after this PR is merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for submitting this PR! Since you're an external contributor the secrets required for the API test suite are unavailable to Github Actions. I ran the tests locally and can confirm they work.
In addition to the requested change, could you squash your commits? I'll merge this once everything is resolved.
|
||
/// Parameters for cancelling a subscription. | ||
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize)] | ||
pub struct CancelSubscriptionParams { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For things that map to a POST body, we prefer to use "request"
pub struct CancelSubscriptionParams { | |
pub struct CancelSubscriptionRequest { |
// The Orb API does not immediately update the status of a cancelled subscription. | ||
// But the end date is set to now when cancelled immediately. | ||
// assert_eq!(immediately_cancelled_subscription.status, Some(SubscriptionStatus::Ended)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, there are some frustrating latencies contained in the API. Depending on what you've seen, we'd be open to a sleep (as we do in test_events()
). If it's longer than several seconds, I think it's fine to leave this as-is.
Motivation
Add support for cancelling subscriptions
https://docs.withorb.com/reference/cancel-subscription
Checklist
[Unreleased]
section header.