Class: CyberSourceMergedSpec::MerchantAdvice2

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/cyber_source_merged_spec/models/merchant_advice2.rb

Overview

MerchantAdvice2 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, additional_properties: nil) ⇒ MerchantAdvice2

Returns a new instance of MerchantAdvice2.



122
123
124
125
126
127
128
129
# File 'lib/cyber_source_merged_spec/models/merchant_advice2.rb', line 122

def initialize(code: SKIP, code_raw: 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
  @additional_properties = additional_properties
end

Instance Attribute Details

#codeString

  • 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 |

Possbile values for Barclays processor:

  • 00: No information, or response not provided.
  • 01: New account information available
  • 02: Try again later
  • 03: Do not try again
  • 05: Payment blocked by the payment card company

Returns:

  • (String)


83
84
85
# File 'lib/cyber_source_merged_spec/models/merchant_advice2.rb', line 83

def code
  @code
end

#code_rawString

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

CyberSource 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

Possbile values for Barclays processor:

  • 01: Updated/additional information needed
  • 02: Cannot approve at this time; try again later
  • 04: Do not try again
  • 08: Payment blocked by card scheme

Returns:

  • (String)


99
100
101
# File 'lib/cyber_source_merged_spec/models/merchant_advice2.rb', line 99

def code_raw
  @code_raw
end

Class Method Details

.from_element(root) ⇒ Object



152
153
154
155
156
157
158
159
# File 'lib/cyber_source_merged_spec/models/merchant_advice2.rb', line 152

def self.from_element(root)
  code = XmlUtilities.from_element(root, 'code', String)
  code_raw = XmlUtilities.from_element(root, 'codeRaw', String)

  new(code: code,
      code_raw: code_raw,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/cyber_source_merged_spec/models/merchant_advice2.rb', line 132

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

  # 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.
  MerchantAdvice2.new(code: code,
                      code_raw: code_raw,
                      additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



102
103
104
105
106
107
# File 'lib/cyber_source_merged_spec/models/merchant_advice2.rb', line 102

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

.nullablesObject

An array for nullable fields



118
119
120
# File 'lib/cyber_source_merged_spec/models/merchant_advice2.rb', line 118

def self.nullables
  []
end

.optionalsObject

An array for optional fields



110
111
112
113
114
115
# File 'lib/cyber_source_merged_spec/models/merchant_advice2.rb', line 110

def self.optionals
  %w[
    code
    code_raw
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



180
181
182
183
184
# File 'lib/cyber_source_merged_spec/models/merchant_advice2.rb', line 180

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

#to_sObject

Provides a human-readable string representation of the object.



173
174
175
176
177
# File 'lib/cyber_source_merged_spec/models/merchant_advice2.rb', line 173

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

#to_xml_element(doc, root_name) ⇒ Object



161
162
163
164
165
166
167
168
169
170
# File 'lib/cyber_source_merged_spec/models/merchant_advice2.rb', line 161

def to_xml_element(doc, root_name)
  root = doc.create_element(root_name)

  XmlUtilities.add_as_subelement(doc, root, 'code', code)
  XmlUtilities.add_as_subelement(doc, root, 'codeRaw', code_raw)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end