Class: FdxV660Api::AccountTransactionsController

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

Overview

AccountTransactionsController

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

#get_account_transaction_images(x_fapi_interaction_id, account_id, image_id, fdx_api_actor_type: nil, fdx_api_data_provider_id: nil, fdx_api_data_recipient_id: nil) ⇒ ApiResponse

Get account transaction image 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

  • account_id (String)

    Required parameter: Account Identifier

  • image_id (String)

    Required parameter: Image 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.



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
173
174
175
176
177
178
179
# File 'lib/fdx_v660_api/controllers/account_transactions_controller.rb', line 135

def (x_fapi_interaction_id,
                                   ,
                                   image_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,
                                 '/accounts/{accountId}/transaction-images/{imageId}',
                                 Server::DEFAULT)
               .header_param(new_parameter(x_fapi_interaction_id, key: 'x-fapi-interaction-id')
                              .is_required(true))
               .template_param(new_parameter(, key: 'accountId')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(image_id, key: 'imageId')
                                .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(:dynamic_deserializer))
                .is_api_response(true)
                .local_error('404',
                             'Account or image with id not found',
                             ErrorException)
                .local_error('406',
                             'Content Type not Supported',
                             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_account_reward_transactions(x_fapi_interaction_id, account_id, fdx_api_actor_type: nil, fdx_api_data_provider_id: nil, fdx_api_data_recipient_id: nil, start_date: nil, end_date: nil, page_key: nil, limit: nil) ⇒ ApiResponse

Search for account transactions with rewards. Example: /accounts/accountId/reward-transactions?startDate=date1&endDate=date2 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 retrieval of elements (ISO 8601 format). Provider to define the date ranges and behaviors they will support. Example of defined behavior: - Recipients need to either specify both start date and end date or neither. If both start date and end date are not specified; default provided. Default range: 7 Days of past data. (Today's date - 6 days both dates are inclusive) - Recipient can specify the same start date and end date. The returned data will reflect transactions from that date - If start date and end date both are specified and if start date is later than end date, return 'invalid date range' error code: 703, HTTPS 400 per the FDX spec - If start Date and end date both are specified and if start date is older than what the Data Provider supports, then the Data Provider should return 'invalid date range' error code: 703, HTTPS 400 per the FDX spec. Example: If today is 5/14/2024 and the DP supports 24 months, the start date should be 5/14/2022 and newer; it should not be 5/13/2022 or older - If start date is specified but end date is not specified or vice versa; Data Provider should return 'invalid date range' error code: 703, HTTPS 400 per the FDX spec of elements (ISO 8601 format). Provider to define the date ranges and behaviors they will support. Example of defined behavior: - Recipients need to either specify both start date and end date or neither. If both start date and end date are not specified; default provided. Default range: 7 Days of past data. (Today's date - 6 days both dates are inclusive) - Recipient can specify the same start date and end date. The returned data will reflect transactions from that date - If start date and end date both are specified and if start date is later than end date, return 'invalid date range' error code: 703, HTTPS 400 per the FDX spec

  • If start Date and end date both are specified and if start date is older than what the Data Provider supports, then the Data Provider should return 'invalid date range' error code: 703, HTTPS 400 per the FDX spec. Example: If today is 5/14/2024 and the DP supports 24 months, the start date should be 5/14/2022 and newer; it should not be 5/13/2022 or older - If start date is specified but end date is not specified or vice versa; Data Provider should return 'invalid date range' error code: 703, HTTPS 400 per the FDX spec - If end date is today's date, the most recent transactions from the time the request is received will be returned 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

Parameters:

  • x_fapi_interaction_id (UUID | String)

    Required parameter: Unique

  • account_id (String)

    Required parameter: Account 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)

  • start_date (Date) (defaults to: nil)

    Optional parameter: Start date for use in

  • end_date (Date) (defaults to: nil)

    Optional parameter: End date for use in retrieval

  • 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

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/fdx_v660_api/controllers/account_transactions_controller.rb', line 69

