Class: VisaAcceptanceMergedSpec::BuyerInformation13
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- VisaAcceptanceMergedSpec::BuyerInformation13
- Defined in:
- lib/visa_acceptance_merged_spec/models/buyer_information13.rb
Overview
BuyerInformation13 Model.
Instance Attribute Summary collapse
-
#company_tax_id ⇒ String
Company’s tax identifier.
-
#currency ⇒ String
Currency used for the order.
-
#date_of_birth ⇒ Date
Date of birth of the customer.
-
#personal_identification ⇒ Array[PersonalIdentification9]
Date of birth of the customer.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(company_tax_id: SKIP, currency: SKIP, date_of_birth: SKIP, personal_identification: SKIP, additional_properties: nil) ⇒ BuyerInformation13
constructor
A new instance of BuyerInformation13.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
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_id ⇒ String
Company’s tax identifier. This is only used for eCheck service.
14 15 16 |
# File 'lib/visa_acceptance_merged_spec/models/buyer_information13.rb', line 14 def company_tax_id @company_tax_id end |
#currency ⇒ String
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](
28 29 30 |
# File 'lib/visa_acceptance_merged_spec/models/buyer_information13.rb', line 28 def currency @currency end |
#date_of_birth ⇒ Date
Date of birth of the customer. Format: YYYY-MM-DD
32 33 34 |
# File 'lib/visa_acceptance_merged_spec/models/buyer_information13.rb', line 32 def date_of_birth @date_of_birth end |
#personal_identification ⇒ Array[PersonalIdentification9]
Date of birth of the customer. Format: YYYY-MM-DD
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 |
.names ⇒ Object
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 |
.nullables ⇒ Object
An array for nullable fields
59 60 61 |
# File 'lib/visa_acceptance_merged_spec/models/buyer_information13.rb', line 59 def self.nullables [] end |
.optionals ⇒ Object
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
#inspect ⇒ Object
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_s ⇒ Object
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 |