Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
98 changes: 76 additions & 22 deletions CyberSource/__init__.py

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions CyberSource/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from .invoices_api import InvoicesApi
from .manage_webhooks_api import ManageWebhooksApi
from .merchant_boarding_api import MerchantBoardingApi
from .merchant_defined_fields_api import MerchantDefinedFieldsApi
from .microform_integration_api import MicroformIntegrationApi
from .net_fundings_api import NetFundingsApi
from .notification_of_changes_api import NotificationOfChangesApi
Expand Down Expand Up @@ -55,9 +56,11 @@
from .user_management_api import UserManagementApi
from .user_management_search_api import UserManagementSearchApi
from .verification_api import VerificationApi
from .bank_account_validation_api import BankAccountValidationApi
from .billing_agreements_api import BillingAgreementsApi
from .capture_api import CaptureApi
from .credit_api import CreditApi
from .merchant_defined_fields_api import MerchantDefinedFieldsApi
from .orders_api import OrdersApi
from .payment_tokens_api import PaymentTokensApi
from .payments_api import PaymentsApi
Expand Down
166 changes: 166 additions & 0 deletions CyberSource/api/bank_account_validation_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
# coding: utf-8

"""
CyberSource Merged Spec

All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html

OpenAPI spec version: 0.0.1

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

from __future__ import absolute_import

import sys
import os
import re

# python 2 and python 3 compatibility library
from six import iteritems

from ..configuration import Configuration
from ..api_client import ApiClient
import CyberSource.logging.log_factory as LogFactory
from CyberSource.utilities.MultipartHelpers import MultipartHelpers
from authenticationsdk.util.MLEUtility import MLEUtility
from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters
from authenticationsdk.util.Utility import process_body

from ..utilities.tracking.sdk_tracker import SdkTracker
class BankAccountValidationApi(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
"""

def __init__(self, merchant_config, api_client=None):
if api_client:
self.api_client = api_client
else:
self.api_client = ApiClient()
self.api_client.set_configuration(merchant_config)
self.logger = LogFactory.setup_logger(self.__class__.__name__, self.api_client.mconfig.log_config)



def bank_account_validation_request(self, account_validations_request, **kwargs):
"""
Visa Bank Account Validation Service
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.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.bank_account_validation_request(account_validations_request, callback=callback_function)

:param callback function: The callback function
for asynchronous request. (optional)
:param AccountValidationsRequest account_validations_request: (required)
:return: InlineResponse20013
If the method is called asynchronously,
returns the request thread.

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.
"""

self.logger.info("CALL TO METHOD `bank_account_validation_request` STARTED")

kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.bank_account_validation_request_with_http_info(account_validations_request, **kwargs)
else:
(data) = self.bank_account_validation_request_with_http_info(account_validations_request, **kwargs)
return data

def bank_account_validation_request_with_http_info(self, account_validations_request, **kwargs):
"""
Visa Bank Account Validation Service
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.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.bank_account_validation_request_with_http_info(account_validations_request, callback=callback_function)

:param callback function: The callback function
for asynchronous request. (optional)
:param AccountValidationsRequest account_validations_request: (required)
:return: InlineResponse20013
If the method is called asynchronously,
returns the request thread.
"""

all_params = ['account_validations_request']
all_params.append('callback')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')

params = locals()
for key, val in iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method bank_account_validation_request" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'account_validations_request' is set
if ('account_validations_request' not in params) or (params['account_validations_request'] is None):
self.logger.error("InvalidArgumentException : Missing the required parameter `account_validations_request` when calling `bank_account_validation_request`")
raise ValueError("Missing the required parameter `account_validations_request` when calling `bank_account_validation_request`")


collection_formats = {}

path_params = {}

query_params = []

header_params = {}

form_params = []
local_var_files = {}

# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8'])

# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type(['application/json;charset=utf-8'])

body_params = None
if 'account_validations_request' in params:
body_params = params['account_validations_request']

