Class: AdvancedBilling::Subscription

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/advanced_billing/models/subscription.rb

Overview

Subscription Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(id: SKIP, state: SKIP, balance_in_cents: SKIP, total_revenue_in_cents: SKIP, product_price_in_cents: SKIP, product_version_number: SKIP, current_period_ends_at: SKIP, next_assessment_at: SKIP, trial_started_at: SKIP, trial_ended_at: SKIP, activated_at: SKIP, expires_at: SKIP, created_at: SKIP, updated_at: SKIP, cancellation_message: SKIP, cancellation_method: SKIP, cancel_at_end_of_period: SKIP, canceled_at: SKIP, current_period_started_at: SKIP, previous_state: SKIP, signup_payment_id: SKIP, signup_revenue: SKIP, delayed_cancel_at: SKIP, coupon_code: SKIP, snap_day: SKIP, payment_collection_method: SKIP, customer: SKIP, product: SKIP, credit_card: SKIP, group: SKIP, bank_account: SKIP, payment_type: SKIP, referral_code: SKIP, next_product_id: SKIP, next_product_handle: SKIP, coupon_use_count: SKIP, coupon_uses_allowed: SKIP, reason_code: SKIP, automatically_resume_at: SKIP, coupon_codes: SKIP, offer_id: SKIP, payer_id: SKIP, current_billing_amount_in_cents: SKIP, product_price_point_id: SKIP, product_price_point_type: SKIP, next_product_price_point_id: SKIP, net_terms: SKIP, stored_credential_transaction_id: SKIP, reference: SKIP, on_hold_at: SKIP, prepaid_dunning: SKIP, coupons: SKIP, dunning_communication_delay_enabled: SKIP, dunning_communication_delay_time_zone: SKIP, receives_invoice_emails: SKIP, locale: SKIP, currency: SKIP, scheduled_cancellation_at: SKIP, credit_balance_in_cents: SKIP, prepayment_balance_in_cents: SKIP, prepaid_configuration: SKIP, self_service_page_token: SKIP, additional_properties: {}) ⇒ Subscription

Returns a new instance of Subscription.



575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
# File 'lib/advanced_billing/models/subscription.rb', line 575

def initialize(id: SKIP, state: SKIP, balance_in_cents: SKIP,
               total_revenue_in_cents: SKIP, product_price_in_cents: SKIP,
               product_version_number: SKIP, current_period_ends_at: SKIP,
               next_assessment_at: SKIP, trial_started_at: SKIP,
               trial_ended_at: SKIP, activated_at: SKIP, expires_at: SKIP,
               created_at: SKIP, updated_at: SKIP,
               cancellation_message: SKIP, cancellation_method: SKIP,
               cancel_at_end_of_period: SKIP, canceled_at: SKIP,
               current_period_started_at: SKIP, previous_state: SKIP,
               signup_payment_id: SKIP, signup_revenue: SKIP,
               delayed_cancel_at: SKIP, coupon_code: SKIP, snap_day: SKIP,
               payment_collection_method: SKIP, customer: SKIP,
               product: SKIP, credit_card: SKIP, group: SKIP,
               bank_account: SKIP, payment_type: SKIP, referral_code: SKIP,
               next_product_id: SKIP, next_product_handle: SKIP,
               coupon_use_count: SKIP, coupon_uses_allowed: SKIP,
               reason_code: SKIP, automatically_resume_at: SKIP,
               coupon_codes: SKIP, offer_id: SKIP, payer_id: SKIP,
               current_billing_amount_in_cents: SKIP,
               product_price_point_id: SKIP, product_price_point_type: SKIP,
               next_product_price_point_id: SKIP, net_terms: SKIP,
               stored_credential_transaction_id: SKIP, reference: SKIP,
               on_hold_at: SKIP, prepaid_dunning: SKIP, coupons: SKIP,
               dunning_communication_delay_enabled: SKIP,
               dunning_communication_delay_time_zone: SKIP,
               receives_invoice_emails: SKIP, locale: SKIP, currency: SKIP,
               scheduled_cancellation_at: SKIP,
               credit_balance_in_cents: SKIP,
               prepayment_balance_in_cents: SKIP,
               prepaid_configuration: SKIP, self_service_page_token: SKIP,
               additional_properties: {})
  @id = id unless id == SKIP
  @state = state unless state == SKIP
  @balance_in_cents = balance_in_cents unless balance_in_cents == SKIP
  @total_revenue_in_cents = total_revenue_in_cents unless total_revenue_in_cents == SKIP
  @product_price_in_cents = product_price_in_cents unless product_price_in_cents == SKIP
  @product_version_number = product_version_number unless product_version_number == SKIP
  @current_period_ends_at = current_period_ends_at unless current_period_ends_at == SKIP
  @next_assessment_at = next_assessment_at unless next_assessment_at == SKIP
  @trial_started_at = trial_started_at unless trial_started_at == SKIP
  @trial_ended_at = trial_ended_at unless trial_ended_at == SKIP
  @activated_at = activated_at unless activated_at == SKIP
  @expires_at = expires_at unless expires_at == SKIP
  @created_at = created_at unless created_at == SKIP
  @updated_at = updated_at unless updated_at == SKIP
  @cancellation_message = cancellation_message unless cancellation_message == SKIP
  @cancellation_method = cancellation_method unless cancellation_method == SKIP
  @cancel_at_end_of_period = cancel_at_end_of_period unless cancel_at_end_of_period == SKIP
  @canceled_at = canceled_at unless canceled_at == SKIP
  unless current_period_started_at == SKIP
    @current_period_started_at =
      current_period_started_at
  end
  @previous_state = previous_state unless previous_state == SKIP
  @signup_payment_id =  unless  == SKIP
  @signup_revenue =  unless  == SKIP
  @delayed_cancel_at = delayed_cancel_at unless delayed_cancel_at == SKIP
  @coupon_code = coupon_code unless coupon_code == SKIP
  @snap_day = snap_day unless snap_day == SKIP
  unless payment_collection_method == SKIP
    @payment_collection_method =
      payment_collection_method
  end
  @customer = customer unless customer == SKIP
  @product = product unless product == SKIP
  @credit_card = credit_card unless credit_card == SKIP
  @group = group unless group == SKIP
  @bank_account =  unless  == SKIP
  @payment_type = payment_type unless payment_type == SKIP
  @referral_code = referral_code unless referral_code == SKIP
  @next_product_id = next_product_id unless next_product_id == SKIP
  @next_product_handle = next_product_handle unless next_product_handle == SKIP
  @coupon_use_count = coupon_use_count unless coupon_use_count == SKIP
  @coupon_uses_allowed = coupon_uses_allowed unless coupon_uses_allowed == SKIP
  @reason_code = reason_code unless reason_code == SKIP
  @automatically_resume_at = automatically_resume_at unless automatically_resume_at == SKIP
  @coupon_codes = coupon_codes unless coupon_codes == SKIP
  @offer_id = offer_id unless offer_id == SKIP
  @payer_id = payer_id unless payer_id == SKIP
  unless current_billing_amount_in_cents == SKIP
    @current_billing_amount_in_cents =
      current_billing_amount_in_cents
  end
  @product_price_point_id = product_price_point_id unless product_price_point_id == SKIP
  @product_price_point_type = product_price_point_type unless product_price_point_type == SKIP
  unless next_product_price_point_id == SKIP
    @next_product_price_point_id =
      next_product_price_point_id
  end
  @net_terms = net_terms unless net_terms == SKIP
  unless stored_credential_transaction_id == SKIP
    @stored_credential_transaction_id =
      stored_credential_transaction_id
  end
  @reference = reference unless reference == SKIP
  @on_hold_at = on_hold_at unless on_hold_at == SKIP
  @prepaid_dunning = prepaid_dunning unless prepaid_dunning == SKIP
  @coupons = coupons unless coupons == SKIP
  unless dunning_communication_delay_enabled == SKIP
    @dunning_communication_delay_enabled =
      dunning_communication_delay_enabled
  end
  unless dunning_communication_delay_time_zone == SKIP
    @dunning_communication_delay_time_zone =
      dunning_communication_delay_time_zone
  end
  @receives_invoice_emails = receives_invoice_emails unless receives_invoice_emails == SKIP
  @locale = locale unless locale == SKIP
  @currency = currency unless currency == SKIP
  unless scheduled_cancellation_at == SKIP
    @scheduled_cancellation_at =
      scheduled_cancellation_at
  end
  @credit_balance_in_cents = credit_balance_in_cents unless credit_balance_in_cents == SKIP
  unless prepayment_balance_in_cents == SKIP
    @prepayment_balance_in_cents =
      prepayment_balance_in_cents
  end
  @prepaid_configuration = prepaid_configuration unless prepaid_configuration == SKIP
  @self_service_page_token = self_service_page_token unless self_service_page_token == SKIP

  # Add additional model properties to the instance.
  additional_properties.each do |_name, _value|
    instance_variable_set("@#{_name}", _value)
  end
