#NEWLINE# def test_create_allows_passing_billing_address_outside_the_nonce( self ) : #NEWLINE# #INDENT# customer_id = Customer . create ( ) . customer . id #NEWLINE# http = ClientApiHttp . create ( ) #NEWLINE# ( status_code , nonce ) = http . get_credit_card_nonce ( { #NEWLINE# #INDENT# 'number' : '4111111111111111' , #NEWLINE# 'expirationMonth' : '12' , #NEWLINE# 'expirationYear' : '2020' , #NEWLINE# 'options' : { #NEWLINE# #INDENT# 'validate' : 'false' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertTrue ( ( status_code == 202 ) ) #NEWLINE# result = PaymentMethod . create ( { #NEWLINE# #INDENT# 'payment_method_nonce' : nonce , #NEWLINE# 'customer_id' : customer_id , #NEWLINE# 'billing_address' : { #NEWLINE# #INDENT# 'street_address' : '123 Abc Way' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertTrue ( result . is_success ) #NEWLINE# self . assertTrue ( isinstance ( result . payment_method , CreditCard ) ) #NEWLINE# token = result . payment_method . token #NEWLINE# found_credit_card = CreditCard . find ( token ) #NEWLINE# self . assertFalse ( ( found_credit_card is None ) ) #NEWLINE# self . assertTrue ( ( found_credit_card . billing_address . street_address == '123 Abc Way' ) )