#NEWLINE# def clean( self ) : #NEWLINE# #INDENT# data = self . cleaned_data #NEWLINE# if ( ( not self . errors ) and ( not self . payment . transaction_id ) ) : #NEWLINE# #INDENT# result = braintree . Transaction . sale ( { #NEWLINE# #INDENT# 'amount' : str ( self . payment . total ) , #NEWLINE# 'billing' : self . get_billing_data ( ) , #NEWLINE# 'credit_card' : self . get_credit_card_clean_data ( ) , #NEWLINE# 'customer' : self . get_customer_data ( ) , #NEWLINE# 'options' : { #NEWLINE# #INDENT# 'submit_for_settlement' : False , #NEWLINE# #UNINDENT# } , #NEWLINE# 'order_id' : self . payment . description , #NEWLINE# #UNINDENT# } ) #NEWLINE# if self . is_success : #NEWLINE# #INDENT# self . transaction_id = result . transaction . id #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . _errors [ '__all__' ] = self . error_class ( [ result . message ] ) #NEWLINE# self . payment . change_status ( 'error' ) #NEWLINE# #UNINDENT# #UNINDENT# return data