Debian Codegraph @

stripe/params/_payment_intent_capture_params.py

raw
1 # -*- coding: utf-8 -*-
2 # File generated from our OpenAPI spec
3 from stripe._request_options import RequestOptions
4 from typing import Dict, List, Union
5 from typing_extensions import Literal, NotRequired, TypedDict
6
7
8 class PaymentIntentCaptureParams(RequestOptions):
9 amount_details: NotRequired["PaymentIntentCaptureParamsAmountDetails"]
10 """
11 Provides industry-specific information about the amount.
12 """
13 amount_to_capture: NotRequired[int]
14 """
15 The amount to capture from the PaymentIntent, which must be less than or equal to the original amount. Defaults to the full `amount_capturable` if it's not provided.
16 """
17 application_fee_amount: NotRequired[int]
18 """
19 The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total amount captured. For more information, see the PaymentIntents [use case for connected accounts](https://docs.stripe.com/payments/connected-accounts).
20 """
21 expand: NotRequired[List[str]]
22 """
23 Specifies which fields in the response should be expanded.
24 """
25 final_capture: NotRequired[bool]
26 """
27 Defaults to `true`. When capturing a PaymentIntent, setting `final_capture` to `false` notifies Stripe to not release the remaining uncaptured funds to make sure that they're captured in future requests. You can only use this setting when [multicapture](https://docs.stripe.com/payments/multicapture) is available for PaymentIntents.
28 """
29 hooks: NotRequired["PaymentIntentCaptureParamsHooks"]
30 """
31 Automations to be run during the PaymentIntent lifecycle
32 """
33 metadata: NotRequired["Literal['']|Dict[str, str]"]
34 """
35 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`.
36 """
37 payment_details: NotRequired[
38 "Literal['']|PaymentIntentCaptureParamsPaymentDetails"
39 ]
40 """
41 Provides industry-specific information about the charge.
42 """
43 statement_descriptor: NotRequired[str]
44 """
45 Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors).
46
47 Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead.
48 """
49 statement_descriptor_suffix: NotRequired[str]
50 """
51 Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement.
52 """
53 transfer_data: NotRequired["PaymentIntentCaptureParamsTransferData"]
54 """
55 The parameters that you can use to automatically create a transfer after the payment
56 is captured. Learn more about the [use case for connected accounts](https://docs.stripe.com/payments/connected-accounts).
57 """
58
59
60 class PaymentIntentCaptureParamsAmountDetails(TypedDict):
61 discount_amount: NotRequired["Literal['']|int"]
62 """
63 The total discount applied on the transaction represented in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). An integer greater than 0.
64
65 This field is mutually exclusive with the `amount_details[line_items][#][discount_amount]` field.
66 """
67 enforce_arithmetic_validation: NotRequired[bool]
68 """
69 Set to `false` to return arithmetic validation errors in the response without failing the request. Use this when you want the operation to proceed regardless of arithmetic errors in the line item data.
70
71 Omit or set to `true` to immediately return a 400 error when arithmetic validation fails. Use this for strict validation that prevents processing with line item data that has arithmetic inconsistencies.
72
73 For card payments, Stripe doesn't send line item data to card networks if there's an arithmetic validation error.
74 """
75 line_items: NotRequired[
76 "Literal['']|List[PaymentIntentCaptureParamsAmountDetailsLineItem]"
77 ]
78 """
79 A list of line items, each containing information about a product in the PaymentIntent. There is a maximum of 200 line items.
80 """
81 shipping: NotRequired[
82 "Literal['']|PaymentIntentCaptureParamsAmountDetailsShipping"
83 ]
84 """
85 Contains information about the shipping portion of the amount.
86 """
87 tax: NotRequired["Literal['']|PaymentIntentCaptureParamsAmountDetailsTax"]
88 """
89 Contains information about the tax portion of the amount.
90 """
91
92
93 class PaymentIntentCaptureParamsAmountDetailsLineItem(TypedDict):
94 discount_amount: NotRequired[int]
95 """
96 The discount applied on this line item represented in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). An integer greater than 0.
97
98 This field is mutually exclusive with the `amount_details[discount_amount]` field.
99 """
100 payment_method_options: NotRequired[
101 "PaymentIntentCaptureParamsAmountDetailsLineItemPaymentMethodOptions"
102 ]
103 """
104 Payment method-specific information for line items.
105 """
106 product_code: NotRequired[str]
107 """
108 The product code of the line item, such as an SKU. Required for L3 rates. At most 12 characters long.
109 """
110 product_name: str
111 """
112 The product name of the line item. Required for L3 rates. At most 1024 characters long.
113
114 For Cards, this field is truncated to 26 alphanumeric characters before being sent to the card networks. For PayPal, this field is truncated to 127 characters.
115 """
116 quantity: int
117 """
118 The quantity of items. Required for L3 rates. An integer greater than 0.
119 """
120 tax: NotRequired["PaymentIntentCaptureParamsAmountDetailsLineItemTax"]
121 """
122 Contains information about the tax on the item.
123 """
124 unit_cost: int
125 """
126 The unit cost of the line item represented in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). Required for L3 rates. An integer greater than or equal to 0.
127 """
128 unit_of_measure: NotRequired[str]
129 """
130 A unit of measure for the line item, such as gallons, feet, meters, etc.
131 """
132
133
134 class PaymentIntentCaptureParamsAmountDetailsLineItemPaymentMethodOptions(
135 TypedDict,
136 ):
137 card: NotRequired[
138 "PaymentIntentCaptureParamsAmountDetailsLineItemPaymentMethodOptionsCard"
139 ]
140 """
141 This sub-hash contains line item details that are specific to the `card` payment method.
142 """
143 card_present: NotRequired[
144 "PaymentIntentCaptureParamsAmountDetailsLineItemPaymentMethodOptionsCardPresent"
145 ]
146 """
147 This sub-hash contains line item details that are specific to the `card_present` payment method.
148 """
149 klarna: NotRequired[
150 "PaymentIntentCaptureParamsAmountDetailsLineItemPaymentMethodOptionsKlarna"
151 ]
152 """
153 This sub-hash contains line item details that are specific to the `klarna` payment method.
154 """
155 paypal: NotRequired[
156 "PaymentIntentCaptureParamsAmountDetailsLineItemPaymentMethodOptionsPaypal"
157 ]
158 """
159 This sub-hash contains line item details that are specific to the `paypal` payment method.
160 """
161
162
163 class PaymentIntentCaptureParamsAmountDetailsLineItemPaymentMethodOptionsCard(
164 TypedDict,
165 ):
166 commodity_code: NotRequired[str]
167 """
168 Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, and so on.
169 """
170
171
172 class PaymentIntentCaptureParamsAmountDetailsLineItemPaymentMethodOptionsCardPresent(
173 TypedDict,
174 ):
175 commodity_code: NotRequired[str]
176 """
177 Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, and so on.
178 """
179
180
181 class PaymentIntentCaptureParamsAmountDetailsLineItemPaymentMethodOptionsKlarna(
182 TypedDict,
183 ):
184 image_url: NotRequired[str]
185 """
186 URL to an image for the product. Max length, 4096 characters.
187 """
188 product_url: NotRequired[str]
189 """
190 URL to the product page. Max length, 4096 characters.
191 """
192 reference: NotRequired[str]
193 """
194 Unique reference for this line item to correlate it with your system's internal records. The field is displayed in the Klarna Consumer App if passed.
195 """
196 subscription_reference: NotRequired[str]
197 """
198 Reference for the subscription this line item is for.
199 """
200
201
202 class PaymentIntentCaptureParamsAmountDetailsLineItemPaymentMethodOptionsPaypal(
203 TypedDict,
204 ):
205 category: NotRequired[
206 Literal["digital_goods", "donation", "physical_goods"]
207 ]
208 """
209 Type of the line item.
210 """
211 description: NotRequired[str]
212 """
213 Description of the line item.
214 """
215 sold_by: NotRequired[str]
216 """
217 The Stripe account ID of the connected account that sells the item.
218 """
219
220
221 class PaymentIntentCaptureParamsAmountDetailsLineItemTax(TypedDict):
222 total_tax_amount: int
223 """
224 The total amount of tax on a single line item represented in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). Required for L3 rates. An integer greater than or equal to 0.
225
226 This field is mutually exclusive with the `amount_details[tax][total_tax_amount]` field.
227 """
228
229
230 class PaymentIntentCaptureParamsAmountDetailsShipping(TypedDict):
231 amount: NotRequired["Literal['']|int"]
232 """
233 If a physical good is being shipped, the cost of shipping represented in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). An integer greater than or equal to 0.
234 """
235 from_postal_code: NotRequired["Literal['']|str"]
236 """
237 If a physical good is being shipped, the postal code of where it is being shipped from. At most 10 alphanumeric characters long, hyphens are allowed.
238 """
239 to_postal_code: NotRequired["Literal['']|str"]
240 """
241 If a physical good is being shipped, the postal code of where it is being shipped to. At most 10 alphanumeric characters long, hyphens are allowed.
242 """
243
244
245 class PaymentIntentCaptureParamsAmountDetailsTax(TypedDict):
246 total_tax_amount: int
247 """
248 The total amount of tax on the transaction represented in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). Required for L2 rates. An integer greater than or equal to 0.
249
250 This field is mutually exclusive with the `amount_details[line_items][#][tax][total_tax_amount]` field.
251 """
252
253
254 class PaymentIntentCaptureParamsHooks(TypedDict):
255 inputs: NotRequired["PaymentIntentCaptureParamsHooksInputs"]
256 """
257 Arguments passed in automations
258 """
259
260
261 class PaymentIntentCaptureParamsHooksInputs(TypedDict):
262 tax: NotRequired["PaymentIntentCaptureParamsHooksInputsTax"]
263 """
264 Tax arguments for automations
265 """
266
267
268 class PaymentIntentCaptureParamsHooksInputsTax(TypedDict):
269 calculation: Union[Literal[""], str]
270 """
271 The [TaxCalculation](https://docs.stripe.com/api/tax/calculations) id
272 """
273
274
275 class PaymentIntentCaptureParamsPaymentDetails(TypedDict):
276 customer_reference: NotRequired["Literal['']|str"]
277 """
278 A unique value to identify the customer. This field is available only for card payments.
279
280 This field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks.
281 """
282 order_reference: NotRequired["Literal['']|str"]
283 """
284 A unique value assigned by the business to identify the transaction. Required for L2 and L3 rates.
285
286 Required when the Payment Method Types array contains `card`, including when [automatic_payment_methods.enabled](https://docs.stripe.com/api/payment_intents/create#create_payment_intent-automatic_payment_methods-enabled) is set to `true`.
287
288 For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks. For Klarna, this field is truncated to 255 characters and is visible to customers when they view the order in the Klarna app.
289 """
290
291
292 class PaymentIntentCaptureParamsTransferData(TypedDict):
293 amount: NotRequired[int]
294 """
295 The amount that will be transferred automatically when a charge succeeds.
296 """