Class: Stripe::V2::Billing::Contract

Inherits:
APIResource show all
Defined in:
lib/stripe/resources/v2/billing/contract.rb

Overview

Contract resource representing a comprehensive sales agreement

Defined Under Namespace

Classes: BillingCycleAnchor, BillingSettings, PricingLines, PricingOverrides, StatusTransitions

Constant Summary collapse

OBJECT_NAME =
"v2.billing.contract"

Constants inherited from StripeObject

StripeObject::RESERVED_FIELD_NAMES

Instance Attribute Summary collapse

Attributes inherited from APIResource

#save_with_parent

Attributes inherited from StripeObject

#last_response

Class Method Summary collapse

Methods inherited from APIResource

class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, save_nested_resource

Methods included from APIOperations::Request

included

Methods inherited from StripeObject

#==, #[], #[]=, #_get_inner_class_type, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values

Constructor Details

This class inherits a constructor from Stripe::StripeObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject

Instance Attribute Details

#billing_cycle_anchorObject (readonly)

The billing cycle anchor.



466
467
468
# File 'lib/stripe/resources/v2/billing/contract.rb', line 466

def billing_cycle_anchor
  @billing_cycle_anchor
end

#billing_settingsObject (readonly)

The billing settings.



468
469
470
# File 'lib/stripe/resources/v2/billing/contract.rb', line 468

def billing_settings
  @billing_settings
end

#contract_numberObject (readonly)

A unique user-provided contract number e.g. C-2026-0001.



470
471
472
# File 'lib/stripe/resources/v2/billing/contract.rb', line 470

def contract_number
  @contract_number
end

#createdObject (readonly)

Timestamp of when the contract was created.



472
473
474
# File 'lib/stripe/resources/v2/billing/contract.rb', line 472

def created
  @created
end

#currencyObject (readonly)

The currency.



474
475
476
# File 'lib/stripe/resources/v2/billing/contract.rb', line 474

def currency
  @currency
end

#customerObject (readonly)

The customer id.



476
477
478
# File 'lib/stripe/resources/v2/billing/contract.rb', line 476

def customer
  @customer
end

#idObject (readonly)

The contract id.



478
479
480
# File 'lib/stripe/resources/v2/billing/contract.rb', line 478

def id
  @id
end

#livemodeObject (readonly)

Has the value true if the object exists in live mode or the value false if the object exists in test mode.



480
481
482
# File 'lib/stripe/resources/v2/billing/contract.rb', line 480

def livemode
  @livemode
end

#metadataObject (readonly)

Set of key-value pairs.



482
483
484
# File 'lib/stripe/resources/v2/billing/contract.rb', line 482

def 
  @metadata
end

#objectObject (readonly)

String representing the object's type. Objects of the same type share the same value of the object field.



484
485
486
# File 'lib/stripe/resources/v2/billing/contract.rb', line 484

def object
  @object
end

#pricing_linesObject (readonly)

The pricing lines. Only populated when pricing_lines is passed in the include parameter.



486
487
488
# File 'lib/stripe/resources/v2/billing/contract.rb', line 486

def pricing_lines
  @pricing_lines
end

#pricing_overridesObject (readonly)

The pricing overrides. Only populated when pricing_overrides is passed in the include parameter.



488
489
490
# File 'lib/stripe/resources/v2/billing/contract.rb', line 488

def pricing_overrides
  @pricing_overrides
end

#statusObject (readonly)

The current status of the contract.



490
491
492
# File 'lib/stripe/resources/v2/billing/contract.rb', line 490

def status
  @status
end

#status_transitionsObject (readonly)

Historical timestamps of when the contract transitioned into each status.



492
493
494
# File 'lib/stripe/resources/v2/billing/contract.rb', line 492

def status_transitions
  @status_transitions
end

Class Method Details

.field_encodingsObject



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
533
# File 'lib/stripe/resources/v2/billing/contract.rb', line 508

def self.field_encodings
  @field_encodings = {
    pricing_lines: {
      kind: :object,
      fields: {
        data: {
          kind: :array,
          element: {
            kind: :object,
            fields: {
              pricing: {
                kind: :object,
                fields: {
                  price_details: {
                    kind: :object,
                    fields: { current_quantity: :decimal_string },
                  },
                },
              },
            },
          },
        },
      },
    },
  }
end

.field_remappingsObject



504
505
506
# File 'lib/stripe/resources/v2/billing/contract.rb', line 504

def self.field_remappings
  @field_remappings = {}
end

.inner_class_typesObject



494
495
496
497
498
499
500
501
502
# File 'lib/stripe/resources/v2/billing/contract.rb', line 494

def self.inner_class_types
  @inner_class_types = {
    billing_cycle_anchor: BillingCycleAnchor,
    billing_settings: BillingSettings,
    pricing_lines: PricingLines,
    pricing_overrides: PricingOverrides,
    status_transitions: StatusTransitions,
  }
end

.object_nameObject



10
11
12
# File 'lib/stripe/resources/v2/billing/contract.rb', line 10

def self.object_name
  "v2.billing.contract"
end