Class: FdxV660Api::TransactionPayeeEntity1
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- FdxV660Api::TransactionPayeeEntity1
- Defined in:
- lib/fdx_v660_api/models/transaction_payee_entity1.rb
Overview
The payee for the buy now pay later item
Instance Attribute Summary collapse
-
#address ⇒ DeliveryAddress1
Address of the payee who received the payment.
-
#individual_name ⇒ IndividualName7
Name when payee is an individual.
-
#merchant_id ⇒ String
Merchant identifier (MID) for card processing.
-
#merchant_name ⇒ BusinessName5
Name when payee is a merchant, typically a business from which goods or services are rendered.
-
#phone ⇒ TelephoneNumber3
Phone number of the payee who received the payment.
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.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(merchant_name: SKIP, merchant_id: SKIP, individual_name: SKIP, address: SKIP, phone: SKIP, additional_properties: nil) ⇒ TransactionPayeeEntity1
constructor
A new instance of TransactionPayeeEntity1.
-
#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(merchant_name: SKIP, merchant_id: SKIP, individual_name: SKIP, address: SKIP, phone: SKIP, additional_properties: nil) ⇒ TransactionPayeeEntity1
Returns a new instance of TransactionPayeeEntity1.
60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/fdx_v660_api/models/transaction_payee_entity1.rb', line 60 def initialize(merchant_name: SKIP, merchant_id: SKIP, individual_name: SKIP, address: SKIP, phone: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @merchant_name = merchant_name unless merchant_name == SKIP @merchant_id = merchant_id unless merchant_id == SKIP @individual_name = individual_name unless individual_name == SKIP @address = address unless address == SKIP @phone = phone unless phone == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#address ⇒ DeliveryAddress1
Address of the payee who received the payment
27 28 29 |
# File 'lib/fdx_v660_api/models/transaction_payee_entity1.rb', line 27 def address @address end |
#individual_name ⇒ IndividualName7
Name when payee is an individual
23 24 25 |
# File 'lib/fdx_v660_api/models/transaction_payee_entity1.rb', line 23 def individual_name @individual_name end |
#merchant_id ⇒ String
Merchant identifier (MID) for card processing
19 20 21 |
# File 'lib/fdx_v660_api/models/transaction_payee_entity1.rb', line 19 def merchant_id @merchant_id end |
#merchant_name ⇒ BusinessName5
Name when payee is a merchant, typically a business from which goods or services are rendered
15 16 17 |
# File 'lib/fdx_v660_api/models/transaction_payee_entity1.rb', line 15 def merchant_name @merchant_name end |
#phone ⇒ TelephoneNumber3
Phone number of the payee who received the payment
31 32 33 |
# File 'lib/fdx_v660_api/models/transaction_payee_entity1.rb', line 31 def phone @phone end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
75 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 |
# File 'lib/fdx_v660_api/models/transaction_payee_entity1.rb', line 75 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. merchant_name = BusinessName5.from_hash(hash['merchantName']) if hash['merchantName'] merchant_id = hash.key?('merchantId') ? hash['merchantId'] : SKIP individual_name = IndividualName7.from_hash(hash['individualName']) if hash['individualName'] address = DeliveryAddress1.from_hash(hash['address']) if hash['address'] phone = TelephoneNumber3.from_hash(hash['phone']) if hash['phone'] # 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. TransactionPayeeEntity1.new(merchant_name: merchant_name, merchant_id: merchant_id, individual_name: individual_name, address: address, phone: phone, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
34 35 36 37 38 39 40 41 42 |
# File 'lib/fdx_v660_api/models/transaction_payee_entity1.rb', line 34 def self.names @_hash = {} if @_hash.nil? @_hash['merchant_name'] = 'merchantName' @_hash['merchant_id'] = 'merchantId' @_hash['individual_name'] = 'individualName' @_hash['address'] = 'address' @_hash['phone'] = 'phone' @_hash end |
.nullables ⇒ Object
An array for nullable fields
56 57 58 |
# File 'lib/fdx_v660_api/models/transaction_payee_entity1.rb', line 56 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
45 46 47 48 49 50 51 52 53 |
# File 'lib/fdx_v660_api/models/transaction_payee_entity1.rb', line 45 def self.optionals %w[ merchant_name merchant_id individual_name address phone ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
104 105 106 107 108 109 110 |
# File 'lib/fdx_v660_api/models/transaction_payee_entity1.rb', line 104 def self.validate(value) return true if value.instance_of? self return false unless value.instance_of? Hash true end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
121 122 123 124 125 126 127 |
# File 'lib/fdx_v660_api/models/transaction_payee_entity1.rb', line 121 def inspect class_name = self.class.name.split('::').last "<#{class_name} merchant_name: #{@merchant_name.inspect}, merchant_id:"\ " #{@merchant_id.inspect}, individual_name: #{@individual_name.inspect}, address:"\ " #{@address.inspect}, phone: #{@phone.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
113 114 115 116 117 118 |
# File 'lib/fdx_v660_api/models/transaction_payee_entity1.rb', line 113 def to_s class_name = self.class.name.split('::').last "<#{class_name} merchant_name: #{@merchant_name}, merchant_id: #{@merchant_id},"\ " individual_name: #{@individual_name}, address: #{@address}, phone: #{@phone},"\ " additional_properties: #{@additional_properties}>" end |