Skip to content

Commit b85c4c0

Browse files
authored
Merge pull request #167 from CyberSource/release/sep25
Release/sep25
2 parents 7ae0dfa + e9bd1a7 commit b85c4c0

464 files changed

Lines changed: 36292 additions & 6188 deletions

File tree

Some content is hidden

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

CyberSource/__init__.py

Lines changed: 76 additions & 22 deletions
Large diffs are not rendered by default.

CyberSource/api/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from .invoices_api import InvoicesApi
2626
from .manage_webhooks_api import ManageWebhooksApi
2727
from .merchant_boarding_api import MerchantBoardingApi
28+
from .merchant_defined_fields_api import MerchantDefinedFieldsApi
2829
from .microform_integration_api import MicroformIntegrationApi
2930
from .net_fundings_api import NetFundingsApi
3031
from .notification_of_changes_api import NotificationOfChangesApi
@@ -55,9 +56,11 @@
5556
from .user_management_api import UserManagementApi
5657
from .user_management_search_api import UserManagementSearchApi
5758
from .verification_api import VerificationApi
59+
from .bank_account_validation_api import BankAccountValidationApi
5860
from .billing_agreements_api import BillingAgreementsApi
5961
from .capture_api import CaptureApi
6062
from .credit_api import CreditApi
63+
from .merchant_defined_fields_api import MerchantDefinedFieldsApi
6164
from .orders_api import OrdersApi
6265
from .payment_tokens_api import PaymentTokensApi
6366
from .payments_api import PaymentsApi
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
# coding: utf-8
2+
3+
"""
4+
CyberSource Merged Spec
5+
6+
All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
7+
8+
OpenAPI spec version: 0.0.1
9+
10+
Generated by: https://github.com/swagger-api/swagger-codegen.git
11+
"""
12+
13+
from __future__ import absolute_import
14+
15+
import sys
16+
import os
17+
import re
18+
19+
# python 2 and python 3 compatibility library
20+
from six import iteritems
21+
22+
from ..configuration import Configuration
23+
from ..api_client import ApiClient
24+
import CyberSource.logging.log_factory as LogFactory
25+
from CyberSource.utilities.MultipartHelpers import MultipartHelpers
26+
from authenticationsdk.util.MLEUtility import MLEUtility
27+
from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters
28+
from authenticationsdk.util.Utility import process_body
29+
30+
from ..utilities.tracking.sdk_tracker import SdkTracker
31+
class BankAccountValidationApi(object):
32+
"""
33+
NOTE: This class is auto generated by the swagger code generator program.
34+
Do not edit the class manually.
35+
Ref: https://github.com/swagger-api/swagger-codegen
36+
"""
37+
38+
def __init__(self, merchant_config, api_client=None):
39+
if api_client:
40+
self.api_client = api_client
41+
else:
42+
self.api_client = ApiClient()
43+
self.api_client.set_configuration(merchant_config)
44+
self.logger = LogFactory.setup_logger(self.__class__.__name__, self.api_client.mconfig.log_config)
45+
46+
47+
48+
def bank_account_validation_request(self, account_validations_request, **kwargs):
49+
"""
50+
Visa Bank Account Validation Service
51+
The Visa Bank Account Validation Service is a new standalone product designed to validate customer's routing and bank account number combination for ACH transactions. Merchant's can use this standalone product to validate their customer's account prior to processing an ACH transaction against the customer's account to comply with Nacha's account validation mandate for Web-debit transactions.
52+
This method makes a synchronous HTTP request by default. To make an
53+
asynchronous HTTP request, please define a `callback` function
54+
to be invoked when receiving the response.
55+
>>> def callback_function(response):
56+
>>> pprint(response)
57+
>>>
58+
>>> thread = api.bank_account_validation_request(account_validations_request, callback=callback_function)
59+
60+
:param callback function: The callback function
61+
for asynchronous request. (optional)
62+
:param AccountValidationsRequest account_validations_request: (required)
63+
:return: InlineResponse20013
64+
If the method is called asynchronously,
65+
returns the request thread.
66+
67+
DISCLAIMER:
68+
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.
69+
"""
70+
71+
self.logger.info("CALL TO METHOD `bank_account_validation_request` STARTED")
72+
73+
kwargs['_return_http_data_only'] = True
74+
if kwargs.get('callback'):
75+
return self.bank_account_validation_request_with_http_info(account_validations_request, **kwargs)
76+
else:
77+
(data) = self.bank_account_validation_request_with_http_info(account_validations_request, **kwargs)
78+
return data
79+
80+
def bank_account_validation_request_with_http_info(self, account_validations_request, **kwargs):
81+
"""
82+
Visa Bank Account Validation Service
83+
The Visa Bank Account Validation Service is a new standalone product designed to validate customer's routing and bank account number combination for ACH transactions. Merchant's can use this standalone product to validate their customer's account prior to processing an ACH transaction against the customer's account to comply with Nacha's account validation mandate for Web-debit transactions.
84+
This method makes a synchronous HTTP request by default. To make an
85+
asynchronous HTTP request, please define a `callback` function
86+
to be invoked when receiving the response.
87+
>>> def callback_function(response):
88+
>>> pprint(response)
89+
>>>
90+
>>> thread = api.bank_account_validation_request_with_http_info(account_validations_request, callback=callback_function)
91+
92+
:param callback function: The callback function
93+
for asynchronous request. (optional)
94+
:param AccountValidationsRequest account_validations_request: (required)
95+
:return: InlineResponse20013
96+
If the method is called asynchronously,
97+
returns the request thread.
98+
"""
99+
100+
all_params = ['account_validations_request']
101+
all_params.append('callback')
102+
all_params.append('_return_http_data_only')
103+
all_params.append('_preload_content')
104+
all_params.append('_request_timeout')
105+
106+
params = locals()
107+
for key, val in iteritems(params['kwargs']):
108+
if key not in all_params:
109+
raise TypeError(
110+
"Got an unexpected keyword argument '%s'"
111+
" to method bank_account_validation_request" % key
112+
)
113+
params[key] = val
114+
del params['kwargs']
115+
# verify the required parameter 'account_validations_request' is set
116+
if ('account_validations_request' not in params) or (params['account_validations_request'] is None):
117+
self.logger.error("InvalidArgumentException : Missing the required parameter `account_validations_request` when calling `bank_account_validation_request`")
118+
raise ValueError("Missing the required parameter `account_validations_request` when calling `bank_account_validation_request`")
119+
120+
121+
collection_formats = {}
122+
123+
path_params = {}
124+
125+
query_params = []
126+
127+
header_params = {}
128+
129+
form_params = []
130+
local_var_files = {}
131+
132+
# HTTP header `Accept`
133+
header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8'])
134+
135+
# HTTP header `Content-Type`
136+
header_params['Content-Type'] = self.api_client.select_header_content_type(['application/json;charset=utf-8'])
137+
138+
body_params = None
139+
if 'account_validations_request' in params:
140+
body_params = params['account_validations_request']
141+
142+
sdkTracker = SdkTracker()
143+
body_params = sdkTracker.insert_developer_id_tracker(body_params, 'account_validations_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId)
144+
body_params = process_body(body_params)
145+
146+
inbound_mle_status = "mandatory"
147+
if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, inbound_mle_status, "bank_account_validation_request,bank_account_validation_request_with_http_info"):
148+
body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params)
149+
150+
# Authentication setting
151+
auth_settings = []
152+
153+
return self.api_client.call_api(f'/bavs/v1/account-validations', 'POST',
154+
path_params,
155+
query_params,
156+
header_params,
157+
body=body_params,
158+
post_params=form_params,
159+
files=local_var_files,
160+
response_type='InlineResponse20013',
161+
auth_settings=auth_settings,
162+
callback=params.get('callback'),
163+
_return_http_data_only=params.get('_return_http_data_only'),
164+
_preload_content=params.get('_preload_content', True),
165+
_request_timeout=params.get('_request_timeout'),
166+
collection_formats=collection_formats)

