Class: Pago::V2026_04::Models::ProductPriceCustom
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Overview
A pay-what-you-want price for a product.
Constant Summary collapse
- JSON_KEYS =
{ 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", minimum_amount: "minimum_amount", maximum_amount: "maximum_amount", preset_amount: "preset_amount" }.freeze
- REQUIRED_KEYS =
["created_at", "modified_at", "id", "source", "amount_type", "price_currency", "tax_behavior", "is_archived", "product_id", "minimum_amount", "maximum_amount", "preset_amount"].freeze
Instance Attribute Summary collapse
- #amount_type ⇒ String readonly
-
#created_at ⇒ String
readonly
Creation timestamp of the object.
-
#id ⇒ String
readonly
The ID of the price.
-
#is_archived ⇒ Boolean
readonly
Whether the price is archived and no longer available.
-
#maximum_amount ⇒ Integer?
readonly
The maximum amount the customer can pay.
-
#minimum_amount ⇒ Integer
readonly
The minimum amount the customer can pay.
-
#modified_at ⇒ String?
readonly
Last modification timestamp of the object.
-
#preset_amount ⇒ Integer?
readonly
The initial amount shown to the customer.
-
#price_currency ⇒ String
readonly
The currency in which the customer will be charged.
-
#product_id ⇒ String
readonly
The ID of the product owning the price.
- #source ⇒ String readonly
-
#tax_behavior ⇒ String?
readonly
The tax behavior of the price.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(created_at:, modified_at:, id:, source:, amount_type:, price_currency:, tax_behavior:, is_archived:, product_id:, minimum_amount:, maximum_amount:, preset_amount:) ⇒ ProductPriceCustom
constructor
A new instance of ProductPriceCustom.
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:, minimum_amount:, maximum_amount:, preset_amount:) ⇒ ProductPriceCustom
Returns a new instance of ProductPriceCustom.
36764 36765 36766 36767 36768 36769 36770 36771 36772 36773 36774 36775 36776 36777 36778 36779 36780 36781 36782 36783 36784 36785 36786 36787 36788 36789 36790 36791 |
# File 'lib/pago/v2026_04/models.rb', line 36764 def initialize( created_at:, modified_at:, id:, source:, amount_type:, price_currency:, tax_behavior:, is_archived:, product_id:, minimum_amount:, maximum_amount:, preset_amount: ) 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(:minimum_amount, minimum_amount) assign(:maximum_amount, maximum_amount) assign(:preset_amount, preset_amount) end |
Instance Attribute Details
#amount_type ⇒ String (readonly)
36734 36735 36736 |
# File 'lib/pago/v2026_04/models.rb', line 36734 def amount_type @amount_type end |
#created_at ⇒ String (readonly)
Creation timestamp of the object.
36720 36721 36722 |
# File 'lib/pago/v2026_04/models.rb', line 36720 def created_at @created_at end |
#id ⇒ String (readonly)
The ID of the price.
36728 36729 36730 |
# File 'lib/pago/v2026_04/models.rb', line 36728 def id @id end |
#is_archived ⇒ Boolean (readonly)
Whether the price is archived and no longer available.
36746 36747 36748 |
# File 'lib/pago/v2026_04/models.rb', line 36746 def is_archived @is_archived end |
#maximum_amount ⇒ Integer? (readonly)
The maximum amount the customer can pay.
36758 36759 36760 |
# File 'lib/pago/v2026_04/models.rb', line 36758 def maximum_amount @maximum_amount end |
#minimum_amount ⇒ Integer (readonly)
The minimum amount the customer can pay. If 0, the price is 'free or pay what you want'.
36754 36755 36756 |
# File 'lib/pago/v2026_04/models.rb', line 36754 def minimum_amount @minimum_amount end |
#modified_at ⇒ String? (readonly)
Last modification timestamp of the object.
36724 36725 36726 |
# File 'lib/pago/v2026_04/models.rb', line 36724 def modified_at @modified_at end |
#preset_amount ⇒ Integer? (readonly)
The initial amount shown to the customer.
36762 36763 36764 |
# File 'lib/pago/v2026_04/models.rb', line 36762 def preset_amount @preset_amount end |
#price_currency ⇒ String (readonly)
The currency in which the customer will be charged.
36738 36739 36740 |
# File 'lib/pago/v2026_04/models.rb', line 36738 def price_currency @price_currency end |
#product_id ⇒ String (readonly)
The ID of the product owning the price.
36750 36751 36752 |
# File 'lib/pago/v2026_04/models.rb', line 36750 def product_id @product_id end |
#source ⇒ String (readonly)
36731 36732 36733 |
# File 'lib/pago/v2026_04/models.rb', line 36731 def source @source end |
#tax_behavior ⇒ String? (readonly)
The tax behavior of the price. If null, it defaults to the organization's default tax behavior.
36742 36743 36744 |
# File 'lib/pago/v2026_04/models.rb', line 36742 def tax_behavior @tax_behavior end |
Class Method Details
.from_json(data) ⇒ ProductPriceCustom?
36795 36796 36797 36798 36799 36800 36801 36802 36803 36804 36805 36806 36807 36808 36809 36810 36811 36812 36813 36814 36815 36816 36817 |
# File 'lib/pago/v2026_04/models.rb', line 36795 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), 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) ), data ) end |