Class: Pago::V2026_04::Models::LegacyRecurringProductPriceCustom

Inherits:
Model
  • Object
show all
Defined in:
lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs

Overview

A pay-what-you-want recurring price for a product, i.e. a subscription.

Deprecated: The recurring interval should be set on the product itself.

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  created_at: "created_at",
  modified_at: "modified_at",
  id: "id",
  source: "source",
  amount_type: "amount_type",
  price_currency: "price_currency",
  tax_behavior: "tax_behavior",
  is_archived: "is_archived",
  product_id: "product_id",
  type: "type",
  recurring_interval: "recurring_interval",
  minimum_amount: "minimum_amount",
  maximum_amount: "maximum_amount",
  preset_amount: "preset_amount",
  legacy: "legacy"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["created_at", "modified_at", "id", "source", "amount_type", "price_currency", "tax_behavior", "is_archived", "product_id", "type", "recurring_interval", "minimum_amount", "maximum_amount", "preset_amount", "legacy"].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw

Constructor Details

#initialize(created_at:, modified_at:, id:, source:, amount_type:, price_currency:, tax_behavior:, is_archived:, product_id:, type:, recurring_interval:, minimum_amount:, maximum_amount:, preset_amount:, legacy:) ⇒ LegacyRecurringProductPriceCustom

Returns a new instance of LegacyRecurringProductPriceCustom.

Parameters:

  • created_at: (String)
  • modified_at: (String, nil)
  • id: (String)
  • source: (String)
  • amount_type: (String)
  • price_currency: (String)
  • tax_behavior: (String, nil)
  • is_archived: (Boolean)
  • product_id: (String)
  • type: (String)
  • recurring_interval: (String)
  • minimum_amount: (Integer)
  • maximum_amount: (Integer, nil)
  • preset_amount: (Integer, nil)
  • legacy: (Boolean)


26344
26345
26346
26347
26348
26349
26350
26351
26352
26353
26354
26355
26356
26357
26358
26359
26360
26361
26362
26363
26364
26365
26366
26367
26368
26369
26370
26371
26372
26373
26374
26375
26376
26377
# File 'lib/pago/v2026_04/models.rb', line 26344

def initialize(
  created_at:,
  modified_at:,
  id:,
  source:,
  amount_type:,
  price_currency:,
  tax_behavior:,
  is_archived:,
  product_id:,
  type:,
  recurring_interval:,
  minimum_amount:,
  maximum_amount:,
  preset_amount:,
  legacy:
)
  super()
  assign(:created_at, created_at)
  assign(:modified_at, modified_at)
  assign(:id, id)
  assign(:source, source)
  assign(:amount_type, amount_type)
  assign(:price_currency, price_currency)
  assign(:tax_behavior, tax_behavior)
  assign(:is_archived, is_archived)
  assign(:product_id, product_id)
  assign(:type, type)
  assign(:recurring_interval, recurring_interval)
  assign(:minimum_amount, minimum_amount)
  assign(:maximum_amount, maximum_amount)
  assign(:preset_amount, preset_amount)
  assign(:legacy, legacy)
end

Instance Attribute Details

#amount_typeString (readonly)

Returns:

  • (String)


26304
26305
26306
# File 'lib/pago/v2026_04/models.rb', line 26304

def amount_type
  @amount_type
end

#created_atString (readonly)

Creation timestamp of the object.

Returns:

  • (String)


26290
26291
26292
# File 'lib/pago/v2026_04/models.rb', line 26290

def created_at
  @created_at
end

#idString (readonly)

The ID of the price.

Returns:

  • (String)


26298
26299
26300
# File 'lib/pago/v2026_04/models.rb', line 26298

def id
  @id
end

#is_archivedBoolean (readonly)

Whether the price is archived and no longer available.

Returns:

  • (Boolean)


26316
26317
26318
# File 'lib/pago/v2026_04/models.rb', line 26316

def is_archived
  @is_archived
end

#legacyBoolean (readonly)

Returns:

  • (Boolean)


26342
26343
26344
# File 'lib/pago/v2026_04/models.rb', line 26342

def legacy
  @legacy
end

#maximum_amountInteger? (readonly)

The maximum amount the customer can pay.

Returns:

  • (Integer, nil)


