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.
Files changed (97) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +155 -0
  4. data/bin/console +15 -0
  5. data/lib/batches/api_helper.rb +10 -0
  6. data/lib/batches/apis/base_api.rb +67 -0
  7. data/lib/batches/apis/close_a_batch_api.rb +111 -0
  8. data/lib/batches/apis/get_a_batch_api.rb +70 -0
  9. data/lib/batches/apis/get_transactions_within_a_batch_api.rb +69 -0
  10. data/lib/batches/client.rb +72 -0
  11. data/lib/batches/configuration.rb +166 -0
  12. data/lib/batches/exceptions/api_exception.rb +21 -0
  13. data/lib/batches/exceptions/batches400_error_exception.rb +61 -0
  14. data/lib/batches/exceptions/batches401_error_exception.rb +61 -0
  15. data/lib/batches/exceptions/batches403_error_exception.rb +61 -0
  16. data/lib/batches/exceptions/batches500_error_exception.rb +61 -0
  17. data/lib/batches/exceptions/batches501_error_exception.rb +61 -0
  18. data/lib/batches/exceptions/batches502_error_exception.rb +62 -0
  19. data/lib/batches/exceptions/batches504_error_exception.rb +61 -0
  20. data/lib/batches/exceptions/batches_transactions400_error_exception.rb +61 -0
  21. data/lib/batches/exceptions/batches_transactions401_error_exception.rb +61 -0
  22. data/lib/batches/exceptions/batches_transactions403_error_exception.rb +61 -0
  23. data/lib/batches/exceptions/batches_transactions500_error_exception.rb +61 -0
  24. data/lib/batches/exceptions/batches_transactions501_error_exception.rb +61 -0
  25. data/lib/batches/exceptions/batches_transactions502_error_exception.rb +62 -0
  26. data/lib/batches/exceptions/batches_transactions504_error_exception.rb +61 -0
  27. data/lib/batches/http/api_response.rb +19 -0
  28. data/lib/batches/http/http_call_back.rb +10 -0
  29. data/lib/batches/http/http_method_enum.rb +10 -0
  30. data/lib/batches/http/http_request.rb +10 -0
  31. data/lib/batches/http/http_response.rb +10 -0
  32. data/lib/batches/http/proxy_settings.rb +22 -0
  33. data/lib/batches/logging/configuration/api_logging_configuration.rb +186 -0
  34. data/lib/batches/logging/sdk_logger.rb +17 -0
  35. data/lib/batches/models/action.rb +125 -0
  36. data/lib/batches/models/authentication_invalid401.rb +102 -0
  37. data/lib/batches/models/avs_address_result_batches_transactions_payment_method_card_avs_address_result.rb +40 -0
  38. data/lib/batches/models/avs_postal_code_result_batches_transactions_payment_method_card_avs_postal_code_result.rb +40 -0
  39. data/lib/batches/models/base_model.rb +110 -0
  40. data/lib/batches/models/batches_request.rb +142 -0
  41. data/lib/batches/models/brand_batches_brand_breakdown_brand.rb +56 -0
  42. data/lib/batches/models/brand_batches_transactions_payment_method_card_brand.rb +56 -0
  43. data/lib/batches/models/brand_breakdown_item.rb +159 -0
  44. data/lib/batches/models/card.rb +170 -0
  45. data/lib/batches/models/channel_batches_channel.rb +44 -0
  46. data/lib/batches/models/close_response.rb +356 -0
  47. data/lib/batches/models/currency_batches_transactions_currency.rb +60 -0
  48. data/lib/batches/models/cvv_result_batches_transactions_payment_method_card_cvv_result.rb +40 -0
  49. data/lib/batches/models/detailed_error_code.rb +26 -0
  50. data/lib/batches/models/detailed_error_code1.rb +36 -0
  51. data/lib/batches/models/detailed_error_code2.rb +36 -0
  52. data/lib/batches/models/detailed_error_code3.rb +26 -0
  53. data/lib/batches/models/detailed_error_code4.rb +26 -0
  54. data/lib/batches/models/detailed_error_code5.rb +26 -0
  55. data/lib/batches/models/detailed_error_code6.rb +26 -0
  56. data/lib/batches/models/entry_mode_batches_transactions_payment_method_entry_mode.rb +104 -0
  57. data/lib/batches/models/error_code.rb +52 -0
  58. data/lib/batches/models/error_code1.rb +26 -0
  59. data/lib/batches/models/error_code2.rb +26 -0
  60. data/lib/batches/models/error_code3.rb +26 -0
  61. data/lib/batches/models/error_code4.rb +26 -0
  62. data/lib/batches/models/error_code5.rb +27 -0
  63. data/lib/batches/models/error_code6.rb +26 -0
  64. data/lib/batches/models/filter.rb +76 -0
  65. data/lib/batches/models/funding_batches_transactions_payment_method_card_funding.rb +59 -0
  66. data/lib/batches/models/funding_credit.rb +85 -0
  67. data/lib/batches/models/funding_credit1.rb +85 -0
  68. data/lib/batches/models/funding_credit5.rb +85 -0
  69. data/lib/batches/models/funding_debit.rb +85 -0
  70. data/lib/batches/models/funding_debit1.rb +85 -0
  71. data/lib/batches/models/funding_debit5.rb +85 -0
  72. data/lib/batches/models/get_response.rb +331 -0
  73. data/lib/batches/models/host_breakdown_item.rb +128 -0
  74. data/lib/batches/models/not_authorized403.rb +102 -0
  75. data/lib/batches/models/obj_request_invalid400.rb +102 -0
  76. data/lib/batches/models/payment_method.rb +167 -0
  77. data/lib/batches/models/payment_method2.rb +52 -0
  78. data/lib/batches/models/payment_methods_batches_payment_method.rb +52 -0
  79. data/lib/batches/models/refunds.rb +85 -0
  80. data/lib/batches/models/refunds1.rb +85 -0
  81. data/lib/batches/models/result_code_batches_action_result_code.rb +26 -0
  82. data/lib/batches/models/sales.rb +85 -0
  83. data/lib/batches/models/sales1.rb +85 -0
  84. data/lib/batches/models/server_error500.rb +102 -0
  85. data/lib/batches/models/server_timeout504.rb +102 -0
  86. data/lib/batches/models/status_batches_status.rb +38 -0
  87. data/lib/batches/models/status_batches_transactions_status.rb +39 -0
  88. data/lib/batches/models/transaction.rb +205 -0
  89. data/lib/batches/models/transaction_batch_response.rb +198 -0
  90. data/lib/batches/models/type_batches_action_type.rb +40 -0
  91. data/lib/batches/models/type_batches_transactions_type.rb +40 -0
  92. data/lib/batches/models/unknown_platform_error502.rb +103 -0
  93. data/lib/batches/models/unknown_server_error501.rb +102 -0
  94. data/lib/batches/utilities/date_time_helper.rb +11 -0
  95. data/lib/batches/utilities/file_wrapper.rb +28 -0
  96. data/lib/batches.rb +128 -0
  97. metadata +180 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 297e93cfb60abaeae1ed48750472262e70cf65d0af720f781155193a632230e4
