Class: Pago::V2026_04::Models::BalanceRefundMetadata

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",
  refund_id: "refund_id",
  order_id: "order_id",
  order_created_at: "order_created_at",
  product_id: "product_id",
  subscription_id: "subscription_id",
  amount: "amount",
  currency: "currency",
  presentment_amount: "presentment_amount",
  presentment_currency: "presentment_currency",
  refundable_amount: "refundable_amount",
  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", "refund_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:, refund_id:, order_id: ::Pago::UNSET, order_created_at: ::Pago::UNSET, product_id: ::Pago::UNSET, subscription_id: ::Pago::UNSET, amount:, currency:, presentment_amount:, presentment_currency:, refundable_amount: ::Pago::UNSET, tax_amount:, tax_state: ::Pago::UNSET, tax_country: ::Pago::UNSET, fee:, exchange_rate: ::Pago::UNSET) ⇒ BalanceRefundMetadata

Returns a new instance of BalanceRefundMetadata.

Parameters:

  • transaction_id: (String)
  • refund_id: (String)
  • order_id: (String, nil) (defaults to: ::Pago::UNSET)
  • order_created_at: (String, nil) (defaults to: ::Pago::UNSET)
  • product_id: (String, nil) (defaults to: ::Pago::UNSET)
  • subscription_id: (String, nil) (defaults to: ::Pago::UNSET)
  • amount: (Integer)
  • currency: (String)
  • presentment_amount: (Integer)
  • presentment_currency: (String)
  • refundable_amount: (Integer, nil) (defaults to: ::Pago::UNSET)
  • 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)


1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
# File 'lib/pago/v2026_04/models.rb', line 1769

def initialize(
  transaction_id:,
  refund_id:,
  order_id: ::Pago::UNSET,
  order_created_at: ::Pago::UNSET,
  product_id: ::Pago::UNSET,
  subscription_id: ::Pago::UNSET,
  amount:,
  currency:,
  presentment_amount:,
  presentment_currency:,
  refundable_amount: ::Pago::UNSET,
  tax_amount:,
  tax_state: ::Pago::UNSET,
  tax_country: ::Pago::UNSET,
  fee:,
  exchange_rate: ::Pago::UNSET
)
  super()
  assign(:transaction_id, transaction_id)
  assign(:refund_id, refund_id)
  assign(:order_id, order_id)
  assign(:order_created_at, order_created_at)
  assign(:product_id, product_id)
  assign(:subscription_id, subscription_id)
  assign(:amount, amount)
  assign(:currency, currency)
  assign(:presentment_amount, presentment_amount)
  assign(:presentment_currency, presentment_currency)
  assign(:refundable_amount, refundable_amount)
  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)


1740
1741
1742
# File 'lib/pago/v2026_04/models.rb', line 1740

def amount
  @amount
end

#currencyString (readonly)

Returns:

  • (String)


1743
1744
1745
# File 'lib/pago/v2026_04/models.rb', line 1743

def currency
  @currency
end

#exchange_rateFloat (readonly)

Returns:

  • (Float)


1767
1768
1769
# File 'lib/pago/v2026_04/models.rb', line 1767

def exchange_rate
  @exchange_rate
end

#feeInteger (readonly)

Returns:

  • (Integer)


1764
1765
1766
# File 'lib/pago/v2026_04/models.rb', line 1764

def fee
  @fee
end

#order_created_atString (readonly)

Returns:

  • (String)


1731
1732
1733
# File 'lib/pago/v2026_04/models.rb', line 1731

def order_created_at
  @order_created_at
end

#order_idString (readonly)

Returns:

  • (String)


1728
1729
1730
# File 'lib/pago/v2026_04/models.rb', line 1728

def order_id
  @order_id
end

#presentment_amountInteger (readonly)

Returns:

  • (Integer)


1746
1747
1748
# File 'lib/pago/v2026_04/models.rb', line 1746

def presentment_amount
  @presentment_amount
end

#presentment_currencyString (readonly)

Returns:

  • (String)


1749
1750
1751
# File 'lib/pago/v2026_04/models.rb', line 1749

def presentment_currency
  @presentment_currency
end

#product_idString (readonly)

Returns:

  • (String)


1734
1735
1736
# File 'lib/pago/v2026_04/models.rb', line 1734

def product_id
  @product_id
end

#refund_idString (readonly)

Returns:

  • (String)


1725
1726
1727
# File 'lib/pago/v2026_04/models.rb', line 1725

def refund_id
  @refund_id
end

#refundable_amountInteger (readonly)

Returns:

  • (Integer)


1752
1753
1754
# File 'lib/pago/v2026_04/models.rb', line 1752

def refundable_amount
  @refundable_amount
end

#subscription_idString (readonly)

Returns:

  • (String)


1737
1738
1739
# File 'lib/pago/v2026_04/models.rb', line 1737

def subscription_id
  @subscription_id
end

#tax_amountInteger (readonly)

Returns:

  • (Integer)


1755
1756
1757
# File 'lib/pago/v2026_04/models.rb', line 1755

def tax_amount
  @tax_amount
end

#tax_countryString? (readonly)

Returns:

  • (String, nil)


1761
1762
1763
# File 'lib/pago/v2026_04/models.rb', line 1761

def tax_country
  @tax_country
end

#tax_stateString? (readonly)

Returns:

  • (String, nil)


1758
1759
1760
# File 'lib/pago/v2026_04/models.rb', line 1758

def tax_state
  @tax_state
end

#transaction_idString (readonly)

Returns:

  • (String)


1722
1723
1724
# File 'lib/pago/v2026_04/models.rb', line 1722

def transaction_id
  @transaction_id
end

Class Method Details

.from_json(data) ⇒ BalanceRefundMetadata?

Parameters:

  • data (Hash, String, nil)

Returns:



1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
# File 'lib/pago/v2026_04/models.rb', line 1808

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),
      refund_id: (data.key?("refund_id") ? data["refund_id"] : ::Pago::UNSET),
      order_id: (data.key?("order_id") ? data["order_id"] : ::Pago::UNSET),
      order_created_at: (data.key?("order_created_at") ? data["order_created_at"] : ::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),
      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),
      refundable_amount: (data.key?("refundable_amount") ? data["refundable_amount"] : ::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