cybersource_rest_client 0.0.40 → 0.0.41
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/AuthenticationSDK/logging/sensitive_logging.rb +7 -4
- data/lib/cybersource_rest_client/api/asymmetric_key_management_api.rb +223 -219
- data/lib/cybersource_rest_client/api/chargeback_details_api.rb +116 -112
- data/lib/cybersource_rest_client/api/chargeback_summaries_api.rb +116 -112
- data/lib/cybersource_rest_client/api/conversion_details_api.rb +5 -1
- data/lib/cybersource_rest_client/api/customer_api.rb +368 -360
- data/lib/cybersource_rest_client/api/customer_payment_instrument_api.rb +530 -518
- data/lib/cybersource_rest_client/api/customer_shipping_address_api.rb +530 -518
- data/lib/cybersource_rest_client/api/download_dtd_api.rb +92 -88
- data/lib/cybersource_rest_client/api/download_xsd_api.rb +92 -88
- data/lib/cybersource_rest_client/api/instrument_identifier_api.rb +15 -3
- data/lib/cybersource_rest_client/api/interchange_clearing_level_details_api.rb +116 -112
- data/lib/cybersource_rest_client/api/invoice_settings_api.rb +152 -148
- data/lib/cybersource_rest_client/api/invoices_api.rb +447 -431
- data/lib/cybersource_rest_client/api/net_fundings_api.rb +5 -1
- data/lib/cybersource_rest_client/api/notification_of_changes_api.rb +5 -1
- data/lib/cybersource_rest_client/api/payer_authentication_api.rb +219 -219
- data/lib/cybersource_rest_client/api/payment_batch_summaries_api.rb +133 -129
- data/lib/cybersource_rest_client/api/payment_instrument_api.rb +10 -2
- data/lib/cybersource_rest_client/api/purchase_and_refund_details_api.rb +5 -1
- data/lib/cybersource_rest_client/api/report_definitions_api.rb +10 -2
- data/lib/cybersource_rest_client/api/report_downloads_api.rb +5 -1
- data/lib/cybersource_rest_client/api/report_subscriptions_api.rb +15 -3
- data/lib/cybersource_rest_client/api/reports_api.rb +10 -2
- data/lib/cybersource_rest_client/api/retrieval_details_api.rb +116 -112
- data/lib/cybersource_rest_client/api/retrieval_summaries_api.rb +116 -112
- data/lib/cybersource_rest_client/api/search_transactions_api.rb +5 -1
- data/lib/cybersource_rest_client/api/secure_file_share_api.rb +206 -198
- data/lib/cybersource_rest_client/api/symmetric_key_management_api.rb +5 -1
- data/lib/cybersource_rest_client/api/taxes_api.rb +160 -160
- data/lib/cybersource_rest_client/api/tokenization_api.rb +89 -89
- data/lib/cybersource_rest_client/api/transaction_batches_api.rb +15 -3
- data/lib/cybersource_rest_client/api/transaction_details_api.rb +5 -1
- data/lib/cybersource_rest_client/api/user_management_api.rb +5 -1
- data/lib/cybersource_rest_client/api/user_management_search_api.rb +89 -89
- data/lib/cybersource_rest_client/api/verification_api.rb +154 -154
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_account_information_card.rb +20 -4
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information_merchant_advice.rb +20 -4
- data/lib/cybersource_rest_client/models/ptsv2payments_merchant_information_merchant_descriptor.rb +20 -4
- data/lib/cybersource_rest_client/models/ptsv2payments_order_information.rb +11 -1
- data/lib/cybersource_rest_client/models/ptsv2payments_order_information_invoice_details.rb +20 -4
- data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_tokenized_card.rb +1 -1
- data/lib/cybersource_rest_client/models/ptsv2payments_point_of_sale_information.rb +20 -4
- data/lib/cybersource_rest_client/models/ptsv2payments_point_of_sale_information_emv.rb +21 -7
- data/lib/cybersource_rest_client/models/ptsv2payments_processing_information_authorization_options.rb +17 -1
- data/lib/cybersource_rest_client/models/ptsv2payments_processor_information.rb +13 -4
- data/lib/cybersource_rest_client/models/ptsv2payments_processor_information_authorization_options.rb +190 -0
- data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_point_of_sale_information_emv.rb +0 -2
- data/lib/cybersource_rest_client/models/ptsv2paymentsidvoids_order_information.rb +183 -0
- data/lib/cybersource_rest_client/models/ptsv2payouts_order_information.rb +14 -4
- data/lib/cybersource_rest_client/models/ptsv2payouts_processing_information.rb +13 -4
- data/lib/cybersource_rest_client/models/ptsv2payouts_processing_information_funding_options.rb +183 -0
- data/lib/cybersource_rest_client/models/ptsv2payouts_processing_information_funding_options_initiator.rb +190 -0
- data/lib/cybersource_rest_client/models/ptsv2payouts_sender_information.rb +52 -4
- data/lib/cybersource_rest_client/models/riskv1authenticationresults_payment_information_tokenized_card.rb +1 -1
- data/lib/cybersource_rest_client/models/riskv1authentications_payment_information_tokenized_card.rb +1 -1
- data/lib/cybersource_rest_client/models/riskv1authenticationsetups_payment_information_tokenized_card.rb +1 -1
- data/lib/cybersource_rest_client/models/riskv1decisions_payment_information_tokenized_card.rb +1 -1
- data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_order_information_amount_details.rb +1 -1
- data/lib/cybersource_rest_client/models/void_capture_request.rb +13 -4
- data/lib/cybersource_rest_client/models/void_credit_request.rb +13 -4
- data/lib/cybersource_rest_client/models/void_payment_request.rb +13 -4
- data/lib/cybersource_rest_client/models/void_refund_request.rb +13 -4
- data/lib/cybersource_rest_client.rb +4 -0
- metadata +7 -3
@@ -1,518 +1,530 @@
|
|
1
|
-
=begin
|
2
|
-
#CyberSource Merged Spec
|
3
|
-
|
4
|
-
#All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
|
5
|
-
|
6
|
-
OpenAPI spec version: 0.0.1
|
7
|
-
|
8
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.2.3
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'uri'
|
14
|
-
|
15
|
-
module CyberSource
|
16
|
-
class CustomerPaymentInstrumentApi
|
17
|
-
attr_accessor :api_client
|
18
|
-
|
19
|
-
def initialize(api_client = ApiClient.default, config)
|
20
|
-
@api_client = api_client
|
21
|
-
@api_client.set_configuration(config)
|
22
|
-
end
|
23
|
-
# Delete a Customer Payment Instrument
|
24
|
-
# @param customer_token_id The TokenId of a customer.
|
25
|
-
# @param payment_instrument_token_id The TokenId of a payment instrument.
|
26
|
-
# @param [Hash] opts the optional parameters
|
27
|
-
# @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
|
28
|
-
# @return [nil]
|
29
|
-
def delete_customer_payment_instrument(customer_token_id, payment_instrument_token_id, opts = {})
|
30
|
-
data, status_code, headers = delete_customer_payment_instrument_with_http_info(customer_token_id, payment_instrument_token_id, opts)
|
31
|
-
return data, status_code, headers
|
32
|
-
end
|
33
|
-
|
34
|
-
# Delete a Customer Payment Instrument
|
35
|
-
# @param customer_token_id The TokenId of a customer.
|
36
|
-
# @param payment_instrument_token_id The TokenId of a payment instrument.
|
37
|
-
# @param [Hash] opts the optional parameters
|
38
|
-
# @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
|
39
|
-
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
40
|
-
def delete_customer_payment_instrument_with_http_info(customer_token_id, payment_instrument_token_id, opts = {})
|
41
|
-
|
42
|
-
if @api_client.config.debugging
|
43
|
-
begin
|
44
|
-
raise
|
45
|
-
@api_client.config.logger.debug 'Calling API: CustomerPaymentInstrumentApi.delete_customer_payment_instrument ...'
|
46
|
-
rescue
|
47
|
-
puts 'Cannot write to log'
|
48
|
-
end
|
49
|
-
end
|
50
|
-
# verify the required parameter 'customer_token_id' is set
|
51
|
-
if @api_client.config.client_side_validation && customer_token_id.nil?
|
52
|
-
fail ArgumentError, "Missing the required parameter 'customer_token_id' when calling CustomerPaymentInstrumentApi.delete_customer_payment_instrument"
|
53
|
-
end
|
54
|
-
if @api_client.config.client_side_validation && customer_token_id.to_s.length > 32
|
55
|
-
fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerPaymentInstrumentApi.delete_customer_payment_instrument, the character length must be smaller than or equal to 32.'
|
56
|
-
end
|
57
|
-
|
58
|
-
if @api_client.config.client_side_validation && customer_token_id.to_s.length < 1
|
59
|
-
fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerPaymentInstrumentApi.delete_customer_payment_instrument, the character length must be great than or equal to 1.'
|
60
|
-
end
|
61
|
-
|
62
|
-
# verify the required parameter 'payment_instrument_token_id' is set
|
63
|
-
if @api_client.config.client_side_validation && payment_instrument_token_id.nil?
|
64
|
-
fail ArgumentError, "Missing the required parameter 'payment_instrument_token_id' when calling CustomerPaymentInstrumentApi.delete_customer_payment_instrument"
|
65
|
-
end
|
66
|
-
if @api_client.config.client_side_validation && payment_instrument_token_id.to_s.length > 32
|
67
|
-
fail ArgumentError, 'invalid value for "payment_instrument_token_id" when calling CustomerPaymentInstrumentApi.delete_customer_payment_instrument, the character length must be smaller than or equal to 32.'
|
68
|
-
end
|
69
|
-
|
70
|
-
if @api_client.config.client_side_validation && payment_instrument_token_id.to_s.length < 1
|
71
|
-
fail ArgumentError, 'invalid value for "payment_instrument_token_id" when calling CustomerPaymentInstrumentApi.delete_customer_payment_instrument, the character length must be great than or equal to 1.'
|
72
|
-
end
|
73
|
-
|
74
|
-
if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length > 36
|
75
|
-
fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerPaymentInstrumentApi.delete_customer_payment_instrument, the character length must be smaller than or equal to 36.'
|
76
|
-
end
|
77
|
-
|
78
|
-
if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length < 36
|
79
|
-
fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerPaymentInstrumentApi.delete_customer_payment_instrument, the character length must be great than or equal to 36.'
|
80
|
-
end
|
81
|
-
|
82
|
-
# resource path
|
83
|
-
local_var_path = 'tms/v2/customers/{customerTokenId}/payment-instruments/{paymentInstrumentTokenId}'.sub('{' + 'customerTokenId' + '}', customer_token_id.to_s).sub('{' + 'paymentInstrumentTokenId' + '}', payment_instrument_token_id.to_s)
|
84
|
-
|
85
|
-
# query parameters
|
86
|
-
query_params = {}
|
87
|
-
|
88
|
-
# header parameters
|
89
|
-
header_params = {}
|
90
|
-
# HTTP header 'Accept' (if needed)
|
91
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=utf-8'])
|
92
|
-
# HTTP header 'Content-Type'
|
93
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
|
94
|
-
header_params[:'profile-id'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
|
95
|
-
|
96
|
-
# form parameters
|
97
|
-
form_params = {}
|
98
|
-
|
99
|
-
# http body (model)
|
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
|
-
end
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
if @api_client.config.client_side_validation && customer_token_id.to_s.length
|
154
|
-
fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerPaymentInstrumentApi.get_customer_payment_instrument, the character length must be
|
155
|
-
end
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
if @api_client.config.client_side_validation && payment_instrument_token_id.to_s.length
|
166
|
-
fail ArgumentError, 'invalid value for "payment_instrument_token_id" when calling CustomerPaymentInstrumentApi.get_customer_payment_instrument, the character length must be
|
167
|
-
end
|
168
|
-
|
169
|
-
if @api_client.config.client_side_validation &&
|
170
|
-
fail ArgumentError, 'invalid value for "
|
171
|
-
end
|
172
|
-
|
173
|
-
if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length
|
174
|
-
fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerPaymentInstrumentApi.get_customer_payment_instrument, the character length must be
|
175
|
-
end
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
#
|
188
|
-
header_params
|
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
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
if @api_client.config.client_side_validation &&
|
256
|
-
fail ArgumentError, 'invalid value for "
|
257
|
-
end
|
258
|
-
|
259
|
-
if @api_client.config.client_side_validation &&
|
260
|
-
fail ArgumentError, 'invalid value for "
|
261
|
-
end
|
262
|
-
|
263
|
-
if @api_client.config.client_side_validation && !opts[:'
|
264
|
-
fail ArgumentError, 'invalid value for "opts[:"
|
265
|
-
end
|
266
|
-
|
267
|
-
if @api_client.config.client_side_validation && !opts[:'
|
268
|
-
fail ArgumentError, 'invalid value for "opts[:"
|
269
|
-
end
|
270
|
-
|
271
|
-
if @api_client.config.client_side_validation && !opts[:'
|
272
|
-
fail ArgumentError, 'invalid value for "opts[:"
|
273
|
-
end
|
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
|
-
return data, status_code, headers
|
325
|
-
end
|
326
|
-
|
327
|
-
#
|
328
|
-
# @param
|
329
|
-
# @param
|
330
|
-
# @param
|
331
|
-
# @
|
332
|
-
# @option opts [String] :
|
333
|
-
# @
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
if @api_client.config.
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
# verify the required parameter '
|
358
|
-
if @api_client.config.client_side_validation &&
|
359
|
-
fail ArgumentError, "Missing the required parameter '
|
360
|
-
end
|
361
|
-
if @api_client.config.client_side_validation &&
|
362
|
-
fail ArgumentError, 'invalid value for "
|
363
|
-
end
|
364
|
-
|
365
|
-
if @api_client.config.client_side_validation &&
|
366
|
-
fail ArgumentError, 'invalid value for "
|
367
|
-
end
|
368
|
-
|
369
|
-
# verify the required parameter '
|
370
|
-
if @api_client.config.client_side_validation &&
|
371
|
-
fail ArgumentError, "Missing the required parameter '
|
372
|
-
end
|
373
|
-
if @api_client.config.client_side_validation &&
|
374
|
-
fail ArgumentError, 'invalid value for "
|
375
|
-
end
|
376
|
-
|
377
|
-
if @api_client.config.client_side_validation &&
|
378
|
-
fail ArgumentError, 'invalid value for "
|
379
|
-
end
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
if @api_client.config.client_side_validation && !opts[:'
|
386
|
-
fail ArgumentError, 'invalid value for "opts[:"
|
387
|
-
end
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
#
|
405
|
-
|
406
|
-
|
407
|
-
#
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
# Create a Customer Payment Instrument
|
440
|
-
# Include an existing TMS Customer &
|
441
|
-
# @param customer_token_id The TokenId of a customer.
|
442
|
-
# @param post_customer_payment_instrument_request
|
443
|
-
# @param [Hash] opts the optional parameters
|
444
|
-
# @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
|
445
|
-
# @return [
|
446
|
-
def
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
if @api_client.config.
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
# verify the required parameter '
|
469
|
-
if @api_client.config.client_side_validation &&
|
470
|
-
fail ArgumentError, "Missing the required parameter '
|
471
|
-
end
|
472
|
-
if @api_client.config.client_side_validation &&
|
473
|
-
fail ArgumentError, 'invalid value for "
|
474
|
-
end
|
475
|
-
|
476
|
-
if @api_client.config.client_side_validation &&
|
477
|
-
fail ArgumentError, 'invalid value for "
|
478
|
-
end
|
479
|
-
|
480
|
-
#
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
1
|
+
=begin
|
2
|
+
#CyberSource Merged Spec
|
3
|
+
|
4
|
+
#All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
|
5
|
+
|
6
|
+
OpenAPI spec version: 0.0.1
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.2.3
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'uri'
|
14
|
+
|
15
|
+
module CyberSource
|
16
|
+
class CustomerPaymentInstrumentApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default, config)
|
20
|
+
@api_client = api_client
|
21
|
+
@api_client.set_configuration(config)
|
22
|
+
end
|
23
|
+
# Delete a Customer Payment Instrument
|
24
|
+
# @param customer_token_id The TokenId of a customer.
|
25
|
+
# @param payment_instrument_token_id The TokenId of a payment instrument.
|
26
|
+
# @param [Hash] opts the optional parameters
|
27
|
+
# @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
|
28
|
+
# @return [nil]
|
29
|
+
def delete_customer_payment_instrument(customer_token_id, payment_instrument_token_id, opts = {})
|
30
|
+
data, status_code, headers = delete_customer_payment_instrument_with_http_info(customer_token_id, payment_instrument_token_id, opts)
|
31
|
+
return data, status_code, headers
|
32
|
+
end
|
33
|
+
|
34
|
+
# Delete a Customer Payment Instrument
|
35
|
+
# @param customer_token_id The TokenId of a customer.
|
36
|
+
# @param payment_instrument_token_id The TokenId of a payment instrument.
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
|
39
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
40
|
+
def delete_customer_payment_instrument_with_http_info(customer_token_id, payment_instrument_token_id, opts = {})
|
41
|
+
|
42
|
+
if @api_client.config.debugging
|
43
|
+
begin
|
44
|
+
raise
|
45
|
+
@api_client.config.logger.debug 'Calling API: CustomerPaymentInstrumentApi.delete_customer_payment_instrument ...'
|
46
|
+
rescue
|
47
|
+
puts 'Cannot write to log'
|
48
|
+
end
|
49
|
+
end
|
50
|
+
# verify the required parameter 'customer_token_id' is set
|
51
|
+
if @api_client.config.client_side_validation && customer_token_id.nil?
|
52
|
+
fail ArgumentError, "Missing the required parameter 'customer_token_id' when calling CustomerPaymentInstrumentApi.delete_customer_payment_instrument"
|
53
|
+
end
|
54
|
+
if @api_client.config.client_side_validation && customer_token_id.to_s.length > 32
|
55
|
+
fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerPaymentInstrumentApi.delete_customer_payment_instrument, the character length must be smaller than or equal to 32.'
|
56
|
+
end
|
57
|
+
|
58
|
+
if @api_client.config.client_side_validation && customer_token_id.to_s.length < 1
|
59
|
+
fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerPaymentInstrumentApi.delete_customer_payment_instrument, the character length must be great than or equal to 1.'
|
60
|
+
end
|
61
|
+
|
62
|
+
# verify the required parameter 'payment_instrument_token_id' is set
|
63
|
+
if @api_client.config.client_side_validation && payment_instrument_token_id.nil?
|
64
|
+
fail ArgumentError, "Missing the required parameter 'payment_instrument_token_id' when calling CustomerPaymentInstrumentApi.delete_customer_payment_instrument"
|
65
|
+
end
|
66
|
+
if @api_client.config.client_side_validation && payment_instrument_token_id.to_s.length > 32
|
67
|
+
fail ArgumentError, 'invalid value for "payment_instrument_token_id" when calling CustomerPaymentInstrumentApi.delete_customer_payment_instrument, the character length must be smaller than or equal to 32.'
|
68
|
+
end
|
69
|
+
|
70
|
+
if @api_client.config.client_side_validation && payment_instrument_token_id.to_s.length < 1
|
71
|
+
fail ArgumentError, 'invalid value for "payment_instrument_token_id" when calling CustomerPaymentInstrumentApi.delete_customer_payment_instrument, the character length must be great than or equal to 1.'
|
72
|
+
end
|
73
|
+
|
74
|
+
if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length > 36
|
75
|
+
fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerPaymentInstrumentApi.delete_customer_payment_instrument, the character length must be smaller than or equal to 36.'
|
76
|
+
end
|
77
|
+
|
78
|
+
if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length < 36
|
79
|
+
fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerPaymentInstrumentApi.delete_customer_payment_instrument, the character length must be great than or equal to 36.'
|
80
|
+
end
|
81
|
+
|
82
|
+
# resource path
|
83
|
+
local_var_path = 'tms/v2/customers/{customerTokenId}/payment-instruments/{paymentInstrumentTokenId}'.sub('{' + 'customerTokenId' + '}', customer_token_id.to_s).sub('{' + 'paymentInstrumentTokenId' + '}', payment_instrument_token_id.to_s)
|
84
|
+
|
85
|
+
# query parameters
|
86
|
+
query_params = {}
|
87
|
+
|
88
|
+
# header parameters
|
89
|
+
header_params = {}
|
90
|
+
# HTTP header 'Accept' (if needed)
|
91
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=utf-8'])
|
92
|
+
# HTTP header 'Content-Type'
|
93
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
|
94
|
+
header_params[:'profile-id'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
|
95
|
+
|
96
|
+
# form parameters
|
97
|
+
form_params = {}
|
98
|
+
|
99
|
+
# http body (model)
|
100
|
+
if 'DELETE' == 'POST'
|
101
|
+
post_body = '{}'
|
102
|
+
else
|
103
|
+
post_body = nil
|
104
|
+
end
|
105
|
+
auth_names = []
|
106
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
107
|
+
:header_params => header_params,
|
108
|
+
:query_params => query_params,
|
109
|
+
:form_params => form_params,
|
110
|
+
:body => post_body,
|
111
|
+
:auth_names => auth_names)
|
112
|
+
if @api_client.config.debugging
|
113
|
+
begin
|
114
|
+
raise
|
115
|
+
@api_client.config.logger.debug "API called: CustomerPaymentInstrumentApi#delete_customer_payment_instrument\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
116
|
+
rescue
|
117
|
+
puts 'Cannot write to log'
|
118
|
+
end
|
119
|
+
end
|
120
|
+
return data, status_code, headers
|
121
|
+
end
|
122
|
+
# Retrieve a Customer Payment Instrument
|
123
|
+
# @param customer_token_id The TokenId of a customer.
|
124
|
+
# @param payment_instrument_token_id The TokenId of a payment instrument.
|
125
|
+
# @param [Hash] opts the optional parameters
|
126
|
+
# @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
|
127
|
+
# @return [Tmsv2customersEmbeddedDefaultPaymentInstrument]
|
128
|
+
def get_customer_payment_instrument(customer_token_id, payment_instrument_token_id, opts = {})
|
129
|
+
data, status_code, headers = get_customer_payment_instrument_with_http_info(customer_token_id, payment_instrument_token_id, opts)
|
130
|
+
return data, status_code, headers
|
131
|
+
end
|
132
|
+
|
133
|
+
# Retrieve a Customer Payment Instrument
|
134
|
+
# @param customer_token_id The TokenId of a customer.
|
135
|
+
# @param payment_instrument_token_id The TokenId of a payment instrument.
|
136
|
+
# @param [Hash] opts the optional parameters
|
137
|
+
# @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
|
138
|
+
# @return [Array<(Tmsv2customersEmbeddedDefaultPaymentInstrument, Fixnum, Hash)>] Tmsv2customersEmbeddedDefaultPaymentInstrument data, response status code and response headers
|
139
|
+
def get_customer_payment_instrument_with_http_info(customer_token_id, payment_instrument_token_id, opts = {})
|
140
|
+
|
141
|
+
if @api_client.config.debugging
|
142
|
+
begin
|
143
|
+
raise
|
144
|
+
@api_client.config.logger.debug 'Calling API: CustomerPaymentInstrumentApi.get_customer_payment_instrument ...'
|
145
|
+
rescue
|
146
|
+
puts 'Cannot write to log'
|
147
|
+
end
|
148
|
+
end
|
149
|
+
# verify the required parameter 'customer_token_id' is set
|
150
|
+
if @api_client.config.client_side_validation && customer_token_id.nil?
|
151
|
+
fail ArgumentError, "Missing the required parameter 'customer_token_id' when calling CustomerPaymentInstrumentApi.get_customer_payment_instrument"
|
152
|
+
end
|
153
|
+
if @api_client.config.client_side_validation && customer_token_id.to_s.length > 32
|
154
|
+
fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerPaymentInstrumentApi.get_customer_payment_instrument, the character length must be smaller than or equal to 32.'
|
155
|
+
end
|
156
|
+
|
157
|
+
if @api_client.config.client_side_validation && customer_token_id.to_s.length < 1
|
158
|
+
fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerPaymentInstrumentApi.get_customer_payment_instrument, the character length must be great than or equal to 1.'
|
159
|
+
end
|
160
|
+
|
161
|
+
# verify the required parameter 'payment_instrument_token_id' is set
|
162
|
+
if @api_client.config.client_side_validation && payment_instrument_token_id.nil?
|
163
|
+
fail ArgumentError, "Missing the required parameter 'payment_instrument_token_id' when calling CustomerPaymentInstrumentApi.get_customer_payment_instrument"
|
164
|
+
end
|
165
|
+
if @api_client.config.client_side_validation && payment_instrument_token_id.to_s.length > 32
|
166
|
+
fail ArgumentError, 'invalid value for "payment_instrument_token_id" when calling CustomerPaymentInstrumentApi.get_customer_payment_instrument, the character length must be smaller than or equal to 32.'
|
167
|
+
end
|
168
|
+
|
169
|
+
if @api_client.config.client_side_validation && payment_instrument_token_id.to_s.length < 1
|
170
|
+
fail ArgumentError, 'invalid value for "payment_instrument_token_id" when calling CustomerPaymentInstrumentApi.get_customer_payment_instrument, the character length must be great than or equal to 1.'
|
171
|
+
end
|
172
|
+
|
173
|
+
if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length > 36
|
174
|
+
fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerPaymentInstrumentApi.get_customer_payment_instrument, the character length must be smaller than or equal to 36.'
|
175
|
+
end
|
176
|
+
|
177
|
+
if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length < 36
|
178
|
+
fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerPaymentInstrumentApi.get_customer_payment_instrument, the character length must be great than or equal to 36.'
|
179
|
+
end
|
180
|
+
|
181
|
+
# resource path
|
182
|
+
local_var_path = 'tms/v2/customers/{customerTokenId}/payment-instruments/{paymentInstrumentTokenId}'.sub('{' + 'customerTokenId' + '}', customer_token_id.to_s).sub('{' + 'paymentInstrumentTokenId' + '}', payment_instrument_token_id.to_s)
|
183
|
+
|
184
|
+
# query parameters
|
185
|
+
query_params = {}
|
186
|
+
|
187
|
+
# header parameters
|
188
|
+
header_params = {}
|
189
|
+
# HTTP header 'Accept' (if needed)
|
190
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=utf-8'])
|
191
|
+
# HTTP header 'Content-Type'
|
192
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
|
193
|
+
header_params[:'profile-id'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
|
194
|
+
|
195
|
+
# form parameters
|
196
|
+
form_params = {}
|
197
|
+
|
198
|
+
# http body (model)
|
199
|
+
if 'GET' == 'POST'
|
200
|
+
post_body = '{}'
|
201
|
+
else
|
202
|
+
post_body = nil
|
203
|
+
end
|
204
|
+
auth_names = []
|
205
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
206
|
+
:header_params => header_params,
|
207
|
+
:query_params => query_params,
|
208
|
+
:form_params => form_params,
|
209
|
+
:body => post_body,
|
210
|
+
:auth_names => auth_names,
|
211
|
+
:return_type => 'Tmsv2customersEmbeddedDefaultPaymentInstrument')
|
212
|
+
if @api_client.config.debugging
|
213
|
+
begin
|
214
|
+
raise
|
215
|
+
@api_client.config.logger.debug "API called: CustomerPaymentInstrumentApi#get_customer_payment_instrument\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
216
|
+
rescue
|
217
|
+
puts 'Cannot write to log'
|
218
|
+
end
|
219
|
+
end
|
220
|
+
return data, status_code, headers
|
221
|
+
end
|
222
|
+
# List Payment Instruments for a Customer
|
223
|
+
# @param customer_token_id The TokenId of a customer.
|
224
|
+
# @param [Hash] opts the optional parameters
|
225
|
+
# @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
|
226
|
+
# @option opts [Integer] :offset Starting record in zero-based dataset that should be returned as the first object in the array. Default is 0. (default to 0)
|
227
|
+
# @option opts [Integer] :limit The maximum number that can be returned in the array starting from the offset record in zero-based dataset. Default is 20, maximum is 100. (default to 20)
|
228
|
+
# @return [PaymentInstrumentList]
|
229
|
+
def get_customer_payment_instruments_list(customer_token_id, opts = {})
|
230
|
+
data, status_code, headers = get_customer_payment_instruments_list_with_http_info(customer_token_id, opts)
|
231
|
+
return data, status_code, headers
|
232
|
+
end
|
233
|
+
|
234
|
+
# List Payment Instruments for a Customer
|
235
|
+
# @param customer_token_id The TokenId of a customer.
|
236
|
+
# @param [Hash] opts the optional parameters
|
237
|
+
# @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
|
238
|
+
# @option opts [Integer] :offset Starting record in zero-based dataset that should be returned as the first object in the array. Default is 0.
|
239
|
+
# @option opts [Integer] :limit The maximum number that can be returned in the array starting from the offset record in zero-based dataset. Default is 20, maximum is 100.
|
240
|
+
# @return [Array<(PaymentInstrumentList, Fixnum, Hash)>] PaymentInstrumentList data, response status code and response headers
|
241
|
+
def get_customer_payment_instruments_list_with_http_info(customer_token_id, opts = {})
|
242
|
+
|
243
|
+
if @api_client.config.debugging
|
244
|
+
begin
|
245
|
+
raise
|
246
|
+
@api_client.config.logger.debug 'Calling API: CustomerPaymentInstrumentApi.get_customer_payment_instruments_list ...'
|
247
|
+
rescue
|
248
|
+
puts 'Cannot write to log'
|
249
|
+
end
|
250
|
+
end
|
251
|
+
# verify the required parameter 'customer_token_id' is set
|
252
|
+
if @api_client.config.client_side_validation && customer_token_id.nil?
|
253
|
+
fail ArgumentError, "Missing the required parameter 'customer_token_id' when calling CustomerPaymentInstrumentApi.get_customer_payment_instruments_list"
|
254
|
+
end
|
255
|
+
if @api_client.config.client_side_validation && customer_token_id.to_s.length > 32
|
256
|
+
fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerPaymentInstrumentApi.get_customer_payment_instruments_list, the character length must be smaller than or equal to 32.'
|
257
|
+
end
|
258
|
+
|
259
|
+
if @api_client.config.client_side_validation && customer_token_id.to_s.length < 1
|
260
|
+
fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerPaymentInstrumentApi.get_customer_payment_instruments_list, the character length must be great than or equal to 1.'
|
261
|
+
end
|
262
|
+
|
263
|
+
if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length > 36
|
264
|
+
fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerPaymentInstrumentApi.get_customer_payment_instruments_list, the character length must be smaller than or equal to 36.'
|
265
|
+
end
|
266
|
+
|
267
|
+
if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length < 36
|
268
|
+
fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerPaymentInstrumentApi.get_customer_payment_instruments_list, the character length must be great than or equal to 36.'
|
269
|
+
end
|
270
|
+
|
271
|
+
if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
|
272
|
+
fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling CustomerPaymentInstrumentApi.get_customer_payment_instruments_list, must be greater than or equal to 0.'
|
273
|
+
end
|
274
|
+
|
275
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
276
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CustomerPaymentInstrumentApi.get_customer_payment_instruments_list, must be smaller than or equal to 100.'
|
277
|
+
end
|
278
|
+
|
279
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
280
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CustomerPaymentInstrumentApi.get_customer_payment_instruments_list, must be greater than or equal to 1.'
|
281
|
+
end
|
282
|
+
|
283
|
+
# resource path
|
284
|
+
local_var_path = 'tms/v2/customers/{customerTokenId}/payment-instruments'.sub('{' + 'customerTokenId' + '}', customer_token_id.to_s)
|
285
|
+
|
286
|
+
# query parameters
|
287
|
+
query_params = {}
|
288
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
289
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
290
|
+
|
291
|
+
# header parameters
|
292
|
+
header_params = {}
|
293
|
+
# HTTP header 'Accept' (if needed)
|
294
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=utf-8'])
|
295
|
+
# HTTP header 'Content-Type'
|
296
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
|
297
|
+
header_params[:'profile-id'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
|
298
|
+
|
299
|
+
# form parameters
|
300
|
+
form_params = {}
|
301
|
+
|
302
|
+
# http body (model)
|
303
|
+
if 'GET' == 'POST'
|
304
|
+
post_body = '{}'
|
305
|
+
else
|
306
|
+
post_body = nil
|
307
|
+
end
|
308
|
+
auth_names = []
|
309
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
310
|
+
:header_params => header_params,
|
311
|
+
:query_params => query_params,
|
312
|
+
:form_params => form_params,
|
313
|
+
:body => post_body,
|
314
|
+
:auth_names => auth_names,
|
315
|
+
:return_type => 'PaymentInstrumentList')
|
316
|
+
if @api_client.config.debugging
|
317
|
+
begin
|
318
|
+
raise
|
319
|
+
@api_client.config.logger.debug "API called: CustomerPaymentInstrumentApi#get_customer_payment_instruments_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
320
|
+
rescue
|
321
|
+
puts 'Cannot write to log'
|
322
|
+
end
|
323
|
+
end
|
324
|
+
return data, status_code, headers
|
325
|
+
end
|
326
|
+
# Update a Customer Payment Instrument
|
327
|
+
# @param customer_token_id The TokenId of a customer.
|
328
|
+
# @param payment_instrument_token_id The TokenId of a payment instrument.
|
329
|
+
# @param patch_customer_payment_instrument_request
|
330
|
+
# @param [Hash] opts the optional parameters
|
331
|
+
# @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
|
332
|
+
# @option opts [String] :if_match Contains an ETag value from a GET request to make the request conditional.
|
333
|
+
# @return [Tmsv2customersEmbeddedDefaultPaymentInstrument]
|
334
|
+
def patch_customers_payment_instrument(customer_token_id, payment_instrument_token_id, patch_customer_payment_instrument_request, opts = {})
|
335
|
+
data, status_code, headers = patch_customers_payment_instrument_with_http_info(customer_token_id, payment_instrument_token_id, patch_customer_payment_instrument_request, opts)
|
336
|
+
return data, status_code, headers
|
337
|
+
end
|
338
|
+
|
339
|
+
# Update a Customer Payment Instrument
|
340
|
+
# @param customer_token_id The TokenId of a customer.
|
341
|
+
# @param payment_instrument_token_id The TokenId of a payment instrument.
|
342
|
+
# @param patch_customer_payment_instrument_request
|
343
|
+
# @param [Hash] opts the optional parameters
|
344
|
+
# @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
|
345
|
+
# @option opts [String] :if_match Contains an ETag value from a GET request to make the request conditional.
|
346
|
+
# @return [Array<(Tmsv2customersEmbeddedDefaultPaymentInstrument, Fixnum, Hash)>] Tmsv2customersEmbeddedDefaultPaymentInstrument data, response status code and response headers
|
347
|
+
def patch_customers_payment_instrument_with_http_info(customer_token_id, payment_instrument_token_id, patch_customer_payment_instrument_request, opts = {})
|
348
|
+
|
349
|
+
if @api_client.config.debugging
|
350
|
+
begin
|
351
|
+
raise
|
352
|
+
@api_client.config.logger.debug 'Calling API: CustomerPaymentInstrumentApi.patch_customers_payment_instrument ...'
|
353
|
+
rescue
|
354
|
+
puts 'Cannot write to log'
|
355
|
+
end
|
356
|
+
end
|
357
|
+
# verify the required parameter 'customer_token_id' is set
|
358
|
+
if @api_client.config.client_side_validation && customer_token_id.nil?
|
359
|
+
fail ArgumentError, "Missing the required parameter 'customer_token_id' when calling CustomerPaymentInstrumentApi.patch_customers_payment_instrument"
|
360
|
+
end
|
361
|
+
if @api_client.config.client_side_validation && customer_token_id.to_s.length > 32
|
362
|
+
fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerPaymentInstrumentApi.patch_customers_payment_instrument, the character length must be smaller than or equal to 32.'
|
363
|
+
end
|
364
|
+
|
365
|
+
if @api_client.config.client_side_validation && customer_token_id.to_s.length < 1
|
366
|
+
fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerPaymentInstrumentApi.patch_customers_payment_instrument, the character length must be great than or equal to 1.'
|
367
|
+
end
|
368
|
+
|
369
|
+
# verify the required parameter 'payment_instrument_token_id' is set
|
370
|
+
if @api_client.config.client_side_validation && payment_instrument_token_id.nil?
|
371
|
+
fail ArgumentError, "Missing the required parameter 'payment_instrument_token_id' when calling CustomerPaymentInstrumentApi.patch_customers_payment_instrument"
|
372
|
+
end
|
373
|
+
if @api_client.config.client_side_validation && payment_instrument_token_id.to_s.length > 32
|
374
|
+
fail ArgumentError, 'invalid value for "payment_instrument_token_id" when calling CustomerPaymentInstrumentApi.patch_customers_payment_instrument, the character length must be smaller than or equal to 32.'
|
375
|
+
end
|
376
|
+
|
377
|
+
if @api_client.config.client_side_validation && payment_instrument_token_id.to_s.length < 1
|
378
|
+
fail ArgumentError, 'invalid value for "payment_instrument_token_id" when calling CustomerPaymentInstrumentApi.patch_customers_payment_instrument, the character length must be great than or equal to 1.'
|
379
|
+
end
|
380
|
+
|
381
|
+
# verify the required parameter 'patch_customer_payment_instrument_request' is set
|
382
|
+
if @api_client.config.client_side_validation && patch_customer_payment_instrument_request.nil?
|
383
|
+
fail ArgumentError, "Missing the required parameter 'patch_customer_payment_instrument_request' when calling CustomerPaymentInstrumentApi.patch_customers_payment_instrument"
|
384
|
+
end
|
385
|
+
if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length > 36
|
386
|
+
fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerPaymentInstrumentApi.patch_customers_payment_instrument, the character length must be smaller than or equal to 36.'
|
387
|
+
end
|
388
|
+
|
389
|
+
if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length < 36
|
390
|
+
fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerPaymentInstrumentApi.patch_customers_payment_instrument, the character length must be great than or equal to 36.'
|
391
|
+
end
|
392
|
+
|
393
|
+
if @api_client.config.client_side_validation && !opts[:'if_match'].nil? && opts[:'if_match'].to_s.length > 32
|
394
|
+
fail ArgumentError, 'invalid value for "opts[:"if_match"]" when calling CustomerPaymentInstrumentApi.patch_customers_payment_instrument, the character length must be smaller than or equal to 32.'
|
395
|
+
end
|
396
|
+
|
397
|
+
if @api_client.config.client_side_validation && !opts[:'if_match'].nil? && opts[:'if_match'].to_s.length < 1
|
398
|
+
fail ArgumentError, 'invalid value for "opts[:"if_match"]" when calling CustomerPaymentInstrumentApi.patch_customers_payment_instrument, the character length must be great than or equal to 1.'
|
399
|
+
end
|
400
|
+
|
401
|
+
# resource path
|
402
|
+
local_var_path = 'tms/v2/customers/{customerTokenId}/payment-instruments/{paymentInstrumentTokenId}'.sub('{' + 'customerTokenId' + '}', customer_token_id.to_s).sub('{' + 'paymentInstrumentTokenId' + '}', payment_instrument_token_id.to_s)
|
403
|
+
|
404
|
+
# query parameters
|
405
|
+
query_params = {}
|
406
|
+
|
407
|
+
# header parameters
|
408
|
+
header_params = {}
|
409
|
+
# HTTP header 'Accept' (if needed)
|
410
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=utf-8'])
|
411
|
+
# HTTP header 'Content-Type'
|
412
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
|
413
|
+
header_params[:'profile-id'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
|
414
|
+
header_params[:'if-match'] = opts[:'if_match'] if !opts[:'if_match'].nil?
|
415
|
+
|
416
|
+
# form parameters
|
417
|
+
form_params = {}
|
418
|
+
|
419
|
+
# http body (model)
|
420
|
+
post_body = @api_client.object_to_http_body(patch_customer_payment_instrument_request)
|
421
|
+
auth_names = []
|
422
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
|
423
|
+
:header_params => header_params,
|
424
|
+
:query_params => query_params,
|
425
|
+
:form_params => form_params,
|
426
|
+
:body => post_body,
|
427
|
+
:auth_names => auth_names,
|
428
|
+
:return_type => 'Tmsv2customersEmbeddedDefaultPaymentInstrument')
|
429
|
+
if @api_client.config.debugging
|
430
|
+
begin
|
431
|
+
raise
|
432
|
+
@api_client.config.logger.debug "API called: CustomerPaymentInstrumentApi#patch_customers_payment_instrument\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
433
|
+
rescue
|
434
|
+
puts 'Cannot write to log'
|
435
|
+
end
|
436
|
+
end
|
437
|
+
return data, status_code, headers
|
438
|
+
end
|
439
|
+
# Create a Customer Payment Instrument
|
440
|
+
# Include an existing TMS Customer & Instrument Identifier token id in the request. * A Customer token can be created by calling: **POST */tms/v2/customers*** * An Instrument Identifier token can be created by calling: **POST */tms/v1/instrumentidentifiers***
|
441
|
+
# @param customer_token_id The TokenId of a customer.
|
442
|
+
# @param post_customer_payment_instrument_request
|
443
|
+
# @param [Hash] opts the optional parameters
|
444
|
+
# @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
|
445
|
+
# @return [Tmsv2customersEmbeddedDefaultPaymentInstrument]
|
446
|
+
def post_customer_payment_instrument(customer_token_id, post_customer_payment_instrument_request, opts = {})
|
447
|
+
data, status_code, headers = post_customer_payment_instrument_with_http_info(customer_token_id, post_customer_payment_instrument_request, opts)
|
448
|
+
return data, status_code, headers
|
449
|
+
end
|
450
|
+
|
451
|
+
# Create a Customer Payment Instrument
|
452
|
+
# Include an existing TMS Customer & Instrument Identifier token id in the request. * A Customer token can be created by calling: **POST */tms/v2/customers*** * An Instrument Identifier token can be created by calling: **POST */tms/v1/instrumentidentifiers***
|
453
|
+
# @param customer_token_id The TokenId of a customer.
|
454
|
+
# @param post_customer_payment_instrument_request
|
455
|
+
# @param [Hash] opts the optional parameters
|
456
|
+
# @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
|
457
|
+
# @return [Array<(Tmsv2customersEmbeddedDefaultPaymentInstrument, Fixnum, Hash)>] Tmsv2customersEmbeddedDefaultPaymentInstrument data, response status code and response headers
|
458
|
+
def post_customer_payment_instrument_with_http_info(customer_token_id, post_customer_payment_instrument_request, opts = {})
|
459
|
+
|
460
|
+
if @api_client.config.debugging
|
461
|
+
begin
|
462
|
+
raise
|
463
|
+
@api_client.config.logger.debug 'Calling API: CustomerPaymentInstrumentApi.post_customer_payment_instrument ...'
|
464
|
+
rescue
|
465
|
+
puts 'Cannot write to log'
|
466
|
+
end
|
467
|
+
end
|
468
|
+
# verify the required parameter 'customer_token_id' is set
|
469
|
+
if @api_client.config.client_side_validation && customer_token_id.nil?
|
470
|
+
fail ArgumentError, "Missing the required parameter 'customer_token_id' when calling CustomerPaymentInstrumentApi.post_customer_payment_instrument"
|
471
|
+
end
|
472
|
+
if @api_client.config.client_side_validation && customer_token_id.to_s.length > 32
|
473
|
+
fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerPaymentInstrumentApi.post_customer_payment_instrument, the character length must be smaller than or equal to 32.'
|
474
|
+
end
|
475
|
+
|
476
|
+
if @api_client.config.client_side_validation && customer_token_id.to_s.length < 1
|
477
|
+
fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerPaymentInstrumentApi.post_customer_payment_instrument, the character length must be great than or equal to 1.'
|
478
|
+
end
|
479
|
+
|
480
|
+
# verify the required parameter 'post_customer_payment_instrument_request' is set
|
481
|
+
if @api_client.config.client_side_validation && post_customer_payment_instrument_request.nil?
|
482
|
+
fail ArgumentError, "Missing the required parameter 'post_customer_payment_instrument_request' when calling CustomerPaymentInstrumentApi.post_customer_payment_instrument"
|
483
|
+
end
|
484
|
+
if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length > 36
|
485
|
+
fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerPaymentInstrumentApi.post_customer_payment_instrument, the character length must be smaller than or equal to 36.'
|
486
|
+
end
|
487
|
+
|
488
|
+
if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length < 36
|
489
|
+
fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerPaymentInstrumentApi.post_customer_payment_instrument, the character length must be great than or equal to 36.'
|
490
|
+
end
|
491
|
+
|
492
|
+
# resource path
|
493
|
+
local_var_path = 'tms/v2/customers/{customerTokenId}/payment-instruments'.sub('{' + 'customerTokenId' + '}', customer_token_id.to_s)
|
494
|
+
|
495
|
+
# query parameters
|
496
|
+
query_params = {}
|
497
|
+
|
498
|
+
# header parameters
|
499
|
+
header_params = {}
|
500
|
+
# HTTP header 'Accept' (if needed)
|
501
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=utf-8'])
|
502
|
+
# HTTP header 'Content-Type'
|
503
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
|
504
|
+
header_params[:'profile-id'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
|
505
|
+
|
506
|
+
# form parameters
|
507
|
+
form_params = {}
|
508
|
+
|
509
|
+
# http body (model)
|
510
|
+
post_body = @api_client.object_to_http_body(post_customer_payment_instrument_request)
|
511
|
+
auth_names = []
|
512
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
513
|
+
:header_params => header_params,
|
514
|
+
:query_params => query_params,
|
515
|
+
:form_params => form_params,
|
516
|
+
:body => post_body,
|
517
|
+
:auth_names => auth_names,
|
518
|
+
:return_type => 'Tmsv2customersEmbeddedDefaultPaymentInstrument')
|
519
|
+
if @api_client.config.debugging
|
520
|
+
begin
|
521
|
+
raise
|
522
|
+
@api_client.config.logger.debug "API called: CustomerPaymentInstrumentApi#post_customer_payment_instrument\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
523
|
+
rescue
|
524
|
+
puts 'Cannot write to log'
|
525
|
+
end
|
526
|
+
end
|
527
|
+
return data, status_code, headers
|
528
|
+
end
|
529
|
+
end
|
530
|
+
end
|