Class: Pago::V2026_04::Models::Order
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Constant Summary collapse
- JSON_KEYS =
{ id: "id", created_at: "created_at", modified_at: "modified_at", status: "status", paid: "paid", subtotal_amount: "subtotal_amount", discount_amount: "discount_amount", net_amount: "net_amount", tax_amount: "tax_amount", total_amount: "total_amount", applied_balance_amount: "applied_balance_amount", due_amount: "due_amount", refunded_amount: "refunded_amount", refunded_tax_amount: "refunded_tax_amount", currency: "currency", billing_reason: "billing_reason", billing_name: "billing_name", billing_address: "billing_address", invoice_number: "invoice_number", is_invoice_generated: "is_invoice_generated", receipt_number: "receipt_number", seats: "seats", customer_id: "customer_id", product_id: "product_id", discount_id: "discount_id", subscription_id: "subscription_id", checkout_id: "checkout_id", next_payment_attempt_at: "next_payment_attempt_at", metadata: "metadata", custom_field_data: "custom_field_data", platform_fee_amount: "platform_fee_amount", platform_fee_currency: "platform_fee_currency", customer: "customer", product: "product", discount: "discount", subscription: "subscription", items: "items", description: "description", refundable_amount: "refundable_amount", refundable_tax_amount: "refundable_tax_amount" }.freeze
- REQUIRED_KEYS =
["id", "created_at", "modified_at", "status", "paid", "subtotal_amount", "discount_amount", "net_amount", "tax_amount", "total_amount", "applied_balance_amount", "due_amount", "refunded_amount", "refunded_tax_amount", "currency", "billing_reason", "billing_name", "billing_address", "invoice_number", "is_invoice_generated", "receipt_number", "customer_id", "product_id", "discount_id", "subscription_id", "checkout_id", "metadata", "platform_fee_amount", "platform_fee_currency", "customer", "product", "discount", "subscription", "items", "description", "refundable_amount", "refundable_tax_amount"].freeze
Instance Attribute Summary collapse
-
#applied_balance_amount ⇒ Integer
readonly
Customer's balance amount applied to this invoice.
- #billing_address ⇒ Models::Address? readonly
-
#billing_name ⇒ String?
readonly
The name of the customer that should appear on the invoice.
- #billing_reason ⇒ String readonly
- #checkout_id ⇒ String? readonly
-
#created_at ⇒ String
readonly
Creation timestamp of the object.
- #currency ⇒ String readonly
-
#custom_field_data ⇒ Hash{String => String, Integer, Boolean, nil}
readonly
Key-value object storing custom field values.
- #customer ⇒ Models::OrderCustomer readonly
- #customer_id ⇒ String readonly
-
#description ⇒ String
readonly
A summary description of the order.
- #discount ⇒ Models::DiscountFixedOnceForeverDurationBase, ... readonly
-
#discount_amount ⇒ Integer
readonly
Discount amount in cents.
- #discount_id ⇒ String? readonly
-
#due_amount ⇒ Integer
readonly
Amount in cents that is due for this order.
-
#id ⇒ String
readonly
The ID of the object.
-
#invoice_number ⇒ String?
readonly
The invoice number associated with this order.
-
#is_invoice_generated ⇒ Boolean
readonly
Whether an invoice has been generated for this order.
-
#items ⇒ Array<Models::OrderItemSchema>
readonly
Line items composing the order.
- #metadata ⇒ Hash{String => String, Integer, Float, Boolean} readonly
-
#modified_at ⇒ String?
readonly
Last modification timestamp of the object.
-
#net_amount ⇒ Integer
readonly
Amount in cents, after discounts but before taxes.
-
#next_payment_attempt_at ⇒ String?
readonly
When the next automatic payment retry is scheduled.
-
#paid ⇒ Boolean
readonly
Whether the order has been paid for.
-
#platform_fee_amount ⇒ Integer
readonly
Platform fee amount in cents.
-
#platform_fee_currency ⇒ String?
readonly
Currency of the platform fee.
- #product ⇒ Models::OrderProduct? readonly
- #product_id ⇒ String? readonly
-
#receipt_number ⇒ String?
readonly
The receipt number for this order.
-
#refundable_amount ⇒ Integer
readonly
Amount in cents that can still be refunded (net, before taxes).
-
#refundable_tax_amount ⇒ Integer
readonly
Sales tax in cents that would be refunded if the full refundable amount is refunded.
-
#refunded_amount ⇒ Integer
readonly
Amount refunded in cents.
-
#refunded_tax_amount ⇒ Integer
readonly
Sales tax refunded in cents.
-
#seats ⇒ Integer?
readonly
Number of seats purchased (for seat-based one-time orders).
- #status ⇒ String readonly
- #subscription ⇒ Models::OrderSubscription? readonly
- #subscription_id ⇒ String? readonly
-
#subtotal_amount ⇒ Integer
readonly
Amount in cents, before discounts and taxes.
-
#tax_amount ⇒ Integer
readonly
Sales tax amount in cents.
-
#total_amount ⇒ Integer
readonly
Amount in cents, after discounts and taxes.
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(id:, created_at:, modified_at:, status:, paid:, subtotal_amount:, discount_amount:, net_amount:, tax_amount:, total_amount:, applied_balance_amount:, due_amount:, refunded_amount:, refunded_tax_amount:, currency:, billing_reason:, billing_name:, billing_address:, invoice_number:, is_invoice_generated:, receipt_number:, seats: ::Pago::UNSET, customer_id:, product_id:, discount_id:, subscription_id:, checkout_id:, next_payment_attempt_at: ::Pago::UNSET, metadata:, custom_field_data: ::Pago::UNSET, platform_fee_amount:, platform_fee_currency:, customer:, product:, discount:, subscription:, items:, description:, refundable_amount:, refundable_tax_amount:) ⇒ Order
Returns a new instance of Order.
32038 32039 32040 32041 32042 32043 32044 32045 32046 32047 32048 32049 32050 32051 32052 32053 32054 32055 32056 32057 32058 32059 32060 32061 32062 32063 32064 32065 32066 32067 32068 32069 32070 32071 32072 32073 32074 32075 32076 32077 32078 32079 32080 32081 32082 32083 32084 32085 32086 32087 32088 32089 32090 32091 32092 32093 32094 32095 32096 32097 32098 32099 32100 32101 32102 32103 32104 32105 32106 32107 32108 32109 32110 32111 32112 32113 32114 32115 32116 32117 32118 32119 32120 32121 |
# File 'lib/pago/v2026_04/models.rb', line 32038 def initialize( id:, created_at:, modified_at:, status:, paid:, subtotal_amount:, discount_amount:, net_amount:, tax_amount:, total_amount:, applied_balance_amount:, due_amount:, refunded_amount:, refunded_tax_amount:, currency:, billing_reason:, billing_name:, billing_address:, invoice_number:, is_invoice_generated:, receipt_number:, seats: ::Pago::UNSET, customer_id:, product_id:, discount_id:, subscription_id:, checkout_id:, next_payment_attempt_at: ::Pago::UNSET, metadata:, custom_field_data: ::Pago::UNSET, platform_fee_amount:, platform_fee_currency:, customer:, product:, discount:, subscription:, items:, description:, refundable_amount:, refundable_tax_amount: ) super() assign(:id, id) assign(:created_at, created_at) assign(:modified_at, modified_at) assign(:status, status) assign(:paid, paid) assign(:subtotal_amount, subtotal_amount) assign(:discount_amount, discount_amount) assign(:net_amount, net_amount) assign(:tax_amount, tax_amount) assign(:total_amount, total_amount) assign(:applied_balance_amount, applied_balance_amount) assign(:due_amount, due_amount) assign(:refunded_amount, refunded_amount) assign(:refunded_tax_amount, refunded_tax_amount) assign(:currency, currency) assign(:billing_reason, billing_reason) assign(:billing_name, billing_name) assign(:billing_address, billing_address) assign(:invoice_number, invoice_number) assign(:is_invoice_generated, is_invoice_generated) assign(:receipt_number, receipt_number) assign(:seats, seats) assign(:customer_id, customer_id) assign(:product_id, product_id) assign(:discount_id, discount_id) assign(:subscription_id, subscription_id) assign(:checkout_id, checkout_id) assign(:next_payment_attempt_at, next_payment_attempt_at) assign(:metadata, ) assign(:custom_field_data, custom_field_data) assign(:platform_fee_amount, platform_fee_amount) assign(:platform_fee_currency, platform_fee_currency) assign(:customer, customer) assign(:product, product) assign(:discount, discount) assign(:subscription, subscription) assign(:items, items) assign(:description, description) assign(:refundable_amount, refundable_amount) assign(:refundable_tax_amount, refundable_tax_amount) end |
Instance Attribute Details
#applied_balance_amount ⇒ Integer (readonly)
Customer's balance amount applied to this invoice. Can increase the total amount paid, if the customer has a negative balance, or decrease it, if the customer has a positive balance.Amount in cents.
31933 31934 31935 |
# File 'lib/pago/v2026_04/models.rb', line 31933 def applied_balance_amount @applied_balance_amount end |
#billing_address ⇒ Models::Address? (readonly)
31958 31959 31960 |
# File 'lib/pago/v2026_04/models.rb', line 31958 def billing_address @billing_address end |
#billing_name ⇒ String? (readonly)
The name of the customer that should appear on the invoice.
31955 31956 31957 |
# File 'lib/pago/v2026_04/models.rb', line 31955 def billing_name @billing_name end |
#billing_reason ⇒ String (readonly)
31951 31952 31953 |
# File 'lib/pago/v2026_04/models.rb', line 31951 def billing_reason @billing_reason end |
#checkout_id ⇒ String? (readonly)
31989 31990 31991 |
# File 'lib/pago/v2026_04/models.rb', line 31989 def checkout_id @checkout_id end |
#created_at ⇒ String (readonly)
Creation timestamp of the object.
31898 31899 31900 |
# File 'lib/pago/v2026_04/models.rb', line 31898 def created_at @created_at end |
#currency ⇒ String (readonly)
31948 31949 31950 |
# File 'lib/pago/v2026_04/models.rb', line 31948 def currency @currency end |
#custom_field_data ⇒ Hash{String => String, Integer, Boolean, nil} (readonly)
Key-value object storing custom field values.
32000 32001 32002 |
# File 'lib/pago/v2026_04/models.rb', line 32000 def custom_field_data @custom_field_data end |
#customer ⇒ Models::OrderCustomer (readonly)
32011 32012 32013 |
# File 'lib/pago/v2026_04/models.rb', line 32011 def customer @customer end |
#customer_id ⇒ String (readonly)
31977 31978 31979 |
# File 'lib/pago/v2026_04/models.rb', line 31977 def customer_id @customer_id end |
#description ⇒ String (readonly)
A summary description of the order.
32028 32029 32030 |
# File 'lib/pago/v2026_04/models.rb', line 32028 def description @description end |
#discount ⇒ Models::DiscountFixedOnceForeverDurationBase, ... (readonly)
32017 32018 32019 |
# File 'lib/pago/v2026_04/models.rb', line 32017 def discount @discount end |
#discount_amount ⇒ Integer (readonly)
Discount amount in cents.
31917 31918 31919 |
# File 'lib/pago/v2026_04/models.rb', line 31917 def discount_amount @discount_amount end |
#discount_id ⇒ String? (readonly)
31983 31984 31985 |
# File 'lib/pago/v2026_04/models.rb', line 31983 def discount_id @discount_id end |
#due_amount ⇒ Integer (readonly)
Amount in cents that is due for this order.
31937 31938 31939 |
# File 'lib/pago/v2026_04/models.rb', line 31937 def due_amount @due_amount end |
#id ⇒ String (readonly)
The ID of the object.
31894 31895 31896 |
# File 'lib/pago/v2026_04/models.rb', line 31894 def id @id end |
#invoice_number ⇒ String? (readonly)
The invoice number associated with this order. null while the order is in draft status; assigned at finalize.
31962 31963 31964 |
# File 'lib/pago/v2026_04/models.rb', line 31962 def invoice_number @invoice_number end |
#is_invoice_generated ⇒ Boolean (readonly)
Whether an invoice has been generated for this order.
31966 31967 31968 |
# File 'lib/pago/v2026_04/models.rb', line 31966 def is_invoice_generated @is_invoice_generated end |
#items ⇒ Array<Models::OrderItemSchema> (readonly)
Line items composing the order.
32024 32025 32026 |
# File 'lib/pago/v2026_04/models.rb', line 32024 def items @items end |
#metadata ⇒ Hash{String => String, Integer, Float, Boolean} (readonly)
31996 31997 31998 |
# File 'lib/pago/v2026_04/models.rb', line 31996 def @metadata end |
#modified_at ⇒ String? (readonly)
Last modification timestamp of the object.
31902 31903 31904 |
# File 'lib/pago/v2026_04/models.rb', line 31902 def modified_at @modified_at end |
#net_amount ⇒ Integer (readonly)
Amount in cents, after discounts but before taxes.
31921 31922 31923 |
# File 'lib/pago/v2026_04/models.rb', line 31921 def net_amount @net_amount end |
#next_payment_attempt_at ⇒ String? (readonly)
When the next automatic payment retry is scheduled. null if the order is not in dunning or all retries have been exhausted.
31993 31994 31995 |
# File 'lib/pago/v2026_04/models.rb', line 31993 def next_payment_attempt_at @next_payment_attempt_at end |
#paid ⇒ Boolean (readonly)
Whether the order has been paid for.
31909 31910 31911 |
# File 'lib/pago/v2026_04/models.rb', line 31909 def paid @paid end |
#platform_fee_amount ⇒ Integer (readonly)
Platform fee amount in cents.
32004 32005 32006 |
# File 'lib/pago/v2026_04/models.rb', line 32004 def platform_fee_amount @platform_fee_amount end |
#platform_fee_currency ⇒ String? (readonly)
Currency of the platform fee.
32008 32009 32010 |
# File 'lib/pago/v2026_04/models.rb', line 32008 def platform_fee_currency @platform_fee_currency end |
#product ⇒ Models::OrderProduct? (readonly)
32014 32015 32016 |
# File 'lib/pago/v2026_04/models.rb', line 32014 def product @product end |
#product_id ⇒ String? (readonly)
31980 31981 31982 |
# File 'lib/pago/v2026_04/models.rb', line 31980 def product_id @product_id end |
#receipt_number ⇒ String? (readonly)
The receipt number for this order. Set once the order is paid for organizations with receipts enabled. When set, a downloadable receipt PDF can be obtained via the receipt endpoint.
31970 31971 31972 |
# File 'lib/pago/v2026_04/models.rb', line 31970 def receipt_number @receipt_number end |
#refundable_amount ⇒ Integer (readonly)
Amount in cents that can still be refunded (net, before taxes). Accounts for any applied customer balance and previous refunds.
32032 32033 32034 |
# File 'lib/pago/v2026_04/models.rb', line 32032 def refundable_amount @refundable_amount end |
#refundable_tax_amount ⇒ Integer (readonly)
Sales tax in cents that would be refunded if the full refundable amount is refunded.
32036 32037 32038 |
# File 'lib/pago/v2026_04/models.rb', line 32036 def refundable_tax_amount @refundable_tax_amount end |
#refunded_amount ⇒ Integer (readonly)
Amount refunded in cents.
31941 31942 31943 |
# File 'lib/pago/v2026_04/models.rb', line 31941 def refunded_amount @refunded_amount end |
#refunded_tax_amount ⇒ Integer (readonly)
Sales tax refunded in cents.
31945 31946 31947 |
# File 'lib/pago/v2026_04/models.rb', line 31945 def refunded_tax_amount @refunded_tax_amount end |
#seats ⇒ Integer? (readonly)
Number of seats purchased (for seat-based one-time orders).
31974 31975 31976 |
# File 'lib/pago/v2026_04/models.rb', line 31974 def seats @seats end |
#status ⇒ String (readonly)
31905 31906 31907 |
# File 'lib/pago/v2026_04/models.rb', line 31905 def status @status end |
#subscription ⇒ Models::OrderSubscription? (readonly)
32020 32021 32022 |
# File 'lib/pago/v2026_04/models.rb', line 32020 def subscription @subscription end |
#subscription_id ⇒ String? (readonly)
31986 31987 31988 |
# File 'lib/pago/v2026_04/models.rb', line 31986 def subscription_id @subscription_id end |
#subtotal_amount ⇒ Integer (readonly)
Amount in cents, before discounts and taxes.
31913 31914 31915 |
# File 'lib/pago/v2026_04/models.rb', line 31913 def subtotal_amount @subtotal_amount end |
#tax_amount ⇒ Integer (readonly)
Sales tax amount in cents.
31925 31926 31927 |
# File 'lib/pago/v2026_04/models.rb', line 31925 def tax_amount @tax_amount end |
#total_amount ⇒ Integer (readonly)
Amount in cents, after discounts and taxes.
31929 31930 31931 |
# File 'lib/pago/v2026_04/models.rb', line 31929 def total_amount @total_amount end |
Class Method Details
.from_json(data) ⇒ Order?
32125 32126 32127 32128 32129 32130 32131 32132 32133 32134 32135 32136 32137 32138 32139 32140 32141 32142 32143 32144 32145 32146 32147 32148 32149 32150 32151 32152 32153 32154 32155 32156 32157 32158 32159 32160 32161 32162 32163 32164 32165 32166 32167 32168 32169 32170 32171 32172 32173 32174 32175 |
# File 'lib/pago/v2026_04/models.rb', line 32125 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( id: (data.key?("id") ? data["id"] : ::Pago::UNSET), created_at: (data.key?("created_at") ? data["created_at"] : ::Pago::UNSET), modified_at: (data.key?("modified_at") ? data["modified_at"] : ::Pago::UNSET), status: (data.key?("status") ? data["status"] : ::Pago::UNSET), paid: (data.key?("paid") ? data["paid"] : ::Pago::UNSET), subtotal_amount: (data.key?("subtotal_amount") ? data["subtotal_amount"] : ::Pago::UNSET), discount_amount: (data.key?("discount_amount") ? data["discount_amount"] : ::Pago::UNSET), net_amount: (data.key?("net_amount") ? data["net_amount"] : ::Pago::UNSET), tax_amount: (data.key?("tax_amount") ? data["tax_amount"] : ::Pago::UNSET), total_amount: (data.key?("total_amount") ? data["total_amount"] : ::Pago::UNSET), applied_balance_amount: (data.key?("applied_balance_amount") ? data["applied_balance_amount"] : ::Pago::UNSET), due_amount: (data.key?("due_amount") ? data["due_amount"] : ::Pago::UNSET), refunded_amount: (data.key?("refunded_amount") ? data["refunded_amount"] : ::Pago::UNSET), refunded_tax_amount: (data.key?("refunded_tax_amount") ? data["refunded_tax_amount"] : ::Pago::UNSET), currency: (data.key?("currency") ? data["currency"] : ::Pago::UNSET), billing_reason: (data.key?("billing_reason") ? data["billing_reason"] : ::Pago::UNSET), billing_name: (data.key?("billing_name") ? data["billing_name"] : ::Pago::UNSET), billing_address: (data.key?("billing_address") ? Models::Address.from_json(data["billing_address"]) : ::Pago::UNSET), invoice_number: (data.key?("invoice_number") ? data["invoice_number"] : ::Pago::UNSET), is_invoice_generated: (data.key?("is_invoice_generated") ? data["is_invoice_generated"] : ::Pago::UNSET), receipt_number: (data.key?("receipt_number") ? data["receipt_number"] : ::Pago::UNSET), seats: (data.key?("seats") ? data["seats"] : ::Pago::UNSET), customer_id: (data.key?("customer_id") ? data["customer_id"] : ::Pago::UNSET), product_id: (data.key?("product_id") ? data["product_id"] : ::Pago::UNSET), discount_id: (data.key?("discount_id") ? data["discount_id"] : ::Pago::UNSET), subscription_id: (data.key?("subscription_id") ? data["subscription_id"] : ::Pago::UNSET), checkout_id: (data.key?("checkout_id") ? data["checkout_id"] : ::Pago::UNSET), next_payment_attempt_at: (data.key?("next_payment_attempt_at") ? data["next_payment_attempt_at"] : ::Pago::UNSET), metadata: (data.key?("metadata") ? data["metadata"] : ::Pago::UNSET), custom_field_data: (data.key?("custom_field_data") ? data["custom_field_data"] : ::Pago::UNSET), platform_fee_amount: (data.key?("platform_fee_amount") ? data["platform_fee_amount"] : ::Pago::UNSET), platform_fee_currency: (data.key?("platform_fee_currency") ? data["platform_fee_currency"] : ::Pago::UNSET), customer: (data.key?("customer") ? Models::OrderCustomer.from_json(data["customer"]) : ::Pago::UNSET), product: (data.key?("product") ? Models::OrderProduct.from_json(data["product"]) : ::Pago::UNSET), discount: (data.key?("discount") ? ::Pago::Serde.union(data["discount"], variants: [Models::DiscountFixedOnceForeverDurationBase, Models::DiscountFixedRepeatDurationBase, Models::DiscountPercentageOnceForeverDurationBase, Models::DiscountPercentageRepeatDurationBase]) : ::Pago::UNSET), subscription: (data.key?("subscription") ? Models::OrderSubscription.from_json(data["subscription"]) : ::Pago::UNSET), items: (data.key?("items") ? ::Pago::Serde.array(data["items"]) { |item0| Models::OrderItemSchema.from_json(item0) } : ::Pago::UNSET), description: (data.key?("description") ? data["description"] : ::Pago::UNSET), refundable_amount: (data.key?("refundable_amount") ? data["refundable_amount"] : ::Pago::UNSET), refundable_tax_amount: (data.key?("refundable_tax_amount") ? data["refundable_tax_amount"] : ::Pago::UNSET) ), data ) end |