Class: VisaAcceptanceMergedSpec::TransactionBatchesApi

Inherits:
BaseApi
  • Object
show all
Defined in:
lib/visa_acceptance_merged_spec/apis/transaction_batches_api.rb

Overview

TransactionBatchesApi

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 VisaAcceptanceMergedSpec::BaseApi

Instance Method Details

#get_transaction_batch_details(id, upload_date: nil, status: nil) ⇒ ApiResponse

Provides real-time detailed status information about the transactions that you previously uploaded in the Business Center or processed with the Offline Transaction File Submission service. template. batch file was uploaded. Date must be in ISO-8601 format. Please refer the following link to know more about ISO 8601 format.[Rfc Date Format]( Example date format: - yyyy-MM-dd rejected response. Valid values: - Rejected

Parameters:

  • id (String)

    Required parameter: The batch id assigned for the

  • upload_date (Date) (defaults to: nil)

    Optional parameter: Date in which the original

  • status (String) (defaults to: nil)

    Optional parameter: Allows you to filter by

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/visa_acceptance_merged_spec/apis/transaction_batches_api.rb', line 104

def get_transaction_batch_details(id,
                                  upload_date: nil,
                                  status: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/pts/v1/transaction-batch-details/{id}',
                                 Server::DEFAULT)
               .template_param(new_parameter(id, key: 'id')
                                .is_required(true)
                                .should_encode(true))
               .query_param(new_parameter(upload_date, key: 'uploadDate'))
               .query_param(new_parameter(status, key: 'status'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(And.new('BearerAuth', 'Accept')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true)
                .local_error('400',
                             'Bad Request',
                             APIException)
                .local_error('401',
                             'Not Authorized',
                             APIException)
                .local_error('403',
                             'No Authenticated',
                             APIException)
                .local_error('404',
                             'No Reports Found',
                             APIException)
                .local_error('502',
                             'Bad Gateway',
                             APIException))
    .execute
end

#get_transaction_batch_id(id) ⇒ ApiResponse

This API provides details like upload date, completion date, transaction count and accepted and rejected transaction count of the individual batch file using the batch id template.

Parameters:

  • id (String)

    Required parameter: The batch id assigned for the

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



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
# File 'lib/visa_acceptance_merged_spec/apis/transaction_batches_api.rb', line 60

def get_transaction_batch_id(id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/pts/v1/transaction-batches/{id}',
                                 Server::DEFAULT)
               .template_param(new_parameter(id, key: 'id')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(And.new('BearerAuth', 'Accept')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(PtsV1TransactionBatchesIdGet200Response.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Bad Request',
                             PtsV1TransactionBatchesGet400Response1Exception)
                .local_error('401',
                             'Not Authorized',
                             PtsV1TransactionBatchesGet401Response1Exception)
                .local_error('403',
                             'No Authenticated',
                             PtsV1TransactionBatchesGet403Response1Exception)
                .local_error('404',
                             'No Reports Found',
                             PtsV1TransactionBatchesGet404Response1Exception)
                .local_error('502',
                             'Bad Gateway',
                             PtsV1TransactionBatchesGet502Response1Exception))
    .execute
end

#get_transaction_batches(start_time, end_time) ⇒ ApiResponse

Provide the date and time search range to get a list of Batch Files ready for settlement in ISO 8601 format Please refer the following link to know more about ISO 8601 format.[Rfc Date Format]( Example date format: - yyyy-MM-dd'T'HH:mm:ss.SSSZZ ISO 8601 format Please refer the following link to know more about ISO 8601 format.[Rfc Date Format]( Example date format: - yyyy-MM-dd'T'HH:mm:ss.SSSZZ

Parameters:

  • start_time (DateTime)

    Required parameter: Valid report Start Time

  • end_time (DateTime)

    Required parameter: Valid report End Time in

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



20
21
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
# File 'lib/visa_acceptance_merged_spec/apis/transaction_batches_api.rb', line 20

def get_transaction_batches(start_time,
                            end_time)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/pts/v1/transaction-batches',
                                 Server::DEFAULT)
               .query_param(new_parameter(start_time, key: 'startTime')
                             .is_required(true))
               .query_param(new_parameter(end_time, key: 'endTime')
                             .is_required(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(And.new('BearerAuth', 'Accept')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(PtsV1TransactionBatchesGet200Response.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Bad Request',
                             PtsV1TransactionBatchesGet400Response1Exception)
                .local_error('401',
                             'Not Authorized',
                             PtsV1TransactionBatchesGet401Response1Exception)
                .local_error('403',
                             'No Authenticated',
                             PtsV1TransactionBatchesGet403Response1Exception)
                .local_error('404',
                             'No Reports Found',
                             PtsV1TransactionBatchesGet404Response1Exception)
                .local_error('500',
                             'Bad Gateway',
                             PtsV1TransactionBatchesGet500Response1Exception))
    .execute
end