-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtransfer.py
More file actions
125 lines (118 loc) · 5.54 KB
/
transfer.py
File metadata and controls
125 lines (118 loc) · 5.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from dataclasses import dataclass, field
from datetime import datetime
import httpx
from moovio_sdk.models.components import (
amount as components_amount,
cancellation as components_cancellation,
cardacquiringdispute as components_cardacquiringdispute,
cardacquiringrefund as components_cardacquiringrefund,
facilitatorfee as components_facilitatorfee,
moovfee as components_moovfee,
moovfeedetails as components_moovfeedetails,
transferamountdetails as components_transferamountdetails,
transfercapture as components_transfercapture,
transferdestination as components_transferdestination,
transferfailurereason as components_transferfailurereason,
transferlineitems as components_transferlineitems,
transfersource as components_transfersource,
transferstatus as components_transferstatus,
)
from moovio_sdk.models.errors import MoovError
from moovio_sdk.types import BaseModel
import pydantic
from typing import Dict, List, Optional
from typing_extensions import Annotated
class TransferData(BaseModel):
transfer_id: Annotated[str, pydantic.Field(alias="transferID")]
created_on: Annotated[datetime, pydantic.Field(alias="createdOn")]
source: components_transfersource.TransferSource
destination: components_transferdestination.TransferDestination
status: components_transferstatus.TransferStatus
r"""Status of a transfer."""
amount: components_amount.Amount
completed_on: Annotated[Optional[datetime], pydantic.Field(alias="completedOn")] = (
None
)
failure_reason: Annotated[
Optional[components_transferfailurereason.TransferFailureReason],
pydantic.Field(alias="failureReason"),
] = None
r"""Reason for a transfer's failure."""
description: Optional[str] = None
r"""An optional description of the transfer that is used on receipts and for your own internal use."""
metadata: Optional[Dict[str, str]] = None
r"""Free-form key-value pair list. Useful for storing information that is not captured elsewhere."""
facilitator_fee: Annotated[
Optional[components_facilitatorfee.FacilitatorFee],
pydantic.Field(alias="facilitatorFee"),
] = None
r"""Total or markup fee."""
moov_fee: Annotated[Optional[int], pydantic.Field(alias="moovFee")] = None
r"""Fees charged to your platform account for transfers."""
moov_fee_decimal: Annotated[
Optional[str], pydantic.Field(alias="moovFeeDecimal")
] = None
r"""Same as `moovFee`, but a decimal-formatted numerical string that represents up to 9 decimal place precision."""
moov_fee_details: Annotated[
Optional[components_moovfeedetails.MoovFeeDetails],
pydantic.Field(alias="moovFeeDetails"),
] = None
r"""Processing and pass-through costs that add up to the moovFee."""
moov_fees: Annotated[
Optional[List[components_moovfee.MoovFee]], pydantic.Field(alias="moovFees")
] = None
r"""Fees charged to accounts involved in the transfer."""
group_id: Annotated[Optional[str], pydantic.Field(alias="groupID")] = None
cancellations: Optional[List[components_cancellation.Cancellation]] = None
refunded_amount: Annotated[
Optional[components_amount.Amount], pydantic.Field(alias="refundedAmount")
] = None
refunds: Optional[List[components_cardacquiringrefund.CardAcquiringRefund]] = None
disputed_amount: Annotated[
Optional[components_amount.Amount], pydantic.Field(alias="disputedAmount")
] = None
disputes: Optional[List[components_cardacquiringdispute.CardAcquiringDispute]] = (
None
)
sweep_id: Annotated[Optional[str], pydantic.Field(alias="sweepID")] = None
r"""ID of the sweep that created this transfer."""
schedule_id: Annotated[Optional[str], pydantic.Field(alias="scheduleID")] = None
occurrence_id: Annotated[Optional[str], pydantic.Field(alias="occurrenceID")] = None
payment_link_code: Annotated[
Optional[str], pydantic.Field(alias="paymentLinkCode")
] = None
sales_tax_amount: Annotated[
Optional[components_amount.Amount], pydantic.Field(alias="salesTaxAmount")
] = None
foreign_id: Annotated[Optional[str], pydantic.Field(alias="foreignID")] = None
r"""Optional alias from a foreign/external system which can be used to reference this resource."""
line_items: Annotated[
Optional[components_transferlineitems.TransferLineItems],
pydantic.Field(alias="lineItems"),
] = None
r"""An optional collection of line items for a transfer.
When line items are provided, their total plus sales tax must equal the transfer amount.
"""
invoice_id: Annotated[Optional[str], pydantic.Field(alias="invoiceID")] = None
r"""ID of the invoice that the transfer is associated with."""
amount_details: Annotated[
Optional[components_transferamountdetails.TransferAmountDetails],
pydantic.Field(alias="amountDetails"),
] = None
capture: Optional[components_transfercapture.TransferCapture] = None
r"""The card authorization and capture IDs associated with a transfer."""
@dataclass(unsafe_hash=True)
class Transfer(MoovError):
r"""Details of a Transfer."""
data: TransferData = field(hash=False)
def __init__(
self,
data: TransferData,
raw_response: httpx.Response,
body: Optional[str] = None,
):
message = body or raw_response.text
super().__init__(message, raw_response, body)
object.__setattr__(self, "data", data)