Coverage for /var/srv/projects/api.amasfac.comuna18.com/tmp/venv/lib/python3.9/site-packages/stripe/oauth_error.py: 84%

22 statements  

« prev     ^ index     » next       coverage.py v6.4.4, created at 2023-07-17 14:22 -0600

1from __future__ import absolute_import, division, print_function 

2 

3import stripe 

4from stripe.error import StripeError 

5 

6 

7class OAuthError(StripeError): 

8 def __init__( 

9 self, 

10 code, 

11 description, 

12 http_body=None, 

13 http_status=None, 

14 json_body=None, 

15 headers=None, 

16 ): 

17 super(OAuthError, self).__init__( 

18 description, http_body, http_status, json_body, headers, code 

19 ) 

20 

21 def construct_error_object(self): 

22 if self.json_body is None: 

23 return None 

24 

25 return ( 

26 stripe.api_resources.error_object.OAuthErrorObject.construct_from( 

27 self.json_body, stripe.api_key 

28 ) 

29 ) 

30 

31 

32class InvalidClientError(OAuthError): 

33 pass 

34 

35 

36class InvalidGrantError(OAuthError): 

37 pass 

38 

39 

40class InvalidRequestError(OAuthError): 

41 pass 

42 

43 

44class InvalidScopeError(OAuthError): 

45 pass 

46 

47 

48class UnsupportedGrantTypeError(OAuthError): 

49 pass 

50 

51 

52class UnsupportedResponseTypeError(OAuthError): 

53 pass