-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcard.py
More file actions
336 lines (237 loc) · 11.2 KB
/
card.py
File metadata and controls
336 lines (237 loc) · 11.2 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import TYPE_CHECKING, Dict, List, Optional
from datetime import datetime
from typing_extensions import Literal
from pydantic import Field as FieldInfo
from .._models import BaseModel
__all__ = [
"Card",
"AuthorizationControls",
"AuthorizationControlsMerchantAcceptorIdentifier",
"AuthorizationControlsMerchantAcceptorIdentifierAllowed",
"AuthorizationControlsMerchantAcceptorIdentifierBlocked",
"AuthorizationControlsMerchantCategoryCode",
"AuthorizationControlsMerchantCategoryCodeAllowed",
"AuthorizationControlsMerchantCategoryCodeBlocked",
"AuthorizationControlsMerchantCountry",
"AuthorizationControlsMerchantCountryAllowed",
"AuthorizationControlsMerchantCountryBlocked",
"AuthorizationControlsUsage",
"AuthorizationControlsUsageMultiUse",
"AuthorizationControlsUsageMultiUseSpendingLimit",
"AuthorizationControlsUsageMultiUseSpendingLimitMerchantCategoryCode",
"AuthorizationControlsUsageSingleUse",
"AuthorizationControlsUsageSingleUseSettlementAmount",
"BillingAddress",
"DigitalWallet",
]
class AuthorizationControlsMerchantAcceptorIdentifierAllowed(BaseModel):
identifier: str
"""The Merchant Acceptor ID."""
class AuthorizationControlsMerchantAcceptorIdentifierBlocked(BaseModel):
identifier: str
"""The Merchant Acceptor ID."""
class AuthorizationControlsMerchantAcceptorIdentifier(BaseModel):
"""
Restricts which Merchant Acceptor IDs are allowed or blocked for authorizations on this card.
"""
allowed: Optional[List[AuthorizationControlsMerchantAcceptorIdentifierAllowed]] = None
"""The Merchant Acceptor IDs that are allowed for authorizations on this card."""
blocked: Optional[List[AuthorizationControlsMerchantAcceptorIdentifierBlocked]] = None
"""The Merchant Acceptor IDs that are blocked for authorizations on this card."""
class AuthorizationControlsMerchantCategoryCodeAllowed(BaseModel):
code: str
"""The Merchant Category Code (MCC)."""
class AuthorizationControlsMerchantCategoryCodeBlocked(BaseModel):
code: str
"""The Merchant Category Code (MCC)."""
class AuthorizationControlsMerchantCategoryCode(BaseModel):
"""
Restricts which Merchant Category Codes are allowed or blocked for authorizations on this card.
"""
allowed: Optional[List[AuthorizationControlsMerchantCategoryCodeAllowed]] = None
"""The Merchant Category Codes that are allowed for authorizations on this card."""
blocked: Optional[List[AuthorizationControlsMerchantCategoryCodeBlocked]] = None
"""The Merchant Category Codes that are blocked for authorizations on this card."""
class AuthorizationControlsMerchantCountryAllowed(BaseModel):
country: str
"""The ISO 3166-1 alpha-2 country code."""
class AuthorizationControlsMerchantCountryBlocked(BaseModel):
country: str
"""The ISO 3166-1 alpha-2 country code."""
class AuthorizationControlsMerchantCountry(BaseModel):
"""
Restricts which merchant countries are allowed or blocked for authorizations on this card.
"""
allowed: Optional[List[AuthorizationControlsMerchantCountryAllowed]] = None
"""The merchant countries that are allowed for authorizations on this card."""
blocked: Optional[List[AuthorizationControlsMerchantCountryBlocked]] = None
"""The merchant countries that are blocked for authorizations on this card."""
class AuthorizationControlsUsageMultiUseSpendingLimitMerchantCategoryCode(BaseModel):
code: str
"""The Merchant Category Code (MCC)."""
class AuthorizationControlsUsageMultiUseSpendingLimit(BaseModel):
interval: Literal["all_time", "per_transaction", "per_day", "per_week", "per_month"]
"""The interval at which the spending limit is enforced.
- `all_time` - The spending limit applies over the lifetime of the card.
- `per_transaction` - The spending limit applies per transaction.
- `per_day` - The spending limit applies per day. Resets nightly at midnight
UTC.
- `per_week` - The spending limit applies per week. Resets weekly on Mondays at
midnight UTC.
- `per_month` - The spending limit applies per month. Resets on the first of the
month, midnight UTC.
"""
merchant_category_codes: Optional[List[AuthorizationControlsUsageMultiUseSpendingLimitMerchantCategoryCode]] = None
"""The Merchant Category Codes (MCCs) this spending limit applies to.
If not set, the limit applies to all transactions.
"""
settlement_amount: int
"""The maximum settlement amount permitted in the given interval."""
class AuthorizationControlsUsageMultiUse(BaseModel):
"""Controls for multi-use cards.
Required if and only if `category` is `multi_use`.
"""
spending_limits: Optional[List[AuthorizationControlsUsageMultiUseSpendingLimit]] = None
"""Spending limits for this card.
The most restrictive limit applies if multiple limits match.
"""
class AuthorizationControlsUsageSingleUseSettlementAmount(BaseModel):
"""The settlement amount constraint for this single-use card."""
comparison: Literal["equals", "less_than_or_equals"]
"""The operator used to compare the settlement amount.
- `equals` - The settlement amount must be exactly the specified value.
- `less_than_or_equals` - The settlement amount must be less than or equal to
the specified value.
"""
value: int
"""The settlement amount value."""
class AuthorizationControlsUsageSingleUse(BaseModel):
"""Controls for single-use cards.
Required if and only if `category` is `single_use`.
"""
settlement_amount: AuthorizationControlsUsageSingleUseSettlementAmount
"""The settlement amount constraint for this single-use card."""
class AuthorizationControlsUsage(BaseModel):
"""Controls how many times this card can be used."""
category: Literal["single_use", "multi_use"]
"""Whether the card is for a single use or multiple uses.
- `single_use` - The card can only be used for a single authorization.
- `multi_use` - The card can be used for multiple authorizations.
"""
multi_use: Optional[AuthorizationControlsUsageMultiUse] = None
"""Controls for multi-use cards.
Required if and only if `category` is `multi_use`.
"""
single_use: Optional[AuthorizationControlsUsageSingleUse] = None
"""Controls for single-use cards.
Required if and only if `category` is `single_use`.
"""
class AuthorizationControls(BaseModel):
"""Controls that restrict how this card can be used."""
merchant_acceptor_identifier: Optional[AuthorizationControlsMerchantAcceptorIdentifier] = None
"""
Restricts which Merchant Acceptor IDs are allowed or blocked for authorizations
on this card.
"""
merchant_category_code: Optional[AuthorizationControlsMerchantCategoryCode] = None
"""
Restricts which Merchant Category Codes are allowed or blocked for
authorizations on this card.
"""
merchant_country: Optional[AuthorizationControlsMerchantCountry] = None
"""
Restricts which merchant countries are allowed or blocked for authorizations on
this card.
"""
usage: Optional[AuthorizationControlsUsage] = None
"""Controls how many times this card can be used."""
class BillingAddress(BaseModel):
"""The Card's billing address."""
city: Optional[str] = None
"""The city of the billing address."""
line1: Optional[str] = None
"""The first line of the billing address."""
line2: Optional[str] = None
"""The second line of the billing address."""
postal_code: Optional[str] = None
"""The postal code of the billing address."""
state: Optional[str] = None
"""The US state of the billing address."""
class DigitalWallet(BaseModel):
"""
The contact information used in the two-factor steps for digital wallet card creation. At least one field must be present to complete the digital wallet steps.
"""
digital_card_profile_id: Optional[str] = None
"""The digital card profile assigned to this digital card.
Card profiles may also be assigned at the program level.
"""
email: Optional[str] = None
"""
An email address that can be used to verify the cardholder via one-time passcode
over email.
"""
phone: Optional[str] = None
"""
A phone number that can be used to verify the cardholder via one-time passcode
over SMS.
"""
class Card(BaseModel):
"""Cards may operate on credit, debit, or prepaid BINs.
They’ll immediately work for online purchases after you create them. All cards work on a good funds model, and maintain a maximum limit of 100% of the Account’s available balance at the time of transaction. Funds are deducted from the Account upon transaction settlement.
"""
id: str
"""The card identifier."""
account_id: str
"""The identifier for the account this card belongs to."""
authorization_controls: Optional[AuthorizationControls] = None
"""Controls that restrict how this card can be used."""
billing_address: BillingAddress
"""The Card's billing address."""
created_at: datetime
"""
The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which
the Card was created.
"""
description: Optional[str] = None
"""The card's description for display purposes."""
digital_wallet: Optional[DigitalWallet] = None
"""
The contact information used in the two-factor steps for digital wallet card
creation. At least one field must be present to complete the digital wallet
steps.
"""
entity_id: Optional[str] = None
"""The identifier for the entity associated with this card."""
expiration_month: int
"""The month the card expires in M format (e.g., August is 8)."""
expiration_year: int
"""The year the card expires in YYYY format (e.g., 2025)."""
idempotency_key: Optional[str] = None
"""The idempotency key you chose for this object.
This value is unique across Increase and is used to ensure that a request is
only processed once. Learn more about
[idempotency](https://increase.com/documentation/idempotency-keys).
"""
last4: str
"""The last 4 digits of the Card's Primary Account Number."""
status: Literal["active", "disabled", "canceled"]
"""This indicates if payments can be made with the card.
- `active` - The card is active.
- `disabled` - The card is temporarily disabled.
- `canceled` - The card is permanently canceled.
"""
type: Literal["card"]
"""A constant representing the object's type.
For this resource it will always be `card`.
"""
if TYPE_CHECKING:
# Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
# value to this field, so for compatibility we avoid doing it at runtime.
__pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
# Stub to indicate that arbitrary properties are accepted.
# To access properties that are not valid identifiers you can use `getattr`, e.g.
# `getattr(obj, '$type')`
def __getattr__(self, attr: str) -> object: ...
else:
__pydantic_extra__: Dict[str, object]