| 1 |
# -*- coding: utf-8 -*- |
| 2 |
# File generated from our OpenAPI spec |
| 3 |
from stripe._request_options import RequestOptions |
| 4 |
from typing import List |
| 5 |
from typing_extensions import Literal, NotRequired, TypedDict |
| 6 |
|
| 7 |
|
| 8 |
class CustomerSessionCreateParams(RequestOptions): |
| 9 |
components: "CustomerSessionCreateParamsComponents" |
| 10 |
""" |
| 11 |
Configuration for each component. At least 1 component must be enabled. |
| 12 |
""" |
| 13 |
customer: NotRequired[str] |
| 14 |
""" |
| 15 |
The ID of an existing customer for which to create the Customer Session. |
| 16 |
""" |
| 17 |
customer_account: NotRequired[str] |
| 18 |
""" |
| 19 |
The ID of an existing Account for which to create the Customer Session. |
| 20 |
""" |
| 21 |
expand: NotRequired[List[str]] |
| 22 |
""" |
| 23 |
Specifies which fields in the response should be expanded. |
| 24 |
""" |
| 25 |
|
| 26 |
|
| 27 |
class CustomerSessionCreateParamsComponents(TypedDict): |
| 28 |
buy_button: NotRequired["CustomerSessionCreateParamsComponentsBuyButton"] |
| 29 |
""" |
| 30 |
Configuration for buy button. |
| 31 |
""" |
| 32 |
customer_sheet: NotRequired[ |
| 33 |
"CustomerSessionCreateParamsComponentsCustomerSheet" |
| 34 |
] |
| 35 |
""" |
| 36 |
Configuration for the customer sheet. |
| 37 |
""" |
| 38 |
mobile_payment_element: NotRequired[ |
| 39 |
"CustomerSessionCreateParamsComponentsMobilePaymentElement" |
| 40 |
] |
| 41 |
""" |
| 42 |
Configuration for the mobile payment element. |
| 43 |
""" |
| 44 |
payment_element: NotRequired[ |
| 45 |
"CustomerSessionCreateParamsComponentsPaymentElement" |
| 46 |
] |
| 47 |
""" |
| 48 |
Configuration for the Payment Element. |
| 49 |
""" |
| 50 |
pricing_table: NotRequired[ |
| 51 |
"CustomerSessionCreateParamsComponentsPricingTable" |
| 52 |
] |
| 53 |
""" |
| 54 |
Configuration for the pricing table. |
| 55 |
""" |
| 56 |
|
| 57 |
|
| 58 |
class CustomerSessionCreateParamsComponentsBuyButton(TypedDict): |
| 59 |
enabled: bool |
| 60 |
""" |
| 61 |
Whether the buy button is enabled. |
| 62 |
""" |
| 63 |
|
| 64 |
|
| 65 |
class CustomerSessionCreateParamsComponentsCustomerSheet(TypedDict): |
| 66 |
enabled: bool |
| 67 |
""" |
| 68 |
Whether the customer sheet is enabled. |
| 69 |
""" |
| 70 |
features: NotRequired[ |
| 71 |
"CustomerSessionCreateParamsComponentsCustomerSheetFeatures" |
| 72 |
] |
| 73 |
""" |
| 74 |
This hash defines whether the customer sheet supports certain features. |
| 75 |
""" |
| 76 |
|
| 77 |
|
| 78 |
class CustomerSessionCreateParamsComponentsCustomerSheetFeatures(TypedDict): |
| 79 |
payment_method_allow_redisplay_filters: NotRequired[ |
| 80 |
List[Literal["always", "limited", "unspecified"]] |
| 81 |
] |
| 82 |
""" |
| 83 |
A list of [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) values that controls which saved payment methods the customer sheet displays by filtering to only show payment methods with an `allow_redisplay` value that is present in this list. |
| 84 |
|
| 85 |
If not specified, defaults to ["always"]. In order to display all saved payment methods, specify ["always", "limited", "unspecified"]. |
| 86 |
""" |
| 87 |
payment_method_remove: NotRequired[Literal["disabled", "enabled"]] |
| 88 |
""" |
| 89 |
Controls whether the customer sheet displays the option to remove a saved payment method." |
| 90 |
|
| 91 |
Allowing buyers to remove their saved payment methods impacts subscriptions that depend on that payment method. Removing the payment method detaches the [`customer` object](https://docs.stripe.com/api/payment_methods/object#payment_method_object-customer) from that [PaymentMethod](https://docs.stripe.com/api/payment_methods). |
| 92 |
""" |
| 93 |
|
| 94 |
|
| 95 |
class CustomerSessionCreateParamsComponentsMobilePaymentElement(TypedDict): |
| 96 |
enabled: bool |
| 97 |
""" |
| 98 |
Whether the mobile payment element is enabled. |
| 99 |
""" |
| 100 |
features: NotRequired[ |
| 101 |
"CustomerSessionCreateParamsComponentsMobilePaymentElementFeatures" |
| 102 |
] |
| 103 |
""" |
| 104 |
This hash defines whether the mobile payment element supports certain features. |
| 105 |
""" |
| 106 |
|
| 107 |
|
| 108 |
class CustomerSessionCreateParamsComponentsMobilePaymentElementFeatures( |
| 109 |
TypedDict, |
| 110 |
): |
| 111 |
payment_method_allow_redisplay_filters: NotRequired[ |
| 112 |
List[Literal["always", "limited", "unspecified"]] |
| 113 |
] |
| 114 |
""" |
| 115 |
A list of [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) values that controls which saved payment methods the mobile payment element displays by filtering to only show payment methods with an `allow_redisplay` value that is present in this list. |
| 116 |
|
| 117 |
If not specified, defaults to ["always"]. In order to display all saved payment methods, specify ["always", "limited", "unspecified"]. |
| 118 |
""" |
| 119 |
payment_method_redisplay: NotRequired[Literal["disabled", "enabled"]] |
| 120 |
""" |
| 121 |
Controls whether or not the mobile payment element shows saved payment methods. |
| 122 |
""" |
| 123 |
payment_method_remove: NotRequired[Literal["disabled", "enabled"]] |
| 124 |
""" |
| 125 |
Controls whether the mobile payment element displays the option to remove a saved payment method." |
| 126 |
|
| 127 |
Allowing buyers to remove their saved payment methods impacts subscriptions that depend on that payment method. Removing the payment method detaches the [`customer` object](https://docs.stripe.com/api/payment_methods/object#payment_method_object-customer) from that [PaymentMethod](https://docs.stripe.com/api/payment_methods). |
| 128 |
""" |
| 129 |
payment_method_save: NotRequired[Literal["disabled", "enabled"]] |
| 130 |
""" |
| 131 |
Controls whether the mobile payment element displays a checkbox offering to save a new payment method. |
| 132 |
|
| 133 |
If a customer checks the box, the [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) value on the PaymentMethod is set to `'always'` at confirmation time. For PaymentIntents, the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value is also set to the value defined in `payment_method_save_usage`. |
| 134 |
""" |
| 135 |
payment_method_save_allow_redisplay_override: NotRequired[ |
| 136 |
Literal["always", "limited", "unspecified"] |
| 137 |
] |
| 138 |
""" |
| 139 |
Allows overriding the value of allow_override when saving a new payment method when payment_method_save is set to disabled. Use values: "always", "limited", or "unspecified". |
| 140 |
|
| 141 |
If not specified, defaults to `nil` (no override value). |
| 142 |
""" |
| 143 |
|
| 144 |
|
| 145 |
class CustomerSessionCreateParamsComponentsPaymentElement(TypedDict): |
| 146 |
enabled: bool |
| 147 |
""" |
| 148 |
Whether the Payment Element is enabled. |
| 149 |
""" |
| 150 |
features: NotRequired[ |
| 151 |
"CustomerSessionCreateParamsComponentsPaymentElementFeatures" |
| 152 |
] |
| 153 |
""" |
| 154 |
This hash defines whether the Payment Element supports certain features. |
| 155 |
""" |
| 156 |
|
| 157 |
|
| 158 |
class CustomerSessionCreateParamsComponentsPaymentElementFeatures(TypedDict): |
| 159 |
payment_method_allow_redisplay_filters: NotRequired[ |
| 160 |
List[Literal["always", "limited", "unspecified"]] |
| 161 |
] |
| 162 |
""" |
| 163 |
A list of [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) values that controls which saved payment methods the Payment Element displays by filtering to only show payment methods with an `allow_redisplay` value that is present in this list. |
| 164 |
|
| 165 |
If not specified, defaults to ["always"]. In order to display all saved payment methods, specify ["always", "limited", "unspecified"]. |
| 166 |
""" |
| 167 |
payment_method_redisplay: NotRequired[Literal["disabled", "enabled"]] |
| 168 |
""" |
| 169 |
Controls whether or not the Payment Element shows saved payment methods. This parameter defaults to `disabled`. |
| 170 |
""" |
| 171 |
payment_method_redisplay_limit: NotRequired[int] |
| 172 |
""" |
| 173 |
Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `3`. The maximum redisplay limit is `10`. |
| 174 |
""" |
| 175 |
payment_method_remove: NotRequired[Literal["disabled", "enabled"]] |
| 176 |
""" |
| 177 |
Controls whether the Payment Element displays the option to remove a saved payment method. This parameter defaults to `disabled`. |
| 178 |
|
| 179 |
Allowing buyers to remove their saved payment methods impacts subscriptions that depend on that payment method. Removing the payment method detaches the [`customer` object](https://docs.stripe.com/api/payment_methods/object#payment_method_object-customer) from that [PaymentMethod](https://docs.stripe.com/api/payment_methods). |
| 180 |
""" |
| 181 |
payment_method_save: NotRequired[Literal["disabled", "enabled"]] |
| 182 |
""" |
| 183 |
Controls whether the Payment Element displays a checkbox offering to save a new payment method. This parameter defaults to `disabled`. |
| 184 |
|
| 185 |
If a customer checks the box, the [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) value on the PaymentMethod is set to `'always'` at confirmation time. For PaymentIntents, the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value is also set to the value defined in `payment_method_save_usage`. |
| 186 |
""" |
| 187 |
payment_method_save_usage: NotRequired[ |
| 188 |
Literal["off_session", "on_session"] |
| 189 |
] |
| 190 |
""" |
| 191 |
When using PaymentIntents and the customer checks the save checkbox, this field determines the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value used to confirm the PaymentIntent. |
| 192 |
|
| 193 |
When using SetupIntents, directly configure the [`usage`](https://docs.stripe.com/api/setup_intents/object#setup_intent_object-usage) value on SetupIntent creation. |
| 194 |
""" |
| 195 |
|
| 196 |
|
| 197 |
class CustomerSessionCreateParamsComponentsPricingTable(TypedDict): |
| 198 |
enabled: bool |
| 199 |
""" |
| 200 |
Whether the pricing table is enabled. |
| 201 |
""" |