mx-platform-ruby 0.42.0 → 0.43.0

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 (42) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/docs/MicrodepositRequest.md +30 -0
  4. data/docs/MicrodepositRequestBody.md +18 -0
  5. data/docs/MicrodepositResponse.md +44 -0
  6. data/docs/MicrodepositResponseBody.md +18 -0
  7. data/docs/MicrodepositVerifyRequest.md +20 -0
  8. data/docs/MicrodepositVerifyRequestBody.md +18 -0
  9. data/docs/MicrodepositsApi.md +371 -0
  10. data/docs/MicrodepositsResponseBody.md +20 -0
  11. data/docs/TransactionCreateRequest.md +40 -0
  12. data/docs/TransactionCreateRequestBody.md +18 -0
  13. data/docs/TransactionCreateResponseBody.md +104 -0
  14. data/docs/TransactionsApi.md +82 -0
  15. data/lib/mx-platform-ruby/api/microdeposits_api.rb +365 -0
  16. data/lib/mx-platform-ruby/api/transactions_api.rb +102 -0
  17. data/lib/mx-platform-ruby/models/microdeposit_request.rb +289 -0
  18. data/lib/mx-platform-ruby/models/microdeposit_request_body.rb +214 -0
  19. data/lib/mx-platform-ruby/models/microdeposit_response.rb +331 -0
  20. data/lib/mx-platform-ruby/models/microdeposit_response_body.rb +214 -0
  21. data/lib/mx-platform-ruby/models/microdeposit_verify_request.rb +223 -0
  22. data/lib/mx-platform-ruby/models/microdeposit_verify_request_body.rb +214 -0
  23. data/lib/mx-platform-ruby/models/microdeposits_response_body.rb +225 -0
  24. data/lib/mx-platform-ruby/models/transaction_create_request.rb +344 -0
  25. data/lib/mx-platform-ruby/models/transaction_create_request_body.rb +214 -0
  26. data/lib/mx-platform-ruby/models/transaction_create_response_body.rb +642 -0
  27. data/lib/mx-platform-ruby/version.rb +1 -1
  28. data/lib/mx-platform-ruby.rb +12 -0
  29. data/openapi/config.yml +1 -1
  30. data/spec/api/microdeposits_api_spec.rb +99 -0
  31. data/spec/api/transactions_api_spec.rb +49 -0
  32. data/spec/models/microdeposit_request_body_spec.rb +34 -0
  33. data/spec/models/microdeposit_request_spec.rb +70 -0
  34. data/spec/models/microdeposit_response_body_spec.rb +34 -0
  35. data/spec/models/microdeposit_response_spec.rb +112 -0
  36. data/spec/models/microdeposit_verify_request_body_spec.rb +34 -0
  37. data/spec/models/microdeposit_verify_request_spec.rb +40 -0
  38. data/spec/models/microdeposits_response_body_spec.rb +40 -0
  39. data/spec/models/transaction_create_request_body_spec.rb +34 -0
  40. data/spec/models/transaction_create_request_spec.rb +100 -0
  41. data/spec/models/transaction_create_response_body_spec.rb +292 -0
  42. metadata +195 -147
