Class: VisaAcceptanceMergedSpec::Features

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

Overview

Features 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(account_funding_source: SKIP, account_funding_source_sub_type: SKIP, card_product: SKIP, message_type: SKIP, acceptance_level: SKIP, card_platform: SKIP, combo_card: SKIP, corporate_purchase: SKIP, health_card: SKIP, shared_bin: SKIP, pos_domestic_only: SKIP, gambling_allowed: SKIP, commercial_card_level2: SKIP, commercial_card_level3: SKIP, exempt_bin: SKIP, account_level_management: SKIP, online_gambling_block: SKIP, auto_substantiation: SKIP, flex_credential: SKIP, additional_properties: nil) ⇒ Features

Returns a new instance of Features.



220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
# File 'lib/visa_acceptance_merged_spec/models/features.rb', line 220

def initialize(account_funding_source: SKIP,
               account_funding_source_sub_type: SKIP, card_product: SKIP,
               message_type: SKIP, acceptance_level: SKIP,
               card_platform: SKIP, combo_card: SKIP,
               corporate_purchase: SKIP, health_card: SKIP,
               shared_bin: SKIP, pos_domestic_only: SKIP,
               gambling_allowed: SKIP, commercial_card_level2: SKIP,
               commercial_card_level3: SKIP, exempt_bin: SKIP,
               account_level_management: SKIP, online_gambling_block: SKIP,
               auto_substantiation: SKIP, flex_credential: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @account_funding_source =  unless  == SKIP
  unless  == SKIP
    @account_funding_source_sub_type =
      
  end
  @card_product = card_product unless card_product == SKIP
  @message_type = message_type unless message_type == SKIP
  @acceptance_level = acceptance_level unless acceptance_level == SKIP
  @card_platform = card_platform unless card_platform == SKIP
  @combo_card = combo_card unless combo_card == SKIP
  @corporate_purchase = corporate_purchase unless corporate_purchase == SKIP
  @health_card = health_card unless health_card == SKIP
  @shared_bin = shared_bin unless shared_bin == SKIP
  @pos_domestic_only = pos_domestic_only unless pos_domestic_only == SKIP
  @gambling_allowed = gambling_allowed unless gambling_allowed == SKIP
  @commercial_card_level2 = commercial_card_level2 unless commercial_card_level2 == SKIP
  @commercial_card_level3 = commercial_card_level3 unless commercial_card_level3 == SKIP
  @exempt_bin = exempt_bin unless exempt_bin == SKIP
  @account_level_management =  unless  == SKIP
  @online_gambling_block = online_gambling_block unless online_gambling_block == SKIP
  @auto_substantiation = auto_substantiation unless auto_substantiation == SKIP
  @flex_credential = flex_credential unless flex_credential == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#acceptance_levelString

This field contains the acceptance level of the PAN. Possible values:

- `0` : Normal
- `1` : Monitor
- `2` : Refuse
- `3` : Not Allowed
- `4` : Private
- `5` : Test

Returns:

  • (String)


53
54
55
# File 'lib/visa_acceptance_merged_spec/models/features.rb', line 53

def acceptance_level
  @acceptance_level
end

#account_funding_sourceString

This field contains the account funding source. Possible values:

- `CREDIT`
- `DEBIT`
- `PREPAID`
- `DEFERRED DEBIT`
- `CHARGE`

Returns:

  • (String)


20
21
22
# File 'lib/visa_acceptance_merged_spec/models/features.rb', line 20

def 
  @account_funding_source
end

#account_funding_source_sub_typeString

This field contains the type of prepaid card. Possible values:

- `Reloadable`
- `Non-reloadable`

Returns:

  • (String)


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

def 
  @account_funding_source_sub_type
end

#account_level_managementTrueClass | FalseClass

This field indicates if the BIN participates in Account Level Management (ALM). Possible values: - true - false

Returns:

  • (TrueClass | FalseClass)


141
142
143
# File 'lib/visa_acceptance_merged_spec/models/features.rb', line 141

def 
  @account_level_management
end

#auto_substantiationTrueClass | FalseClass

This field indicates if auto-substantiation is enabled on the BIN. Possible values: - true - false

Returns:

  • (TrueClass | FalseClass)


155
156
157
# File 'lib/visa_acceptance_merged_spec/models/features.rb', line 155

def auto_substantiation
  @auto_substantiation
end

#card_platformString

This field contains the type of card platform. Possible values:

- `BUSINESS`
- `CONSUMER`
- `CORPORATE`
- `COMMERCIAL`
- `GOVERNMENT`

Returns:

  • (String)


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

def card_platform
  @card_platform
end

#card_productString

This field contains the type of issuer product. Example values:

- Visa Classic
- Visa Signature
- Visa Infinite

Returns:

  • (String)


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

def card_product
  @card_product
end

#combo_cardString

This field indicates the type of combo card. Possible values:

- 0 (Not a combo card)
- 1 (Credit and Prepaid Combo card)
- 2 (Credit and Debit Combo card)
- 3 (Prepaid Credit and Prepaid Debit combo card)

Returns:

  • (String)


72
73
74
# File 'lib/visa_acceptance_merged_spec/models/features.rb', line 72

def combo_card
  @combo_card
end

#commercial_card_level2TrueClass | FalseClass

This field indicates if a transaction on the instrument qualifies for level 2 interchange rates. Possible values: - true - false

Returns:

  • (TrueClass | FalseClass)


117
118
119
# File 'lib/visa_acceptance_merged_spec/models/features.rb', line 117

def commercial_card_level2
  @commercial_card_level2
end

#commercial_card_level3TrueClass | FalseClass

This field indicates if a transaction on the instrument qualifies for level 3 interchange rates. Possible values: - true - false

Returns:

  • (TrueClass | FalseClass)


125
126
127
# File 'lib/visa_acceptance_merged_spec/models/features.rb', line 125

def commercial_card_level3
  @commercial_card_level3
end

#corporate_purchaseTrueClass | FalseClass

This field indicates if the instrument can be used for corporate purchasing. This field is only applicable for American Express cards. Possible values:

- `true`
- `false`

Returns:

  • (TrueClass | FalseClass)


80
81
82
# File 'lib/visa_acceptance_merged_spec/models/features.rb', line 80

def corporate_purchase
  @corporate_purchase
end

#exempt_binTrueClass | FalseClass

This field indicates if a transaction on the instrument qualifies for government exempt interchange fee. Possible values: - true - false

Returns:

  • (TrueClass | FalseClass)


133
134
135
# File 'lib/visa_acceptance_merged_spec/models/features.rb', line 133

def exempt_bin
  @exempt_bin
end

#flex_credentialTrueClass | FalseClass

This field indicates if the instrument is a flex credential. Possible values: - true - false

Returns:

  • (TrueClass | FalseClass)


162
163
164
# File 'lib/visa_acceptance_merged_spec/models/features.rb', line 162

def flex_credential
  @flex_credential
end

#gambling_allowedTrueClass | FalseClass

This field indicates if gambling transactions are allowed on the BIN. Possible values: - true - false

Returns:

  • (TrueClass | FalseClass)


109
110
111
# File 'lib/visa_acceptance_merged_spec/models/features.rb', line 109

def gambling_allowed
  @gambling_allowed
end

#health_cardTrueClass | FalseClass

This field indicates if the BIN is for healthcare (HSA/FSA). Currently, this field is only supported for Visa BINs. Possible values: - true - false

Returns:

  • (TrueClass | FalseClass)


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

def health_card
  @health_card
end

#message_typeString

This field contains the type of BIN based authentication. Possible values:

- `S`: Single Message
- `D`: Dual Message

Returns:

  • (String)


42
43
44
# File 'lib/visa_acceptance_merged_spec/models/features.rb', line 42

def message_type
  @message_type
end

#online_gambling_blockTrueClass | FalseClass

This field indicates if online gambling is blocked on the BIN. Possible values: - true - false

Returns:

  • (TrueClass | FalseClass)


148
149
150
# File 'lib/visa_acceptance_merged_spec/models/features.rb', line 148

def online_gambling_block
  @online_gambling_block
end

#pos_domestic_onlyTrueClass | FalseClass

This field indicates if the BIN is valid only for POS domestic usage. Possible values: - true - false

Returns:

  • (TrueClass | FalseClass)


102
103
104
# File 'lib/visa_acceptance_merged_spec/models/features.rb', line 102

def pos_domestic_only
  @pos_domestic_only
end

#shared_binTrueClass | FalseClass

This field indicates if the BIN is shared by multiple issuers Possible values: - true - false

Returns:

  • (TrueClass | FalseClass)


95
96
97
# File 'lib/visa_acceptance_merged_spec/models/features.rb', line 95

def shared_bin
  @shared_bin
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
# File 'lib/visa_acceptance_merged_spec/models/features.rb', line 260

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   =
    hash.key?('accountFundingSource') ? hash['accountFundingSource'] : SKIP
   =
    hash.key?('accountFundingSourceSubType') ? hash['accountFundingSourceSubType'] : SKIP
  card_product = hash.key?('cardProduct') ? hash['cardProduct'] : SKIP
  message_type = hash.key?('messageType') ? hash['messageType'] : SKIP
  acceptance_level =
    hash.key?('acceptanceLevel') ? hash['acceptanceLevel'] : SKIP
  card_platform = hash.key?('cardPlatform') ? hash['cardPlatform'] : SKIP
  combo_card = hash.key?('comboCard') ? hash['comboCard'] : SKIP
  corporate_purchase =
    hash.key?('corporatePurchase') ? hash['corporatePurchase'] : SKIP
  health_card = hash.key?('healthCard') ? hash['healthCard'] : SKIP
  shared_bin = hash.key?('sharedBIN') ? hash['sharedBIN'] : SKIP
  pos_domestic_only =
    hash.key?('posDomesticOnly') ? hash['posDomesticOnly'] : SKIP
  gambling_allowed =
    hash.key?('gamblingAllowed') ? hash['gamblingAllowed'] : SKIP
  commercial_card_level2 =
    hash.key?('commercialCardLevel2') ? hash['commercialCardLevel2'] : SKIP
  commercial_card_level3 =
    hash.key?('commercialCardLevel3') ? hash['commercialCardLevel3'] : SKIP
  exempt_bin = hash.key?('exemptBIN') ? hash['exemptBIN'] : SKIP
   =
    hash.key?('accountLevelManagement') ? hash['accountLevelManagement'] : SKIP
  online_gambling_block =
    hash.key?('onlineGamblingBlock') ? hash['onlineGamblingBlock'] : SKIP
  auto_substantiation =
    hash.key?('autoSubstantiation') ? hash['autoSubstantiation'] : SKIP
  flex_credential =
    hash.key?('flexCredential') ? hash['flexCredential'] : 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.
  Features.new(account_funding_source: ,
               account_funding_source_sub_type: ,
               card_product: card_product,
               message_type: message_type,
               acceptance_level: acceptance_level,
               card_platform: card_platform,
               combo_card: combo_card,
               corporate_purchase: corporate_purchase,
               health_card: health_card,
               shared_bin: shared_bin,
               pos_domestic_only: pos_domestic_only,
               gambling_allowed: gambling_allowed,
               commercial_card_level2: commercial_card_level2,
               commercial_card_level3: commercial_card_level3,
               exempt_bin: exempt_bin,
               account_level_management: ,
               online_gambling_block: online_gambling_block,
               auto_substantiation: auto_substantiation,
               flex_credential: flex_credential,
               additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# File 'lib/visa_acceptance_merged_spec/models/features.rb', line 165

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_funding_source'] = 'accountFundingSource'
  @_hash['account_funding_source_sub_type'] =
    'accountFundingSourceSubType'
  @_hash['card_product'] = 'cardProduct'
  @_hash['message_type'] = 'messageType'
  @_hash['acceptance_level'] = 'acceptanceLevel'
  @_hash['card_platform'] = 'cardPlatform'
  @_hash['combo_card'] = 'comboCard'
  @_hash['corporate_purchase'] = 'corporatePurchase'
  @_hash['health_card'] = 'healthCard'
  @_hash['shared_bin'] = 'sharedBIN'
  @_hash['pos_domestic_only'] = 'posDomesticOnly'
  @_hash['gambling_allowed'] = 'gamblingAllowed'
  @_hash['commercial_card_level2'] = 'commercialCardLevel2'
  @_hash['commercial_card_level3'] = 'commercialCardLevel3'
  @_hash['exempt_bin'] = 'exemptBIN'
  @_hash['account_level_management'] = 'accountLevelManagement'
  @_hash['online_gambling_block'] = 'onlineGamblingBlock'
  @_hash['auto_substantiation'] = 'autoSubstantiation'
  @_hash['flex_credential'] = 'flexCredential'
  @_hash
end

.nullablesObject

An array for nullable fields



216
217
218
# File 'lib/visa_acceptance_merged_spec/models/features.rb', line 216

def self.nullables
  []
end

.optionalsObject

An array for optional fields



191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
# File 'lib/visa_acceptance_merged_spec/models/features.rb', line 191

def self.optionals
  %w[
    account_funding_source
    account_funding_source_sub_type
    card_product
    message_type
    acceptance_level
    card_platform
    combo_card
    corporate_purchase
    health_card
    shared_bin
    pos_domestic_only
    gambling_allowed
    commercial_card_level2
    commercial_card_level3
    exempt_bin
    account_level_management
    online_gambling_block
    auto_substantiation
    flex_credential
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
# File 'lib/visa_acceptance_merged_spec/models/features.rb', line 343

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} account_funding_source: #{@account_funding_source.inspect},"\
  " account_funding_source_sub_type: #{@account_funding_source_sub_type.inspect},"\
  " card_product: #{@card_product.inspect}, message_type: #{@message_type.inspect},"\
  " acceptance_level: #{@acceptance_level.inspect}, card_platform: #{@card_platform.inspect},"\
  " combo_card: #{@combo_card.inspect}, corporate_purchase: #{@corporate_purchase.inspect},"\
  " health_card: #{@health_card.inspect}, shared_bin: #{@shared_bin.inspect},"\
  " pos_domestic_only: #{@pos_domestic_only.inspect}, gambling_allowed:"\
  " #{@gambling_allowed.inspect}, commercial_card_level2: #{@commercial_card_level2.inspect},"\
  " commercial_card_level3: #{@commercial_card_level3.inspect}, exempt_bin:"\
  " #{@exempt_bin.inspect}, account_level_management: #{@account_level_management.inspect},"\
  " online_gambling_block: #{@online_gambling_block.inspect}, auto_substantiation:"\
  " #{@auto_substantiation.inspect}, flex_credential: #{@flex_credential.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



327
328
329
330
331
332
333
334
335
336
337
338
339
340
# File 'lib/visa_acceptance_merged_spec/models/features.rb', line 327

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} account_funding_source: #{@account_funding_source},"\
  " account_funding_source_sub_type: #{@account_funding_source_sub_type}, card_product:"\
  " #{@card_product}, message_type: #{@message_type}, acceptance_level: #{@acceptance_level},"\
  " card_platform: #{@card_platform}, combo_card: #{@combo_card}, corporate_purchase:"\
  " #{@corporate_purchase}, health_card: #{@health_card}, shared_bin: #{@shared_bin},"\
  " pos_domestic_only: #{@pos_domestic_only}, gambling_allowed: #{@gambling_allowed},"\
  " commercial_card_level2: #{@commercial_card_level2}, commercial_card_level3:"\
  " #{@commercial_card_level3}, exempt_bin: #{@exempt_bin}, account_level_management:"\
  " #{@account_level_management}, online_gambling_block: #{@online_gambling_block},"\
  " auto_substantiation: #{@auto_substantiation}, flex_credential: #{@flex_credential},"\
  " additional_properties: #{@additional_properties}>"
end