Class: Recurly::Resources::Subscription
- Inherits:
-
Recurly::Resource
- Object
- Recurly::Resource
- Recurly::Resources::Subscription
- Defined in:
- lib/recurly/resources/subscription.rb
Instance Attribute Summary collapse
-
#account ⇒ AccountMini
Account mini details.
-
#action_result ⇒ 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.
-
#activated_at ⇒ DateTime
Activated at.
-
#active_invoice_id ⇒ String
The invoice ID of the latest invoice created for an active subscription.
-
#add_ons ⇒ Array[SubscriptionAddOn]
Add-ons.
-
#add_ons_total ⇒ Float
Total price of add-ons.
-
#auto_renew ⇒ Boolean
Whether the subscription renews at the end of its term.
-
#bank_account_authorized_at ⇒ DateTime
Recurring subscriptions paid with ACH will have this attribute set.
-
#billing_info_id ⇒ String
Billing Info ID.
-
#canceled_at ⇒ DateTime
Canceled at.
-
#collection_method ⇒ String
Collection method.
-
#converted_at ⇒ DateTime
When the subscription was converted from a gift card.
-
#coupon_redemptions ⇒ Array[CouponRedemptionMini]
Returns subscription level coupon redemptions that are tied to this subscription.
-
#created_at ⇒ DateTime
Created at.
-
#currency ⇒ String
3-letter ISO 4217 currency code.
-
#current_period_ends_at ⇒ DateTime
Current billing period ends at.
-
#current_period_started_at ⇒ DateTime
Current billing period started at.
-
#current_term_ends_at ⇒ DateTime
When the term ends.
-
#current_term_started_at ⇒ DateTime
The start date of the term when the first billing period starts.
-
#custom_fields ⇒ Array[CustomField]
The custom fields will only be altered when they are included in a request.
-
#customer_notes ⇒ String
Customer notes.
-
#expiration_reason ⇒ String
Expiration reason.
-
#expires_at ⇒ DateTime
Expires at.
-
#gateway_code ⇒ String
If present, this subscription's transactions will use the payment gateway with this code.
-
#id ⇒ String
Subscription ID.
-
#net_terms ⇒ 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.
-
#net_terms_type ⇒ String
Optionally supplied string that may be either `net` or `eom` (end-of-month).
-
#object ⇒ String
Object type.
-
#paused_at ⇒ DateTime
Null unless subscription is paused or will pause at the end of the current billing period.
-
#pending_change ⇒ SubscriptionChange
Subscription Change.
-
#plan ⇒ PlanMini
Just the important parts.
-
#po_number ⇒ String
For manual invoicing, this identifies the PO number associated with the subscription.
-
#quantity ⇒ Integer
Subscription quantity.
-
#ramp_intervals ⇒ Array[SubscriptionRampIntervalResponse]
The ramp intervals representing the pricing schedule for the subscription.
-
#remaining_billing_cycles ⇒ Integer
The remaining billing cycles in the current term.
-
#remaining_pause_cycles ⇒ Integer
Null unless subscription is paused or will pause at the end of the current billing period.
-
#renewal_billing_cycles ⇒ Integer
If `auto_renew=true`, when a term completes, `total_billing_cycles` takes this value as the length of subsequent terms.
-
#revenue_schedule_type ⇒ String
Revenue schedule type.
-
#shipping ⇒ SubscriptionShipping
Subscription shipping details.
-
#started_with_gift ⇒ Boolean
Whether the subscription was started with a gift certificate.
-
#state ⇒ String
State.
-
#subtotal ⇒ Float
Estimated total, before tax.
-
#tax ⇒ Float
Only for merchants using Recurly's In-The-Box taxes.
-
#tax_inclusive ⇒ Boolean
Determines whether or not tax is included in the unit amount.
-
#tax_info ⇒ TaxInfo
Only for merchants using Recurly's In-The-Box taxes.
-
#terms_and_conditions ⇒ String
Terms and conditions.
-
#total ⇒ Float
Estimated total.
-
#total_billing_cycles ⇒ Integer
The number of cycles/billing periods in a term.
-
#trial_ends_at ⇒ DateTime
Trial period ends at.
-
#trial_started_at ⇒ DateTime
Trial period started at.
-
#unit_amount ⇒ Float
Subscription unit price.
-
#updated_at ⇒ DateTime
Last updated at.
-
#uuid ⇒ String
The UUID is useful for matching data with the CSV exports and building URLs into Recurly's UI.
Attributes inherited from Recurly::Resource
Method Summary
Methods inherited from Recurly::Resource
#==, #get_response, #inspect, #requires_client?, #to_json, #to_s
Methods included from Schema::SchemaFactory
Methods included from Schema::ResourceCaster
Methods included from Schema::SchemaValidator
#get_did_you_mean, #validate!, #validate_attribute!
Instance Attribute Details
#account ⇒ AccountMini
Returns Account mini details.
11 |
# File 'lib/recurly/resources/subscription.rb', line 11 define_attribute :account, :AccountMini |
#action_result ⇒ Hash
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.
15 |
# File 'lib/recurly/resources/subscription.rb', line 15 define_attribute :action_result, Hash |
#activated_at ⇒ DateTime
Returns Activated at.
19 |
# File 'lib/recurly/resources/subscription.rb', line 19 define_attribute :activated_at, DateTime |
#active_invoice_id ⇒ String
Returns 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_ons ⇒ Array[SubscriptionAddOn]
Returns Add-ons.
27 |
# File 'lib/recurly/resources/subscription.rb', line 27 define_attribute :add_ons, Array, { :item_type => :SubscriptionAddOn } |
#add_ons_total ⇒ Float
Returns Total price of add-ons.
31 |
# File 'lib/recurly/resources/subscription.rb', line 31 define_attribute :add_ons_total, Float |
#auto_renew ⇒ Boolean
Returns 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_at ⇒ DateTime
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.
39 |
# File 'lib/recurly/resources/subscription.rb', line 39 define_attribute :bank_account_authorized_at, DateTime |
#billing_info_id ⇒ String
Returns Billing Info ID.
43 |
# File 'lib/recurly/resources/subscription.rb', line 43 define_attribute :billing_info_id, String |
#canceled_at ⇒ DateTime
Returns Canceled at.
47 |
# File 'lib/recurly/resources/subscription.rb', line 47 define_attribute :canceled_at, DateTime |
#collection_method ⇒ String
Returns Collection method.
51 |
# File 'lib/recurly/resources/subscription.rb', line 51 define_attribute :collection_method, String |
#converted_at ⇒ DateTime
Returns When the subscription was converted from a gift card.
55 |
# File 'lib/recurly/resources/subscription.rb', line 55 define_attribute :converted_at, DateTime |
#coupon_redemptions ⇒ 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_at ⇒ DateTime
Returns Created at.
63 |
# File 'lib/recurly/resources/subscription.rb', line 63 define_attribute :created_at, DateTime |
#currency ⇒ String
Returns 3-letter ISO 4217 currency code.
67 |
# File 'lib/recurly/resources/subscription.rb', line 67 define_attribute :currency, String |
#current_period_ends_at ⇒ DateTime
Returns Current billing period ends at.
71 |
# File 'lib/recurly/resources/subscription.rb', line 71 define_attribute :current_period_ends_at, DateTime |
#current_period_started_at ⇒ DateTime
Returns Current billing period started at.
75 |
# File 'lib/recurly/resources/subscription.rb', line 75 define_attribute :current_period_started_at, DateTime |
#current_term_ends_at ⇒ DateTime
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.
79 |
# File 'lib/recurly/resources/subscription.rb', line 79 define_attribute :current_term_ends_at, DateTime |
#current_term_started_at ⇒ DateTime
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.
83 |
# File 'lib/recurly/resources/subscription.rb', line 83 define_attribute :current_term_started_at, DateTime |
#custom_fields ⇒ Array[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.
87 |
# File 'lib/recurly/resources/subscription.rb', line 87 define_attribute :custom_fields, Array, { :item_type => :CustomField } |
#customer_notes ⇒ String
Returns Customer notes.
91 |
# File 'lib/recurly/resources/subscription.rb', line 91 define_attribute :customer_notes, String |
#expiration_reason ⇒ String
Returns Expiration reason.
95 |
# File 'lib/recurly/resources/subscription.rb', line 95 define_attribute :expiration_reason, String |
#expires_at ⇒ DateTime
Returns Expires at.
99 |
# File 'lib/recurly/resources/subscription.rb', line 99 define_attribute :expires_at, DateTime |
#gateway_code ⇒ String
Returns 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 |
#id ⇒ String
Returns Subscription ID.
107 |
# File 'lib/recurly/resources/subscription.rb', line 107 define_attribute :id, String |
#net_terms ⇒ Integer
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.
111 |
# File 'lib/recurly/resources/subscription.rb', line 111 define_attribute :net_terms, Integer |
#net_terms_type ⇒ String
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.
115 |
# File 'lib/recurly/resources/subscription.rb', line 115 define_attribute :net_terms_type, String |
#object ⇒ String
Returns Object type.
119 |
# File 'lib/recurly/resources/subscription.rb', line 119 define_attribute :object, String |
#paused_at ⇒ DateTime
Returns 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_change ⇒ SubscriptionChange
Returns Subscription Change.
127 |
# File 'lib/recurly/resources/subscription.rb', line 127 define_attribute :pending_change, :SubscriptionChange |
#plan ⇒ PlanMini
Returns Just the important parts.
131 |
# File 'lib/recurly/resources/subscription.rb', line 131 define_attribute :plan, :PlanMini |
#po_number ⇒ String
Returns 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 |
#quantity ⇒ Integer
Returns Subscription quantity.
139 |
# File 'lib/recurly/resources/subscription.rb', line 139 define_attribute :quantity, Integer |
#ramp_intervals ⇒ Array[SubscriptionRampIntervalResponse]
Returns The ramp intervals representing the pricing schedule for the subscription.
143 |
# File 'lib/recurly/resources/subscription.rb', line 143 define_attribute :ramp_intervals, Array, { :item_type => :SubscriptionRampIntervalResponse } |
#remaining_billing_cycles ⇒ Integer
Returns 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_cycles ⇒ Integer
Returns 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_cycles ⇒ Integer
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`.
155 |
# File 'lib/recurly/resources/subscription.rb', line 155 define_attribute :renewal_billing_cycles, Integer |
#revenue_schedule_type ⇒ String
Returns Revenue schedule type.
159 |
# File 'lib/recurly/resources/subscription.rb', line 159 define_attribute :revenue_schedule_type, String |
#shipping ⇒ SubscriptionShipping
Returns Subscription shipping details.
163 |
# File 'lib/recurly/resources/subscription.rb', line 163 define_attribute :shipping, :SubscriptionShipping |
#started_with_gift ⇒ Boolean
Returns Whether the subscription was started with a gift certificate.
167 |
# File 'lib/recurly/resources/subscription.rb', line 167 define_attribute :started_with_gift, :Boolean |
#state ⇒ String
Returns State.
171 |
# File 'lib/recurly/resources/subscription.rb', line 171 define_attribute :state, String |
#subtotal ⇒ Float
Returns Estimated total, before tax.
175 |
# File 'lib/recurly/resources/subscription.rb', line 175 define_attribute :subtotal, Float |
#tax ⇒ Float
Returns Only for merchants using Recurly's In-The-Box taxes.
179 |
# File 'lib/recurly/resources/subscription.rb', line 179 define_attribute :tax, Float |
#tax_inclusive ⇒ Boolean
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.
183 |
# File 'lib/recurly/resources/subscription.rb', line 183 define_attribute :tax_inclusive, :Boolean |
#tax_info ⇒ TaxInfo
Returns 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_conditions ⇒ String
Returns Terms and conditions.
191 |
# File 'lib/recurly/resources/subscription.rb', line 191 define_attribute :terms_and_conditions, String |
#total ⇒ Float
Returns Estimated total.
195 |
# File 'lib/recurly/resources/subscription.rb', line 195 define_attribute :total, Float |
#total_billing_cycles ⇒ Integer
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.
199 |
# File 'lib/recurly/resources/subscription.rb', line 199 define_attribute :total_billing_cycles, Integer |
#trial_ends_at ⇒ DateTime
Returns Trial period ends at.
203 |
# File 'lib/recurly/resources/subscription.rb', line 203 define_attribute :trial_ends_at, DateTime |
#trial_started_at ⇒ DateTime
Returns Trial period started at.
207 |
# File 'lib/recurly/resources/subscription.rb', line 207 define_attribute :trial_started_at, DateTime |
#unit_amount ⇒ Float
Returns Subscription unit price.
211 |
# File 'lib/recurly/resources/subscription.rb', line 211 define_attribute :unit_amount, Float |
#updated_at ⇒ DateTime
Returns Last updated at.
215 |
# File 'lib/recurly/resources/subscription.rb', line 215 define_attribute :updated_at, DateTime |
#uuid ⇒ String
Returns 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 |