Object

org.mdedetrich.stripe.v1

Subscriptions

Related Doc: package v1

Permalink

object Subscriptions extends LazyLogging

See also

https://stripe.com/docs/api#subscriptions

Linear Supertypes
LazyLogging, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Subscriptions
  2. LazyLogging
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. sealed abstract class Source extends AnyRef

    Permalink
  2. sealed abstract class Status extends EnumEntry

    Permalink
  3. case class Subscription(id: String, applicationFeePercent: Option[BigDecimal], cancelAtPeriodEnd: Boolean, canceledAt: Option[OffsetDateTime], currentPeriodEnd: OffsetDateTime, currentPeriodStart: OffsetDateTime, customer: String, discount: Option[Discount], endedAt: Option[OffsetDateTime], metadata: Option[Map[String, String]], plan: Plan, quantity: Long, start: OffsetDateTime, status: Status, taxPercent: Option[BigDecimal], trialEnd: Option[OffsetDateTime], trialStart: Option[OffsetDateTime]) extends Product with Serializable

    Permalink

    applicationFeePercent

    A positive decimal that represents the fee percentage of the subscription invoice amount that will be transferred to the application owner’s Stripe account each billing period.

    cancelAtPeriodEnd

    If the subscription has been canceled with the at_period_end flag set to true, cancelAtPeriodEnd on the subscription will be true. You can use this attribute to determine whether a subscription that has a status of active is scheduled to be canceled at the end of the current period.

    canceledAt

    If the subscription has been canceled, the date of that cancellation. If the subscription was canceled with cancelAtPeriodEnd, canceledAt will still reflect the date of the initial cancellation request, not the end of the subscription period when the subscription is automatically moved to a canceled state.

    currentPeriodEnd

    End of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created.

    currentPeriodStart

    Start of the current period that the subscription has been invoiced for

    discount

    Describes the current discount applied to this subscription, if there is one. When billing, a discount applied to a subscription overrides a discount applied on a customer-wide basis.

    endedAt

    If the subscription has ended (either because it was canceled or because the customer was switched to a subscription to a new plan), the date the subscription ended

    metadata

    A set of key/value pairs that you can attach to a subscription object. It can be useful for storing additional information about the subscription in a structured format.

    plan

    Hash describing the plan the customer is subscribed to

    start

    Date the subscription started

    status

    Possible values are Status.Trialing, Status.Active, Status.PastDue, Status.Canceled, or Status.Unpaid. A subscription still in its trial period is trialing and moves to active when the trial period is over. When payment to renew the subscription fails, the subscription becomes Status.PastDue. After Stripe has exhausted all payment retry attempts, the subscription ends up with a status of either Status.Canceled or Status.Unpaid depending on your retry settings. Note that when a subscription has a status of Status.Unpaid, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed. Additionally, updating customer card details will not lead to Stripe retrying the latest invoice.). After receiving updated card details from a customer, you may choose to reopen and pay their closed invoices.

    taxPercent

    If provided, each invoice created by this subscription will apply the tax rate, increasing the amount billed to the customer.

    trialEnd

    If the subscription has a trial, the end of that trial.

    trialStart

    If the subscription has a trial, the beginning of that trial.

    See also

    https://stripe.com/docs/api#subscription_object

  4. case class SubscriptionInput(applicationFeePercent: Option[BigDecimal], coupon: Option[String], plan: String, source: Option[Source], quantity: Option[Long], metadata: Option[Map[String, String]], taxPercent: Option[BigDecimal], trialEnd: Option[OffsetDateTime]) extends Product with Serializable

    Permalink

    applicationFeePercent

    A positive decimal (with at most two decimal places) between 1 and 100. 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

    coupon

    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.

    plan

    The identifier of the plan to subscribe the customer to.

    source

    The source can either be a token, like the ones returned by our Stripe.js, or a dictionary containing a user's credit card details (with the options shown below). You must provide a source if the customer does not already have a valid source attached, and you are subscribing the customer for a plan that is not free. Passing source will create a new source object, make it the customer default source, and delete the old customer default if one exists. If you want to add an additional source to use with subscriptions, instead use the card creation API to add the card and then the customer update API to set it as the default. Whenever you attach a card to a customer, Stripe will automatically validate the card.

    quantity

    The quantity you'd like to apply to the subscription you're creating. For example, if your plan is $10/user/month, and your customer has 5 users, you could pass 5 as the quantity to have the customer charged $50 (5 x $10) monthly. If you update a subscription but don't change the plan ID (e.g. changing only the trial_end), the subscription will inherit the old subscription's quantity attribute unless you pass a new quantity parameter. If you update a subscription and change the plan ID, the new subscription will not inherit the quantity attribute and will default to 1 unless you pass a quantity parameter.

    metadata

    A set of key/value pairs that you can attach to a subscription object. It can be useful for storing additional information about the subscription in a structured format.

    taxPercent

    A positive decimal (with at most two decimal places) between 1 and 100. This represents the percentage of the subscription invoice subtotal that will be calculated and added as tax to the final amount each billing period. For example, a plan which charges $10/month with a taxPercent of 20.0 will charge $12 per invoice.

    trialEnd

    Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. If set, trialEnd 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.

    See also

    https://stripe.com/docs/api#create_subscription-source

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. object Source

    Permalink
  5. object Status extends Enum[Status]

    Permalink
  6. object Subscription extends Serializable

    Permalink
  7. object SubscriptionInput extends Serializable

    Permalink
  8. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  9. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def create(customerId: String, subscriptionInput: SubscriptionInput)(idempotencyKey: Option[IdempotencyKey] = None)(implicit apiKey: ApiKey, endpoint: Endpoint): Future[Try[Subscription]]

    Permalink
  11. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  15. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  17. lazy val logger: Logger

    Permalink
    Attributes
    protected
    Definition Classes
    LazyLogging
  18. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  19. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. implicit val sourceReads: Reads[Source]

    Permalink
  22. implicit val sourceWrites: Writes[Source]

    Permalink
  23. implicit val statusFormats: Format[Status]

    Permalink
  24. implicit val subscriptionReads: Reads[Subscription]

    Permalink
  25. implicit val subscriptionWrites: Writes[Subscription]

    Permalink
  26. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  27. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  28. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from LazyLogging

Inherited from AnyRef

Inherited from Any

Ungrouped