Class: CyberSourceMergedSpec::ProcessorInformation

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

Overview

Processor Information

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(pre_approval_token: SKIP, authorization_options: SKIP, reversal: SKIP, network: SKIP, auth_approval_token: SKIP, supplementary_transaction_data: SKIP, response_source_code: SKIP, cedp_verified_indicator: SKIP, fee_program_indicator: SKIP, additional_properties: nil) ⇒ ProcessorInformation

Returns a new instance of ProcessorInformation.



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/cyber_source_merged_spec/models/processor_information.rb', line 101

def initialize(pre_approval_token: SKIP, authorization_options: SKIP,
               reversal: SKIP, network: SKIP, auth_approval_token: SKIP,
               supplementary_transaction_data: SKIP,
               response_source_code: SKIP, cedp_verified_indicator: SKIP,
               fee_program_indicator: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @pre_approval_token = pre_approval_token unless pre_approval_token == SKIP
  @authorization_options = authorization_options unless authorization_options == SKIP
  @reversal = reversal unless reversal == SKIP
  @network = network unless network == SKIP
  @auth_approval_token = auth_approval_token unless auth_approval_token == SKIP
  unless supplementary_transaction_data == SKIP
    @supplementary_transaction_data =
      supplementary_transaction_data
  end
  @response_source_code = response_source_code unless response_source_code == SKIP
  @cedp_verified_indicator = cedp_verified_indicator unless cedp_verified_indicator == SKIP
  @fee_program_indicator = fee_program_indicator unless fee_program_indicator == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#auth_approval_tokenString

Interoperability Token received by merchant for Authorization API. Field for merchant to send Klarna Advantage Plus authorization approval token for Auth API call.

Returns:

  • (String)


32
33
34
# File 'lib/cyber_source_merged_spec/models/processor_information.rb', line 32

def auth_approval_token
  @auth_approval_token
end

#authorization_optionsAuthorizationOptions

Token received in original session service.



18
19
20
# File 'lib/cyber_source_merged_spec/models/processor_information.rb', line 18

def authorization_options
  @authorization_options
end

#cedp_verified_indicatorString

Merchant Commercial Enhanced Data Program (CEDP) verified indicator for capture/bill requests. This field is used when the client is doing authorization with a different gateway and capture/settlement with CyberSource. This field flows in ISO field 34, DSID 02 tag DA, in AN, EBCDIC format. Possible values:

  • Y: Merchant CEDP verified

Used by

Capture Request Request field for force capture/bill support when auth is done with a different gateway.

Returns:

  • (String)


56
57
58
# File 'lib/cyber_source_merged_spec/models/processor_information.rb', line 56

def cedp_verified_indicator
  @cedp_verified_indicator
end

#fee_program_indicatorString

Interchange reimbursement fee program indicator (FPI), which is used when assessing the fee applied to a cross-border or domestic Asia Pacific financial transaction. Acquirers and issues retain and return the FPI value in chargeback and representments.

Returns:

  • (String)


63
64
65
# File 'lib/cyber_source_merged_spec/models/processor_information.rb', line 63

def fee_program_indicator
  @fee_program_indicator
end

#networkNetwork

Token received in original session service.

Returns:



26
27
28
# File 'lib/cyber_source_merged_spec/models/processor_information.rb', line 26

def network
  @network
end

#pre_approval_tokenString

Token received in original session service.

Returns:

  • (String)


14
15
16
# File 'lib/cyber_source_merged_spec/models/processor_information.rb', line 14

def pre_approval_token
  @pre_approval_token
end

#response_source_codeString

Field contains the response source code that identifies the source.

Returns:

  • (String)


42
43
44
# File 'lib/cyber_source_merged_spec/models/processor_information.rb', line 42

def response_source_code
  @response_source_code
end

#reversalReversal

Token received in original session service.

Returns:



22
23
24
# File 'lib/cyber_source_merged_spec/models/processor_information.rb', line 22

def reversal
  @reversal
end

#supplementary_transaction_dataString

Supplementary transaction data for Klarna Advantage Plus. Fields to capture Interoperability Data from Merchant and transfer to Klarna for Authorization/Sale/Re-Auth/Capture APIs.

Returns:

  • (String)


38
39
40
# File 'lib/cyber_source_merged_spec/models/processor_information.rb', line 38

def supplementary_transaction_data
  @supplementary_transaction_data
end

Class Method Details

.from_element(root) ⇒ Object



166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/cyber_source_merged_spec/models/processor_information.rb', line 166

def self.from_element(root)
  pre_approval_token = XmlUtilities.from_element(root, 'preApprovalToken',
                                                 String)
  authorization_options = XmlUtilities.from_element(root,
                                                    'AuthorizationOptions',
                                                    AuthorizationOptions)
  reversal = XmlUtilities.from_element(root, 'Reversal', Reversal)
  network = XmlUtilities.from_element(root, 'Network', Network)
  auth_approval_token = XmlUtilities.from_element(root, 'authApprovalToken',
                                                  String)
  supplementary_transaction_data = XmlUtilities.from_element(
    root, 'supplementaryTransactionData', String
  )
  response_source_code = XmlUtilities.from_element(root,
                                                   'responseSourceCode',
                                                   String)
  cedp_verified_indicator = XmlUtilities.from_element(
    root, 'cedpVerifiedIndicator', String
  )
  fee_program_indicator = XmlUtilities.from_element(root,
                                                    'feeProgramIndicator',
                                                    String)

  new(pre_approval_token: pre_approval_token,
      authorization_options: authorization_options,
      reversal: reversal,
      network: network,
      auth_approval_token: auth_approval_token,
      supplementary_transaction_data: supplementary_transaction_data,
      response_source_code: response_source_code,
      cedp_verified_indicator: cedp_verified_indicator,
      fee_program_indicator: fee_program_indicator,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/cyber_source_merged_spec/models/processor_information.rb', line 125

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  pre_approval_token =
    hash.key?('preApprovalToken') ? hash['preApprovalToken'] : SKIP
  authorization_options = AuthorizationOptions.from_hash(hash['authorizationOptions']) if
    hash['authorizationOptions']
  reversal = Reversal.from_hash(hash['reversal']) if hash['reversal']
  network = Network.from_hash(hash['network']) if hash['network']
  auth_approval_token =
    hash.key?('authApprovalToken') ? hash['authApprovalToken'] : SKIP
  supplementary_transaction_data =
    hash.key?('supplementaryTransactionData') ? hash['supplementaryTransactionData'] : SKIP
  response_source_code =
    hash.key?('responseSourceCode') ? hash['responseSourceCode'] : SKIP
  cedp_verified_indicator =
    hash.key?('cedpVerifiedIndicator') ? hash['cedpVerifiedIndicator'] : SKIP
  fee_program_indicator =
    hash.key?('feeProgramIndicator') ? hash['feeProgramIndicator'] : 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.
  ProcessorInformation.new(pre_approval_token: pre_approval_token,
                           authorization_options: authorization_options,
                           reversal: reversal,
                           network: network,
                           auth_approval_token: auth_approval_token,
                           supplementary_transaction_data: supplementary_transaction_data,
                           response_source_code: response_source_code,
                           cedp_verified_indicator: cedp_verified_indicator,
                           fee_program_indicator: fee_program_indicator,
                           additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['pre_approval_token'] = 'preApprovalToken'
  @_hash['authorization_options'] = 'authorizationOptions'
  @_hash['reversal'] = 'reversal'
  @_hash['network'] = 'network'
  @_hash['auth_approval_token'] = 'authApprovalToken'
  @_hash['supplementary_transaction_data'] =
    'supplementaryTransactionData'
  @_hash['response_source_code'] = 'responseSourceCode'
  @_hash['cedp_verified_indicator'] = 'cedpVerifiedIndicator'
  @_hash['fee_program_indicator'] = 'feeProgramIndicator'
  @_hash
end

.nullablesObject

An array for nullable fields



97
98
99
# File 'lib/cyber_source_merged_spec/models/processor_information.rb', line 97

def self.nullables
  []
end

.optionalsObject

An array for optional fields



82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/cyber_source_merged_spec/models/processor_information.rb', line 82

def self.optionals
  %w[
    pre_approval_token
    authorization_options
    reversal
    network
    auth_approval_token
    supplementary_transaction_data
    response_source_code
    cedp_verified_indicator
    fee_program_indicator
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



238
239
240
241
242
243
244
245
246
247
# File 'lib/cyber_source_merged_spec/models/processor_information.rb', line 238

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} pre_approval_token: #{@pre_approval_token.inspect}, authorization_options:"\
  " #{@authorization_options.inspect}, reversal: #{@reversal.inspect}, network:"\
  " #{@network.inspect}, auth_approval_token: #{@auth_approval_token.inspect},"\
  " supplementary_transaction_data: #{@supplementary_transaction_data.inspect},"\
  " response_source_code: #{@response_source_code.inspect}, cedp_verified_indicator:"\
  " #{@cedp_verified_indicator.inspect}, fee_program_indicator:"\
  " #{@fee_program_indicator.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



227
228
229
230
231
232
233
234
235
# File 'lib/cyber_source_merged_spec/models/processor_information.rb', line 227

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} pre_approval_token: #{@pre_approval_token}, authorization_options:"\
  " #{@authorization_options}, reversal: #{@reversal}, network: #{@network},"\
  " auth_approval_token: #{@auth_approval_token}, supplementary_transaction_data:"\
  " #{@supplementary_transaction_data}, response_source_code: #{@response_source_code},"\
  " cedp_verified_indicator: #{@cedp_verified_indicator}, fee_program_indicator:"\
  " #{@fee_program_indicator}, additional_properties: #{@additional_properties}>"
end

#to_xml_element(doc, root_name) ⇒ Object



201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# File 'lib/cyber_source_merged_spec/models/processor_information.rb', line 201

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

  XmlUtilities.add_as_subelement(doc, root, 'preApprovalToken',
                                 pre_approval_token)
  XmlUtilities.add_as_subelement(doc, root, 'AuthorizationOptions',
                                 authorization_options)
  XmlUtilities.add_as_subelement(doc, root, 'Reversal', reversal)
  XmlUtilities.add_as_subelement(doc, root, 'Network', network)
  XmlUtilities.add_as_subelement(doc, root, 'authApprovalToken',
                                 auth_approval_token)
  XmlUtilities.add_as_subelement(doc, root, 'supplementaryTransactionData',
                                 supplementary_transaction_data)
  XmlUtilities.add_as_subelement(doc, root, 'responseSourceCode',
                                 response_source_code)
  XmlUtilities.add_as_subelement(doc, root, 'cedpVerifiedIndicator',
                                 cedp_verified_indicator)
  XmlUtilities.add_as_subelement(doc, root, 'feeProgramIndicator',
                                 fee_program_indicator)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end