Class: VisaAcceptanceMergedSpec::MerchantAdvice

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

Overview

MerchantAdvice 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(code: SKIP, code_raw: SKIP, name_match: SKIP, additional_properties: nil) ⇒ MerchantAdvice

Returns a new instance of MerchantAdvice.



122
123
124
125
126
127
128
129
130
131
# File 'lib/visa_acceptance_merged_spec/models/merchant_advice.rb', line 122

def initialize(code: SKIP, code_raw: SKIP, name_match: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @code = code unless code == SKIP
  @code_raw = code_raw unless code_raw == SKIP
  @name_match = name_match unless name_match == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#code ⇒ String

  • Merchant should update their retry logic to ensure retry is not attempted for the cards for which Issuer won’t approve the transactions and where the retry is allowed.
  • Card Processing Associations provides this data which is being passed through in the following data element irrespective of the Card Associations. Usage of this data must be always associated with the Card Associations card types for merchant processing retry logic.
  • In additions to the Merchant Advice code, Associations also provides the decline response codes which provides the reason for decline. Association response code will be a pass-through value.

Processors supported:

- HSBC
- Barclays
- FDC Nash
- FDI Global
- Elavon America
- VPC
- Rede
- Payment tech Salem

Possible values:

| Card Type | Advice Code | Description | | ----------- | ------------- | ------------------------------------------- | | VISA | 1 | Issuer never approves | | VISA | 2 | Issuer cannot approve at this time | | VISA | 3 | Data quality/revalidate payment information | | MasterCard | 01 | New account information available | | MasterCard | 02 | Try Again Later | | MasterCard | 03 | Do Not Try Again | | MasterCard | 04 | Token not supported | | MasterCard | 21 | Do not honor | | MasterCard | 22 | Merchant does not qualify for product code | | MasterCard | 24 | Retry after 1 hour | | MasterCard | 25 | Retry after 24 hours | | MasterCard | 26 | Retry after 2 days | | MasterCard | 27 | Retry after 4 days | | MasterCard | 28 | Retry after 6 days | | MasterCard | 29 | Retry after 8 days | | MasterCard | 30 | Retry after 10 days | | MasterCard | 40 | Consumer non-reloadable prepaid card | | MasterCard | 41 | Consumer single-use virtual card number | | MasterCard | 42 | Sanctions score exceeds threshold value | | MasterCard | 99 | Do Not Try Again |

Returns:

  • (String)


77
78
79
# File 'lib/visa_acceptance_merged_spec/models/merchant_advice.rb', line 77

def code
  @code
end

#code_raw ⇒ String

Raw merchant advice code sent directly from the processor. This field is used only for Mastercard.

Visa Acceptance through VisaNet

The value for this field corresponds to the following data in the TC 33 capture file1:

  • Record: CP01 TCR7
  • Position: 96-99
  • Field: Response Data-Merchant Advice Code

Returns:

  • (String)


88
89
90
# File 'lib/visa_acceptance_merged_spec/models/merchant_advice.rb', line 88

def code_raw
  @code_raw
end

#name_match ⇒ String

Visa Platform Connect

The field contains will contain the Account Name Request Result for zero amount Authorization request. Valid values are: 00 = Name Match Performed 01 = Name Match not Performed 02 = Name Match not supported

Returns:

  • (String)


97
98
99
# File 'lib/visa_acceptance_merged_spec/models/merchant_advice.rb', line 97

def name_match
  @name_match
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/visa_acceptance_merged_spec/models/merchant_advice.rb', line 134

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  code = hash.key?('code') ? hash['code'] : SKIP
  code_raw = hash.key?('codeRaw') ? hash['codeRaw'] : SKIP
  name_match = hash.key?('nameMatch') ? hash['nameMatch'] : 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.
  MerchantAdvice.new(code: code,
                     code_raw: code_raw,
                     name_match: name_match,
                     additional_properties: additional_properties)
end

.names ⇒ Object

A mapping from model property names to API property names.



100
101
102
103
104
105
106
# File 'lib/visa_acceptance_merged_spec/models/merchant_advice.rb', line 100

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['code'] = 'code'
  @_hash['code_raw'] = 'codeRaw'
  @_hash['name_match'] = 'nameMatch'
  @_hash
end

.nullables ⇒ Object

An array for nullable fields



118
119
120
# File 'lib/visa_acceptance_merged_spec/models/merchant_advice.rb', line 118

def self.nullables
  []
end

.optionals ⇒ Object

An array for optional fields



109
110
111
112
113
114
115
# File 'lib/visa_acceptance_merged_spec/models/merchant_advice.rb', line 109

def self.optionals
  %w[
    code
    code_raw
    name_match
  ]
end

Instance Method Details

#inspect ⇒ Object

Provides a debugging-friendly string with detailed object information.



164
165
166
167
168
# File 'lib/visa_acceptance_merged_spec/models/merchant_advice.rb', line 164

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} code: #{@code.inspect}, code_raw: #{@code_raw.inspect}, name_match:"\
  " #{@name_match.inspect}, additional_properties: #{@additional_properties}>"
end

#to_s ⇒ Object

Provides a human-readable string representation of the object.



157
158
159
160
161
# File 'lib/visa_acceptance_merged_spec/models/merchant_advice.rb', line 157

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} code: #{@code}, code_raw: #{@code_raw}, name_match: #{@name_match},"\
  " additional_properties: #{@additional_properties}>"
end