Coverage for packages/kapitalbank/src/integrify/kapitalbank/schemas/response/detailed_order_response.py: 100%

118 statements  

« prev     ^ index     » next       coverage.py v7.16.0, created at 2026-10-19 02:39 +0000

1from datetime import datetime 

2 

3from integrify.kapitalbank.schemas.enums import TransactionStatus 

4from integrify.kapitalbank.schemas.utils import BaseSchema 

5from pydantic import Field 

6 

7 

8class StoredToken(BaseSchema): 

9 id: int 

10 cof_provider_rid: str | None = None 

11 rid_bycofp: str | None = None 

12 

13 

14class CardAuthentication(BaseSchema): 

15 need_cvv2: bool 

16 need_tds: bool 

17 tran_id: str | None = None 

18 tds_ds_tran_id: str | None = None 

19 timestamp: datetime | None = None 

20 tds_protocol_ver: str | None = None 

21 eci: str | None = None 

22 tds_a_res: str | None = None 

23 

24 

25class CardDetails(BaseSchema): 

26 authentication: CardAuthentication | None = None 

27 expiration: str 

28 brand: str 

29 issuer_rid: str | None = None 

30 

31 

32class SrcToken(BaseSchema): 

33 id: int 

34 payment_method: str 

35 role: str 

36 status: str 

37 reg_time: datetime 

38 entry_mode: str | None = None 

39 display_name: str 

40 card: CardDetails 

41 

42 

43class ConsumerDeviceBrowser(BaseSchema): 

44 user_agent: str 

45 color_depth: int 

46 pixel_ratio: float 

47 language: str 

48 tz_offset: int 

49 local_storage: bool 

50 language_replaced: bool 

51 resolution_replaced: bool 

52 os_replaced: bool 

53 browser_replaced: bool 

54 screen_w: int 

55 screen_h: int 

56 screen_avail_w: int 

57 screen_avail_h: int 

58 platform: str 

59 accept_header: str 

60 ip: str 

61 ref_url: str 

62 java_enabled: bool 

63 js_enabled: bool 

64 

65 

66class ConsumerDevice(BaseSchema): 

67 browser: ConsumerDeviceBrowser 

68 

69 

70class BusinessAddress(BaseSchema): 

71 country: str 

72 country_a2: str 

73 country_n3: int 

74 

75 

76class Merchant(BaseSchema): 

77 id: int 

78 rid: str 

79 title: str 

80 business_address: BusinessAddress 

81 trust_consumer_phone: bool 

82 

83 

84class DetailedOrderType(BaseSchema): 

85 allow_void: bool 

86 hpp_tran_phase: str 

87 secret_length: int 

88 title: str 

89 rid: str 

90 payment_methods: list[str] 

91 card_brands: list[str] | None = None 

92 allow_tds_attempt: bool 

93 allow_tds_cant: bool 

94 allow_tds_challenged: bool 

95 allow_surcharge: bool 

96 allow_tran_types: list[str] 

97 allow_tran_phases: list[str] 

98 allow_auth_kinds: list[str] 

99 allow_cof_store_usages: list[str] 

100 order_class: str 

101 allow_cvv2: bool = Field(alias='allowCVV2') 

102 

103 

104class DetailedOrderInformationResponseSchema(BaseSchema): 

105 id: int 

106 hpp_url: str 

107 hpp_redirect_url: str | None = None 

108 password: str 

109 status: TransactionStatus 

110 prev_status: str | None = None 

111 last_status_login: str 

112 amount: float 

113 currency: str 

114 terminal: dict 

115 src_amount: float 

116 src_amount_full: float 

117 src_currency: str 

118 dst_amount: float | None = None 

119 dst_currency: str | None = None 

120 stored_tokens: list[StoredToken] | None = None 

121 create_time: datetime 

122 finish_time: datetime | None = None 

123 cvv2_auth_status: str 

124 tds_v1_auth_status: str | None = None 

125 tds_v2_auth_status: str | None = None 

126 tds_server_url: str | None = None 

127 authorized_charge_amount: float 

128 cleared_charge_amount: float 

129 cleared_refund_amount: float 

130 description: str 

131 language: str 

132 src_token: SrcToken | None = None 

133 consumer_device: ConsumerDevice | None = None 

134 merchant: Merchant 

135 initiation_env_kind: str 

136 type: DetailedOrderType 

137 hpp_cof_capture_purposes: list[str] 

138 cust_attrs: list[str] 

139 report_pubs: dict