Skip to content

Commit

Permalink
Merge pull request arlyon#411 from nryanl/fix-cancel-subscription-fields
Browse files Browse the repository at this point in the history
Corrected CancelSubscription fields for current Stripe API version.
  • Loading branch information
arlyon committed Feb 2, 2024
2 parents 7f2b1a9 + 15d08e3 commit 4ce9c17
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/resources/subscription_ext.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use serde::Serialize;

use crate::CancellationDetails;
use crate::client::{Client, Response};
use crate::ids::SubscriptionId;
use crate::params::SearchList;
Expand All @@ -8,12 +9,16 @@ use crate::resources::{CreateSubscriptionItems, Subscription};
#[derive(Clone, Debug, Default, Serialize)]
pub struct CancelSubscription {
#[serde(skip_serializing_if = "Option::is_none")]
pub at_period_end: Option<bool>,
pub cancellation_details: Option<CancellationDetails>,
#[serde(skip_serializing_if = "Option::is_none")]
pub invoice_now: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub prorate: Option<bool>,
}

impl CancelSubscription {
pub fn new() -> CancelSubscription {
CancelSubscription { at_period_end: None }
CancelSubscription { cancellation_details: None, invoice_now: None, prorate: None }
}
}

Expand Down

0 comments on commit 4ce9c17

Please sign in to comment.