Class: Pago::V2026_04::Models::CustomerOrder
- 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", product: "product", 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", "product", "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
- #customer_id ⇒ String readonly
-
#description ⇒ String
readonly
A summary description of the order.
-
#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.
-
#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.
- #product ⇒ Models::CustomerOrderProduct? 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::CustomerOrderSubscription? 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, product:, subscription:, items:, description:, refundable_amount:, refundable_tax_amount:) ⇒ CustomerOrder
Returns a new instance of CustomerOrder.
17450 17451 17452 17453 17454 17455 17456 17457 17458 17459 17460 17461 17462 17463 17464 17465 17466 17467 17468 17469 17470 17471 17472 17473 17474 17475 17476 17477 17478 17479 17480 17481 17482 17483 17484 17485 17486 17487 17488 17489 17490 17491 17492 17493 17494 17495 17496 17497 17498 17499 17500 17501 17502 17503 17504 17505 17506 17507 17508 17509 17510 17511 17512 17513 17514 17515 17516 17517 17518 17519 17520 17521 |
# File 'lib/pago/v2026_04/models.rb', line 17450 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, product:, 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(:product, product) 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.
17366 17367 17368 |
# File 'lib/pago/v2026_04/models.rb', line 17366 def applied_balance_amount @applied_balance_amount end |
#billing_address ⇒ Models::Address? (readonly)
17391 17392 17393 |
# File 'lib/pago/v2026_04/models.rb', line 17391 def billing_address @billing_address end |
#billing_name ⇒ String? (readonly)
The name of the customer that should appear on the invoice.
17388 17389 17390 |
# File 'lib/pago/v2026_04/models.rb', line 17388 def billing_name @billing_name end |
#billing_reason ⇒ String (readonly)
17384 17385 17386 |
# File 'lib/pago/v2026_04/models.rb', line 17384 def billing_reason @billing_reason end |
#checkout_id ⇒ String? (readonly)
17422 17423 17424 |
# File 'lib/pago/v2026_04/models.rb', line 17422 def checkout_id @checkout_id end |
#created_at ⇒ String (readonly)
Creation timestamp of the object.
17331 17332 17333 |
# File 'lib/pago/v2026_04/models.rb', line 17331 def created_at @created_at end |
#currency ⇒ String (readonly)
17381 17382 17383 |
# File 'lib/pago/v2026_04/models.rb', line 17381 def currency @currency end |
#customer_id ⇒ String (readonly)
17410 17411 17412 |
# File 'lib/pago/v2026_04/models.rb', line 17410 def customer_id @customer_id end |
#description ⇒ String (readonly)
A summary description of the order.
17440 17441 17442 |
# File 'lib/pago/v2026_04/models.rb', line 17440 def description @description end |
#discount_amount ⇒ Integer (readonly)
Discount amount in cents.
17350 17351 17352 |
# File 'lib/pago/v2026_04/models.rb', line 17350 def discount_amount @discount_amount end |
#discount_id ⇒ String? (readonly)
17416 17417 17418 |
# File 'lib/pago/v2026_04/models.rb', line 17416 def discount_id @discount_id end |
#due_amount ⇒ Integer (readonly)
Amount in cents that is due for this order.
17370 17371 17372 |
# File 'lib/pago/v2026_04/models.rb', line 17370 def due_amount @due_amount end |
#id ⇒ String (readonly)
The ID of the object.
17327 17328 17329 |
# File 'lib/pago/v2026_04/models.rb', line 17327 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.
17395 17396 17397 |
# File 'lib/pago/v2026_04/models.rb', line 17395 def invoice_number @invoice_number end |
#is_invoice_generated ⇒ Boolean (readonly)
Whether an invoice has been generated for this order.
17399 17400 17401 |
# File 'lib/pago/v2026_04/models.rb', line 17399 def is_invoice_generated @is_invoice_generated end |
#items ⇒ Array<Models::OrderItemSchema> (readonly)
Line items composing the order.
17436 17437 17438 |
# File 'lib/pago/v2026_04/models.rb', line 17436 def items @items end |
#modified_at ⇒ String? (readonly)
Last modification timestamp of the object.
17335 17336 17337 |
# File 'lib/pago/v2026_04/models.rb', line 17335 def modified_at @modified_at end |
#net_amount ⇒ Integer (readonly)
Amount in cents, after discounts but before taxes.
17354 17355 17356 |
# File 'lib/pago/v2026_04/models.rb', line 17354 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.
17426 17427 17428 |
# File 'lib/pago/v2026_04/models.rb', line 17426 def next_payment_attempt_at @next_payment_attempt_at end |
#paid ⇒ Boolean (readonly)
Whether the order has been paid for.
17342 17343 17344 |
# File 'lib/pago/v2026_04/models.rb', line 17342 def paid @paid end |
#product ⇒ Models::CustomerOrderProduct? (readonly)
17429 17430 17431 |
# File 'lib/pago/v2026_04/models.rb', line 17429 def product @product end |
#product_id ⇒ String? (readonly)
17413 17414 17415 |
# File 'lib/pago/v2026_04/models.rb', line 17413 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.
17403 17404 17405 |
# File 'lib/pago/v2026_04/models.rb', line 17403 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.
17444 17445 17446 |
# File 'lib/pago/v2026_04/models.rb', line 17444 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.
17448 17449 17450 |
# File 'lib/pago/v2026_04/models.rb', line 17448 def refundable_tax_amount @refundable_tax_amount end |
#refunded_amount ⇒ Integer (readonly)
Amount refunded in cents.
17374 17375 17376 |
# File 'lib/pago/v2026_04/models.rb', line 17374 def refunded_amount @refunded_amount end |
#refunded_tax_amount ⇒ Integer (readonly)
Sales tax refunded in cents.
17378 17379 17380 |
# File 'lib/pago/v2026_04/models.rb', line 17378 def refunded_tax_amount @refunded_tax_amount end |
#seats ⇒ Integer? (readonly)
Number of seats purchased (for seat-based one-time orders).
17407 17408 17409 |
# File 'lib/pago/v2026_04/models.rb', line 17407 def seats @seats end |
#status ⇒ String (readonly)
17338 17339 17340 |
# File 'lib/pago/v2026_04/models.rb', line 17338 def status @status end |
#subscription ⇒ Models::CustomerOrderSubscription? (readonly)
17432 17433 17434 |
# File 'lib/pago/v2026_04/models.rb', line 17432 def subscription @subscription end |
#subscription_id ⇒ String? (readonly)
17419 17420 17421 |
# File 'lib/pago/v2026_04/models.rb', line 17419 def subscription_id @subscription_id end |
#subtotal_amount ⇒ Integer (readonly)
Amount in cents, before discounts and taxes.
17346 17347 17348 |
# File 'lib/pago/v2026_04/models.rb', line 17346 def subtotal_amount @subtotal_amount end |
#tax_amount ⇒ Integer (readonly)
Sales tax amount in cents.
17358 17359 17360 |
# File 'lib/pago/v2026_04/models.rb', line 17358 def tax_amount @tax_amount end |
#total_amount ⇒ Integer (readonly)
Amount in cents, after discounts and taxes.
17362 17363 17364 |
# File 'lib/pago/v2026_04/models.rb', line 17362 def total_amount @total_amount end |
Class Method Details
.from_json(data) ⇒ CustomerOrder?
17525 17526 17527 17528 17529 17530 17531 17532 17533 17534 17535 17536 17537 17538 17539 17540 17541 17542 17543 17544 17545 17546 17547 17548 17549 17550 17551 17552 17553 17554 17555 17556 17557 17558 17559 17560 17561 17562 17563 17564 17565 17566 17567 17568 17569 |
# File 'lib/pago/v2026_04/models.rb', line 17525 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), product: (data.key?("product") ? Models::CustomerOrderProduct.from_json(data["product"]) : ::Pago::UNSET), subscription: (data.key?("subscription") ? Models::CustomerOrderSubscription.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 |