apimatic-gp-sdk 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +28 -0
- data/README.md +155 -0
- data/bin/console +15 -0
- data/lib/batches/api_helper.rb +10 -0
- data/lib/batches/apis/base_api.rb +67 -0
- data/lib/batches/apis/close_a_batch_api.rb +111 -0
- data/lib/batches/apis/get_a_batch_api.rb +70 -0
- data/lib/batches/apis/get_transactions_within_a_batch_api.rb +69 -0
- data/lib/batches/client.rb +72 -0
- data/lib/batches/configuration.rb +166 -0
- data/lib/batches/exceptions/api_exception.rb +21 -0
- data/lib/batches/exceptions/batches400_error_exception.rb +61 -0
- data/lib/batches/exceptions/batches401_error_exception.rb +61 -0
- data/lib/batches/exceptions/batches403_error_exception.rb +61 -0
- data/lib/batches/exceptions/batches500_error_exception.rb +61 -0
- data/lib/batches/exceptions/batches501_error_exception.rb +61 -0
- data/lib/batches/exceptions/batches502_error_exception.rb +62 -0
- data/lib/batches/exceptions/batches504_error_exception.rb +61 -0
- data/lib/batches/exceptions/batches_transactions400_error_exception.rb +61 -0
- data/lib/batches/exceptions/batches_transactions401_error_exception.rb +61 -0
- data/lib/batches/exceptions/batches_transactions403_error_exception.rb +61 -0
- data/lib/batches/exceptions/batches_transactions500_error_exception.rb +61 -0
- data/lib/batches/exceptions/batches_transactions501_error_exception.rb +61 -0
- data/lib/batches/exceptions/batches_transactions502_error_exception.rb +62 -0
- data/lib/batches/exceptions/batches_transactions504_error_exception.rb +61 -0
- data/lib/batches/http/api_response.rb +19 -0
- data/lib/batches/http/http_call_back.rb +10 -0
- data/lib/batches/http/http_method_enum.rb +10 -0
- data/lib/batches/http/http_request.rb +10 -0
- data/lib/batches/http/http_response.rb +10 -0
- data/lib/batches/http/proxy_settings.rb +22 -0
- data/lib/batches/logging/configuration/api_logging_configuration.rb +186 -0
- data/lib/batches/logging/sdk_logger.rb +17 -0
- data/lib/batches/models/action.rb +125 -0
- data/lib/batches/models/authentication_invalid401.rb +102 -0
- data/lib/batches/models/avs_address_result_batches_transactions_payment_method_card_avs_address_result.rb +40 -0
- data/lib/batches/models/avs_postal_code_result_batches_transactions_payment_method_card_avs_postal_code_result.rb +40 -0
- data/lib/batches/models/base_model.rb +110 -0
- data/lib/batches/models/batches_request.rb +142 -0
- data/lib/batches/models/brand_batches_brand_breakdown_brand.rb +56 -0
- data/lib/batches/models/brand_batches_transactions_payment_method_card_brand.rb +56 -0
- data/lib/batches/models/brand_breakdown_item.rb +159 -0
- data/lib/batches/models/card.rb +170 -0
- data/lib/batches/models/channel_batches_channel.rb +44 -0
- data/lib/batches/models/close_response.rb +356 -0
- data/lib/batches/models/currency_batches_transactions_currency.rb +60 -0
- data/lib/batches/models/cvv_result_batches_transactions_payment_method_card_cvv_result.rb +40 -0
- data/lib/batches/models/detailed_error_code.rb +26 -0
- data/lib/batches/models/detailed_error_code1.rb +36 -0
- data/lib/batches/models/detailed_error_code2.rb +36 -0
- data/lib/batches/models/detailed_error_code3.rb +26 -0
- data/lib/batches/models/detailed_error_code4.rb +26 -0
- data/lib/batches/models/detailed_error_code5.rb +26 -0
- data/lib/batches/models/detailed_error_code6.rb +26 -0
- data/lib/batches/models/entry_mode_batches_transactions_payment_method_entry_mode.rb +104 -0
- data/lib/batches/models/error_code.rb +52 -0
- data/lib/batches/models/error_code1.rb +26 -0
- data/lib/batches/models/error_code2.rb +26 -0
- data/lib/batches/models/error_code3.rb +26 -0
- data/lib/batches/models/error_code4.rb +26 -0
- data/lib/batches/models/error_code5.rb +27 -0
- data/lib/batches/models/error_code6.rb +26 -0
- data/lib/batches/models/filter.rb +76 -0
- data/lib/batches/models/funding_batches_transactions_payment_method_card_funding.rb +59 -0
- data/lib/batches/models/funding_credit.rb +85 -0
- data/lib/batches/models/funding_credit1.rb +85 -0
- data/lib/batches/models/funding_credit5.rb +85 -0
- data/lib/batches/models/funding_debit.rb +85 -0
- data/lib/batches/models/funding_debit1.rb +85 -0
- data/lib/batches/models/funding_debit5.rb +85 -0
- data/lib/batches/models/get_response.rb +331 -0
- data/lib/batches/models/host_breakdown_item.rb +128 -0
- data/lib/batches/models/not_authorized403.rb +102 -0
- data/lib/batches/models/obj_request_invalid400.rb +102 -0
- data/lib/batches/models/payment_method.rb +167 -0
- data/lib/batches/models/payment_method2.rb +52 -0
- data/lib/batches/models/payment_methods_batches_payment_method.rb +52 -0
- data/lib/batches/models/refunds.rb +85 -0
- data/lib/batches/models/refunds1.rb +85 -0
- data/lib/batches/models/result_code_batches_action_result_code.rb +26 -0
- data/lib/batches/models/sales.rb +85 -0
- data/lib/batches/models/sales1.rb +85 -0
- data/lib/batches/models/server_error500.rb +102 -0
- data/lib/batches/models/server_timeout504.rb +102 -0
- data/lib/batches/models/status_batches_status.rb +38 -0
- data/lib/batches/models/status_batches_transactions_status.rb +39 -0
- data/lib/batches/models/transaction.rb +205 -0
- data/lib/batches/models/transaction_batch_response.rb +198 -0
- data/lib/batches/models/type_batches_action_type.rb +40 -0
- data/lib/batches/models/type_batches_transactions_type.rb +40 -0
- data/lib/batches/models/unknown_platform_error502.rb +103 -0
- data/lib/batches/models/unknown_server_error501.rb +102 -0
- data/lib/batches/utilities/date_time_helper.rb +11 -0
- data/lib/batches/utilities/file_wrapper.rb +28 -0
- data/lib/batches.rb +128 -0
- metadata +180 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# batches
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Batches
|
|
7
|
+
# FundingCredit5 Model.
|
|
8
|
+
class FundingCredit5 < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [Sales]
|
|
14
|
+
attr_accessor :sales
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for this method
|
|
17
|
+
# @return [Refunds]
|
|
18
|
+
attr_accessor :refunds
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['sales'] = 'sales'
|
|
24
|
+
@_hash['refunds'] = 'refunds'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
%w[
|
|
31
|
+
sales
|
|
32
|
+
refunds
|
|
33
|
+
]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for nullable fields
|
|
37
|
+
def self.nullables
|
|
38
|
+
[]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def initialize(sales: SKIP, refunds: SKIP, additional_properties: nil)
|
|
42
|
+
# Add additional model properties to the instance
|
|
43
|
+
additional_properties = {} if additional_properties.nil?
|
|
44
|
+
|
|
45
|
+
@sales = sales unless sales == SKIP
|
|
46
|
+
@refunds = refunds unless refunds == SKIP
|
|
47
|
+
@additional_properties = additional_properties
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Creates an instance of the object from a hash.
|
|
51
|
+
def self.from_hash(hash)
|
|
52
|
+
return nil unless hash
|
|
53
|
+
|
|
54
|
+
# Extract variables from the hash.
|
|
55
|
+
sales = Sales.from_hash(hash['sales']) if hash['sales']
|
|
56
|
+
refunds = Refunds.from_hash(hash['refunds']) if hash['refunds']
|
|
57
|
+
|
|
58
|
+
# Create a new hash for additional properties, removing known properties.
|
|
59
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
60
|
+
|
|
61
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
62
|
+
new_hash, proc { |value| value }
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
# Create object from extracted values.
|
|
66
|
+
FundingCredit5.new(sales: sales,
|
|
67
|
+
refunds: refunds,
|
|
68
|
+
additional_properties: additional_properties)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Provides a human-readable string representation of the object.
|
|
72
|
+
def to_s
|
|
73
|
+
class_name = self.class.name.split('::').last
|
|
74
|
+
"<#{class_name} sales: #{@sales}, refunds: #{@refunds}, additional_properties:"\
|
|
75
|
+
" #{@additional_properties}>"
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
79
|
+
def inspect
|
|
80
|
+
class_name = self.class.name.split('::').last
|
|
81
|
+
"<#{class_name} sales: #{@sales.inspect}, refunds: #{@refunds.inspect},"\
|
|
82
|
+
" additional_properties: #{@additional_properties}>"
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# batches
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Batches
|
|
7
|
+
# FundingDebit Model.
|
|
8
|
+
class FundingDebit < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# The total number of Debit card transactions.
|
|
13
|
+
# @return [Float]
|
|
14
|
+
attr_accessor :count
|
|
15
|
+
|
|
16
|
+
# The total amount of Debit card transactions.
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :amount
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['count'] = 'count'
|
|
24
|
+
@_hash['amount'] = 'amount'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
%w[
|
|
31
|
+
count
|
|
32
|
+
amount
|
|
33
|
+
]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for nullable fields
|
|
37
|
+
def self.nullables
|
|
38
|
+
[]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def initialize(count: SKIP, amount: SKIP, additional_properties: nil)
|
|
42
|
+
# Add additional model properties to the instance
|
|
43
|
+
additional_properties = {} if additional_properties.nil?
|
|
44
|
+
|
|
45
|
+
@count = count unless count == SKIP
|
|
46
|
+
@amount = amount unless amount == SKIP
|
|
47
|
+
@additional_properties = additional_properties
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Creates an instance of the object from a hash.
|
|
51
|
+
def self.from_hash(hash)
|
|
52
|
+
return nil unless hash
|
|
53
|
+
|
|
54
|
+
# Extract variables from the hash.
|
|
55
|
+
count = hash.key?('count') ? hash['count'] : SKIP
|
|
56
|
+
amount = hash.key?('amount') ? hash['amount'] : SKIP
|
|
57
|
+
|
|
58
|
+
# Create a new hash for additional properties, removing known properties.
|
|
59
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
60
|
+
|
|
61
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
62
|
+
new_hash, proc { |value| value }
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
# Create object from extracted values.
|
|
66
|
+
FundingDebit.new(count: count,
|
|
67
|
+
amount: amount,
|
|
68
|
+
additional_properties: additional_properties)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Provides a human-readable string representation of the object.
|
|
72
|
+
def to_s
|
|
73
|
+
class_name = self.class.name.split('::').last
|
|
74
|
+
"<#{class_name} count: #{@count}, amount: #{@amount}, additional_properties:"\
|
|
75
|
+
" #{@additional_properties}>"
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
79
|
+
def inspect
|
|
80
|
+
class_name = self.class.name.split('::').last
|
|
81
|
+
"<#{class_name} count: #{@count.inspect}, amount: #{@amount.inspect},"\
|
|
82
|
+
" additional_properties: #{@additional_properties}>"
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# batches
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Batches
|
|
7
|
+
# FundingDebit1 Model.
|
|
8
|
+
class FundingDebit1 < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# The total number of Debit card transactions for this brand.
|
|
13
|
+
# @return [Float]
|
|
14
|
+
attr_accessor :count
|
|
15
|
+
|
|
16
|
+
# The total amount of Debit card transactions for this brand.
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :amount
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['count'] = 'count'
|
|
24
|
+
@_hash['amount'] = 'amount'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
%w[
|
|
31
|
+
count
|
|
32
|
+
amount
|
|
33
|
+
]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for nullable fields
|
|
37
|
+
def self.nullables
|
|
38
|
+
[]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def initialize(count: SKIP, amount: SKIP, additional_properties: nil)
|
|
42
|
+
# Add additional model properties to the instance
|
|
43
|
+
additional_properties = {} if additional_properties.nil?
|
|
44
|
+
|
|
45
|
+
@count = count unless count == SKIP
|
|
46
|
+
@amount = amount unless amount == SKIP
|
|
47
|
+
@additional_properties = additional_properties
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Creates an instance of the object from a hash.
|
|
51
|
+
def self.from_hash(hash)
|
|
52
|
+
return nil unless hash
|
|
53
|
+
|
|
54
|
+
# Extract variables from the hash.
|
|
55
|
+
count = hash.key?('count') ? hash['count'] : SKIP
|
|
56
|
+
amount = hash.key?('amount') ? hash['amount'] : SKIP
|
|
57
|
+
|
|
58
|
+
# Create a new hash for additional properties, removing known properties.
|
|
59
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
60
|
+
|
|
61
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
62
|
+
new_hash, proc { |value| value }
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
# Create object from extracted values.
|
|
66
|
+
FundingDebit1.new(count: count,
|
|
67
|
+
amount: amount,
|
|
68
|
+
additional_properties: additional_properties)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Provides a human-readable string representation of the object.
|
|
72
|
+
def to_s
|
|
73
|
+
class_name = self.class.name.split('::').last
|
|
74
|
+
"<#{class_name} count: #{@count}, amount: #{@amount}, additional_properties:"\
|
|
75
|
+
" #{@additional_properties}>"
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
79
|
+
def inspect
|
|
80
|
+
class_name = self.class.name.split('::').last
|
|
81
|
+
"<#{class_name} count: #{@count.inspect}, amount: #{@amount.inspect},"\
|
|
82
|
+
" additional_properties: #{@additional_properties}>"
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# batches
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Batches
|
|
7
|
+
# FundingDebit5 Model.
|
|
8
|
+
class FundingDebit5 < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [Sales]
|
|
14
|
+
attr_accessor :sales
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for this method
|
|
17
|
+
# @return [Refunds]
|
|
18
|
+
attr_accessor :refunds
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['sales'] = 'sales'
|
|
24
|
+
@_hash['refunds'] = 'refunds'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
%w[
|
|
31
|
+
sales
|
|
32
|
+
refunds
|
|
33
|
+
]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for nullable fields
|
|
37
|
+
def self.nullables
|
|
38
|
+
[]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def initialize(sales: SKIP, refunds: SKIP, additional_properties: nil)
|
|
42
|
+
# Add additional model properties to the instance
|
|
43
|
+
additional_properties = {} if additional_properties.nil?
|
|
44
|
+
|
|
45
|
+
@sales = sales unless sales == SKIP
|
|
46
|
+
@refunds = refunds unless refunds == SKIP
|
|
47
|
+
@additional_properties = additional_properties
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Creates an instance of the object from a hash.
|
|
51
|
+
def self.from_hash(hash)
|
|
52
|
+
return nil unless hash
|
|
53
|
+
|
|
54
|
+
# Extract variables from the hash.
|
|
55
|
+
sales = Sales.from_hash(hash['sales']) if hash['sales']
|
|
56
|
+
refunds = Refunds.from_hash(hash['refunds']) if hash['refunds']
|
|
57
|
+
|
|
58
|
+
# Create a new hash for additional properties, removing known properties.
|
|
59
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
60
|
+
|
|
61
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
62
|
+
new_hash, proc { |value| value }
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
# Create object from extracted values.
|
|
66
|
+
FundingDebit5.new(sales: sales,
|
|
67
|
+
refunds: refunds,
|
|
68
|
+
additional_properties: additional_properties)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Provides a human-readable string representation of the object.
|
|
72
|
+
def to_s
|
|
73
|
+
class_name = self.class.name.split('::').last
|
|
74
|
+
"<#{class_name} sales: #{@sales}, refunds: #{@refunds}, additional_properties:"\
|
|
75
|
+
" #{@additional_properties}>"
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
79
|
+
def inspect
|
|
80
|
+
class_name = self.class.name.split('::').last
|
|
81
|
+
"<#{class_name} sales: #{@sales.inspect}, refunds: #{@refunds.inspect},"\
|
|
82
|
+
" additional_properties: #{@additional_properties}>"
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
# batches
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Batches
|
|
7
|
+
# GetResponse Model.
|
|
8
|
+
class GetResponse < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# A unique identifier for the object created by Global Payments. The first 3
|
|
13
|
+
# characters identifies the resource an id relates to.
|
|
14
|
+
# @return [String]
|
|
15
|
+
attr_accessor :id
|
|
16
|
+
|
|
17
|
+
# Indicates where a batch is in its life cycle. *`OPEN` - Batch is open and
|
|
18
|
+
# can accept more transactions.
|
|
19
|
+
# *`CLOSED` - Batch is closed and cannot accept more transactions.
|
|
20
|
+
# @return [StatusBatchesStatus]
|
|
21
|
+
attr_accessor :status
|
|
22
|
+
|
|
23
|
+
# Time indicating when the batch was created in ISO-8601 format..
|
|
24
|
+
# @return [String]
|
|
25
|
+
attr_accessor :time_created
|
|
26
|
+
|
|
27
|
+
# Time indicating when the batch was closed
|
|
28
|
+
# @return [String]
|
|
29
|
+
attr_accessor :time_closed
|
|
30
|
+
|
|
31
|
+
# An identifier generated by Global Payments to uniquely identify the action
|
|
32
|
+
# that opened the batch.
|
|
33
|
+
# @return [String]
|
|
34
|
+
attr_accessor :open_action_id
|
|
35
|
+
|
|
36
|
+
# An identifier generated by Global Payments to uniquely identify the action
|
|
37
|
+
# that closed the batch.
|
|
38
|
+
# @return [String]
|
|
39
|
+
attr_accessor :close_action_id
|
|
40
|
+
|
|
41
|
+
# A unique identifier that is used to identify and reference an instance of
|
|
42
|
+
# this resource. This id is used when actioning or referencing a specific
|
|
43
|
+
# merchant. Begins with the three letters, MER.
|
|
44
|
+
# @return [String]
|
|
45
|
+
attr_accessor :merchant_id
|
|
46
|
+
|
|
47
|
+
# A meaningful label that better identifies the merchant.
|
|
48
|
+
# @return [String]
|
|
49
|
+
attr_accessor :merchant_name
|
|
50
|
+
|
|
51
|
+
# A unique identifier that is used to identify and reference an instance of
|
|
52
|
+
# this resource. This id is used when actioning or referencing a specific
|
|
53
|
+
# account. Begins with the three letters, TRA.
|
|
54
|
+
# @return [String]
|
|
55
|
+
attr_accessor :account_id
|
|
56
|
+
|
|
57
|
+
# A meaningful label that better identifies the account.
|
|
58
|
+
# @return [String]
|
|
59
|
+
attr_accessor :account_name
|
|
60
|
+
|
|
61
|
+
# A reference for the location that created the batch.
|
|
62
|
+
# @return [String]
|
|
63
|
+
attr_accessor :site_reference
|
|
64
|
+
|
|
65
|
+
# A reference for the device that created the batch
|
|
66
|
+
# @return [String]
|
|
67
|
+
attr_accessor :device_reference
|
|
68
|
+
|
|
69
|
+
# The number of transactions in the batch.
|
|
70
|
+
# @return [Float]
|
|
71
|
+
attr_accessor :batch_transaction_count
|
|
72
|
+
|
|
73
|
+
# The batch amount that is an aggregation of all the transactions' amounts
|
|
74
|
+
# in the batch. It is always represented in the lowest denomination of the
|
|
75
|
+
# related currency.
|
|
76
|
+
# @return [String]
|
|
77
|
+
attr_accessor :amount
|
|
78
|
+
|
|
79
|
+
# The currency of the amount in ISO-4217(alpha-3)
|
|
80
|
+
# @return [String]
|
|
81
|
+
attr_accessor :currency
|
|
82
|
+
|
|
83
|
+
# The amount that is an aggregation of all the transactions' gratuity
|
|
84
|
+
# amounts in the batch. It is always represented in the lowest denomination
|
|
85
|
+
# of the related currency.
|
|
86
|
+
# @return [String]
|
|
87
|
+
attr_accessor :gratuity_amount
|
|
88
|
+
|
|
89
|
+
# The amount that is an aggregation of all the transactions' gratuity
|
|
90
|
+
# amounts in the batch. It is always represented in the lowest denomination
|
|
91
|
+
# of the related currency.
|
|
92
|
+
# @return [Sales]
|
|
93
|
+
attr_accessor :sales
|
|
94
|
+
|
|
95
|
+
# The amount that is an aggregation of all the transactions' gratuity
|
|
96
|
+
# amounts in the batch. It is always represented in the lowest denomination
|
|
97
|
+
# of the related currency.
|
|
98
|
+
# @return [Refunds]
|
|
99
|
+
attr_accessor :refunds
|
|
100
|
+
|
|
101
|
+
# The amount that is an aggregation of all the transactions' gratuity
|
|
102
|
+
# amounts in the batch. It is always represented in the lowest denomination
|
|
103
|
+
# of the related currency.
|
|
104
|
+
# @return [FundingDebit]
|
|
105
|
+
attr_accessor :funding_debit
|
|
106
|
+
|
|
107
|
+
# The amount that is an aggregation of all the transactions' gratuity
|
|
108
|
+
# amounts in the batch. It is always represented in the lowest denomination
|
|
109
|
+
# of the related currency.
|
|
110
|
+
# @return [FundingCredit]
|
|
111
|
+
attr_accessor :funding_credit
|
|
112
|
+
|
|
113
|
+
# The amount that is an aggregation of all the transactions' gratuity
|
|
114
|
+
# amounts in the batch. It is always represented in the lowest denomination
|
|
115
|
+
# of the related currency.
|
|
116
|
+
# @return [Array[BrandBreakdownItem]]
|
|
117
|
+
attr_accessor :brand_breakdown
|
|
118
|
+
|
|
119
|
+
# The amount that is an aggregation of all the transactions' gratuity
|
|
120
|
+
# amounts in the batch. It is always represented in the lowest denomination
|
|
121
|
+
# of the related currency.
|
|
122
|
+
# @return [Action]
|
|
123
|
+
attr_accessor :action
|
|
124
|
+
|
|
125
|
+
# A mapping from model property names to API property names.
|
|
126
|
+
def self.names
|
|
127
|
+
@_hash = {} if @_hash.nil?
|
|
128
|
+
@_hash['id'] = 'id'
|
|
129
|
+
@_hash['status'] = 'status'
|
|
130
|
+
@_hash['time_created'] = 'time_created'
|
|
131
|
+
@_hash['time_closed'] = 'time_closed'
|
|
132
|
+
@_hash['open_action_id'] = 'open_action_id'
|
|
133
|
+
@_hash['close_action_id'] = 'close_action_id'
|
|
134
|
+
@_hash['merchant_id'] = 'merchant_id'
|
|
135
|
+
@_hash['merchant_name'] = 'merchant_name'
|
|
136
|
+
@_hash['account_id'] = 'account_id'
|
|
137
|
+
@_hash['account_name'] = 'account_name'
|
|
138
|
+
@_hash['site_reference'] = 'site_reference'
|
|
139
|
+
@_hash['device_reference'] = 'device_reference'
|
|
140
|
+
@_hash['batch_transaction_count'] = 'batch_transaction_count'
|
|
141
|
+
@_hash['amount'] = 'amount'
|
|
142
|
+
@_hash['currency'] = 'currency'
|
|
143
|
+
@_hash['gratuity_amount'] = 'gratuity_amount'
|
|
144
|
+
@_hash['sales'] = 'sales'
|
|
145
|
+
@_hash['refunds'] = 'refunds'
|
|
146
|
+
@_hash['funding_debit'] = 'funding_debit'
|
|
147
|
+
@_hash['funding_credit'] = 'funding_credit'
|
|
148
|
+
@_hash['brand_breakdown'] = 'brand_breakdown'
|
|
149
|
+
@_hash['action'] = 'action'
|
|
150
|
+
@_hash
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# An array for optional fields
|
|
154
|
+
def self.optionals
|
|
155
|
+
%w[
|
|
156
|
+
id
|
|
157
|
+
status
|
|
158
|
+
time_created
|
|
159
|
+
time_closed
|
|
160
|
+
open_action_id
|
|
161
|
+
close_action_id
|
|
162
|
+
merchant_id
|
|
163
|
+
merchant_name
|
|
164
|
+
account_id
|
|
165
|
+
account_name
|
|
166
|
+
site_reference
|
|
167
|
+
device_reference
|
|
168
|
+
batch_transaction_count
|
|
169
|
+
amount
|
|
170
|
+
currency
|
|
171
|
+
gratuity_amount
|
|
172
|
+
sales
|
|
173
|
+
refunds
|
|
174
|
+
funding_debit
|
|
175
|
+
funding_credit
|
|
176
|
+
brand_breakdown
|
|
177
|
+
action
|
|
178
|
+
]
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# An array for nullable fields
|
|
182
|
+
def self.nullables
|
|
183
|
+
[]
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
def initialize(id: SKIP, status: SKIP, time_created: SKIP,
|
|
187
|
+
time_closed: SKIP, open_action_id: SKIP,
|
|
188
|
+
close_action_id: SKIP, merchant_id: SKIP,
|
|
189
|
+
merchant_name: SKIP, account_id: SKIP, account_name: SKIP,
|
|
190
|
+
site_reference: SKIP, device_reference: SKIP,
|
|
191
|
+
batch_transaction_count: SKIP, amount: SKIP, currency: SKIP,
|
|
192
|
+
gratuity_amount: SKIP, sales: SKIP, refunds: SKIP,
|
|
193
|
+
funding_debit: SKIP, funding_credit: SKIP,
|
|
194
|
+
brand_breakdown: SKIP, action: SKIP,
|
|
195
|
+
additional_properties: nil)
|
|
196
|
+
# Add additional model properties to the instance
|
|
197
|
+
additional_properties = {} if additional_properties.nil?
|
|
198
|
+
|
|
199
|
+
@id = id unless id == SKIP
|
|
200
|
+
@status = status unless status == SKIP
|
|
201
|
+
@time_created = time_created unless time_created == SKIP
|
|
202
|
+
@time_closed = time_closed unless time_closed == SKIP
|
|
203
|
+
@open_action_id = open_action_id unless open_action_id == SKIP
|
|
204
|
+
@close_action_id = close_action_id unless close_action_id == SKIP
|
|
205
|
+
@merchant_id = merchant_id unless merchant_id == SKIP
|
|
206
|
+
@merchant_name = merchant_name unless merchant_name == SKIP
|
|
207
|
+
@account_id = account_id unless account_id == SKIP
|
|
208
|
+
@account_name = account_name unless account_name == SKIP
|
|
209
|
+
@site_reference = site_reference unless site_reference == SKIP
|
|
210
|
+
@device_reference = device_reference unless device_reference == SKIP
|
|
211
|
+
@batch_transaction_count = batch_transaction_count unless batch_transaction_count == SKIP
|
|
212
|
+
@amount = amount unless amount == SKIP
|
|
213
|
+
@currency = currency unless currency == SKIP
|
|
214
|
+
@gratuity_amount = gratuity_amount unless gratuity_amount == SKIP
|
|
215
|
+
@sales = sales unless sales == SKIP
|
|
216
|
+
@refunds = refunds unless refunds == SKIP
|
|
217
|
+
@funding_debit = funding_debit unless funding_debit == SKIP
|
|
218
|
+
@funding_credit = funding_credit unless funding_credit == SKIP
|
|
219
|
+
@brand_breakdown = brand_breakdown unless brand_breakdown == SKIP
|
|
220
|
+
@action = action unless action == SKIP
|
|
221
|
+
@additional_properties = additional_properties
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
# Creates an instance of the object from a hash.
|
|
225
|
+
def self.from_hash(hash)
|
|
226
|
+
return nil unless hash
|
|
227
|
+
|
|
228
|
+
# Extract variables from the hash.
|
|
229
|
+
id = hash.key?('id') ? hash['id'] : SKIP
|
|
230
|
+
status = hash.key?('status') ? hash['status'] : SKIP
|
|
231
|
+
time_created = hash.key?('time_created') ? hash['time_created'] : SKIP
|
|
232
|
+
time_closed = hash.key?('time_closed') ? hash['time_closed'] : SKIP
|
|
233
|
+
open_action_id =
|
|
234
|
+
hash.key?('open_action_id') ? hash['open_action_id'] : SKIP
|
|
235
|
+
close_action_id =
|
|
236
|
+
hash.key?('close_action_id') ? hash['close_action_id'] : SKIP
|
|
237
|
+
merchant_id = hash.key?('merchant_id') ? hash['merchant_id'] : SKIP
|
|
238
|
+
merchant_name = hash.key?('merchant_name') ? hash['merchant_name'] : SKIP
|
|
239
|
+
account_id = hash.key?('account_id') ? hash['account_id'] : SKIP
|
|
240
|
+
account_name = hash.key?('account_name') ? hash['account_name'] : SKIP
|
|
241
|
+
site_reference =
|
|
242
|
+
hash.key?('site_reference') ? hash['site_reference'] : SKIP
|
|
243
|
+
device_reference =
|
|
244
|
+
hash.key?('device_reference') ? hash['device_reference'] : SKIP
|
|
245
|
+
batch_transaction_count =
|
|
246
|
+
hash.key?('batch_transaction_count') ? hash['batch_transaction_count'] : SKIP
|
|
247
|
+
amount = hash.key?('amount') ? hash['amount'] : SKIP
|
|
248
|
+
currency = hash.key?('currency') ? hash['currency'] : SKIP
|
|
249
|
+
gratuity_amount =
|
|
250
|
+
hash.key?('gratuity_amount') ? hash['gratuity_amount'] : SKIP
|
|
251
|
+
sales = Sales.from_hash(hash['sales']) if hash['sales']
|
|
252
|
+
refunds = Refunds.from_hash(hash['refunds']) if hash['refunds']
|
|
253
|
+
funding_debit = FundingDebit.from_hash(hash['funding_debit']) if hash['funding_debit']
|
|
254
|
+
funding_credit = FundingCredit.from_hash(hash['funding_credit']) if hash['funding_credit']
|
|
255
|
+
# Parameter is an array, so we need to iterate through it
|
|
256
|
+
brand_breakdown = nil
|
|
257
|
+
unless hash['brand_breakdown'].nil?
|
|
258
|
+
brand_breakdown = []
|
|
259
|
+
hash['brand_breakdown'].each do |structure|
|
|
260
|
+
brand_breakdown << (BrandBreakdownItem.from_hash(structure) if structure)
|
|
261
|
+
end
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
brand_breakdown = SKIP unless hash.key?('brand_breakdown')
|
|
265
|
+
action = Action.from_hash(hash['action']) if hash['action']
|
|
266
|
+
|
|
267
|
+
# Create a new hash for additional properties, removing known properties.
|
|
268
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
269
|
+
|
|
270
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
271
|
+
new_hash, proc { |value| value }
|
|
272
|
+
)
|
|
273
|
+
|
|
274
|
+
# Create object from extracted values.
|
|
275
|
+
GetResponse.new(id: id,
|
|
276
|
+
status: status,
|
|
277
|
+
time_created: time_created,
|
|
278
|
+
time_closed: time_closed,
|
|
279
|
+
open_action_id: open_action_id,
|
|
280
|
+
close_action_id: close_action_id,
|
|
281
|
+
merchant_id: merchant_id,
|
|
282
|
+
merchant_name: merchant_name,
|
|
283
|
+
account_id: account_id,
|
|
284
|
+
account_name: account_name,
|
|
285
|
+
site_reference: site_reference,
|
|
286
|
+
device_reference: device_reference,
|
|
287
|
+
batch_transaction_count: batch_transaction_count,
|
|
288
|
+
amount: amount,
|
|
289
|
+
currency: currency,
|
|
290
|
+
gratuity_amount: gratuity_amount,
|
|
291
|
+
sales: sales,
|
|
292
|
+
refunds: refunds,
|
|
293
|
+
funding_debit: funding_debit,
|
|
294
|
+
funding_credit: funding_credit,
|
|
295
|
+
brand_breakdown: brand_breakdown,
|
|
296
|
+
action: action,
|
|
297
|
+
additional_properties: additional_properties)
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
# Provides a human-readable string representation of the object.
|
|
301
|
+
def to_s
|
|
302
|
+
class_name = self.class.name.split('::').last
|
|
303
|
+
"<#{class_name} id: #{@id}, status: #{@status}, time_created: #{@time_created},"\
|
|
304
|
+
" time_closed: #{@time_closed}, open_action_id: #{@open_action_id}, close_action_id:"\
|
|
305
|
+
" #{@close_action_id}, merchant_id: #{@merchant_id}, merchant_name: #{@merchant_name},"\
|
|
306
|
+
" account_id: #{@account_id}, account_name: #{@account_name}, site_reference:"\
|
|
307
|
+
" #{@site_reference}, device_reference: #{@device_reference}, batch_transaction_count:"\
|
|
308
|
+
" #{@batch_transaction_count}, amount: #{@amount}, currency: #{@currency}, gratuity_amount:"\
|
|
309
|
+
" #{@gratuity_amount}, sales: #{@sales}, refunds: #{@refunds}, funding_debit:"\
|
|
310
|
+
" #{@funding_debit}, funding_credit: #{@funding_credit}, brand_breakdown:"\
|
|
311
|
+
" #{@brand_breakdown}, action: #{@action}, additional_properties:"\
|
|
312
|
+
" #{@additional_properties}>"
|
|
313
|
+
end
|
|
314
|
+
|
|
315
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
316
|
+
def inspect
|
|
317
|
+
class_name = self.class.name.split('::').last
|
|
318
|
+
"<#{class_name} id: #{@id.inspect}, status: #{@status.inspect}, time_created:"\
|
|
319
|
+
" #{@time_created.inspect}, time_closed: #{@time_closed.inspect}, open_action_id:"\
|
|
320
|
+
" #{@open_action_id.inspect}, close_action_id: #{@close_action_id.inspect}, merchant_id:"\
|
|
321
|
+
" #{@merchant_id.inspect}, merchant_name: #{@merchant_name.inspect}, account_id:"\
|
|
322
|
+
" #{@account_id.inspect}, account_name: #{@account_name.inspect}, site_reference:"\
|
|
323
|
+
" #{@site_reference.inspect}, device_reference: #{@device_reference.inspect},"\
|
|
324
|
+
" batch_transaction_count: #{@batch_transaction_count.inspect}, amount: #{@amount.inspect},"\
|
|
325
|
+
" currency: #{@currency.inspect}, gratuity_amount: #{@gratuity_amount.inspect}, sales:"\
|
|
326
|
+
" #{@sales.inspect}, refunds: #{@refunds.inspect}, funding_debit: #{@funding_debit.inspect},"\
|
|
327
|
+
" funding_credit: #{@funding_credit.inspect}, brand_breakdown: #{@brand_breakdown.inspect},"\
|
|
328
|
+
" action: #{@action.inspect}, additional_properties: #{@additional_properties}>"
|
|
329
|
+
end
|
|
330
|
+
end
|
|
331
|
+
end
|