Class: Recurly::Resources::Subscription

Inherits:
Recurly::Resource show all
Defined in:
lib/recurly/resources/subscription.rb

Instance Attribute Summary collapse

Attributes inherited from Recurly::Resource

#attributes

Method Summary

Methods inherited from Recurly::Resource

#==, #get_response, #inspect, #requires_client?, #to_json, #to_s

Methods included from Schema::SchemaFactory

#schema

Methods included from Schema::ResourceCaster

#cast

Methods included from Schema::SchemaValidator

#get_did_you_mean, #validate!, #validate_attribute!

Instance Attribute Details

#accountAccountMini

Returns Account mini details.

Returns:



11
# File 'lib/recurly/resources/subscription.rb', line 11

define_attribute :account, :AccountMini

#action_resultHash

Returns Action result params to be used in Recurly-JS to complete a payment when using asynchronous payment methods, e.g., Boleto, iDEAL and Sofort.

Returns:

  • (Hash)

    Action result params to be used in Recurly-JS to complete a payment when using asynchronous payment methods, e.g., Boleto, iDEAL and Sofort.



15
# File 'lib/recurly/resources/subscription.rb', line 15

define_attribute :action_result, Hash

#activated_atDateTime

Returns Activated at.

Returns:

  • (DateTime)

    Activated at



19
# File 'lib/recurly/resources/subscription.rb', line 19

define_attribute :activated_at, DateTime

#active_invoice_idString

Returns The invoice ID of the latest invoice created for an active subscription.

Returns:

  • (String)

    The invoice ID of the latest invoice created for an active subscription.



23
# File 'lib/recurly/resources/subscription.rb', line 23

define_attribute :active_invoice_id, String

#add_onsArray[SubscriptionAddOn]

Returns Add-ons.

Returns:



27
# File 'lib/recurly/resources/subscription.rb', line 27

define_attribute :add_ons, Array, { :item_type => :SubscriptionAddOn }

#add_ons_totalFloat

Returns Total price of add-ons.

Returns:

  • (Float)

    Total price of add-ons



31
# File 'lib/recurly/resources/subscription.rb', line 31

define_attribute :add_ons_total, Float

#auto_renewBoolean

Returns Whether the subscription renews at the end of its term.

Returns:

  • (Boolean)

    Whether the subscription renews at the end of its term.



35
# File 'lib/recurly/resources/subscription.rb', line 35

define_attribute :auto_renew, :Boolean

#bank_account_authorized_atDateTime

Returns Recurring subscriptions paid with ACH will have this attribute set. This timestamp is used for alerting customers to reauthorize in 3 years in accordance with NACHA rules. If a subscription becomes inactive or the billing info is no longer a bank account, this timestamp is cleared.

Returns:

  • (DateTime)

    Recurring subscriptions paid with ACH will have this attribute set. This timestamp is used for alerting customers to reauthorize in 3 years in accordance with NACHA rules. If a subscription becomes inactive or the billing info is no longer a bank account, this timestamp is cleared.



39
# File 'lib/recurly/resources/subscription.rb', line 39

define_attribute :bank_account_authorized_at, DateTime

#billing_info_idString

Returns Billing Info ID.

Returns:

  • (String)

    Billing Info ID.



43
# File 'lib/recurly/resources/subscription.rb', line 43

define_attribute :billing_info_id, String

#canceled_atDateTime

Returns Canceled at.

Returns:

  • (DateTime)

    Canceled at



47
# File 'lib/recurly/resources/subscription.rb', line 47

define_attribute :canceled_at, DateTime

#collection_methodString

Returns Collection method.

Returns:

  • (String)

    Collection method



51
# File 'lib/recurly/resources/subscription.rb', line 51

define_attribute :collection_method, String

#converted_atDateTime

Returns When the subscription was converted from a gift card.

Returns:

  • (DateTime)

    When the subscription was converted from a gift card.



55
# File 'lib/recurly/resources/subscription.rb', line 55

define_attribute :converted_at, DateTime

#coupon_redemptionsArray[CouponRedemptionMini]

Returns subscription level coupon redemptions that are tied to this subscription.

Returns:

  • (Array[CouponRedemptionMini])

    Returns subscription level coupon redemptions that are tied to this subscription.



59
# File 'lib/recurly/resources/subscription.rb', line 59

define_attribute :coupon_redemptions, Array, { :item_type => :CouponRedemptionMini }

#created_atDateTime