end

Instance Attribute Details

#activated_atDateTime

Timestamp for when the subscription began (i.e. when it came out of trial, or when it began in the case of no trial)

Returns:

  • (DateTime)


138
139
140
# File 'lib/advanced_billing/models/subscription.rb', line 138

def activated_at
  @activated_at
end

#automatically_resume_atDateTime

The date the subscription is scheduled to automatically resume from the on_hold state.

Returns:

  • (DateTime)


281
282
283
# File 'lib/advanced_billing/models/subscription.rb', line 281

def automatically_resume_at
  @automatically_resume_at
end

#balance_in_centsInteger

Gives the current outstanding subscription balance in the number of cents.

Returns:

  • (Integer)


94
95
96
# File 'lib/advanced_billing/models/subscription.rb', line 94

def balance_in_cents
  @balance_in_cents
end

#bank_accountBankAccountPaymentProfile

The type of payment collection to be used in the subscription. For legacy Statements Architecture valid options are - ‘invoice`, `automatic`. For current Relationship Invoicing Architecture valid options are - `remittance`, `automatic`, `prepaid`.



244
245
246
# File 'lib/advanced_billing/models/subscription.rb', line 244

def 
  @bank_account
end

#cancel_at_end_of_periodTrueClass | FalseClass

Whether or not the subscription will (or has) canceled at the end of the period.

Returns:

  • (TrueClass | FalseClass)


164
165
166
# File 'lib/advanced_billing/models/subscription.rb', line 164

def cancel_at_end_of_period
  @cancel_at_end_of_period
end

#canceled_atDateTime

The timestamp of the most recent cancellation

Returns:

  • (DateTime)


168
169
170
# File 'lib/advanced_billing/models/subscription.rb', line 168

def canceled_at
  @canceled_at
end

#cancellation_messageString

Seller-provided reason for, or note about, the cancellation.

Returns:

  • (String)


154
155
156
# File 'lib/advanced_billing/models/subscription.rb', line 154

def cancellation_message
  @cancellation_message
end

#cancellation_methodCancellationMethod

The process used to cancel the subscription, if the subscription has been canceled. It is nil if the subscription’s state is not canceled.

Returns:



159
160
161
# File 'lib/advanced_billing/models/subscription.rb', line 159

def cancellation_method
  @cancellation_method
end

#coupon_codeString

(deprecated) The coupon code of the single coupon currently applied to the subscription. See coupon_codes instead as subscriptions can now have more than one coupon.

Returns:

  • (String)


197
198
199
# File 'lib/advanced_billing/models/subscription.rb', line 197

def coupon_code
  @coupon_code
end

#coupon_codesArray[String]

An array for all the coupons attached to the subscription.

Returns:

  • (Array[String])


285
286
287
# File 'lib/advanced_billing/models/subscription.rb', line 285

def coupon_codes
  @coupon_codes
end

#coupon_use_countInteger

(deprecated) How many times the subscription’s single coupon has been used. This field has no replacement for multiple coupons.

Returns:

  • (Integer)


267
268
269
# File 'lib/advanced_billing/models/subscription.rb', line 267

def coupon_use_count
  @coupon_use_count
end

#coupon_uses_allowedInteger

(deprecated) How many times the subscription’s single coupon may be used. This field has no replacement for multiple coupons.

Returns:

  • (Integer)


272
273
274
# File 'lib/advanced_billing/models/subscription.rb', line 272

def coupon_uses_allowed
  @coupon_uses_allowed
end

#couponsArray[SubscriptionIncludedCoupon]

Additional coupon data. To use this data you also have to include the following param in the request`include[]=coupons`. Only in Read Subscription Endpoint.

Returns:



349
350
351
# File 'lib/advanced_billing/models/subscription.rb', line 349

def coupons
  @coupons
end

#created_atDateTime

The creation date for this subscription

Returns:

  • (DateTime)


146
147
148
# File 'lib/advanced_billing/models/subscription.rb', line 146

def created_at
  @created_at
end

#credit_balance_in_centsInteger

Time zone for the Dunning Communication Delay feature.

Returns:

  • (Integer)


379
380
381
# File 'lib/advanced_billing/models/subscription.rb', line 379

def credit_balance_in_cents
  @credit_balance_in_cents
end

#credit_cardCreditCardPaymentProfile

The type of payment collection to be used in the subscription. For legacy Statements Architecture valid options are - ‘invoice`, `automatic`. For current Relationship Invoicing Architecture valid options are - `remittance`, `automatic`, `prepaid`.



