Class: FdxV660Api::InternalTransfersController

Inherits:
BaseController show all
Defined in:
lib/fdx_v660_api/controllers/internal_transfers_controller.rb

Overview

InternalTransfersController

Constant Summary

Constants inherited from BaseController

BaseController::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseController

#config, #http_call_back

Instance Method Summary collapse

Methods inherited from BaseController

#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent, user_agent_parameters

Constructor Details

This class inherits a constructor from FdxV660Api::BaseController

Instance Method Details

#cancel_transfer(x_fapi_interaction_id, transfer_id, fdx_api_actor_type: nil, fdx_api_data_provider_id: nil, fdx_api_data_recipient_id: nil) ⇒ ApiResponse

Cancel a transfer between accounts identifier for this interaction, as defined by [FAPI 2.0 Implementation Advice, 2.2.1 x-fapi-interaction-id](https://openid.bitbucket.io/fapi/fapi-2_0-implement ation_advice.html#name-x-fapi-interaction-id) whether the customer is present (USER) or it is a BATCH operation financial institution responding to the request for the data recipient(s) on whose behalf the request is being made

Parameters:

  • x_fapi_interaction_id (UUID | String)

    Required parameter: Unique

  • transfer_id (String)

    Required parameter: Transfer identifier

  • fdx_api_actor_type (FdxApiActorType) (defaults to: nil)

    Optional parameter: Identifies

  • fdx_api_data_provider_id (String) (defaults to: nil)

    Optional parameter: ID for the

  • fdx_api_data_recipient_id (Array[String]) (defaults to: nil)

    Optional parameter: ID(s)

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
# File 'lib/fdx_v660_api/controllers/internal_transfers_controller.rb', line 301

def cancel_transfer(x_fapi_interaction_id,
                    transfer_id,
                    fdx_api_actor_type: nil,
                    fdx_api_data_provider_id: nil,
                    fdx_api_data_recipient_id: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::DELETE,
                                 '/transfers/{transferId}',
                                 Server::DEFAULT)
               .header_param(new_parameter(x_fapi_interaction_id, key: 'x-fapi-interaction-id')
                              .is_required(true))
               .template_param(new_parameter(transfer_id, key: 'transferId')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter(fdx_api_actor_type, key: 'FDX-API-Actor-Type'))
               .header_param(new_parameter(fdx_api_data_provider_id, key: 'FDX-API-Data-Provider-Id'))
               .header_param(new_parameter(fdx_api_data_recipient_id, key: 'FDX-API-Data-Recipient-Id'))
               .header_param(new_parameter('application/json', key: 'accept')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(TransferEntity.method(:from_hash))
                .is_api_response(true))
    .execute
end

#get_transfer(x_fapi_interaction_id, transfer_id, fdx_api_actor_type: nil, fdx_api_data_provider_id: nil, fdx_api_data_recipient_id: nil) ⇒ ApiResponse

Get a transfer between accounts identifier for this interaction, as defined by [FAPI 2.0 Implementation Advice, 2.2.1 x-fapi-interaction-id](https://openid.bitbucket.io/fapi/fapi-2_0-implement ation_advice.html#name-x-fapi-interaction-id) whether the customer is present (USER) or it is a BATCH operation financial institution responding to the request for the data recipient(s) on whose behalf the request is being made

Parameters:

  • x_fapi_interaction_id (UUID | String)

    Required parameter: Unique

  • transfer_id (String)

    Required parameter: Transfer identifier

  • fdx_api_actor_type (FdxApiActorType) (defaults to: nil)

    Optional parameter: Identifies

  • fdx_api_data_provider_id (String) (defaults to: nil)

    Optional parameter: ID for the

  • fdx_api_data_recipient_id (Array[String]) (defaults to: nil)

    Optional parameter: ID(s)

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# File 'lib/fdx_v660_api/controllers/internal_transfers_controller.rb', line 188

def get_transfer(x_fapi_interaction_id,
                 transfer_id,
                 fdx_api_actor_type: nil,
                 fdx_api_data_provider_id: nil,
                 fdx_api_data_recipient_id: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/transfers/{transferId}',
                                 Server::DEFAULT)
               .header_param(new_parameter(x_fapi_interaction_id, key: 'x-fapi-interaction-id')
                              .is_required(true))
               .template_param(new_parameter(transfer_id, key: 'transferId')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter(fdx_api_actor_type, key: 'FDX-API-Actor-Type'))
               .header_param(new_parameter(fdx_api_data_provider_id, key: 'FDX-API-Data-Provider-Id'))
               .header_param(new_parameter(fdx_api_data_recipient_id, key: 'FDX-API-Data-Recipient-Id'))
               .header_param(new_parameter('application/json', key: 'accept')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(TransferEntity.method(:from_hash))
                .is_api_response(true))
    .execute
end

#request_account_transfer(x_fapi_interaction_id, idempotency_key, fdx_api_actor_type: nil, fdx_api_data_provider_id: nil, fdx_api_data_recipient_id: nil, body: nil) ⇒ ApiResponse

Create a transfer between accounts identifier for this interaction, as defined by [FAPI 2.0 Implementation Advice, 2.2.1 x-fapi-interaction-id](https://openid.bitbucket.io/fapi/fapi-2_0-implement ation_advice.html#name-x-fapi-interaction-id) requests whether the customer is present (USER) or it is a BATCH operation financial institution responding to the request for the data recipient(s) on whose behalf the request is being made transfer request

Parameters:

  • x_fapi_interaction_id (UUID | String)

    Required parameter: Unique

  • idempotency_key (String)

    Required parameter: Used to de-duplicate

  • fdx_api_actor_type (FdxApiActorType) (defaults to: nil)

    Optional parameter: Identifies

  • fdx_api_data_provider_id (String) (defaults to: nil)

    Optional parameter: ID for the

  • fdx_api_data_recipient_id (Array[String]) (defaults to: nil)

    Optional parameter: ID(s)

  • body (TransferForCreateEntity1) (defaults to: nil)

    Optional parameter: Data of the

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/fdx_v660_api/controllers/internal_transfers_controller.rb', line 122

def (x_fapi_interaction_id,
                             idempotency_key,
                             fdx_api_actor_type: nil,
                             fdx_api_data_provider_id: nil,
                             fdx_api_data_recipient_id: nil,
                             body: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/transfers',
                                 Server::DEFAULT)
               .header_param(new_parameter(x_fapi_interaction_id, key: 'x-fapi-interaction-id')
                              .is_required(true))
               .header_param(new_parameter(idempotency_key, key: 'idempotency-key')
                              .is_required(true))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .header_param(new_parameter(fdx_api_actor_type, key: 'FDX-API-Actor-Type'))
               .header_param(new_parameter(fdx_api_data_provider_id, key: 'FDX-API-Data-Provider-Id'))
               .header_param(new_parameter(fdx_api_data_recipient_id, key: 'FDX-API-Data-Recipient-Id'))
               .body_param(new_parameter(body))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(TransferEntity.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Source account does not have sufficient funds',
                             ErrorException)
                .local_error('401',
                             'Account not authorized for transfer',
                             ErrorException)
                .local_error('404',
                             'Requested transfer is invalid',
                             ErrorException)
                .local_error('409',
                             'Duplicate transfer request',
                             ErrorException)
                .local_error('500',
                             'Catch-all exception where request was not processed due to an'\
                              ' internal outage/issue. Consider other more specific errors'\
                              ' before using this error',
                             ErrorException)
                .local_error('501',
                             'Error when FdxVersion in Header is not one of those'\
                              ' implemented at backend',
                             ErrorException)
                .local_error('503',
                             'System is down for maintenance',
                             ErrorException))
    .execute
end

#search_for_transfers(x_fapi_interaction_id, fdx_api_actor_type: nil, fdx_api_data_provider_id: nil, fdx_api_data_recipient_id: nil, updated_since: nil, offset: nil, page_key: nil, limit: nil, search_start_transfer_date: nil, search_end_transfer_date: nil, search_from_account_ids: nil, search_to_account_ids: nil, search_statuses: nil, search_transfer_ids: nil) ⇒ ApiResponse

Search for transfers identifier for this interaction, as defined by [FAPI 2.0 Implementation Advice, 2.2.1 x-fapi-interaction-id](https://openid.bitbucket.io/fapi/fapi-2_0-implement ation_advice.html#name-x-fapi-interaction-id) whether the customer is present (USER) or it is a BATCH operation financial institution responding to the request for the data recipient(s) on whose behalf the request is being made been created or updated since the nextUpdateId provider to send the next set of records. Deprecated in favor of PageKeyQuery, will be removed with a future major release provider to send the next set of records. Pagination can be implemented per provider's preference consumer wishes to receive. Providers should implement reasonable default/maximum/minimum values based on their internal architecture and update their documentation accordingly for use in retrieval of transfers by transfer date use in retrieval of transfers by transfer date for transfers by source account(s) for transfers by target account(s) for transfers by current statuses transfers by id

Parameters:

  • x_fapi_interaction_id (UUID | String)

    Required parameter: Unique

  • fdx_api_actor_type (FdxApiActorType) (defaults to: nil)

    Optional parameter: Identifies

  • fdx_api_data_provider_id (String) (defaults to: nil)

    Optional parameter: ID for the

  • fdx_api_data_recipient_id (Array[String]) (defaults to: nil)

    Optional parameter: ID(s)

  • updated_since (String) (defaults to: nil)

    Optional parameter: Return items that have

  • offset (String) (defaults to: nil)

    Optional parameter: Opaque cursor used by the

  • page_key (String) (defaults to: nil)

    Optional parameter: Opaque cursor used by the

  • limit (Integer) (defaults to: nil)

    Optional parameter: Number of elements that the

  • search_start_transfer_date (Date) (defaults to: nil)

    Optional parameter: Start time

  • search_end_transfer_date (Date) (defaults to: nil)

    Optional parameter: End time for

  • search_from_account_ids (Array[String]) (defaults to: nil)

    Optional parameter: Search

  • search_to_account_ids (Array[String]) (defaults to: nil)

    Optional parameter: Search

  • search_statuses (Array[PaymentStatus]) (defaults to: nil)

    Optional parameter: Search

  • search_transfer_ids (Array[String]) (defaults to: nil)

    Optional parameter: Search for

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/fdx_v660_api/controllers/internal_transfers_controller.rb', line 46

def search_for_transfers(x_fapi_interaction_id,
                         fdx_api_actor_type: nil,
                         fdx_api_data_provider_id: nil,
                         fdx_api_data_recipient_id: nil,
                         updated_since: nil,
                         offset: nil,
                         page_key: nil,
                         limit: nil,
                         search_start_transfer_date: nil,
                         search_end_transfer_date: nil,
                         search_from_account_ids: nil,
                         search_to_account_ids: nil,
                         search_statuses: nil,
                         search_transfer_ids: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/transfers',
                                 Server::DEFAULT)
               .header_param(new_parameter(x_fapi_interaction_id, key: 'x-fapi-interaction-id')
                              .is_required(true))
               .header_param(new_parameter(fdx_api_actor_type, key: 'FDX-API-Actor-Type'))
               .header_param(new_parameter(fdx_api_data_provider_id, key: 'FDX-API-Data-Provider-Id'))
               .header_param(new_parameter(fdx_api_data_recipient_id, key: 'FDX-API-Data-Recipient-Id'))
               .query_param(new_parameter(updated_since, key: 'updatedSince'))
               .query_param(new_parameter(offset, key: 'offset'))
               .query_param(new_parameter(page_key, key: 'pageKey'))
               .query_param(new_parameter(limit, key: 'limit'))
               .query_param(new_parameter(search_start_transfer_date, key: 'searchStartTransferDate'))
               .query_param(new_parameter(search_end_transfer_date, key: 'searchEndTransferDate'))
               .query_param(new_parameter(, key: 'searchFromAccountIds'))
               .query_param(new_parameter(, key: 'searchToAccountIds'))
               .query_param(new_parameter(search_statuses, key: 'searchStatuses'))
               .query_param(new_parameter(search_transfer_ids, key: 'searchTransferIds'))
               .header_param(new_parameter('application/json', key: 'accept')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(TransfersEntity.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Start or end date value is not in the ISO 8601 format',
                             ErrorException)
                .local_error('404',
                             'Data not found for request parameters',
                             ErrorException)
                .local_error('500',
                             'Catch-all exception where request was not processed due to an'\
                              ' internal outage/issue. Consider other more specific errors'\
                              ' before using this error',
                             ErrorException)
                .local_error('501',
                             'Error when FdxVersion in Header is not one of those'\
                              ' implemented at backend',
                             ErrorException)
                .local_error('503',
                             'System is down for maintenance',
                             ErrorException))
    .execute
end

#update_account_transfer(x_fapi_interaction_id, transfer_id, idempotency_key, fdx_api_actor_type: nil, fdx_api_data_provider_id: nil, fdx_api_data_recipient_id: nil, body: nil) ⇒ ApiResponse

Update a transfer between accounts identifier for this interaction, as defined by [FAPI 2.0 Implementation Advice, 2.2.1 x-fapi-interaction-id](https://openid.bitbucket.io/fapi/fapi-2_0-implement ation_advice.html#name-x-fapi-interaction-id) requests whether the customer is present (USER) or it is a BATCH operation financial institution responding to the request for the data recipient(s) on whose behalf the request is being made description here

Parameters:

  • x_fapi_interaction_id (UUID | String)

    Required parameter: Unique

  • transfer_id (String)

    Required parameter: Transfer identifier

  • idempotency_key (String)

    Required parameter: Used to de-duplicate

  • fdx_api_actor_type (FdxApiActorType) (defaults to: nil)

    Optional parameter: Identifies

  • fdx_api_data_provider_id (String) (defaults to: nil)

    Optional parameter: ID for the

  • fdx_api_data_recipient_id (Array[String]) (defaults to: nil)

    Optional parameter: ID(s)

  • body (TransferForCreateEntity2) (defaults to: nil)

    Optional parameter: TODO: type

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# File 'lib/fdx_v660_api/controllers/internal_transfers_controller.rb', line 231

def (x_fapi_interaction_id,
                            transfer_id,
                            idempotency_key,
                            fdx_api_actor_type: nil,
                            fdx_api_data_provider_id: nil,
                            fdx_api_data_recipient_id: nil,
                            body: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::PATCH,
                                 '/transfers/{transferId}',
                                 Server::DEFAULT)
               .header_param(new_parameter(x_fapi_interaction_id, key: 'x-fapi-interaction-id')
                              .is_required(true))
               .template_param(new_parameter(transfer_id, key: 'transferId')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter(idempotency_key, key: 'idempotency-key')
                              .is_required(true))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .header_param(new_parameter(fdx_api_actor_type, key: 'FDX-API-Actor-Type'))
               .header_param(new_parameter(fdx_api_data_provider_id, key: 'FDX-API-Data-Provider-Id'))
               .header_param(new_parameter(fdx_api_data_recipient_id, key: 'FDX-API-Data-Recipient-Id'))
               .body_param(new_parameter(body))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(TransferEntity.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Source account does not have sufficient funds',
                             ErrorException)
                .local_error('401',
                             'Account not authorized for transfer',
                             ErrorException)
                .local_error('404',
                             'Requested transfer change is invalid',
                             ErrorException)
                .local_error('409',
                             'Duplicate transfer request',
                             ErrorException)
                .local_error('500',
                             'Catch-all exception where request was not processed due to an'\
                              ' internal outage/issue. Consider other more specific errors'\
                              ' before using this error',
                             ErrorException)
                .local_error('501',
                             'Error when FdxVersion in Header is not one of those'\
                              ' implemented at backend',
                             ErrorException)
                .local_error('503',
                             'System is down for maintenance',
                             ErrorException))
    .execute
end