Class: Batches::GetTransactionsWithinABatchApi

Inherits:
BaseApi
  • Object
show all
Defined in:
lib/batches/apis/get_transactions_within_a_batch_api.rb

Overview

GetTransactionsWithinABatchApi

Constant Summary

Constants inherited from BaseApi

BaseApi::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseApi

#config, #http_call_back

Instance Method Summary collapse

Methods inherited from BaseApi

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

Constructor Details

This class inherits a constructor from Batches::BaseApi

Instance Method Details

#get_batches_id_transactions(id, authorization, x_gp_version, accept: 'application/json') ⇒ ApiResponse

Get the details of all transactions within a given Batch. Availability of this feature in production depends on your allowed live configuration. Please contact Global Payments before coding this feature to confirm it will be available to you when you go live. value used to authorize and access the API. Must always begin with the string "Bearer". execute the request. of the message response.

Parameters:

  • id (String)

    Required parameter: TODO: type description here

  • authorization (String)

    Required parameter: Bearer access token

  • x_gp_version (String)

    Required parameter: The version of the API to

  • accept (String) (defaults to: 'application/json')

    Optional parameter: Indicates the expected format

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/batches/apis/get_transactions_within_a_batch_api.rb', line 22

def get_batches_id_transactions(id,
                                authorization,
                                x_gp_version,
                                accept: 'application/json')
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/batches/{id}/transactions',
                                 Server::DEFAULT)
               .template_param(new_parameter(id, key: 'id')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter(authorization, key: 'Authorization')
                              .is_required(true))
               .header_param(new_parameter(x_gp_version, key: 'X-GP-Version')
                              .is_required(true))
               .header_param(new_parameter(accept, key: 'Accept')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(TransactionBatchResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Bad Request',
                             BatchesTransactions400ErrorException)
                .local_error('401',
                             'Not Authenticated',
                             BatchesTransactions401ErrorException)
                .local_error('403',
                             'Forbidden',
                             BatchesTransactions403ErrorException)
                .local_error('404',
                             'Resource Not Found',
                             APIException)
                .local_error('500',
                             'Internal Server Error',
                             BatchesTransactions500ErrorException)
                .local_error('501',
                             'Not implemented',
                             BatchesTransactions501ErrorException)
                .local_error('502',
                             'Bad Gateway',
                             BatchesTransactions502ErrorException)
                .local_error('504',
                             'Timeout',
                             BatchesTransactions504ErrorException))
    .execute
end