Coverage for functions \ flipdare \ request \ data \ payment_request_adapter.py: 0%
25 statements
« prev ^ index » next coverage.py v7.13.0, created at 2026-05-08 12:22 +1000
« prev ^ index » next coverage.py v7.13.0, created at 2026-05-08 12:22 +1000
1#!/usr/bin/env python
2# Copyright (c) 2026 Flipdare Pty Ltd. All rights reserved.
3#
4# This file is part of Flipdare's proprietary software and contains
5# confidential and copyrighted material. Unauthorised copying,
6# modification, distribution, or use of this file is strictly
7# prohibited without prior written permission from Flipdare Pty Ltd.
8#
9# This software includes third-party components licensed under MIT,
10# BSD, and Apache 2.0 licences. See THIRD_PARTY_NOTICES for details.
11#
14from flipdare.generated.schema.payment.payment_dispute_hook_request_schema import (
15 PaymentDisputeHookRequestSchema,
16)
17from flipdare.generated.schema.payment.payment_dispute_link_request_schema import (
18 PaymentDisputeLinkRequestSchema,
19)
20from flipdare.request.request_adapter import RequestAdapter
21from flipdare.request.request_validator import TextPresentRequestValidator, UidRequestValidator
23# ---------------------------------------------------------------------------------------------------------------------
24# Disputes
25# ---------------------------------------------------------------------------------------------------------------------
28class PaymentDisputeLinkRequestAdapter(RequestAdapter[PaymentDisputeLinkRequestSchema]):
30 SCHEMA_CLS = PaymentDisputeLinkRequestSchema
31 VALIDATORS = (UidRequestValidator, TextPresentRequestValidator)
33 @property
34 def uid(self) -> str:
35 return self.data["uid"]
37 @property
38 def account_id(self) -> str:
39 return self.data["account_id"]
41 @property
42 def dispute_id(self) -> str:
43 return self.data["dispute_id"]
46class PaymentDisputeHookRequestAdapter(RequestAdapter[PaymentDisputeHookRequestSchema]):
48 SCHEMA_CLS = PaymentDisputeHookRequestSchema
49 VALIDATORS = (UidRequestValidator, TextPresentRequestValidator)
51 @property
52 def account_id(self) -> str:
53 return self.data["account_id"]
55 @property
56 def charge_id(self) -> str:
57 return self.data["charge_id"]