4
+ data.tar.gz: d41e15a1274eb781fab2cfb11e5bbc465d4bee4dc56e92b959c0484b74a74e5b
5
+ SHA512:
6
+ metadata.gz: 957f6d61c083119e63ce38b9ae4a6f7897118b4949e618d977ded4a1d2ae3ec187bd91f69fbe16ffb8e9a7bb9266b268eee73a89f060d6193207390bf3db44a4
7
+ data.tar.gz: '09e32cfcd263c3e4aeb92a46b5e2ad8f0a3b2bdc3e8b3beb11ebf6a4ac16c6f6ad14947392a25efc5eb1adcf3571fed82734d38484a190a3954a410b4ddc5298'
data/LICENSE ADDED
@@ -0,0 +1,28 @@
1
+ License:
2
+ ========
3
+ The MIT License (MIT)
4
+ http://opensource.org/licenses/MIT
5
+
6
+ Copyright (c) 2014 - 2026 APIMATIC Limited
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ of this software and associated documentation files (the "Software"), to deal
10
+ in the Software without restriction, including without limitation the rights
11
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ copies of the Software, and to permit persons to whom the Software is
13
+ furnished to do so, subject to the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in
16
+ all copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ THE SOFTWARE.
25
+
26
+ Trade Mark:
27
+ ==========
28
+ APIMATIC is a trade mark for APIMATIC Limited
data/README.md ADDED
@@ -0,0 +1,155 @@
1
+
2
+ # Getting Started with Batches
3
+
4
+ ## Introduction
5
+
6
+ A Batch represents a group of transactions that commence the funding process together. Batches have aggregate amount and count totals of all the transactions in the batch.
7
+ Once a batch is closed all transactions assigned to that batch will be funded to the merchant.
8
+ Once a batch is closed no more transactions can be added or removed from that batch.
9
+ Transactions that are in a closed batch cannot be cancelled/reversed and must be refunded.
10
+
11
+ ## Install the Package
12
+
13
+ Install the gem from the command line:
14
+
15
+ ```bash
16
+ gem install apimatic-gp-sdk -v 0.0.1
17
+ ```
18
+
19
+ Or add the gem to your Gemfile and run `bundle`:
20
+
21
+ ```ruby
22
+ gem 'apimatic-gp-sdk', '0.0.1'
23
+ ```
24
+
25
+ For additional gem details, see the [RubyGems page for the apimatic-gp-sdk gem](https://rubygems.org/gems/apimatic-gp-sdk/versions/0.0.1).
26
+
27
+ ## IRB Console Usage
28
+
29
+ You can explore the SDK interactively using IRB in two ways
30
+
31
+ ### 1. Use IRB with Installed Gem
32
+
33
+ Open your system terminal (Command Prompt, Git Bash or macOS Terminal) and type the following command to start the irb console.
34
+
35
+ ```bash
36
+ irb
37
+ ```
38
+
39
+ Now you can load the SDK in the IRB
40
+
41
+ ```ruby
42
+ require 'batches'
43
+ include Batches
44
+ ```
45
+
46
+ ### 2. Use IRB within SDK
47
+
48
+ Open your system terminal (Command Prompt, Git Bash or macOS Terminal) and navigate to the root folder of SDK.
49
+
50
+ ```
51
+ cd path/to/batches
52
+ ```
53
+
54
+ Now you can start the preconfigured irb console by running the following command
55
+
56
+ ```bash
57
+ ruby bin/console
58
+ ```
59
+
60
+ **_Note:_** This automatically loads the SDK from lib/
61
+
62
+ ## Initialize the API Client
63
+
64
+ **_Note:_** Documentation for the client can be found [here.](https://www.github.com/sdks-io/apimatic-gp-ruby-sdk/tree/0.0.1/doc/client.md)
65
+
66
+ The following parameters are configurable for the API Client:
67
+
68
+ | Parameter | Type | Description |
69
+ | --- | --- | --- |
70
+ | environment | [`Environment`](https://www.github.com/sdks-io/apimatic-gp-ruby-sdk/tree/0.0.1/README.md#environments) | The API environment. <br> **Default: `Environment.PRODUCTION`** |
71
+ | connection | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests |
72
+ | adapter | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests |
73
+ | timeout | `Float` | The value to use for connection timeout. <br> **Default: 30** |
74
+ | max_retries | `Integer` | The number of times to retry an endpoint call if it fails. <br> **Default: 0** |
75
+ | retry_interval | `Float` | Pause in seconds between retries. <br> **Default: 1** |
76
+ | backoff_factor | `Float` | The amount to multiply each successive retry's interval amount by in order to provide backoff. <br> **Default: 2** |
77
+ | retry_statuses | `Array` | A list of HTTP statuses to retry. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
78
+ | retry_methods | `Array` | A list of HTTP methods to retry. <br> **Default: %i[get put]** |
79
+ | http_callback | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. |
80
+ | proxy_settings | [`ProxySettings`](https://www.github.com/sdks-io/apimatic-gp-ruby-sdk/tree/0.0.1/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. |
81
+ | logging_configuration | [`LoggingConfiguration`](https://www.github.com/sdks-io/apimatic-gp-ruby-sdk/tree/0.0.1/doc/logging-configuration.md) | The SDK logging configuration for API calls |
82
+
83
+ The API client can be initialized as follows:
84
+
85
+ ### Code-Based Client Initialization
86
+
87
+ ```ruby
88
+ require 'batches'
89
+ include Batches
90
+
91
+ client = Client.new(
92
+ environment: Environment::PRODUCTION,
93
+ logging_configuration: LoggingConfiguration.new(
94
+ log_level: Logger::INFO,
95
+ request_logging_config: RequestLoggingConfiguration.new(
96
+ log_body: true
97
+ ),
98
+ response_logging_config: ResponseLoggingConfiguration.new(
99
+ log_headers: true
100
+ )
101
+ )
102
+ )
103
+ ```
104
+
105
+ ### Environment-Based Client Initialization
106
+
107
+ ```ruby
108
+ require 'batches'
109
+ include Batches
110
+
111
+ # Create client from environment
112
+ client = Client.from_env
113
+ ```
114
+
115
+ See the [`Environment-Based Client Initialization`](https://www.github.com/sdks-io/apimatic-gp-ruby-sdk/tree/0.0.1/doc/environment-based-client-initialization.md) section for details.
116
+
117
+ ## Environments
118
+
119
+ The SDK can be configured to use a different environment for making API calls. Available environments are:
120
+
121
+ ### Fields
122
+
123
+ | Name | Description |
124
+ | --- | --- |
125
+ | PRODUCTION | **Default** Sandbox Environment |
126
+ | ENVIRONMENT2 | Production Environment |
127
+
128
+ ## List of APIs
129
+
130
+ * [Geta Batch](https://www.github.com/sdks-io/apimatic-gp-ruby-sdk/tree/0.0.1/doc/controllers/geta-batch.md)
131
+ * [Closea Batch](https://www.github.com/sdks-io/apimatic-gp-ruby-sdk/tree/0.0.1/doc/controllers/closea-batch.md)
132
+ * [Get Transactions Withina Batch](https://www.github.com/sdks-io/apimatic-gp-ruby-sdk/tree/0.0.1/doc/controllers/get-transactions-withina-batch.md)
133
+
134
+ ## SDK Infrastructure
135
+
136
+ ### Configuration
137
+
138
+ * [ProxySettings](https://www.github.com/sdks-io/apimatic-gp-ruby-sdk/tree/0.0.1/doc/proxy-settings.md)
139
+ * [Environment-Based Client Initialization](https://www.github.com/sdks-io/apimatic-gp-ruby-sdk/tree/0.0.1/doc/environment-based-client-initialization.md)
140
+ * [AbstractLogger](https://www.github.com/sdks-io/apimatic-gp-ruby-sdk/tree/0.0.1/doc/abstract-logger.md)
141
+ * [LoggingConfiguration](https://www.github.com/sdks-io/apimatic-gp-ruby-sdk/tree/0.0.1/doc/logging-configuration.md)
142
+ * [RequestLoggingConfiguration](https://www.github.com/sdks-io/apimatic-gp-ruby-sdk/tree/0.0.1/doc/request-logging-configuration.md)
143
+ * [ResponseLoggingConfiguration](https://www.github.com/sdks-io/apimatic-gp-ruby-sdk/tree/0.0.1/doc/response-logging-configuration.md)
144
+
145
+ ### HTTP
146
+
147
+ * [HttpResponse](https://www.github.com/sdks-io/apimatic-gp-ruby-sdk/tree/0.0.1/doc/http-response.md)
148
+ * [HttpRequest](https://www.github.com/sdks-io/apimatic-gp-ruby-sdk/tree/0.0.1/doc/http-request.md)
149
+
150
+ ### Utilities
151
+
152
+ * [ApiResponse](https://www.github.com/sdks-io/apimatic-gp-ruby-sdk/tree/0.0.1/doc/api-response.md)
153
+ * [ApiHelper](https://www.github.com/sdks-io/apimatic-gp-ruby-sdk/tree/0.0.1/doc/api-helper.md)
154
+ * [DateTimeHelper](https://www.github.com/sdks-io/apimatic-gp-ruby-sdk/tree/0.0.1/doc/date-time-helper.md)
155
+
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Load the lib folder into Ruby's load path
4
+ $LOAD_PATH.unshift(File.expand_path('../lib', __dir__))
5
+
6
+ # Require the gem
7
+ require 'batches'
8
+
9
+ puts 'Batches SDK loaded!'
10
+ puts 'You can now create a client with: client = Batches::Client.new'
11
+ puts 'Or use from_env: client = Batches::Client.from_env'
12
+
13
+ # Start an interactive IRB session
14
+ require 'irb'
15
+ IRB.start
@@ -0,0 +1,10 @@
1
+ # batches
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Batches
7
+ # API utility class
8
+ class APIHelper < CoreLibrary::ApiHelper
9
+ end
10
+ end
@@ -0,0 +1,67 @@
1
+ # batches
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Batches
7
+ # BaseApi.
8
+ class BaseApi
9
+ include CoreLibrary
10
+ attr_accessor :config, :http_call_back
11
+
12
+ def self.user_agent
13
+ 'Ruby-SDK/0.0.1 (OS: {os-info}, Engine: {engine}/{engine-version})'
14
+ end
15
+
16
+ def self.user_agent_parameters
17
+ {
18
+ '{engine}' => { 'value' => RUBY_ENGINE, 'encode' => false },
19
+ '{engine-version}' => { 'value' => RUBY_ENGINE_VERSION, 'encode' => false },
20
+ '{os-info}' => { 'value' => RUBY_PLATFORM, 'encode' => false }
21
+ }
22
+ end
23
+
24
+ GLOBAL_ERRORS = {
25
+ 'default' => ErrorCase.new
26
+ .error_message('HTTP response not OK.')
27
+ .exception_type(APIException)
28
+ }.freeze
29
+
30
+ # Initialization constructor.
31
+ # @param [GlobalConfiguration] global_configuration The instance of GlobalConfiguration.
32
+ def initialize(global_configuration)
33
+ @global_configuration = global_configuration
34
+ @config = @global_configuration.client_configuration
35
+ @http_call_back = @config.http_callback
36
+ @api_call = ApiCall.new(@global_configuration)
37
+ end
38
+
39
+ # Creates a new instance of the request builder.
40
+ # @param [String] http_method The HTTP method to use in the request.
41
+ # @param [String] path The endpoint path to use in the request.
42
+ # @param [String] server The server to extract the base uri for the request.
43
+ # @return [RequestBuilder] The instance of RequestBuilder.
44
+ def new_request_builder(http_method, path, server)
45
+ RequestBuilder.new
46
+ .http_method(http_method)
47
+ .path(path)
48
+ .server(server)
49
+ end
50
+
51
+ # Creates a new instance of the response handler.
52
+ # @return [ResponseHandler] The instance of ResponseHandler.
53
+ def new_response_handler
54
+ ResponseHandler.new
55
+ end
56
+
57
+ # Creates a new instance of the parameter.
58
+ # @param [String|optional] key The key of the parameter.
59
+ # @param [Object] value The value of the parameter.
60
+ # @return [Parameter] The instance of Parameter.
61
+ def new_parameter(value, key: nil)
62
+ Parameter.new
63
+ .key(key)
64
+ .value(value)
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,111 @@
1
+ # batches
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Batches
7
+ # CloseABatchApi
8
+ class CloseABatchApi < BaseApi
9
+ # Closing a batch results in commencement of funding to the merchant all the
10
+ # transactions in that batch.
11
+ # Availability of this feature in production depends on your allowed live
12
+ # configuration.
13
+ # Please contact Global Payments before coding this feature to confirm it
14
+ # will be available to you when you go live.
15
+ # @param [String] id Required parameter: TODO: type description here
16
+ # @param [String] authorization Required parameter: Bearer access token
17
+ # value used to authorize and access the API. Must always begin with the
18
+ # string "Bearer".
19
+ # @param [String] x_gp_version Required parameter: The version of the API to
20
+ # execute the request.
21
+ # @param [String] accept Optional parameter: Indicates the expected format
22
+ # of the message response.
23
+ # @return [ApiResponse] Complete http response with raw body and status code.
24
+ def close_single_batch(id,
25
+ authorization,
26
+ x_gp_version,
27
+ accept: 'application/json')
28
+ @api_call
29
+ .request(new_request_builder(HttpMethodEnum::POST,
30
+ '/batches/{id}',
31
+ Server::DEFAULT)
32
+ .template_param(new_parameter(id, key: 'id')
33
+ .is_required(true)
34
+ .should_encode(true))
35
+ .header_param(new_parameter(authorization, key: 'Authorization')
36
+ .is_required(true))
37
+ .header_param(new_parameter(x_gp_version, key: 'X-GP-Version')
38
+ .is_required(true))
39
+ .header_param(new_parameter(accept, key: 'Accept')))
40
+ .response(new_response_handler
41
+ .deserializer(APIHelper.method(:custom_type_deserializer))
42
+ .deserialize_into(CloseResponse.method(:from_hash))
43
+ .is_api_response(true)
44
+ .local_error('400',
45
+ 'Bad Request',
46
+ Batches400ErrorException)
47
+ .local_error('401',
48
+ 'Not Authenticated',
49
+ Batches401ErrorException)
50
+ .local_error('403',
51
+ 'Forbidden',
52
+ Batches403ErrorException)
53
+ .local_error('404',
54
+ 'Resource Not Found',
55
+ APIException)
56
+ .local_error('500',
57
+ 'Internal Server Error',
58
+ Batches500ErrorException)
59
+ .local_error('501',
60
+ 'Not implemented',
61
+ Batches501ErrorException)
62
+ .local_error('502',
63
+ 'Bad Gateway',
64
+ Batches502ErrorException)
65
+ .local_error('504',
66
+ 'Timeout',
67
+ Batches504ErrorException))
68
+ .execute
69
+ end
70
+
71
+ # Closing a batch results in commencement of funding to the merchant all the
72
+ # transactions in that batch. Here you can close the current open batch
73
+ # without the unique batch id.
74
+ # Availability of this feature in production depends on your allowed live
75
+ # configuration.
76
+ # Please contact Global Payments before coding this feature to confirm it
77
+ # will be available to you when you go live.
78
+ # @param [String] authorization Required parameter: Bearer access token
79
+ # value used to authorize and access the API. Must always begin with the
80
+ # string "Bearer".
81
+ # @param [String] x_gp_version Required parameter: The version of the API to
82
+ # execute the request.
83
+ # @param [String] accept Optional parameter: Indicates the expected format
84
+ # of the message response.
85
+ # @param [BatchesRequest] body Optional parameter: TODO: type description
86
+ # here
87
+ # @return [ApiResponse] Complete http response with raw body and status code.
88
+ def post_batches(authorization,
89
+ x_gp_version,
90
+ accept: 'application/json',
91
+ body: nil)
92
+ @api_call
93
+ .request(new_request_builder(HttpMethodEnum::POST,
94
+ '/batches',
95
+ Server::DEFAULT)
96
+ .header_param(new_parameter(authorization, key: 'Authorization')
97
+ .is_required(true))
98
+ .header_param(new_parameter('application/json', key: 'Content-type'))
99
+ .header_param(new_parameter(x_gp_version, key: 'X-GP-Version')
100
+ .is_required(true))
101
+ .header_param(new_parameter(accept, key: 'Accept'))
102
+ .body_param(new_parameter(body))
103
+ .body_serializer(proc do |param| param.to_json unless param.nil? end))
104
+ .response(new_response_handler
105
+ .deserializer(APIHelper.method(:custom_type_deserializer))
106
+ .deserialize_into(CloseResponse.method(:from_hash))
107
+ .is_api_response(true))
108
+ .execute
109
+ end
110
+ end
111
+ end
@@ -0,0 +1,70 @@
1
+ # batches
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Batches
7
+ # GetABatchApi
8
+ class GetABatchApi < BaseApi
9
+ # Get a single view of a Batch using the Global Payments Batch id.
10
+ # Availability of this feature in production depends on your allowed live
11
+ # configuration.
12
+ # Please contact Global Payments before coding this feature to confirm it
13
+ # will be available to you when you go live.
14
+ # @param [String] id Required parameter: TODO: type description here
15
+ # @param [String] authorization Required parameter: Bearer access token
16
+ # value used to authorize and access the API. Must always begin with the
17
+ # string "Bearer".
18
+ # @param [String] x_gp_version Required parameter: The version of the API to
19
+ # execute the request.
20
+ # @param [String] accept Optional parameter: Indicates the expected format
21
+ # of the message response.
22
+ # @return [ApiResponse] Complete http response with raw body and status code.
23
+ def get_single_batch(id,
24
+ authorization,
25
+ x_gp_version,
26
+ accept: 'application/json')
27
+ @api_call
28
+ .request(new_request_builder(HttpMethodEnum::GET,
29
+ '/batches/{id}',
30
+ Server::DEFAULT)
31
+ .template_param(new_parameter(id, key: 'id')
32
+ .is_required(true)
33
+ .should_encode(true))
34
+ .header_param(new_parameter(authorization, key: 'Authorization')
35
+ .is_required(true))
36
+ .header_param(new_parameter(x_gp_version, key: 'X-GP-Version')
37
+ .is_required(true))
38
+ .header_param(new_parameter(accept, key: 'Accept')))
39
+ .response(new_response_handler
40
+ .deserializer(APIHelper.method(:custom_type_deserializer))
41
+ .deserialize_into(GetResponse.method(:from_hash))
42
+ .is_api_response(true)
43
+ .local_error('400',
44
+ 'Bad Request',
45
+ Batches400ErrorException)
46
+ .local_error('401',
47
+ 'Not Authenticated',
48
+ Batches401ErrorException)
49
+ .local_error('403',
50
+ 'Forbidden',
51
+ Batches403ErrorException)
52
+ .local_error('404',
53
+ 'Resource Not Found',
54
+ APIException)
55
+ .local_error('500',
56
+ 'Internal Server Error',
57
+ Batches500ErrorException)
58
+ .local_error('501',
59
+ 'Not implemented',
60
+ Batches501ErrorException)
61
+ .local_error('502',
62
+ 'Bad Gateway',
63
+ Batches502ErrorException)
64
+ .local_error('504',
65
+ 'Timeout',
66
+ Batches504ErrorException))
67
+ .execute
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,69 @@
1
+ # batches
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Batches
7
+ # GetTransactionsWithinABatchApi
8
+ class GetTransactionsWithinABatchApi < BaseApi
9
+ # Get the details of all transactions within a given Batch. Availability of
10
+ # this feature in production depends on your allowed live configuration.
11
+ # Please contact Global Payments before coding this feature to confirm it
12
+ # will be available to you when you go live.
13
+ # @param [String] id Required parameter: TODO: type description here
14
+ # @param [String] authorization Required parameter: Bearer access token
15
+ # value used to authorize and access the API. Must always begin with the
16
+ # string "Bearer".
17
+ # @param [String] x_gp_version Required parameter: The version of the API to
18
+ # execute the request.
19
+ # @param [String] accept Optional parameter: Indicates the expected format
20
+ # of the message response.
21
+ # @return [ApiResponse] Complete http response with raw body and status code.
22
+ def get_batches_id_transactions(id,
23
+ authorization,
24
+ x_gp_version,
25
+ accept: 'application/json')
26
+ @api_call
27
+ .request(new_request_builder(HttpMethodEnum::GET,
28
+ '/batches/{id}/transactions',
29
+ Server::DEFAULT)
30
+ .template_param(new_parameter(id, key: 'id')
31
+ .is_required(true)
32
+ .should_encode(true))
33
+ .header_param(new_parameter(authorization, key: 'Authorization')
34
+ .is_required(true))
35
+ .header_param(new_parameter(x_gp_version, key: 'X-GP-Version')
36
+ .is_required(true))
37
+ .header_param(new_parameter(accept, key: 'Accept')))
38
+ .response(new_response_handler
39
+ .deserializer(APIHelper.method(:custom_type_deserializer))
40
+ .deserialize_into(TransactionBatchResponse.method(:from_hash))
41
+ .is_api_response(true)
42
+ .local_error('400',
43
+ 'Bad Request',
44
+ BatchesTransactions400ErrorException)
45
+ .local_error('401',
46
+ 'Not Authenticated',
47
+ BatchesTransactions401ErrorException)
48
+ .local_error('403',
49
+ 'Forbidden',
50
+ BatchesTransactions403ErrorException)
51
+ .local_error('404',
52
+ 'Resource Not Found',
53
+ APIException)
54
+ .local_error('500',
55
+ 'Internal Server Error',
56
+ BatchesTransactions500ErrorException)
57
+ .local_error('501',
58
+ 'Not implemented',
59
+ BatchesTransactions501ErrorException)
60
+ .local_error('502',
61
+ 'Bad Gateway',
62
+ BatchesTransactions502ErrorException)
63
+ .local_error('504',
64
+ 'Timeout',
65
+ BatchesTransactions504ErrorException))
66
+ .execute
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,72 @@
1
+ # batches
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Batches
7
+ # batches client class.
8
+ class Client
9
+ include CoreLibrary
10
+ attr_reader :config
11
+
12
+ def user_agent_detail
13
+ config.user_agent_detail
14
+ end
15
+
16
+ # Access to get_a_batch controller.
17
+ # @return [GetABatchApi] Returns the controller instance.
18
+ def get_a_batch
19
+ @get_a_batch ||= GetABatchApi.new @global_configuration
20
+ end
21
+
22
+ # Access to close_a_batch controller.
23
+ # @return [CloseABatchApi] Returns the controller instance.
24
+ def close_a_batch
25
+ @close_a_batch ||= CloseABatchApi.new @global_configuration
26
+ end
27
+
28
+ # Access to get_transactions_within_a_batch controller.
29
+ # @return [GetTransactionsWithinABatchApi] Returns the controller instance.
30
+ def get_transactions_within_a_batch
31
+ @get_transactions_within_a_batch ||= GetTransactionsWithinABatchApi.new @global_configuration
32
+ end
33
+
34
+ def initialize(
35
+ connection: nil, adapter: :net_http_persistent, timeout: 30,
36
+ max_retries: 0, retry_interval: 1, backoff_factor: 2,
37
+ retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
38
+ retry_methods: %i[get put], http_callback: nil, proxy_settings: nil,
39
+ logging_configuration: nil, environment: Environment::PRODUCTION,
40
+ config: nil
41
+ )
42
+ @config = if config.nil?
43
+ Configuration.new(
44
+ connection: connection, adapter: adapter, timeout: timeout,
45
+ max_retries: max_retries, retry_interval: retry_interval,
46
+ backoff_factor: backoff_factor,
47
+ retry_statuses: retry_statuses,
48
+ retry_methods: retry_methods, http_callback: http_callback,
49
+ proxy_settings: proxy_settings,
50
+ logging_configuration: logging_configuration,
51
+ environment: environment
52
+ )
53
+ else
54
+ config
55
+ end
56
+ user_agent_params = BaseApi.user_agent_parameters
57
+
58
+ @global_configuration = GlobalConfiguration.new(client_configuration: @config)
59
+ .base_uri_executor(@config.method(:get_base_uri))
60
+ .global_errors(BaseApi::GLOBAL_ERRORS)
61
+ .user_agent(BaseApi.user_agent,
62
+ agent_parameters: user_agent_params)
63
+ end
64
+
65
+ # Creates a client directly from environment variables.
66
+ def self.from_env(**overrides)
67
+ default_config = Configuration.build_default_config_from_env
68
+ new_config = default_config.clone_with(**overrides)
69
+ new(config: new_config)
70
+ end
71
+ end
72
+ end