Class: VisaAcceptanceMergedSpec::Application

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

Overview

Application 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(name: SKIP, status: SKIP, reason_code: SKIP, r_code: SKIP, r_flag: SKIP, reconciliation_id: SKIP, r_message: SKIP, return_code: SKIP, additional_properties: nil) ⇒ Application

Returns a new instance of Application.



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/visa_acceptance_merged_spec/models/application.rb', line 87

def initialize(name: SKIP, status: SKIP, reason_code: SKIP, r_code: SKIP,
               r_flag: SKIP, reconciliation_id: SKIP, r_message: SKIP,
               return_code: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @name = name unless name == SKIP
  @status = status unless status == SKIP
  @reason_code = reason_code unless reason_code == SKIP
  @r_code = r_code unless r_code == SKIP
  @r_flag = r_flag unless r_flag == SKIP
  @reconciliation_id = reconciliation_id unless reconciliation_id == SKIP
  @r_message = r_message unless r_message == SKIP
  @return_code = return_code unless return_code == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#nameString

The name of the Visa Acceptance transaction type (such as CC settlement or CC authorization) that the merchant wants to process in a transaction request. More than one transaction type can included in a transaction request. Each transaction type separately returns their own status, reasonCode, rCode, and rFlag messages.

Returns:

  • (String)


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

def name
  @name
end

#r_codeString

Indicates whether the service request was successful. Possible values:

  • -1: An error occurred.
  • 0: The request was declined.
  • 1: The request was successful.

Returns:

  • (String)


35
36
37
# File 'lib/visa_acceptance_merged_spec/models/application.rb', line 35

def r_code
  @r_code
end

#r_flagString

One-word description of the result of the application.

Returns:

  • (String)


39
40
41
# File 'lib/visa_acceptance_merged_spec/models/application.rb', line 39

def r_flag
  @r_flag
end

#r_messageString

Message that explains the reply flag for the application.

Returns:

  • (String)


48
49
50
# File 'lib/visa_acceptance_merged_spec/models/application.rb', line 48

def r_message
  @r_message
end

#reason_codeString

3-digit reason code that indicates why the customer profile payment succeeded or failed.

Returns:

  • (String)


27
28
29
# File 'lib/visa_acceptance_merged_spec/models/application.rb', line 27

def reason_code
  @reason_code
end

#reconciliation_idString

Reference number that you use to reconcile your Visa Acceptance reports with your processor reports.

Returns:

  • (String)


44
45
46
# File 'lib/visa_acceptance_merged_spec/models/application.rb', line 44

def reconciliation_id
  @reconciliation_id
end

#return_codeInteger

The description for this field is not available.

Returns:

  • (Integer)


52
53
54
# File 'lib/visa_acceptance_merged_spec/models/application.rb', line 52

def return_code
  @return_code
end

#statusString

The description for this field is not available.

Returns:

  • (String)


22
23
24
# File 'lib/visa_acceptance_merged_spec/models/application.rb', line 22

def status
  @status
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/visa_acceptance_merged_spec/models/application.rb', line 105

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  name = hash.key?('name') ? hash['name'] : SKIP
  status = hash.key?('status') ? hash['status'] : SKIP
  reason_code = hash.key?('reasonCode') ? hash['reasonCode'] : SKIP
  r_code = hash.key?('rCode') ? hash['rCode'] : SKIP
  r_flag = hash.key?('rFlag') ? hash['rFlag'] : SKIP
  reconciliation_id =
    hash.key?('reconciliationId') ? hash['reconciliationId'] : SKIP
  r_message = hash.key?('rMessage') ? hash['rMessage'] : SKIP
  return_code = hash.key?('returnCode') ? hash['returnCode'] : SKIP

  # 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.
  Application.new(name: name,
                  status: status,
                  reason_code: reason_code,
                  r_code: r_code,
                  r_flag: r_flag,
                  reconciliation_id: reconciliation_id,
                  r_message: r_message,
                  return_code: return_code,
                  additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/visa_acceptance_merged_spec/models/application.rb', line 55

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['name'] = 'name'
  @_hash['status'] = 'status'
  @_hash['reason_code'] = 'reasonCode'
  @_hash['r_code'] = 'rCode'
  @_hash['r_flag'] = 'rFlag'
  @_hash['reconciliation_id'] = 'reconciliationId'
  @_hash['r_message'] = 'rMessage'
  @_hash['return_code'] = 'returnCode'
  @_hash
end

.nullablesObject

An array for nullable fields



83
84
85
# File 'lib/visa_acceptance_merged_spec/models/application.rb', line 83

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    name
    status
    reason_code
    r_code
    r_flag
    reconciliation_id
    r_message
    return_code
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



148
149
150
151
152
153
154
# File 'lib/visa_acceptance_merged_spec/models/application.rb', line 148

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} name: #{@name.inspect}, status: #{@status.inspect}, reason_code:"\
  " #{@reason_code.inspect}, r_code: #{@r_code.inspect}, r_flag: #{@r_flag.inspect},"\
  " reconciliation_id: #{@reconciliation_id.inspect}, r_message: #{@r_message.inspect},"\
  " return_code: #{@return_code.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



139
140
141
142
143
144
145
# File 'lib/visa_acceptance_merged_spec/models/application.rb', line 139

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} name: #{@name}, status: #{@status}, reason_code: #{@reason_code}, r_code:"\
  " #{@r_code}, r_flag: #{@r_flag}, reconciliation_id: #{@reconciliation_id}, r_message:"\
  " #{@r_message}, return_code: #{@return_code}, additional_properties:"\
  " #{@additional_properties}>"
end