def example(self): with self.__get_client() as client: bank_account_bban = BankAccountBban() bank_account_bban.account_number = "0532013000" bank_account_bban.bank_code = "37040044" bank_account_bban.country_code = "DE" amount_of_money = AmountOfMoney() amount_of_money.amount = 100 amount_of_money.currency_code = "EUR" billing_address = Address() billing_address.country_code = "US" customer = CustomerRiskAssessment() customer.billing_address = billing_address customer.locale = "en_US" order = OrderRiskAssessment() order.amount_of_money = amount_of_money order.customer = customer body = RiskAssessmentBankAccount() body.bank_account_bban = bank_account_bban body.order = order response = client.merchant("merchantId").riskassessments().bankaccounts(body)
def from_dictionary(self, dictionary): super(BankDetailsResponse, self).from_dictionary(dictionary) if 'bankAccountBban' in dictionary: if not isinstance(dictionary['bankAccountBban'], dict): raise TypeError('value \'{}\' is not a dictionary'.format( dictionary['bankAccountBban'])) value = BankAccountBban() self.bank_account_bban = value.from_dictionary( dictionary['bankAccountBban']) if 'bankAccountIban' in dictionary: if not isinstance(dictionary['bankAccountIban'], dict): raise TypeError('value \'{}\' is not a dictionary'.format( dictionary['bankAccountIban'])) value = BankAccountIban() self.bank_account_iban = value.from_dictionary( dictionary['bankAccountIban']) if 'bankData' in dictionary: if not isinstance(dictionary['bankData'], dict): raise TypeError('value \'{}\' is not a dictionary'.format( dictionary['bankData'])) value = BankData() self.bank_data = value.from_dictionary(dictionary['bankData']) if 'swift' in dictionary: if not isinstance(dictionary['swift'], dict): raise TypeError('value \'{}\' is not a dictionary'.format( dictionary['swift'])) value = Swift() self.swift = value.from_dictionary(dictionary['swift']) return self
def from_dictionary(self, dictionary): super(NonSepaDirectDebitPaymentProduct730SpecificInput, self).from_dictionary(dictionary) if 'bankAccountBban' in dictionary: if not isinstance(dictionary['bankAccountBban'], dict): raise TypeError('value \'{}\' is not a dictionary'.format( dictionary['bankAccountBban'])) value = BankAccountBban() self.bank_account_bban = value.from_dictionary( dictionary['bankAccountBban']) return self
def example(self): with self.__get_client() as client: bank_account_bban = BankAccountBban() bank_account_bban.account_number = "0532013000" bank_account_bban.bank_code = "37040044" bank_account_bban.country_code = "DE" body = BankDetailsRequest() body.bank_account_bban = bank_account_bban response = client.merchant("merchantId").services().bankaccount( body)
def from_dictionary(self, dictionary): super(TokenNonSepaDirectDebitPaymentProduct705SpecificData, self).from_dictionary(dictionary) if 'authorisationId' in dictionary: self.authorisation_id = dictionary['authorisationId'] if 'bankAccountBban' in dictionary: if not isinstance(dictionary['bankAccountBban'], dict): raise TypeError('value \'{}\' is not a dictionary'.format( dictionary['bankAccountBban'])) value = BankAccountBban() self.bank_account_bban = value.from_dictionary( dictionary['bankAccountBban']) return self
def from_dictionary(self, dictionary): super(RiskAssessmentBankAccount, self).from_dictionary(dictionary) if 'bankAccountBban' in dictionary: if not isinstance(dictionary['bankAccountBban'], dict): raise TypeError('value \'{}\' is not a dictionary'.format( dictionary['bankAccountBban'])) value = BankAccountBban() self.bank_account_bban = value.from_dictionary( dictionary['bankAccountBban']) if 'bankAccountIban' in dictionary: if not isinstance(dictionary['bankAccountIban'], dict): raise TypeError('value \'{}\' is not a dictionary'.format( dictionary['bankAccountIban'])) value = BankAccountIban() self.bank_account_iban = value.from_dictionary( dictionary['bankAccountIban']) return self
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) self.assertGreater(len(response.results), 0)
def example(self): with self.__get_client() as client: billing_address = Address() billing_address.additional_info = "Suite II" billing_address.city = "Monument Valley" billing_address.country_code = "US" billing_address.house_number = "1" billing_address.state = "Utah" billing_address.street = "Desertroad" billing_address.zip = "84536" company_information = CompanyInformation() company_information.name = "Acme Labs" name = PersonalNameToken() name.first_name = "Wile" name.surname = "Coyote" name.surname_prefix = "E." personal_information = PersonalInformationToken() personal_information.name = name customer = CustomerToken() customer.billing_address = billing_address customer.company_information = company_information customer.merchant_customer_id = "1234" customer.personal_information = personal_information bank_account_bban = BankAccountBban() bank_account_bban.account_number = "000000123456" bank_account_bban.bank_code = "05428" bank_account_bban.branch_code = "11101" bank_account_bban.check_digit = "X" bank_account_bban.country_code = "IT" payment_product705_specific_data = TokenNonSepaDirectDebitPaymentProduct705SpecificData( ) payment_product705_specific_data.authorisation_id = "123456" payment_product705_specific_data.bank_account_bban = bank_account_bban mandate = MandateNonSepaDirectDebit() mandate.payment_product705_specific_data = payment_product705_specific_data non_sepa_direct_debit = TokenNonSepaDirectDebit() non_sepa_direct_debit.customer = customer non_sepa_direct_debit.mandate = mandate body = CreateTokenRequest() body.non_sepa_direct_debit = non_sepa_direct_debit body.payment_product_id = 705 response = client.merchant("merchantId").tokens().create(body)
def from_dictionary(self, dictionary): super(BankTransferPayoutMethodSpecificInput, self).from_dictionary(dictionary) if 'bankAccountBban' in dictionary: if not isinstance(dictionary['bankAccountBban'], dict): raise TypeError('value \'{}\' is not a dictionary'.format(dictionary['bankAccountBban'])) value = BankAccountBban() self.bank_account_bban = value.from_dictionary(dictionary['bankAccountBban']) if 'bankAccountIban' in dictionary: if not isinstance(dictionary['bankAccountIban'], dict): raise TypeError('value \'{}\' is not a dictionary'.format(dictionary['bankAccountIban'])) value = BankAccountIban() self.bank_account_iban = value.from_dictionary(dictionary['bankAccountIban']) if 'customer' in dictionary: if not isinstance(dictionary['customer'], dict): raise TypeError('value \'{}\' is not a dictionary'.format(dictionary['customer'])) value = PayoutCustomer() self.customer = value.from_dictionary(dictionary['customer']) if 'payoutDate' in dictionary: self.payout_date = dictionary['payoutDate'] if 'payoutText' in dictionary: self.payout_text = dictionary['payoutText'] if 'swiftCode' in dictionary: self.swift_code = dictionary['swiftCode'] return self
def from_dictionary(self, dictionary): super(CreatePayoutRequest, self).from_dictionary(dictionary) if 'amountOfMoney' in dictionary: if not isinstance(dictionary['amountOfMoney'], dict): raise TypeError('value \'{}\' is not a dictionary'.format( dictionary['amountOfMoney'])) value = AmountOfMoney() self.amount_of_money = value.from_dictionary( dictionary['amountOfMoney']) if 'bankAccountBban' in dictionary: if not isinstance(dictionary['bankAccountBban'], dict): raise TypeError('value \'{}\' is not a dictionary'.format( dictionary['bankAccountBban'])) value = BankAccountBban() self.bank_account_bban = value.from_dictionary( dictionary['bankAccountBban']) if 'bankAccountIban' in dictionary: if not isinstance(dictionary['bankAccountIban'], dict): raise TypeError('value \'{}\' is not a dictionary'.format( dictionary['bankAccountIban'])) value = BankAccountIban() self.bank_account_iban = value.from_dictionary( dictionary['bankAccountIban']) if 'bankTransferPayoutMethodSpecificInput' in dictionary: if not isinstance( dictionary['bankTransferPayoutMethodSpecificInput'], dict): raise TypeError('value \'{}\' is not a dictionary'.format( dictionary['bankTransferPayoutMethodSpecificInput'])) value = BankTransferPayoutMethodSpecificInput() self.bank_transfer_payout_method_specific_input = value.from_dictionary( dictionary['bankTransferPayoutMethodSpecificInput']) if 'cardPayoutMethodSpecificInput' in dictionary: if not isinstance(dictionary['cardPayoutMethodSpecificInput'], dict): raise TypeError('value \'{}\' is not a dictionary'.format( dictionary['cardPayoutMethodSpecificInput'])) value = CardPayoutMethodSpecificInput() self.card_payout_method_specific_input = value.from_dictionary( dictionary['cardPayoutMethodSpecificInput']) if 'customer' in dictionary: if not isinstance(dictionary['customer'], dict): raise TypeError('value \'{}\' is not a dictionary'.format( dictionary['customer'])) value = PayoutCustomer() self.customer = value.from_dictionary(dictionary['customer']) if 'payoutDate' in dictionary: self.payout_date = dictionary['payoutDate'] if 'payoutDetails' in dictionary: if not isinstance(dictionary['payoutDetails'], dict): raise TypeError('value \'{}\' is not a dictionary'.format( dictionary['payoutDetails'])) value = PayoutDetails() self.payout_details = value.from_dictionary( dictionary['payoutDetails']) if 'payoutText' in dictionary: self.payout_text = dictionary['payoutText'] if 'references' in dictionary: if not isinstance(dictionary['references'], dict): raise TypeError('value \'{}\' is not a dictionary'.format( dictionary['references'])) value = PayoutReferences() self.references = value.from_dictionary(dictionary['references']) if 'swiftCode' in dictionary: self.swift_code = dictionary['swiftCode'] return self
def from_dictionary(self, dictionary): super(RedirectPaymentMethodSpecificOutput, self).from_dictionary(dictionary) if 'bankAccountBban' in dictionary: if not isinstance(dictionary['bankAccountBban'], dict): raise TypeError('value \'{}\' is not a dictionary'.format( dictionary['bankAccountBban'])) value = BankAccountBban() self.bank_account_bban = value.from_dictionary( dictionary['bankAccountBban']) if 'bankAccountIban' in dictionary: if not isinstance(dictionary['bankAccountIban'], dict): raise TypeError('value \'{}\' is not a dictionary'.format( dictionary['bankAccountIban'])) value = BankAccountIban() self.bank_account_iban = value.from_dictionary( dictionary['bankAccountIban']) if 'bic' in dictionary: self.bic = dictionary['bic'] if 'fraudResults' in dictionary: if not isinstance(dictionary['fraudResults'], dict): raise TypeError('value \'{}\' is not a dictionary'.format( dictionary['fraudResults'])) value = FraudResults() self.fraud_results = value.from_dictionary( dictionary['fraudResults']) if 'paymentProduct3201SpecificOutput' in dictionary: if not isinstance(dictionary['paymentProduct3201SpecificOutput'], dict): raise TypeError('value \'{}\' is not a dictionary'.format( dictionary['paymentProduct3201SpecificOutput'])) value = PaymentProduct3201SpecificOutput() self.payment_product3201_specific_output = value.from_dictionary( dictionary['paymentProduct3201SpecificOutput']) if 'paymentProduct806SpecificOutput' in dictionary: if not isinstance(dictionary['paymentProduct806SpecificOutput'], dict): raise TypeError('value \'{}\' is not a dictionary'.format( dictionary['paymentProduct806SpecificOutput'])) value = PaymentProduct806SpecificOutput() self.payment_product806_specific_output = value.from_dictionary( dictionary['paymentProduct806SpecificOutput']) if 'paymentProduct836SpecificOutput' in dictionary: if not isinstance(dictionary['paymentProduct836SpecificOutput'], dict): raise TypeError('value \'{}\' is not a dictionary'.format( dictionary['paymentProduct836SpecificOutput'])) value = PaymentProduct836SpecificOutput() self.payment_product836_specific_output = value.from_dictionary( dictionary['paymentProduct836SpecificOutput']) if 'paymentProduct840SpecificOutput' in dictionary: if not isinstance(dictionary['paymentProduct840SpecificOutput'], dict): raise TypeError('value \'{}\' is not a dictionary'.format( dictionary['paymentProduct840SpecificOutput'])) value = PaymentProduct840SpecificOutput() self.payment_product840_specific_output = value.from_dictionary( dictionary['paymentProduct840SpecificOutput']) if 'token' in dictionary: self.token = dictionary['token'] return self