@@ -0,0 +1,104 @@
1
+ # MxPlatformRuby::TransactionCreateResponseBody
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **account_guid** | **String** | | [optional] |
8
+ | **account_id** | **String** | | [optional] |
9
+ | **amount** | **Float** | | [optional] |
10
+ | **category** | **String** | | [optional] |
11
+ | **category_guid** | **String** | | [optional] |
12
+ | **check_number_string** | **String** | | [optional] |
13
+ | **created_at** | **String** | | [optional] |
14
+ | **currency_code** | **String** | | [optional] |
15
+ | **date** | **String** | | [optional] |
16
+ | **description** | **String** | | [optional] |
17
+ | **extended_transaction_type** | **String** | | [optional] |
18
+ | **guid** | **String** | | [optional] |
19
+ | **id** | **String** | | [optional] |
20
+ | **is_bill_pay** | **Boolean** | | [optional] |
21
+ | **is_direct_deposit** | **Boolean** | | [optional] |
22
+ | **is_expense** | **Boolean** | | [optional] |
23
+ | **is_fee** | **Boolean** | | [optional] |
24
+ | **is_income** | **Boolean** | | [optional] |
25
+ | **is_international** | **Boolean** | | [optional] |
26
+ | **is_manual** | **Boolean** | | [optional] |
27
+ | **is_overdraft_fee** | **Boolean** | | [optional] |
28
+ | **is_payroll_advance** | **Boolean** | | [optional] |
29
+ | **is_recurring** | **Boolean** | | [optional] |
30
+ | **is_subscription** | **Boolean** | | [optional] |
31
+ | **latitude** | **Float** | | [optional] |
32
+ | **localized_description** | **String** | | [optional] |
33
+ | **localized_memo** | **String** | | [optional] |
34
+ | **longitude** | **Float** | | [optional] |
35
+ | **member_guid** | **String** | | [optional] |
36
+ | **member_is_managed_by_user** | **Boolean** | | [optional] |
37
+ | **memo** | **String** | | [optional] |
38
+ | **merchant_category_code** | **Integer** | | [optional] |
39
+ | **merchant_guid** | **String** | | [optional] |
40
+ | **merchant_location_guid** | **String** | | [optional] |
41
+ | **metadata** | **String** | | [optional] |
42
+ | **original_description** | **String** | | [optional] |
43
+ | **posted_at** | **String** | | [optional] |
44
+ | **status** | **String** | | [optional] |
45
+ | **top_level_category** | **String** | | [optional] |
46
+ | **transacted_at** | **String** | | [optional] |
47
+ | **type** | **String** | | [optional] |
48
+ | **updated_at** | **String** | | [optional] |
49
+ | **user_guid** | **String** | | [optional] |
50
+ | **user_id** | **String** | | [optional] |
51
+
52
+ ## Example
53
+
54
+ ```ruby
55
+ require 'mx-platform-ruby'
56
+
57
+ instance = MxPlatformRuby::TransactionCreateResponseBody.new(
58
+ account_guid: ACT-06d7f44b-caae-0f6e-1384-01f52e75dcb1,
59
+ account_id: account123,
60
+ amount: 61.11,
61
+ category: Groceries,
62
+ category_guid: CAT-b6d61a19-30a7-e852-2703-bdfb4072289e,
63
+ check_number_string: null,
64
+ created_at: 2016-10-08T09:43:42.000Z,
65
+ currency_code: USD,
66
+ date: 2016-10-06T00:00:00.000Z,
67
+ description: Whole foods,
68
+ extended_transaction_type: null,
69
+ guid: TRN-265abee9-889b-af6a-c69b-25157db2bdd9,
70
+ id: null,
71
+ is_bill_pay: false,
72
+ is_direct_deposit: false,
73
+ is_expense: true,
74
+ is_fee: false,
75
+ is_income: false,
76
+ is_international: false,
77
+ is_manual: true,
78
+ is_overdraft_fee: false,
79
+ is_payroll_advance: false,
80
+ is_recurring: null,
81
+ is_subscription: false,
82
+ latitude: null,
83
+ localized_description: null,
84
+ localized_memo: null,
85
+ longitude: null,
86
+ member_guid: MBR-7c6f361b-e582-15b6-60c0-358f12466b4b,
87
+ member_is_managed_by_user: true,
88
+ memo: This is a memo,
89
+ merchant_category_code: null,
90
+ merchant_guid: null,
91
+ merchant_location_guid: null,
92
+ metadata: some metadata,
93
+ original_description: null,
94
+ posted_at: null,
95
+ status: null,
96
+ top_level_category: Food & Dining,
97
+ transacted_at: null,
98
+ type: DEBIT,
99
+ updated_at: 2016-10-08T05:49:12.000Z,
100
+ user_guid: USR-fa7537f3-48aa-a683-a02a-b18940482f54,
101
+ user_id: user123
102
+ )
103
+ ```
104
+
@@ -0,0 +1,82 @@
1
+ # MxPlatformRuby::TransactionsApi
2
+
3
+ All URIs are relative to *https://api.mx.com*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**users_user_guid_accounts_account_guid_transactions_post**](TransactionsApi.md#users_user_guid_accounts_account_guid_transactions_post) | **POST** /users/{user_guid}/accounts/{account_guid}/transactions | Create manual transaction |
8
+
9
+
10
+ ## users_user_guid_accounts_account_guid_transactions_post
11
+
12
+ > <TransactionCreateResponseBody> users_user_guid_accounts_account_guid_transactions_post(user_guid, account_guid, transaction_create_request_body)
13
+
14
+ Create manual transaction
15
+
16
+ This endpoint can only be used to create manual transactions that are under a manual account. This endpoint accepts the optional MX-Skip-Webhook header and skip_webhook parameter.
17
+
18
+ ### Examples
19
+
20
+ ```ruby
21
+ require 'time'
22
+ require 'mx-platform-ruby'
23
+ # setup authorization
24
+ MxPlatformRuby.configure do |config|
25
+ # Configure HTTP basic authorization: basicAuth
26
+ config.username = 'YOUR USERNAME'
27
+ config.password = 'YOUR PASSWORD'
28
+ end
29
+
30
+ api_instance = MxPlatformRuby::TransactionsApi.new
31
+ user_guid = 'user_guid_example' # String | The unique identifier for the user.
32
+ account_guid = 'account_guid_example' # String | The unique identifier for the account.
33
+ transaction_create_request_body = MxPlatformRuby::TransactionCreateRequestBody.new # TransactionCreateRequestBody |
34
+
35
+ begin
36
+ # Create manual transaction
37
+ result = api_instance.users_user_guid_accounts_account_guid_transactions_post(user_guid, account_guid, transaction_create_request_body)
38
+ p result
39
+ rescue MxPlatformRuby::ApiError => e
40
+ puts "Error when calling TransactionsApi->users_user_guid_accounts_account_guid_transactions_post: #{e}"
41
+ end
42
+ ```
43
+
44
+ #### Using the users_user_guid_accounts_account_guid_transactions_post_with_http_info variant
45
+
46
+ This returns an Array which contains the response data, status code and headers.
47
+
48
+ > <Array(<TransactionCreateResponseBody>, Integer, Hash)> users_user_guid_accounts_account_guid_transactions_post_with_http_info(user_guid, account_guid, transaction_create_request_body)
49
+
50
+ ```ruby
51
+ begin
52
+ # Create manual transaction
53
+ data, status_code, headers = api_instance.users_user_guid_accounts_account_guid_transactions_post_with_http_info(user_guid, account_guid, transaction_create_request_body)
54
+ p status_code # => 2xx
55
+ p headers # => { ... }
56
+ p data # => <TransactionCreateResponseBody>
57
+ rescue MxPlatformRuby::ApiError => e
58
+ puts "Error when calling TransactionsApi->users_user_guid_accounts_account_guid_transactions_post_with_http_info: #{e}"
59
+ end
60
+ ```
61
+
62
+ ### Parameters
63
+
64
+ | Name | Type | Description | Notes |
65
+ | ---- | ---- | ----------- | ----- |
66
+ | **user_guid** | **String** | The unique identifier for the user. | |
67
+ | **account_guid** | **String** | The unique identifier for the account. | |
68
+ | **transaction_create_request_body** | [**TransactionCreateRequestBody**](TransactionCreateRequestBody.md) | | |
69
+
70
+ ### Return type
71
+
72
+ [**TransactionCreateResponseBody**](TransactionCreateResponseBody.md)
73
+
74
+ ### Authorization
75
+
76
+ [basicAuth](../README.md#basicAuth)
77
+
78
+ ### HTTP request headers
79
+
80
+ - **Content-Type**: application/json
81
+ - **Accept**: application/vnd.mx.api.v1+json
82
+
@@ -0,0 +1,365 @@
1
+ =begin
2
+ #MX Platform API
3
+
4
+ #The MX Platform API is a powerful, fully-featured API designed to make aggregating and enhancing financial data easy and reliable. It can seamlessly connect your app or website to tens of thousands of financial institutions.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 7.0.1
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module MxPlatformRuby
16
+ class MicrodepositsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Verify a Microdeposit
23
+ # Use this endpoint to verify the amounts deposited into the account during a microdeposit verification. The verification has not successfully completed until the `status` is `VERIFIED`. Poll the `/users/{user_guid}/micro_deposits/{micro_deposit_guid}` (read microdeposit) endpoint until you see this status or an error state.
24
+ # @param microdeposit_guid [String] The unique identifier for the microdeposit. Defined by MX.
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [MicrodepositVerifyRequestBody] :microdeposit_verify_request_body
27
+ # @return [MicrodepositResponseBody]
28
+ def micro_deposits_microdeposit_guid_verify_put(microdeposit_guid, opts = {})
29
+ data, _status_code, _headers = micro_deposits_microdeposit_guid_verify_put_with_http_info(microdeposit_guid, opts)
30
+ data
31
+ end
32
+
33
+ # Verify a Microdeposit
34
+ # Use this endpoint to verify the amounts deposited into the account during a microdeposit verification. The verification has not successfully completed until the &#x60;status&#x60; is &#x60;VERIFIED&#x60;. Poll the &#x60;/users/{user_guid}/micro_deposits/{micro_deposit_guid}&#x60; (read microdeposit) endpoint until you see this status or an error state.
35
+ # @param microdeposit_guid [String] The unique identifier for the microdeposit. Defined by MX.
36
+ # @param [Hash] opts the optional parameters
37
+ # @option opts [MicrodepositVerifyRequestBody] :microdeposit_verify_request_body
38
+ # @return [Array<(MicrodepositResponseBody, Integer, Hash)>] MicrodepositResponseBody data, response status code and response headers
39
+ def micro_deposits_microdeposit_guid_verify_put_with_http_info(microdeposit_guid, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: MicrodepositsApi.micro_deposits_microdeposit_guid_verify_put ...'
42
+ end
43
+ # verify the required parameter 'microdeposit_guid' is set
44
+ if @api_client.config.client_side_validation && microdeposit_guid.nil?
45
+ fail ArgumentError, "Missing the required parameter 'microdeposit_guid' when calling MicrodepositsApi.micro_deposits_microdeposit_guid_verify_put"
46
+ end
47
+ # resource path
48
+ local_var_path = '/micro_deposits/{microdeposit_guid}/verify'.sub('{' + 'microdeposit_guid' + '}', CGI.escape(microdeposit_guid.to_s))
49
+
50
+ # query parameters
51
+ query_params = opts[:query_params] || {}
52
+
53
+ # header parameters
54
+ header_params = opts[:header_params] || {}
55
+ # HTTP header 'Accept' (if needed)
56
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
57
+ # HTTP header 'Content-Type'
58
+ content_type = @api_client.select_header_content_type(['application/json'])
59
+ if !content_type.nil?
60
+ header_params['Content-Type'] = content_type
61
+ end
62
+
63
+ # form parameters
64
+ form_params = opts[:form_params] || {}
65
+
66
+ # http body (model)
67
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'microdeposit_verify_request_body'])
68
+
69
+ # return_type
70
+ return_type = opts[:debug_return_type] || 'MicrodepositResponseBody'
71
+
72
+ # auth_names
73
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
74
+
75
+ new_options = opts.merge(
76
+ :operation => :"MicrodepositsApi.micro_deposits_microdeposit_guid_verify_put",
77
+ :header_params => header_params,
78
+ :query_params => query_params,
79
+ :form_params => form_params,
80
+ :body => post_body,
81
+ :auth_names => auth_names,
82
+ :return_type => return_type
83
+ )
84
+
85
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
86
+ if @api_client.config.debugging
87
+ @api_client.config.logger.debug "API called: MicrodepositsApi#micro_deposits_microdeposit_guid_verify_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
88
+ end
89
+ return data, status_code, headers
90
+ end
91
+
92
+ # List all microdeposits for a user
93
+ # Use this endpoint to read the attributes of a specific microdeposit according to its unique GUID.
94
+ # @param user_guid [String] The unique identifier for the user. Defined by MX.
95
+ # @param [Hash] opts the optional parameters
96
+ # @return [MicrodepositsResponseBody]
97
+ def users_user_guid_micro_deposits_get(user_guid, opts = {})
98
+ data, _status_code, _headers = users_user_guid_micro_deposits_get_with_http_info(user_guid, opts)
99
+ data
100
+ end
101
+
102
+ # List all microdeposits for a user
103
+ # Use this endpoint to read the attributes of a specific microdeposit according to its unique GUID.
104
+ # @param user_guid [String] The unique identifier for the user. Defined by MX.
105
+ # @param [Hash] opts the optional parameters
106
+ # @return [Array<(MicrodepositsResponseBody, Integer, Hash)>] MicrodepositsResponseBody data, response status code and response headers
107
+ def users_user_guid_micro_deposits_get_with_http_info(user_guid, opts = {})
108
+ if @api_client.config.debugging
109
+ @api_client.config.logger.debug 'Calling API: MicrodepositsApi.users_user_guid_micro_deposits_get ...'
110
+ end
111
+ # verify the required parameter 'user_guid' is set
112
+ if @api_client.config.client_side_validation && user_guid.nil?
113
+ fail ArgumentError, "Missing the required parameter 'user_guid' when calling MicrodepositsApi.users_user_guid_micro_deposits_get"
114
+ end
115
+ # resource path
116
+ local_var_path = '/users/{user_guid}/micro_deposits'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s))
117
+
118
+ # query parameters
119
+ query_params = opts[:query_params] || {}
120
+
121
+ # header parameters
122
+ header_params = opts[:header_params] || {}
123
+ # HTTP header 'Accept' (if needed)
124
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
125
+
126
+ # form parameters
127
+ form_params = opts[:form_params] || {}
128
+
129
+ # http body (model)
130
+ post_body = opts[:debug_body]
131
+
132
+ # return_type
133
+ return_type = opts[:debug_return_type] || 'MicrodepositsResponseBody'
134
+
135
+ # auth_names
136
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
137
+
138
+ new_options = opts.merge(
139
+ :operation => :"MicrodepositsApi.users_user_guid_micro_deposits_get",
140
+ :header_params => header_params,
141
+ :query_params => query_params,
142
+ :form_params => form_params,
143
+ :body => post_body,
144
+ :auth_names => auth_names,
145
+ :return_type => return_type
146
+ )
147
+
148
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
149
+ if @api_client.config.debugging
150
+ @api_client.config.logger.debug "API called: MicrodepositsApi#users_user_guid_micro_deposits_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
151
+ end
152
+ return data, status_code, headers
153
+ end
154
+
155
+ # Delete a microdeposit
156
+ # Use this endpoint to delete the specified microdeposit.
157
+ # @param micro_deposit_guid [String] The unique identifier for the microdeposit. Defined by MX.
158
+ # @param user_guid [String] The unique id for a &#x60;user&#x60;.
159
+ # @param [Hash] opts the optional parameters
160
+ # @return [nil]
161
+ def users_user_guid_micro_deposits_micro_deposit_guid_delete(micro_deposit_guid, user_guid, opts = {})
162
+ users_user_guid_micro_deposits_micro_deposit_guid_delete_with_http_info(micro_deposit_guid, user_guid, opts)
163
+ nil
164
+ end
165
+
166
+ # Delete a microdeposit
167
+ # Use this endpoint to delete the specified microdeposit.
168
+ # @param micro_deposit_guid [String] The unique identifier for the microdeposit. Defined by MX.
169
+ # @param user_guid [String] The unique id for a &#x60;user&#x60;.
170
+ # @param [Hash] opts the optional parameters
171
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
172
+ def users_user_guid_micro_deposits_micro_deposit_guid_delete_with_http_info(micro_deposit_guid, user_guid, opts = {})
173
+ if @api_client.config.debugging
174
+ @api_client.config.logger.debug 'Calling API: MicrodepositsApi.users_user_guid_micro_deposits_micro_deposit_guid_delete ...'
175
+ end
176
+ # verify the required parameter 'micro_deposit_guid' is set
177
+ if @api_client.config.client_side_validation && micro_deposit_guid.nil?
178
+ fail ArgumentError, "Missing the required parameter 'micro_deposit_guid' when calling MicrodepositsApi.users_user_guid_micro_deposits_micro_deposit_guid_delete"
179
+ end
180
+ # verify the required parameter 'user_guid' is set
181
+ if @api_client.config.client_side_validation && user_guid.nil?
182
+ fail ArgumentError, "Missing the required parameter 'user_guid' when calling MicrodepositsApi.users_user_guid_micro_deposits_micro_deposit_guid_delete"
183
+ end
184
+ # resource path
185
+ local_var_path = '/users/{user_guid}/micro_deposits/{micro_deposit_guid}'.sub('{' + 'micro_deposit_guid' + '}', CGI.escape(micro_deposit_guid.to_s)).sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s))
186
+
187
+ # query parameters
188
+ query_params = opts[:query_params] || {}
189
+
190
+ # header parameters
191
+ header_params = opts[:header_params] || {}
192
+
193
+ # form parameters
194
+ form_params = opts[:form_params] || {}
195
+
196
+ # http body (model)
197
+ post_body = opts[:debug_body]
198
+
199
+ # return_type
200
+ return_type = opts[:debug_return_type]
201
+
202
+ # auth_names
203
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
204
+
205
+ new_options = opts.merge(
206
+ :operation => :"MicrodepositsApi.users_user_guid_micro_deposits_micro_deposit_guid_delete",
207
+ :header_params => header_params,
208
+ :query_params => query_params,
209
+ :form_params => form_params,
210
+ :body => post_body,
211
+ :auth_names => auth_names,
212
+ :return_type => return_type
213
+ )
214
+
215
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
216
+ if @api_client.config.debugging
217
+ @api_client.config.logger.debug "API called: MicrodepositsApi#users_user_guid_micro_deposits_micro_deposit_guid_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
218
+ end
219
+ return data, status_code, headers
220
+ end
221
+
222
+ # Read a microdeposit for a user
223
+ # Use this endpoint to read the attributes of a specific microdeposit according to its unique GUID. <br></br> Webhooks for microdeposit status changes are triggered when a status changes. The actual status of the microdeposit guid updates every minute. You may force a status update by calling the read microdeposit endpoint.
224
+ # @param user_guid [String] The unique identifier for the user. Defined by MX.
225
+ # @param micro_deposit_guid [String] The unique identifier for the microdeposit. Defined by MX.
226
+ # @param [Hash] opts the optional parameters
227
+ # @return [MicrodepositResponseBody]
228
+ def users_user_guid_micro_deposits_micro_deposit_guid_get(user_guid, micro_deposit_guid, opts = {})
229
+ data, _status_code, _headers = users_user_guid_micro_deposits_micro_deposit_guid_get_with_http_info(user_guid, micro_deposit_guid, opts)
230
+ data
231
+ end
232
+
233
+ # Read a microdeposit for a user
234
+ # Use this endpoint to read the attributes of a specific microdeposit according to its unique GUID. &lt;br&gt;&lt;/br&gt; Webhooks for microdeposit status changes are triggered when a status changes. The actual status of the microdeposit guid updates every minute. You may force a status update by calling the read microdeposit endpoint.
235
+ # @param user_guid [String] The unique identifier for the user. Defined by MX.
236
+ # @param micro_deposit_guid [String] The unique identifier for the microdeposit. Defined by MX.
237
+ # @param [Hash] opts the optional parameters
238
+ # @return [Array<(MicrodepositResponseBody, Integer, Hash)>] MicrodepositResponseBody data, response status code and response headers
239
+ def users_user_guid_micro_deposits_micro_deposit_guid_get_with_http_info(user_guid, micro_deposit_guid, opts = {})
240
+ if @api_client.config.debugging
241
+ @api_client.config.logger.debug 'Calling API: MicrodepositsApi.users_user_guid_micro_deposits_micro_deposit_guid_get ...'
242
+ end
243
+ # verify the required parameter 'user_guid' is set
244
+ if @api_client.config.client_side_validation && user_guid.nil?
245
+ fail ArgumentError, "Missing the required parameter 'user_guid' when calling MicrodepositsApi.users_user_guid_micro_deposits_micro_deposit_guid_get"
246
+ end
247
+ # verify the required parameter 'micro_deposit_guid' is set
248
+ if @api_client.config.client_side_validation && micro_deposit_guid.nil?
249
+ fail ArgumentError, "Missing the required parameter 'micro_deposit_guid' when calling MicrodepositsApi.users_user_guid_micro_deposits_micro_deposit_guid_get"
250
+ end
251
+ # resource path
252
+ local_var_path = '/users/{user_guid}/micro_deposits/{micro_deposit_guid}'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s)).sub('{' + 'micro_deposit_guid' + '}', CGI.escape(micro_deposit_guid.to_s))
253
+
254
+ # query parameters
255
+ query_params = opts[:query_params] || {}
256
+
257
+ # header parameters
258
+ header_params = opts[:header_params] || {}
259
+ # HTTP header 'Accept' (if needed)
260
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
261
+
262
+ # form parameters
263
+ form_params = opts[:form_params] || {}
264
+
265
+ # http body (model)
266
+ post_body = opts[:debug_body]
267
+
268
+ # return_type
269
+ return_type = opts[:debug_return_type] || 'MicrodepositResponseBody'
270
+
271
+ # auth_names
272
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
273
+
274
+ new_options = opts.merge(
275
+ :operation => :"MicrodepositsApi.users_user_guid_micro_deposits_micro_deposit_guid_get",
276
+ :header_params => header_params,
277
+ :query_params => query_params,
278
+ :form_params => form_params,
279
+ :body => post_body,
280
+ :auth_names => auth_names,
281
+ :return_type => return_type
282
+ )
283
+
284
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
285
+ if @api_client.config.debugging
286
+ @api_client.config.logger.debug "API called: MicrodepositsApi#users_user_guid_micro_deposits_micro_deposit_guid_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
287
+ end
288
+ return data, status_code, headers
289
+ end
290
+
291
+ # Create a microdeposit
292
+ # Use this endpoint to create a microdeposit. The response will include the new microdeposit record with a status of INITIATED.
293
+ # @param user_guid [String] The unique identifier for the user. Defined by MX.
294
+ # @param microdeposit_request_body [MicrodepositRequestBody]
295
+ # @param [Hash] opts the optional parameters
296
+ # @return [MicrodepositResponseBody]
297
+ def users_user_guid_micro_deposits_post(user_guid, microdeposit_request_body, opts = {})
298
+ data, _status_code, _headers = users_user_guid_micro_deposits_post_with_http_info(user_guid, microdeposit_request_body, opts)
299
+ data
300
+ end
301
+
302
+ # Create a microdeposit
303
+ # Use this endpoint to create a microdeposit. The response will include the new microdeposit record with a status of INITIATED.
304
+ # @param user_guid [String] The unique identifier for the user. Defined by MX.
305
+ # @param microdeposit_request_body [MicrodepositRequestBody]
306
+ # @param [Hash] opts the optional parameters
307
+ # @return [Array<(MicrodepositResponseBody, Integer, Hash)>] MicrodepositResponseBody data, response status code and response headers
308
+ def users_user_guid_micro_deposits_post_with_http_info(user_guid, microdeposit_request_body, opts = {})
309
+ if @api_client.config.debugging
310
+ @api_client.config.logger.debug 'Calling API: MicrodepositsApi.users_user_guid_micro_deposits_post ...'
311
+ end
312
+ # verify the required parameter 'user_guid' is set
313
+ if @api_client.config.client_side_validation && user_guid.nil?
314
+ fail ArgumentError, "Missing the required parameter 'user_guid' when calling MicrodepositsApi.users_user_guid_micro_deposits_post"
315
+ end
316
+ # verify the required parameter 'microdeposit_request_body' is set
317
+ if @api_client.config.client_side_validation && microdeposit_request_body.nil?
318
+ fail ArgumentError, "Missing the required parameter 'microdeposit_request_body' when calling MicrodepositsApi.users_user_guid_micro_deposits_post"
319
+ end
320
+ # resource path
321
+ local_var_path = '/users/{user_guid}/micro_deposits'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s))
322
+
323
+ # query parameters
324
+ query_params = opts[:query_params] || {}
325
+
326
+ # header parameters
327
+ header_params = opts[:header_params] || {}
328
+ # HTTP header 'Accept' (if needed)
329
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
330
+ # HTTP header 'Content-Type'
331
+ content_type = @api_client.select_header_content_type(['application/json'])
332
+ if !content_type.nil?
333
+ header_params['Content-Type'] = content_type
334
+ end
335
+
336
+ # form parameters
337
+ form_params = opts[:form_params] || {}
338
+
339
+ # http body (model)
340
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(microdeposit_request_body)
341
+
342
+ # return_type
343
+ return_type = opts[:debug_return_type] || 'MicrodepositResponseBody'
344
+
345
+ # auth_names
346
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
347
+
348
+ new_options = opts.merge(
349
+ :operation => :"MicrodepositsApi.users_user_guid_micro_deposits_post",
350
+ :header_params => header_params,
351
+ :query_params => query_params,
352
+ :form_params => form_params,
353
+ :body => post_body,
354
+ :auth_names => auth_names,
355
+ :return_type => return_type
356
+ )
357
+
358
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
359
+ if @api_client.config.debugging
360
+ @api_client.config.logger.debug "API called: MicrodepositsApi#users_user_guid_micro_deposits_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
361
+ end
362
+ return data, status_code, headers
363
+ end
364
+ end
365
+ end
@@ -0,0 +1,102 @@
1
+ =begin
2
+ #MX Platform API
3
+
4
+ #The MX Platform API is a powerful, fully-featured API designed to make aggregating and enhancing financial data easy and reliable. It can seamlessly connect your app or website to tens of thousands of financial institutions.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 7.0.1
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module MxPlatformRuby
16
+ class TransactionsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create manual transaction
23
+ # This endpoint can only be used to create manual transactions that are under a manual account. This endpoint accepts the optional MX-Skip-Webhook header and skip_webhook parameter.
24
+ # @param user_guid [String] The unique identifier for the user.
25
+ # @param account_guid [String] The unique identifier for the account.
26
+ # @param transaction_create_request_body [TransactionCreateRequestBody]
27
+ # @param [Hash] opts the optional parameters
28
+ # @return [TransactionCreateResponseBody]
29
+ def users_user_guid_accounts_account_guid_transactions_post(user_guid, account_guid, transaction_create_request_body, opts = {})
30
+ data, _status_code, _headers = users_user_guid_accounts_account_guid_transactions_post_with_http_info(user_guid, account_guid, transaction_create_request_body, opts)
31
+ data
32
+ end
33
+
34
+ # Create manual transaction
35
+ # This endpoint can only be used to create manual transactions that are under a manual account. This endpoint accepts the optional MX-Skip-Webhook header and skip_webhook parameter.
36
+ # @param user_guid [String] The unique identifier for the user.
37
+ # @param account_guid [String] The unique identifier for the account.
38
+ # @param transaction_create_request_body [TransactionCreateRequestBody]
39
+ # @param [Hash] opts the optional parameters
40
+ # @return [Array<(TransactionCreateResponseBody, Integer, Hash)>] TransactionCreateResponseBody data, response status code and response headers
41
+ def users_user_guid_accounts_account_guid_transactions_post_with_http_info(user_guid, account_guid, transaction_create_request_body, opts = {})
42
+ if @api_client.config.debugging
43
+ @api_client.config.logger.debug 'Calling API: TransactionsApi.users_user_guid_accounts_account_guid_transactions_post ...'
44
+ end
45
+ # verify the required parameter 'user_guid' is set
46
+ if @api_client.config.client_side_validation && user_guid.nil?
47
+ fail ArgumentError, "Missing the required parameter 'user_guid' when calling TransactionsApi.users_user_guid_accounts_account_guid_transactions_post"
48
+ end
49
+ # verify the required parameter 'account_guid' is set
50
+ if @api_client.config.client_side_validation && account_guid.nil?
51
+ fail ArgumentError, "Missing the required parameter 'account_guid' when calling TransactionsApi.users_user_guid_accounts_account_guid_transactions_post"
52
+ end
53
+ # verify the required parameter 'transaction_create_request_body' is set
54
+ if @api_client.config.client_side_validation && transaction_create_request_body.nil?
55
+ fail ArgumentError, "Missing the required parameter 'transaction_create_request_body' when calling TransactionsApi.users_user_guid_accounts_account_guid_transactions_post"
56
+ end
57
+ # resource path
58
+ local_var_path = '/users/{user_guid}/accounts/{account_guid}/transactions'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s)).sub('{' + 'account_guid' + '}', CGI.escape(account_guid.to_s))
59
+
60
+ # query parameters
61
+ query_params = opts[:query_params] || {}
62
+
63
+ # header parameters
64
+ header_params = opts[:header_params] || {}
65
+ # HTTP header 'Accept' (if needed)
66
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
67
+ # HTTP header 'Content-Type'
68
+ content_type = @api_client.select_header_content_type(['application/json'])
69
+ if !content_type.nil?
70
+ header_params['Content-Type'] = content_type
71
+ end
72
+
73
+ # form parameters
74
+ form_params = opts[:form_params] || {}
75
+
76
+ # http body (model)
77
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(transaction_create_request_body)
78
+
79
+ # return_type
80
+ return_type = opts[:debug_return_type] || 'TransactionCreateResponseBody'
81
+
82
+ # auth_names
83
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
84
+
85
+ new_options = opts.merge(
86
+ :operation => :"TransactionsApi.users_user_guid_accounts_account_guid_transactions_post",
87
+ :header_params => header_params,
88
+ :query_params => query_params,
89
+ :form_params => form_params,
90
+ :body => post_body,
91
+ :auth_names => auth_names,
92
+ :return_type => return_type
93
+ )
94
+
95
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
96
+ if @api_client.config.debugging
97
+ @api_client.config.logger.debug "API called: TransactionsApi#users_user_guid_accounts_account_guid_transactions_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
98
+ end
99
+ return data, status_code, headers
100
+ end
101
+ end
102
+ end