def get_shared_secret_key(provider_id):
 secret = getattr(settings, 'CREDIT_PROVIDER_SECRET_KEYS', {}).get(provider_id)
 if isinstance(secret, unicode):
  try:
   secret = str(secret)
  except UnicodeEncodeError:
   secret = None
   log.error(u'Shared secret key for credit provider "%s" contains non-ASCII unicode.', provider_id)
 return secret

def get_shared_secret_key ( provider_id ) : secret = getattr ( settings , 'CREDIT_PROVIDER_SECRET_KEYS' , { } ) . get ( provider_id ) if isinstance ( secret , unicode ) : try : secret = str ( secret ) except UnicodeEncodeError : secret = None log . error ( u'Shared secret key for credit provider "%s" contains non-ASCII unicode.' , provider_id ) return secret
retrieve the shared secret key for a particular credit provider .