#NEWLINE# def get_selected_payment_method( request ) : #NEWLINE# #INDENT# '\n    Returns the selected payment method for given request. This could either\n    be an explicitly selected payment method of the current user or the default\n    payment method.\n    ' #NEWLINE# customer = customer_utils . get_customer ( request ) #NEWLINE# if ( customer and customer . selected_payment_method ) : #NEWLINE# #INDENT# return customer . selected_payment_method #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return get_default_payment_method ( request )