Class Plan

    • Constructor Detail

      • Plan

        public Plan()
    • Method Detail

      • getProduct

        public java.lang.String getProduct()
        Get ID of expandable product object.
      • setProduct

        public void setProduct​(java.lang.String id)
      • getProductObject

        public Product getProductObject()
        Get expanded product.
      • setProductObject

        public void setProductObject​(Product expandableObject)
      • create

        public static Plan create​(java.util.Map<java.lang.String,​java.lang.Object> params)
                           throws StripeException
        You can now model subscriptions more flexibly using the Prices API. It replaces the Plans API and is backwards compatible to simplify your migration.
        Throws:
        StripeException
      • create

        public static Plan create​(java.util.Map<java.lang.String,​java.lang.Object> params,
                                  RequestOptions options)
                           throws StripeException
        You can now model subscriptions more flexibly using the Prices API. It replaces the Plans API and is backwards compatible to simplify your migration.
        Throws:
        StripeException
      • update

        public Plan update​(java.util.Map<java.lang.String,​java.lang.Object> params)
                    throws StripeException
        Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan’s ID, amount, currency, or billing cycle.
        Specified by:
        update in interface MetadataStore<Plan>
        Throws:
        StripeException
      • update

        public Plan update​(java.util.Map<java.lang.String,​java.lang.Object> params,
                           RequestOptions options)
                    throws StripeException
        Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan’s ID, amount, currency, or billing cycle.
        Specified by:
        update in interface MetadataStore<Plan>
        Throws:
        StripeException
      • update

        public Plan update​(PlanUpdateParams params)
                    throws StripeException
        Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan’s ID, amount, currency, or billing cycle.
        Throws:
        StripeException
      • update

        public Plan update​(PlanUpdateParams params,
                           RequestOptions options)
                    throws StripeException
        Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan’s ID, amount, currency, or billing cycle.
        Throws:
        StripeException
      • delete

        public Plan delete()
                    throws StripeException
        Deleting plans means new subscribers can’t be added. Existing subscribers aren’t affected.
        Throws:
        StripeException
      • delete

        public Plan delete​(java.util.Map<java.lang.String,​java.lang.Object> params)
                    throws StripeException
        Deleting plans means new subscribers can’t be added. Existing subscribers aren’t affected.
        Throws:
        StripeException
      • delete

        public Plan delete​(java.util.Map<java.lang.String,​java.lang.Object> params,
                           RequestOptions options)
                    throws StripeException
        Deleting plans means new subscribers can’t be added. Existing subscribers aren’t affected.
        Throws:
        StripeException
      • getActive

        public java.lang.Boolean getActive()
        Whether the plan can be used for new purchases.
      • getAggregateUsage

        public java.lang.String getAggregateUsage()
        Specifies a usage aggregation strategy for plans of usage_type=metered. Allowed values are sum for summing up all usage during a period, last_during_period for using the last usage record reported within a period, last_ever for using the last usage record ever (across period bounds) or max which uses the usage record with the maximum reported usage during a period. Defaults to sum.

        One of last_during_period, last_ever, max, or sum.

      • getAmount

        public java.lang.Long getAmount()
        The unit amount in %s to be charged, represented as a whole integer if possible. Only set if billing_scheme=per_unit.
      • getAmountDecimal

        public java.math.BigDecimal getAmountDecimal()
        The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places. Only set if billing_scheme=per_unit.
      • getBillingScheme

        public java.lang.String getBillingScheme()
        Describes how to compute the price per period. Either per_unit or tiered. per_unit indicates that the fixed amount (specified in amount) will be charged per unit in quantity (for plans with usage_type=licensed), or per unit of total usage (for plans with usage_type=metered). tiered indicates that the unit pricing will be computed using a tiering strategy as defined using the tiers and tiers_mode attributes.

        One of per_unit, or tiered.

      • getCreated

        public java.lang.Long getCreated()
        Time at which the object was created. Measured in seconds since the Unix epoch.
      • getDeleted

        public java.lang.Boolean getDeleted()
        Always true for a deleted object.
      • getInterval

        public java.lang.String getInterval()
        The frequency at which a subscription is billed. One of day, week, month or year.
      • getIntervalCount

        public java.lang.Long getIntervalCount()
        The number of intervals (specified in the interval attribute) between subscription billings. For example, interval=month and interval_count=3 bills every 3 months.
      • getLivemode

        public java.lang.Boolean getLivemode()
        Has the value true if the object exists in live mode or the value false if the object exists in test mode.
      • getNickname

        public java.lang.String getNickname()
        A brief description of the plan, hidden from customers.
      • getObject

        public java.lang.String getObject()
        String representing the object's type. Objects of the same type share the same value.

        Equal to plan.

      • getTiers

        public java.util.List<Plan.Tier> getTiers()
        Each element represents a pricing tier. This parameter requires billing_scheme to be set to tiered. See also the documentation for billing_scheme.
      • getTiersMode

        public java.lang.String getTiersMode()
        Defines if the tiering price should be graduated or volume based. In volume-based tiering, the maximum quantity within a period determines the per unit price. In graduated tiering, pricing can change as the quantity grows.

        One of graduated, or volume.

      • getTransformUsage

        public Plan.TransformUsage getTransformUsage()
        Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with tiers.
      • getTrialPeriodDays

        public java.lang.Long getTrialPeriodDays()
        Default number of trial days when subscribing a customer to this plan using trial_from_plan=true.
      • getUsageType

        public java.lang.String getUsageType()
        Configures how the quantity per period should be determined. Can be either metered or licensed. licensed automatically bills the quantity set when adding it to a subscription. metered aggregates the total usage based on usage records. Defaults to licensed.
      • setActive

        public void setActive​(java.lang.Boolean active)
        Whether the plan can be used for new purchases.
      • setAggregateUsage

        public void setAggregateUsage​(java.lang.String aggregateUsage)
        Specifies a usage aggregation strategy for plans of usage_type=metered. Allowed values are sum for summing up all usage during a period, last_during_period for using the last usage record reported within a period, last_ever for using the last usage record ever (across period bounds) or max which uses the usage record with the maximum reported usage during a period. Defaults to sum.

        One of last_during_period, last_ever, max, or sum.

      • setAmount

        public void setAmount​(java.lang.Long amount)
        The unit amount in %s to be charged, represented as a whole integer if possible. Only set if billing_scheme=per_unit.
      • setAmountDecimal

        public void setAmountDecimal​(java.math.BigDecimal amountDecimal)
        The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places. Only set if billing_scheme=per_unit.
      • setBillingScheme

        public void setBillingScheme​(java.lang.String billingScheme)
        Describes how to compute the price per period. Either per_unit or tiered. per_unit indicates that the fixed amount (specified in amount) will be charged per unit in quantity (for plans with usage_type=licensed), or per unit of total usage (for plans with usage_type=metered). tiered indicates that the unit pricing will be computed using a tiering strategy as defined using the tiers and tiers_mode attributes.

        One of per_unit, or tiered.

      • setCreated

        public void setCreated​(java.lang.Long created)
        Time at which the object was created. Measured in seconds since the Unix epoch.
      • setDeleted

        public void setDeleted​(java.lang.Boolean deleted)
        Always true for a deleted object.
      • setId

        public void setId​(java.lang.String id)
        Unique identifier for the object.
      • setInterval

        public void setInterval​(java.lang.String interval)
        The frequency at which a subscription is billed. One of day, week, month or year.
      • setIntervalCount

        public void setIntervalCount​(java.lang.Long intervalCount)
        The number of intervals (specified in the interval attribute) between subscription billings. For example, interval=month and interval_count=3 bills every 3 months.
      • setLivemode

        public void setLivemode​(java.lang.Boolean livemode)
        Has the value true if the object exists in live mode or the value false if the object exists in test mode.
      • setMetadata

        public void setMetadata​(java.util.Map<java.lang.String,​java.lang.String> metadata)
        Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
      • setNickname

        public void setNickname​(java.lang.String nickname)
        A brief description of the plan, hidden from customers.
      • setObject

        public void setObject​(java.lang.String object)
        String representing the object's type. Objects of the same type share the same value.

        Equal to plan.

      • setTiers

        public void setTiers​(java.util.List<Plan.Tier> tiers)
        Each element represents a pricing tier. This parameter requires billing_scheme to be set to tiered. See also the documentation for billing_scheme.
      • setTiersMode

        public void setTiersMode​(java.lang.String tiersMode)
        Defines if the tiering price should be graduated or volume based. In volume-based tiering, the maximum quantity within a period determines the per unit price. In graduated tiering, pricing can change as the quantity grows.

        One of graduated, or volume.

      • setTransformUsage

        public void setTransformUsage​(Plan.TransformUsage transformUsage)
        Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with tiers.
      • setTrialPeriodDays

        public void setTrialPeriodDays​(java.lang.Long trialPeriodDays)
        Default number of trial days when subscribing a customer to this plan using trial_from_plan=true.
      • setUsageType

        public void setUsageType​(java.lang.String usageType)
        Configures how the quantity per period should be determined. Can be either metered or licensed. licensed automatically bills the quantity set when adding it to a subscription. metered aggregates the total usage based on usage records. Defaults to licensed.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • canEqual

        protected boolean canEqual​(java.lang.Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • getId

        public java.lang.String getId()
        Unique identifier for the object.
        Specified by:
        getId in interface HasId
      • getMetadata

        public java.util.Map<java.lang.String,​java.lang.String> getMetadata()
        Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
        Specified by:
        getMetadata in interface MetadataStore<Plan>