Returns Created at.

Returns:

  • (DateTime)

    Created at



63
# File 'lib/recurly/resources/subscription.rb', line 63

define_attribute :created_at, DateTime

#currencyString

Returns 3-letter ISO 4217 currency code.

Returns:

  • (String)

    3-letter ISO 4217 currency code.



67
# File 'lib/recurly/resources/subscription.rb', line 67

define_attribute :currency, String

#current_period_ends_atDateTime

Returns Current billing period ends at.

Returns:

  • (DateTime)

    Current billing period ends at



71
# File 'lib/recurly/resources/subscription.rb', line 71

define_attribute :current_period_ends_at, DateTime

#current_period_started_atDateTime

Returns Current billing period started at.

Returns:

  • (DateTime)

    Current billing period started at



75
# File 'lib/recurly/resources/subscription.rb', line 75

define_attribute :current_period_started_at, DateTime

#current_term_ends_atDateTime

Returns When the term ends. This is calculated by a plan's interval and `total_billing_cycles` in a term. Subscription changes with a `timeframe=renewal` will be applied on this date.

Returns:

  • (DateTime)

    When the term ends. This is calculated by a plan's interval and `total_billing_cycles` in a term. Subscription changes with a `timeframe=renewal` will be applied on this date.



79
# File 'lib/recurly/resources/subscription.rb', line 79

define_attribute :current_term_ends_at, DateTime

#current_term_started_atDateTime

Returns The start date of the term when the first billing period starts. The subscription term is the length of time that a customer will be committed to a subscription. A term can span multiple billing periods.

Returns:

  • (DateTime)

    The start date of the term when the first billing period starts. The subscription term is the length of time that a customer will be committed to a subscription. A term can span multiple billing periods.



83
# File 'lib/recurly/resources/subscription.rb', line 83

define_attribute :current_term_started_at, DateTime

#custom_fieldsArray[CustomField]

Returns The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.

Returns:

  • (Array[CustomField])

    The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.



87
# File 'lib/recurly/resources/subscription.rb', line 87

define_attribute :custom_fields, Array, { :item_type => :CustomField }

#customer_notesString

Returns Customer notes.

Returns:

  • (String)

    Customer notes



91
# File 'lib/recurly/resources/subscription.rb', line 91

define_attribute :customer_notes, String

#expiration_reasonString

Returns Expiration reason.

Returns:

  • (String)

    Expiration reason



95
# File 'lib/recurly/resources/subscription.rb', line 95

define_attribute :expiration_reason, String

#expires_atDateTime

Returns Expires at.

Returns:

  • (DateTime)

    Expires at



99
# File 'lib/recurly/resources/subscription.rb', line 99

define_attribute :expires_at, DateTime

#gateway_codeString

Returns If present, this subscription's transactions will use the payment gateway with this code.

Returns:

  • (String)

    If present, this subscription's transactions will use the payment gateway with this code.



103
# File 'lib/recurly/resources/subscription.rb', line 103

define_attribute :gateway_code, String

#idString

Returns Subscription ID.

Returns:

  • (String)

    Subscription ID



107
# File 'lib/recurly/resources/subscription.rb', line 107

define_attribute :id, String

#net_termsInteger

Returns Integer paired with `Net Terms Type` and representing the number of days past the current date (for `net` Net Terms Type) or days after the last day of the current month (for `eom` Net Terms Type) that the invoice will become past due. For `manual` collection method, an additional 24 hours is added to ensure the customer has the entire last day to make payment before becoming past due. For example: If an invoice is due `net 0`, it is due 'On Receipt' and will become past due 24 hours after it's created. If an invoice is due `net 30`, it will become past due at 31 days exactly. If an invoice is due `eom 30`, it will become past due 31 days from the last day of the current month. For `automatic` collection method, the additional 24 hours is not added. For example, On-Receipt is due immediately, and `net 30` will become due exactly 30 days from invoice generation, at which point Recurly will attempt collection. When `eom` Net Terms Type is passed, the value for `Net Terms` is restricted to `0, 15, 30, 45, 60, or 90`. For more information on how net terms work with `manual` collection visit our docs page (docs.recurly.com/docs/manual-payments#section-collection-terms) or visit (docs.recurly.com/docs/automatic-invoicing-terms#section-collection-terms) for information about net terms using `automatic` collection.

