Class: VisaAcceptanceMergedSpec::RetrieveOrDeletePaymentTokenResponse

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/visa_acceptance_merged_spec/models/retrieve_or_delete_payment_token_response.rb

Overview

RetrieveOrDeletePaymentTokenResponse Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(id: SKIP, status: SKIP, payment_information: SKIP, order_information: SKIP, additional_properties: nil) ⇒ RetrieveOrDeletePaymentTokenResponse

Returns a new instance of RetrieveOrDeletePaymentTokenResponse.



63
64
65
66
67
68
69
70
71
72
73
# File 'lib/visa_acceptance_merged_spec/models/retrieve_or_delete_payment_token_response.rb', line 63

def initialize(id: SKIP, status: SKIP, payment_information: SKIP,
               order_information: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @id = id unless id == SKIP
  @status = status unless status == SKIP
  @payment_information = payment_information unless payment_information == SKIP
  @order_information = order_information unless order_information == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#id ⇒ String

An unique identification number generated by Visa Acceptance to identify the submitted request. Returned by all services. It is also appended to the endpoint of the resource. On incremental authorizations, this value with be the same as the identification number returned in the original authorization response.

Returns:

  • (String)


18
19
20
# File 'lib/visa_acceptance_merged_spec/models/retrieve_or_delete_payment_token_response.rb', line 18

def id
  @id
end

#order_information ⇒ OrderInformation32

The status of the request. Possible values:

  • COMPLETED

Returns:



36
37
38
# File 'lib/visa_acceptance_merged_spec/models/retrieve_or_delete_payment_token_response.rb', line 36

def order_information
  @order_information
end

#payment_information ⇒ PaymentInformation30

The status of the request. Possible values:

  • COMPLETED


30
31
32
# File 'lib/visa_acceptance_merged_spec/models/retrieve_or_delete_payment_token_response.rb', line 30

def payment_information
  @payment_information
end

#status ⇒ String

The status of the request. Possible values:

  • COMPLETED

Returns:

  • (String)


24
25
26
# File 'lib/visa_acceptance_merged_spec/models/retrieve_or_delete_payment_token_response.rb', line 24

def status
  @status
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/visa_acceptance_merged_spec/models/retrieve_or_delete_payment_token_response.rb', line 76

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash.key?('id') ? hash['id'] : SKIP
  status = hash.key?('status') ? hash['status'] : SKIP
  payment_information = PaymentInformation30.from_hash(hash['paymentInformation']) if
    hash['paymentInformation']
  order_information = OrderInformation32.from_hash(hash['orderInformation']) if
    hash['orderInformation']

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  RetrieveOrDeletePaymentTokenResponse.new(id: id,
                                           status: status,
                                           payment_information: payment_information,
                                           order_information: order_information,
                                           additional_properties: additional_properties)
end

.names ⇒ Object

A mapping from model property names to API property names.



39
40
41
42
43
44
45
46
# File 'lib/visa_acceptance_merged_spec/models/retrieve_or_delete_payment_token_response.rb', line 39

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['status'] = 'status'
  @_hash['payment_information'] = 'paymentInformation'
  @_hash['order_information'] = 'orderInformation'
  @_hash
end

.nullables ⇒ Object

An array for nullable fields



59
60
61
# File 'lib/visa_acceptance_merged_spec/models/retrieve_or_delete_payment_token_response.rb', line 59

def self.nullables
  []
end

.optionals ⇒ Object

An array for optional fields



49
50
51
52
53
54
55
56
# File 'lib/visa_acceptance_merged_spec/models/retrieve_or_delete_payment_token_response.rb', line 49

def self.optionals
  %w[
    id
    status
    payment_information
    order_information
  ]
end

Instance Method Details

#inspect ⇒ Object

Provides a debugging-friendly string with detailed object information.



111
112
113
114
115
116
# File 'lib/visa_acceptance_merged_spec/models/retrieve_or_delete_payment_token_response.rb', line 111

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id.inspect}, status: #{@status.inspect}, payment_information:"\
  " #{@payment_information.inspect}, order_information: #{@order_information.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_s ⇒ Object

Provides a human-readable string representation of the object.



103
104
105
106
107
108
# File 'lib/visa_acceptance_merged_spec/models/retrieve_or_delete_payment_token_response.rb', line 103

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id}, status: #{@status}, payment_information:"\
  " #{@payment_information}, order_information: #{@order_information}, additional_properties:"\
  " #{@additional_properties}>"
end