Class: CyberSourceMergedSpec::AcquirerInformation1

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

Overview

AcquirerInformation1 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(acquirer_bin: SKIP, country: SKIP, password: SKIP, merchant_id: SKIP, additional_properties: nil) ⇒ AcquirerInformation1

Returns a new instance of AcquirerInformation1.



59
60
61
62
63
64
65
66
67
68
69
# File 'lib/cyber_source_merged_spec/models/acquirer_information1.rb', line 59

def initialize(acquirer_bin: SKIP, country: SKIP, password: SKIP,
               merchant_id: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @acquirer_bin = acquirer_bin unless acquirer_bin == SKIP
  @country = country unless country == SKIP
  @password = password unless password == SKIP
  @merchant_id = merchant_id unless merchant_id == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#acquirer_binString

Acquirer bank ID number that corresponds to a certificate that Cybersource already has.This ID has this format. 4XXXXX for Visa and 5XXXXX for Mastercard.

Returns:

  • (String)


16
17
18
# File 'lib/cyber_source_merged_spec/models/acquirer_information1.rb', line 16

def acquirer_bin
  @acquirer_bin
end

#countryString

Issuers need to be aware of the Acquirer's Country Code when the Acquirer country differs from the Merchant country and the Acquirer is in the EEA (European Economic Area).

Returns:

  • (String)


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

def country
  @country
end

#merchant_idString

Username for the visa directory server that is created when your acquirer sets up your account. This ID might be the same as your merchant ID. the username can be 15 or 23 characters.

Returns:

  • (String)


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

def merchant_id
  @merchant_id
end

#passwordString

Registered password for the Visa directory server.

Returns:

  • (String)


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

def password
  @password
end

Class Method Details

.from_element(root) ⇒ Object



96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/cyber_source_merged_spec/models/acquirer_information1.rb', line 96

def self.from_element(root)
  acquirer_bin = XmlUtilities.from_element(root, 'acquirerBin', String)
  country = XmlUtilities.from_element(root, 'country', String)
  password = XmlUtilities.from_element(root, 'password', String)
  merchant_id = XmlUtilities.from_element(root, 'merchantId', String)

  new(acquirer_bin: acquirer_bin,
      country: country,
      password: password,
      merchant_id: merchant_id,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/cyber_source_merged_spec/models/acquirer_information1.rb', line 72

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  acquirer_bin = hash.key?('acquirerBin') ? hash['acquirerBin'] : SKIP
  country = hash.key?('country') ? hash['country'] : SKIP
  password = hash.key?('password') ? hash['password'] : SKIP
  merchant_id = hash.key?('merchantId') ? hash['merchantId'] : 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.
  AcquirerInformation1.new(acquirer_bin: acquirer_bin,
                           country: country,
                           password: password,
                           merchant_id: merchant_id,
                           additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



35
36
37
38
39
40
41
42
# File 'lib/cyber_source_merged_spec/models/acquirer_information1.rb', line 35

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['acquirer_bin'] = 'acquirerBin'
  @_hash['country'] = 'country'
  @_hash['password'] = 'password'
  @_hash['merchant_id'] = 'merchantId'
  @_hash
end

.nullablesObject

An array for nullable fields



55
56
57
# File 'lib/cyber_source_merged_spec/models/acquirer_information1.rb', line 55

def self.nullables
  []
end

.optionalsObject

An array for optional fields



45
46
47
48
49
50
51
52
# File 'lib/cyber_source_merged_spec/models/acquirer_information1.rb', line 45

def self.optionals
  %w[
    acquirer_bin
    country
    password
    merchant_id
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



131
132
133
134
135
136
# File 'lib/cyber_source_merged_spec/models/acquirer_information1.rb', line 131

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

#to_sObject

Provides a human-readable string representation of the object.



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

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

#to_xml_element(doc, root_name) ⇒ Object



109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/cyber_source_merged_spec/models/acquirer_information1.rb', line 109

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

  XmlUtilities.add_as_subelement(doc, root, 'acquirerBin', acquirer_bin)
  XmlUtilities.add_as_subelement(doc, root, 'country', country)
  XmlUtilities.add_as_subelement(doc, root, 'password', password)
  XmlUtilities.add_as_subelement(doc, root, 'merchantId', merchant_id)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end