Class: VisaAcceptanceMergedSpec::PtsV2CreditsPost201Response1

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

Overview

PtsV2CreditsPost201Response1 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, submit_time_utc: SKIP, status: SKIP, processor_information: SKIP, installment_information: SKIP, additional_properties: nil) ⇒ PtsV2CreditsPost201Response1

Returns a new instance of PtsV2CreditsPost201Response1.



67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/visa_acceptance_merged_spec/models/pts_v2_credits_post201_response1.rb', line 67

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

  @id = id unless id == SKIP
  @submit_time_utc = submit_time_utc unless submit_time_utc == SKIP
  @status = status unless status == SKIP
  @processor_information = processor_information unless processor_information == SKIP
  @installment_information = installment_information unless installment_information == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#idString

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/pts_v2_credits_post201_response1.rb', line 18

def id
  @id
end

#installment_informationInstallmentInformation5

The status of the submitted transaction.



38
39
40
# File 'lib/visa_acceptance_merged_spec/models/pts_v2_credits_post201_response1.rb', line 38

def installment_information
  @installment_information
end

#processor_informationProcessorInformation18

The status of the submitted transaction.



34
35
36
# File 'lib/visa_acceptance_merged_spec/models/pts_v2_credits_post201_response1.rb', line 34

def processor_information
  @processor_information
end

#statusString

The status of the submitted transaction.

Returns:

  • (String)


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

def status
  @status
end

#submit_time_utcString

Time of request in UTC. Format: YYYY-MM-DDThh:mm:ssZ Example 2016-08-11T22:47:57Z equals August 11, 2016, at 22:47:57 (10:47:57 p.m.). The T separates the date and the time. The Z indicates UTC. Returned by Visa Acceptance for all services.

Returns:

  • (String)


26
27
28
# File 'lib/visa_acceptance_merged_spec/models/pts_v2_credits_post201_response1.rb', line 26

def submit_time_utc
  @submit_time_utc
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/visa_acceptance_merged_spec/models/pts_v2_credits_post201_response1.rb', line 82

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash.key?('id') ? hash['id'] : SKIP
  submit_time_utc =
    hash.key?('submitTimeUtc') ? hash['submitTimeUtc'] : SKIP
  status = hash.key?('status') ? hash['status'] : SKIP
  processor_information = ProcessorInformation18.from_hash(hash['processorInformation']) if
    hash['processorInformation']
  installment_information = InstallmentInformation5.from_hash(hash['installmentInformation']) if
    hash['installmentInformation']

  # 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.
  PtsV2CreditsPost201Response1.new(id: id,
                                   submit_time_utc: submit_time_utc,
                                   status: status,
                                   processor_information: processor_information,
                                   installment_information: installment_information,
                                   additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



41
42
43
44
45
46
47
48
49
# File 'lib/visa_acceptance_merged_spec/models/pts_v2_credits_post201_response1.rb', line 41

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['submit_time_utc'] = 'submitTimeUtc'
  @_hash['status'] = 'status'
  @_hash['processor_information'] = 'processorInformation'
  @_hash['installment_information'] = 'installmentInformation'
  @_hash
end

.nullablesObject

An array for nullable fields



63
64
65
# File 'lib/visa_acceptance_merged_spec/models/pts_v2_credits_post201_response1.rb', line 63

def self.nullables
  []
end

.optionalsObject

An array for optional fields



52
53
54
55
56
57
58
59
60
# File 'lib/visa_acceptance_merged_spec/models/pts_v2_credits_post201_response1.rb', line 52

def self.optionals
  %w[
    id
    submit_time_utc
    status
    processor_information
    installment_information
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



120
121
122
123
124
125
126
# File 'lib/visa_acceptance_merged_spec/models/pts_v2_credits_post201_response1.rb', line 120

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

#to_sObject

Provides a human-readable string representation of the object.



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

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