Class: CyberSource::VpriTransactionInsightsAdditionalDataCardBinData

Inherits:
Object
  • Object
show all
Defined in:
lib/cybersource_rest_client/models/vpri_transaction_insights_additional_data_card_bin_data.rb

Overview

Card BIN (Bank Identification Number) metadata returned by the BIN lookup service. Present when BIN lookup succeeds; absent on no-match or lookup error.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ VpriTransactionInsightsAdditionalDataCardBinData

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



103
104
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/cybersource_rest_client/models/vpri_transaction_insights_additional_data_card_bin_data.rb', line 103

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  if attributes.has_key?(:'issuerBin')
    self.issuer_bin = attributes[:'issuerBin']
  end

  if attributes.has_key?(:'issuerBinCountry')
    self.issuer_bin_country = attributes[:'issuerBinCountry']
  end

  if attributes.has_key?(:'issuerName')
    self.issuer_name = attributes[:'issuerName']
  end

  if attributes.has_key?(:'cardBin')
    self.card_bin = attributes[:'cardBin']
  end

  if attributes.has_key?(:'cardFundingSource')
    self.card_funding_source = attributes[:'cardFundingSource']
  end

  if attributes.has_key?(:'cardFundingSourceSubType')
    self.card_funding_source_sub_type = attributes[:'cardFundingSourceSubType']
  end

  if attributes.has_key?(:'cardBrand')
    self.card_brand = attributes[:'cardBrand']
  end

  if attributes.has_key?(:'cardProductID')
    self.card_product_id = attributes[:'cardProductID']
  end

  if attributes.has_key?(:'cardProductDescription')
    self.card_product_description = attributes[:'cardProductDescription']
  end

  if attributes.has_key?(:'status')
    self.status = attributes[:'status']
  end

  if attributes.has_key?(:'warnings')
    if (value = attributes[:'warnings']).is_a?(Array)
      self.warnings = value
    end
  end
end

Instance Attribute Details

#card_binObject

Resolved card BIN returned by the lookup service, which may differ from issuerBin in certain co-branded or affiliated card scenarios.



27
28
29
# File 'lib/cybersource_rest_client/models/vpri_transaction_insights_additional_data_card_bin_data.rb', line 27

def card_bin
  @card_bin
end

#card_brandObject

Card network brand code (e.g., 001 for Visa, 002 for Mastercard). Used for brand-specific fraud rule application.



36
37
38
# File 'lib/cybersource_rest_client/models/vpri_transaction_insights_additional_data_card_bin_data.rb', line 36

def card_brand
  @card_brand
end

#card_funding_sourceObject

Funding source type of the card indicating how transactions are funded (e.g., CREDIT, DEBIT, PREPAID). Used for risk segmentation by payment method.



30
31
32
# File 'lib/cybersource_rest_client/models/vpri_transaction_insights_additional_data_card_bin_data.rb', line 30

def card_funding_source
  @card_funding_source
end

#card_funding_source_sub_typeObject

Sub-classification of the funding source (e.g., business, consumer). Enables more granular risk profiling within a funding source category.



33
34
35
# File 'lib/cybersource_rest_client/models/vpri_transaction_insights_additional_data_card_bin_data.rb', line 33

def card_funding_source_sub_type
  @card_funding_source_sub_type
end

#card_product_descriptionObject

Human-readable description of the card product. Useful for client-facing displays or product-level fraud analysis.



42
43
44
# File 'lib/cybersource_rest_client/models/vpri_transaction_insights_additional_data_card_bin_data.rb', line 42

def card_product_description
  @card_product_description
end

#card_product_idObject

Product identifier for the card product issued. May be an alphanumeric code or a product name depending on the issuer.



39
40
41
# File 'lib/cybersource_rest_client/models/vpri_transaction_insights_additional_data_card_bin_data.rb', line 39

def card_product_id
  @card_product_id
end

#issuer_binObject

The BIN submitted for lookup, consisting of the first 6 or 8 digits of the card number, identifying the issuing institution.



18
19
20
# File 'lib/cybersource_rest_client/models/vpri_transaction_insights_additional_data_card_bin_data.rb', line 18

def issuer_bin
  @issuer_bin
end

#issuer_bin_countryObject

ISO 3166-1 alpha-2 country code of the card-issuing institution. Useful for detecting geographic mismatches between issuer and transaction origin.



21
22
23
# File 'lib/cybersource_rest_client/models/vpri_transaction_insights_additional_data_card_bin_data.rb', line 21

def issuer_bin_country
  @issuer_bin_country
end

#issuer_nameObject

Full name of the card-issuing bank or financial institution.



24
25
26
# File 'lib/cybersource_rest_client/models/vpri_transaction_insights_additional_data_card_bin_data.rb', line 24

def issuer_name
  @issuer_name
end

#statusObject

Result status of the BIN lookup. Indicates whether the BIN was successfully matched in the lookup service. Possible values: - matched - no_match - error



45
46
47
# File 'lib/cybersource_rest_client/models/vpri_transaction_insights_additional_data_card_bin_data.rb', line 45

def status
  @status
end

#warningsObject