def (x_fapi_interaction_id,
                                           ,
                                           fdx_api_actor_type: nil,
                                           fdx_api_data_provider_id: nil,
                                           fdx_api_data_recipient_id: nil,
                                           start_date: nil,
                                           end_date: nil,
                                           page_key: nil,
                                           limit: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/accounts/{accountId}/reward-transactions',
                                 Server::DEFAULT)
               .header_param(new_parameter(x_fapi_interaction_id, key: 'x-fapi-interaction-id')
                              .is_required(true))
               .template_param(new_parameter(, key: 'accountId')
                                .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'))
               .query_param(new_parameter(start_date, key: 'startDate'))
               .query_param(new_parameter(end_date, key: 'endDate'))
               .query_param(new_parameter(page_key, key: 'pageKey'))
               .query_param(new_parameter(limit, key: 'limit'))
               .header_param(new_parameter('application/json', key: 'accept')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(RewardTransactionsEntity.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',
                             'Account with id not found',
                             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_account_transactions(x_fapi_interaction_id, account_id, fdx_api_actor_type: nil, fdx_api_client_public_key: nil, fdx_api_data_provider_id: nil, fdx_api_data_recipient_id: nil, start_time: nil, end_time: nil, start_date: nil, end_date: nil, offset: nil, page_key: nil, limit: nil) ⇒ ApiResponse

Search for account transactions. Example: /accounts/accountId/transactions?startTime=value1&endTime=value2 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 for data provider to encrypt sensitive response data financial institution responding to the request for the data recipient(s) on whose behalf the request is being made retrieval of elements (ISO 8601). Will support filtering by time in a future major release. To support filtering by date only, see StartDateQuery of elements (ISO 8601). Will support filtering by time in a future major release. To support filtering by date only, see EndDateQuery retrieval of elements (ISO 8601 format). Provider to define the date ranges and behaviors they will support. Example of defined behavior: - Recipients need to either specify both start date and end date or neither. If both start date and end date are not specified; default provided. Default range: 7 Days of past data. (Today's date - 6 days both dates are inclusive) - Recipient can specify the same start date and end date. The returned data will reflect transactions from that date - If start date and end date both are specified and if start date is later than end date, return 'invalid date range' error code: 703, HTTPS 400 per the FDX spec - If start Date and end date both are specified and if start date is older than what the Data Provider supports, then the Data Provider should return 'invalid date range' error code: 703, HTTPS 400 per the FDX spec. Example: If today is 5/14/2024 and the DP supports 24 months, the start date should be 5/14/2022 and newer; it should not be 5/13/2022 or older - If start date is specified but end date is not specified or vice versa; Data Provider should return 'invalid date range' error code: 703, HTTPS 400 per the FDX spec of elements (ISO 8601 format). Provider to define the date ranges and behaviors they will support. Example of defined behavior: - Recipients need to either specify both start date and end date or neither. If both start date and end date are not specified; default provided. Default range: 7 Days of past data. (Today's date - 6 days both dates are inclusive) - Recipient can specify the same start date and end date. The returned data will reflect transactions from that date - If start date and end date both are specified and if start date is later than end date, return 'invalid date range' error code: 703, HTTPS 400 per the FDX spec

  • If start Date and end date both are specified and if start date is older than what the Data Provider supports, then the Data Provider should return 'invalid date range' error code: 703, HTTPS 400 per the FDX spec. Example: If today is 5/14/2024 and the DP supports 24 months, the start date should be 5/14/2022 and newer; it should not be 5/13/2022 or older - If start date is specified but end date is not specified or vice versa; Data Provider should return 'invalid date range' error code: 703, HTTPS 400 per the FDX spec - If end date is today's date, the most recent transactions from the time the request is received will be returned 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

Parameters:

  • x_fapi_interaction_id (UUID | String)

    Required parameter: Unique

  • account_id (String)

    Required parameter: Account Identifier

  • fdx_api_actor_type (FdxApiActorType) (defaults to: nil)

    Optional parameter: Identifies

  • fdx_api_client_public_key (String) (defaults to: nil)

    Optional parameter: Public key

  • 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)

  • start_time (Date) (defaults to: nil)

    Optional parameter: Start time for use in

  • end_time (Date) (defaults to: nil)

    Optional parameter: End time for use in retrieval

  • start_date (Date) (defaults to: nil)

    Optional parameter: Start date for use in

  • end_date (Date) (defaults to: nil)

    Optional parameter: End date for use in retrieval

  • 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

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



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
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
# File 'lib/fdx_v660_api/controllers/account_transactions_controller.rb', line 253

def (x_fapi_interaction_id,
                                    ,
                                    fdx_api_actor_type: nil,
                                    fdx_api_client_public_key: nil,
                                    fdx_api_data_provider_id: nil,
                                    fdx_api_data_recipient_id: nil,
                                    start_time: nil,
                                    end_time: nil,
                                    start_date: nil,
                                    end_date: nil,
                                    offset: nil,
                                    page_key: nil,
                                    limit: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/accounts/{accountId}/transactions',
                                 Server::DEFAULT)
               .header_param(new_parameter(x_fapi_interaction_id, key: 'x-fapi-interaction-id')
                              .is_required(true))
               .template_param(new_parameter(, key: 'accountId')
                                .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_client_public_key, key: 'FDX-API-Client-Public-Key'))
               .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(start_time, key: 'startTime'))
               .query_param(new_parameter(end_time, key: 'endTime'))
               .query_param(new_parameter(start_date, key: 'startDate'))
               .query_param(new_parameter(end_date, key: 'endDate'))
               .query_param(new_parameter(offset, key: 'offset'))
               .query_param(new_parameter(page_key, key: 'pageKey'))
               .query_param(new_parameter(limit, key: 'limit'))
               .header_param(new_parameter('application/json', key: 'accept')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(TransactionsEntity.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',
                             'Account with id not found',
                             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