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,128 @@
|
|
|
1
|
+
# batches
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Batches
|
|
7
|
+
# HostBreakdownItem Model.
|
|
8
|
+
class HostBreakdownItem < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# The merchant name that is associated with the batch.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :merchant_name
|
|
15
|
+
|
|
16
|
+
# A reference for the batch from the host.
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :reference
|
|
19
|
+
|
|
20
|
+
# The batch amount that is an aggregation of all the transactions' amounts
|
|
21
|
+
# in the batch. It is always represented in the lowest denomination of the
|
|
22
|
+
# related currency.
|
|
23
|
+
# @return [String]
|
|
24
|
+
attr_accessor :amount
|
|
25
|
+
|
|
26
|
+
# The number of transactions in the batch.
|
|
27
|
+
# @return [Float]
|
|
28
|
+
attr_accessor :count
|
|
29
|
+
|
|
30
|
+
# The number of transactions in the batch.
|
|
31
|
+
# @return [FundingDebit5]
|
|
32
|
+
attr_accessor :funding_debit
|
|
33
|
+
|
|
34
|
+
# The number of transactions in the batch.
|
|
35
|
+
# @return [FundingCredit5]
|
|
36
|
+
attr_accessor :funding_credit
|
|
37
|
+
|
|
38
|
+
# A mapping from model property names to API property names.
|
|
39
|
+
def self.names
|
|
40
|
+
@_hash = {} if @_hash.nil?
|
|
41
|
+
@_hash['merchant_name'] = 'merchant_name'
|
|
42
|
+
@_hash['reference'] = 'reference'
|
|
43
|
+
@_hash['amount'] = 'amount'
|
|
44
|
+
@_hash['count'] = 'count'
|
|
45
|
+
@_hash['funding_debit'] = 'funding_debit'
|
|
46
|
+
@_hash['funding_credit'] = 'funding_credit'
|
|
47
|
+
@_hash
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# An array for optional fields
|
|
51
|
+
def self.optionals
|
|
52
|
+
%w[
|
|
53
|
+
merchant_name
|
|
54
|
+
reference
|
|
55
|
+
amount
|
|
56
|
+
count
|
|
57
|
+
funding_debit
|
|
58
|
+
funding_credit
|
|
59
|
+
]
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# An array for nullable fields
|
|
63
|
+
def self.nullables
|
|
64
|
+
[]
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def initialize(merchant_name: SKIP, reference: SKIP, amount: SKIP,
|
|
68
|
+
count: SKIP, funding_debit: SKIP, funding_credit: SKIP,
|
|
69
|
+
additional_properties: nil)
|
|
70
|
+
# Add additional model properties to the instance
|
|
71
|
+
additional_properties = {} if additional_properties.nil?
|
|
72
|
+
|
|
73
|
+
@merchant_name = merchant_name unless merchant_name == SKIP
|
|
74
|
+
@reference = reference unless reference == SKIP
|
|
75
|
+
@amount = amount unless amount == SKIP
|
|
76
|
+
@count = count unless count == SKIP
|
|
77
|
+
@funding_debit = funding_debit unless funding_debit == SKIP
|
|
78
|
+
@funding_credit = funding_credit unless funding_credit == SKIP
|
|
79
|
+
@additional_properties = additional_properties
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Creates an instance of the object from a hash.
|
|
83
|
+
def self.from_hash(hash)
|
|
84
|
+
return nil unless hash
|
|
85
|
+
|
|
86
|
+
# Extract variables from the hash.
|
|
87
|
+
merchant_name = hash.key?('merchant_name') ? hash['merchant_name'] : SKIP
|
|
88
|
+
reference = hash.key?('reference') ? hash['reference'] : SKIP
|
|
89
|
+
amount = hash.key?('amount') ? hash['amount'] : SKIP
|
|
90
|
+
count = hash.key?('count') ? hash['count'] : SKIP
|
|
91
|
+
funding_debit = FundingDebit5.from_hash(hash['funding_debit']) if hash['funding_debit']
|
|
92
|
+
funding_credit = FundingCredit5.from_hash(hash['funding_credit']) if hash['funding_credit']
|
|
93
|
+
|
|
94
|
+
# Create a new hash for additional properties, removing known properties.
|
|
95
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
96
|
+
|
|
97
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
98
|
+
new_hash, proc { |value| value }
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
# Create object from extracted values.
|
|
102
|
+
HostBreakdownItem.new(merchant_name: merchant_name,
|
|
103
|
+
reference: reference,
|
|
104
|
+
amount: amount,
|
|
105
|
+
count: count,
|
|
106
|
+
funding_debit: funding_debit,
|
|
107
|
+
funding_credit: funding_credit,
|
|
108
|
+
additional_properties: additional_properties)
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Provides a human-readable string representation of the object.
|
|
112
|
+
def to_s
|
|
113
|
+
class_name = self.class.name.split('::').last
|
|
114
|
+
"<#{class_name} merchant_name: #{@merchant_name}, reference: #{@reference}, amount:"\
|
|
115
|
+
" #{@amount}, count: #{@count}, funding_debit: #{@funding_debit}, funding_credit:"\
|
|
116
|
+
" #{@funding_credit}, additional_properties: #{@additional_properties}>"
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
120
|
+
def inspect
|
|
121
|
+
class_name = self.class.name.split('::').last
|
|
122
|
+
"<#{class_name} merchant_name: #{@merchant_name.inspect}, reference: #{@reference.inspect},"\
|
|
123
|
+
" amount: #{@amount.inspect}, count: #{@count.inspect}, funding_debit:"\
|
|
124
|
+
" #{@funding_debit.inspect}, funding_credit: #{@funding_credit.inspect},"\
|
|
125
|
+
" additional_properties: #{@additional_properties}>"
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
end
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# batches
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Batches
|
|
7
|
+
# Forbidden
|
|
8
|
+
class NotAuthorized403 < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# This action is not authorized with the credentials being used.
|
|
13
|
+
# @return [ErrorCode2]
|
|
14
|
+
attr_accessor :error_code
|
|
15
|
+
|
|
16
|
+
# Unique reference to identify the error.
|
|
17
|
+
# @return [DetailedErrorCode2]
|
|
18
|
+
attr_accessor :detailed_error_code
|
|
19
|
+
|
|
20
|
+
# Unique Text describing the specific error.
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :detailed_error_description
|
|
23
|
+
|
|
24
|
+
# A mapping from model property names to API property names.
|
|
25
|
+
def self.names
|
|
26
|
+
@_hash = {} if @_hash.nil?
|
|
27
|
+
@_hash['error_code'] = 'error_code'
|
|
28
|
+
@_hash['detailed_error_code'] = 'detailed_error_code'
|
|
29
|
+
@_hash['detailed_error_description'] = 'detailed_error_description'
|
|
30
|
+
@_hash
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# An array for optional fields
|
|
34
|
+
def self.optionals
|
|
35
|
+
%w[
|
|
36
|
+
error_code
|
|
37
|
+
detailed_error_code
|
|
38
|
+
detailed_error_description
|
|
39
|
+
]
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# An array for nullable fields
|
|
43
|
+
def self.nullables
|
|
44
|
+
[]
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def initialize(error_code: SKIP, detailed_error_code: SKIP,
|
|
48
|
+
detailed_error_description: SKIP, additional_properties: nil)
|
|
49
|
+
# Add additional model properties to the instance
|
|
50
|
+
additional_properties = {} if additional_properties.nil?
|
|
51
|
+
|
|
52
|
+
@error_code = error_code unless error_code == SKIP
|
|
53
|
+
@detailed_error_code = detailed_error_code unless detailed_error_code == SKIP
|
|
54
|
+
unless detailed_error_description == SKIP
|
|
55
|
+
@detailed_error_description =
|
|
56
|
+
detailed_error_description
|
|
57
|
+
end
|
|
58
|
+
@additional_properties = additional_properties
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Creates an instance of the object from a hash.
|
|
62
|
+
def self.from_hash(hash)
|
|
63
|
+
return nil unless hash
|
|
64
|
+
|
|
65
|
+
# Extract variables from the hash.
|
|
66
|
+
error_code = hash.key?('error_code') ? hash['error_code'] : SKIP
|
|
67
|
+
detailed_error_code =
|
|
68
|
+
hash.key?('detailed_error_code') ? hash['detailed_error_code'] : SKIP
|
|
69
|
+
detailed_error_description =
|
|
70
|
+
hash.key?('detailed_error_description') ? hash['detailed_error_description'] : SKIP
|
|
71
|
+
|
|
72
|
+
# Create a new hash for additional properties, removing known properties.
|
|
73
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
74
|
+
|
|
75
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
76
|
+
new_hash, proc { |value| value }
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
# Create object from extracted values.
|
|
80
|
+
NotAuthorized403.new(error_code: error_code,
|
|
81
|
+
detailed_error_code: detailed_error_code,
|
|
82
|
+
detailed_error_description: detailed_error_description,
|
|
83
|
+
additional_properties: additional_properties)
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Provides a human-readable string representation of the object.
|
|
87
|
+
def to_s
|
|
88
|
+
class_name = self.class.name.split('::').last
|
|
89
|
+
"<#{class_name} error_code: #{@error_code}, detailed_error_code: #{@detailed_error_code},"\
|
|
90
|
+
" detailed_error_description: #{@detailed_error_description}, additional_properties:"\
|
|
91
|
+
" #{@additional_properties}>"
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
95
|
+
def inspect
|
|
96
|
+
class_name = self.class.name.split('::').last
|
|
97
|
+
"<#{class_name} error_code: #{@error_code.inspect}, detailed_error_code:"\
|
|
98
|
+
" #{@detailed_error_code.inspect}, detailed_error_description:"\
|
|
99
|
+
" #{@detailed_error_description.inspect}, additional_properties: #{@additional_properties}>"
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# batches
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Batches
|
|
7
|
+
# Bad Request
|
|
8
|
+
class ObjRequestInvalid400 < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# This indicates an issue with the API request.
|
|
13
|
+
# @return [ErrorCode]
|
|
14
|
+
attr_accessor :error_code
|
|
15
|
+
|
|
16
|
+
# Unique reference to identify the error.
|
|
17
|
+
# @return [DetailedErrorCode]
|
|
18
|
+
attr_accessor :detailed_error_code
|
|
19
|
+
|
|
20
|
+
# Unique Text describing the specific error.
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :detailed_error_description
|
|
23
|
+
|
|
24
|
+
# A mapping from model property names to API property names.
|
|
25
|
+
def self.names
|
|
26
|
+
@_hash = {} if @_hash.nil?
|
|
27
|
+
@_hash['error_code'] = 'error_code'
|
|
28
|
+
@_hash['detailed_error_code'] = 'detailed_error_code'
|
|
29
|
+
@_hash['detailed_error_description'] = 'detailed_error_description'
|
|
30
|
+
@_hash
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# An array for optional fields
|
|
34
|
+
def self.optionals
|
|
35
|
+
%w[
|
|
36
|
+
error_code
|
|
37
|
+
detailed_error_code
|
|
38
|
+
detailed_error_description
|
|
39
|
+
]
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# An array for nullable fields
|
|
43
|
+
def self.nullables
|
|
44
|
+
[]
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def initialize(error_code: SKIP, detailed_error_code: SKIP,
|
|
48
|
+
detailed_error_description: SKIP, additional_properties: nil)
|
|
49
|
+
# Add additional model properties to the instance
|
|
50
|
+
additional_properties = {} if additional_properties.nil?
|
|
51
|
+
|
|
52
|
+
@error_code = error_code unless error_code == SKIP
|
|
53
|
+
@detailed_error_code = detailed_error_code unless detailed_error_code == SKIP
|
|
54
|
+
unless detailed_error_description == SKIP
|
|
55
|
+
@detailed_error_description =
|
|
56
|
+
detailed_error_description
|
|
57
|
+
end
|
|
58
|
+
@additional_properties = additional_properties
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Creates an instance of the object from a hash.
|
|
62
|
+
def self.from_hash(hash)
|
|
63
|
+
return nil unless hash
|
|
64
|
+
|
|
65
|
+
# Extract variables from the hash.
|
|
66
|
+
error_code = hash.key?('error_code') ? hash['error_code'] : SKIP
|
|
67
|
+
detailed_error_code =
|
|
68
|
+
hash.key?('detailed_error_code') ? hash['detailed_error_code'] : SKIP
|
|
69
|
+
detailed_error_description =
|
|
70
|
+
hash.key?('detailed_error_description') ? hash['detailed_error_description'] : SKIP
|
|
71
|
+
|
|
72
|
+
# Create a new hash for additional properties, removing known properties.
|
|
73
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
74
|
+
|
|
75
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
76
|
+
new_hash, proc { |value| value }
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
# Create object from extracted values.
|
|
80
|
+
ObjRequestInvalid400.new(error_code: error_code,
|
|
81
|
+
detailed_error_code: detailed_error_code,
|
|
82
|
+
detailed_error_description: detailed_error_description,
|
|
83
|
+
additional_properties: additional_properties)
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Provides a human-readable string representation of the object.
|
|
87
|
+
def to_s
|
|
88
|
+
class_name = self.class.name.split('::').last
|
|
89
|
+
"<#{class_name} error_code: #{@error_code}, detailed_error_code: #{@detailed_error_code},"\
|
|
90
|
+
" detailed_error_description: #{@detailed_error_description}, additional_properties:"\
|
|
91
|
+
" #{@additional_properties}>"
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
95
|
+
def inspect
|
|
96
|
+
class_name = self.class.name.split('::').last
|
|
97
|
+
"<#{class_name} error_code: #{@error_code.inspect}, detailed_error_code:"\
|
|
98
|
+
" #{@detailed_error_code.inspect}, detailed_error_description:"\
|
|
99
|
+
" #{@detailed_error_description.inspect}, additional_properties: #{@additional_properties}>"
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# batches
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Batches
|
|
7
|
+
# PaymentMethod Model.
|
|
8
|
+
class PaymentMethod < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# The name of the owner of the payment method
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :name
|
|
15
|
+
|
|
16
|
+
# Indicates how the payment method information was obtained by the Merchant
|
|
17
|
+
# for this transaction.
|
|
18
|
+
# * `MOTO` - A CNP channel entry mode where the
|
|
19
|
+
# payment method information was obtained over the phone or via postal mail.
|
|
20
|
+
#
|
|
21
|
+
# * `ECOM` - A CNP channel entry mode where the
|
|
22
|
+
# payment method was obtained via a browser.
|
|
23
|
+
# * `IN_APP` - A CNP channel entry mode where the
|
|
24
|
+
# payment method was obtained via an application and applies to digital
|
|
25
|
+
# wallets only.
|
|
26
|
+
# * `CHIP` - A CP channel entry mode where the
|
|
27
|
+
# payment method information was obtained from a chip. E.g. card is inserted
|
|
28
|
+
# into a device to read the chip.
|
|
29
|
+
# * `SWIPE` - A CP channel entry mode where the
|
|
30
|
+
# payment method information was obtained from swiping a magnetic strip.
|
|
31
|
+
# E.g. card's magnetic strip is swiped through a device to read the card
|
|
32
|
+
# information.
|
|
33
|
+
# * `MANUAL` - A CP channel entry mode where the
|
|
34
|
+
# payment method information was obtained by manually keying the payment
|
|
35
|
+
# method information into the device.
|
|
36
|
+
# * `CONTACTLESS_CHIP` - A CP channel entry mode
|
|
37
|
+
# where the payment method information was obtained by bringing the payment
|
|
38
|
+
# method to close proximity of a device. E.g. tap a card on or near a device
|
|
39
|
+
# to exchange card information.
|
|
40
|
+
# * `CONTACTLESS_SWIPE` - A CP channel entry mode
|
|
41
|
+
# where the payment method information was obtained by bringing the payment
|
|
42
|
+
# method to close proximity of a device and also swiping the card. E.g. tap
|
|
43
|
+
# a card on or near a device and swipe it through device to exchange card
|
|
44
|
+
# information
|
|
45
|
+
# * `PHONE` - A CNP channel entry mode where the
|
|
46
|
+
# payment method was obtained over the phone.
|
|
47
|
+
# * `MAIL` - A CNP channel entry mode where the
|
|
48
|
+
# payment method was obtained via postal mail.
|
|
49
|
+
# * `PRESENT`- The entry mode cannot be determined
|
|
50
|
+
# but it is a Customer Present transaction.
|
|
51
|
+
# * `UNKNOWN` - The entry mode for this transaction
|
|
52
|
+
# cannot be determined.
|
|
53
|
+
# @return [EntryModeBatchesTransactionsPaymentMethodEntryMode]
|
|
54
|
+
attr_accessor :entry_mode
|
|
55
|
+
|
|
56
|
+
# Indicates how the payment method information was obtained by the Merchant
|
|
57
|
+
# for this transaction.
|
|
58
|
+
# * `MOTO` - A CNP channel entry mode where the
|
|
59
|
+
# payment method information was obtained over the phone or via postal mail.
|
|
60
|
+
#
|
|
61
|
+
# * `ECOM` - A CNP channel entry mode where the
|
|
62
|
+
# payment method was obtained via a browser.
|
|
63
|
+
# * `IN_APP` - A CNP channel entry mode where the
|
|
64
|
+
# payment method was obtained via an application and applies to digital
|
|
65
|
+
# wallets only.
|
|
66
|
+
# * `CHIP` - A CP channel entry mode where the
|
|
67
|
+
# payment method information was obtained from a chip. E.g. card is inserted
|
|
68
|
+
# into a device to read the chip.
|
|
69
|
+
# * `SWIPE` - A CP channel entry mode where the
|
|
70
|
+
# payment method information was obtained from swiping a magnetic strip.
|
|
71
|
+
# E.g. card's magnetic strip is swiped through a device to read the card
|
|
72
|
+
# information.
|
|
73
|
+
# * `MANUAL` - A CP channel entry mode where the
|
|
74
|
+
# payment method information was obtained by manually keying the payment
|
|
75
|
+
# method information into the device.
|
|
76
|
+
# * `CONTACTLESS_CHIP` - A CP channel entry mode
|
|
77
|
+
# where the payment method information was obtained by bringing the payment
|
|
78
|
+
# method to close proximity of a device. E.g. tap a card on or near a device
|
|
79
|
+
# to exchange card information.
|
|
80
|
+
# * `CONTACTLESS_SWIPE` - A CP channel entry mode
|
|
81
|
+
# where the payment method information was obtained by bringing the payment
|
|
82
|
+
# method to close proximity of a device and also swiping the card. E.g. tap
|
|
83
|
+
# a card on or near a device and swipe it through device to exchange card
|
|
84
|
+
# information
|
|
85
|
+
# * `PHONE` - A CNP channel entry mode where the
|
|
86
|
+
# payment method was obtained over the phone.
|
|
87
|
+
# * `MAIL` - A CNP channel entry mode where the
|
|
88
|
+
# payment method was obtained via postal mail.
|
|
89
|
+
# * `PRESENT`- The entry mode cannot be determined
|
|
90
|
+
# but it is a Customer Present transaction.
|
|
91
|
+
# * `UNKNOWN` - The entry mode for this transaction
|
|
92
|
+
# cannot be determined.
|
|
93
|
+
# @return [Card]
|
|
94
|
+
attr_accessor :card
|
|
95
|
+
|
|
96
|
+
# A mapping from model property names to API property names.
|
|
97
|
+
def self.names
|
|
98
|
+
@_hash = {} if @_hash.nil?
|
|
99
|
+
@_hash['name'] = 'name'
|
|
100
|
+
@_hash['entry_mode'] = 'entry_mode'
|
|
101
|
+
@_hash['card'] = 'card'
|
|
102
|
+
@_hash
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# An array for optional fields
|
|
106
|
+
def self.optionals
|
|
107
|
+
%w[
|
|
108
|
+
name
|
|
109
|
+
entry_mode
|
|
110
|
+
card
|
|
111
|
+
]
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# An array for nullable fields
|
|
115
|
+
def self.nullables
|
|
116
|
+
[]
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def initialize(name: SKIP, entry_mode: SKIP, card: SKIP,
|
|
120
|
+
additional_properties: nil)
|
|
121
|
+
# Add additional model properties to the instance
|
|
122
|
+
additional_properties = {} if additional_properties.nil?
|
|
123
|
+
|
|
124
|
+
@name = name unless name == SKIP
|
|
125
|
+
@entry_mode = entry_mode unless entry_mode == SKIP
|
|
126
|
+
@card = card unless card == SKIP
|
|
127
|
+
@additional_properties = additional_properties
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Creates an instance of the object from a hash.
|
|
131
|
+
def self.from_hash(hash)
|
|
132
|
+
return nil unless hash
|
|
133
|
+
|
|
134
|
+
# Extract variables from the hash.
|
|
135
|
+
name = hash.key?('name') ? hash['name'] : SKIP
|
|
136
|
+
entry_mode = hash.key?('entry_mode') ? hash['entry_mode'] : SKIP
|
|
137
|
+
card = Card.from_hash(hash['card']) if hash['card']
|
|
138
|
+
|
|
139
|
+
# Create a new hash for additional properties, removing known properties.
|
|
140
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
141
|
+
|
|
142
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
143
|
+
new_hash, proc { |value| value }
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
# Create object from extracted values.
|
|
147
|
+
PaymentMethod.new(name: name,
|
|
148
|
+
entry_mode: entry_mode,
|
|
149
|
+
card: card,
|
|
150
|
+
additional_properties: additional_properties)
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Provides a human-readable string representation of the object.
|
|
154
|
+
def to_s
|
|
155
|
+
class_name = self.class.name.split('::').last
|
|
156
|
+
"<#{class_name} name: #{@name}, entry_mode: #{@entry_mode}, card: #{@card},"\
|
|
157
|
+
" additional_properties: #{@additional_properties}>"
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
161
|
+
def inspect
|
|
162
|
+
class_name = self.class.name.split('::').last
|
|
163
|
+
"<#{class_name} name: #{@name.inspect}, entry_mode: #{@entry_mode.inspect}, card:"\
|
|
164
|
+
" #{@card.inspect}, additional_properties: #{@additional_properties}>"
|
|
165
|
+
end
|
|
166
|
+
end
|
|
167
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# batches
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Batches
|
|
7
|
+
# PaymentMethod2.
|
|
8
|
+
class PaymentMethod2
|
|
9
|
+
PAYMENT_METHOD2 = [
|
|
10
|
+
# TODO: Write general description for CARD
|
|
11
|
+
CARD = 'CARD'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for DIGITAL_WALLET
|
|
14
|
+
DIGITAL_WALLET = 'DIGITAL_WALLET'.freeze,
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for APM
|
|
17
|
+
APM = 'APM'.freeze,
|
|
18
|
+
|
|
19
|
+
# TODO: Write general description for BANK_TRANSFER
|
|
20
|
+
BANK_TRANSFER = 'BANK_TRANSFER'.freeze,
|
|
21
|
+
|
|
22
|
+
# TODO: Write general description for BNPL
|
|
23
|
+
BNPL = 'BNPL'.freeze,
|
|
24
|
+
|
|
25
|
+
# TODO: Write general description for NETWORK_TOKEN
|
|
26
|
+
NETWORK_TOKEN = 'NETWORK_TOKEN'.freeze
|
|
27
|
+
].freeze
|
|
28
|
+
|
|
29
|
+
def self.validate(value)
|
|
30
|
+
return false if value.nil?
|
|
31
|
+
|
|
32
|
+
PAYMENT_METHOD2.include?(value)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def self.from_value(value, default_value = CARD)
|
|
36
|
+
return default_value if value.nil?
|
|
37
|
+
|
|
38
|
+
str = value.to_s.strip
|
|
39
|
+
|
|
40
|
+
case str.downcase
|
|
41
|
+
when 'card' then CARD
|
|
42
|
+
when 'digital_wallet' then DIGITAL_WALLET
|
|
43
|
+
when 'apm' then APM
|
|
44
|
+
when 'bank_transfer' then BANK_TRANSFER
|
|
45
|
+
when 'bnpl' then BNPL
|
|
46
|
+
when 'network_token' then NETWORK_TOKEN
|
|
47
|
+
else
|
|
48
|
+
default_value
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# batches
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Batches
|
|
7
|
+
# payment_methods_BATCHES.payment_method.
|
|
8
|
+
class PaymentMethodsBatchesPaymentMethod
|
|
9
|
+
PAYMENT_METHODS_BATCHES_PAYMENT_METHOD = [
|
|
10
|
+
# TODO: Write general description for CARD
|
|
11
|
+
CARD = 'CARD'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for DIGITAL_WALLET
|
|
14
|
+
DIGITAL_WALLET = 'DIGITAL_WALLET'.freeze,
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for APM
|
|
17
|
+
APM = 'APM'.freeze,
|
|
18
|
+
|
|
19
|
+
# TODO: Write general description for BANK_TRANSFER
|
|
20
|
+
BANK_TRANSFER = 'BANK_TRANSFER'.freeze,
|
|
21
|
+
|
|
22
|
+
# TODO: Write general description for BNPL
|
|
23
|
+
BNPL = 'BNPL'.freeze,
|
|
24
|
+
|
|
25
|
+
# TODO: Write general description for NETWORK_TOKEN
|
|
26
|
+
NETWORK_TOKEN = 'NETWORK_TOKEN'.freeze
|
|
27
|
+
].freeze
|
|
28
|
+
|
|
29
|
+
def self.validate(value)
|
|
30
|
+
return false if value.nil?
|
|
31
|
+
|
|
32
|
+
PAYMENT_METHODS_BATCHES_PAYMENT_METHOD.include?(value)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def self.from_value(value, default_value = CARD)
|
|
36
|
+
return default_value if value.nil?
|
|
37
|
+
|
|
38
|
+
str = value.to_s.strip
|
|
39
|
+
|
|
40
|
+
case str.downcase
|
|
41
|
+
when 'card' then CARD
|
|
42
|
+
when 'digital_wallet' then DIGITAL_WALLET
|
|
43
|
+
when 'apm' then APM
|
|
44
|
+
when 'bank_transfer' then BANK_TRANSFER
|
|
45
|
+
when 'bnpl' then BNPL
|
|
46
|
+
when 'network_token' then NETWORK_TOKEN
|
|
47
|
+
else
|
|
48
|
+
default_value
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
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
|
+
# Refunds Model.
|
|
8
|
+
class Refunds < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# The total number of Refund transactions.
|
|
13
|
+
# @return [Float]
|
|
14
|
+
attr_accessor :count
|
|
15
|
+
|
|
16
|
+
# The total amount of Refund 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
|
+
Refunds.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
|