BIN-lookup-specific warnings. An empty array indicates a clean lookup. Warning codes include BIN_NO_MATCH, BIN_INPUT_MISSING, BIN_LOOKUP_ERROR, BIN_AMBIGUOUS, BIN_LOOKUP_INPUT_ERROR.



48
49
50
# File 'lib/cybersource_rest_client/models/vpri_transaction_insights_additional_data_card_bin_data.rb', line 48

def warnings
  @warnings
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/cybersource_rest_client/models/vpri_transaction_insights_additional_data_card_bin_data.rb', line 51

def self.attribute_map
  {
    :'issuer_bin' => :'issuerBin',
    :'issuer_bin_country' => :'issuerBinCountry',
    :'issuer_name' => :'issuerName',
    :'card_bin' => :'cardBin',
    :'card_funding_source' => :'cardFundingSource',
    :'card_funding_source_sub_type' => :'cardFundingSourceSubType',
    :'card_brand' => :'cardBrand',
    :'card_product_id' => :'cardProductID',
    :'card_product_description' => :'cardProductDescription',
    :'status' => :'status',
    :'warnings' => :'warnings'
  }
end

.json_mapObject

Attribute mapping from JSON key to ruby-style variable name.



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/cybersource_rest_client/models/vpri_transaction_insights_additional_data_card_bin_data.rb', line 68

def self.json_map
  {
    :'issuer_bin' => :'issuer_bin',
    :'issuer_bin_country' => :'issuer_bin_country',
    :'issuer_name' => :'issuer_name',
    :'card_bin' => :'card_bin',
    :'card_funding_source' => :'card_funding_source',
    :'card_funding_source_sub_type' => :'card_funding_source_sub_type',
    :'card_brand' => :'card_brand',
    :'card_product_id' => :'card_product_id',
    :'card_product_description' => :'card_product_description',
    :'status' => :'status',
    :'warnings' => :'warnings'
  }
end

.swagger_typesObject

Attribute type mapping.



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/cybersource_rest_client/models/vpri_transaction_insights_additional_data_card_bin_data.rb', line 85

def self.swagger_types
  {
    :'issuer_bin' => :'String',
    :'issuer_bin_country' => :'String',
    :'issuer_name' => :'String',
    :'card_bin' => :'String',
    :'card_funding_source' => :'String',
    :'card_funding_source_sub_type' => :'String',
    :'card_brand' => :'String',
    :'card_product_id' => :'String',
    :'card_product_description' => :'String',
    :'status' => :'String',
    :'warnings' => :'Array<UnifiedRiskPost201ResponseResultsRISKINSIGHTSPackagesTransactionInsightsInsightsWarnings>'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
# File 'lib/cybersource_rest_client/models/vpri_transaction_insights_additional_data_card_bin_data.rb', line 225

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      issuer_bin == o.issuer_bin &&
      issuer_bin_country == o.issuer_bin_country &&
      issuer_name == o.issuer_name &&
      card_bin == o.card_bin &&
      card_funding_source == o.card_funding_source &&
      card_funding_source_sub_type == o.card_funding_source_sub_type &&
      card_brand == o.card_brand &&
      card_product_id == o.card_product_id &&
      card_product_description == o.card_product_description &&
      status == o.status &&
      warnings == o.warnings
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



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
# File 'lib/cybersource_rest_client/models/vpri_transaction_insights_additional_data_card_bin_data.rb', line 277

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    temp_model = CyberSource.const_get(type).new
    temp_model.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



343
344
345
346
347
348
349
350
351
352
353
354
355
# File 'lib/cybersource_rest_client/models/vpri_transaction_insights_additional_data_card_bin_data.rb', line 343

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
# File 'lib/cybersource_rest_client/models/vpri_transaction_insights_additional_data_card_bin_data.rb', line 256

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


243
244
245
# File 'lib/cybersource_rest_client/models/vpri_transaction_insights_additional_data_card_bin_data.rb', line 243

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



249
250
251
# File 'lib/cybersource_rest_client/models/vpri_transaction_insights_additional_data_card_bin_data.rb', line 249

def hash
  [issuer_bin, issuer_bin_country, issuer_name, card_bin, card_funding_source, card_funding_source_sub_type, card_brand, card_product_id, card_product_description, status, warnings].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



158
159
160
161
# File 'lib/cybersource_rest_client/models/vpri_transaction_insights_additional_data_card_bin_data.rb', line 158

def list_invalid_properties
  invalid_properties = Array.new
  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



323
324
325
# File 'lib/cybersource_rest_client/models/vpri_transaction_insights_additional_data_card_bin_data.rb', line 323

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



329
330
331
332
333
334
335
336
337
# File 'lib/cybersource_rest_client/models/vpri_transaction_insights_additional_data_card_bin_data.rb', line 329

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



317
318
319
# File 'lib/cybersource_rest_client/models/vpri_transaction_insights_additional_data_card_bin_data.rb', line 317

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



165
166
167
# File 'lib/cybersource_rest_client/models/vpri_transaction_insights_additional_data_card_bin_data.rb', line 165

def valid?
  true
end