Class: CyberSource::PushFundsApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of PushFundsApi.



18
19
20
21
# File 'lib/cybersource_rest_client/api/push_funds_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/push_funds_api.rb', line 16

def api_client
  @api_client
end

Instance Method Details

#create_push_funds_transfer(push_funds_request, content_type, x_requestid, v_c_merchant_id, v_c_permissions, v_c_correlation_id, v_c_organization_id, opts = {}) ⇒ PushFunds201Response

Process a Push Funds Transfer Receive funds using an Original Credit Transaction (OCT).

Parameters:

  • push_funds_request
  • 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

Returns:



35
36
37
38
# File 'lib/cybersource_rest_client/api/push_funds_api.rb', line 35

def create_push_funds_transfer(push_funds_request, 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_push_funds_transfer_with_http_info(push_funds_request, 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_push_funds_transfer_with_http_info(push_funds_request, content_type, x_requestid, v_c_merchant_id, v_c_permissions, v_c_correlation_id, v_c_organization_id, opts = {}) ⇒ Array<(PushFunds201Response, Fixnum, Hash)>

Process a Push Funds Transfer Receive funds using an Original Credit Transaction (OCT).

Parameters:

  • push_funds_request
  • 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

Returns:

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

    PushFunds201Response data, response status code and response headers



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
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
# File 'lib/cybersource_rest_client/api/push_funds_api.rb', line 51

def create_push_funds_transfer_with_http_info(push_funds_request, 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: PushFundsApi.create_push_funds_transfer ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'push_funds_request' is set
  if @api_client.config.client_side_validation && push_funds_request.nil?
    fail ArgumentError, "Missing the required parameter 'push_funds_request' when calling PushFundsApi.create_push_funds_transfer"
  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 PushFundsApi.create_push_funds_transfer"
  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 PushFundsApi.create_push_funds_transfer"
  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 PushFundsApi.create_push_funds_transfer"
  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 PushFundsApi.create_push_funds_transfer"
  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 PushFundsApi.create_push_funds_transfer"
  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 PushFundsApi.create_push_funds_transfer"
  end
  # resource path
  local_var_path = 'pts/v1/push-funds-transfer'

  # query parameters
  query_params = {}

  # 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(push_funds_request)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'PushFundsRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
  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 => 'PushFunds201Response')
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: PushFundsApi#create_push_funds_transfer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end