#NEWLINE# def parse_client_credentials( self ) : #NEWLINE# #INDENT# if ( ( self . client_id is None ) and ( self . client_secret is not None ) ) : #NEWLINE# #INDENT# raise ConfigurationError ( 'Missing client_id when constructing BraintreeGateway' ) #NEWLINE# #UNINDENT# if ( ( self . client_secret is None ) and ( self . client_id is not None ) ) : #NEWLINE# #INDENT# raise ConfigurationError ( 'Missing client_secret when constructing BraintreeGateway' ) #NEWLINE# #UNINDENT# if ( not self . client_id . startswith ( 'client_id' ) ) : #NEWLINE# #INDENT# raise ConfigurationError ( 'Value passed for client_id is not a client_id' ) #NEWLINE# #UNINDENT# if ( not self . client_secret . startswith ( 'client_secret' ) ) : #NEWLINE# #INDENT# raise ConfigurationError ( 'Value passed for client_secret is not a client_secret' ) #NEWLINE# #UNINDENT# client_id_environment = self . get_environment ( self . client_id ) #NEWLINE# client_secret_environment = self . get_environment ( self . client_secret ) #NEWLINE# if ( client_id_environment is client_secret_environment ) : #NEWLINE# #INDENT# self . environment = client_id_environment #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ConfigurationError ( ' ' . join ( [ 'Mismatched credential environments: client_id environment is:' , str ( client_id_environment ) , 'and client_secret environment is:' , str ( client_id_environment ) ] ) )