26335
26336
26337
# File 'lib/pago/v2026_04/models.rb', line 26335

def maximum_amount
  @maximum_amount
end

#minimum_amountInteger (readonly)

The minimum amount the customer can pay. If 0, the price is 'free or pay what you want'.

Returns:

  • (Integer)


26331
26332
26333
# File 'lib/pago/v2026_04/models.rb', line 26331

def minimum_amount
  @minimum_amount
end

#modified_atString? (readonly)

Last modification timestamp of the object.

Returns:

  • (String, nil)


26294
26295
26296
# File 'lib/pago/v2026_04/models.rb', line 26294

def modified_at
  @modified_at
end

#preset_amountInteger? (readonly)

The initial amount shown to the customer.

Returns:

  • (Integer, nil)


26339
26340
26341
# File 'lib/pago/v2026_04/models.rb', line 26339

def preset_amount
  @preset_amount
end

#price_currencyString (readonly)

The currency in which the customer will be charged.

Returns:

  • (String)


26308
26309
26310
# File 'lib/pago/v2026_04/models.rb', line 26308

def price_currency
  @price_currency
end

#product_idString (readonly)

The ID of the product owning the price.

Returns:

  • (String)


26320
26321
26322
# File 'lib/pago/v2026_04/models.rb', line 26320

def product_id
  @product_id
end

#recurring_intervalString (readonly)

Returns:

  • (String)


26327
26328
26329
# File 'lib/pago/v2026_04/models.rb', line 26327

def recurring_interval
  @recurring_interval
end

#sourceString (readonly)

Returns:

  • (String)


26301
26302
26303
# File 'lib/pago/v2026_04/models.rb', line 26301

def source
  @source
end

#tax_behaviorString? (readonly)

The tax behavior of the price. If null, it defaults to the organization's default tax behavior.

Returns:

  • (String, nil)


26312
26313
26314
# File 'lib/pago/v2026_04/models.rb', line 26312

def tax_behavior
  @tax_behavior
end

#typeString (readonly)

The type of the price.

Returns:

  • (String)


26324
26325
26326
# File 'lib/pago/v2026_04/models.rb', line 26324

def type
  @type
end

Class Method Details

.from_json(data) ⇒ LegacyRecurringProductPriceCustom?

Parameters:

  • data (Hash, String, nil)

Returns:



26381
26382
26383
26384
26385
26386
26387
26388
26389
26390
26391
26392
26393
26394
26395
26396
26397
26398
26399
26400
26401
26402
26403
26404
26405
26406
# File 'lib/pago/v2026_04/models.rb', line 26381

def self.from_json(data)
  data = ::JSON.parse(data) if data.is_a?(String)
  data = ::Pago::Serde.object(data)
  return nil if data.nil?

  wrap_raw(
    new(
      created_at: (data.key?("created_at") ? data["created_at"] : ::Pago::UNSET),
      modified_at: (data.key?("modified_at") ? data["modified_at"] : ::Pago::UNSET),
      id: (data.key?("id") ? data["id"] : ::Pago::UNSET),
      source: (data.key?("source") ? data["source"] : ::Pago::UNSET),
      amount_type: (data.key?("amount_type") ? data["amount_type"] : ::Pago::UNSET),
      price_currency: (data.key?("price_currency") ? data["price_currency"] : ::Pago::UNSET),
      tax_behavior: (data.key?("tax_behavior") ? data["tax_behavior"] : ::Pago::UNSET),
      is_archived: (data.key?("is_archived") ? data["is_archived"] : ::Pago::UNSET),
      product_id: (data.key?("product_id") ? data["product_id"] : ::Pago::UNSET),
      type: (data.key?("type") ? data["type"] : ::Pago::UNSET),
      recurring_interval: (data.key?("recurring_interval") ? data["recurring_interval"] : ::Pago::UNSET),
      minimum_amount: (data.key?("minimum_amount") ? data["minimum_amount"] : ::Pago::UNSET),
      maximum_amount: (data.key?("maximum_amount") ? data["maximum_amount"] : ::Pago::UNSET),
      preset_amount: (data.key?("preset_amount") ? data["preset_amount"] : ::Pago::UNSET),
      legacy: (data.key?("legacy") ? data["legacy"] : ::Pago::UNSET)
    ),
    data
  )
end