| 1 |
# -*- coding: utf-8 -*- |
| 2 |
# File generated from our OpenAPI spec |
| 3 |
from typing import Dict, List |
| 4 |
from typing_extensions import Literal, NotRequired, TypedDict |
| 5 |
|
| 6 |
|
| 7 |
class SourceUpdateParams(TypedDict): |
| 8 |
amount: NotRequired[int] |
| 9 |
""" |
| 10 |
Amount associated with the source. |
| 11 |
""" |
| 12 |
expand: NotRequired[List[str]] |
| 13 |
""" |
| 14 |
Specifies which fields in the response should be expanded. |
| 15 |
""" |
| 16 |
mandate: NotRequired["SourceUpdateParamsMandate"] |
| 17 |
""" |
| 18 |
Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status. |
| 19 |
""" |
| 20 |
metadata: NotRequired["Literal['']|Dict[str, str]"] |
| 21 |
""" |
| 22 |
Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. |
| 23 |
""" |
| 24 |
owner: NotRequired["SourceUpdateParamsOwner"] |
| 25 |
""" |
| 26 |
Information about the owner of the payment instrument that may be used or required by particular source types. |
| 27 |
""" |
| 28 |
source_order: NotRequired["SourceUpdateParamsSourceOrder"] |
| 29 |
""" |
| 30 |
Information about the items and shipping associated with the source. Required for transactional credit (for example Klarna) sources before you can charge it. |
| 31 |
""" |
| 32 |
|
| 33 |
|
| 34 |
class SourceUpdateParamsMandate(TypedDict): |
| 35 |
acceptance: NotRequired["SourceUpdateParamsMandateAcceptance"] |
| 36 |
""" |
| 37 |
The parameters required to notify Stripe of a mandate acceptance or refusal by the customer. |
| 38 |
""" |
| 39 |
amount: NotRequired["Literal['']|int"] |
| 40 |
""" |
| 41 |
The amount specified by the mandate. (Leave null for a mandate covering all amounts) |
| 42 |
""" |
| 43 |
currency: NotRequired[str] |
| 44 |
""" |
| 45 |
The currency specified by the mandate. (Must match `currency` of the source) |
| 46 |
""" |
| 47 |
interval: NotRequired[Literal["one_time", "scheduled", "variable"]] |
| 48 |
""" |
| 49 |
The interval of debits permitted by the mandate. Either `one_time` (just permitting a single debit), `scheduled` (with debits on an agreed schedule or for clearly-defined events), or `variable`(for debits with any frequency) |
| 50 |
""" |
| 51 |
notification_method: NotRequired[ |
| 52 |
Literal["deprecated_none", "email", "manual", "none", "stripe_email"] |
| 53 |
] |
| 54 |
""" |
| 55 |
The method Stripe should use to notify the customer of upcoming debit instructions and/or mandate confirmation as required by the underlying debit network. Either `email` (an email is sent directly to the customer), `manual` (a `source.mandate_notification` event is sent to your webhooks endpoint and you should handle the notification) or `none` (the underlying debit network does not require any notification). |
| 56 |
""" |
| 57 |
|
| 58 |
|
| 59 |
class SourceUpdateParamsMandateAcceptance(TypedDict): |
| 60 |
date: NotRequired[int] |
| 61 |
""" |
| 62 |
The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. |
| 63 |
""" |
| 64 |
ip: NotRequired[str] |
| 65 |
""" |
| 66 |
The IP address from which the mandate was accepted or refused by the customer. |
| 67 |
""" |
| 68 |
offline: NotRequired["SourceUpdateParamsMandateAcceptanceOffline"] |
| 69 |
""" |
| 70 |
The parameters required to store a mandate accepted offline. Should only be set if `mandate[type]` is `offline` |
| 71 |
""" |
| 72 |
online: NotRequired["SourceUpdateParamsMandateAcceptanceOnline"] |
| 73 |
""" |
| 74 |
The parameters required to store a mandate accepted online. Should only be set if `mandate[type]` is `online` |
| 75 |
""" |
| 76 |
status: Literal["accepted", "pending", "refused", "revoked"] |
| 77 |
""" |
| 78 |
The status of the mandate acceptance. Either `accepted` (the mandate was accepted) or `refused` (the mandate was refused). |
| 79 |
""" |
| 80 |
type: NotRequired[Literal["offline", "online"]] |
| 81 |
""" |
| 82 |
The type of acceptance information included with the mandate. Either `online` or `offline` |
| 83 |
""" |
| 84 |
user_agent: NotRequired[str] |
| 85 |
""" |
| 86 |
The user agent of the browser from which the mandate was accepted or refused by the customer. |
| 87 |
""" |
| 88 |
|
| 89 |
|
| 90 |
class SourceUpdateParamsMandateAcceptanceOffline(TypedDict): |
| 91 |
contact_email: str |
| 92 |
""" |
| 93 |
An email to contact you with if a copy of the mandate is requested, required if `type` is `offline`. |
| 94 |
""" |
| 95 |
|
| 96 |
|
| 97 |
class SourceUpdateParamsMandateAcceptanceOnline(TypedDict): |
| 98 |
date: NotRequired[int] |
| 99 |
""" |
| 100 |
The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. |
| 101 |
""" |
| 102 |
ip: NotRequired[str] |
| 103 |
""" |
| 104 |
The IP address from which the mandate was accepted or refused by the customer. |
| 105 |
""" |
| 106 |
user_agent: NotRequired[str] |
| 107 |
""" |
| 108 |
The user agent of the browser from which the mandate was accepted or refused by the customer. |
| 109 |
""" |
| 110 |
|
| 111 |
|
| 112 |
class SourceUpdateParamsOwner(TypedDict): |
| 113 |
address: NotRequired["SourceUpdateParamsOwnerAddress"] |
| 114 |
""" |
| 115 |
Owner's address. |
| 116 |
""" |
| 117 |
email: NotRequired[str] |
| 118 |
""" |
| 119 |
Owner's email address. |
| 120 |
""" |
| 121 |
name: NotRequired[str] |
| 122 |
""" |
| 123 |
Owner's full name. |
| 124 |
""" |
| 125 |
phone: NotRequired[str] |
| 126 |
""" |
| 127 |
Owner's phone number. |
| 128 |
""" |
| 129 |
|
| 130 |
|
| 131 |
class SourceUpdateParamsOwnerAddress(TypedDict): |
| 132 |
city: NotRequired[str] |
| 133 |
""" |
| 134 |
City, district, suburb, town, or village. |
| 135 |
""" |
| 136 |
country: NotRequired[str] |
| 137 |
""" |
| 138 |
Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). |
| 139 |
""" |
| 140 |
line1: NotRequired[str] |
| 141 |
""" |
| 142 |
Address line 1, such as the street, PO Box, or company name. |
| 143 |
""" |
| 144 |
line2: NotRequired[str] |
| 145 |
""" |
| 146 |
Address line 2, such as the apartment, suite, unit, or building. |
| 147 |
""" |
| 148 |
postal_code: NotRequired[str] |
| 149 |
""" |
| 150 |
ZIP or postal code. |
| 151 |
""" |
| 152 |
state: NotRequired[str] |
| 153 |
""" |
| 154 |
State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). |
| 155 |
""" |
| 156 |
|
| 157 |
|
| 158 |
class SourceUpdateParamsSourceOrder(TypedDict): |
| 159 |
items: NotRequired[List["SourceUpdateParamsSourceOrderItem"]] |
| 160 |
""" |
| 161 |
List of items constituting the order. |
| 162 |
""" |
| 163 |
shipping: NotRequired["SourceUpdateParamsSourceOrderShipping"] |
| 164 |
""" |
| 165 |
Shipping address for the order. Required if any of the SKUs are for products that have `shippable` set to true. |
| 166 |
""" |
| 167 |
|
| 168 |
|
| 169 |
class SourceUpdateParamsSourceOrderItem(TypedDict): |
| 170 |
amount: NotRequired[int] |
| 171 |
currency: NotRequired[str] |
| 172 |
description: NotRequired[str] |
| 173 |
parent: NotRequired[str] |
| 174 |
""" |
| 175 |
The ID of the SKU being ordered. |
| 176 |
""" |
| 177 |
quantity: NotRequired[int] |
| 178 |
""" |
| 179 |
The quantity of this order item. When type is `sku`, this is the number of instances of the SKU to be ordered. |
| 180 |
""" |
| 181 |
type: NotRequired[Literal["discount", "shipping", "sku", "tax"]] |
| 182 |
|
| 183 |
|
| 184 |
class SourceUpdateParamsSourceOrderShipping(TypedDict): |
| 185 |
address: "SourceUpdateParamsSourceOrderShippingAddress" |
| 186 |
""" |
| 187 |
Shipping address. |
| 188 |
""" |
| 189 |
carrier: NotRequired[str] |
| 190 |
""" |
| 191 |
The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. |
| 192 |
""" |
| 193 |
name: NotRequired[str] |
| 194 |
""" |
| 195 |
Recipient name. |
| 196 |
""" |
| 197 |
phone: NotRequired[str] |
| 198 |
""" |
| 199 |
Recipient phone (including extension). |
| 200 |
""" |
| 201 |
tracking_number: NotRequired[str] |
| 202 |
""" |
| 203 |
The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. |
| 204 |
""" |
| 205 |
|
| 206 |
|
| 207 |
class SourceUpdateParamsSourceOrderShippingAddress(TypedDict): |
| 208 |
city: NotRequired[str] |
| 209 |
""" |
| 210 |
City, district, suburb, town, or village. |
| 211 |
""" |
| 212 |
country: NotRequired[str] |
| 213 |
""" |
| 214 |
Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). |
| 215 |
""" |
| 216 |
line1: str |
| 217 |
""" |
| 218 |
Address line 1, such as the street, PO Box, or company name. |
| 219 |
""" |
| 220 |
line2: NotRequired[str] |
| 221 |
""" |
| 222 |
Address line 2, such as the apartment, suite, unit, or building. |
| 223 |
""" |
| 224 |
postal_code: NotRequired[str] |
| 225 |
""" |
| 226 |
ZIP or postal code. |
| 227 |
""" |
| 228 |
state: NotRequired[str] |
| 229 |
""" |
| 230 |
State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). |
| 231 |
""" |