Class: VisaAcceptanceMergedSpec::ShippingDetails1
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- VisaAcceptanceMergedSpec::ShippingDetails1
- Defined in:
- lib/visa_acceptance_merged_spec/models/shipping_details1.rb
Overview
ShippingDetails1 Model.
Instance Attribute Summary collapse
-
#ship_from_postal_code ⇒ String
Postal code for the address from which the goods are shipped, which is used to establish nexus.
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(ship_from_postal_code: SKIP, additional_properties: nil) ⇒ ShippingDetails1
constructor
A new instance of ShippingDetails1.
-
#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(ship_from_postal_code: SKIP, additional_properties: nil) ⇒ ShippingDetails1
Returns a new instance of ShippingDetails1.
47 48 49 50 51 52 53 |
# File 'lib/visa_acceptance_merged_spec/models/shipping_details1.rb', line 47 def initialize(ship_from_postal_code: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @ship_from_postal_code = ship_from_postal_code unless ship_from_postal_code == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#ship_from_postal_code ⇒ String
Postal code for the address from which the goods are shipped, which is
used to establish nexus. The default is
the postal code associated with your Visa Acceptance account.
The postal code must consist of 5 to 9 digits. When the billing country is
the U.S., the 9-digit postal code
must follow this format:
[5 digits][dash][4 digits]
Example 12345-6789
When the billing country is Canada, the 6-digit postal code must follow
this format:
[alpha][numeric][alpha][space] [numeric][alpha][numeric]
Example A1B 2C3
This field is frequently used for Level II and Level III transactions.
26 27 28 |
# File 'lib/visa_acceptance_merged_spec/models/shipping_details1.rb', line 26 def ship_from_postal_code @ship_from_postal_code end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/visa_acceptance_merged_spec/models/shipping_details1.rb', line 56 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. ship_from_postal_code = hash.key?('shipFromPostalCode') ? hash['shipFromPostalCode'] : 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. ShippingDetails1.new(ship_from_postal_code: ship_from_postal_code, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 |
# File 'lib/visa_acceptance_merged_spec/models/shipping_details1.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['ship_from_postal_code'] = 'shipFromPostalCode' @_hash end |
.nullables ⇒ Object
An array for nullable fields
43 44 45 |
# File 'lib/visa_acceptance_merged_spec/models/shipping_details1.rb', line 43 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
36 37 38 39 40 |
# File 'lib/visa_acceptance_merged_spec/models/shipping_details1.rb', line 36 def self.optionals %w[ ship_from_postal_code ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
83 84 85 86 87 |
# File 'lib/visa_acceptance_merged_spec/models/shipping_details1.rb', line 83 def inspect class_name = self.class.name.split('::').last "<#{class_name} ship_from_postal_code: #{@ship_from_postal_code.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
76 77 78 79 80 |
# File 'lib/visa_acceptance_merged_spec/models/shipping_details1.rb', line 76 def to_s class_name = self.class.name.split('::').last "<#{class_name} ship_from_postal_code: #{@ship_from_postal_code}, additional_properties:"\ " #{@additional_properties}>" end |