Class: SubfiPay::PaymentIntentsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/subfi_pay/api/payment_intents_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ PaymentIntentsApi

Returns a new instance of PaymentIntentsApi.



19
20
21
# File 'lib/subfi_pay/api/payment_intents_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/subfi_pay/api/payment_intents_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#cancel_payment_intent(x_api_version, x_account_id, id, opts = {}) ⇒ PaymentIntentResponse

Cancel a payment intent

Parameters:

  • x_api_version (String)
  • x_account_id (String)
  • id (String)

    The ID of the payment intent to cancel

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

    the optional parameters

Returns:



28
29
30
31
# File 'lib/subfi_pay/api/payment_intents_api.rb', line 28

def cancel_payment_intent(x_api_version, , id, opts = {})
  data, _status_code, _headers = cancel_payment_intent_with_http_info(x_api_version, , id, opts)
  data
end

#cancel_payment_intent_with_http_info(x_api_version, x_account_id, id, opts = {}) ⇒ Array<(PaymentIntentResponse, Integer, Hash)>

Cancel a payment intent

Parameters:

  • x_api_version (String)
  • x_account_id (String)
  • id (String)

    The ID of the payment intent to cancel

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

    the optional parameters

Returns:

  • (Array<(PaymentIntentResponse, Integer, Hash)>)

    PaymentIntentResponse data, response status code and response headers



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
87
88
89
90
91
92
93
94
95
# File 'lib/subfi_pay/api/payment_intents_api.rb', line 39

