Class: VisaAcceptanceMergedSpec::AmountDetails1
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- VisaAcceptanceMergedSpec::AmountDetails1
- Defined in:
- lib/visa_acceptance_merged_spec/models/amount_details1.rb
Overview
AmountDetails1 Model.
Instance Attribute Summary collapse
-
#amount ⇒ String
Total Amount that has been spent on the corresponding amountType.
-
#amount_type ⇒ String
Total amount that has been spent on healthcare in a transaction.
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(amount_type: SKIP, amount: SKIP, additional_properties: nil) ⇒ AmountDetails1
constructor
A new instance of AmountDetails1.
-
#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(amount_type: SKIP, amount: SKIP, additional_properties: nil) ⇒ AmountDetails1
Returns a new instance of AmountDetails1.
62 63 64 65 66 67 68 69 |
# File 'lib/visa_acceptance_merged_spec/models/amount_details1.rb', line 62 def initialize(amount_type: SKIP, amount: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @amount_type = amount_type unless amount_type == SKIP @amount = amount unless amount == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#amount ⇒ String
Total Amount that has been spent on the corresponding amountType. This is 13 byte field including sign. If the amount is positive, then it is a debit for the customer. If the amount is negative, then it is a credit for the customer.
39 40 41 |
# File 'lib/visa_acceptance_merged_spec/models/amount_details1.rb', line 39 def amount @amount end |
#amount_type ⇒ String
Total amount that has been spent on healthcare in a transaction. Valid Values for Visa:
healthcare- Total Amount Healthcarehealthcare-transit- Amount Transitvision- Amount Vision/Opticalprescription- Amount Prescription/RXclinic- Amount Clinic/Other Qualified Medicaldental- Amount DentalNote:- Prescription, Clinic and dental amounts must be preceded with the total healthcare amount and cannot occur individually. Vision and Transit must be sent individually and cannot be combined with total healthcare amount or any other amounts. Total Healthcare amount can be sent individually. Valid Values for MasterCard:prescription- Amount Prescription/RXeligible-total- Total Amount HealthcareNote:- Prescription must be preceded with the total healthcare amount and cannot occur individually. Total Healthcare amount can be sent individually.
32 33 34 |
# File 'lib/visa_acceptance_merged_spec/models/amount_details1.rb', line 32 def amount_type @amount_type end |
Class Method Details
.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 |
# File 'lib/visa_acceptance_merged_spec/models/amount_details1.rb', line 72 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. amount_type = hash.key?('amountType') ? hash['amountType'] : SKIP amount = hash.key?('amount') ? hash['amount'] : 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. AmountDetails1.new(amount_type: amount_type, amount: amount, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
42 43 44 45 46 47 |
# File 'lib/visa_acceptance_merged_spec/models/amount_details1.rb', line 42 def self.names @_hash = {} if @_hash.nil? @_hash['amount_type'] = 'amountType' @_hash['amount'] = 'amount' @_hash end |
.nullables ⇒ Object
An array for nullable fields
58 59 60 |
# File 'lib/visa_acceptance_merged_spec/models/amount_details1.rb', line 58 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
50 51 52 53 54 55 |
# File 'lib/visa_acceptance_merged_spec/models/amount_details1.rb', line 50 def self.optionals %w[ amount_type amount ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
100 101 102 103 104 |
# File 'lib/visa_acceptance_merged_spec/models/amount_details1.rb', line 100 def inspect class_name = self.class.name.split('::').last "<#{class_name} amount_type: #{@amount_type.inspect}, amount: #{@amount.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
93 94 95 96 97 |
# File 'lib/visa_acceptance_merged_spec/models/amount_details1.rb', line 93 def to_s class_name = self.class.name.split('::').last "<#{class_name} amount_type: #{@amount_type}, amount: #{@amount}, additional_properties:"\ " #{@additional_properties}>" end |