Class: CyberSource::TransactionBatchesApi

Inherits:
Object
  • Object
show all
Defined in:
lib/cybersource_rest_client/api/transaction_batches_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default, config) ⇒ TransactionBatchesApi

Returns a new instance of TransactionBatchesApi.



19
20
21
22
# File 'lib/cybersource_rest_client/api/transaction_batches_api.rb', line 19

def initialize(api_client = ApiClient.default, config)
  @api_client = api_client
    @api_client.set_configuration(config)
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/cybersource_rest_client/api/transaction_batches_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_transaction_batch_details(id, opts = {}) ⇒ nil

Get transaction details for a given batch id 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.

Parameters:

  • id

    The batch id assigned for the template.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


28
29
30
31
# File 'lib/cybersource_rest_client/api/transaction_batches_api.rb', line 28

def get_transaction_batch_details(id, opts = {})
  data, status_code, headers = get_transaction_batch_details_with_http_info(id, opts)
  return data, status_code, headers
end

#get_transaction_batch_details_with_http_info(id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Get transaction details for a given batch id 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.

Parameters:

  • id

    The batch id assigned for the template.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/cybersource_rest_client/api/transaction_batches_api.rb', line 38

def get_transaction_batch_details_with_http_info(id, opts = {})
  
    if @api_client.config.debugging
begin
      raise
@api_client.config.logger.debug 'Calling API: TransactionBatchesApi.get_transaction_batch_details ...'
      rescue
puts 'Cannot write to log'
      end
  end
  # verify the required parameter 'id' is set

  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TransactionBatchesApi.get_transaction_batch_details"
  end
  # resource path

  local_var_path = 'pts/v1/transaction-batch-details/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters

  query_params = {}

  # header parameters

  header_params = {}
  # HTTP header 'Accept' (if needed)

  header_params['Accept'] = @api_client.select_header_accept(['text/csv', 'application/xml'])
  # HTTP header 'Content-Type'

  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])

  # form parameters

  form_params = {}

  # http body (model)

  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    begin
    raise
      @api_client.config.logger.debug "API called: TransactionBatchesApi#get_transaction_batch_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
      puts 'Cannot write to log'
    end
    end
  return data, status_code, headers
end

#get_transaction_batch_id(id, opts = {}) ⇒ PtsV1TransactionBatchesIdGet200Response

Get individual batch file Provide the search range

Parameters:

  • id

    The batch id assigned for the template.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



92
93
94
95
# File 'lib/cybersource_rest_client/api/transaction_batches_api.rb', line 92

def get_transaction_batch_id(id, opts = {})
  data, status_code, headers = get_transaction_batch_id_with_http_info(id, opts)
  return data, status_code, headers
end

#get_transaction_batch_id_with_http_info(id, opts = {}) ⇒ Array<(PtsV1TransactionBatchesIdGet200Response, Fixnum, Hash)>

Get individual batch file Provide the search range

Parameters:

  • id

    The batch id assigned for the template.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



102
103
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/cybersource_rest_client/api/transaction_batches_api.rb', line 102

def get_transaction_batch_id_with_http_info(id, opts = {})
  
    if @api_client.config.debugging
begin
      raise
@api_client.config.logger.debug 'Calling API: TransactionBatchesApi.get_transaction_batch_id ...'
      rescue
puts 'Cannot write to log'
      end
  end
  # verify the required parameter 'id' is set

  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TransactionBatchesApi.get_transaction_batch_id"
  end
  # resource path

  local_var_path = 'pts/v1/transaction-batches/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters

  query_params = {}

  # header parameters

  header_params = {}
  # HTTP header 'Accept' (if needed)

  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json'])
  # HTTP header 'Content-Type'

  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])

  # form parameters

  form_params = {}

  # http body (model)

  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'PtsV1TransactionBatchesIdGet200Response')
  if @api_client.config.debugging
    begin
    raise
      @api_client.config.logger.debug "API called: TransactionBatchesApi#get_transaction_batch_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
      puts 'Cannot write to log'
    end
    end
  return data, status_code, headers
end

#get_transaction_batches(start_time, end_time, opts = {}) ⇒ PtsV1TransactionBatchesGet200Response

Get a list of batch files Provide the search range

Parameters:

Returns:



158
159
160
161
# File 'lib/cybersource_rest_client/api/transaction_batches_api.rb', line 158

def get_transaction_batches(start_time, end_time, opts = {})
  data, status_code, headers = get_transaction_batches_with_http_info(start_time, end_time, opts)
  return data, status_code, headers
end

#get_transaction_batches_with_http_info(start_time, end_time, opts = {}) ⇒ Array<(PtsV1TransactionBatchesGet200Response, Fixnum, Hash)>

Get a list of batch files Provide the search range

Parameters:

Returns:



169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# File 'lib/cybersource_rest_client/api/transaction_batches_api.rb', line 169

def get_transaction_batches_with_http_info(start_time, end_time, opts = {})
  
    if @api_client.config.debugging
begin
      raise
@api_client.config.logger.debug 'Calling API: TransactionBatchesApi.get_transaction_batches ...'
      rescue
puts 'Cannot write to log'
      end
  end
  # verify the required parameter 'start_time' is set

  if @api_client.config.client_side_validation && start_time.nil?
    fail ArgumentError, "Missing the required parameter 'start_time' when calling TransactionBatchesApi.get_transaction_batches"
  end
  # verify the required parameter 'end_time' is set

  if @api_client.config.client_side_validation && end_time.nil?
    fail ArgumentError, "Missing the required parameter 'end_time' when calling TransactionBatchesApi.get_transaction_batches"
  end
  # resource path

  local_var_path = 'pts/v1/transaction-batches'

  # query parameters

  query_params = {}
  query_params[:'startTime'] = start_time
  query_params[:'endTime'] = end_time

  # header parameters

  header_params = {}
  # HTTP header 'Accept' (if needed)

  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json'])
  # HTTP header 'Content-Type'

  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])

  # form parameters

  form_params = {}

  # http body (model)

  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'PtsV1TransactionBatchesGet200Response')
  if @api_client.config.debugging
    begin
    raise
      @api_client.config.logger.debug "API called: TransactionBatchesApi#get_transaction_batches\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
      puts 'Cannot write to log'
    end
    end
  return data, status_code, headers
end