[][src]Struct stripe::UpdateSubscription

pub struct UpdateSubscription<'a> {
    pub application_fee_percent: Option<f64>,
    pub billing: Option<SubscriptionBilling>,
    pub billing_cycle_anchor: Option<SubscriptionBillingCycleAnchor>,
    pub billing_thresholds: Option<SubscriptionBillingThresholds>,
    pub cancel_at_period_end: Option<bool>,
    pub coupon: Option<CouponId>,
    pub days_until_due: Option<u32>,
    pub default_payment_method: Option<&'a str>,
    pub default_source: Option<&'a str>,
    pub default_tax_rates: Option<Vec<String>>,
    pub expand: &'a [&'a str],
    pub items: Option<Vec<UpdateSubscriptionItems>>,
    pub metadata: Option<Metadata>,
    pub prorate: Option<bool>,
    pub proration_date: Option<Timestamp>,
    pub tax_percent: Option<f64>,
    pub trial_end: Option<Scheduled>,
    pub trial_from_plan: Option<bool>,
}

The parameters for Subscription::update.

Fields

application_fee_percent: Option<f64>

A non-negative decimal between 0 and 100, with at most two decimal places.

This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. The request must be made with an OAuth key in order to set an application fee percentage. For more information, see the application fees documentation.

billing: Option<SubscriptionBilling>

Either charge_automatically, or send_invoice.

When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions. Defaults to charge_automatically.

billing_cycle_anchor: Option<SubscriptionBillingCycleAnchor>

Either now or unchanged.

Setting the value to now resets the subscription's billing cycle anchor to the current time. For more information, see the billing cycle documentation.

billing_thresholds: Option<SubscriptionBillingThresholds>

Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period.

Pass an empty string to remove previously-defined thresholds.

cancel_at_period_end: Option<bool>

Boolean indicating whether this subscription should cancel at the end of the current period.

coupon: Option<CouponId>

The code of the coupon to apply to this subscription.

A coupon applied to a subscription will only affect invoices created for that particular subscription.

days_until_due: Option<u32>

Number of days a customer has to pay invoices generated by this subscription.

Valid only for subscriptions where billing is set to send_invoice.

default_payment_method: Option<&'a str>

ID of the default payment method for the subscription.

It must belong to the customer associated with the subscription. If not set, invoices will use the default payment method in the customer's invoice settings.

default_source: Option<&'a str>

ID of the default payment source for the subscription.

It must belong to the customer associated with the subscription and be in a chargeable state. If not set, defaults to the customer's default source.

default_tax_rates: Option<Vec<String>>

The tax rates that will apply to any subscription item that does not have tax_rates set.

Invoices created will have their default_tax_rates populated from the subscription.

expand: &'a [&'a str]

Specifies which fields in the response should be expanded.

items: Option<Vec<UpdateSubscriptionItems>>

List of subscription items, each with an attached plan.

metadata: Option<Metadata>

A set of key-value pairs that you can attach to a subscription object.

This can be useful for storing additional information about the subscription in a structured format.

prorate: Option<bool>

Boolean (defaults to true) telling us whether to credit for unused time when the billing cycle changes (e.g.

when switching plans, resetting billing_cycle_anchor=now, or starting a trial), or if an item's quantity changes. If false, the anchor period will be free (similar to a trial) and no proration adjustments will be created.

proration_date: Option<Timestamp>

If set, the proration will be calculated as though the subscription was updated at the given time.

This can be used to apply exactly the same proration that was previewed with upcoming invoice endpoint. It can also be used to implement custom proration logic, such as prorating by day instead of by second, by providing the time that you wish to use for proration calculations.

tax_percent: Option<f64>

A non-negative decimal (with at most four decimal places) between 0 and 100.

This represents the percentage of the subscription invoice subtotal that will be calculated and added as tax to the final amount in each billing period. For example, a plan which charges $10/month with a tax_percent of 20.0 will charge $12 per invoice. To unset a previously-set value, pass an empty string. This field has been deprecated and will be removed in a future API version, for further information view the migration docs for tax_rates.

trial_end: Option<Scheduled>

Unix timestamp representing the end of the trial period the customer will get before being charged for the first time.

This will always overwrite any trials that might apply via a subscribed plan. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value now can be provided to end the customer's trial immediately. Can be at most two years from billing_cycle_anchor.

trial_from_plan: Option<bool>

Indicates if a plan's trial_period_days should be applied to the subscription.

Setting trial_end per subscription is preferred, and this defaults to false. Setting this flag to true together with trial_end is not allowed.

Methods

impl<'a> UpdateSubscription<'a>[src]

pub fn new() -> Self[src]

Trait Implementations

impl<'a> Default for UpdateSubscription<'a>[src]

impl<'a> Clone for UpdateSubscription<'a>[src]

impl<'a> Debug for UpdateSubscription<'a>[src]

impl<'a> Serialize for UpdateSubscription<'a>[src]

Auto Trait Implementations

impl<'a> Unpin for UpdateSubscription<'a>

impl<'a> Sync for UpdateSubscription<'a>

impl<'a> Send for UpdateSubscription<'a>

impl<'a> UnwindSafe for UpdateSubscription<'a>

impl<'a> RefUnwindSafe for UpdateSubscription<'a>

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err

impl<T> Same<T> for T

type Output = T

Should always be Self