# Path: ingenico/connect/sdk/domain/definitions/amount_of_money.py
# class AmountOfMoney(DataObject):
# 
#     __amount = None
#     __currency_code = None
# 
#     @property
#     def amount(self):
#         """
#         | Amount in cents and always having 2 decimals
#         
#         Type: int
#         """
#         return self.__amount
# 
#     @amount.setter
#     def amount(self, value):
#         self.__amount = value
# 
#     @property
#     def currency_code(self):
#         """
#         | Three-letter ISO currency code representing the currency for the amount
#         
#         Type: str
#         """
#         return self.__currency_code
# 
#     @currency_code.setter
#     def currency_code(self, value):
#         self.__currency_code = value
# 
#     def to_dictionary(self):
#         dictionary = super(AmountOfMoney, self).to_dictionary()
#         if self.amount is not None:
#             dictionary['amount'] = self.amount
#         if self.currency_code is not None:
#             dictionary['currencyCode'] = self.currency_code
#         return dictionary
# 
#     def from_dictionary(self, dictionary):
#         super(AmountOfMoney, self).from_dictionary(dictionary)
#         if 'amount' in dictionary:
#             self.amount = dictionary['amount']
#         if 'currencyCode' in dictionary:
#             self.currency_code = dictionary['currencyCode']
#         return self
# 
# Path: tests/integration/init_utils.py
# PROPERTIES_URL = os.path.abspath(os.path.join(__file__, os.pardir, "../resources/configuration.ini"))
# PROPERTIES_URL_PROXY = os.path.abspath(os.path.join(__file__, os.pardir, "../resources/configuration.proxy.ini"))
# API_KEY_ID = os.getenv("connect.api.apiKeyId")
# SECRET_API_KEY = os.getenv("connect.api.secretApiKey")
# MERCHANT_ID = str(os.getenv("connect.api.merchantId"))
# def create_communicator_configuration(properties_url=PROPERTIES_URL, max_connections=False):
# def create_session():
# def create_client(max_connections=False):
# def create_client_with_proxy(max_connections=False):
# 
# Path: tests/integration/init_utils.py
# MERCHANT_ID = str(os.getenv("connect.api.merchantId"))


import unittest
from ingenico.connect.sdk.domain.definitions.amount_of_money import AmountOfMoney
from ingenico.connect.sdk.domain.definitions.bank_account_bban import BankAccountBban
from ingenico.connect.sdk.domain.riskassessments.definitions.customer_risk_assessment import \
    CustomerRiskAssessment
from ingenico.connect.sdk.domain.riskassessments.definitions.order_risk_assessment import OrderRiskAssessment
from ingenico.connect.sdk.domain.riskassessments.risk_assessment_bank_account import RiskAssessmentBankAccount
from tests.integration import init_utils
from tests.integration.init_utils import MERCHANT_ID



class RiskAssessmentsTest(unittest.TestCase):
    """Test if the risk assessments service functions"""
    def test_risk_assessments(self):
        """Test if the risk assessments service functions"""
        bank_account_bban = BankAccountBban()
        bank_account_bban.country_code = "DE"
        bank_account_bban.account_number = "0532013000"
        bank_account_bban.bank_code = "37040044"
        amount_of_money = AmountOfMoney()
        amount_of_money.amount = 100
        amount_of_money.currency_code = "EUR"
        customer = CustomerRiskAssessment()
        customer.locale = "en_GB"
        order = OrderRiskAssessment()
        order.amount_of_money = amount_of_money
        order.customer = customer
        body = RiskAssessmentBankAccount()
        body.order = order
        body.bank_account_bban = bank_account_bban

        with init_utils.create_client() as client:

# Path: ingenico/connect/sdk/domain/definitions/amount_of_money.py
# class AmountOfMoney(DataObject):
# 
#     __amount = None
#     __currency_code = None
# 
#     @property
#     def amount(self):
#         """
#         | Amount in cents and always having 2 decimals
#         
#         Type: int
#         """
#         return self.__amount
# 
#     @amount.setter
#     def amount(self, value):
#         self.__amount = value
# 
#     @property
#     def currency_code(self):
#         """
#         | Three-letter ISO currency code representing the currency for the amount
#         
#         Type: str
#         """
#         return self.__currency_code
# 
#     @currency_code.setter
#     def currency_code(self, value):
#         self.__currency_code = value
# 
#     def to_dictionary(self):
#         dictionary = super(AmountOfMoney, self).to_dictionary()
#         if self.amount is not None:
#             dictionary['amount'] = self.amount
#         if self.currency_code is not None:
#             dictionary['currencyCode'] = self.currency_code
#         return dictionary
# 
#     def from_dictionary(self, dictionary):
#         super(AmountOfMoney, self).from_dictionary(dictionary)
#         if 'amount' in dictionary:
#             self.amount = dictionary['amount']
#         if 'currencyCode' in dictionary:
#             self.currency_code = dictionary['currencyCode']
#         return self
# 
# Path: tests/integration/init_utils.py
# PROPERTIES_URL = os.path.abspath(os.path.join(__file__, os.pardir, "../resources/configuration.ini"))
# PROPERTIES_URL_PROXY = os.path.abspath(os.path.join(__file__, os.pardir, "../resources/configuration.proxy.ini"))
# API_KEY_ID = os.getenv("connect.api.apiKeyId")
# SECRET_API_KEY = os.getenv("connect.api.secretApiKey")
# MERCHANT_ID = str(os.getenv("connect.api.merchantId"))
# def create_communicator_configuration(properties_url=PROPERTIES_URL, max_connections=False):
# def create_session():
# def create_client(max_connections=False):
# def create_client_with_proxy(max_connections=False):
# 
# Path: tests/integration/init_utils.py
# MERCHANT_ID = str(os.getenv("connect.api.merchantId"))


# Path: tests/integration/test_risk_assessments.py
import unittest
from ingenico.connect.sdk.domain.definitions.amount_of_money import AmountOfMoney
from ingenico.connect.sdk.domain.definitions.bank_account_bban import BankAccountBban
from ingenico.connect.sdk.domain.riskassessments.definitions.customer_risk_assessment import \
    CustomerRiskAssessment
from ingenico.connect.sdk.domain.riskassessments.definitions.order_risk_assessment import OrderRiskAssessment
from ingenico.connect.sdk.domain.riskassessments.risk_assessment_bank_account import RiskAssessmentBankAccount
from tests.integration import init_utils
from tests.integration.init_utils import MERCHANT_ID




class RiskAssessmentsTest(unittest.TestCase):
    """Test if the risk assessments service functions"""
    def test_risk_assessments(self):
        """Test if the risk assessments service functions"""
        bank_account_bban = BankAccountBban()
        bank_account_bban.country_code = "DE"
        bank_account_bban.account_number = "0532013000"
        bank_account_bban.bank_code = "37040044"
        amount_of_money = AmountOfMoney()
        amount_of_money.amount = 100
        amount_of_money.currency_code = "EUR"
        customer = CustomerRiskAssessment()
        customer.locale = "en_GB"
        order = OrderRiskAssessment()
        order.amount_of_money = amount_of_money
        order.customer = customer
        body = RiskAssessmentBankAccount()
        body.order = order
        body.bank_account_bban = bank_account_bban

        with init_utils.create_client() as client:

            response = client.merchant(MERCHANT_ID).riskassessments().bankaccounts(body)