Class: VisaAcceptanceMergedSpec::BuyerInformation13

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

Overview

BuyerInformation13 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(company_tax_id: SKIP, currency: SKIP, date_of_birth: SKIP, personal_identification: SKIP, additional_properties: nil) ⇒ BuyerInformation13

Returns a new instance of BuyerInformation13.



63
64
65
66
67
68
69
70
71
72
73
# File 'lib/visa_acceptance_merged_spec/models/buyer_information13.rb', line 63

def initialize(company_tax_id: SKIP, currency: SKIP, date_of_birth: SKIP,
               personal_identification: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @company_tax_id = company_tax_id unless company_tax_id == SKIP
  @currency = currency unless currency == SKIP
  @date_of_birth = date_of_birth unless date_of_birth == SKIP
  @personal_identification = personal_identification unless personal_identification == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#company_tax_idString

Company’s tax identifier. This is only used for eCheck service.

Returns:

  • (String)


14
15
16
# File 'lib/visa_acceptance_merged_spec/models/buyer_information13.rb', line 14

def company_tax_id
  @company_tax_id
end

#currencyString

Currency used for the order. Use the three-character I[ISO Standard Currency Codes.]( For an authorization reversal (reversalInformation) or a capture (processingOptions.capture is set to true), you must use the same currency that you used in your payment authorization request.

DCC for First Data

Your local currency. For details, see the currency field description in [Dynamic Currency Conversion For First Data Using the SCMP API](

For details about currency as used in partial authorizations, see

"Features for Debit Cards and Prepaid Cards" in the [Credit Card Services Using the SCMP API Guide](

Returns:

  • (String)


28
29
30
# File 'lib/visa_acceptance_merged_spec/models/buyer_information13.rb', line 28

def currency
  @currency
end

#date_of_birthDate

Date of birth of the customer. Format: YYYY-MM-DD

Returns:

  • (Date)


32
33
34
# File 'lib/visa_acceptance_merged_spec/models/buyer_information13.rb', line 32

def date_of_birth
  @date_of_birth
end

#personal_identificationArray[PersonalIdentification9]

Date of birth of the customer. Format: YYYY-MM-DD

Returns:



36
37
38
# File 'lib/visa_acceptance_merged_spec/models/buyer_information13.rb', line 36

def personal_identification
  @personal_identification
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



76
77
78
79
80
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
107
# File 'lib/visa_acceptance_merged_spec/models/buyer_information13.rb', line 76

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  company_tax_id = hash.key?('companyTaxID') ? hash['companyTaxID'] : SKIP
  currency = hash.key?('currency') ? hash['currency'] : SKIP
  date_of_birth = hash.key?('dateOfBirth') ? hash['dateOfBirth'] : SKIP
  # Parameter is an array, so we need to iterate through it
  personal_identification = nil
  unless hash['personalIdentification'].nil?
    personal_identification = []
    hash['personalIdentification'].each do |structure|
      personal_identification << (PersonalIdentification9.from_hash(structure) if structure)
    end
  end

  personal_identification = SKIP unless hash.key?('personalIdentification')

  # 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.
  BuyerInformation13.new(company_tax_id: company_tax_id,
                         currency: currency,
                         date_of_birth: date_of_birth,
                         personal_identification: personal_identification,
                         additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



39
40
41
42
43
44
45
46
# File 'lib/visa_acceptance_merged_spec/models/buyer_information13.rb', line 39

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['company_tax_id'] = 'companyTaxID'
  @_hash['currency'] = 'currency'
  @_hash['date_of_birth'] = 'dateOfBirth'
  @_hash['personal_identification'] = 'personalIdentification'
  @_hash
end

.nullablesObject

An array for nullable fields



59
60
61
# File 'lib/visa_acceptance_merged_spec/models/buyer_information13.rb', line 59

def self.nullables
  []
end

.optionalsObject

An array for optional fields



49
50
51
52
53
54
55
56
# File 'lib/visa_acceptance_merged_spec/models/buyer_information13.rb', line 49

def self.optionals
  %w[
    company_tax_id
    currency
    date_of_birth
    personal_identification
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



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

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} company_tax_id: #{@company_tax_id.inspect}, currency: #{@currency.inspect},"\
  " date_of_birth: #{@date_of_birth.inspect}, personal_identification:"\
  " #{@personal_identification.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



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

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} company_tax_id: #{@company_tax_id}, currency: #{@currency}, date_of_birth:"\
  " #{@date_of_birth}, personal_identification: #{@personal_identification},"\
  " additional_properties: #{@additional_properties}>"
end