230
231
232
# File 'lib/advanced_billing/models/subscription.rb', line 230

def credit_card
  @credit_card
end

#currencyString

Time zone for the Dunning Communication Delay feature.

Returns:

  • (String)


371
372
373
# File 'lib/advanced_billing/models/subscription.rb', line 371

def currency
  @currency
end

#current_billing_amount_in_centsInteger

The balance in cents plus the estimated renewal amount in cents. Returned ONLY for readSubscription operation as it’s compute intensive operation.

Returns:

  • (Integer)


300
301
302
# File 'lib/advanced_billing/models/subscription.rb', line 300

def current_billing_amount_in_cents
  @current_billing_amount_in_cents
end

#current_period_ends_atDateTime

Timestamp relating to the end of the current (recurring) period (i.e.,when the next regularly scheduled attempted charge will occur)

Returns:

  • (DateTime)


115
116
117
# File 'lib/advanced_billing/models/subscription.rb', line 115

def current_period_ends_at
  @current_period_ends_at
end

#current_period_started_atDateTime

Timestamp relating to the start of the current (recurring) period

Returns:

  • (DateTime)


172
173
174
# File 'lib/advanced_billing/models/subscription.rb', line 172

def current_period_started_at
  @current_period_started_at
end

#customerCustomer

The type of payment collection to be used in the subscription. For legacy Statements Architecture valid options are - ‘invoice`, `automatic`. For current Relationship Invoicing Architecture valid options are - `remittance`, `automatic`, `prepaid`.

Returns:



216
217
218
# File 'lib/advanced_billing/models/subscription.rb', line 216

def customer
  @customer
end

#delayed_cancel_atDateTime

Timestamp for when the subscription is currently set to cancel.

Returns:

  • (DateTime)


191
192
193
# File 'lib/advanced_billing/models/subscription.rb', line 191

def delayed_cancel_at
  @delayed_cancel_at
end

#dunning_communication_delay_enabledTrueClass | FalseClass

Enable Communication Delay feature, making sure no communication (email or SMS) is sent to the Customer between 9PM and 8AM in time zone set by the ‘dunning_communication_delay_time_zone` attribute.

Returns:

  • (TrueClass | FalseClass)


355
356
357
# File 'lib/advanced_billing/models/subscription.rb', line 355

def dunning_communication_delay_enabled
  @dunning_communication_delay_enabled
end

#dunning_communication_delay_time_zoneString

Time zone for the Dunning Communication Delay feature.

Returns:

  • (String)


359
360
361
# File 'lib/advanced_billing/models/subscription.rb', line 359

def dunning_communication_delay_time_zone
  @dunning_communication_delay_time_zone
end

#expires_atDateTime

Timestamp giving the expiration date of this subscription (if any)

Returns:

  • (DateTime)


142
143
144
# File 'lib/advanced_billing/models/subscription.rb', line 142

def expires_at
  @expires_at
end

#groupNestedSubscriptionGroup

The type of payment collection to be used in the subscription. For legacy Statements Architecture valid options are - ‘invoice`, `automatic`. For current Relationship Invoicing Architecture valid options are - `remittance`, `automatic`, `prepaid`.



237
238
239
# File 'lib/advanced_billing/models/subscription.rb', line 237

def group
  @group
end

#idInteger

The subscription unique id within Chargify.

Returns:

  • (Integer)


15
16
17
# File 'lib/advanced_billing/models/subscription.rb', line 15

def id
  @id
end

#localeString

Time zone for the Dunning Communication Delay feature.

Returns:

  • (String)


367
368
369
# File 'lib/advanced_billing/models/subscription.rb', line 367

def locale
  @locale
end

#net_termsInteger

On Relationship Invoicing, the number of days before a renewal invoice is due.

Returns:

  • (Integer)


323
324
325
# File 'lib/advanced_billing/models/subscription.rb', line 323

def net_terms
  @net_terms
end

#next_assessment_atDateTime

Timestamp that indicates when capture of payment will be tried or,retried. This value will usually track the current_period_ends_at, but,will diverge if a renewal payment fails and must be retried. In that,case, the current_period_ends_at will advance to the end of the next,period (time doesn’t stop because a payment was missed) but the,next_assessment_at will be scheduled for the auto-retry time (i.e. 24,hours in the future, in some cases)

Returns:

  • (DateTime)


125
126
127
# File 'lib/advanced_billing/models/subscription.rb', line 125

def next_assessment_at
  @next_assessment_at
end

#next_product_handleString

If a delayed product change is scheduled, the handle of the product that the subscription will be changed to at the next renewal.

Returns:

  • (String)


262
263
264
# File 'lib/advanced_billing/models/subscription.rb', line 262

def next_product_handle
  @next_product_handle
end

#next_product_idInteger

If a delayed product change is scheduled, the ID of the product that the subscription will be changed to at the next renewal.

Returns:

  • (Integer)


257
258
259
# File 'lib/advanced_billing/models/subscription.rb', line 257

def next_product_id
  @next_product_id
end

#next_product_price_point_idInteger

If a delayed product change is scheduled, the ID of the product price point that the subscription will be changed to at the next renewal.

Returns:

  • (Integer)


318
319
320
# File 'lib/advanced_billing/models/subscription.rb', line 318

def next_product_price_point_id
  @next_product_price_point_id
end

#offer_idInteger

The ID of the offer associated with the subscription.

Returns:

  • (Integer)


289
290
291
# File 'lib/advanced_billing/models/subscription.rb', line 289

def offer_id
  @offer_id
end

#on_hold_atDateTime

The timestamp of the most recent on hold action.

Returns:

  • (DateTime)


337
338
339
# File 'lib/advanced_billing/models/subscription.rb', line 337

def on_hold_at
  @on_hold_at
end

#payer_idInteger

On Relationship Invoicing, the ID of the individual paying for the subscription. Defaults to the Customer ID unless the ‘Customer Hierarchies & WhoPays’ feature is enabled.

Returns:

  • (Integer)


295
296
297
# File 'lib/advanced_billing/models/subscription.rb', line 295

def payer_id
  @payer_id
end

#payment_collection_methodCollectionMethod

The type of payment collection to be used in the subscription. For legacy Statements Architecture valid options are - ‘invoice`, `automatic`. For current Relationship Invoicing Architecture valid options are - `remittance`, `automatic`, `prepaid`.

