Class: Pago::V2026_04::Models::BalanceOrderMetadata

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

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  transaction_id: "transaction_id",
  order_id: "order_id",
  product_id: "product_id",
  subscription_id: "subscription_id",
  amount: "amount",
  net_amount: "net_amount",
  currency: "currency",
  presentment_amount: "presentment_amount",
  presentment_currency: "presentment_currency",
  tax_amount: "tax_amount",
  tax_state: "tax_state",
  tax_country: "tax_country",
  fee: "fee",
  exchange_rate: "exchange_rate"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["transaction_id", "order_id", "amount", "currency", "presentment_amount", "presentment_currency", "tax_amount", "fee"].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(transaction_id:, order_id:, product_id: ::Pago::UNSET, subscription_id: ::Pago::UNSET, amount:, net_amount: ::Pago::UNSET, currency:, presentment_amount:, presentment_currency:, tax_amount:, tax_state: ::Pago::UNSET, tax_country: ::Pago::UNSET, fee:, exchange_rate: ::Pago::UNSET) ⇒ BalanceOrderMetadata

Returns a new instance of BalanceOrderMetadata.

Parameters:

  • transaction_id: (String)
  • order_id: (String)
  • product_id: (String, nil) (defaults to: ::Pago::UNSET)
  • subscription_id: (String, nil) (defaults to: ::Pago::UNSET)
  • amount: (Integer)
  • net_amount: (Integer, nil) (defaults to: ::Pago::UNSET)
  • currency: (String)
  • presentment_amount: (Integer)
  • presentment_currency: (String)
  • tax_amount: (Integer)
  • tax_state: (String, nil) (defaults to: ::Pago::UNSET)
  • tax_country: (String, nil) (defaults to: ::Pago::UNSET)
  • fee: (Integer)
  • exchange_rate: (Float, nil) (defaults to: ::Pago::UNSET)


1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
# File 'lib/pago/v2026_04/models.rb', line 1501

def initialize(
  transaction_id:,
  order_id:,
  product_id: ::Pago::UNSET,
  subscription_id: ::Pago::UNSET,
  amount:,
  net_amount: ::Pago::UNSET,
  currency:,
  presentment_amount:,
  presentment_currency:,
  tax_amount:,
  tax_state: ::Pago::UNSET,
  tax_country: ::Pago::UNSET,
  fee:,
  exchange_rate: ::Pago::UNSET
)
  super()
  assign(:transaction_id, transaction_id)
  assign(:order_id, order_id)
  assign(:product_id, product_id)
  assign(:subscription_id, subscription_id)
  assign(:amount, amount)
  assign(:net_amount, net_amount)
  assign(:currency, currency)
  assign(:presentment_amount, presentment_amount)
  assign(:presentment_currency, presentment_currency)
  assign(:tax_amount, tax_amount)
  assign(:tax_state, tax_state)
  assign(:tax_country, tax_country)
  assign(:fee, fee)
  assign(:exchange_rate, exchange_rate)
end

Instance Attribute Details

#amountInteger (readonly)

Returns:

  • (Integer)


1472
1473
1474
# File 'lib/pago/v2026_04/models.rb', line 1472

def amount
  @amount
end

#currencyString (readonly)

Returns:

  • (String)


1478
1479
1480
# File 'lib/pago/v2026_04/models.rb', line 1478

def currency
  @currency
end

#exchange_rateFloat (readonly)

Returns:

  • (Float)


1499
1500
1501
# File 'lib/pago/v2026_04/models.rb', line 1499

def exchange_rate
  @exchange_rate
end

#feeInteger (readonly)

Returns:

  • (Integer)


1496
1497
1498
# File 'lib/pago/v2026_04/models.rb', line 1496

def fee
  @fee
end

#net_amountInteger (readonly)

Returns:

  • (Integer)


1475
1476
1477
# File 'lib/pago/v2026_04/models.rb', line 1475

def net_amount
  @net_amount
end

#order_idString (readonly)

Returns:

  • (String)


1463
1464
1465
# File 'lib/pago/v2026_04/models.rb', line 1463

def order_id
  @order_id
end

#presentment_amountInteger (readonly)

Returns:

  • (Integer)


1481
1482
1483
# File 'lib/pago/v2026_04/models.rb', line 1481

def presentment_amount
  @presentment_amount
end

#presentment_currencyString (readonly)

Returns:

  • (String)


1484
1485
1486
# File 'lib/pago/v2026_04/models.rb', line 1484

def presentment_currency
  @presentment_currency
end

#product_idString (readonly)

Returns:

  • (String)


1466
1467
1468
# File 'lib/pago/v2026_04/models.rb', line 1466

def product_id
  @product_id
end

#subscription_idString (readonly)

Returns:

  • (String)


1469
1470
1471
# File 'lib/pago/v2026_04/models.rb', line 1469

def subscription_id
  @subscription_id
end

#tax_amountInteger (readonly)

Returns:

  • (Integer)


1487
1488
1489
# File 'lib/pago/v2026_04/models.rb', line 1487

def tax_amount
  @tax_amount
end

#tax_countryString? (readonly)

Returns:

  • (String, nil)


1493
1494
1495
# File 'lib/pago/v2026_04/models.rb', line 1493

def tax_country
  @tax_country
end

#tax_stateString? (readonly)

Returns:

  • (String, nil)


1490
1491
1492
# File 'lib/pago/v2026_04/models.rb', line 1490

def tax_state
  @tax_state
end

#transaction_idString (readonly)

Returns:

  • (String)


1460
1461
1462
# File 'lib/pago/v2026_04/models.rb', line 1460

def transaction_id
  @transaction_id
end

Class Method Details

.from_json(data) ⇒ BalanceOrderMetadata?

Parameters:

  • data (Hash, String, nil)

Returns:



1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
# File 'lib/pago/v2026_04/models.rb', line 1536

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(
      transaction_id: (data.key?("transaction_id") ? data["transaction_id"] : ::Pago::UNSET),
      order_id: (data.key?("order_id") ? data["order_id"] : ::Pago::UNSET),
      product_id: (data.key?("product_id") ? data["product_id"] : ::Pago::UNSET),
      subscription_id: (data.key?("subscription_id") ? data["subscription_id"] : ::Pago::UNSET),
      amount: (data.key?("amount") ? data["amount"] : ::Pago::UNSET),
      net_amount: (data.key?("net_amount") ? data["net_amount"] : ::Pago::UNSET),
      currency: (data.key?("currency") ? data["currency"] : ::Pago::UNSET),
      presentment_amount: (data.key?("presentment_amount") ? data["presentment_amount"] : ::Pago::UNSET),
      presentment_currency: (data.key?("presentment_currency") ? data["presentment_currency"] : ::Pago::UNSET),
      tax_amount: (data.key?("tax_amount") ? data["tax_amount"] : ::Pago::UNSET),
      tax_state: (data.key?("tax_state") ? data["tax_state"] : ::Pago::UNSET),
      tax_country: (data.key?("tax_country") ? data["tax_country"] : ::Pago::UNSET),
      fee: (data.key?("fee") ? data["fee"] : ::Pago::UNSET),
      exchange_rate: (data.key?("exchange_rate") ? data["exchange_rate"] : ::Pago::UNSET)
    ),
    data
  )
end