CyberSource/api/batches_api.py

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,10 @@ class BatchesApi(object):
3636
"""
3737

3838
def __init__(self, merchant_config, api_client=None):
39-
config = Configuration()
4039
if api_client:
4140
self.api_client = api_client
4241
else:
43-
if not config.api_client:
44-
config.api_client = ApiClient()
45-
self.api_client = config.api_client
42+
self.api_client = ApiClient()
4643
self.api_client.set_configuration(merchant_config)
4744
self.logger = LogFactory.setup_logger(self.__class__.__name__, self.api_client.mconfig.log_config)
4845

@@ -63,13 +60,12 @@ def get_batch_report(self, batch_id, **kwargs):
6360
:param callback function: The callback function
6461
for asynchronous request. (optional)
6562
:param str batch_id: Unique identification number assigned to the submitted request. (required)
66-
:return: InlineResponse20011
63+
:return: InlineResponse20012
6764
If the method is called asynchronously,
6865
returns the request thread.
6966
"""
7067

71-
if self.api_client.mconfig.log_config.enable_log:
72-
self.logger.info("CALL TO METHOD `get_batch_report` STARTED")
68+
self.logger.info("CALL TO METHOD `get_batch_report` STARTED")
7369

7470
kwargs['_return_http_data_only'] = True
7571
if kwargs.get('callback'):
@@ -93,7 +89,7 @@ def get_batch_report_with_http_info(self, batch_id, **kwargs):
9389
:param callback function: The callback function
9490
for asynchronous request. (optional)
9591
:param str batch_id: Unique identification number assigned to the submitted request. (required)
96-
:return: InlineResponse20011
92+
:return: InlineResponse20012
9793
If the method is called asynchronously,
9894
returns the request thread.
9995
"""
@@ -115,8 +111,7 @@ def get_batch_report_with_http_info(self, batch_id, **kwargs):
115111
del params['kwargs']
116112
# verify the required parameter 'batch_id' is set
117113
if ('batch_id' not in params) or (params['batch_id'] is None):
118-
if self.api_client.mconfig.log_config.enable_log:
119-
self.logger.error("InvalidArgumentException : Missing the required parameter `batch_id` when calling `get_batch_report`")
114+
self.logger.error("InvalidArgumentException : Missing the required parameter `batch_id` when calling `get_batch_report`")
120115
raise ValueError("Missing the required parameter `batch_id` when calling `get_batch_report`")
121116

122117

@@ -163,7 +158,7 @@ def get_batch_report_with_http_info(self, batch_id, **kwargs):
163158
body=body_params,
164159
post_params=form_params,
165160
files=local_var_files,
166-
response_type='InlineResponse20011',
161+
response_type='InlineResponse20012',
167162
auth_settings=auth_settings,
168163
callback=params.get('callback'),
169164
_return_http_data_only=params.get('_return_http_data_only'),
@@ -186,13 +181,12 @@ def get_batch_status(self, batch_id, **kwargs):
186181
:param callback function: The callback function
187182
for asynchronous request. (optional)
188183
:param str batch_id: Unique identification number assigned to the submitted request. (required)
189-
:return: InlineResponse20010
184+
:return: InlineResponse20011
190185
If the method is called asynchronously,
191186
returns the request thread.
192187
"""
193188

