Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 8 additions & 18 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 @@ -68,8 +65,7 @@ def get_batch_report(self, batch_id, **kwargs):
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 Down Expand Up @@ -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 @@ -191,8 +186,7 @@ def get_batch_status(self, batch_id, **kwargs):
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 Down Expand Up @@ -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 @@ -317,8 +310,7 @@ def get_batches_list(self, **kwargs):
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 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
29 changes: 9 additions & 20 deletions CyberSource/api/billing_agreements_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,10 @@ class BillingAgreementsApi(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 @@ -69,8 +66,7 @@ def billing_agreements_de_registration(self, modify_billing_agreement, id, **kwa
returns the request thread.
"""

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

kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
Expand Down Expand Up @@ -117,13 +113,11 @@ def billing_agreements_de_registration_with_http_info(self, modify_billing_agree
del params['kwargs']
# verify the required parameter 'modify_billing_agreement' is set
if ('modify_billing_agreement' not in params) or (params['modify_billing_agreement'] is None):
if self.api_client.mconfig.log_config.enable_log:
self.logger.error("InvalidArgumentException : Missing the required parameter `modify_billing_agreement` when calling `billing_agreements_de_registration`")
self.logger.error("InvalidArgumentException : Missing the required parameter `modify_billing_agreement` when calling `billing_agreements_de_registration`")
raise ValueError("Missing the required parameter `modify_billing_agreement` when calling `billing_agreements_de_registration`")
# verify the required parameter 'id' is set
if ('id' not in params) or (params['id'] is None):
if self.api_client.mconfig.log_config.enable_log:
self.logger.error("InvalidArgumentException : Missing the required parameter `id` when calling `billing_agreements_de_registration`")
self.logger.error("InvalidArgumentException : Missing the required parameter `id` when calling `billing_agreements_de_registration`")
raise ValueError("Missing the required parameter `id` when calling `billing_agreements_de_registration`")


Expand Down Expand Up @@ -198,8 +192,7 @@ def billing_agreements_intimation(self, intimate_billing_agreement, id, **kwargs
returns the request thread.
"""

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

kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
Expand Down Expand Up @@ -246,13 +239,11 @@ def billing_agreements_intimation_with_http_info(self, intimate_billing_agreemen
del params['kwargs']
# verify the required parameter 'intimate_billing_agreement' is set
if ('intimate_billing_agreement' not in params) or (params['intimate_billing_agreement'] is None):
if self.api_client.mconfig.log_config.enable_log:
self.logger.error("InvalidArgumentException : Missing the required parameter `intimate_billing_agreement` when calling `billing_agreements_intimation`")
self.logger.error("InvalidArgumentException : Missing the required parameter `intimate_billing_agreement` when calling `billing_agreements_intimation`")
raise ValueError("Missing the required parameter `intimate_billing_agreement` when calling `billing_agreements_intimation`")
# verify the required parameter 'id' is set
if ('id' not in params) or (params['id'] is None):
if self.api_client.mconfig.log_config.enable_log:
self.logger.error("InvalidArgumentException : Missing the required parameter `id` when calling `billing_agreements_intimation`")
self.logger.error("InvalidArgumentException : Missing the required parameter `id` when calling `billing_agreements_intimation`")
raise ValueError("Missing the required parameter `id` when calling `billing_agreements_intimation`")


Expand Down Expand Up @@ -326,8 +317,7 @@ def billing_agreements_registration(self, create_billing_agreement, **kwargs):
returns the request thread.
"""

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

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


Expand Down
11 changes: 3 additions & 8 deletions CyberSource/api/bin_lookup_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,10 @@ class BinLookupApi(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 Down Expand Up @@ -71,8 +68,7 @@ def get_account_info(self, create_bin_lookup_request, **kwargs):
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.
"""

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

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


Expand Down
14 changes: 4 additions & 10 deletions CyberSource/api/capture_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,10 @@ class CaptureApi(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 @@ -69,8 +66,7 @@ def capture_payment(self, capture_payment_request, id, **kwargs):
returns the request thread.
"""

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

kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
Expand Down Expand Up @@ -117,13 +113,11 @@ def capture_payment_with_http_info(self, capture_payment_request, id, **kwargs):
del params['kwargs']
# verify the required parameter 'capture_payment_request' is set
if ('capture_payment_request' not in params) or (params['capture_payment_request'] is None):
if self.api_client.mconfig.log_config.enable_log:
self.logger.error("InvalidArgumentException : Missing the required parameter `capture_payment_request` when calling `capture_payment`")
self.logger.error("InvalidArgumentException : Missing the required parameter `capture_payment_request` when calling `capture_payment`")
raise ValueError("Missing the required parameter `capture_payment_request` when calling `capture_payment`")
# verify the required parameter 'id' is set
if ('id' not in params) or (params['id'] is None):
if self.api_client.mconfig.log_config.enable_log:
self.logger.error("InvalidArgumentException : Missing the required parameter `id` when calling `capture_payment`")
self.logger.error("InvalidArgumentException : Missing the required parameter `id` when calling `capture_payment`")
raise ValueError("Missing the required parameter `id` when calling `capture_payment`")


Expand Down
14 changes: 4 additions & 10 deletions CyberSource/api/chargeback_details_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,10 @@ class ChargebackDetailsApi(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 Down Expand Up @@ -70,8 +67,7 @@ def get_chargeback_details(self, start_time, end_time, **kwargs):
returns the request thread.
"""

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

kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
Expand Down Expand Up @@ -119,13 +115,11 @@ def get_chargeback_details_with_http_info(self, start_time, end_time, **kwargs):
del params['kwargs']
# verify the required parameter 'start_time' is set
if ('start_time' not in params) or (params['start_time'] is None):
if self.api_client.mconfig.log_config.enable_log:
self.logger.error("InvalidArgumentException : Missing the required parameter `start_time` when calling `get_chargeback_details`")
self.logger.error("InvalidArgumentException : Missing the required parameter `start_time` when calling `get_chargeback_details`")
raise ValueError("Missing the required parameter `start_time` when calling `get_chargeback_details`")
# verify the required parameter 'end_time' is set
if ('end_time' not in params) or (params['end_time'] is None):
if self.api_client.mconfig.log_config.enable_log:
self.logger.error("InvalidArgumentException : Missing the required parameter `end_time` when calling `get_chargeback_details`")
self.logger.error("InvalidArgumentException : Missing the required parameter `end_time` when calling `get_chargeback_details`")
raise ValueError("Missing the required parameter `end_time` when calling `get_chargeback_details`")


Expand Down
Loading