Returns:



209
210
211
# File 'lib/advanced_billing/models/subscription.rb', line 209

def payment_collection_method
  @payment_collection_method
end

#payment_typeString

The payment profile type for the active profile on file.

Returns:

  • (String)


248
249
250
# File 'lib/advanced_billing/models/subscription.rb', line 248

def payment_type
  @payment_type
end

#prepaid_configurationPrepaidConfiguration

Time zone for the Dunning Communication Delay feature.



387
388
389
# File 'lib/advanced_billing/models/subscription.rb', line 387

def prepaid_configuration
  @prepaid_configuration
end

#prepaid_dunningTrueClass | FalseClass

Boolean representing whether the subscription is prepaid and currently in dunning. Only returned for Relationship Invoicing sites with the feature enabled

Returns:

  • (TrueClass | FalseClass)


343
344
345
# File 'lib/advanced_billing/models/subscription.rb', line 343

def prepaid_dunning
  @prepaid_dunning
end

#prepayment_balance_in_centsInteger

Time zone for the Dunning Communication Delay feature.

Returns:

  • (Integer)


383
384
385
# File 'lib/advanced_billing/models/subscription.rb', line 383

def prepayment_balance_in_cents
  @prepayment_balance_in_cents
end

#previous_stateSubscriptionState

Only valid for webhook payloads The previous state for webhooks that have indicated a change in state. For normal API calls, this will always be the same as the state (current state)

Returns:



178
179
180
# File 'lib/advanced_billing/models/subscription.rb', line 178

def previous_state
  @previous_state
end

#productProduct

The type of payment collection to be used in the subscription. For legacy Statements Architecture valid options are - ‘invoice`, `automatic`. For current Relationship Invoicing Architecture valid options are - `remittance`, `automatic`, `prepaid`.

Returns:



223
224
225
# File 'lib/advanced_billing/models/subscription.rb', line 223

def product
  @product
end

#product_price_in_centsInteger

(Added Nov 5 2013) The recurring amount of the product (and version),currently subscribed. NOTE: this may differ from the current price of,the product, if you’ve changed the price of the product but haven’t,moved this subscription to a newer version.

Returns:

  • (Integer)


105
106
107
# File 'lib/advanced_billing/models/subscription.rb', line 105

def product_price_in_cents
  @product_price_in_cents
end

#product_price_point_idInteger

The product price point currently subscribed to.

Returns:

  • (Integer)


304
305
306
# File 'lib/advanced_billing/models/subscription.rb', line 304

def product_price_point_id
  @product_price_point_id
end

#product_price_point_typePricePointType

Price point type. We expose the following types:

  1. default: a price point that is marked as a default price for a

certain product.

  1. custom: a custom price point.

  2. catalog: a price point that is not marked as a default price

for a certain product and is not a custom one.

Returns:



313
314
315
# File 'lib/advanced_billing/models/subscription.rb', line 313

def product_price_point_type
  @product_price_point_type
end

#product_version_numberInteger

The version of the product for the subscription. Note that this is a deprecated field kept for backwards-compatibility.

Returns:

  • (Integer)


110
111
112
# File 'lib/advanced_billing/models/subscription.rb', line 110

def product_version_number
  @product_version_number
end

#reason_codeString

If the subscription is canceled, this is their churn code.

Returns:

  • (String)


276
277
278
# File 'lib/advanced_billing/models/subscription.rb', line 276

def reason_code
  @reason_code
end

#receives_invoice_emailsTrueClass | FalseClass

Time zone for the Dunning Communication Delay feature.

Returns:

  • (TrueClass | FalseClass)


363
364
365
# File 'lib/advanced_billing/models/subscription.rb', line 363

def receives_invoice_emails
  @receives_invoice_emails
end

#referenceString

The reference value (provided by your app) for the subscription itelf.

Returns:

  • (String)


333
334
335
# File 'lib/advanced_billing/models/subscription.rb', line 333

def reference
  @reference
end

#referral_codeString

The subscription’s unique code that can be given to referrals.

Returns:

  • (String)


252
253
254
# File 'lib/advanced_billing/models/subscription.rb', line 252

def referral_code
  @referral_code
end

#scheduled_cancellation_atDateTime

Time zone for the Dunning Communication Delay feature.

Returns:

  • (DateTime)


375
376
377
# File 'lib/advanced_billing/models/subscription.rb', line 375

def scheduled_cancellation_at
  @scheduled_cancellation_at
end

#self_service_page_tokenString

Returned only for list/read Subscription operation when ‘include[]=self_service_page_token` parameter is provided.

Returns:

  • (String)


392
393
394
# File 'lib/advanced_billing/models/subscription.rb', line 392

def self_service_page_token
  @self_service_page_token
end

#signup_payment_idInteger

The ID of the transaction that generated the revenue

Returns:

  • (Integer)


182
183
184
# File 'lib/advanced_billing/models/subscription.rb', line 182

def 
  @signup_payment_id
end

#signup_revenueString

The revenue, formatted as a string of decimal separated dollars and,cents, from the subscription signup ($50.00 would be formatted as,50.00)

Returns:

  • (String)


187
188
189
# File 'lib/advanced_billing/models/subscription.rb', line 187

def 
  @signup_revenue
end

#snap_dayString

The day of the month that the subscription will charge according to calendar billing rules, if used.

Returns:

  • (String)


