Class: Subscription

Subscription()

A Subscription Model represents a single instance of a Subscription object from the DataONE Bookkeeper data model. Subscriptions represent a Product that has been ordered by a Customer and is paid for on a recurring basis or is in a free trial period. See https://github.com/DataONEorg/bookkeeper for documentation on the DataONE Bookkeeper service and data model.

Constructor

new Subscription()

Since:
  • 2.14.0
Source:

Members

defaults :Object

Default attributes for Subscription models
Type:
  • Object
Properties:
Name Type Description
id string The unique identifier of this Subscription, from Bookkeeper
object string The name of this type of Bookkeeper object, which will always be "subscription"
canceledAt number The timestamp of the date that this Subscription was canceled
collectionMethod string The method of payment collection for this Subscription, which is a string from a controlled vocabulary from Bookkeeper
created number The timestamp of the date that this Subscription was created
customerId number The identifier of the Customer that is associated with this Subscription
metadata Object Arbitrary metadata about this Subscription. These values should be parsed and set on this model (TODO)
productId number The identifier of a Product in this Subscription
quantity number The number of Subscriptions
startDate number The timestamp of the date that this Subscription was started
status string The status of this Subscription, which is taken from a controlled vocabulary set on this model (statusOptions)
statusOptions Array.<string> The controlled vocabulary from which the `status` value can be from
trialEnd number The timestamp of the date that this free trial Subscription ends
trialStart number The timestamp of the date that this free trial Subscription starts
Source:

type :string

The name of this type of model
Type:
  • string
Source:

Methods

isTrialing() → {boolean}

Returns true if this Subscription is in a free trial period.
Source:
Returns:
Type
boolean