Class: Stripe::V2::Billing::LicenseFeeCreateParams

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/params/v2/billing/license_fee_create_params.rb

Defined Under Namespace

Classes: Tier, TransformQuantity

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

attr_accessor, coerce_params, coerce_value, new, #to_h

Constructor Details

#initialize(currency: nil, display_name: nil, licensed_item: nil, lookup_key: nil, metadata: nil, service_interval: nil, service_interval_count: nil, tax_behavior: nil, tiering_mode: nil, tiers: nil, transform_quantity: nil, unit_amount: nil) ⇒ LicenseFeeCreateParams

Returns a new instance of LicenseFeeCreateParams.



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/stripe/params/v2/billing/license_fee_create_params.rb', line 81

def initialize(
  currency: nil,
  display_name: nil,
  licensed_item: nil,
  lookup_key: nil,
  metadata: nil,
  service_interval: nil,
  service_interval_count: nil,
  tax_behavior: nil,
  tiering_mode: nil,
  tiers: nil,
  transform_quantity: nil,
  unit_amount: nil
)
  @currency = currency
  @display_name = display_name
  @licensed_item = licensed_item
  @lookup_key = lookup_key
  @metadata = 
  @service_interval = service_interval
  @service_interval_count = service_interval_count
  @tax_behavior = tax_behavior
  @tiering_mode = tiering_mode
  @tiers = tiers
  @transform_quantity = transform_quantity
  @unit_amount = unit_amount
end

Instance Attribute Details

#currencyObject

Three-letter ISO currency code, in lowercase. Must be a supported currency.



48
49
50
# File 'lib/stripe/params/v2/billing/license_fee_create_params.rb', line 48

def currency
  @currency
end

#display_nameObject

A customer-facing name for the License Fee. This name is used in Stripe-hosted products like the Customer Portal and Checkout. It does not show up on Invoices. Maximum length of 250 characters.



52
53
54
# File 'lib/stripe/params/v2/billing/license_fee_create_params.rb', line 52

def display_name
  @display_name
end

#licensed_itemObject

The Licensed Item that this License Fee binds to.



54
55
56
# File 'lib/stripe/params/v2/billing/license_fee_create_params.rb', line 54

def licensed_item
  @licensed_item
end

#lookup_keyObject

An internal key you can use to search for a particular license fee. Maximum length of 200 characters.



56
57
58
# File 'lib/stripe/params/v2/billing/license_fee_create_params.rb', line 56

def lookup_key
  @lookup_key
end

#metadataObject

Set of [key-value pairs](/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.



58
59
60
# File 'lib/stripe/params/v2/billing/license_fee_create_params.rb', line 58

def 
  @metadata
end

#service_intervalObject

The interval for assessing service. For example, a monthly license fee with a rate of 1 USD for the first 10 “workloads” and 2 USD thereafter means “1 USD per workload up to 10 workloads during a month of service.” This is similar to but distinct from billing interval; the service interval deals with the rate at which the customer accumulates fees, while the billing interval in Cadence deals with the rate the customer is billed.



63
64
65
# File 'lib/stripe/params/v2/billing/license_fee_create_params.rb', line 63

def service_interval
  @service_interval
end

#service_interval_countObject

The length of the interval for assessing service. For example, set this to 3 and ‘service_interval` to `“month”` to specify quarterly service.



66
67
68
# File 'lib/stripe/params/v2/billing/license_fee_create_params.rb', line 66

def service_interval_count
  @service_interval_count
end

#tax_behaviorObject

The tax behavior for Stripe Tax — whether the license fee price includes or excludes tax.



68
69
70
# File 'lib/stripe/params/v2/billing/license_fee_create_params.rb', line 68

def tax_behavior
  @tax_behavior
end

#tiering_modeObject

Defines whether the tiered price is graduated or volume-based. In volume-based tiering, the maximum quantity within a period determines the per-unit price. In graduated tiering, the pricing changes as the quantity grows into new tiers. Can only be set if ‘tiers` is set.



72
73
74
# File 'lib/stripe/params/v2/billing/license_fee_create_params.rb', line 72

def tiering_mode
  @tiering_mode
end

#tiersObject

Each element represents a pricing tier. Cannot be set if ‘unit_amount` is provided.



74
75
76
# File 'lib/stripe/params/v2/billing/license_fee_create_params.rb', line 74

def tiers
  @tiers
end

#transform_quantityObject

Apply a transformation to the reported usage or set quantity before computing the amount billed.



76
77
78
# File 'lib/stripe/params/v2/billing/license_fee_create_params.rb', line 76

def transform_quantity
  @transform_quantity
end

#unit_amountObject

The per-unit amount to be charged, represented as a decimal string in minor currency units with at most 12 decimal places. Cannot be set if ‘tiers` is provided.



79
80
81
# File 'lib/stripe/params/v2/billing/license_fee_create_params.rb', line 79

def unit_amount
  @unit_amount
end

Class Method Details

.field_encodingsObject



109
110
111
112
113
114
115
116
117
# File 'lib/stripe/params/v2/billing/license_fee_create_params.rb', line 109

def self.field_encodings
  @field_encodings = {
    tiers: {
      kind: :array,
      element: { kind: :object, fields: { up_to_decimal: :decimal_string } },
    },
    transform_quantity: { kind: :object, fields: { divide_by: :int64_string } },
  }
end