Class: Pago::V2026_04::Models::CustomerOrderReceipt

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

Overview

Order's receipt data.

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  url: "url"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["url"].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(url:) ⇒ CustomerOrderReceipt

Returns a new instance of CustomerOrderReceipt.

Parameters:

  • url: (String)


17933
17934
17935
17936
17937
17938
# File 'lib/pago/v2026_04/models.rb', line 17933

def initialize(
  url:
)
  super()
  assign(:url, url)
end

Instance Attribute Details

#urlString (readonly)

The URL to the receipt PDF.

Returns:

  • (String)


17931
17932
17933
# File 'lib/pago/v2026_04/models.rb', line 17931

def url
  @url
end

Class Method Details

.from_json(data) ⇒ CustomerOrderReceipt?

Parameters:

  • data (Hash, String, nil)

Returns:



17942
17943
17944
17945
17946
17947
17948
17949
17950
17951
17952
17953
# File 'lib/pago/v2026_04/models.rb', line 17942

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(
      url: (data.key?("url") ? data["url"] : ::Pago::UNSET)
    ),
    data
  )
end