Skip to content

Commit c216628

Browse files
adding disclaimer in beta apis through generation script
1 parent cd506d6 commit c216628

File tree

61 files changed

+285
-804
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+285
-804
lines changed

generator/cybersource-ruby-template/api.mustache

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,13 @@ module {{moduleName}}
2020
{{#notes}}
2121
# {{{notes}}}
2222
{{/notes}}
23+
#
2324
{{#allParams}}{{#required}} # @param {{paramName}} {{description}}
2425
{{/required}}{{/allParams}} # @param [Hash] opts the optional parameters
2526
{{#allParams}}{{^required}} # @option opts [{{{dataType}}}] :{{paramName}} {{description}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
2627
{{/required}}{{/allParams}} # @return [{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}nil{{/returnType}}]
28+
#
29+
# DISCLAIMER_PLACEHOLDER_{{#vendorExtensions.x-devcenter-metaData.apiLifeCycle}}{{.}}{{/vendorExtensions.x-devcenter-metaData.apiLifeCycle}}
2730
def {{operationId}}({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}opts = {})
2831
data, status_code, headers = {{operationId}}_with_http_info({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}opts)
2932
return data, status_code, headers
@@ -79,30 +82,6 @@ module {{moduleName}}
7982
{{/isEnum}}
8083
{{/required}}
8184
{{#hasValidation}}
82-
{{#maxLength}}
83-
if @api_client.config.client_side_validation && {{^required}}!opts[:'{{{paramName}}}'].nil? && {{/required}}{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}}.to_s.length > {{{maxLength}}}
84-
fail ArgumentError, 'invalid value for "{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:"{{{paramName}}}"]{{/required}}" when calling {{classname}}.{{operationId}}, the character length must be smaller than or equal to {{{maxLength}}}.'
85-
end
86-
87-
{{/maxLength}}
88-
{{#minLength}}
89-
if @api_client.config.client_side_validation && {{^required}}!opts[:'{{{paramName}}}'].nil? && {{/required}}{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}}.to_s.length < {{{minLength}}}
90-
fail ArgumentError, 'invalid value for "{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:"{{{paramName}}}"]{{/required}}" when calling {{classname}}.{{operationId}}, the character length must be great than or equal to {{{minLength}}}.'
91-
end
92-
93-
{{/minLength}}
94-
{{#maximum}}
95-
if @api_client.config.client_side_validation && {{^required}}!opts[:'{{{paramName}}}'].nil? && {{/required}}{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{{maximum}}}
96-
fail ArgumentError, 'invalid value for "{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:"{{{paramName}}}"]{{/required}}" when calling {{classname}}.{{operationId}}, must be smaller than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{{maximum}}}.'
97-
end
98-
99-
{{/maximum}}
100-
{{#minimum}}
101-
if @api_client.config.client_side_validation && {{^required}}!opts[:'{{{paramName}}}'].nil? && {{/required}}{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{{minimum}}}
102-
fail ArgumentError, 'invalid value for "{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:"{{{paramName}}}"]{{/required}}" when calling {{classname}}.{{operationId}}, must be greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}{{{minimum}}}.'
103-
end
104-
105-
{{/minimum}}
10685
{{#pattern}}
10786
#if @api_client.config.client_side_validation && {{^required}}!opts[:'{{{paramName}}}'].nil? && {{/required}}{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}} !~ Regexp.new({{{pattern}}})
10887
#fail ArgumentError, "invalid value for '{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:\"{{{paramName}}}\"]{{/required}}' when calling {{classname}}.{{operationId}}, must conform to the pattern {{{pattern}}}."

generator/cybersource_ruby_SDK_gen.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,11 @@ sed -i 's/$/\r/' ../lib/cybersource_rest_client.rb
211211
# sed -i "s+require \'\'cybersource_rest_client/api/download_dtd_api\'\'++g;s+require \'\'cybersource_rest_client/api/download_xsd_api\'\'++g" ../lib/cybersource_rest_client.rb"
212212

213213
# to remove beginning / from loc_var_path in all the api files
214-
214+
# adding disclaimer in beta APIs
215215
cd ../lib/cybersource_rest_client/api
216216
for file in ./*.rb; do \
217+
sed -i "s|DISCLAIMER_PLACEHOLDER_beta|DISCLAIMER : Cybersource may allow Customer to access, use, and/or test a Cybersource product or service that may still be in development or has not been market-tested (\"Beta Product\") solely for the purpose of evaluating the functionality or marketability of the Beta Product (a \"Beta Evaluation\"). Notwithstanding any language to the contrary, the following terms shall apply with respect to Customer\'s participation in any Beta Evaluation (and the Beta Product(s)) accessed thereunder): The Parties will enter into a separate form agreement detailing the scope of the Beta Evaluation, requirements, pricing, the length of the beta evaluation period (\"Beta Product Form\"). Beta Products are not, and may not become, Transaction Services and have not yet been publicly released and are offered for the sole purpose of internal testing and non-commercial evaluation. Customer's use of the Beta Product shall be solely for the purpose of conducting the Beta Evaluation. Customer accepts all risks arising out of the access and use of the Beta Products. Cybersource may, in its sole discretion, at any time, terminate or discontinue the Beta Evaluation. Customer acknowledges and agrees that any Beta Product may still be in development and that Beta Product is provided \"AS IS\" and may not perform at the level of a commercially available service, may not operate as expected and may be modified prior to release. CYBERSOURCE SHALL NOT BE RESPONSIBLE OR LIABLE UNDER ANY CONTRACT, TORT (INCLUDING NEGLIGENCE), OR OTHERWISE RELATING TO A BETA PRODUCT OR THE BETA EVALUATION (A) FOR LOSS OR INACCURACY OF DATA OR COST OF PROCUREMENT OF SUBSTITUTE GOODS, SERVICES OR TECHNOLOGY, (B) ANY CLAIM, LOSSES, DAMAGES, OR CAUSE OF ACTION ARISING IN CONNECTION WITH THE BETA PRODUCT; OR (C) FOR ANY INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES INCLUDING, BUT NOT LIMITED TO, LOSS OF REVENUES AND LOSS OF PROFITS.|g" "$file"
218+
sed -i "/DISCLAIMER_PLACEHOLDER_/d" "$file"
217219
sed -i "s|local_var_path = "\'"/|local_var_path = "\'"|g" "$file"
218220
sed -i 's/$/\r/' "$file"
219221
done

lib/cybersource_rest_client/api/asymmetric_key_management_api.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ def initialize(api_client = ApiClient.default, config)
2222
end
2323
# Create one or more PKCS12 keys
2424
# 'Create one or more PKCS12 keys'
25+
#
2526
# @param create_p12_keys_request
2627
# @param [Hash] opts the optional parameters
2728
# @return [KmsV2KeysAsymPost201Response]
29+
#
2830
def create_p12_keys(create_p12_keys_request, opts = {})
2931
data, status_code, headers = create_p12_keys_with_http_info(create_p12_keys_request, opts)
3032
return data, status_code, headers
@@ -89,9 +91,11 @@ def create_p12_keys_with_http_info(create_p12_keys_request, opts = {})
8991
end
9092
# Delete one or more PKCS12 keys
9193
# 'Delete one or more PKCS12 keys'
94+
#
9295
# @param delete_bulk_p12_keys_request
9396
# @param [Hash] opts the optional parameters
9497
# @return [KmsV2KeysAsymDeletesPost200Response]
98+
#
9599
def delete_bulk_p12_keys(delete_bulk_p12_keys_request, opts = {})
96100
data, status_code, headers = delete_bulk_p12_keys_with_http_info(delete_bulk_p12_keys_request, opts)
97101
return data, status_code, headers
@@ -156,9 +160,11 @@ def delete_bulk_p12_keys_with_http_info(delete_bulk_p12_keys_request, opts = {})
156160
end
157161
# Retrieves PKCS12 key details
158162
# Retrieves keys details by providing the key id.
163+
#
159164
# @param key_id Key ID.
160165
# @param [Hash] opts the optional parameters
161166
# @return [KmsV2KeysAsymGet200Response]
167+
#
162168
def get_p12_key_details(key_id, opts = {})
163169
data, status_code, headers = get_p12_key_details_with_http_info(key_id, opts)
164170
return data, status_code, headers
@@ -225,10 +231,12 @@ def get_p12_key_details_with_http_info(key_id, opts = {})
225231
end
226232
# Activate or De-activate Asymmetric Key
227233
# Activate or De-activate Asymmetric Key
234+
#
228235
# @param key_id Key ID.
229236
# @param update_asym_keys_request
230237
# @param [Hash] opts the optional parameters
231238
# @return [Object]
239+
#
232240
def update_asym_key(key_id, update_asym_keys_request, opts = {})
233241
data, status_code, headers = update_asym_key_with_http_info(key_id, update_asym_keys_request, opts)
234242
return data, status_code, headers

lib/cybersource_rest_client/api/batches_api.rb

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ def initialize(api_client = ApiClient.default, config)
2222
end
2323
# Retrieve a Batch Report
2424
# **Get Batch Report**<br>This resource accepts a batch id and returns: - The batch status. - The total number of accepted, rejected, updated records. - The total number of card association responses. - The billable quantities of: - New Account Numbers (NAN) - New Expiry Dates (NED) - Account Closures (ACL) - Contact Card Holders (CCH) - Source record information including token ids, masked card number, expiration dates & card type. - Response record information including response code, reason, token ids, masked card number, expiration dates & card type.
25+
#
2526
# @param batch_id Unique identification number assigned to the submitted request.
2627
# @param [Hash] opts the optional parameters
2728
# @return [InlineResponse2007]
29+
#
2830
def get_batch_report(batch_id, opts = {})
2931
data, status_code, headers = get_batch_report_with_http_info(batch_id, opts)
3032
return data, status_code, headers
@@ -49,14 +51,6 @@ def get_batch_report_with_http_info(batch_id, opts = {})
4951
if @api_client.config.client_side_validation && batch_id.nil?
5052
fail ArgumentError, "Missing the required parameter 'batch_id' when calling BatchesApi.get_batch_report"
5153
end
52-
# if @api_client.config.client_side_validation && batch_id > 32
53-
# fail ArgumentError, 'invalid value for "batch_id" when calling BatchesApi.get_batch_report, must be smaller than or equal to 32.'
54-
# end
55-
#
56-
# if @api_client.config.client_side_validation && batch_id < 16
57-
# fail ArgumentError, 'invalid value for "batch_id" when calling BatchesApi.get_batch_report, must be greater than or equal to 16.'
58-
# end
59-
6054
# resource path
6155
local_var_path = 'accountupdater/v1/batches/{batchId}/report'.sub('{' + 'batchId' + '}', batch_id.to_s)
6256

@@ -99,9 +93,11 @@ def get_batch_report_with_http_info(batch_id, opts = {})
9993
end
10094
# Retrieve a Batch Status
10195
# **Get Batch Status**<br>This resource accepts a batch id and returns: - The batch status. - The total number of accepted, rejected, updated records. - The total number of card association responses. - The billable quantities of: - New Account Numbers (NAN) - New Expiry Dates (NED) - Account Closures (ACL) - Contact Card Holders (CCH)
96+
#
10297
# @param batch_id Unique identification number assigned to the submitted request.
10398
# @param [Hash] opts the optional parameters
10499
# @return [InlineResponse2006]
100+
#
105101
def get_batch_status(batch_id, opts = {})
106102
data, status_code, headers = get_batch_status_with_http_info(batch_id, opts)
107103
return data, status_code, headers
@@ -126,14 +122,6 @@ def get_batch_status_with_http_info(batch_id, opts = {})
126122
if @api_client.config.client_side_validation && batch_id.nil?
127123
fail ArgumentError, "Missing the required parameter 'batch_id' when calling BatchesApi.get_batch_status"
128124
end
129-
# if @api_client.config.client_side_validation && batch_id > 32
130-
# fail ArgumentError, 'invalid value for "batch_id" when calling BatchesApi.get_batch_status, must be smaller than or equal to 32.'
131-
# end
132-
#
133-
# if @api_client.config.client_side_validation && batch_id < 16
134-
# fail ArgumentError, 'invalid value for "batch_id" when calling BatchesApi.get_batch_status, must be greater than or equal to 16.'
135-
# end
136-
137125
# resource path
138126
local_var_path = 'accountupdater/v1/batches/{batchId}/status'.sub('{' + 'batchId' + '}', batch_id.to_s)
139127

@@ -176,12 +164,14 @@ def get_batch_status_with_http_info(batch_id, opts = {})
176164
end
177165
# List Batches
178166
# **List Batches**<br>This resource accepts a optional date range, record offset and limit, returning a paginated response of batches containing: - The batch id. - The batch status. - The batch created / modified dates. - The total number of accepted, rejected, updated records. - The total number of card association responses.
167+
#
179168
# @param [Hash] opts the optional parameters
180169
# @option opts [Integer] :offset Starting record in zero-based dataset that should be returned as the first object in the array. (default to 0)
181170
# @option opts [Integer] :limit The maximum number that can be returned in the array starting from the offset record in zero-based dataset. (default to 20)
182171
# @option opts [String] :from_date ISO-8601 format: yyyyMMddTHHmmssZ
183172
# @option opts [String] :to_date ISO-8601 format: yyyyMMddTHHmmssZ
184173
# @return [InlineResponse2005]
174+
#
185175
def get_batches_list(opts = {})
186176
data, status_code, headers = get_batches_list_with_http_info(opts)
187177
return data, status_code, headers
@@ -205,18 +195,6 @@ def get_batches_list_with_http_info(opts = {})
205195
puts 'Cannot write to log'
206196
end
207197
end
208-
if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
209-
fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling BatchesApi.get_batches_list, must be greater than or equal to 0.'
210-
end
211-
212-
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
213-
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling BatchesApi.get_batches_list, must be smaller than or equal to 500.'
214-
end
215-
216-
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
217-
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling BatchesApi.get_batches_list, must be greater than or equal to 1.'
218-
end
219-
220198
# resource path
221199
local_var_path = 'accountupdater/v1/batches'
222200

@@ -263,9 +241,11 @@ def get_batches_list_with_http_info(opts = {})
263241
end
264242
# Create a Batch
265243
# **Create a Batch**<br>This resource accepts TMS tokens ids of a Customer, Payment Instrument or Instrument Identifier. <br> The card numbers for the supplied tokens ids are then sent to the relevant card associations to check for updates.<br>The following type of batches can be submitted: - **oneOff** batch containing tokens id for Visa or MasterCard card numbers. - **amexRegistration** batch containing tokens id for Amex card numbers. A batch id will be returned on a successful response which can be used to get the batch status and the batch report.
244+
#
266245
# @param body
267246
# @param [Hash] opts the optional parameters
268247
# @return [InlineResponse202]
248+
#
269249
def post_batch(body, opts = {})
270250
data, status_code, headers = post_batch_with_http_info(body, opts)
271251
return data, status_code, headers

lib/cybersource_rest_client/api/billing_agreements_api.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ def initialize(api_client = ApiClient.default, config)
2222
end
2323
# Standing Instruction Cancellation or Modification
2424
# Standing Instruction with or without Token
25+
#
2526
# @param modify_billing_agreement
2627
# @param id ID for de-registration or cancellation of Billing Agreement
2728
# @param [Hash] opts the optional parameters
2829
# @return [PtsV2CreditsPost201Response1]
30+
#
2931
def billing_agreements_de_registration(modify_billing_agreement, id, opts = {})
3032
data, status_code, headers = billing_agreements_de_registration_with_http_info(modify_billing_agreement, id, opts)
3133
return data, status_code, headers
@@ -95,10 +97,12 @@ def billing_agreements_de_registration_with_http_info(modify_billing_agreement,
9597
end
9698
# Standing Instruction intimation
9799
# Standing Instruction with or without Token.
100+
#
98101
# @param intimate_billing_agreement
99102
# @param id ID for intimation of Billing Agreement
100103
# @param [Hash] opts the optional parameters
101104
# @return [PtsV2CreditsPost201Response1]
105+
#
102106
def billing_agreements_intimation(intimate_billing_agreement, id, opts = {})
103107
data, status_code, headers = billing_agreements_intimation_with_http_info(intimate_billing_agreement, id, opts)
104108
return data, status_code, headers
@@ -168,9 +172,11 @@ def billing_agreements_intimation_with_http_info(intimate_billing_agreement, id,
168172
end
169173
# Standing Instruction completion registration
170174
# Standing Instruction with or without Token. Transaction amount in case First payment is coming along with registration. Only 2 decimal places allowed
175+
#
171176
# @param create_billing_agreement
172177
# @param [Hash] opts the optional parameters
173178
# @return [PtsV2CreditsPost201Response1]
179+
#
174180
def billing_agreements_registration(create_billing_agreement, opts = {})
175181
data, status_code, headers = billing_agreements_registration_with_http_info(create_billing_agreement, opts)
176182
return data, status_code, headers

lib/cybersource_rest_client/api/capture_api.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ def initialize(api_client = ApiClient.default, config)
2222
end
2323
# Capture a Payment
2424
# Include the payment ID in the POST request to capture the payment amount.
25+
#
2526
# @param capture_payment_request
2627
# @param id The payment ID returned from a previous payment request. This ID links the capture to the payment.
2728
# @param [Hash] opts the optional parameters
2829
# @return [PtsV2PaymentsCapturesPost201Response]
30+
#
2931
def capture_payment(capture_payment_request, id, opts = {})
3032
data, status_code, headers = capture_payment_with_http_info(capture_payment_request, id, opts)
3133
return data, status_code, headers

0 commit comments

Comments
 (0)