sdkTracker = SdkTracker()
body_params = sdkTracker.insert_developer_id_tracker(body_params, 'account_validations_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId)
body_params = process_body(body_params)

inbound_mle_status = "mandatory"
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"):
body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params)

# Authentication setting
auth_settings = []

return self.api_client.call_api(f'/bavs/v1/account-validations', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='InlineResponse20013',
auth_settings=auth_settings,
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
44 changes: 17 additions & 27 deletions CyberSource/api/batches_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,10 @@ class BatchesApi(object):
"""

def __init__(self, merchant_config, api_client=None):
config = Configuration()
if api_client:
self.api_client = api_client
else:
if not config.api_client:
config.api_client = ApiClient()
self.api_client = config.api_client
self.api_client = ApiClient()
self.api_client.set_configuration(merchant_config)
self.logger = LogFactory.setup_logger(self.__class__.__name__, self.api_client.mconfig.log_config)

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

if self.api_client.mconfig.log_config.enable_log:
self.logger.info("CALL TO METHOD `get_batch_report` STARTED")
self.logger.info("CALL TO METHOD `get_batch_report` STARTED")

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


Expand Down Expand Up @@ -163,7 +158,7 @@ def get_batch_report_with_http_info(self, batch_id, **kwargs):
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='InlineResponse20011',
response_type='InlineResponse20012',
auth_settings=auth_settings,
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand All @@ -186,13 +181,12 @@ def get_batch_status(self, batch_id, **kwargs):
:param callback function: The callback function
for asynchronous request. (optional)
:param str batch_id: Unique identification number assigned to the submitted request. (required)
:return: InlineResponse20010
:return: InlineResponse20011
If the method is called asynchronously,
returns the request thread.
"""

if self.api_client.mconfig.log_config.enable_log:
self.logger.info("CALL TO METHOD `get_batch_status` STARTED")
self.logger.info("CALL TO METHOD `get_batch_status` STARTED")

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


Expand Down Expand Up @@ -286,7 +279,7 @@ def get_batch_status_with_http_info(self, batch_id, **kwargs):
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='InlineResponse20010',
response_type='InlineResponse20011',
auth_settings=auth_settings,
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand All @@ -312,13 +305,12 @@ def get_batches_list(self, **kwargs):
:param int limit: The maximum number that can be returned in the array starting from the offset record in zero-based dataset.
:param str from_date: ISO-8601 format: yyyyMMddTHHmmssZ
:param str to_date: ISO-8601 format: yyyyMMddTHHmmssZ
:return: InlineResponse2009
:return: InlineResponse20010
If the method is called asynchronously,
returns the request thread.
"""

if self.api_client.mconfig.log_config.enable_log:
self.logger.info("CALL TO METHOD `get_batches_list` STARTED")
self.logger.info("CALL TO METHOD `get_batches_list` STARTED")

kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
Expand All @@ -345,7 +337,7 @@ def get_batches_list_with_http_info(self, **kwargs):
:param int limit: The maximum number that can be returned in the array starting from the offset record in zero-based dataset.
:param str from_date: ISO-8601 format: yyyyMMddTHHmmssZ
:param str to_date: ISO-8601 format: yyyyMMddTHHmmssZ
:return: InlineResponse2009
:return: InlineResponse20010
If the method is called asynchronously,
returns the request thread.
"""
Expand Down Expand Up @@ -415,7 +407,7 @@ def get_batches_list_with_http_info(self, **kwargs):
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='InlineResponse2009',
response_type='InlineResponse20010',
auth_settings=auth_settings,
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down Expand Up @@ -443,8 +435,7 @@ def post_batch(self, body, **kwargs):
returns the request thread.
"""

if self.api_client.mconfig.log_config.enable_log:
self.logger.info("CALL TO METHOD `post_batch` STARTED")
self.logger.info("CALL TO METHOD `post_batch` STARTED")

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


Expand Down
Loading