Class: CyberSource::TransactionQueryApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of TransactionQueryApi.



18
19
20
21
# File 'lib/cybersource_rest_client/api/transaction_query_api.rb', line 18

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.



16
17
18
# File 'lib/cybersource_rest_client/api/transaction_query_api.rb', line 16

def api_client
  @api_client
end

Instance Method Details

#create_query_api(id, body, content_type, x_requestid, v_c_merchant_id, v_c_permissions, v_c_correlation_id, v_c_organization_id, opts = {}) ⇒ InlineResponse2015

Query Transaction Details Query the status and details of payouts transactions including Pull Funds, Push Funds, and Pull Funds Reversals

Parameters:

  • id

    This is the CyberSource Request ID generated for successfully processed AFT/OCT that needs to be queried.

  • body
  • content_type
  • x_requestid
  • v_c_merchant_id
  • v_c_permissions
  • v_c_correlation_id
  • v_c_organization_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The maximum number of options to be retrieved from the processor and displayed to the consumer.

  • :offset (Integer)

    Offset from the first item in the list of options received from the processor. If you want to display the options in multiple lists, this number represents the first option displayed in each list.

Returns:



38
39
40
41
# File 'lib/cybersource_rest_client/api/transaction_query_api.rb', line 38

def create_query_api(id, body, content_type, x_requestid, v_c_merchant_id, v_c_permissions, v_c_correlation_id, v_c_organization_id, opts = {})
  data, status_code, headers = create_query_api_with_http_info(id, body, content_type, x_requestid, v_c_merchant_id, v_c_permissions, v_c_correlation_id, v_c_organization_id, opts)
  return data, status_code, headers
end

#create_query_api_with_http_info(id, body, content_type, x_requestid, v_c_merchant_id, v_c_permissions, v_c_correlation_id, v_c_organization_id, opts = {}) ⇒ Array<(InlineResponse2015, Fixnum, Hash)>

Query Transaction Details Query the status and details of payouts transactions including Pull Funds, Push Funds, and Pull Funds Reversals

Parameters:

  • id

    This is the CyberSource Request ID generated for successfully processed AFT/OCT that needs to be queried.

  • body
  • content_type
  • x_requestid
  • v_c_merchant_id
  • v_c_permissions
  • v_c_correlation_id
  • v_c_organization_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The maximum number of options to be retrieved from the processor and displayed to the consumer.

  • :offset (Integer)

    Offset from the first item in the list of options received from the processor. If you want to display the options in multiple lists, this number represents the first option displayed in each list.

Returns:

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

    InlineResponse2015 data, response status code and response headers



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
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
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
152
153
154
155
156
# File 'lib/cybersource_rest_client/api/transaction_query_api.rb', line 57

def create_query_api_with_http_info(id, body, content_type, x_requestid, v_c_merchant_id, v_c_permissions, v_c_correlation_id, v_c_organization_id, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: TransactionQueryApi.create_query_api ...'
        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 TransactionQueryApi.create_query_api"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling TransactionQueryApi.create_query_api"
  end
  # verify the required parameter 'content_type' is set
  if @api_client.config.client_side_validation && content_type.nil?
    fail ArgumentError, "Missing the required parameter 'content_type' when calling TransactionQueryApi.create_query_api"
  end
  # verify the required parameter 'x_requestid' is set
  if @api_client.config.client_side_validation && x_requestid.nil?
    fail ArgumentError, "Missing the required parameter 'x_requestid' when calling TransactionQueryApi.create_query_api"
  end
  # verify the required parameter 'v_c_merchant_id' is set
  if @api_client.config.client_side_validation && v_c_merchant_id.nil?
    fail ArgumentError, "Missing the required parameter 'v_c_merchant_id' when calling TransactionQueryApi.create_query_api"
  end
  # verify the required parameter 'v_c_permissions' is set
  if @api_client.config.client_side_validation && v_c_permissions.nil?
    fail ArgumentError, "Missing the required parameter 'v_c_permissions' when calling TransactionQueryApi.create_query_api"
  end
  # verify the required parameter 'v_c_correlation_id' is set
  if @api_client.config.client_side_validation && v_c_correlation_id.nil?
    fail ArgumentError, "Missing the required parameter 'v_c_correlation_id' when calling TransactionQueryApi.create_query_api"
  end
  # verify the required parameter 'v_c_organization_id' is set
  if @api_client.config.client_side_validation && v_c_organization_id.nil?
    fail ArgumentError, "Missing the required parameter 'v_c_organization_id' when calling TransactionQueryApi.create_query_api"
  end
  # resource path
  local_var_path = 'pts/v2/payouts/transaction-query/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
  header_params[:'Content-Type'] = content_type
  header_params[:'x-requestid'] = x_requestid
  header_params[:'v-c-merchant-id'] = v_c_merchant_id
  header_params[:'v-c-permissions'] = v_c_permissions
  header_params[:'v-c-correlation-id'] = v_c_correlation_id
  header_params[:'v-c-organization-id'] = v_c_organization_id

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'Body1', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
  inbound_mle_status = "mandatory"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["create_query_api","create_query_api_with_http_info"])
    begin
      post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
    rescue
      raise
    end
  end

  is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["create_query_api","create_query_api_with_http_info"])

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