194-
if self.api_client.mconfig.log_config.enable_log:
195-
self.logger.info("CALL TO METHOD `get_batch_status` STARTED")
189+
self.logger.info("CALL TO METHOD `get_batch_status` STARTED")
196190

197191
kwargs['_return_http_data_only'] = True
198192
if kwargs.get('callback'):
@@ -216,7 +210,7 @@ def get_batch_status_with_http_info(self, batch_id, **kwargs):
216210
:param callback function: The callback function
217211
for asynchronous request. (optional)
218212
:param str batch_id: Unique identification number assigned to the submitted request. (required)
219-
:return: InlineResponse20010
213+
:return: InlineResponse20011
220214
If the method is called asynchronously,
221215
returns the request thread.
222216
"""
@@ -238,8 +232,7 @@ def get_batch_status_with_http_info(self, batch_id, **kwargs):
238232
del params['kwargs']
239233
# verify the required parameter 'batch_id' is set
240234
if ('batch_id' not in params) or (params['batch_id'] is None):
241-
if self.api_client.mconfig.log_config.enable_log:
242-
self.logger.error("InvalidArgumentException : Missing the required parameter `batch_id` when calling `get_batch_status`")
235+
self.logger.error("InvalidArgumentException : Missing the required parameter `batch_id` when calling `get_batch_status`")
243236
raise ValueError("Missing the required parameter `batch_id` when calling `get_batch_status`")
244237

245238

@@ -286,7 +279,7 @@ def get_batch_status_with_http_info(self, batch_id, **kwargs):
286279
body=body_params,
287280
post_params=form_params,
288281
files=local_var_files,
289-
response_type='InlineResponse20010',
282+
response_type='InlineResponse20011',
290283
auth_settings=auth_settings,
291284
callback=params.get('callback'),
292285
_return_http_data_only=params.get('_return_http_data_only'),
@@ -312,13 +305,12 @@ def get_batches_list(self, **kwargs):
312305
:param int limit: The maximum number that can be returned in the array starting from the offset record in zero-based dataset.
313306
:param str from_date: ISO-8601 format: yyyyMMddTHHmmssZ
314307
:param str to_date: ISO-8601 format: yyyyMMddTHHmmssZ
315-
:return: InlineResponse2009
308+
:return: InlineResponse20010
316309
If the method is called asynchronously,
317310
returns the request thread.
318311
"""
319312

