Repository navigation
Expand file tree
/
Copy pathtransfer.py
More file actions
139 lines (132 loc) · 6.08 KB
/
Copy pathtransfer.py
File metadata and controls
139 lines (132 loc) · 6.08 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
"""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 (
amountdecimal as components_amountdecimal,
facilitatorfee as components_facilitatorfee,
moovfee as components_moovfee,
moovfeedetails as components_moovfeedetails,
transferamountdetails as components_transferamountdetails,
transferauthorization as components_transferauthorization,
transferdestination as components_transferdestination,
transferfailurereason as components_transferfailurereason,
transferlineitems as components_transferlineitems,
transferprocessingdetails as components_transferprocessingdetails,
transferrailoptions as components_transferrailoptions,
transfersource as components_transfersource,
transferstatus as components_transferstatus,
transfertype as components_transfertype,
)
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")]
transfer_type: Annotated[
components_transfertype.TransferType, pydantic.Field(alias="transferType")
]
r"""The rail and direction used to move funds for a transfer."""
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_amountdecimal.AmountDecimal
r"""Amount associated with this transfer.
In v2026.10 and later, an auth-capture `card-payment` transfer reports the approved authorization amount until a final capture is created.
For these transfers, when a final capture is created, this is updated to the cumulative captured amount.
For other transfer types, this is the transfer amount.
"""
options: components_transferrailoptions.TransferRailOptions
processing_details: Annotated[
components_transferprocessingdetails.TransferProcessingDetails,
pydantic.Field(alias="processingDetails"),
]
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[components_amountdecimal.AmountDecimal],
pydantic.Field(alias="moovFee"),
] = None
r"""Fees charged to your platform account for transfers."""
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
refunded_amount: Annotated[
Optional[components_amountdecimal.AmountDecimal],
pydantic.Field(alias="refundedAmount"),
] = None
disputed_amount: Annotated[
Optional[components_amountdecimal.AmountDecimal],
pydantic.Field(alias="disputedAmount"),
] = 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
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 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
r"""The tip, tax, and surcharge portion of the transfer amount.
For an auth-capture `card-payment` transfer, this is the aggregate of all captures' `amountDetails`.
"""
authorization: Optional[components_transferauthorization.TransferAuthorization] = (
None
)
r"""Authorization amounts.
This field is present only for an auth-capture `card-payment` 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)