Class: Batches::CloseResponse
- Defined in:
- lib/batches/models/close_response.rb
Overview
CloseResponse Model.
Instance Attribute Summary collapse
-
#account_id ⇒ String
A unique identifier that is used to identify and reference an instance of this resource.
-
#account_name ⇒ String
A meaningful label that better identifies the account.
-
#action ⇒ Action
The amount that is an aggregation of all the transactions' gratuity amounts in the batch.
-
#amount ⇒ String
The batch amount that is an aggregation of all the transactions' amounts in the batch.
-
#brand_breakdown ⇒ Array[BrandBreakdownItem]
The amount that is an aggregation of all the transactions' gratuity amounts in the batch.
-
#close_action_id ⇒ String
An identifier generated by Global Payments to uniquely identify the action that closed the batch.
-
#currency ⇒ String
The currency of the amount in ISO-4217(alpha-3).
-
#device_reference ⇒ String
A reference for the device that created the batch.
-
#funding_credit ⇒ FundingCredit
The amount that is an aggregation of all the transactions' gratuity amounts in the batch.
-
#funding_debit ⇒ FundingDebit
The amount that is an aggregation of all the transactions' gratuity amounts in the batch.
-
#gratuity_amount ⇒ String
The amount that is an aggregation of all the transactions' gratuity amounts in the batch.
-
#host_breakdown ⇒ HostBreakdownItem
The amount that is an aggregation of all the transactions' gratuity amounts in the batch.
-
#id ⇒ String
A unique identifier for the object created by Global Payments.
-
#merchant_id ⇒ String
A unique identifier that is used to identify and reference an instance of this resource.
-
#merchant_name ⇒ String
A meaningful label that better identifies the merchant.
-
#open_action_id ⇒ String
An identifier generated by Global Payments to uniquely identify the action that opened the batch.
-
#refunds ⇒ Refunds
The amount that is an aggregation of all the transactions' gratuity amounts in the batch.
-
#sales ⇒ Sales
The amount that is an aggregation of all the transactions' gratuity amounts in the batch.
-
#site_reference ⇒ String
A reference for the location that created the batch.
-
#status ⇒ StatusBatchesStatus
Indicates where a batch is in its life cycle.
-
#time_closed ⇒ String
Time indicating when the batch was closed.
-
#time_created ⇒ String
Time indicating when the batch was created in ISO-8601 format..
-
#time_last_updated ⇒ String
Global Payments time indicating when the batch was last updated in ISO-8601 format..
-
#transaction_count ⇒ Float
The number of transactions in the batch.
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, status: SKIP, time_created: SKIP, time_last_updated: SKIP, time_closed: SKIP, open_action_id: SKIP, close_action_id: SKIP, merchant_id: SKIP, merchant_name: SKIP, account_id: SKIP, account_name: SKIP, site_reference: SKIP, device_reference: SKIP, transaction_count: SKIP, amount: SKIP, currency: SKIP, gratuity_amount: SKIP, sales: SKIP, refunds: SKIP, funding_debit: SKIP, funding_credit: SKIP, brand_breakdown: SKIP, host_breakdown: SKIP, action: SKIP, additional_properties: nil) ⇒ CloseResponse
constructor
A new instance of CloseResponse.
-
#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, status: SKIP, time_created: SKIP, time_last_updated: SKIP, time_closed: SKIP, open_action_id: SKIP, close_action_id: SKIP, merchant_id: SKIP, merchant_name: SKIP, account_id: SKIP, account_name: SKIP, site_reference: SKIP, device_reference: SKIP, transaction_count: SKIP, amount: SKIP, currency: SKIP, gratuity_amount: SKIP, sales: SKIP, refunds: SKIP, funding_debit: SKIP, funding_credit: SKIP, brand_breakdown: SKIP, host_breakdown: SKIP, action: SKIP, additional_properties: nil) ⇒ CloseResponse
Returns a new instance of CloseResponse.
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 |
# File 'lib/batches/models/close_response.rb', line 201 def initialize(id: SKIP, status: SKIP, time_created: SKIP, time_last_updated: SKIP, time_closed: SKIP, open_action_id: SKIP, close_action_id: SKIP, merchant_id: SKIP, merchant_name: SKIP, account_id: SKIP, account_name: SKIP, site_reference: SKIP, device_reference: SKIP, transaction_count: SKIP, amount: SKIP, currency: SKIP, gratuity_amount: SKIP, sales: SKIP, refunds: SKIP, funding_debit: SKIP, funding_credit: SKIP, brand_breakdown: SKIP, host_breakdown: SKIP, action: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @id = id unless id == SKIP @status = status unless status == SKIP @time_created = time_created unless time_created == SKIP @time_last_updated = time_last_updated unless time_last_updated == SKIP @time_closed = time_closed unless time_closed == SKIP @open_action_id = open_action_id unless open_action_id == SKIP @close_action_id = close_action_id unless close_action_id == SKIP @merchant_id = merchant_id unless merchant_id == SKIP @merchant_name = merchant_name unless merchant_name == SKIP @account_id = account_id unless account_id == SKIP @account_name = account_name unless account_name == SKIP @site_reference = site_reference unless site_reference == SKIP @device_reference = device_reference unless device_reference == SKIP @transaction_count = transaction_count unless transaction_count == SKIP @amount = amount unless amount == SKIP @currency = currency unless currency == SKIP @gratuity_amount = gratuity_amount unless gratuity_amount == SKIP @sales = sales unless sales == SKIP @refunds = refunds unless refunds == SKIP @funding_debit = funding_debit unless funding_debit == SKIP @funding_credit = funding_credit unless funding_credit == SKIP @brand_breakdown = brand_breakdown unless brand_breakdown == SKIP @host_breakdown = host_breakdown unless host_breakdown == SKIP @action = action unless action == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#account_id ⇒ String
A unique identifier that is used to identify and reference an instance of this resource. This id is used when actioning or referencing a specific account. Begins with the three letters, TRA.
60 61 62 |
# File 'lib/batches/models/close_response.rb', line 60 def account_id @account_id end |
#account_name ⇒ String
A meaningful label that better identifies the account.
64 65 66 |
# File 'lib/batches/models/close_response.rb', line 64 def account_name @account_name end |
#action ⇒ Action
The amount that is an aggregation of all the transactions' gratuity amounts in the batch. It is always represented in the lowest denomination of the related currency.
134 135 136 |
# File 'lib/batches/models/close_response.rb', line 134 def action @action end |
#amount ⇒ String
The batch amount that is an aggregation of all the transactions' amounts in the batch. It is always represented in the lowest denomination of the related currency.
82 83 84 |
# File 'lib/batches/models/close_response.rb', line 82 def amount @amount end |
#brand_breakdown ⇒ Array[BrandBreakdownItem]
The amount that is an aggregation of all the transactions' gratuity amounts in the batch. It is always represented in the lowest denomination of the related currency.
122 123 124 |
# File 'lib/batches/models/close_response.rb', line 122 def brand_breakdown @brand_breakdown end |
#close_action_id ⇒ String
An identifier generated by Global Payments to uniquely identify the action that closed the batch.
44 45 46 |
# File 'lib/batches/models/close_response.rb', line 44 def close_action_id @close_action_id end |
#currency ⇒ String
The currency of the amount in ISO-4217(alpha-3)
86 87 88 |
# File 'lib/batches/models/close_response.rb', line 86 def currency @currency end |
#device_reference ⇒ String
A reference for the device that created the batch
72 73 74 |
# File 'lib/batches/models/close_response.rb', line 72 def device_reference @device_reference end |
#funding_credit ⇒ FundingCredit
The amount that is an aggregation of all the transactions' gratuity amounts in the batch. It is always represented in the lowest denomination of the related currency.
116 117 118 |
# File 'lib/batches/models/close_response.rb', line 116 def funding_credit @funding_credit end |
#funding_debit ⇒ FundingDebit
The amount that is an aggregation of all the transactions' gratuity amounts in the batch. It is always represented in the lowest denomination of the related currency.
110 111 112 |
# File 'lib/batches/models/close_response.rb', line 110 def funding_debit @funding_debit end |
#gratuity_amount ⇒ String
The amount that is an aggregation of all the transactions' gratuity amounts in the batch. It is always represented in the lowest denomination of the related currency.
92 93 94 |
# File 'lib/batches/models/close_response.rb', line 92 def gratuity_amount @gratuity_amount end |
#host_breakdown ⇒ HostBreakdownItem
The amount that is an aggregation of all the transactions' gratuity amounts in the batch. It is always represented in the lowest denomination of the related currency.
128 129 130 |
# File 'lib/batches/models/close_response.rb', line 128 def host_breakdown @host_breakdown end |
#id ⇒ String
A unique identifier for the object created by Global Payments. The first 3 characters identifies the resource an id relates to.
15 16 17 |
# File 'lib/batches/models/close_response.rb', line 15 def id @id end |
#merchant_id ⇒ String
A unique identifier that is used to identify and reference an instance of this resource. This id is used when actioning or referencing a specific merchant. Begins with the three letters, MER.
50 51 52 |
# File 'lib/batches/models/close_response.rb', line 50 def merchant_id @merchant_id end |
#merchant_name ⇒ String
A meaningful label that better identifies the merchant.
54 55 56 |
# File 'lib/batches/models/close_response.rb', line 54 def merchant_name @merchant_name end |
#open_action_id ⇒ String
An identifier generated by Global Payments to uniquely identify the action that opened the batch.
39 40 41 |
# File 'lib/batches/models/close_response.rb', line 39 def open_action_id @open_action_id end |
#refunds ⇒ Refunds
The amount that is an aggregation of all the transactions' gratuity amounts in the batch. It is always represented in the lowest denomination of the related currency.
104 105 106 |
# File 'lib/batches/models/close_response.rb', line 104 def refunds @refunds end |
#sales ⇒ Sales
The amount that is an aggregation of all the transactions' gratuity amounts in the batch. It is always represented in the lowest denomination of the related currency.
98 99 100 |
# File 'lib/batches/models/close_response.rb', line 98 def sales @sales end |
#site_reference ⇒ String
A reference for the location that created the batch.
68 69 70 |
# File 'lib/batches/models/close_response.rb', line 68 def site_reference @site_reference end |
#status ⇒ StatusBatchesStatus
Indicates where a batch is in its life cycle. *OPEN - Batch is open and
can accept more transactions.
*CLOSED - Batch is closed and cannot accept more transactions.
21 22 23 |
# File 'lib/batches/models/close_response.rb', line 21 def status @status end |
#time_closed ⇒ String
Time indicating when the batch was closed
34 35 36 |
# File 'lib/batches/models/close_response.rb', line 34 def time_closed @time_closed end |
#time_created ⇒ String
Time indicating when the batch was created in ISO-8601 format..
25 26 27 |
# File 'lib/batches/models/close_response.rb', line 25 def time_created @time_created end |
#time_last_updated ⇒ String
Global Payments time indicating when the batch was last updated in ISO-8601 format..
30 31 32 |
# File 'lib/batches/models/close_response.rb', line 30 def time_last_updated @time_last_updated end |
#transaction_count ⇒ Float
The number of transactions in the batch.
76 77 78 |
# File 'lib/batches/models/close_response.rb', line 76 def transaction_count @transaction_count end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 |
# File 'lib/batches/models/close_response.rb', line 243 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : SKIP status = hash.key?('status') ? hash['status'] : SKIP time_created = hash.key?('time_created') ? hash['time_created'] : SKIP time_last_updated = hash.key?('time_last_updated') ? hash['time_last_updated'] : SKIP time_closed = hash.key?('time_closed') ? hash['time_closed'] : SKIP open_action_id = hash.key?('open_action_id') ? hash['open_action_id'] : SKIP close_action_id = hash.key?('close_action_id') ? hash['close_action_id'] : SKIP merchant_id = hash.key?('merchant_id') ? hash['merchant_id'] : SKIP merchant_name = hash.key?('merchant_name') ? hash['merchant_name'] : SKIP account_id = hash.key?('account_id') ? hash['account_id'] : SKIP account_name = hash.key?('account_name') ? hash['account_name'] : SKIP site_reference = hash.key?('site_reference') ? hash['site_reference'] : SKIP device_reference = hash.key?('device_reference') ? hash['device_reference'] : SKIP transaction_count = hash.key?('transaction_count') ? hash['transaction_count'] : SKIP amount = hash.key?('amount') ? hash['amount'] : SKIP currency = hash.key?('currency') ? hash['currency'] : SKIP gratuity_amount = hash.key?('gratuity_amount') ? hash['gratuity_amount'] : SKIP sales = Sales.from_hash(hash['sales']) if hash['sales'] refunds = Refunds.from_hash(hash['refunds']) if hash['refunds'] funding_debit = FundingDebit.from_hash(hash['funding_debit']) if hash['funding_debit'] funding_credit = FundingCredit.from_hash(hash['funding_credit']) if hash['funding_credit'] # Parameter is an array, so we need to iterate through it brand_breakdown = nil unless hash['brand_breakdown'].nil? brand_breakdown = [] hash['brand_breakdown'].each do |structure| brand_breakdown << (BrandBreakdownItem.from_hash(structure) if structure) end end brand_breakdown = SKIP unless hash.key?('brand_breakdown') host_breakdown = HostBreakdownItem.from_hash(hash['host_breakdown']) if hash['host_breakdown'] action = Action.from_hash(hash['action']) if hash['action'] # 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. CloseResponse.new(id: id, status: status, time_created: time_created, time_last_updated: time_last_updated, time_closed: time_closed, open_action_id: open_action_id, close_action_id: close_action_id, merchant_id: merchant_id, merchant_name: merchant_name, account_id: account_id, account_name: account_name, site_reference: site_reference, device_reference: device_reference, transaction_count: transaction_count, amount: amount, currency: currency, gratuity_amount: gratuity_amount, sales: sales, refunds: refunds, funding_debit: funding_debit, funding_credit: funding_credit, brand_breakdown: brand_breakdown, host_breakdown: host_breakdown, action: action, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
# File 'lib/batches/models/close_response.rb', line 137 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['status'] = 'status' @_hash['time_created'] = 'time_created' @_hash['time_last_updated'] = 'time_last_updated' @_hash['time_closed'] = 'time_closed' @_hash['open_action_id'] = 'open_action_id' @_hash['close_action_id'] = 'close_action_id' @_hash['merchant_id'] = 'merchant_id' @_hash['merchant_name'] = 'merchant_name' @_hash['account_id'] = 'account_id' @_hash['account_name'] = 'account_name' @_hash['site_reference'] = 'site_reference' @_hash['device_reference'] = 'device_reference' @_hash['transaction_count'] = 'transaction_count' @_hash['amount'] = 'amount' @_hash['currency'] = 'currency' @_hash['gratuity_amount'] = 'gratuity_amount' @_hash['sales'] = 'sales' @_hash['refunds'] = 'refunds' @_hash['funding_debit'] = 'funding_debit' @_hash['funding_credit'] = 'funding_credit' @_hash['brand_breakdown'] = 'brand_breakdown' @_hash['host_breakdown'] = 'host_breakdown' @_hash['action'] = 'action' @_hash end |
.nullables ⇒ Object
An array for nullable fields
197 198 199 |
# File 'lib/batches/models/close_response.rb', line 197 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/batches/models/close_response.rb', line 167 def self.optionals %w[ id status time_created time_last_updated time_closed open_action_id close_action_id merchant_id merchant_name account_id account_name site_reference device_reference transaction_count amount currency gratuity_amount sales refunds funding_debit funding_credit brand_breakdown host_breakdown action ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 |
# File 'lib/batches/models/close_response.rb', line 340 def inspect class_name = self.class.name.split('::').last "<#{class_name} id: #{@id.inspect}, status: #{@status.inspect}, time_created:"\ " #{@time_created.inspect}, time_last_updated: #{@time_last_updated.inspect}, time_closed:"\ " #{@time_closed.inspect}, open_action_id: #{@open_action_id.inspect}, close_action_id:"\ " #{@close_action_id.inspect}, merchant_id: #{@merchant_id.inspect}, merchant_name:"\ " #{@merchant_name.inspect}, account_id: #{@account_id.inspect}, account_name:"\ " #{@account_name.inspect}, site_reference: #{@site_reference.inspect}, device_reference:"\ " #{@device_reference.inspect}, transaction_count: #{@transaction_count.inspect}, amount:"\ " #{@amount.inspect}, currency: #{@currency.inspect}, gratuity_amount:"\ " #{@gratuity_amount.inspect}, sales: #{@sales.inspect}, refunds: #{@refunds.inspect},"\ " funding_debit: #{@funding_debit.inspect}, funding_credit: #{@funding_credit.inspect},"\ " brand_breakdown: #{@brand_breakdown.inspect}, host_breakdown: #{@host_breakdown.inspect},"\ " action: #{@action.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
325 326 327 328 329 330 331 332 333 334 335 336 337 |
# File 'lib/batches/models/close_response.rb', line 325 def to_s class_name = self.class.name.split('::').last "<#{class_name} id: #{@id}, status: #{@status}, time_created: #{@time_created},"\ " time_last_updated: #{@time_last_updated}, time_closed: #{@time_closed}, open_action_id:"\ " #{@open_action_id}, close_action_id: #{@close_action_id}, merchant_id: #{@merchant_id},"\ " merchant_name: #{@merchant_name}, account_id: #{@account_id}, account_name:"\ " #{@account_name}, site_reference: #{@site_reference}, device_reference:"\ " #{@device_reference}, transaction_count: #{@transaction_count}, amount: #{@amount},"\ " currency: #{@currency}, gratuity_amount: #{@gratuity_amount}, sales: #{@sales}, refunds:"\ " #{@refunds}, funding_debit: #{@funding_debit}, funding_credit: #{@funding_credit},"\ " brand_breakdown: #{@brand_breakdown}, host_breakdown: #{@host_breakdown}, action:"\ " #{@action}, additional_properties: #{@additional_properties}>" end |