320-
if self.api_client.mconfig.log_config.enable_log:
321-
self.logger.info("CALL TO METHOD `get_batches_list` STARTED")
313+
self.logger.info("CALL TO METHOD `get_batches_list` STARTED")
322314

323315
kwargs['_return_http_data_only'] = True
324316
if kwargs.get('callback'):
@@ -345,7 +337,7 @@ def get_batches_list_with_http_info(self, **kwargs):
345337
:param int limit: The maximum number that can be returned in the array starting from the offset record in zero-based dataset.
346338
:param str from_date: ISO-8601 format: yyyyMMddTHHmmssZ
347339
:param str to_date: ISO-8601 format: yyyyMMddTHHmmssZ
348-
:return: InlineResponse2009
340+
:return: InlineResponse20010
349341
If the method is called asynchronously,
350342
returns the request thread.
351343
"""
@@ -415,7 +407,7 @@ def get_batches_list_with_http_info(self, **kwargs):
415407
body=body_params,
416408
post_params=form_params,
417409
files=local_var_files,
418-
response_type='InlineResponse2009',
410+
response_type='InlineResponse20010',
419411
auth_settings=auth_settings,
420412
callback=params.get('callback'),
421413
_return_http_data_only=params.get('_return_http_data_only'),
@@ -443,8 +435,7 @@ def post_batch(self, body, **kwargs):
443435
returns the request thread.
444436
"""
445437

446-
if self.api_client.mconfig.log_config.enable_log:
447-
self.logger.info("CALL TO METHOD `post_batch` STARTED")
438+
self.logger.info("CALL TO METHOD `post_batch` STARTED")
448439

449440
kwargs['_return_http_data_only'] = True
450441
if kwargs.get('callback'):
@@ -490,8 +481,7 @@ def post_batch_with_http_info(self, body, **kwargs):
490481
del params['kwargs']
491482
# verify the required parameter 'body' is set
492483
if ('body' not in params) or (params['body'] is None):
493-
if self.api_client.mconfig.log_config.enable_log:
494-
self.logger.error("InvalidArgumentException : Missing the required parameter `body` when calling `post_batch`")
484+
self.logger.error("InvalidArgumentException : Missing the required parameter `body` when calling `post_batch`")
495485
raise ValueError("Missing the required parameter `body` when calling `post_batch`")
496486

497487

0 commit comments

Comments
 (0)