Class: Stripe::ProductCreateParams::DefaultPriceData

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/params/product_create_params.rb

Defined Under Namespace

Classes: CurrencyOptions, CustomUnitAmount, Recurring

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, currency_options: nil, custom_unit_amount: nil, metadata: nil, recurring: nil, tax_behavior: nil, unit_amount: nil, unit_amount_decimal: nil) ⇒ DefaultPriceData

Returns a new instance of DefaultPriceData.



147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# File 'lib/stripe/params/product_create_params.rb', line 147

def initialize(
  currency: nil,
  currency_options: nil,
  custom_unit_amount: nil,
  metadata: nil,
  recurring: nil,
  tax_behavior: nil,
  unit_amount: nil,
  unit_amount_decimal: nil
)
  @currency = currency
  @currency_options = currency_options
  @custom_unit_amount = custom_unit_amount
  @metadata = 
  @recurring = recurring
  @tax_behavior = tax_behavior
  @unit_amount = unit_amount
  @unit_amount_decimal = unit_amount_decimal
end

Instance Attribute Details

#currencyObject

Three-letter [ISO currency code](www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](stripe.com/docs/currencies).



131
132
133
# File 'lib/stripe/params/product_create_params.rb', line 131

def currency
  @currency
end

#currency_optionsObject

Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](www.iso.org/iso-4217-currency-codes.html) and a [supported currency](stripe.com/docs/currencies).



133
134
135
# File 'lib/stripe/params/product_create_params.rb', line 133

def currency_options
  @currency_options
end

#custom_unit_amountObject

When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links.



135
136
137
# File 'lib/stripe/params/product_create_params.rb', line 135

def custom_unit_amount
  @custom_unit_amount
end

#metadataObject

Set of [key-value pairs](docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to ‘metadata`.



137
138
139
# File 'lib/stripe/params/product_create_params.rb', line 137

def 
  @metadata
end

#recurringObject

The recurring components of a price such as ‘interval` and `interval_count`.



139
140
141
# File 'lib/stripe/params/product_create_params.rb', line 139

def recurring
  @recurring
end

#tax_behaviorObject

Only required if a [default tax behavior](docs.stripe.com/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of ‘inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.



141
142
143
# File 'lib/stripe/params/product_create_params.rb', line 141

def tax_behavior
  @tax_behavior
end

#unit_amountObject

A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of ‘unit_amount`, `unit_amount_decimal`, or `custom_unit_amount` is required.



143
144
145
# File 'lib/stripe/params/product_create_params.rb', line 143

def unit_amount
  @unit_amount
end

#unit_amount_decimalObject

Same as ‘unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.



145
146
147
# File 'lib/stripe/params/product_create_params.rb', line 145

def unit_amount_decimal
  @unit_amount_decimal
end

Class Method Details

.field_encodingsObject



167
168
169
# File 'lib/stripe/params/product_create_params.rb', line 167

def self.field_encodings
  @field_encodings = { unit_amount_decimal: :decimal_string }
end