Returns:

  • (Integer)

    Integer paired with `Net Terms Type` and representing the number of days past the current date (for `net` Net Terms Type) or days after the last day of the current month (for `eom` Net Terms Type) that the invoice will become past due. For `manual` collection method, an additional 24 hours is added to ensure the customer has the entire last day to make payment before becoming past due. For example: If an invoice is due `net 0`, it is due 'On Receipt' and will become past due 24 hours after it's created. If an invoice is due `net 30`, it will become past due at 31 days exactly. If an invoice is due `eom 30`, it will become past due 31 days from the last day of the current month. For `automatic` collection method, the additional 24 hours is not added. For example, On-Receipt is due immediately, and `net 30` will become due exactly 30 days from invoice generation, at which point Recurly will attempt collection. When `eom` Net Terms Type is passed, the value for `Net Terms` is restricted to `0, 15, 30, 45, 60, or 90`. For more information on how net terms work with `manual` collection visit our docs page (docs.recurly.com/docs/manual-payments#section-collection-terms) or visit (docs.recurly.com/docs/automatic-invoicing-terms#section-collection-terms) for information about net terms using `automatic` collection.



111
# File 'lib/recurly/resources/subscription.rb', line 111

define_attribute :net_terms, Integer

#net_terms_typeString

Returns Optionally supplied string that may be either `net` or `eom` (end-of-month). When `net`, an invoice becomes past due the specified number of `Net Terms` days from the current date. When `eom` an invoice becomes past due the specified number of `Net Terms` days from the last day of the current month. This field is only available when the EOM Net Terms feature is enabled.

Returns:

  • (String)

    Optionally supplied string that may be either `net` or `eom` (end-of-month). When `net`, an invoice becomes past due the specified number of `Net Terms` days from the current date. When `eom` an invoice becomes past due the specified number of `Net Terms` days from the last day of the current month. This field is only available when the EOM Net Terms feature is enabled.



115
# File 'lib/recurly/resources/subscription.rb', line 115

define_attribute :net_terms_type, String

#objectString

Returns Object type.

Returns:

  • (String)

    Object type



119
# File 'lib/recurly/resources/subscription.rb', line 119

define_attribute :object, String

#paused_atDateTime

Returns Null unless subscription is paused or will pause at the end of the current billing period.

Returns:

  • (DateTime)

    Null unless subscription is paused or will pause at the end of the current billing period.



123
# File 'lib/recurly/resources/subscription.rb', line 123

define_attribute :paused_at, DateTime

#pending_changeSubscriptionChange

Returns Subscription Change.

Returns:



127
# File 'lib/recurly/resources/subscription.rb', line 127

define_attribute :pending_change, :SubscriptionChange

#planPlanMini

Returns Just the important parts.

Returns:

  • (PlanMini)

    Just the important parts.



131
# File 'lib/recurly/resources/subscription.rb', line 131

define_attribute :plan, :PlanMini

#po_numberString

Returns For manual invoicing, this identifies the PO number associated with the subscription.

Returns:

  • (String)

    For manual invoicing, this identifies the PO number associated with the subscription.



135
# File 'lib/recurly/resources/subscription.rb', line 135

define_attribute :po_number, String

#quantityInteger

Returns Subscription quantity.

Returns:

  • (Integer)

    Subscription quantity



139
# File 'lib/recurly/resources/subscription.rb', line 139

define_attribute :quantity, Integer

#ramp_intervalsArray[SubscriptionRampIntervalResponse]

Returns The ramp intervals representing the pricing schedule for the subscription.

Returns:



143
# File 'lib/recurly/resources/subscription.rb', line 143

define_attribute :ramp_intervals, Array, { :item_type => :SubscriptionRampIntervalResponse }

#remaining_billing_cyclesInteger

Returns The remaining billing cycles in the current term.

Returns:

  • (Integer)

    The remaining billing cycles in the current term.



147
# File 'lib/recurly/resources/subscription.rb', line 147

define_attribute :remaining_billing_cycles, Integer

#remaining_pause_cyclesInteger

Returns Null unless subscription is paused or will pause at the end of the current billing period.

Returns:

  • (Integer)

    Null unless subscription is paused or will pause at the end of the current billing period.



151
# File 'lib/recurly/resources/subscription.rb', line 151

define_attribute :remaining_pause_cycles, Integer

#renewal_billing_cyclesInteger

Returns If `auto_renew=true`, when a term completes, `total_billing_cycles` takes this value as the length of subsequent terms. Defaults to the plan's `total_billing_cycles`.

