Coverage for functions \ flipdare \ generated \ shared \ stripe \ stripe_intent_status.py: 100%

0 statements  

« prev     ^ index     » next       coverage.py v7.13.0, created at 2026-05-08 12:22 +1000

1#!/usr/bin/env python 

2# 

3# Copyright (c) 2026 Flipdare Pty Ltd. All rights reserved. 

4# 

5# This file is part of Flipdare's proprietary software and contains 

6# confidential and copyrighted material. Unauthorised copying, 

7# modification, distribution, or use of this file is strictly 

8# prohibited without prior written permission from Flipdare Pty Ltd. 

9# 

10# This software includes third-party components licensed under MIT, 

11# BSD, and Apache 2.0 licences. See THIRD_PARTY_NOTICES for details. 

12# 

13# NOTE: THIS FILE IS AUTO GENERATED. DO NOT EDIT. 

14# 

15# Generated by codegen_models.py 

16# 

17# Modify 'codegen_models.py' 

18# and re-run the script above to update. 

19# 

20 

21# pragma: no cover 

22from enum import StrEnum 

23from typing import Literal 

24 

25 

26class StripeIntentStatus(StrEnum): 

27 """Intent Status for a Stripe Payment Intent""" 

28 

29 CANCELED = "canceled" 

30 PROCESSING = "processing" 

31 REQUIRES_ACTION = "requires_action" 

32 REQUIRES_CAPTURE = "requires_capture" 

33 REQUIRES_CONFIRMATION = "requires_confirmation" 

34 REQUIRES_PAYMENT_METHOD = "requires_payment_method" 

35 SUCCEEDED = "succeeded" 

36 ERROR = "error" 

37 UNKNOWN = "unknown" 

38 

39 # ---- Convenience predicates ----------------------------------------- 

40 @staticmethod 

41 def from_literal( 

42 status: Literal[ 

43 "canceled", 

44 "processing", 

45 "requires_action", 

46 "requires_capture", 

47 "requires_confirmation", 

48 "requires_payment_method", 

49 "succeeded", 

50 ], 

51 ) -> "StripeIntentStatus": 

52 return StripeIntentStatus(status) 

53 

54 @property 

55 def has_succeeded(self) -> bool: 

56 return self == StripeIntentStatus.SUCCEEDED 

57 

58 @property 

59 def is_completed(self) -> bool: 

60 return self in { 

61 StripeIntentStatus.CANCELED, 

62 StripeIntentStatus.SUCCEEDED, 

63 } 

64 

65 @property 

66 def requires_additional_info(self) -> bool: 

67 return self in { 

68 StripeIntentStatus.REQUIRES_ACTION, 

69 StripeIntentStatus.REQUIRES_CONFIRMATION, 

70 StripeIntentStatus.REQUIRES_PAYMENT_METHOD, 

71 } 

72 

73 @property 

74 def is_processable(self) -> bool: 

75 return self in { 

76 StripeIntentStatus.REQUIRES_ACTION, 

77 StripeIntentStatus.REQUIRES_CAPTURE, 

78 StripeIntentStatus.REQUIRES_CONFIRMATION, 

79 StripeIntentStatus.REQUIRES_PAYMENT_METHOD, 

80 StripeIntentStatus.UNKNOWN, 

81 }