Class: Pago::V2026_04::Models::ProductPriceFixedCreate

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

Overview

Schema to create a fixed price.

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  amount_type: "amount_type",
  price_currency: "price_currency",
  tax_behavior: "tax_behavior",
  price_amount: "price_amount"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["amount_type", "price_amount"].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(amount_type:, price_currency: ::Pago::UNSET, tax_behavior: ::Pago::UNSET, price_amount:) ⇒ ProductPriceFixedCreate

Returns a new instance of ProductPriceFixedCreate.

Parameters:

  • amount_type: (String)
  • price_currency: (String, nil) (defaults to: ::Pago::UNSET)
  • tax_behavior: (String, nil) (defaults to: ::Pago::UNSET)
  • price_amount: (Integer)


37418
37419
37420
37421
37422
37423
37424
37425
37426
37427
37428
37429
# File 'lib/pago/v2026_04/models.rb', line 37418

def initialize(
  amount_type:,
  price_currency: ::Pago::UNSET,
  tax_behavior: ::Pago::UNSET,
  price_amount:
)
  super()
  assign(:amount_type, amount_type)
  assign(:price_currency, price_currency)
  assign(:tax_behavior, tax_behavior)
  assign(:price_amount, price_amount)
end

Instance Attribute Details

#amount_typeString (readonly)

Returns:

  • (String)


37277
37278
37279
# File 'lib/pago/v2026_04/models.rb', line 37277

def amount_type
  @amount_type
end

#price_amountInteger (readonly)

The price in cents. Set to 0 for a free price. Minimum amounts per currency:

  • USD: 0.5
  • AED: 2
  • ALL: 50
  • AMD: 200
  • AOA: 500
  • ARS: 750
  • AUD: 0.7
  • AWG: 1
  • AZN: 1
  • BAM: 1
  • BBD: 2
  • BDT: 70
  • BIF: 2,000
  • BMD: 1
  • BND: 1
  • BOB: 5
  • BRL: 2.5
  • BSD: 1
  • BWP: 10
  • BZD: 2
  • CAD: 0.7
  • CDF: 2,000
  • CHF: 0.5
  • CLP: 500
  • CNY: 5
  • COP: 2,000
  • CRC: 300
  • CVE: 50
  • CZK: 15
  • DJF: 100
  • DKK: 3.2
  • DOP: 40
  • DZD: 70
  • EGP: 30
  • ETB: 80
  • EUR: 0.5
  • FJD: 2
  • FKP: 1
  • GBP: 0.4
  • GEL: 2
  • GNF: 5,000
  • GIP: 1
  • GMD: 40
  • GTQ: 5
  • GYD: 200
  • HKD: 4
  • HNL: 20
  • HTG: 70
  • HUF: 175
  • IDR: 9,000
  • ILS: 1.5
  • INR: 60
  • ISK: 70
  • JMD: 80
  • JPY: 80
  • KES: 70
  • KGS: 50
  • KHR: 3,000
  • KMF: 500
  • KRW: 800
  • KYD: 1
  • KZT: 300
  • LAK: 20,000
  • LKR: 200
  • LRD: 100
  • LSL: 10
  • MAD: 5
  • MDL: 10
  • MGA: 3,000
  • MKD: 50
  • MNT: 2,000
  • MOP: 5
  • MUR: 50
  • MVR: 8
  • MXN: 9
  • MWK: 1,000
  • MYR: 2
  • MZN: 50
  • NAD: 10
  • NGN: 700
  • NIO: 20
  • NOK: 5
  • NPR: 80
  • NZD: 0.9
  • PAB: 1
  • PEN: 2
  • PGK: 3
  • PHP: 35
  • PKR: 200
  • PLN: 2
  • PYG: 4,000
  • QAR: 2
  • RON: 2.5
  • RSD: 60
  • RWF: 1,000
  • SAR: 2
  • SBD: 4
  • SCR: 8
  • SEK: 5
  • SGD: 0.7
  • SHP: 1
  • SOS: 500
  • SRD: 20
  • SZL: 10
  • THB: 20
  • TJS: 5
  • TOP: 2
  • TRY: 30
  • TTD: 4
  • TWD: 20
  • TZS: 2,000
  • UAH: 30
  • UGX: 2,000
  • UYU: 20
  • UZS: 7,000
  • VND: 20,000
  • VUV: 100
  • WST: 2
  • XAF: 500
  • XCD: 2
  • XCG: 1
  • XOF: 500
  • XPF: 100
  • YER: 200
  • ZAR: 9
  • ZMW: 10
  • Other currencies: 50 minor units

Returns:

  • (Integer)


37416
37417
37418
# File 'lib/pago/v2026_04/models.rb', line 37416

def price_amount
  @price_amount
end

#price_currencyString (readonly)

Returns:

  • (String)


37280
37281
37282
# File 'lib/pago/v2026_04/models.rb', line 37280

def price_currency
  @price_currency
end

#tax_behaviorString? (readonly)

The tax behavior of the price. If not set, it will default to the organization's default tax behavior.

Returns:

  • (String, nil)


37284
37285
37286
# File 'lib/pago/v2026_04/models.rb', line 37284

def tax_behavior
  @tax_behavior
end

Class Method Details

.from_json(data) ⇒ ProductPriceFixedCreate?

Parameters:

  • data (Hash, String, nil)

Returns:



37433
37434
37435
37436
37437
37438
37439
37440
37441
37442
37443
37444
37445
37446
37447
# File 'lib/pago/v2026_04/models.rb', line 37433

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(
      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),
      price_amount: (data.key?("price_amount") ? data["price_amount"] : ::Pago::UNSET)
    ),
    data
  )
end