Class: VisaAcceptanceMergedSpec::AcquirerInformation

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

Overview

AcquirerInformation 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, acquirer_merchant_id: SKIP, additional_properties: nil) ⇒ AcquirerInformation

Returns a new instance of AcquirerInformation.



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

def initialize(acquirer_bin: SKIP, country: SKIP, password: SKIP,
               merchant_id: SKIP, acquirer_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
  @acquirer_merchant_id = acquirer_merchant_id unless acquirer_merchant_id == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#acquirer_bin ⇒ String

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

Returns:

  • (String)


16
17
18
# File 'lib/visa_acceptance_merged_spec/models/acquirer_information.rb', line 16

def acquirer_bin
  @acquirer_bin
end

#acquirer_merchant_id ⇒ String

Acquirer assigned merchant id. Check if your processor supports this field.

Returns:

  • (String)


37
38
39
# File 'lib/visa_acceptance_merged_spec/models/acquirer_information.rb', line 37

def acquirer_merchant_id
  @acquirer_merchant_id
end

#country ⇒ String

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/visa_acceptance_merged_spec/models/acquirer_information.rb', line 22

def country
  @country
end

#merchant_id ⇒ String

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/visa_acceptance_merged_spec/models/acquirer_information.rb', line 32

def merchant_id
  @merchant_id
end

#password ⇒ String

Registered password for the Visa directory server.

Returns:

  • (String)


26
27
28
# File 'lib/visa_acceptance_merged_spec/models/acquirer_information.rb', line 26

def password
  @password
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/visa_acceptance_merged_spec/models/acquirer_information.rb', line 81

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
  acquirer_merchant_id =
    hash.key?('acquirerMerchantId') ? hash['acquirerMerchantId'] : 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.
  AcquirerInformation.new(acquirer_bin: acquirer_bin,
                          country: country,
                          password: password,
                          merchant_id: merchant_id,
                          acquirer_merchant_id: acquirer_merchant_id,
                          additional_properties: additional_properties)
end

.names ⇒ Object

A mapping from model property names to API property names.



40
41
42
43
44
45
46
47
48
# File 'lib/visa_acceptance_merged_spec/models/acquirer_information.rb', line 40

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

.nullables ⇒ Object

An array for nullable fields



62
63
64
# File 'lib/visa_acceptance_merged_spec/models/acquirer_information.rb', line 62

def self.nullables
  []
end

.optionals ⇒ Object

An array for optional fields



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

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

Instance Method Details

#inspect ⇒ Object

Provides a debugging-friendly string with detailed object information.



117
118
119
120
121
122
123
# File 'lib/visa_acceptance_merged_spec/models/acquirer_information.rb', line 117

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},"\
  " acquirer_merchant_id: #{@acquirer_merchant_id.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_s ⇒ Object

Provides a human-readable string representation of the object.



109
110
111
112
113
114
# File 'lib/visa_acceptance_merged_spec/models/acquirer_information.rb', line 109

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