Class: CyberSourceMergedSpec::PaymentInformation32

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

Overview

Contains response information about the payment.

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(bin_country: SKIP, account_type: SKIP, issuer: SKIP, scheme: SKIP, bin: SKIP, additional_properties: nil) ⇒ PaymentInformation32

Returns a new instance of PaymentInformation32.



77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/cyber_source_merged_spec/models/payment_information32.rb', line 77

def initialize(bin_country: SKIP, account_type: SKIP, issuer: SKIP,
               scheme: SKIP, bin: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @bin_country = bin_country unless bin_country == SKIP
  @account_type =  unless  == SKIP
  @issuer = issuer unless issuer == SKIP
  @scheme = scheme unless scheme == SKIP
  @bin = bin unless bin == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#account_typeString

Type of payment card account. This field can refer to a credit card, debit card, or prepaid card account type.

Returns:

  • (String)


25
26
27
# File 'lib/cyber_source_merged_spec/models/payment_information32.rb', line 25

def 
  @account_type
end

#binString

Credit card BIN (the first six digits of the credit card).Derived either from the cc_bin request field or from the first six characters of the customer_cc_num field.

Returns:

  • (String)


48
49
50
# File 'lib/cyber_source_merged_spec/models/payment_information32.rb', line 48

def bin
  @bin
end

#bin_countryString

Country (two-digit country code) associated with the BIN of the customer’s card used for the payment. Returned if the information is available. Use this field for additional information when reviewing orders. This information is also displayed in the details page of the CyberSource Business Center.

Returns:

  • (String)


19
20
21
# File 'lib/cyber_source_merged_spec/models/payment_information32.rb', line 19

def bin_country
  @bin_country
end

#issuerString

Name of the bank or entity that issued the card account.

Returns:

  • (String)


29
30
31
# File 'lib/cyber_source_merged_spec/models/payment_information32.rb', line 29

def issuer
  @issuer
end

#schemeString

Subtype of card account. This field can contain one of the following values:

  • Maestro International
  • Maestro UK Domestic
  • MasterCard Credit
  • MasterCard Debit
  • Visa Credit
  • Visa Debit
  • Visa Electron Note Additional values may be present.

Returns:

  • (String)


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

def scheme
  @scheme
end

Class Method Details

.from_element(root) ⇒ Object



117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/cyber_source_merged_spec/models/payment_information32.rb', line 117

def self.from_element(root)
  bin_country = XmlUtilities.from_element(root, 'binCountry', String)
   = XmlUtilities.from_element(root, 'accountType', String)
  issuer = XmlUtilities.from_element(root, 'issuer', String)
  scheme = XmlUtilities.from_element(root, 'scheme', String)
  bin = XmlUtilities.from_element(root, 'bin', String)

  new(bin_country: bin_country,
      account_type: ,
      issuer: issuer,
      scheme: scheme,
      bin: bin,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/cyber_source_merged_spec/models/payment_information32.rb', line 91

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  bin_country = hash.key?('binCountry') ? hash['binCountry'] : SKIP
   = hash.key?('accountType') ? hash['accountType'] : SKIP
  issuer = hash.key?('issuer') ? hash['issuer'] : SKIP
  scheme = hash.key?('scheme') ? hash['scheme'] : SKIP
  bin = hash.key?('bin') ? hash['bin'] : 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.
  PaymentInformation32.new(bin_country: bin_country,
                           account_type: ,
                           issuer: issuer,
                           scheme: scheme,
                           bin: bin,
                           additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



51
52
53
54
55
56
57
58
59
# File 'lib/cyber_source_merged_spec/models/payment_information32.rb', line 51

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['bin_country'] = 'binCountry'
  @_hash['account_type'] = 'accountType'
  @_hash['issuer'] = 'issuer'
  @_hash['scheme'] = 'scheme'
  @_hash['bin'] = 'bin'
  @_hash
end

.nullablesObject

An array for nullable fields



73
74
75
# File 'lib/cyber_source_merged_spec/models/payment_information32.rb', line 73

def self.nullables
  []
end

.optionalsObject

An array for optional fields



62
63
64
65
66
67
68
69
70
# File 'lib/cyber_source_merged_spec/models/payment_information32.rb', line 62

def self.optionals
  %w[
    bin_country
    account_type
    issuer
    scheme
    bin
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



155
156
157
158
159
160
# File 'lib/cyber_source_merged_spec/models/payment_information32.rb', line 155

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} bin_country: #{@bin_country.inspect}, account_type:"\
  " #{@account_type.inspect}, issuer: #{@issuer.inspect}, scheme: #{@scheme.inspect}, bin:"\
  " #{@bin.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



147
148
149
150
151
152
# File 'lib/cyber_source_merged_spec/models/payment_information32.rb', line 147

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} bin_country: #{@bin_country}, account_type: #{@account_type}, issuer:"\
  " #{@issuer}, scheme: #{@scheme}, bin: #{@bin}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_xml_element(doc, root_name) ⇒ Object



132
133
134
135
136
137
138
139
140
141
142
143
144
# File 'lib/cyber_source_merged_spec/models/payment_information32.rb', line 132

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

  XmlUtilities.add_as_subelement(doc, root, 'binCountry', bin_country)
  XmlUtilities.add_as_subelement(doc, root, 'accountType', )
  XmlUtilities.add_as_subelement(doc, root, 'issuer', issuer)
  XmlUtilities.add_as_subelement(doc, root, 'scheme', scheme)
  XmlUtilities.add_as_subelement(doc, root, 'bin', bin)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end