Class: Batches::GetABatchApi
- Defined in:
- lib/batches/apis/get_a_batch_api.rb
Overview
GetABatchApi
Constant Summary
Constants inherited from BaseApi
Instance Attribute Summary
Attributes inherited from BaseApi
Instance Method Summary collapse
-
#get_single_batch(id, authorization, x_gp_version, accept: 'application/json') ⇒ ApiResponse
Get a single view of a Batch using the Global Payments Batch id.
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_single_batch(id, authorization, x_gp_version, accept: 'application/json') ⇒ ApiResponse
Get a single view of a Batch using the Global Payments Batch id. 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.
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 68 |
# File 'lib/batches/apis/get_a_batch_api.rb', line 23 def get_single_batch(id, , x_gp_version, accept: 'application/json') @api_call .request(new_request_builder(HttpMethodEnum::GET, '/batches/{id}', Server::DEFAULT) .template_param(new_parameter(id, key: 'id') .is_required(true) .should_encode(true)) .header_param(new_parameter(, 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(GetResponse.method(:from_hash)) .is_api_response(true) .local_error('400', 'Bad Request', Batches400ErrorException) .local_error('401', 'Not Authenticated', Batches401ErrorException) .local_error('403', 'Forbidden', Batches403ErrorException) .local_error('404', 'Resource Not Found', APIException) .local_error('500', 'Internal Server Error', Batches500ErrorException) .local_error('501', 'Not implemented', Batches501ErrorException) .local_error('502', 'Bad Gateway', Batches502ErrorException) .local_error('504', 'Timeout', Batches504ErrorException)) .execute end |