Returns:

  • (Integer)

    If `auto_renew=true`, when a term completes, `total_billing_cycles` takes this value as the length of subsequent terms. Defaults to the plan's `total_billing_cycles`.



155
# File 'lib/recurly/resources/subscription.rb', line 155

define_attribute :renewal_billing_cycles, Integer

#revenue_schedule_typeString

Returns Revenue schedule type.

Returns:

  • (String)

    Revenue schedule type



159
# File 'lib/recurly/resources/subscription.rb', line 159

define_attribute :revenue_schedule_type, String

#shippingSubscriptionShipping

Returns Subscription shipping details.

Returns:



163
# File 'lib/recurly/resources/subscription.rb', line 163

define_attribute :shipping, :SubscriptionShipping

#started_with_giftBoolean

Returns Whether the subscription was started with a gift certificate.

Returns:

  • (Boolean)

    Whether the subscription was started with a gift certificate.



167
# File 'lib/recurly/resources/subscription.rb', line 167

define_attribute :started_with_gift, :Boolean

#stateString

Returns State.

Returns:

  • (String)

    State



171
# File 'lib/recurly/resources/subscription.rb', line 171

define_attribute :state, String

#subtotalFloat

Returns Estimated total, before tax.

Returns:

  • (Float)

    Estimated total, before tax.



175
# File 'lib/recurly/resources/subscription.rb', line 175

define_attribute :subtotal, Float

#taxFloat

Returns Only for merchants using Recurly's In-The-Box taxes.

Returns:

  • (Float)

    Only for merchants using Recurly's In-The-Box taxes.



179
# File 'lib/recurly/resources/subscription.rb', line 179

define_attribute :tax, Float

#tax_inclusiveBoolean

Returns Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to utilize this flag.

Returns:

  • (Boolean)

    Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to utilize this flag.



183
# File 'lib/recurly/resources/subscription.rb', line 183

define_attribute :tax_inclusive, :Boolean

#tax_infoTaxInfo

Returns Only for merchants using Recurly's In-The-Box taxes.

Returns:

  • (TaxInfo)

    Only for merchants using Recurly's In-The-Box taxes.



187
# File 'lib/recurly/resources/subscription.rb', line 187

define_attribute :tax_info, :TaxInfo

#terms_and_conditionsString

Returns Terms and conditions.

Returns:

  • (String)

    Terms and conditions



191
# File 'lib/recurly/resources/subscription.rb', line 191

define_attribute :terms_and_conditions, String

#totalFloat

Returns Estimated total.

Returns:

  • (Float)

    Estimated total



195
# File 'lib/recurly/resources/subscription.rb', line 195

define_attribute :total, Float

#total_billing_cyclesInteger

Returns The number of cycles/billing periods in a term. When `remaining_billing_cycles=0`, if `auto_renew=true` the subscription will renew and a new term will begin, otherwise the subscription will expire.

Returns:

  • (Integer)

    The number of cycles/billing periods in a term. When `remaining_billing_cycles=0`, if `auto_renew=true` the subscription will renew and a new term will begin, otherwise the subscription will expire.



199
# File 'lib/recurly/resources/subscription.rb', line 199

define_attribute :total_billing_cycles, Integer

#trial_ends_atDateTime

Returns Trial period ends at.

Returns:

  • (DateTime)

    Trial period ends at



203
# File 'lib/recurly/resources/subscription.rb', line 203

define_attribute :trial_ends_at, DateTime

#trial_started_atDateTime

Returns Trial period started at.

Returns:

  • (DateTime)

    Trial period started at



207
# File 'lib/recurly/resources/subscription.rb', line 207

define_attribute :trial_started_at, DateTime

#unit_amountFloat

Returns Subscription unit price.

Returns:

  • (Float)

    Subscription unit price



211
# File 'lib/recurly/resources/subscription.rb', line 211

define_attribute :unit_amount, Float

#updated_atDateTime

Returns Last updated at.

Returns:

  • (DateTime)

    Last updated at



215
# File 'lib/recurly/resources/subscription.rb', line 215

define_attribute :updated_at, DateTime

#uuidString

Returns The UUID is useful for matching data with the CSV exports and building URLs into Recurly's UI.

Returns:

  • (String)

    The UUID is useful for matching data with the CSV exports and building URLs into Recurly's UI.



219
# File 'lib/recurly/resources/subscription.rb', line 219

define_attribute :uuid, String