202
203
204
# File 'lib/advanced_billing/models/subscription.rb', line 202

def snap_day
  @snap_day
end

#stateSubscriptionState

The state of a subscription.

  • **Live States**

    * `active` - A normal, active subscription. It is not in a trial and
    

is paid and up to date.

* `assessing` - An internal (transient) state that indicates a

subscription is in the middle of periodic assessment. Do not base any access decisions in your app on this state, as it may not always be exposed.

* `pending` - An internal (transient) state that indicates a

subscription is in the creation process. Do not base any access decisions in your app on this state, as it may not always be exposed.

* `trialing` - A subscription in trialing state has a valid trial

subscription. This type of subscription may transition to active once payment is received when the trial has ended. Otherwise, it may go to a Problem or End of Life state.

* `paused` - An internal state that indicates that your account with

Advanced Billing is in arrears.

  • **Problem States**

    * `past_due` - Indicates that the most recent payment has failed, and
    

payment is past due for this subscription. If you have enabled our automated dunning, this subscription will be in the dunning process (additional status and callbacks from the dunning process will be available in the future). If you are handling dunning and payment updates yourself, you will want to use this state to initiate a payment update from your customers.

* `soft_failure` - Indicates that normal assessment/processing of the

subscription has failed for a reason that cannot be fixed by the Customer. For example, a Soft Fail may result from a timeout at the gateway or incorrect credentials on your part. The subscriptions should be retried automatically. An interface is being built for you to review problems resulting from these events to take manual action when needed.

* `unpaid` - Indicates an unpaid subscription. A subscription is

