Class: DnaPaymentsPartnerReportingSettlementApIs::Terminal
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- DnaPaymentsPartnerReportingSettlementApIs::Terminal
- Defined in:
- lib/dna_payments_partner_reporting_settlement_ap_is/models/terminal.rb
Overview
Terminal Model.
Instance Attribute Summary collapse
-
#daily_settlement ⇒ TrueClass | FalseClass
If true, a separate payment is received each day.
-
#id ⇒ String
Unique Terminal ID for the merchant, allocated by DNA Payments.
-
#mid ⇒ String
MID allocated by DNA Payments.
-
#settlement_period ⇒ Integer
Number of days after which settlement is processed for this merchant.
-
#status ⇒ Status
open: all operations allowed.
-
#store_name ⇒ String
Name of the merchant store provided during onboarding.
-
#type ⇒ Type
Type of terminal: ecom (Ecommerce TID) or pos (physical terminal).
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(id: SKIP, mid: SKIP, daily_settlement: SKIP, settlement_period: SKIP, store_name: SKIP, type: SKIP, status: SKIP, additional_properties: nil) ⇒ Terminal
constructor
A new instance of Terminal.
-
#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(id: SKIP, mid: SKIP, daily_settlement: SKIP, settlement_period: SKIP, store_name: SKIP, type: SKIP, status: SKIP, additional_properties: nil) ⇒ Terminal
Returns a new instance of Terminal.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/models/terminal.rb', line 75 def initialize(id: SKIP, mid: SKIP, daily_settlement: SKIP, settlement_period: SKIP, store_name: SKIP, type: SKIP, status: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @id = id unless id == SKIP @mid = mid unless mid == SKIP @daily_settlement = daily_settlement unless daily_settlement == SKIP @settlement_period = settlement_period unless settlement_period == SKIP @store_name = store_name unless store_name == SKIP @type = type unless type == SKIP @status = status unless status == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#daily_settlement ⇒ TrueClass | FalseClass
If true, a separate payment is received each day. If false, a single payment is received on Monday for the entire weekend (Fri/Sat/Sun combined).
24 25 26 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/models/terminal.rb', line 24 def daily_settlement @daily_settlement end |
#id ⇒ String
Unique Terminal ID for the merchant, allocated by DNA Payments.
14 15 16 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/models/terminal.rb', line 14 def id @id end |
#mid ⇒ String
MID allocated by DNA Payments. Available only for the pos terminal type.
18 19 20 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/models/terminal.rb', line 18 def mid @mid end |
#settlement_period ⇒ Integer
Number of days after which settlement is processed for this merchant.
28 29 30 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/models/terminal.rb', line 28 def settlement_period @settlement_period end |
#status ⇒ Status
open: all operations allowed. suspended/pending-closure: merchant-initiated operations prohibited, settlements/disputes still allowed. closed: no activity allowed.
42 43 44 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/models/terminal.rb', line 42 def status @status end |
#store_name ⇒ String
Name of the merchant store provided during onboarding.
32 33 34 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/models/terminal.rb', line 32 def store_name @store_name end |
#type ⇒ Type
Type of terminal: ecom (Ecommerce TID) or pos (physical terminal).
36 37 38 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/models/terminal.rb', line 36 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 120 121 122 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/models/terminal.rb', line 92 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : SKIP mid = hash.key?('mid') ? hash['mid'] : SKIP daily_settlement = hash.key?('dailySettlement') ? hash['dailySettlement'] : SKIP settlement_period = hash.key?('settlementPeriod') ? hash['settlementPeriod'] : SKIP store_name = hash.key?('storeName') ? hash['storeName'] : SKIP type = hash.key?('type') ? hash['type'] : SKIP status = hash.key?('status') ? hash['status'] : 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. Terminal.new(id: id, mid: mid, daily_settlement: daily_settlement, settlement_period: settlement_period, store_name: store_name, type: type, status: status, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/models/terminal.rb', line 45 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['mid'] = 'mid' @_hash['daily_settlement'] = 'dailySettlement' @_hash['settlement_period'] = 'settlementPeriod' @_hash['store_name'] = 'storeName' @_hash['type'] = 'type' @_hash['status'] = 'status' @_hash end |
.nullables ⇒ Object
An array for nullable fields
71 72 73 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/models/terminal.rb', line 71 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/models/terminal.rb', line 58 def self.optionals %w[ id mid daily_settlement settlement_period store_name type status ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
133 134 135 136 137 138 139 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/models/terminal.rb', line 133 def inspect class_name = self.class.name.split('::').last "<#{class_name} id: #{@id.inspect}, mid: #{@mid.inspect}, daily_settlement:"\ " #{@daily_settlement.inspect}, settlement_period: #{@settlement_period.inspect},"\ " store_name: #{@store_name.inspect}, type: #{@type.inspect}, status: #{@status.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
125 126 127 128 129 130 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/models/terminal.rb', line 125 def to_s class_name = self.class.name.split('::').last "<#{class_name} id: #{@id}, mid: #{@mid}, daily_settlement: #{@daily_settlement},"\ " settlement_period: #{@settlement_period}, store_name: #{@store_name}, type: #{@type},"\ " status: #{@status}, additional_properties: #{@additional_properties}>" end |