Class: DnaPaymentsPartnerReportingSettlementApIs::MerchantV2
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- DnaPaymentsPartnerReportingSettlementApIs::MerchantV2
- Defined in:
- lib/dna_payments_partner_reporting_settlement_ap_is/models/merchant_v2.rb
Overview
MerchantV2 Model.
Instance Attribute Summary collapse
-
#descriptor ⇒ String
Merchant descriptor as it appears on the consumer's bank statement for DNA Acquiring.
-
#id ⇒ String
Unique ID for the merchant, allocated by DNA Payments.
-
#is_active ⇒ TrueClass | FalseClass
Whether the merchant is active.
-
#name ⇒ String
Name of the merchant.
-
#reconciliation_id ⇒ String
Unique ID allocated by DNA Payments to the merchant account; appears on the merchant bank statement when payments/settlements are made.
-
#terminals ⇒ Array[Terminal]
List of all Terminal IDs configured for the merchant.
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(descriptor: SKIP, id: SKIP, name: SKIP, is_active: SKIP, reconciliation_id: SKIP, terminals: SKIP, additional_properties: nil) ⇒ MerchantV2
constructor
A new instance of MerchantV2.
-
#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(descriptor: SKIP, id: SKIP, name: SKIP, is_active: SKIP, reconciliation_id: SKIP, terminals: SKIP, additional_properties: nil) ⇒ MerchantV2
Returns a new instance of MerchantV2.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/models/merchant_v2.rb', line 67 def initialize(descriptor: SKIP, id: SKIP, name: SKIP, is_active: SKIP, reconciliation_id: SKIP, terminals: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @descriptor = descriptor unless descriptor == SKIP @id = id unless id == SKIP @name = name unless name == SKIP @is_active = is_active unless is_active == SKIP @reconciliation_id = reconciliation_id unless reconciliation_id == SKIP @terminals = terminals unless terminals == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#descriptor ⇒ String
Merchant descriptor as it appears on the consumer's bank statement for DNA Acquiring.
15 16 17 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/models/merchant_v2.rb', line 15 def descriptor @descriptor end |
#id ⇒ String
Unique ID for the merchant, allocated by DNA Payments.
19 20 21 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/models/merchant_v2.rb', line 19 def id @id end |
#is_active ⇒ TrueClass | FalseClass
Whether the merchant is active.
27 28 29 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/models/merchant_v2.rb', line 27 def is_active @is_active end |
#name ⇒ String
Name of the merchant.
23 24 25 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/models/merchant_v2.rb', line 23 def name @name end |
#reconciliation_id ⇒ String
Unique ID allocated by DNA Payments to the merchant account; appears on the merchant bank statement when payments/settlements are made.
32 33 34 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/models/merchant_v2.rb', line 32 def reconciliation_id @reconciliation_id end |
#terminals ⇒ Array[Terminal]
List of all Terminal IDs configured for the merchant.
36 37 38 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/models/merchant_v2.rb', line 36 def terminals @terminals end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/models/merchant_v2.rb', line 83 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. descriptor = hash.key?('descriptor') ? hash['descriptor'] : SKIP id = hash.key?('id') ? hash['id'] : SKIP name = hash.key?('name') ? hash['name'] : SKIP is_active = hash.key?('isActive') ? hash['isActive'] : SKIP reconciliation_id = hash.key?('reconciliationId') ? hash['reconciliationId'] : SKIP # Parameter is an array, so we need to iterate through it terminals = nil unless hash['terminals'].nil? terminals = [] hash['terminals'].each do |structure| terminals << (Terminal.from_hash(structure) if structure) end end terminals = SKIP unless hash.key?('terminals') # 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. MerchantV2.new(descriptor: descriptor, id: id, name: name, is_active: is_active, reconciliation_id: reconciliation_id, terminals: terminals, 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 47 48 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/models/merchant_v2.rb', line 39 def self.names @_hash = {} if @_hash.nil? @_hash['descriptor'] = 'descriptor' @_hash['id'] = 'id' @_hash['name'] = 'name' @_hash['is_active'] = 'isActive' @_hash['reconciliation_id'] = 'reconciliationId' @_hash['terminals'] = 'terminals' @_hash end |
.nullables ⇒ Object
An array for nullable fields
63 64 65 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/models/merchant_v2.rb', line 63 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
51 52 53 54 55 56 57 58 59 60 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/models/merchant_v2.rb', line 51 def self.optionals %w[ descriptor id name is_active reconciliation_id terminals ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
130 131 132 133 134 135 136 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/models/merchant_v2.rb', line 130 def inspect class_name = self.class.name.split('::').last "<#{class_name} descriptor: #{@descriptor.inspect}, id: #{@id.inspect}, name:"\ " #{@name.inspect}, is_active: #{@is_active.inspect}, reconciliation_id:"\ " #{@reconciliation_id.inspect}, terminals: #{@terminals.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
122 123 124 125 126 127 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/models/merchant_v2.rb', line 122 def to_s class_name = self.class.name.split('::').last "<#{class_name} descriptor: #{@descriptor}, id: #{@id}, name: #{@name}, is_active:"\ " #{@is_active}, reconciliation_id: #{@reconciliation_id}, terminals: #{@terminals},"\ " additional_properties: #{@additional_properties}>" end |