#NEWLINE# def create_payment_event( self , request , order , lines , quantities ) : #NEWLINE# #INDENT# '\n        Create a payment event for a subset of order lines\n        ' #NEWLINE# amount_str = request . POST . get ( 'amount' , None ) #NEWLINE# if ( not amount_str ) : #NEWLINE# #INDENT# amount = sum ( [ line . line_price_incl_tax for line in lines ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# amount = D ( amount_str ) #NEWLINE# #UNINDENT# except InvalidOperation : #NEWLINE# #INDENT# messages . error ( request , _ ( 'Please choose a valid amount' ) ) #NEWLINE# return self . reload_page ( ) #NEWLINE# #UNINDENT# #UNINDENT# return self . _create_payment_event ( request , order , amount , lines , quantities )