#NEWLINE# def test_create_with_europe_bank_account_nonce( self ) : #NEWLINE# #INDENT# config = Configuration . instantiate ( ) #NEWLINE# customer_id = Customer . create ( ) . customer . id #NEWLINE# token = TestHelper . generate_decoded_client_token ( { #NEWLINE# #INDENT# 'customer_id' : customer_id , #NEWLINE# 'sepa_mandate_type' : EuropeBankAccount . MandateType . Business , #NEWLINE# #UNINDENT# } ) #NEWLINE# authorization_fingerprint = json . loads ( token ) [ 'authorizationFingerprint' ] #NEWLINE# client_api = ClientApiHttp ( config , { #NEWLINE# #INDENT# 'authorization_fingerprint' : authorization_fingerprint , #NEWLINE# 'shared_customer_identifier' : 'fake_identifier' , #NEWLINE# 'shared_customer_identifier_type' : 'testing' , #NEWLINE# #UNINDENT# } ) #NEWLINE# nonce = client_api . get_europe_bank_account_nonce ( { #NEWLINE# #INDENT# 'locale' : 'de-DE' , #NEWLINE# 'bic' : 'DEUTDEFF' , #NEWLINE# 'iban' : 'DE89370400440532013000' , #NEWLINE# 'accountHolderName' : 'Baron Von Holder' , #NEWLINE# 'billingAddress' : { #NEWLINE# #INDENT# 'region' : 'Hesse' , #NEWLINE# 'country_name' : 'Germany' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertNotEquals ( nonce , None ) #NEWLINE# result = PaymentMethod . create ( { #NEWLINE# #INDENT# 'customer_id' : customer_id , #NEWLINE# 'payment_method_nonce' : nonce , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertTrue ( result . is_success ) #NEWLINE# self . assertNotEqual ( result . payment_method . image_url , None ) #NEWLINE# self . assertEqual ( result . payment_method . customer_id , customer_id ) #NEWLINE# found_bank_account = PaymentMethod . find ( result . payment_method . token ) #NEWLINE# self . assertNotEqual ( found_bank_account , None ) #NEWLINE# self . assertEquals ( found_bank_account . bic , 'DEUTDEFF' ) #NEWLINE# self . assertEquals ( found_bank_account . __class__ , EuropeBankAccount )