def ecommerce_api_client(user, session=None):
 jwt_auth = configuration_helpers.get_value('JWT_AUTH', settings.JWT_AUTH)
 return EdxRestApiClient(configuration_helpers.get_value('ECOMMERCE_API_URL', settings.ECOMMERCE_API_URL), configuration_helpers.get_value('ECOMMERCE_API_SIGNING_KEY', settings.ECOMMERCE_API_SIGNING_KEY), user.username, (user.profile.name if hasattr(user, 'profile') else None), user.email, tracking_context=create_tracking_context(user), issuer=jwt_auth['JWT_ISSUER'], expires_in=jwt_auth['JWT_EXPIRATION'], session=session)

def ecommerce_api_client ( user , session = None ) : jwt_auth = configuration_helpers . get_value ( 'JWT_AUTH' , settings . JWT_AUTH ) return EdxRestApiClient ( configuration_helpers . get_value ( 'ECOMMERCE_API_URL' , settings . ECOMMERCE_API_URL ) , configuration_helpers . get_value ( 'ECOMMERCE_API_SIGNING_KEY' , settings . ECOMMERCE_API_SIGNING_KEY ) , user . username , ( user . profile . name if hasattr ( user , 'profile' ) else None ) , user . email , tracking_context = create_tracking_context ( user ) , issuer = jwt_auth [ 'JWT_ISSUER' ] , expires_in = jwt_auth [ 'JWT_EXPIRATION' ] , session = session )
returns an e-commerce api client setup with authentication for the specified user .