marked unpaid if the retry period expires and you have configured your [Dunning](maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunni ng-Overview) settings to have a Final Action of ‘mark the subscription unpaid`.

  • **End of Life States**

    * `canceled` - Indicates a canceled subscription. This may happen at
    

your request (via the API or the web interface) or due to the expiration of the [Dunning](maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunni ng-Overview) process without payment. See the [Reactivation](maxio.zendesk.com/hc/en-us/articles/24252109503629- Reactivating-and-Resuming) documentation for info on how to restart a canceled subscription.

While a subscription is canceled, its period will not advance, it will

not accrue any new charges, and Advanced Billing will not attempt to collect the overdue balance.

* `expired` - Indicates a subscription that has expired due to running

its normal life cycle. Some products may be configured to have an expiration period. An expired subscription then is one that stayed active until it fulfilled its full period.

* `failed_to_create` - Indicates that signup has failed. (You may see

this state in a signup_failure webhook.)

* `on_hold` - Indicates that a subscription’s billing has been

temporarily stopped. While it is expected that the subscription will resume and return to active status, this is still treated as an “End of Life” state because the customer is not paying for services during this time.

* `suspended` - Indicates that a prepaid subscription has used up all

their prepayment balance. If a prepayment is applied, it will return to an active state.

* `trial_ended` - A subscription in a trial_ended state is a

subscription that completed a no-obligation trial and did not have a card on file at the expiration of the trial period. See [Product Pricing – No Obligation Trials](maxio.zendesk.com/hc/en-us/articles/24261076617869-Product -Editing) for more details. See [Subscription States](maxio.zendesk.com/hc/en-us/articles/24252119027853-Subscri ption-States) for more info about subscription states and state transitions.

Returns:



90
91
92
# File 'lib/advanced_billing/models/subscription.rb', line 90

def state
  @state
end

#stored_credential_transaction_idInteger

For European sites subject to PSD2 and using 3D Secure, this can be used to reference a previous transaction for the customer. This will ensure the card will be charged successfully at renewal.

Returns:

  • (Integer)


329
330
331
# File 'lib/advanced_billing/models/subscription.rb', line 329

def stored_credential_transaction_id
  @stored_credential_transaction_id
end

#total_revenue_in_centsInteger

Gives the total revenue from the subscription in the number of cents.

Returns:

  • (Integer)


98
99
100
# File 'lib/advanced_billing/models/subscription.rb', line 98

def total_revenue_in_cents
  @total_revenue_in_cents
end

#trial_ended_atDateTime

Timestamp for when the trial period (if any) ended

Returns:

  • (DateTime)


133
134
135
# File 'lib/advanced_billing/models/subscription.rb', line 133

def trial_ended_at
  @trial_ended_at
end

#trial_started_atDateTime

Timestamp for when the trial period (if any) began

Returns:

  • (DateTime)


129
130
131
# File 'lib/advanced_billing/models/subscription.rb', line 129

def trial_started_at
  @trial_started_at
end

#updated_atDateTime

The date of last update for this subscription

Returns:

  • (DateTime)


150
151
152
# File 'lib/advanced_billing/models/subscription.rb', line 150

def updated_at
  @updated_at
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
# File 'lib/advanced_billing/models/subscription.rb', line 703

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash.key?('id') ? hash['id'] : SKIP
  state = hash.key?('state') ? hash['state'] : SKIP
  balance_in_cents =
    hash.key?('balance_in_cents') ? hash['balance_in_cents'] : SKIP
  total_revenue_in_cents =
    hash.key?('total_revenue_in_cents') ? hash['total_revenue_in_cents'] : SKIP
  product_price_in_cents =
    hash.key?('product_price_in_cents') ? hash['product_price_in_cents'] : SKIP
  product_version_number =
    hash.key?('product_version_number') ? hash['product_version_number'] : SKIP
  current_period_ends_at = if hash.key?('current_period_ends_at')
                             (DateTimeHelper.from_rfc3339(hash['current_period_ends_at']) if hash['current_period_ends_at'])
                           else
                             SKIP
                           end
  next_assessment_at = if hash.key?('next_assessment_at')
                         (DateTimeHelper.from_rfc3339(hash['next_assessment_at']) if hash['next_assessment_at'])
                       else
                         SKIP
                       end
  trial_started_at = if hash.key?('trial_started_at')
                       (DateTimeHelper.from_rfc3339(hash['trial_started_at']) if hash['trial_started_at'])
                     else
                       SKIP
                     end
  trial_ended_at = if hash.key?('trial_ended_at')
                     (DateTimeHelper.from_rfc3339(hash['trial_ended_at']) if hash['trial_ended_at'])
                   else
                     SKIP
                   end
  activated_at = if hash.key?('activated_at')
                   (DateTimeHelper.from_rfc3339(hash['activated_at']) if hash['activated_at'])
                 else
                   SKIP
                 end
  expires_at = if hash.key?('expires_at')
                 (DateTimeHelper.from_rfc3339(hash['expires_at']) if hash['expires_at'])
               else
                 SKIP
               end
  created_at = if hash.key?('created_at')
                 (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at'])
               else
                 SKIP
               end
  updated_at = if hash.key?('updated_at')
                 (DateTimeHelper.from_rfc3339(hash['updated_at']) if hash['updated_at'])
               else
                 SKIP
               end
  cancellation_message =
    hash.key?('cancellation_message') ? hash['cancellation_message'] : SKIP
  cancellation_method =
    hash.key?('cancellation_method') ? hash['cancellation_method'] : SKIP
  cancel_at_end_of_period =
    hash.key?('cancel_at_end_of_period') ? hash['cancel_at_end_of_period'] : SKIP
  canceled_at = if hash.key?('canceled_at')
                  (DateTimeHelper.from_rfc3339(hash['canceled_at']) if hash['canceled_at'])
                else
                  SKIP
                end
  current_period_started_at = if hash.key?('current_period_started_at')
                                (DateTimeHelper.from_rfc3339(hash['current_period_started_at']) if hash['current_period_started_at'])
                              else
                                SKIP
                              end
  previous_state =
    hash.key?('previous_state') ? hash['previous_state'] : SKIP
   =
    hash.key?('signup_payment_id') ? hash['signup_payment_id'] : SKIP
   =
    hash.key?('signup_revenue') ? hash['signup_revenue'] : SKIP
  delayed_cancel_at = if hash.key?('delayed_cancel_at')
                        (DateTimeHelper.from_rfc3339(hash['delayed_cancel_at']) if hash['delayed_cancel_at'])
                      else
                        SKIP
                      end
  coupon_code = hash.key?('coupon_code') ? hash['coupon_code'] : SKIP
  snap_day = hash.key?('snap_day') ? hash['snap_day'] : SKIP
  payment_collection_method =
    hash.key?('payment_collection_method') ? hash['payment_collection_method'] : SKIP
  customer = Customer.from_hash(hash['customer']) if hash['customer']
  product = Product.from_hash(hash['product']) if hash['product']
  credit_card = CreditCardPaymentProfile.from_hash(hash['credit_card']) if hash['credit_card']
  group = NestedSubscriptionGroup.from_hash(hash['group']) if hash['group']
   = BankAccountPaymentProfile.from_hash(hash['bank_account']) if
    hash['bank_account']
  payment_type = hash.key?('payment_type') ? hash['payment_type'] : SKIP
  referral_code = hash.key?('referral_code') ? hash['referral_code'] : SKIP
  next_product_id =
    hash.key?('next_product_id') ? hash['next_product_id'] : SKIP
  next_product_handle =
    hash.key?('next_product_handle') ? hash['next_product_handle'] : SKIP
  coupon_use_count =
    hash.key?('coupon_use_count') ? hash['coupon_use_count'] : SKIP
  coupon_uses_allowed =
    hash.key?('coupon_uses_allowed') ? hash['coupon_uses_allowed'] : SKIP
  reason_code = hash.key?('reason_code') ? hash['reason_code'] : SKIP
  automatically_resume_at = if hash.key?('automatically_resume_at')
                              (DateTimeHelper.from_rfc3339(hash['automatically_resume_at']) if hash['automatically_resume_at'])
                            else
                              SKIP
                            end
  coupon_codes = hash.key?('coupon_codes') ? hash['coupon_codes'] : SKIP
  offer_id = hash.key?('offer_id') ? hash['offer_id'] : SKIP
  payer_id = hash.key?('payer_id') ? hash['payer_id'] : SKIP
  current_billing_amount_in_cents =
    hash.key?('current_billing_amount_in_cents') ? hash['current_billing_amount_in_cents'] : SKIP
  product_price_point_id =
    hash.key?('product_price_point_id') ? hash['product_price_point_id'] : SKIP
  product_price_point_type =
    hash.key?('product_price_point_type') ? hash['product_price_point_type'] : SKIP
  next_product_price_point_id =
    hash.key?('next_product_price_point_id') ? hash['next_product_price_point_id'] : SKIP
  net_terms = hash.key?('net_terms') ? hash['net_terms'] : SKIP
  stored_credential_transaction_id =
    hash.key?('stored_credential_transaction_id') ? hash['stored_credential_transaction_id'] : SKIP
  reference = hash.key?('reference') ? hash['reference'] : SKIP
  on_hold_at = if hash.key?('on_hold_at')
                 (DateTimeHelper.from_rfc3339(hash['on_hold_at']) if hash['on_hold_at'])
               else
                 SKIP
               end
  prepaid_dunning =
    hash.key?('prepaid_dunning') ? hash['prepaid_dunning'] : SKIP
  # Parameter is an array, so we need to iterate through it
  coupons = nil
  unless hash['coupons'].nil?
    coupons = []
    hash['coupons'].each do |structure|
      coupons << (SubscriptionIncludedCoupon.from_hash(structure) if structure)
    end
  end

  coupons = SKIP unless hash.key?('coupons')
  dunning_communication_delay_enabled =
    hash.key?('dunning_communication_delay_enabled') ? hash['dunning_communication_delay_enabled'] : SKIP
  dunning_communication_delay_time_zone =
    hash.key?('dunning_communication_delay_time_zone') ? hash['dunning_communication_delay_time_zone'] : SKIP
  receives_invoice_emails =
    hash.key?('receives_invoice_emails') ? hash['receives_invoice_emails'] : SKIP
  locale = hash.key?('locale') ? hash['locale'] : SKIP
  currency = hash.key?('currency') ? hash['currency'] : SKIP
  scheduled_cancellation_at = if hash.key?('scheduled_cancellation_at')
                                (DateTimeHelper.from_rfc3339(hash['scheduled_cancellation_at']) if hash['scheduled_cancellation_at'])
                              else
                                SKIP
                              end
  credit_balance_in_cents =
    hash.key?('credit_balance_in_cents') ? hash['credit_balance_in_cents'] : SKIP
  prepayment_balance_in_cents =
    hash.key?('prepayment_balance_in_cents') ? hash['prepayment_balance_in_cents'] : SKIP
  prepaid_configuration = PrepaidConfiguration.from_hash(hash['prepaid_configuration']) if
    hash['prepaid_configuration']
  self_service_page_token =
    hash.key?('self_service_page_token') ? hash['self_service_page_token'] : SKIP

  # Clean out expected properties from Hash.
  names.each_value { |k| hash.delete(k) }

  # Create object from extracted values.
  Subscription.new(id: id,
                   state: state,
                   balance_in_cents: balance_in_cents,
                   total_revenue_in_cents: total_revenue_in_cents,
                   product_price_in_cents: product_price_in_cents,
                   product_version_number: product_version_number,
                   current_period_ends_at: current_period_ends_at,
                   next_assessment_at: next_assessment_at,
                   trial_started_at: trial_started_at,
                   trial_ended_at: trial_ended_at,
                   activated_at: activated_at,
                   expires_at: expires_at,
                   created_at: created_at,
                   updated_at: updated_at,
                   cancellation_message: cancellation_message,
                   cancellation_method: cancellation_method,
                   cancel_at_end_of_period: cancel_at_end_of_period,
                   canceled_at: canceled_at,
                   current_period_started_at: current_period_started_at,
                   previous_state: previous_state,
                   signup_payment_id: ,
                   signup_revenue: ,
                   delayed_cancel_at: delayed_cancel_at,
                   coupon_code: coupon_code,
                   snap_day: snap_day,
                   payment_collection_method: payment_collection_method,
                   customer: customer,
                   product: product,
                   credit_card: credit_card,
                   group: group,
                   bank_account: ,
                   payment_type: payment_type,
                   referral_code: referral_code,
                   next_product_id: next_product_id,
                   next_product_handle: next_product_handle,
                   coupon_use_count: coupon_use_count,
                   coupon_uses_allowed: coupon_uses_allowed,
                   reason_code: reason_code,
                   automatically_resume_at: automatically_resume_at,
                   coupon_codes: coupon_codes,
                   offer_id: offer_id,
                   payer_id: payer_id,
                   current_billing_amount_in_cents: current_billing_amount_in_cents,
                   product_price_point_id: product_price_point_id,
                   product_price_point_type: product_price_point_type,
                   next_product_price_point_id: next_product_price_point_id,
                   net_terms: net_terms,
                   stored_credential_transaction_id: stored_credential_transaction_id,
                   reference: reference,
                   on_hold_at: on_hold_at,
                   prepaid_dunning: prepaid_dunning,
                   coupons: coupons,
                   dunning_communication_delay_enabled: dunning_communication_delay_enabled,
                   dunning_communication_delay_time_zone: dunning_communication_delay_time_zone,
                   receives_invoice_emails: receives_invoice_emails,
                   locale: locale,
                   currency: currency,
                   scheduled_cancellation_at: scheduled_cancellation_at,
                   credit_balance_in_cents: credit_balance_in_cents,
                   prepayment_balance_in_cents: prepayment_balance_in_cents,
                   prepaid_configuration: prepaid_configuration,
                   self_service_page_token: self_service_page_token,
                   additional_properties: hash)
end

.namesObject

A mapping from model property names to API property names.



395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
# File 'lib/advanced_billing/models/subscription.rb', line 395

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['state'] = 'state'
  @_hash['balance_in_cents'] = 'balance_in_cents'
  @_hash['total_revenue_in_cents'] = 'total_revenue_in_cents'
  @_hash['product_price_in_cents'] = 'product_price_in_cents'
  @_hash['product_version_number'] = 'product_version_number'
  @_hash['current_period_ends_at'] = 'current_period_ends_at'
  @_hash['next_assessment_at'] = 'next_assessment_at'
  @_hash['trial_started_at'] = 'trial_started_at'
  @_hash['trial_ended_at'] = 'trial_ended_at'
  @_hash['activated_at'] = 'activated_at'
  @_hash['expires_at'] = 'expires_at'
  @_hash['created_at'] = 'created_at'
  @_hash['updated_at'] = 'updated_at'
  @_hash['cancellation_message'] = 'cancellation_message'
  @_hash['cancellation_method'] = 'cancellation_method'
  @_hash['cancel_at_end_of_period'] = 'cancel_at_end_of_period'
  @_hash['canceled_at'] = 'canceled_at'
  @_hash['current_period_started_at'] = 'current_period_started_at'
  @_hash['previous_state'] = 'previous_state'
  @_hash['signup_payment_id'] = 'signup_payment_id'
  @_hash['signup_revenue'] = 'signup_revenue'
  @_hash['delayed_cancel_at'] = 'delayed_cancel_at'
  @_hash['coupon_code'] = 'coupon_code'
  @_hash['snap_day'] = 'snap_day'
  @_hash['payment_collection_method'] = 'payment_collection_method'
  @_hash['customer'] = 'customer'
  @_hash['product'] = 'product'
  @_hash['credit_card'] = 'credit_card'
  @_hash['group'] = 'group'
  @_hash['bank_account'] = 'bank_account'
  @_hash['payment_type'] = 'payment_type'
  @_hash['referral_code'] = 'referral_code'
  @_hash['next_product_id'] = 'next_product_id'
  @_hash['next_product_handle'] = 'next_product_handle'
  @_hash['coupon_use_count'] = 'coupon_use_count'
  @_hash['coupon_uses_allowed'] = 'coupon_uses_allowed'
  @_hash['reason_code'] = 'reason_code'
  @_hash['automatically_resume_at'] = 'automatically_resume_at'
  @_hash['coupon_codes'] = 'coupon_codes'
  @_hash['offer_id'] = 'offer_id'
  @_hash['payer_id'] = 'payer_id'
  @_hash['current_billing_amount_in_cents'] =
    'current_billing_amount_in_cents'
  @_hash['product_price_point_id'] = 'product_price_point_id'
  @_hash['product_price_point_type'] = 'product_price_point_type'
  @_hash['next_product_price_point_id'] = 'next_product_price_point_id'
  @_hash['net_terms'] = 'net_terms'
  @_hash['stored_credential_transaction_id'] =
    'stored_credential_transaction_id'
  @_hash['reference'] = 'reference'
  @_hash['on_hold_at'] = 'on_hold_at'
  @_hash['prepaid_dunning'] = 'prepaid_dunning'
  @_hash['coupons'] = 'coupons'
  @_hash['dunning_communication_delay_enabled'] =
    'dunning_communication_delay_enabled'
  @_hash['dunning_communication_delay_time_zone'] =
    'dunning_communication_delay_time_zone'
  @_hash['receives_invoice_emails'] = 'receives_invoice_emails'
  @_hash['locale'] = 'locale'
  @_hash['currency'] = 'currency'
  @_hash['scheduled_cancellation_at'] = 'scheduled_cancellation_at'
  @_hash['credit_balance_in_cents'] = 'credit_balance_in_cents'
  @_hash['prepayment_balance_in_cents'] = 'prepayment_balance_in_cents'
  @_hash['prepaid_configuration'] = 'prepaid_configuration'
  @_hash['self_service_page_token'] = 'self_service_page_token'
  @_hash
end

.nullablesObject

An array for nullable fields



535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
# File 'lib/advanced_billing/models/subscription.rb', line 535

def self.nullables
  %w[
    current_period_ends_at
    next_assessment_at
    trial_started_at
    trial_ended_at
    activated_at
    expires_at
    cancellation_message
    cancellation_method
    cancel_at_end_of_period
    canceled_at
    current_period_started_at
    delayed_cancel_at
    coupon_code
    snap_day
    group
    payment_type
    referral_code
    next_product_id
    next_product_handle
    coupon_use_count
    coupon_uses_allowed
    reason_code
    automatically_resume_at
    offer_id
    payer_id
    next_product_price_point_id
    net_terms
    stored_credential_transaction_id
    reference
    on_hold_at
    dunning_communication_delay_time_zone
    receives_invoice_emails
    locale
    scheduled_cancellation_at
    prepaid_configuration
  ]
end

.optionalsObject

An array for optional fields



467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
# File 'lib/advanced_billing/models/subscription.rb', line 467

def self.optionals
  %w[
    id
    state
    balance_in_cents
    total_revenue_in_cents
    product_price_in_cents
    product_version_number
    current_period_ends_at
    next_assessment_at
    trial_started_at
    trial_ended_at
    activated_at
    expires_at
    created_at
    updated_at
    cancellation_message
    cancellation_method
    cancel_at_end_of_period
    canceled_at
    current_period_started_at
    previous_state
    signup_payment_id
    signup_revenue
    delayed_cancel_at
    coupon_code
    snap_day
    payment_collection_method
    customer
    product
    credit_card
    group
    bank_account
    payment_type
    referral_code
    next_product_id
    next_product_handle
    coupon_use_count
    coupon_uses_allowed
    reason_code
    automatically_resume_at
    coupon_codes
    offer_id
    payer_id
    current_billing_amount_in_cents
    product_price_point_id
    product_price_point_type
    next_product_price_point_id
    net_terms
    stored_credential_transaction_id
    reference
    on_hold_at
    prepaid_dunning
    coupons
    dunning_communication_delay_enabled
    dunning_communication_delay_time_zone
    receives_invoice_emails
    locale
    currency
    scheduled_cancellation_at
    credit_balance_in_cents
    prepayment_balance_in_cents
    prepaid_configuration
    self_service_page_token
  ]
end

Instance Method Details

#to_custom_activated_atObject



949
950
951
# File 'lib/advanced_billing/models/subscription.rb', line 949

def to_custom_activated_at
  DateTimeHelper.to_rfc3339(activated_at)
end

#to_custom_automatically_resume_atObject



977
978
979
# File 'lib/advanced_billing/models/subscription.rb', line 977

def to_custom_automatically_resume_at
  DateTimeHelper.to_rfc3339(automatically_resume_at)
end

#to_custom_canceled_atObject



965
966
967
# File 'lib/advanced_billing/models/subscription.rb', line 965

def to_custom_canceled_at
  DateTimeHelper.to_rfc3339(canceled_at)
end

#to_custom_created_atObject



957
958
959
# File 'lib/advanced_billing/models/subscription.rb', line 957

def to_custom_created_at
  DateTimeHelper.to_rfc3339(created_at)
end

#to_custom_current_period_ends_atObject



933
934
935
# File 'lib/advanced_billing/models/subscription.rb', line 933

def to_custom_current_period_ends_at
  DateTimeHelper.to_rfc3339(current_period_ends_at)
end

#to_custom_current_period_started_atObject



969
970
971
# File 'lib/advanced_billing/models/subscription.rb', line 969

def to_custom_current_period_started_at
  DateTimeHelper.to_rfc3339(current_period_started_at)
end

#to_custom_delayed_cancel_atObject



973
974
975
# File 'lib/advanced_billing/models/subscription.rb', line 973

def to_custom_delayed_cancel_at
  DateTimeHelper.to_rfc3339(delayed_cancel_at)
end

#to_custom_expires_atObject



953
954
955
# File 'lib/advanced_billing/models/subscription.rb', line 953

def to_custom_expires_at
  DateTimeHelper.to_rfc3339(expires_at)
end

#to_custom_next_assessment_atObject



937
938
939
# File 'lib/advanced_billing/models/subscription.rb', line 937

def to_custom_next_assessment_at
  DateTimeHelper.to_rfc3339(next_assessment_at)
end

#to_custom_on_hold_atObject



981
982
983
# File 'lib/advanced_billing/models/subscription.rb', line 981

def to_custom_on_hold_at
  DateTimeHelper.to_rfc3339(on_hold_at)
end

#to_custom_scheduled_cancellation_atObject



985
986
987
# File 'lib/advanced_billing/models/subscription.rb', line 985

def to_custom_scheduled_cancellation_at
  DateTimeHelper.to_rfc3339(scheduled_cancellation_at)
end

#to_custom_trial_ended_atObject



945
946
947
# File 'lib/advanced_billing/models/subscription.rb', line 945

def to_custom_trial_ended_at
  DateTimeHelper.to_rfc3339(trial_ended_at)
end

#to_custom_trial_started_atObject



941
942
943
# File 'lib/advanced_billing/models/subscription.rb', line 941

def to_custom_trial_started_at
  DateTimeHelper.to_rfc3339(trial_started_at)
end

#to_custom_updated_atObject



961
962
963
# File 'lib/advanced_billing/models/subscription.rb', line 961

def to_custom_updated_at
  DateTimeHelper.to_rfc3339(updated_at)
end