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,104 @@
|
|
|
1
|
+
# batches
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Batches
|
|
7
|
+
# Indicates how the payment method information was obtained by the Merchant
|
|
8
|
+
# for this transaction. * `MOTO` - A CNP channel
|
|
9
|
+
# entry mode where the payment method information was obtained over the phone
|
|
10
|
+
# or via postal mail. * `ECOM` - A CNP channel entry
|
|
11
|
+
# mode where the payment method was obtained via a browser.
|
|
12
|
+
# * `IN_APP` - A CNP channel entry mode where the payment method was
|
|
13
|
+
# obtained via an application and applies to digital wallets only.
|
|
14
|
+
# * `CHIP` - A CP channel entry mode where the payment method
|
|
15
|
+
# information was obtained from a chip. E.g. card is inserted into a device to
|
|
16
|
+
# read the chip. * `SWIPE` - A CP channel entry mode
|
|
17
|
+
# where the payment method information was obtained from swiping a magnetic
|
|
18
|
+
# strip. E.g. card's magnetic strip is swiped through a device to read the
|
|
19
|
+
# card information. * `MANUAL` - A CP channel entry
|
|
20
|
+
# mode where the payment method information was obtained by manually keying
|
|
21
|
+
# the payment method information into the device. *
|
|
22
|
+
# `CONTACTLESS_CHIP` - A CP channel entry mode where the payment method
|
|
23
|
+
# information was obtained by bringing the payment method to close proximity
|
|
24
|
+
# of a device. E.g. tap a card on or near a device to exchange card
|
|
25
|
+
# information. * `CONTACTLESS_SWIPE` - A CP channel
|
|
26
|
+
# entry mode where the payment method information was obtained by bringing the
|
|
27
|
+
# payment method to close proximity of a device and also swiping the card.
|
|
28
|
+
# E.g. tap a card on or near a device and swipe it through device to exchange
|
|
29
|
+
# card information * `PHONE` - A CNP channel entry
|
|
30
|
+
# mode where the payment method was obtained over the phone.
|
|
31
|
+
# * `MAIL` - A CNP channel entry mode where the payment method was
|
|
32
|
+
# obtained via postal mail. * `PRESENT`- The entry
|
|
33
|
+
# mode cannot be determined but it is a Customer Present transaction.
|
|
34
|
+
# * `UNKNOWN` - The entry mode for this transaction cannot be
|
|
35
|
+
# determined.
|
|
36
|
+
class EntryModeBatchesTransactionsPaymentMethodEntryMode
|
|
37
|
+
ENTRY_MODE_BATCHES_TRANSACTIONS_PAYMENT_METHOD_ENTRY_MODE = [
|
|
38
|
+
# TODO: Write general description for MOTO
|
|
39
|
+
MOTO = 'MOTO'.freeze,
|
|
40
|
+
|
|
41
|
+
# TODO: Write general description for ECOM
|
|
42
|
+
ECOM = 'ECOM'.freeze,
|
|
43
|
+
|
|
44
|
+
# TODO: Write general description for IN_APP
|
|
45
|
+
IN_APP = 'IN_APP'.freeze,
|
|
46
|
+
|
|
47
|
+
# TODO: Write general description for CHIP
|
|
48
|
+
CHIP = 'CHIP'.freeze,
|
|
49
|
+
|
|
50
|
+
# TODO: Write general description for SWIPE
|
|
51
|
+
SWIPE = 'SWIPE'.freeze,
|
|
52
|
+
|
|
53
|
+
# TODO: Write general description for MANUAL
|
|
54
|
+
MANUAL = 'MANUAL'.freeze,
|
|
55
|
+
|
|
56
|
+
# TODO: Write general description for PHONE
|
|
57
|
+
PHONE = 'PHONE'.freeze,
|
|
58
|
+
|
|
59
|
+
# TODO: Write general description for MAIL
|
|
60
|
+
MAIL = 'MAIL'.freeze,
|
|
61
|
+
|
|
62
|
+
# TODO: Write general description for CONTACTLESS_CHIP
|
|
63
|
+
CONTACTLESS_CHIP = 'CONTACTLESS_CHIP'.freeze,
|
|
64
|
+
|
|
65
|
+
# TODO: Write general description for CONTACTLESS_SWIPE
|
|
66
|
+
CONTACTLESS_SWIPE = 'CONTACTLESS_SWIPE'.freeze,
|
|
67
|
+
|
|
68
|
+
# TODO: Write general description for PRESENT
|
|
69
|
+
PRESENT = 'PRESENT'.freeze,
|
|
70
|
+
|
|
71
|
+
# TODO: Write general description for UNKNOWN
|
|
72
|
+
UNKNOWN = 'UNKNOWN'.freeze
|
|
73
|
+
].freeze
|
|
74
|
+
|
|
75
|
+
def self.validate(value)
|
|
76
|
+
return false if value.nil?
|
|
77
|
+
|
|
78
|
+
ENTRY_MODE_BATCHES_TRANSACTIONS_PAYMENT_METHOD_ENTRY_MODE.include?(value)
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def self.from_value(value, default_value = MOTO)
|
|
82
|
+
return default_value if value.nil?
|
|
83
|
+
|
|
84
|
+
str = value.to_s.strip
|
|
85
|
+
|
|
86
|
+
case str.downcase
|
|
87
|
+
when 'moto' then MOTO
|
|
88
|
+
when 'ecom' then ECOM
|
|
89
|
+
when 'in_app' then IN_APP
|
|
90
|
+
when 'chip' then CHIP
|
|
91
|
+
when 'swipe' then SWIPE
|
|
92
|
+
when 'manual' then MANUAL
|
|
93
|
+
when 'phone' then PHONE
|
|
94
|
+
when 'mail' then MAIL
|
|
95
|
+
when 'contactless_chip' then CONTACTLESS_CHIP
|
|
96
|
+
when 'contactless_swipe' then CONTACTLESS_SWIPE
|
|
97
|
+
when 'present' then PRESENT
|
|
98
|
+
when 'unknown' then UNKNOWN
|
|
99
|
+
else
|
|
100
|
+
default_value
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
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
|
+
# This indicates an issue with the API request.
|
|
8
|
+
class ErrorCode
|
|
9
|
+
ERROR_CODE = [
|
|
10
|
+
# TODO: Write general description for DUPLICATE_TRANSACTION
|
|
11
|
+
DUPLICATE_TRANSACTION = 'DUPLICATE_TRANSACTION'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for INVALID_BATCH_ACTION
|
|
14
|
+
INVALID_BATCH_ACTION = 'INVALID_BATCH_ACTION'.freeze,
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for INVALID_REQUEST_DATA
|
|
17
|
+
INVALID_REQUEST_DATA = 'INVALID_REQUEST_DATA'.freeze,
|
|
18
|
+
|
|
19
|
+
# TODO: Write general description for INVALID_TRANSACTION_ACTION
|
|
20
|
+
INVALID_TRANSACTION_ACTION = 'INVALID_TRANSACTION_ACTION'.freeze,
|
|
21
|
+
|
|
22
|
+
# TODO: Write general description for MANDATORY_DATA_MISSING
|
|
23
|
+
MANDATORY_DATA_MISSING = 'MANDATORY_DATA_MISSING'.freeze,
|
|
24
|
+
|
|
25
|
+
# TODO: Write general description for TRANSACTION_NOT_FOUND
|
|
26
|
+
TRANSACTION_NOT_FOUND = 'TRANSACTION_NOT_FOUND'.freeze
|
|
27
|
+
].freeze
|
|
28
|
+
|
|
29
|
+
def self.validate(value)
|
|
30
|
+
return false if value.nil?
|
|
31
|
+
|
|
32
|
+
ERROR_CODE.include?(value)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def self.from_value(value, default_value = DUPLICATE_TRANSACTION)
|
|
36
|
+
return default_value if value.nil?
|
|
37
|
+
|
|
38
|
+
str = value.to_s.strip
|
|
39
|
+
|
|
40
|
+
case str.downcase
|
|
41
|
+
when 'duplicate_transaction' then DUPLICATE_TRANSACTION
|
|
42
|
+
when 'invalid_batch_action' then INVALID_BATCH_ACTION
|
|
43
|
+
when 'invalid_request_data' then INVALID_REQUEST_DATA
|
|
44
|
+
when 'invalid_transaction_action' then INVALID_TRANSACTION_ACTION
|
|
45
|
+
when 'mandatory_data_missing' then MANDATORY_DATA_MISSING
|
|
46
|
+
when 'transaction_not_found' then TRANSACTION_NOT_FOUND
|
|
47
|
+
else
|
|
48
|
+
default_value
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# batches
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Batches
|
|
7
|
+
# This action failed as token in the request is not valid.
|
|
8
|
+
class ErrorCode1
|
|
9
|
+
ERROR_CODE1 = [
|
|
10
|
+
# TODO: Write general description for NOT_AUTHENTICATED
|
|
11
|
+
NOT_AUTHENTICATED = 'NOT_AUTHENTICATED'.freeze
|
|
12
|
+
].freeze
|
|
13
|
+
|
|
14
|
+
def self.validate(value)
|
|
15
|
+
return false if value.nil?
|
|
16
|
+
|
|
17
|
+
ERROR_CODE1.include?(value)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def self.from_value(value, default_value = NOT_AUTHENTICATED)
|
|
21
|
+
return default_value if value.nil?
|
|
22
|
+
|
|
23
|
+
default_value
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# batches
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Batches
|
|
7
|
+
# This action is not authorized with the credentials being used.
|
|
8
|
+
class ErrorCode2
|
|
9
|
+
ERROR_CODE2 = [
|
|
10
|
+
# TODO: Write general description for ACTION_NOT_AUTHORIZED
|
|
11
|
+
ACTION_NOT_AUTHORIZED = 'ACTION_NOT_AUTHORIZED'.freeze
|
|
12
|
+
].freeze
|
|
13
|
+
|
|
14
|
+
def self.validate(value)
|
|
15
|
+
return false if value.nil?
|
|
16
|
+
|
|
17
|
+
ERROR_CODE2.include?(value)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def self.from_value(value, default_value = ACTION_NOT_AUTHORIZED)
|
|
21
|
+
return default_value if value.nil?
|
|
22
|
+
|
|
23
|
+
default_value
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# batches
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Batches
|
|
7
|
+
# This indicates an unexpected issue occurred on the Global Payments system.
|
|
8
|
+
class ErrorCode3
|
|
9
|
+
ERROR_CODE3 = [
|
|
10
|
+
# TODO: Write general description for SYSTEM_ERROR_DOWNSTREAM
|
|
11
|
+
SYSTEM_ERROR_DOWNSTREAM = 'SYSTEM_ERROR_DOWNSTREAM'.freeze
|
|
12
|
+
].freeze
|
|
13
|
+
|
|
14
|
+
def self.validate(value)
|
|
15
|
+
return false if value.nil?
|
|
16
|
+
|
|
17
|
+
ERROR_CODE3.include?(value)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def self.from_value(value, default_value = SYSTEM_ERROR_DOWNSTREAM)
|
|
21
|
+
return default_value if value.nil?
|
|
22
|
+
|
|
23
|
+
default_value
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# batches
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Batches
|
|
7
|
+
# This is an error not yet handled or mapped properly.
|
|
8
|
+
class ErrorCode4
|
|
9
|
+
ERROR_CODE4 = [
|
|
10
|
+
# TODO: Write general description for UNKNOWN_RESPONSE
|
|
11
|
+
UNKNOWN_RESPONSE = 'UNKNOWN_RESPONSE'.freeze
|
|
12
|
+
].freeze
|
|
13
|
+
|
|
14
|
+
def self.validate(value)
|
|
15
|
+
return false if value.nil?
|
|
16
|
+
|
|
17
|
+
ERROR_CODE4.include?(value)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def self.from_value(value, default_value = UNKNOWN_RESPONSE)
|
|
21
|
+
return default_value if value.nil?
|
|
22
|
+
|
|
23
|
+
default_value
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# batches
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Batches
|
|
7
|
+
# This is an error indicating there was an issue connecting to a partner
|
|
8
|
+
# system..
|
|
9
|
+
class ErrorCode5
|
|
10
|
+
ERROR_CODE5 = [
|
|
11
|
+
# TODO: Write general description for UNAUTHORIZED_DOWNSTREAM
|
|
12
|
+
UNAUTHORIZED_DOWNSTREAM = 'UNAUTHORIZED_DOWNSTREAM'.freeze
|
|
13
|
+
].freeze
|
|
14
|
+
|
|
15
|
+
def self.validate(value)
|
|
16
|
+
return false if value.nil?
|
|
17
|
+
|
|
18
|
+
ERROR_CODE5.include?(value)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def self.from_value(value, default_value = UNAUTHORIZED_DOWNSTREAM)
|
|
22
|
+
return default_value if value.nil?
|
|
23
|
+
|
|
24
|
+
default_value
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# batches
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Batches
|
|
7
|
+
# This is an error indicating there was a timeout issue to another system.
|
|
8
|
+
class ErrorCode6
|
|
9
|
+
ERROR_CODE6 = [
|
|
10
|
+
# TODO: Write general description for TIMEOUT_DOWNSTREAM
|
|
11
|
+
TIMEOUT_DOWNSTREAM = 'TIMEOUT_DOWNSTREAM'.freeze
|
|
12
|
+
].freeze
|
|
13
|
+
|
|
14
|
+
def self.validate(value)
|
|
15
|
+
return false if value.nil?
|
|
16
|
+
|
|
17
|
+
ERROR_CODE6.include?(value)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def self.from_value(value, default_value = TIMEOUT_DOWNSTREAM)
|
|
21
|
+
return default_value if value.nil?
|
|
22
|
+
|
|
23
|
+
default_value
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# batches
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Batches
|
|
7
|
+
# Filter Model.
|
|
8
|
+
class Filter < 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 :batch_id
|
|
16
|
+
|
|
17
|
+
# A mapping from model property names to API property names.
|
|
18
|
+
def self.names
|
|
19
|
+
@_hash = {} if @_hash.nil?
|
|
20
|
+
@_hash['batch_id'] = 'batch_id'
|
|
21
|
+
@_hash
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# An array for optional fields
|
|
25
|
+
def self.optionals
|
|
26
|
+
%w[
|
|
27
|
+
batch_id
|
|
28
|
+
]
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# An array for nullable fields
|
|
32
|
+
def self.nullables
|
|
33
|
+
[]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def initialize(batch_id: SKIP, additional_properties: nil)
|
|
37
|
+
# Add additional model properties to the instance
|
|
38
|
+
additional_properties = {} if additional_properties.nil?
|
|
39
|
+
|
|
40
|
+
@batch_id = batch_id unless batch_id == SKIP
|
|
41
|
+
@additional_properties = additional_properties
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Creates an instance of the object from a hash.
|
|
45
|
+
def self.from_hash(hash)
|
|
46
|
+
return nil unless hash
|
|
47
|
+
|
|
48
|
+
# Extract variables from the hash.
|
|
49
|
+
batch_id = hash.key?('batch_id') ? hash['batch_id'] : SKIP
|
|
50
|
+
|
|
51
|
+
# Create a new hash for additional properties, removing known properties.
|
|
52
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
53
|
+
|
|
54
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
55
|
+
new_hash, proc { |value| value }
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
# Create object from extracted values.
|
|
59
|
+
Filter.new(batch_id: batch_id,
|
|
60
|
+
additional_properties: additional_properties)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Provides a human-readable string representation of the object.
|
|
64
|
+
def to_s
|
|
65
|
+
class_name = self.class.name.split('::').last
|
|
66
|
+
"<#{class_name} batch_id: #{@batch_id}, additional_properties: #{@additional_properties}>"
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
70
|
+
def inspect
|
|
71
|
+
class_name = self.class.name.split('::').last
|
|
72
|
+
"<#{class_name} batch_id: #{@batch_id.inspect}, additional_properties:"\
|
|
73
|
+
" #{@additional_properties}>"
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# batches
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Batches
|
|
7
|
+
# Indicates how the card is funded: * `DEBIT` -
|
|
8
|
+
# indicates the card is a debit card where the funds may be present in an
|
|
9
|
+
# account to fulfill the transaction amount. *
|
|
10
|
+
# `CREDIT` - indicates the card is a credit card where the funds may be
|
|
11
|
+
# available on credit to the payer to fulfill the transaction amount.
|
|
12
|
+
# * `FOOD_STAMP` - indicates the card is an, Electronic
|
|
13
|
+
# Benefits Transfer, for food stamps. *
|
|
14
|
+
# `CASH_BENEFITS` - indicates the card is an, Electronic Benefits Transfer,
|
|
15
|
+
# for cash benefits. * `PREPAID` - indicates the
|
|
16
|
+
# card is a prepaid card where the funds are loaded to the card account to
|
|
17
|
+
# fulfill the transaction amount. Unlike a debit card, a prepaid is not linked
|
|
18
|
+
# to a bank account.
|
|
19
|
+
class FundingBatchesTransactionsPaymentMethodCardFunding
|
|
20
|
+
FUNDING_BATCHES_TRANSACTIONS_PAYMENT_METHOD_CARD_FUNDING = [
|
|
21
|
+
# TODO: Write general description for DEBIT
|
|
22
|
+
DEBIT = 'DEBIT'.freeze,
|
|
23
|
+
|
|
24
|
+
# TODO: Write general description for CREDIT
|
|
25
|
+
CREDIT = 'CREDIT'.freeze,
|
|
26
|
+
|
|
27
|
+
# TODO: Write general description for CASH_BENEFITS
|
|
28
|
+
CASH_BENEFITS = 'CASH_BENEFITS'.freeze,
|
|
29
|
+
|
|
30
|
+
# TODO: Write general description for FOOD_STAMP
|
|
31
|
+
FOOD_STAMP = 'FOOD_STAMP'.freeze,
|
|
32
|
+
|
|
33
|
+
# TODO: Write general description for PREPAID
|
|
34
|
+
PREPAID = 'PREPAID'.freeze
|
|
35
|
+
].freeze
|
|
36
|
+
|
|
37
|
+
def self.validate(value)
|
|
38
|
+
return false if value.nil?
|
|
39
|
+
|
|
40
|
+
FUNDING_BATCHES_TRANSACTIONS_PAYMENT_METHOD_CARD_FUNDING.include?(value)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def self.from_value(value, default_value = DEBIT)
|
|
44
|
+
return default_value if value.nil?
|
|
45
|
+
|
|
46
|
+
str = value.to_s.strip
|
|
47
|
+
|
|
48
|
+
case str.downcase
|
|
49
|
+
when 'debit' then DEBIT
|
|
50
|
+
when 'credit' then CREDIT
|
|
51
|
+
when 'cash_benefits' then CASH_BENEFITS
|
|
52
|
+
when 'food_stamp' then FOOD_STAMP
|
|
53
|
+
when 'prepaid' then PREPAID
|
|
54
|
+
else
|
|
55
|
+
default_value
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
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
|
+
# FundingCredit Model.
|
|
8
|
+
class FundingCredit < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# The total number of Credit card transactions.
|
|
13
|
+
# @return [Float]
|
|
14
|
+
attr_accessor :count
|
|
15
|
+
|
|
16
|
+
# The total amount of Credit 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
|
+
FundingCredit.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
|
+
# FundingCredit1 Model.
|
|
8
|
+
class FundingCredit1 < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# The total number of Credit card transactions for this brand.
|
|
13
|
+
# @return [Float]
|
|
14
|
+
attr_accessor :count
|
|
15
|
+
|
|
16
|
+
# The total amount of Credit 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
|
+
FundingCredit1.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
|