def cancel_payment_intent_with_http_info(x_api_version, , id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentIntentsApi.cancel_payment_intent ...'
  end
  # verify the required parameter 'x_api_version' is set
  if @api_client.config.client_side_validation && x_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'x_api_version' when calling PaymentIntentsApi.cancel_payment_intent"
  end
  # verify the required parameter 'x_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'x_account_id' when calling PaymentIntentsApi.cancel_payment_intent"
  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 PaymentIntentsApi.cancel_payment_intent"
  end
  # resource path
  local_var_path = '/payment_intents/{id}/cancel'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-Api-Version'] = x_api_version
  header_params[:'X-Account-Id'] = 

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'PaymentIntentResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"PaymentIntentsApi.cancel_payment_intent",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentIntentsApi#cancel_payment_intent\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#capture_payment_intent(x_api_version, x_account_id, id, opts = {}) ⇒ PaymentIntentResponse

Capture a payment intent

Parameters:

  • x_api_version (String)
  • x_account_id (String)
  • id (String)

    The ID of the payment intent to capture

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

    the optional parameters

Returns:



103
104
105
106
# File 'lib/subfi_pay/api/payment_intents_api.rb', line 103

def capture_payment_intent(x_api_version, , id, opts = {})
  data, _status_code, _headers = capture_payment_intent_with_http_info(x_api_version, , id, opts)
  data
end

#capture_payment_intent_with_http_info(x_api_version, x_account_id, id, opts = {}) ⇒ Array<(PaymentIntentResponse, Integer, Hash)>

Capture a payment intent

Parameters:

  • x_api_version (String)
  • x_account_id (String)
  • id (String)

    The ID of the payment intent to capture

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

    the optional parameters

Returns:

  • (Array<(PaymentIntentResponse, Integer, Hash)>)

    PaymentIntentResponse data, response status code and response headers



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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/subfi_pay/api/payment_intents_api.rb', line 114

def capture_payment_intent_with_http_info(x_api_version, , id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentIntentsApi.capture_payment_intent ...'
  end
  # verify the required parameter 'x_api_version' is set
  if @api_client.config.client_side_validation && x_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'x_api_version' when calling PaymentIntentsApi.capture_payment_intent"
  end
  # verify the required parameter 'x_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'x_account_id' when calling PaymentIntentsApi.capture_payment_intent"
  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 PaymentIntentsApi.capture_payment_intent"
  end
  # resource path
  local_var_path = '/payment_intents/{id}/capture'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-Api-Version'] = x_api_version
  header_params[:'X-Account-Id'] = 

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'PaymentIntentResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"PaymentIntentsApi.capture_payment_intent",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentIntentsApi#capture_payment_intent\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#confirm_payment_intent(x_api_version, x_account_id, id, opts = {}) ⇒ PaymentIntentResponse

Confirm a payment intent

Parameters:

  • x_api_version (String)
  • x_account_id (String)
  • id (String)

    The ID of the payment intent to confirm

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

    the optional parameters

Returns:



178
179
180
181
# File 'lib/subfi_pay/api/payment_intents_api.rb', line 178

def confirm_payment_intent(x_api_version, , id, opts = {})
  data, _status_code, _headers = confirm_payment_intent_with_http_info(x_api_version, , id, opts)
  data
end

#confirm_payment_intent_with_http_info(x_api_version, x_account_id, id, opts = {}) ⇒ Array<(PaymentIntentResponse, Integer, Hash)>

Confirm a payment intent

Parameters:

  • x_api_version (String)
  • x_account_id (String)
  • id (String)

    The ID of the payment intent to confirm

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

    the optional parameters

Returns:

  • (Array<(PaymentIntentResponse, Integer, Hash)>)

    PaymentIntentResponse data, response status code and response headers



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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# File 'lib/subfi_pay/api/payment_intents_api.rb', line 189

def confirm_payment_intent_with_http_info(x_api_version, , id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentIntentsApi.confirm_payment_intent ...'
  end
  # verify the required parameter 'x_api_version' is set
  if @api_client.config.client_side_validation && x_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'x_api_version' when calling PaymentIntentsApi.confirm_payment_intent"
  end
  # verify the required parameter 'x_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'x_account_id' when calling PaymentIntentsApi.confirm_payment_intent"
  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 PaymentIntentsApi.confirm_payment_intent"
  end
  # resource path
  local_var_path = '/payment_intents/{id}/confirm'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-Api-Version'] = x_api_version
  header_params[:'X-Account-Id'] = 

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'PaymentIntentResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"PaymentIntentsApi.confirm_payment_intent",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentIntentsApi#confirm_payment_intent\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_payment_intent(x_api_version, x_account_id, payment_intent_create_request, opts = {}) ⇒ PaymentIntentResponse

Create a new payment intent

Parameters:

  • x_api_version (String)
  • x_account_id (String)
  • payment_intent_create_request (PaymentIntentCreateRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



253
254
255
256
# File 'lib/subfi_pay/api/payment_intents_api.rb', line 253

def create_payment_intent(x_api_version, , payment_intent_create_request, opts = {})
  data, _status_code, _headers = create_payment_intent_with_http_info(x_api_version, , payment_intent_create_request, opts)
  data
end

#create_payment_intent_with_http_info(x_api_version, x_account_id, payment_intent_create_request, opts = {}) ⇒ Array<(PaymentIntentResponse, Integer, Hash)>

Create a new payment intent

Parameters:

  • x_api_version (String)
  • x_account_id (String)
  • payment_intent_create_request (PaymentIntentCreateRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(PaymentIntentResponse, Integer, Hash)>)

    PaymentIntentResponse data, response status code and response headers



264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
# File 'lib/subfi_pay/api/payment_intents_api.rb', line 264

def create_payment_intent_with_http_info(x_api_version, , payment_intent_create_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentIntentsApi.create_payment_intent ...'
  end
  # verify the required parameter 'x_api_version' is set
  if @api_client.config.client_side_validation && x_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'x_api_version' when calling PaymentIntentsApi.create_payment_intent"
  end
  # verify the required parameter 'x_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'x_account_id' when calling PaymentIntentsApi.create_payment_intent"
  end
  # verify the required parameter 'payment_intent_create_request' is set
  if @api_client.config.client_side_validation && payment_intent_create_request.nil?
    fail ArgumentError, "Missing the required parameter 'payment_intent_create_request' when calling PaymentIntentsApi.create_payment_intent"
  end
  # resource path
  local_var_path = '/payment_intents'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end
  header_params[:'X-Api-Version'] = x_api_version
  header_params[:'X-Account-Id'] = 

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(payment_intent_create_request)

  # return_type
  return_type = opts[:debug_return_type] || 'PaymentIntentResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"PaymentIntentsApi.create_payment_intent",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentIntentsApi#create_payment_intent\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_payment_intent(x_api_version, x_account_id, id, opts = {}) ⇒ PaymentIntentResponse

Retrieve a payment intent by ID

Parameters:

  • x_api_version (String)
  • x_account_id (String)
  • id (String)

    The ID of the payment intent to retrieve

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

    the optional parameters

Returns:



333
334
335
336
# File 'lib/subfi_pay/api/payment_intents_api.rb', line 333

def get_payment_intent(x_api_version, , id, opts = {})
  data, _status_code, _headers = get_payment_intent_with_http_info(x_api_version, , id, opts)
  data
end

#get_payment_intent_with_http_info(x_api_version, x_account_id, id, opts = {}) ⇒ Array<(PaymentIntentResponse, Integer, Hash)>

Retrieve a payment intent by ID

Parameters:

  • x_api_version (String)
  • x_account_id (String)
  • id (String)

    The ID of the payment intent to retrieve

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

    the optional parameters

Returns:

  • (Array<(PaymentIntentResponse, Integer, Hash)>)

    PaymentIntentResponse data, response status code and response headers



344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
# File 'lib/subfi_pay/api/payment_intents_api.rb', line 344

def get_payment_intent_with_http_info(x_api_version, , id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentIntentsApi.get_payment_intent ...'
  end
  # verify the required parameter 'x_api_version' is set
  if @api_client.config.client_side_validation && x_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'x_api_version' when calling PaymentIntentsApi.get_payment_intent"
  end
  # verify the required parameter 'x_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'x_account_id' when calling PaymentIntentsApi.get_payment_intent"
  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 PaymentIntentsApi.get_payment_intent"
  end
  # resource path
  local_var_path = '/payment_intents/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-Api-Version'] = x_api_version
  header_params[:'X-Account-Id'] = 

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'PaymentIntentResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"PaymentIntentsApi.get_payment_intent",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentIntentsApi#get_payment_intent\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_payment_intents(x_api_version, x_account_id, opts = {}) ⇒ ListPaymentIntentsResponse

List payment intents

Parameters:

  • x_api_version (String)
  • x_account_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    The page of results to retrieve.

  • :per_page (Integer)

    Number of results per page.

  • :connected_account_id (String)

    Filter results by sub_merchant ID.

Returns:



410
411
412
413
# File 'lib/subfi_pay/api/payment_intents_api.rb', line 410

def list_payment_intents(x_api_version, , opts = {})
  data, _status_code, _headers = list_payment_intents_with_http_info(x_api_version, , opts)
  data
end

#list_payment_intents_with_http_info(x_api_version, x_account_id, opts = {}) ⇒ Array<(ListPaymentIntentsResponse, Integer, Hash)>

List payment intents

Parameters:

  • x_api_version (String)
  • x_account_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    The page of results to retrieve.

  • :per_page (Integer)

    Number of results per page.

  • :connected_account_id (String)

    Filter results by sub_merchant ID.

Returns:

  • (Array<(ListPaymentIntentsResponse, Integer, Hash)>)

    ListPaymentIntentsResponse data, response status code and response headers



423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
# File 'lib/subfi_pay/api/payment_intents_api.rb', line 423

def list_payment_intents_with_http_info(x_api_version, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentIntentsApi.list_payment_intents ...'
  end
  # verify the required parameter 'x_api_version' is set
  if @api_client.config.client_side_validation && x_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'x_api_version' when calling PaymentIntentsApi.list_payment_intents"
  end
  # verify the required parameter 'x_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'x_account_id' when calling PaymentIntentsApi.list_payment_intents"
  end
  # resource path
  local_var_path = '/payment_intents'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
  query_params[:'connected_account_id'] = opts[:'connected_account_id'] if !opts[:'connected_account_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-Api-Version'] = x_api_version
  header_params[:'X-Account-Id'] = 

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListPaymentIntentsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"PaymentIntentsApi.list_payment_intents",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentIntentsApi#list_payment_intents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_payment_intent(x_api_version, x_account_id, id, payment_intent_update_attributes, opts = {}) ⇒ PaymentIntentResponse

Update a payment intent

Parameters:

  • x_api_version (String)
  • x_account_id (String)
  • id (String)

    The ID of the payment intent to update

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

    the optional parameters

Returns:



487
488
489
490
# File 'lib/subfi_pay/api/payment_intents_api.rb', line 487

def update_payment_intent(x_api_version, , id, payment_intent_update_attributes, opts = {})
  data, _status_code, _headers = update_payment_intent_with_http_info(x_api_version, , id, payment_intent_update_attributes, opts)
  data
end

#update_payment_intent_with_http_info(x_api_version, x_account_id, id, payment_intent_update_attributes, opts = {}) ⇒ Array<(PaymentIntentResponse, Integer, Hash)>

Update a payment intent

Parameters:

  • x_api_version (String)
  • x_account_id (String)
  • id (String)

    The ID of the payment intent to update

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

    the optional parameters

Returns:

  • (Array<(PaymentIntentResponse, Integer, Hash)>)

    PaymentIntentResponse data, response status code and response headers



499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
# File 'lib/subfi_pay/api/payment_intents_api.rb', line 499

def update_payment_intent_with_http_info(x_api_version, , id, payment_intent_update_attributes, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentIntentsApi.update_payment_intent ...'
  end
  # verify the required parameter 'x_api_version' is set
  if @api_client.config.client_side_validation && x_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'x_api_version' when calling PaymentIntentsApi.update_payment_intent"
  end
  # verify the required parameter 'x_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'x_account_id' when calling PaymentIntentsApi.update_payment_intent"
  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 PaymentIntentsApi.update_payment_intent"
  end
  # verify the required parameter 'payment_intent_update_attributes' is set
  if @api_client.config.client_side_validation && payment_intent_update_attributes.nil?
    fail ArgumentError, "Missing the required parameter 'payment_intent_update_attributes' when calling PaymentIntentsApi.update_payment_intent"
  end
  # resource path
  local_var_path = '/payment_intents/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end
  header_params[:'X-Api-Version'] = x_api_version
  header_params[:'X-Account-Id'] = 

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(payment_intent_update_attributes)

  # return_type
  return_type = opts[:debug_return_type] || 'PaymentIntentResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"PaymentIntentsApi.update_payment_intent",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentIntentsApi#update_payment_intent\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end