Skip to main content

stripe_checkout/checkout_session/
requests.rs

1use stripe_client_core::{
2    RequestBuilder, StripeBlockingClient, StripeClient, StripeMethod, StripeRequest,
3};
4
5#[derive(Clone, Eq, PartialEq)]
6#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
7#[derive(serde::Serialize)]
8struct ListCheckoutSessionBuilder {
9    #[serde(skip_serializing_if = "Option::is_none")]
10    created: Option<stripe_types::RangeQueryTs>,
11    #[serde(skip_serializing_if = "Option::is_none")]
12    customer: Option<String>,
13    #[serde(skip_serializing_if = "Option::is_none")]
14    customer_account: Option<String>,
15    #[serde(skip_serializing_if = "Option::is_none")]
16    customer_details: Option<ListCheckoutSessionCustomerDetails>,
17    #[serde(skip_serializing_if = "Option::is_none")]
18    ending_before: Option<String>,
19    #[serde(skip_serializing_if = "Option::is_none")]
20    expand: Option<Vec<String>>,
21    #[serde(skip_serializing_if = "Option::is_none")]
22    limit: Option<i64>,
23    #[serde(skip_serializing_if = "Option::is_none")]
24    payment_intent: Option<String>,
25    #[serde(skip_serializing_if = "Option::is_none")]
26    payment_link: Option<String>,
27    #[serde(skip_serializing_if = "Option::is_none")]
28    starting_after: Option<String>,
29    #[serde(skip_serializing_if = "Option::is_none")]
30    status: Option<stripe_shared::CheckoutSessionStatus>,
31    #[serde(skip_serializing_if = "Option::is_none")]
32    subscription: Option<String>,
33}
34#[cfg(feature = "redact-generated-debug")]
35impl std::fmt::Debug for ListCheckoutSessionBuilder {
36    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
37        f.debug_struct("ListCheckoutSessionBuilder").finish_non_exhaustive()
38    }
39}
40impl ListCheckoutSessionBuilder {
41    fn new() -> Self {
42        Self {
43            created: None,
44            customer: None,
45            customer_account: None,
46            customer_details: None,
47            ending_before: None,
48            expand: None,
49            limit: None,
50            payment_intent: None,
51            payment_link: None,
52            starting_after: None,
53            status: None,
54            subscription: None,
55        }
56    }
57}
58/// Only return the Checkout Sessions for the Customer details specified.
59#[derive(Clone, Eq, PartialEq)]
60#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
61#[derive(serde::Serialize)]
62pub struct ListCheckoutSessionCustomerDetails {
63    /// Customer's email address.
64    pub email: String,
65}
66#[cfg(feature = "redact-generated-debug")]
67impl std::fmt::Debug for ListCheckoutSessionCustomerDetails {
68    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
69        f.debug_struct("ListCheckoutSessionCustomerDetails").finish_non_exhaustive()
70    }
71}
72impl ListCheckoutSessionCustomerDetails {
73    pub fn new(email: impl Into<String>) -> Self {
74        Self { email: email.into() }
75    }
76}
77/// Returns a list of Checkout Sessions.
78#[derive(Clone)]
79#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
80#[derive(serde::Serialize)]
81pub struct ListCheckoutSession {
82    inner: ListCheckoutSessionBuilder,
83}
84#[cfg(feature = "redact-generated-debug")]
85impl std::fmt::Debug for ListCheckoutSession {
86    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
87        f.debug_struct("ListCheckoutSession").finish_non_exhaustive()
88    }
89}
90impl ListCheckoutSession {
91    /// Construct a new `ListCheckoutSession`.
92    pub fn new() -> Self {
93        Self { inner: ListCheckoutSessionBuilder::new() }
94    }
95    /// Only return Checkout Sessions that were created during the given date interval.
96    pub fn created(mut self, created: impl Into<stripe_types::RangeQueryTs>) -> Self {
97        self.inner.created = Some(created.into());
98        self
99    }
100    /// Only return the Checkout Sessions for the Customer specified.
101    pub fn customer(mut self, customer: impl Into<String>) -> Self {
102        self.inner.customer = Some(customer.into());
103        self
104    }
105    /// Only return the Checkout Sessions for the Account specified.
106    pub fn customer_account(mut self, customer_account: impl Into<String>) -> Self {
107        self.inner.customer_account = Some(customer_account.into());
108        self
109    }
110    /// Only return the Checkout Sessions for the Customer details specified.
111    pub fn customer_details(
112        mut self,
113        customer_details: impl Into<ListCheckoutSessionCustomerDetails>,
114    ) -> Self {
115        self.inner.customer_details = Some(customer_details.into());
116        self
117    }
118    /// A cursor for use in pagination.
119    /// `ending_before` is an object ID that defines your place in the list.
120    /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
121    pub fn ending_before(mut self, ending_before: impl Into<String>) -> Self {
122        self.inner.ending_before = Some(ending_before.into());
123        self
124    }
125    /// Specifies which fields in the response should be expanded.
126    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
127        self.inner.expand = Some(expand.into());
128        self
129    }
130    /// A limit on the number of objects to be returned.
131    /// Limit can range between 1 and 100, and the default is 10.
132    pub fn limit(mut self, limit: impl Into<i64>) -> Self {
133        self.inner.limit = Some(limit.into());
134        self
135    }
136    /// Only return the Checkout Session for the PaymentIntent specified.
137    pub fn payment_intent(mut self, payment_intent: impl Into<String>) -> Self {
138        self.inner.payment_intent = Some(payment_intent.into());
139        self
140    }
141    /// Only return the Checkout Sessions for the Payment Link specified.
142    pub fn payment_link(mut self, payment_link: impl Into<String>) -> Self {
143        self.inner.payment_link = Some(payment_link.into());
144        self
145    }
146    /// A cursor for use in pagination.
147    /// `starting_after` is an object ID that defines your place in the list.
148    /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
149    pub fn starting_after(mut self, starting_after: impl Into<String>) -> Self {
150        self.inner.starting_after = Some(starting_after.into());
151        self
152    }
153    /// Only return the Checkout Sessions matching the given status.
154    pub fn status(mut self, status: impl Into<stripe_shared::CheckoutSessionStatus>) -> Self {
155        self.inner.status = Some(status.into());
156        self
157    }
158    /// Only return the Checkout Session for the subscription specified.
159    pub fn subscription(mut self, subscription: impl Into<String>) -> Self {
160        self.inner.subscription = Some(subscription.into());
161        self
162    }
163}
164impl Default for ListCheckoutSession {
165    fn default() -> Self {
166        Self::new()
167    }
168}
169impl ListCheckoutSession {
170    /// Send the request and return the deserialized response.
171    pub async fn send<C: StripeClient>(
172        &self,
173        client: &C,
174    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
175        self.customize().send(client).await
176    }
177
178    /// Send the request and return the deserialized response, blocking until completion.
179    pub fn send_blocking<C: StripeBlockingClient>(
180        &self,
181        client: &C,
182    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
183        self.customize().send_blocking(client)
184    }
185
186    pub fn paginate(
187        &self,
188    ) -> stripe_client_core::ListPaginator<stripe_types::List<stripe_shared::CheckoutSession>> {
189        stripe_client_core::ListPaginator::new_list("/checkout/sessions", &self.inner)
190    }
191}
192
193impl StripeRequest for ListCheckoutSession {
194    type Output = stripe_types::List<stripe_shared::CheckoutSession>;
195
196    fn build(&self) -> RequestBuilder {
197        RequestBuilder::new(StripeMethod::Get, "/checkout/sessions").query(&self.inner)
198    }
199}
200#[derive(Clone, Eq, PartialEq)]
201#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
202#[derive(serde::Serialize)]
203struct RetrieveCheckoutSessionBuilder {
204    #[serde(skip_serializing_if = "Option::is_none")]
205    expand: Option<Vec<String>>,
206}
207#[cfg(feature = "redact-generated-debug")]
208impl std::fmt::Debug for RetrieveCheckoutSessionBuilder {
209    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
210        f.debug_struct("RetrieveCheckoutSessionBuilder").finish_non_exhaustive()
211    }
212}
213impl RetrieveCheckoutSessionBuilder {
214    fn new() -> Self {
215        Self { expand: None }
216    }
217}
218/// Retrieves a Checkout Session object.
219#[derive(Clone)]
220#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
221#[derive(serde::Serialize)]
222pub struct RetrieveCheckoutSession {
223    inner: RetrieveCheckoutSessionBuilder,
224    session: stripe_shared::CheckoutSessionId,
225}
226#[cfg(feature = "redact-generated-debug")]
227impl std::fmt::Debug for RetrieveCheckoutSession {
228    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
229        f.debug_struct("RetrieveCheckoutSession").finish_non_exhaustive()
230    }
231}
232impl RetrieveCheckoutSession {
233    /// Construct a new `RetrieveCheckoutSession`.
234    pub fn new(session: impl Into<stripe_shared::CheckoutSessionId>) -> Self {
235        Self { session: session.into(), inner: RetrieveCheckoutSessionBuilder::new() }
236    }
237    /// Specifies which fields in the response should be expanded.
238    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
239        self.inner.expand = Some(expand.into());
240        self
241    }
242}
243impl RetrieveCheckoutSession {
244    /// Send the request and return the deserialized response.
245    pub async fn send<C: StripeClient>(
246        &self,
247        client: &C,
248    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
249        self.customize().send(client).await
250    }
251
252    /// Send the request and return the deserialized response, blocking until completion.
253    pub fn send_blocking<C: StripeBlockingClient>(
254        &self,
255        client: &C,
256    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
257        self.customize().send_blocking(client)
258    }
259}
260
261impl StripeRequest for RetrieveCheckoutSession {
262    type Output = stripe_shared::CheckoutSession;
263
264    fn build(&self) -> RequestBuilder {
265        let session = &self.session;
266        RequestBuilder::new(StripeMethod::Get, format!("/checkout/sessions/{session}"))
267            .query(&self.inner)
268    }
269}
270#[derive(Clone, Eq, PartialEq)]
271#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
272#[derive(serde::Serialize)]
273struct ListLineItemsCheckoutSessionBuilder {
274    #[serde(skip_serializing_if = "Option::is_none")]
275    ending_before: Option<String>,
276    #[serde(skip_serializing_if = "Option::is_none")]
277    expand: Option<Vec<String>>,
278    #[serde(skip_serializing_if = "Option::is_none")]
279    limit: Option<i64>,
280    #[serde(skip_serializing_if = "Option::is_none")]
281    starting_after: Option<String>,
282}
283#[cfg(feature = "redact-generated-debug")]
284impl std::fmt::Debug for ListLineItemsCheckoutSessionBuilder {
285    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
286        f.debug_struct("ListLineItemsCheckoutSessionBuilder").finish_non_exhaustive()
287    }
288}
289impl ListLineItemsCheckoutSessionBuilder {
290    fn new() -> Self {
291        Self { ending_before: None, expand: None, limit: None, starting_after: None }
292    }
293}
294/// When retrieving a Checkout Session, there is an includable **line_items** property containing the first handful of those items.
295/// There is also a URL where you can retrieve the full (paginated) list of line items.
296#[derive(Clone)]
297#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
298#[derive(serde::Serialize)]
299pub struct ListLineItemsCheckoutSession {
300    inner: ListLineItemsCheckoutSessionBuilder,
301    session: stripe_shared::CheckoutSessionId,
302}
303#[cfg(feature = "redact-generated-debug")]
304impl std::fmt::Debug for ListLineItemsCheckoutSession {
305    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
306        f.debug_struct("ListLineItemsCheckoutSession").finish_non_exhaustive()
307    }
308}
309impl ListLineItemsCheckoutSession {
310    /// Construct a new `ListLineItemsCheckoutSession`.
311    pub fn new(session: impl Into<stripe_shared::CheckoutSessionId>) -> Self {
312        Self { session: session.into(), inner: ListLineItemsCheckoutSessionBuilder::new() }
313    }
314    /// A cursor for use in pagination.
315    /// `ending_before` is an object ID that defines your place in the list.
316    /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
317    pub fn ending_before(mut self, ending_before: impl Into<String>) -> Self {
318        self.inner.ending_before = Some(ending_before.into());
319        self
320    }
321    /// Specifies which fields in the response should be expanded.
322    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
323        self.inner.expand = Some(expand.into());
324        self
325    }
326    /// A limit on the number of objects to be returned.
327    /// Limit can range between 1 and 100, and the default is 10.
328    pub fn limit(mut self, limit: impl Into<i64>) -> Self {
329        self.inner.limit = Some(limit.into());
330        self
331    }
332    /// A cursor for use in pagination.
333    /// `starting_after` is an object ID that defines your place in the list.
334    /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
335    pub fn starting_after(mut self, starting_after: impl Into<String>) -> Self {
336        self.inner.starting_after = Some(starting_after.into());
337        self
338    }
339}
340impl ListLineItemsCheckoutSession {
341    /// Send the request and return the deserialized response.
342    pub async fn send<C: StripeClient>(
343        &self,
344        client: &C,
345    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
346        self.customize().send(client).await
347    }
348
349    /// Send the request and return the deserialized response, blocking until completion.
350    pub fn send_blocking<C: StripeBlockingClient>(
351        &self,
352        client: &C,
353    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
354        self.customize().send_blocking(client)
355    }
356
357    pub fn paginate(
358        &self,
359    ) -> stripe_client_core::ListPaginator<stripe_types::List<stripe_shared::CheckoutSessionItem>>
360    {
361        let session = &self.session;
362
363        stripe_client_core::ListPaginator::new_list(
364            format!("/checkout/sessions/{session}/line_items"),
365            &self.inner,
366        )
367    }
368}
369
370impl StripeRequest for ListLineItemsCheckoutSession {
371    type Output = stripe_types::List<stripe_shared::CheckoutSessionItem>;
372
373    fn build(&self) -> RequestBuilder {
374        let session = &self.session;
375        RequestBuilder::new(StripeMethod::Get, format!("/checkout/sessions/{session}/line_items"))
376            .query(&self.inner)
377    }
378}
379#[derive(Clone)]
380#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
381#[derive(serde::Serialize)]
382struct CreateCheckoutSessionBuilder {
383    #[serde(skip_serializing_if = "Option::is_none")]
384    adaptive_pricing: Option<CreateCheckoutSessionAdaptivePricing>,
385    #[serde(skip_serializing_if = "Option::is_none")]
386    after_expiration: Option<CreateCheckoutSessionAfterExpiration>,
387    #[serde(skip_serializing_if = "Option::is_none")]
388    allow_promotion_codes: Option<bool>,
389    #[serde(skip_serializing_if = "Option::is_none")]
390    automatic_tax: Option<CreateCheckoutSessionAutomaticTax>,
391    #[serde(skip_serializing_if = "Option::is_none")]
392    billing_address_collection: Option<stripe_shared::CheckoutSessionBillingAddressCollection>,
393    #[serde(skip_serializing_if = "Option::is_none")]
394    branding_settings: Option<CreateCheckoutSessionBrandingSettings>,
395    #[serde(skip_serializing_if = "Option::is_none")]
396    cancel_url: Option<String>,
397    #[serde(skip_serializing_if = "Option::is_none")]
398    client_reference_id: Option<String>,
399    #[serde(skip_serializing_if = "Option::is_none")]
400    consent_collection: Option<CreateCheckoutSessionConsentCollection>,
401    #[serde(skip_serializing_if = "Option::is_none")]
402    currency: Option<stripe_types::Currency>,
403    #[serde(skip_serializing_if = "Option::is_none")]
404    custom_fields: Option<Vec<CreateCheckoutSessionCustomFields>>,
405    #[serde(skip_serializing_if = "Option::is_none")]
406    custom_text: Option<CreateCheckoutSessionCustomText>,
407    #[serde(skip_serializing_if = "Option::is_none")]
408    customer: Option<String>,
409    #[serde(skip_serializing_if = "Option::is_none")]
410    customer_account: Option<String>,
411    #[serde(skip_serializing_if = "Option::is_none")]
412    customer_creation: Option<CreateCheckoutSessionCustomerCreation>,
413    #[serde(skip_serializing_if = "Option::is_none")]
414    customer_email: Option<String>,
415    #[serde(skip_serializing_if = "Option::is_none")]
416    customer_update: Option<CreateCheckoutSessionCustomerUpdate>,
417    #[serde(skip_serializing_if = "Option::is_none")]
418    discounts: Option<Vec<CreateCheckoutSessionDiscounts>>,
419    #[serde(skip_serializing_if = "Option::is_none")]
420    excluded_payment_method_types: Option<Vec<CreateCheckoutSessionExcludedPaymentMethodTypes>>,
421    #[serde(skip_serializing_if = "Option::is_none")]
422    expand: Option<Vec<String>>,
423    #[serde(skip_serializing_if = "Option::is_none")]
424    expires_at: Option<stripe_types::Timestamp>,
425    #[serde(skip_serializing_if = "Option::is_none")]
426    integration_identifier: Option<String>,
427    #[serde(skip_serializing_if = "Option::is_none")]
428    invoice_creation: Option<CreateCheckoutSessionInvoiceCreation>,
429    #[serde(skip_serializing_if = "Option::is_none")]
430    line_items: Option<Vec<CreateCheckoutSessionLineItems>>,
431    #[serde(skip_serializing_if = "Option::is_none")]
432    locale: Option<stripe_shared::CheckoutSessionLocale>,
433    #[serde(skip_serializing_if = "Option::is_none")]
434    managed_payments: Option<CreateCheckoutSessionManagedPayments>,
435    #[serde(skip_serializing_if = "Option::is_none")]
436    metadata: Option<std::collections::HashMap<String, String>>,
437    #[serde(skip_serializing_if = "Option::is_none")]
438    mode: Option<stripe_shared::CheckoutSessionMode>,
439    #[serde(skip_serializing_if = "Option::is_none")]
440    name_collection: Option<CreateCheckoutSessionNameCollection>,
441    #[serde(skip_serializing_if = "Option::is_none")]
442    optional_items: Option<Vec<CreateCheckoutSessionOptionalItems>>,
443    #[serde(skip_serializing_if = "Option::is_none")]
444    origin_context: Option<stripe_shared::CheckoutSessionOriginContext>,
445    #[serde(skip_serializing_if = "Option::is_none")]
446    payment_intent_data: Option<CreateCheckoutSessionPaymentIntentData>,
447    #[serde(skip_serializing_if = "Option::is_none")]
448    payment_method_collection: Option<CreateCheckoutSessionPaymentMethodCollection>,
449    #[serde(skip_serializing_if = "Option::is_none")]
450    payment_method_configuration: Option<String>,
451    #[serde(skip_serializing_if = "Option::is_none")]
452    payment_method_data: Option<CreateCheckoutSessionPaymentMethodData>,
453    #[serde(skip_serializing_if = "Option::is_none")]
454    payment_method_options: Option<CreateCheckoutSessionPaymentMethodOptions>,
455    #[serde(skip_serializing_if = "Option::is_none")]
456    payment_method_types: Option<Vec<CreateCheckoutSessionPaymentMethodTypes>>,
457    #[serde(skip_serializing_if = "Option::is_none")]
458    permissions: Option<CreateCheckoutSessionPermissions>,
459    #[serde(skip_serializing_if = "Option::is_none")]
460    phone_number_collection: Option<CreateCheckoutSessionPhoneNumberCollection>,
461    #[serde(skip_serializing_if = "Option::is_none")]
462    redirect_on_completion: Option<stripe_shared::CheckoutSessionRedirectOnCompletion>,
463    #[serde(skip_serializing_if = "Option::is_none")]
464    return_url: Option<String>,
465    #[serde(skip_serializing_if = "Option::is_none")]
466    saved_payment_method_options: Option<CreateCheckoutSessionSavedPaymentMethodOptions>,
467    #[serde(skip_serializing_if = "Option::is_none")]
468    setup_intent_data: Option<CreateCheckoutSessionSetupIntentData>,
469    #[serde(skip_serializing_if = "Option::is_none")]
470    shipping_address_collection: Option<CreateCheckoutSessionShippingAddressCollection>,
471    #[serde(skip_serializing_if = "Option::is_none")]
472    shipping_options: Option<Vec<CreateCheckoutSessionShippingOptions>>,
473    #[serde(skip_serializing_if = "Option::is_none")]
474    submit_type: Option<stripe_shared::CheckoutSessionSubmitType>,
475    #[serde(skip_serializing_if = "Option::is_none")]
476    subscription_data: Option<CreateCheckoutSessionSubscriptionData>,
477    #[serde(skip_serializing_if = "Option::is_none")]
478    success_url: Option<String>,
479    #[serde(skip_serializing_if = "Option::is_none")]
480    tax_id_collection: Option<CreateCheckoutSessionTaxIdCollection>,
481    #[serde(skip_serializing_if = "Option::is_none")]
482    ui_mode: Option<stripe_shared::CheckoutSessionUiMode>,
483    #[serde(skip_serializing_if = "Option::is_none")]
484    wallet_options: Option<CreateCheckoutSessionWalletOptions>,
485}
486#[cfg(feature = "redact-generated-debug")]
487impl std::fmt::Debug for CreateCheckoutSessionBuilder {
488    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
489        f.debug_struct("CreateCheckoutSessionBuilder").finish_non_exhaustive()
490    }
491}
492impl CreateCheckoutSessionBuilder {
493    fn new() -> Self {
494        Self {
495            adaptive_pricing: None,
496            after_expiration: None,
497            allow_promotion_codes: None,
498            automatic_tax: None,
499            billing_address_collection: None,
500            branding_settings: None,
501            cancel_url: None,
502            client_reference_id: None,
503            consent_collection: None,
504            currency: None,
505            custom_fields: None,
506            custom_text: None,
507            customer: None,
508            customer_account: None,
509            customer_creation: None,
510            customer_email: None,
511            customer_update: None,
512            discounts: None,
513            excluded_payment_method_types: None,
514            expand: None,
515            expires_at: None,
516            integration_identifier: None,
517            invoice_creation: None,
518            line_items: None,
519            locale: None,
520            managed_payments: None,
521            metadata: None,
522            mode: None,
523            name_collection: None,
524            optional_items: None,
525            origin_context: None,
526            payment_intent_data: None,
527            payment_method_collection: None,
528            payment_method_configuration: None,
529            payment_method_data: None,
530            payment_method_options: None,
531            payment_method_types: None,
532            permissions: None,
533            phone_number_collection: None,
534            redirect_on_completion: None,
535            return_url: None,
536            saved_payment_method_options: None,
537            setup_intent_data: None,
538            shipping_address_collection: None,
539            shipping_options: None,
540            submit_type: None,
541            subscription_data: None,
542            success_url: None,
543            tax_id_collection: None,
544            ui_mode: None,
545            wallet_options: None,
546        }
547    }
548}
549/// Settings for price localization with [Adaptive Pricing](https://docs.stripe.com/payments/checkout/adaptive-pricing).
550#[derive(Copy, Clone, Eq, PartialEq)]
551#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
552#[derive(serde::Serialize)]
553pub struct CreateCheckoutSessionAdaptivePricing {
554    /// If set to `true`, Adaptive Pricing is available on [eligible sessions](https://docs.stripe.com/payments/currencies/localize-prices/adaptive-pricing?payment-ui=stripe-hosted#restrictions).
555    /// Defaults to your [dashboard setting](https://dashboard.stripe.com/settings/adaptive-pricing).
556    #[serde(skip_serializing_if = "Option::is_none")]
557    pub enabled: Option<bool>,
558}
559#[cfg(feature = "redact-generated-debug")]
560impl std::fmt::Debug for CreateCheckoutSessionAdaptivePricing {
561    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
562        f.debug_struct("CreateCheckoutSessionAdaptivePricing").finish_non_exhaustive()
563    }
564}
565impl CreateCheckoutSessionAdaptivePricing {
566    pub fn new() -> Self {
567        Self { enabled: None }
568    }
569}
570impl Default for CreateCheckoutSessionAdaptivePricing {
571    fn default() -> Self {
572        Self::new()
573    }
574}
575/// Configure actions after a Checkout Session has expired.
576/// You can't set this parameter if `ui_mode` is `elements`.
577#[derive(Copy, Clone, Eq, PartialEq)]
578#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
579#[derive(serde::Serialize)]
580pub struct CreateCheckoutSessionAfterExpiration {
581    /// Configure a Checkout Session that can be used to recover an expired session.
582    #[serde(skip_serializing_if = "Option::is_none")]
583    pub recovery: Option<CreateCheckoutSessionAfterExpirationRecovery>,
584}
585#[cfg(feature = "redact-generated-debug")]
586impl std::fmt::Debug for CreateCheckoutSessionAfterExpiration {
587    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
588        f.debug_struct("CreateCheckoutSessionAfterExpiration").finish_non_exhaustive()
589    }
590}
591impl CreateCheckoutSessionAfterExpiration {
592    pub fn new() -> Self {
593        Self { recovery: None }
594    }
595}
596impl Default for CreateCheckoutSessionAfterExpiration {
597    fn default() -> Self {
598        Self::new()
599    }
600}
601/// Configure a Checkout Session that can be used to recover an expired session.
602#[derive(Copy, Clone, Eq, PartialEq)]
603#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
604#[derive(serde::Serialize)]
605pub struct CreateCheckoutSessionAfterExpirationRecovery {
606    /// Enables user redeemable promotion codes on the recovered Checkout Sessions. Defaults to `false`
607    #[serde(skip_serializing_if = "Option::is_none")]
608    pub allow_promotion_codes: Option<bool>,
609    /// If `true`, a recovery URL will be generated to recover this Checkout Session if it
610    /// expires before a successful transaction is completed. It will be attached to the
611    /// Checkout Session object upon expiration.
612    pub enabled: bool,
613}
614#[cfg(feature = "redact-generated-debug")]
615impl std::fmt::Debug for CreateCheckoutSessionAfterExpirationRecovery {
616    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
617        f.debug_struct("CreateCheckoutSessionAfterExpirationRecovery").finish_non_exhaustive()
618    }
619}
620impl CreateCheckoutSessionAfterExpirationRecovery {
621    pub fn new(enabled: impl Into<bool>) -> Self {
622        Self { allow_promotion_codes: None, enabled: enabled.into() }
623    }
624}
625/// Settings for automatic tax lookup for this session and resulting payments, invoices, and subscriptions.
626#[derive(Clone, Eq, PartialEq)]
627#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
628#[derive(serde::Serialize)]
629pub struct CreateCheckoutSessionAutomaticTax {
630    /// Set to `true` to [calculate tax automatically](https://docs.stripe.com/tax) using the customer's location.
631    ///
632    /// Enabling this parameter causes Checkout to collect any billing address information necessary for tax calculation.
633    pub enabled: bool,
634    /// The account that's liable for tax.
635    /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account.
636    /// The tax transaction is returned in the report of the connected account.
637    #[serde(skip_serializing_if = "Option::is_none")]
638    pub liability: Option<CreateCheckoutSessionAutomaticTaxLiability>,
639}
640#[cfg(feature = "redact-generated-debug")]
641impl std::fmt::Debug for CreateCheckoutSessionAutomaticTax {
642    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
643        f.debug_struct("CreateCheckoutSessionAutomaticTax").finish_non_exhaustive()
644    }
645}
646impl CreateCheckoutSessionAutomaticTax {
647    pub fn new(enabled: impl Into<bool>) -> Self {
648        Self { enabled: enabled.into(), liability: None }
649    }
650}
651/// The account that's liable for tax.
652/// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account.
653/// The tax transaction is returned in the report of the connected account.
654#[derive(Clone, Eq, PartialEq)]
655#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
656#[derive(serde::Serialize)]
657pub struct CreateCheckoutSessionAutomaticTaxLiability {
658    /// The connected account being referenced when `type` is `account`.
659    #[serde(skip_serializing_if = "Option::is_none")]
660    pub account: Option<String>,
661    /// Type of the account referenced in the request.
662    #[serde(rename = "type")]
663    pub type_: CreateCheckoutSessionAutomaticTaxLiabilityType,
664}
665#[cfg(feature = "redact-generated-debug")]
666impl std::fmt::Debug for CreateCheckoutSessionAutomaticTaxLiability {
667    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
668        f.debug_struct("CreateCheckoutSessionAutomaticTaxLiability").finish_non_exhaustive()
669    }
670}
671impl CreateCheckoutSessionAutomaticTaxLiability {
672    pub fn new(type_: impl Into<CreateCheckoutSessionAutomaticTaxLiabilityType>) -> Self {
673        Self { account: None, type_: type_.into() }
674    }
675}
676/// Type of the account referenced in the request.
677#[derive(Clone, Eq, PartialEq)]
678#[non_exhaustive]
679pub enum CreateCheckoutSessionAutomaticTaxLiabilityType {
680    Account,
681    Self_,
682    /// An unrecognized value from Stripe. Should not be used as a request parameter.
683    Unknown(String),
684}
685impl CreateCheckoutSessionAutomaticTaxLiabilityType {
686    pub fn as_str(&self) -> &str {
687        use CreateCheckoutSessionAutomaticTaxLiabilityType::*;
688        match self {
689            Account => "account",
690            Self_ => "self",
691            Unknown(v) => v,
692        }
693    }
694}
695
696impl std::str::FromStr for CreateCheckoutSessionAutomaticTaxLiabilityType {
697    type Err = std::convert::Infallible;
698    fn from_str(s: &str) -> Result<Self, Self::Err> {
699        use CreateCheckoutSessionAutomaticTaxLiabilityType::*;
700        match s {
701            "account" => Ok(Account),
702            "self" => Ok(Self_),
703            v => {
704                tracing::warn!(
705                    "Unknown value '{}' for enum '{}'",
706                    v,
707                    "CreateCheckoutSessionAutomaticTaxLiabilityType"
708                );
709                Ok(Unknown(v.to_owned()))
710            }
711        }
712    }
713}
714impl std::fmt::Display for CreateCheckoutSessionAutomaticTaxLiabilityType {
715    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
716        f.write_str(self.as_str())
717    }
718}
719
720#[cfg(not(feature = "redact-generated-debug"))]
721impl std::fmt::Debug for CreateCheckoutSessionAutomaticTaxLiabilityType {
722    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
723        f.write_str(self.as_str())
724    }
725}
726#[cfg(feature = "redact-generated-debug")]
727impl std::fmt::Debug for CreateCheckoutSessionAutomaticTaxLiabilityType {
728    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
729        f.debug_struct(stringify!(CreateCheckoutSessionAutomaticTaxLiabilityType))
730            .finish_non_exhaustive()
731    }
732}
733impl serde::Serialize for CreateCheckoutSessionAutomaticTaxLiabilityType {
734    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
735    where
736        S: serde::Serializer,
737    {
738        serializer.serialize_str(self.as_str())
739    }
740}
741#[cfg(feature = "deserialize")]
742impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionAutomaticTaxLiabilityType {
743    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
744        use std::str::FromStr;
745        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
746        Ok(Self::from_str(&s).expect("infallible"))
747    }
748}
749/// The branding settings for the Checkout Session.
750/// This parameter is not allowed if ui_mode is `elements`.
751#[derive(Clone, Eq, PartialEq)]
752#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
753#[derive(serde::Serialize)]
754pub struct CreateCheckoutSessionBrandingSettings {
755    /// A hex color value starting with `#` representing the background color for the Checkout Session.
756    #[serde(skip_serializing_if = "Option::is_none")]
757    pub background_color: Option<String>,
758    /// The border style for the Checkout Session.
759    #[serde(skip_serializing_if = "Option::is_none")]
760    pub border_style: Option<CreateCheckoutSessionBrandingSettingsBorderStyle>,
761    /// A hex color value starting with `#` representing the button color for the Checkout Session.
762    #[serde(skip_serializing_if = "Option::is_none")]
763    pub button_color: Option<String>,
764    /// A string to override the business name shown on the Checkout Session.
765    /// This only shows at the top of the Checkout page, and your business name still appears in terms, receipts, and other places.
766    #[serde(skip_serializing_if = "Option::is_none")]
767    pub display_name: Option<String>,
768    /// The font family for the Checkout Session corresponding to one of the [supported font families](https://docs.stripe.com/payments/checkout/customization/appearance?payment-ui=stripe-hosted#font-compatibility).
769    #[serde(skip_serializing_if = "Option::is_none")]
770    pub font_family: Option<CreateCheckoutSessionBrandingSettingsFontFamily>,
771    /// The icon for the Checkout Session. For best results, use a square image.
772    #[serde(skip_serializing_if = "Option::is_none")]
773    pub icon: Option<CreateCheckoutSessionBrandingSettingsIcon>,
774    /// The logo for the Checkout Session.
775    #[serde(skip_serializing_if = "Option::is_none")]
776    pub logo: Option<CreateCheckoutSessionBrandingSettingsLogo>,
777}
778#[cfg(feature = "redact-generated-debug")]
779impl std::fmt::Debug for CreateCheckoutSessionBrandingSettings {
780    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
781        f.debug_struct("CreateCheckoutSessionBrandingSettings").finish_non_exhaustive()
782    }
783}
784impl CreateCheckoutSessionBrandingSettings {
785    pub fn new() -> Self {
786        Self {
787            background_color: None,
788            border_style: None,
789            button_color: None,
790            display_name: None,
791            font_family: None,
792            icon: None,
793            logo: None,
794        }
795    }
796}
797impl Default for CreateCheckoutSessionBrandingSettings {
798    fn default() -> Self {
799        Self::new()
800    }
801}
802/// The border style for the Checkout Session.
803#[derive(Clone, Eq, PartialEq)]
804#[non_exhaustive]
805pub enum CreateCheckoutSessionBrandingSettingsBorderStyle {
806    Pill,
807    Rectangular,
808    Rounded,
809    /// An unrecognized value from Stripe. Should not be used as a request parameter.
810    Unknown(String),
811}
812impl CreateCheckoutSessionBrandingSettingsBorderStyle {
813    pub fn as_str(&self) -> &str {
814        use CreateCheckoutSessionBrandingSettingsBorderStyle::*;
815        match self {
816            Pill => "pill",
817            Rectangular => "rectangular",
818            Rounded => "rounded",
819            Unknown(v) => v,
820        }
821    }
822}
823
824impl std::str::FromStr for CreateCheckoutSessionBrandingSettingsBorderStyle {
825    type Err = std::convert::Infallible;
826    fn from_str(s: &str) -> Result<Self, Self::Err> {
827        use CreateCheckoutSessionBrandingSettingsBorderStyle::*;
828        match s {
829            "pill" => Ok(Pill),
830            "rectangular" => Ok(Rectangular),
831            "rounded" => Ok(Rounded),
832            v => {
833                tracing::warn!(
834                    "Unknown value '{}' for enum '{}'",
835                    v,
836                    "CreateCheckoutSessionBrandingSettingsBorderStyle"
837                );
838                Ok(Unknown(v.to_owned()))
839            }
840        }
841    }
842}
843impl std::fmt::Display for CreateCheckoutSessionBrandingSettingsBorderStyle {
844    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
845        f.write_str(self.as_str())
846    }
847}
848
849#[cfg(not(feature = "redact-generated-debug"))]
850impl std::fmt::Debug for CreateCheckoutSessionBrandingSettingsBorderStyle {
851    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
852        f.write_str(self.as_str())
853    }
854}
855#[cfg(feature = "redact-generated-debug")]
856impl std::fmt::Debug for CreateCheckoutSessionBrandingSettingsBorderStyle {
857    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
858        f.debug_struct(stringify!(CreateCheckoutSessionBrandingSettingsBorderStyle))
859            .finish_non_exhaustive()
860    }
861}
862impl serde::Serialize for CreateCheckoutSessionBrandingSettingsBorderStyle {
863    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
864    where
865        S: serde::Serializer,
866    {
867        serializer.serialize_str(self.as_str())
868    }
869}
870#[cfg(feature = "deserialize")]
871impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionBrandingSettingsBorderStyle {
872    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
873        use std::str::FromStr;
874        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
875        Ok(Self::from_str(&s).expect("infallible"))
876    }
877}
878/// The font family for the Checkout Session corresponding to one of the [supported font families](https://docs.stripe.com/payments/checkout/customization/appearance?payment-ui=stripe-hosted#font-compatibility).
879#[derive(Clone, Eq, PartialEq)]
880#[non_exhaustive]
881pub enum CreateCheckoutSessionBrandingSettingsFontFamily {
882    BeVietnamPro,
883    Bitter,
884    ChakraPetch,
885    Default,
886    Hahmlet,
887    Inconsolata,
888    Inter,
889    Lato,
890    Lora,
891    MPlus1Code,
892    Montserrat,
893    NotoSans,
894    NotoSansJp,
895    NotoSerif,
896    Nunito,
897    OpenSans,
898    Pridi,
899    PtSans,
900    PtSerif,
901    Raleway,
902    Roboto,
903    RobotoSlab,
904    SourceSansPro,
905    TitilliumWeb,
906    UbuntuMono,
907    ZenMaruGothic,
908    /// An unrecognized value from Stripe. Should not be used as a request parameter.
909    Unknown(String),
910}
911impl CreateCheckoutSessionBrandingSettingsFontFamily {
912    pub fn as_str(&self) -> &str {
913        use CreateCheckoutSessionBrandingSettingsFontFamily::*;
914        match self {
915            BeVietnamPro => "be_vietnam_pro",
916            Bitter => "bitter",
917            ChakraPetch => "chakra_petch",
918            Default => "default",
919            Hahmlet => "hahmlet",
920            Inconsolata => "inconsolata",
921            Inter => "inter",
922            Lato => "lato",
923            Lora => "lora",
924            MPlus1Code => "m_plus_1_code",
925            Montserrat => "montserrat",
926            NotoSans => "noto_sans",
927            NotoSansJp => "noto_sans_jp",
928            NotoSerif => "noto_serif",
929            Nunito => "nunito",
930            OpenSans => "open_sans",
931            Pridi => "pridi",
932            PtSans => "pt_sans",
933            PtSerif => "pt_serif",
934            Raleway => "raleway",
935            Roboto => "roboto",
936            RobotoSlab => "roboto_slab",
937            SourceSansPro => "source_sans_pro",
938            TitilliumWeb => "titillium_web",
939            UbuntuMono => "ubuntu_mono",
940            ZenMaruGothic => "zen_maru_gothic",
941            Unknown(v) => v,
942        }
943    }
944}
945
946impl std::str::FromStr for CreateCheckoutSessionBrandingSettingsFontFamily {
947    type Err = std::convert::Infallible;
948    fn from_str(s: &str) -> Result<Self, Self::Err> {
949        use CreateCheckoutSessionBrandingSettingsFontFamily::*;
950        match s {
951            "be_vietnam_pro" => Ok(BeVietnamPro),
952            "bitter" => Ok(Bitter),
953            "chakra_petch" => Ok(ChakraPetch),
954            "default" => Ok(Default),
955            "hahmlet" => Ok(Hahmlet),
956            "inconsolata" => Ok(Inconsolata),
957            "inter" => Ok(Inter),
958            "lato" => Ok(Lato),
959            "lora" => Ok(Lora),
960            "m_plus_1_code" => Ok(MPlus1Code),
961            "montserrat" => Ok(Montserrat),
962            "noto_sans" => Ok(NotoSans),
963            "noto_sans_jp" => Ok(NotoSansJp),
964            "noto_serif" => Ok(NotoSerif),
965            "nunito" => Ok(Nunito),
966            "open_sans" => Ok(OpenSans),
967            "pridi" => Ok(Pridi),
968            "pt_sans" => Ok(PtSans),
969            "pt_serif" => Ok(PtSerif),
970            "raleway" => Ok(Raleway),
971            "roboto" => Ok(Roboto),
972            "roboto_slab" => Ok(RobotoSlab),
973            "source_sans_pro" => Ok(SourceSansPro),
974            "titillium_web" => Ok(TitilliumWeb),
975            "ubuntu_mono" => Ok(UbuntuMono),
976            "zen_maru_gothic" => Ok(ZenMaruGothic),
977            v => {
978                tracing::warn!(
979                    "Unknown value '{}' for enum '{}'",
980                    v,
981                    "CreateCheckoutSessionBrandingSettingsFontFamily"
982                );
983                Ok(Unknown(v.to_owned()))
984            }
985        }
986    }
987}
988impl std::fmt::Display for CreateCheckoutSessionBrandingSettingsFontFamily {
989    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
990        f.write_str(self.as_str())
991    }
992}
993
994#[cfg(not(feature = "redact-generated-debug"))]
995impl std::fmt::Debug for CreateCheckoutSessionBrandingSettingsFontFamily {
996    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
997        f.write_str(self.as_str())
998    }
999}
1000#[cfg(feature = "redact-generated-debug")]
1001impl std::fmt::Debug for CreateCheckoutSessionBrandingSettingsFontFamily {
1002    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1003        f.debug_struct(stringify!(CreateCheckoutSessionBrandingSettingsFontFamily))
1004            .finish_non_exhaustive()
1005    }
1006}
1007impl serde::Serialize for CreateCheckoutSessionBrandingSettingsFontFamily {
1008    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1009    where
1010        S: serde::Serializer,
1011    {
1012        serializer.serialize_str(self.as_str())
1013    }
1014}
1015#[cfg(feature = "deserialize")]
1016impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionBrandingSettingsFontFamily {
1017    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1018        use std::str::FromStr;
1019        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1020        Ok(Self::from_str(&s).expect("infallible"))
1021    }
1022}
1023/// The icon for the Checkout Session. For best results, use a square image.
1024#[derive(Clone, Eq, PartialEq)]
1025#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
1026#[derive(serde::Serialize)]
1027pub struct CreateCheckoutSessionBrandingSettingsIcon {
1028    /// The ID of a [File upload](https://stripe.com/docs/api/files) representing the icon.
1029    /// Purpose must be `business_icon`.
1030    /// Required if `type` is `file` and disallowed otherwise.
1031    #[serde(skip_serializing_if = "Option::is_none")]
1032    pub file: Option<String>,
1033    /// The type of image for the icon. Must be one of `file` or `url`.
1034    #[serde(rename = "type")]
1035    pub type_: CreateCheckoutSessionBrandingSettingsIconType,
1036    /// The URL of the image. Required if `type` is `url` and disallowed otherwise.
1037    #[serde(skip_serializing_if = "Option::is_none")]
1038    pub url: Option<String>,
1039}
1040#[cfg(feature = "redact-generated-debug")]
1041impl std::fmt::Debug for CreateCheckoutSessionBrandingSettingsIcon {
1042    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1043        f.debug_struct("CreateCheckoutSessionBrandingSettingsIcon").finish_non_exhaustive()
1044    }
1045}
1046impl CreateCheckoutSessionBrandingSettingsIcon {
1047    pub fn new(type_: impl Into<CreateCheckoutSessionBrandingSettingsIconType>) -> Self {
1048        Self { file: None, type_: type_.into(), url: None }
1049    }
1050}
1051/// The type of image for the icon. Must be one of `file` or `url`.
1052#[derive(Clone, Eq, PartialEq)]
1053#[non_exhaustive]
1054pub enum CreateCheckoutSessionBrandingSettingsIconType {
1055    File,
1056    Url,
1057    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1058    Unknown(String),
1059}
1060impl CreateCheckoutSessionBrandingSettingsIconType {
1061    pub fn as_str(&self) -> &str {
1062        use CreateCheckoutSessionBrandingSettingsIconType::*;
1063        match self {
1064            File => "file",
1065            Url => "url",
1066            Unknown(v) => v,
1067        }
1068    }
1069}
1070
1071impl std::str::FromStr for CreateCheckoutSessionBrandingSettingsIconType {
1072    type Err = std::convert::Infallible;
1073    fn from_str(s: &str) -> Result<Self, Self::Err> {
1074        use CreateCheckoutSessionBrandingSettingsIconType::*;
1075        match s {
1076            "file" => Ok(File),
1077            "url" => Ok(Url),
1078            v => {
1079                tracing::warn!(
1080                    "Unknown value '{}' for enum '{}'",
1081                    v,
1082                    "CreateCheckoutSessionBrandingSettingsIconType"
1083                );
1084                Ok(Unknown(v.to_owned()))
1085            }
1086        }
1087    }
1088}
1089impl std::fmt::Display for CreateCheckoutSessionBrandingSettingsIconType {
1090    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1091        f.write_str(self.as_str())
1092    }
1093}
1094
1095#[cfg(not(feature = "redact-generated-debug"))]
1096impl std::fmt::Debug for CreateCheckoutSessionBrandingSettingsIconType {
1097    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1098        f.write_str(self.as_str())
1099    }
1100}
1101#[cfg(feature = "redact-generated-debug")]
1102impl std::fmt::Debug for CreateCheckoutSessionBrandingSettingsIconType {
1103    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1104        f.debug_struct(stringify!(CreateCheckoutSessionBrandingSettingsIconType))
1105            .finish_non_exhaustive()
1106    }
1107}
1108impl serde::Serialize for CreateCheckoutSessionBrandingSettingsIconType {
1109    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1110    where
1111        S: serde::Serializer,
1112    {
1113        serializer.serialize_str(self.as_str())
1114    }
1115}
1116#[cfg(feature = "deserialize")]
1117impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionBrandingSettingsIconType {
1118    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1119        use std::str::FromStr;
1120        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1121        Ok(Self::from_str(&s).expect("infallible"))
1122    }
1123}
1124/// The logo for the Checkout Session.
1125#[derive(Clone, Eq, PartialEq)]
1126#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
1127#[derive(serde::Serialize)]
1128pub struct CreateCheckoutSessionBrandingSettingsLogo {
1129    /// The ID of a [File upload](https://stripe.com/docs/api/files) representing the logo.
1130    /// Purpose must be `business_logo`.
1131    /// Required if `type` is `file` and disallowed otherwise.
1132    #[serde(skip_serializing_if = "Option::is_none")]
1133    pub file: Option<String>,
1134    /// The type of image for the logo. Must be one of `file` or `url`.
1135    #[serde(rename = "type")]
1136    pub type_: CreateCheckoutSessionBrandingSettingsLogoType,
1137    /// The URL of the image. Required if `type` is `url` and disallowed otherwise.
1138    #[serde(skip_serializing_if = "Option::is_none")]
1139    pub url: Option<String>,
1140}
1141#[cfg(feature = "redact-generated-debug")]
1142impl std::fmt::Debug for CreateCheckoutSessionBrandingSettingsLogo {
1143    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1144        f.debug_struct("CreateCheckoutSessionBrandingSettingsLogo").finish_non_exhaustive()
1145    }
1146}
1147impl CreateCheckoutSessionBrandingSettingsLogo {
1148    pub fn new(type_: impl Into<CreateCheckoutSessionBrandingSettingsLogoType>) -> Self {
1149        Self { file: None, type_: type_.into(), url: None }
1150    }
1151}
1152/// The type of image for the logo. Must be one of `file` or `url`.
1153#[derive(Clone, Eq, PartialEq)]
1154#[non_exhaustive]
1155pub enum CreateCheckoutSessionBrandingSettingsLogoType {
1156    File,
1157    Url,
1158    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1159    Unknown(String),
1160}
1161impl CreateCheckoutSessionBrandingSettingsLogoType {
1162    pub fn as_str(&self) -> &str {
1163        use CreateCheckoutSessionBrandingSettingsLogoType::*;
1164        match self {
1165            File => "file",
1166            Url => "url",
1167            Unknown(v) => v,
1168        }
1169    }
1170}
1171
1172impl std::str::FromStr for CreateCheckoutSessionBrandingSettingsLogoType {
1173    type Err = std::convert::Infallible;
1174    fn from_str(s: &str) -> Result<Self, Self::Err> {
1175        use CreateCheckoutSessionBrandingSettingsLogoType::*;
1176        match s {
1177            "file" => Ok(File),
1178            "url" => Ok(Url),
1179            v => {
1180                tracing::warn!(
1181                    "Unknown value '{}' for enum '{}'",
1182                    v,
1183                    "CreateCheckoutSessionBrandingSettingsLogoType"
1184                );
1185                Ok(Unknown(v.to_owned()))
1186            }
1187        }
1188    }
1189}
1190impl std::fmt::Display for CreateCheckoutSessionBrandingSettingsLogoType {
1191    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1192        f.write_str(self.as_str())
1193    }
1194}
1195
1196#[cfg(not(feature = "redact-generated-debug"))]
1197impl std::fmt::Debug for CreateCheckoutSessionBrandingSettingsLogoType {
1198    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1199        f.write_str(self.as_str())
1200    }
1201}
1202#[cfg(feature = "redact-generated-debug")]
1203impl std::fmt::Debug for CreateCheckoutSessionBrandingSettingsLogoType {
1204    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1205        f.debug_struct(stringify!(CreateCheckoutSessionBrandingSettingsLogoType))
1206            .finish_non_exhaustive()
1207    }
1208}
1209impl serde::Serialize for CreateCheckoutSessionBrandingSettingsLogoType {
1210    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1211    where
1212        S: serde::Serializer,
1213    {
1214        serializer.serialize_str(self.as_str())
1215    }
1216}
1217#[cfg(feature = "deserialize")]
1218impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionBrandingSettingsLogoType {
1219    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1220        use std::str::FromStr;
1221        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1222        Ok(Self::from_str(&s).expect("infallible"))
1223    }
1224}
1225/// Configure fields for the Checkout Session to gather active consent from customers.
1226#[derive(Clone, Eq, PartialEq)]
1227#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
1228#[derive(serde::Serialize)]
1229pub struct CreateCheckoutSessionConsentCollection {
1230    /// Determines the display of payment method reuse agreement text in the UI.
1231    /// If set to `hidden`, it will hide legal text related to the reuse of a payment method.
1232    #[serde(skip_serializing_if = "Option::is_none")]
1233    pub payment_method_reuse_agreement:
1234        Option<CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreement>,
1235    /// If set to `auto`, enables the collection of customer consent for promotional communications.
1236    /// The Checkout.
1237    /// Session will determine whether to display an option to opt into promotional communication
1238    /// from the merchant depending on the customer's locale.
1239    /// Only available to US merchants and US customers.
1240    #[serde(skip_serializing_if = "Option::is_none")]
1241    pub promotions: Option<CreateCheckoutSessionConsentCollectionPromotions>,
1242    /// If set to `required`, it requires customers to check a terms of service checkbox before being able to pay.
1243    /// There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public).
1244    #[serde(skip_serializing_if = "Option::is_none")]
1245    pub terms_of_service: Option<CreateCheckoutSessionConsentCollectionTermsOfService>,
1246}
1247#[cfg(feature = "redact-generated-debug")]
1248impl std::fmt::Debug for CreateCheckoutSessionConsentCollection {
1249    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1250        f.debug_struct("CreateCheckoutSessionConsentCollection").finish_non_exhaustive()
1251    }
1252}
1253impl CreateCheckoutSessionConsentCollection {
1254    pub fn new() -> Self {
1255        Self { payment_method_reuse_agreement: None, promotions: None, terms_of_service: None }
1256    }
1257}
1258impl Default for CreateCheckoutSessionConsentCollection {
1259    fn default() -> Self {
1260        Self::new()
1261    }
1262}
1263/// Determines the display of payment method reuse agreement text in the UI.
1264/// If set to `hidden`, it will hide legal text related to the reuse of a payment method.
1265#[derive(Clone, Eq, PartialEq)]
1266#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
1267#[derive(serde::Serialize)]
1268pub struct CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreement {
1269    /// Determines the position and visibility of the payment method reuse agreement in the UI.
1270    /// When set to `auto`, Stripe's.
1271    /// defaults will be used.
1272    /// When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI.
1273    pub position: CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition,
1274}
1275#[cfg(feature = "redact-generated-debug")]
1276impl std::fmt::Debug for CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreement {
1277    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1278        f.debug_struct("CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreement")
1279            .finish_non_exhaustive()
1280    }
1281}
1282impl CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreement {
1283    pub fn new(
1284        position: impl Into<CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition>,
1285    ) -> Self {
1286        Self { position: position.into() }
1287    }
1288}
1289/// Determines the position and visibility of the payment method reuse agreement in the UI.
1290/// When set to `auto`, Stripe's.
1291/// defaults will be used.
1292/// When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI.
1293#[derive(Clone, Eq, PartialEq)]
1294#[non_exhaustive]
1295pub enum CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition {
1296    Auto,
1297    Hidden,
1298    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1299    Unknown(String),
1300}
1301impl CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition {
1302    pub fn as_str(&self) -> &str {
1303        use CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition::*;
1304        match self {
1305            Auto => "auto",
1306            Hidden => "hidden",
1307            Unknown(v) => v,
1308        }
1309    }
1310}
1311
1312impl std::str::FromStr
1313    for CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition
1314{
1315    type Err = std::convert::Infallible;
1316    fn from_str(s: &str) -> Result<Self, Self::Err> {
1317        use CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition::*;
1318        match s {
1319            "auto" => Ok(Auto),
1320            "hidden" => Ok(Hidden),
1321            v => {
1322                tracing::warn!(
1323                    "Unknown value '{}' for enum '{}'",
1324                    v,
1325                    "CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition"
1326                );
1327                Ok(Unknown(v.to_owned()))
1328            }
1329        }
1330    }
1331}
1332impl std::fmt::Display
1333    for CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition
1334{
1335    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1336        f.write_str(self.as_str())
1337    }
1338}
1339
1340#[cfg(not(feature = "redact-generated-debug"))]
1341impl std::fmt::Debug for CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition {
1342    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1343        f.write_str(self.as_str())
1344    }
1345}
1346#[cfg(feature = "redact-generated-debug")]
1347impl std::fmt::Debug for CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition {
1348    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1349        f.debug_struct(stringify!(
1350            CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition
1351        ))
1352        .finish_non_exhaustive()
1353    }
1354}
1355impl serde::Serialize
1356    for CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition
1357{
1358    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1359    where
1360        S: serde::Serializer,
1361    {
1362        serializer.serialize_str(self.as_str())
1363    }
1364}
1365#[cfg(feature = "deserialize")]
1366impl<'de> serde::Deserialize<'de>
1367    for CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition
1368{
1369    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1370        use std::str::FromStr;
1371        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1372        Ok(Self::from_str(&s).expect("infallible"))
1373    }
1374}
1375/// If set to `auto`, enables the collection of customer consent for promotional communications.
1376/// The Checkout.
1377/// Session will determine whether to display an option to opt into promotional communication
1378/// from the merchant depending on the customer's locale.
1379/// Only available to US merchants and US customers.
1380#[derive(Clone, Eq, PartialEq)]
1381#[non_exhaustive]
1382pub enum CreateCheckoutSessionConsentCollectionPromotions {
1383    Auto,
1384    None,
1385    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1386    Unknown(String),
1387}
1388impl CreateCheckoutSessionConsentCollectionPromotions {
1389    pub fn as_str(&self) -> &str {
1390        use CreateCheckoutSessionConsentCollectionPromotions::*;
1391        match self {
1392            Auto => "auto",
1393            None => "none",
1394            Unknown(v) => v,
1395        }
1396    }
1397}
1398
1399impl std::str::FromStr for CreateCheckoutSessionConsentCollectionPromotions {
1400    type Err = std::convert::Infallible;
1401    fn from_str(s: &str) -> Result<Self, Self::Err> {
1402        use CreateCheckoutSessionConsentCollectionPromotions::*;
1403        match s {
1404            "auto" => Ok(Auto),
1405            "none" => Ok(None),
1406            v => {
1407                tracing::warn!(
1408                    "Unknown value '{}' for enum '{}'",
1409                    v,
1410                    "CreateCheckoutSessionConsentCollectionPromotions"
1411                );
1412                Ok(Unknown(v.to_owned()))
1413            }
1414        }
1415    }
1416}
1417impl std::fmt::Display for CreateCheckoutSessionConsentCollectionPromotions {
1418    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1419        f.write_str(self.as_str())
1420    }
1421}
1422
1423#[cfg(not(feature = "redact-generated-debug"))]
1424impl std::fmt::Debug for CreateCheckoutSessionConsentCollectionPromotions {
1425    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1426        f.write_str(self.as_str())
1427    }
1428}
1429#[cfg(feature = "redact-generated-debug")]
1430impl std::fmt::Debug for CreateCheckoutSessionConsentCollectionPromotions {
1431    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1432        f.debug_struct(stringify!(CreateCheckoutSessionConsentCollectionPromotions))
1433            .finish_non_exhaustive()
1434    }
1435}
1436impl serde::Serialize for CreateCheckoutSessionConsentCollectionPromotions {
1437    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1438    where
1439        S: serde::Serializer,
1440    {
1441        serializer.serialize_str(self.as_str())
1442    }
1443}
1444#[cfg(feature = "deserialize")]
1445impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionConsentCollectionPromotions {
1446    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1447        use std::str::FromStr;
1448        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1449        Ok(Self::from_str(&s).expect("infallible"))
1450    }
1451}
1452/// If set to `required`, it requires customers to check a terms of service checkbox before being able to pay.
1453/// There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public).
1454#[derive(Clone, Eq, PartialEq)]
1455#[non_exhaustive]
1456pub enum CreateCheckoutSessionConsentCollectionTermsOfService {
1457    None,
1458    Required,
1459    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1460    Unknown(String),
1461}
1462impl CreateCheckoutSessionConsentCollectionTermsOfService {
1463    pub fn as_str(&self) -> &str {
1464        use CreateCheckoutSessionConsentCollectionTermsOfService::*;
1465        match self {
1466            None => "none",
1467            Required => "required",
1468            Unknown(v) => v,
1469        }
1470    }
1471}
1472
1473impl std::str::FromStr for CreateCheckoutSessionConsentCollectionTermsOfService {
1474    type Err = std::convert::Infallible;
1475    fn from_str(s: &str) -> Result<Self, Self::Err> {
1476        use CreateCheckoutSessionConsentCollectionTermsOfService::*;
1477        match s {
1478            "none" => Ok(None),
1479            "required" => Ok(Required),
1480            v => {
1481                tracing::warn!(
1482                    "Unknown value '{}' for enum '{}'",
1483                    v,
1484                    "CreateCheckoutSessionConsentCollectionTermsOfService"
1485                );
1486                Ok(Unknown(v.to_owned()))
1487            }
1488        }
1489    }
1490}
1491impl std::fmt::Display for CreateCheckoutSessionConsentCollectionTermsOfService {
1492    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1493        f.write_str(self.as_str())
1494    }
1495}
1496
1497#[cfg(not(feature = "redact-generated-debug"))]
1498impl std::fmt::Debug for CreateCheckoutSessionConsentCollectionTermsOfService {
1499    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1500        f.write_str(self.as_str())
1501    }
1502}
1503#[cfg(feature = "redact-generated-debug")]
1504impl std::fmt::Debug for CreateCheckoutSessionConsentCollectionTermsOfService {
1505    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1506        f.debug_struct(stringify!(CreateCheckoutSessionConsentCollectionTermsOfService))
1507            .finish_non_exhaustive()
1508    }
1509}
1510impl serde::Serialize for CreateCheckoutSessionConsentCollectionTermsOfService {
1511    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1512    where
1513        S: serde::Serializer,
1514    {
1515        serializer.serialize_str(self.as_str())
1516    }
1517}
1518#[cfg(feature = "deserialize")]
1519impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionConsentCollectionTermsOfService {
1520    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1521        use std::str::FromStr;
1522        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1523        Ok(Self::from_str(&s).expect("infallible"))
1524    }
1525}
1526/// Collect additional information from your customer using custom fields.
1527/// Up to 3 fields are supported.
1528/// You can't set this parameter if `ui_mode` is `custom`.
1529#[derive(Clone, Eq, PartialEq)]
1530#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
1531#[derive(serde::Serialize)]
1532pub struct CreateCheckoutSessionCustomFields {
1533    /// Configuration for `type=dropdown` fields.
1534    #[serde(skip_serializing_if = "Option::is_none")]
1535    pub dropdown: Option<CreateCheckoutSessionCustomFieldsDropdown>,
1536    /// String of your choice that your integration can use to reconcile this field.
1537    /// Must be unique to this field, alphanumeric, and up to 200 characters.
1538    pub key: String,
1539    /// The label for the field, displayed to the customer.
1540    pub label: CreateCheckoutSessionCustomFieldsLabel,
1541    /// Configuration for `type=numeric` fields.
1542    #[serde(skip_serializing_if = "Option::is_none")]
1543    pub numeric: Option<CreateCheckoutSessionCustomFieldsNumeric>,
1544    /// Whether the customer is required to complete the field before completing the Checkout Session.
1545    /// Defaults to `false`.
1546    #[serde(skip_serializing_if = "Option::is_none")]
1547    pub optional: Option<bool>,
1548    /// Configuration for `type=text` fields.
1549    #[serde(skip_serializing_if = "Option::is_none")]
1550    pub text: Option<CreateCheckoutSessionCustomFieldsText>,
1551    /// The type of the field.
1552    #[serde(rename = "type")]
1553    pub type_: CreateCheckoutSessionCustomFieldsType,
1554}
1555#[cfg(feature = "redact-generated-debug")]
1556impl std::fmt::Debug for CreateCheckoutSessionCustomFields {
1557    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1558        f.debug_struct("CreateCheckoutSessionCustomFields").finish_non_exhaustive()
1559    }
1560}
1561impl CreateCheckoutSessionCustomFields {
1562    pub fn new(
1563        key: impl Into<String>,
1564        label: impl Into<CreateCheckoutSessionCustomFieldsLabel>,
1565        type_: impl Into<CreateCheckoutSessionCustomFieldsType>,
1566    ) -> Self {
1567        Self {
1568            dropdown: None,
1569            key: key.into(),
1570            label: label.into(),
1571            numeric: None,
1572            optional: None,
1573            text: None,
1574            type_: type_.into(),
1575        }
1576    }
1577}
1578/// Configuration for `type=dropdown` fields.
1579#[derive(Clone, Eq, PartialEq)]
1580#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
1581#[derive(serde::Serialize)]
1582pub struct CreateCheckoutSessionCustomFieldsDropdown {
1583    /// The value that pre-fills the field on the payment page.Must match a `value` in the `options` array.
1584    #[serde(skip_serializing_if = "Option::is_none")]
1585    pub default_value: Option<String>,
1586    /// The options available for the customer to select. Up to 200 options allowed.
1587    pub options: Vec<CreateCheckoutSessionCustomFieldsDropdownOptions>,
1588}
1589#[cfg(feature = "redact-generated-debug")]
1590impl std::fmt::Debug for CreateCheckoutSessionCustomFieldsDropdown {
1591    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1592        f.debug_struct("CreateCheckoutSessionCustomFieldsDropdown").finish_non_exhaustive()
1593    }
1594}
1595impl CreateCheckoutSessionCustomFieldsDropdown {
1596    pub fn new(options: impl Into<Vec<CreateCheckoutSessionCustomFieldsDropdownOptions>>) -> Self {
1597        Self { default_value: None, options: options.into() }
1598    }
1599}
1600/// The options available for the customer to select. Up to 200 options allowed.
1601#[derive(Clone, Eq, PartialEq)]
1602#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
1603#[derive(serde::Serialize)]
1604pub struct CreateCheckoutSessionCustomFieldsDropdownOptions {
1605    /// The label for the option, displayed to the customer. Up to 100 characters.
1606    pub label: String,
1607    /// The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer.
1608    /// Must be unique to this option, alphanumeric, and up to 100 characters.
1609    pub value: String,
1610}
1611#[cfg(feature = "redact-generated-debug")]
1612impl std::fmt::Debug for CreateCheckoutSessionCustomFieldsDropdownOptions {
1613    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1614        f.debug_struct("CreateCheckoutSessionCustomFieldsDropdownOptions").finish_non_exhaustive()
1615    }
1616}
1617impl CreateCheckoutSessionCustomFieldsDropdownOptions {
1618    pub fn new(label: impl Into<String>, value: impl Into<String>) -> Self {
1619        Self { label: label.into(), value: value.into() }
1620    }
1621}
1622/// The label for the field, displayed to the customer.
1623#[derive(Clone, Eq, PartialEq)]
1624#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
1625#[derive(serde::Serialize)]
1626pub struct CreateCheckoutSessionCustomFieldsLabel {
1627    /// Custom text for the label, displayed to the customer. Up to 50 characters.
1628    pub custom: String,
1629    /// The type of the label.
1630    #[serde(rename = "type")]
1631    pub type_: CreateCheckoutSessionCustomFieldsLabelType,
1632}
1633#[cfg(feature = "redact-generated-debug")]
1634impl std::fmt::Debug for CreateCheckoutSessionCustomFieldsLabel {
1635    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1636        f.debug_struct("CreateCheckoutSessionCustomFieldsLabel").finish_non_exhaustive()
1637    }
1638}
1639impl CreateCheckoutSessionCustomFieldsLabel {
1640    pub fn new(
1641        custom: impl Into<String>,
1642        type_: impl Into<CreateCheckoutSessionCustomFieldsLabelType>,
1643    ) -> Self {
1644        Self { custom: custom.into(), type_: type_.into() }
1645    }
1646}
1647/// The type of the label.
1648#[derive(Clone, Eq, PartialEq)]
1649#[non_exhaustive]
1650pub enum CreateCheckoutSessionCustomFieldsLabelType {
1651    Custom,
1652    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1653    Unknown(String),
1654}
1655impl CreateCheckoutSessionCustomFieldsLabelType {
1656    pub fn as_str(&self) -> &str {
1657        use CreateCheckoutSessionCustomFieldsLabelType::*;
1658        match self {
1659            Custom => "custom",
1660            Unknown(v) => v,
1661        }
1662    }
1663}
1664
1665impl std::str::FromStr for CreateCheckoutSessionCustomFieldsLabelType {
1666    type Err = std::convert::Infallible;
1667    fn from_str(s: &str) -> Result<Self, Self::Err> {
1668        use CreateCheckoutSessionCustomFieldsLabelType::*;
1669        match s {
1670            "custom" => Ok(Custom),
1671            v => {
1672                tracing::warn!(
1673                    "Unknown value '{}' for enum '{}'",
1674                    v,
1675                    "CreateCheckoutSessionCustomFieldsLabelType"
1676                );
1677                Ok(Unknown(v.to_owned()))
1678            }
1679        }
1680    }
1681}
1682impl std::fmt::Display for CreateCheckoutSessionCustomFieldsLabelType {
1683    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1684        f.write_str(self.as_str())
1685    }
1686}
1687
1688#[cfg(not(feature = "redact-generated-debug"))]
1689impl std::fmt::Debug for CreateCheckoutSessionCustomFieldsLabelType {
1690    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1691        f.write_str(self.as_str())
1692    }
1693}
1694#[cfg(feature = "redact-generated-debug")]
1695impl std::fmt::Debug for CreateCheckoutSessionCustomFieldsLabelType {
1696    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1697        f.debug_struct(stringify!(CreateCheckoutSessionCustomFieldsLabelType))
1698            .finish_non_exhaustive()
1699    }
1700}
1701impl serde::Serialize for CreateCheckoutSessionCustomFieldsLabelType {
1702    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1703    where
1704        S: serde::Serializer,
1705    {
1706        serializer.serialize_str(self.as_str())
1707    }
1708}
1709#[cfg(feature = "deserialize")]
1710impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionCustomFieldsLabelType {
1711    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1712        use std::str::FromStr;
1713        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1714        Ok(Self::from_str(&s).expect("infallible"))
1715    }
1716}
1717/// Configuration for `type=numeric` fields.
1718#[derive(Clone, Eq, PartialEq)]
1719#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
1720#[derive(serde::Serialize)]
1721pub struct CreateCheckoutSessionCustomFieldsNumeric {
1722    /// The value that pre-fills the field on the payment page.
1723    #[serde(skip_serializing_if = "Option::is_none")]
1724    pub default_value: Option<String>,
1725    /// The maximum character length constraint for the customer's input.
1726    #[serde(skip_serializing_if = "Option::is_none")]
1727    pub maximum_length: Option<i64>,
1728    /// The minimum character length requirement for the customer's input.
1729    #[serde(skip_serializing_if = "Option::is_none")]
1730    pub minimum_length: Option<i64>,
1731}
1732#[cfg(feature = "redact-generated-debug")]
1733impl std::fmt::Debug for CreateCheckoutSessionCustomFieldsNumeric {
1734    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1735        f.debug_struct("CreateCheckoutSessionCustomFieldsNumeric").finish_non_exhaustive()
1736    }
1737}
1738impl CreateCheckoutSessionCustomFieldsNumeric {
1739    pub fn new() -> Self {
1740        Self { default_value: None, maximum_length: None, minimum_length: None }
1741    }
1742}
1743impl Default for CreateCheckoutSessionCustomFieldsNumeric {
1744    fn default() -> Self {
1745        Self::new()
1746    }
1747}
1748/// Configuration for `type=text` fields.
1749#[derive(Clone, Eq, PartialEq)]
1750#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
1751#[derive(serde::Serialize)]
1752pub struct CreateCheckoutSessionCustomFieldsText {
1753    /// The value that pre-fills the field on the payment page.
1754    #[serde(skip_serializing_if = "Option::is_none")]
1755    pub default_value: Option<String>,
1756    /// The maximum character length constraint for the customer's input.
1757    #[serde(skip_serializing_if = "Option::is_none")]
1758    pub maximum_length: Option<i64>,
1759    /// The minimum character length requirement for the customer's input.
1760    #[serde(skip_serializing_if = "Option::is_none")]
1761    pub minimum_length: Option<i64>,
1762}
1763#[cfg(feature = "redact-generated-debug")]
1764impl std::fmt::Debug for CreateCheckoutSessionCustomFieldsText {
1765    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1766        f.debug_struct("CreateCheckoutSessionCustomFieldsText").finish_non_exhaustive()
1767    }
1768}
1769impl CreateCheckoutSessionCustomFieldsText {
1770    pub fn new() -> Self {
1771        Self { default_value: None, maximum_length: None, minimum_length: None }
1772    }
1773}
1774impl Default for CreateCheckoutSessionCustomFieldsText {
1775    fn default() -> Self {
1776        Self::new()
1777    }
1778}
1779/// The type of the field.
1780#[derive(Clone, Eq, PartialEq)]
1781#[non_exhaustive]
1782pub enum CreateCheckoutSessionCustomFieldsType {
1783    Dropdown,
1784    Numeric,
1785    Text,
1786    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1787    Unknown(String),
1788}
1789impl CreateCheckoutSessionCustomFieldsType {
1790    pub fn as_str(&self) -> &str {
1791        use CreateCheckoutSessionCustomFieldsType::*;
1792        match self {
1793            Dropdown => "dropdown",
1794            Numeric => "numeric",
1795            Text => "text",
1796            Unknown(v) => v,
1797        }
1798    }
1799}
1800
1801impl std::str::FromStr for CreateCheckoutSessionCustomFieldsType {
1802    type Err = std::convert::Infallible;
1803    fn from_str(s: &str) -> Result<Self, Self::Err> {
1804        use CreateCheckoutSessionCustomFieldsType::*;
1805        match s {
1806            "dropdown" => Ok(Dropdown),
1807            "numeric" => Ok(Numeric),
1808            "text" => Ok(Text),
1809            v => {
1810                tracing::warn!(
1811                    "Unknown value '{}' for enum '{}'",
1812                    v,
1813                    "CreateCheckoutSessionCustomFieldsType"
1814                );
1815                Ok(Unknown(v.to_owned()))
1816            }
1817        }
1818    }
1819}
1820impl std::fmt::Display for CreateCheckoutSessionCustomFieldsType {
1821    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1822        f.write_str(self.as_str())
1823    }
1824}
1825
1826#[cfg(not(feature = "redact-generated-debug"))]
1827impl std::fmt::Debug for CreateCheckoutSessionCustomFieldsType {
1828    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1829        f.write_str(self.as_str())
1830    }
1831}
1832#[cfg(feature = "redact-generated-debug")]
1833impl std::fmt::Debug for CreateCheckoutSessionCustomFieldsType {
1834    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1835        f.debug_struct(stringify!(CreateCheckoutSessionCustomFieldsType)).finish_non_exhaustive()
1836    }
1837}
1838impl serde::Serialize for CreateCheckoutSessionCustomFieldsType {
1839    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1840    where
1841        S: serde::Serializer,
1842    {
1843        serializer.serialize_str(self.as_str())
1844    }
1845}
1846#[cfg(feature = "deserialize")]
1847impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionCustomFieldsType {
1848    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1849        use std::str::FromStr;
1850        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1851        Ok(Self::from_str(&s).expect("infallible"))
1852    }
1853}
1854/// Display additional text for your customers using custom text.
1855/// You can't set this parameter if `ui_mode` is `custom`.
1856#[derive(Clone, Eq, PartialEq)]
1857#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
1858#[derive(serde::Serialize)]
1859pub struct CreateCheckoutSessionCustomText {
1860    /// Custom text that should be displayed after the payment confirmation button.
1861    #[serde(skip_serializing_if = "Option::is_none")]
1862    pub after_submit: Option<CustomTextPositionParam>,
1863    /// Custom text that should be displayed alongside shipping address collection.
1864    #[serde(skip_serializing_if = "Option::is_none")]
1865    pub shipping_address: Option<CustomTextPositionParam>,
1866    /// Custom text that should be displayed alongside the payment confirmation button.
1867    #[serde(skip_serializing_if = "Option::is_none")]
1868    pub submit: Option<CustomTextPositionParam>,
1869    /// Custom text that should be displayed in place of the default terms of service agreement text.
1870    #[serde(skip_serializing_if = "Option::is_none")]
1871    pub terms_of_service_acceptance: Option<CustomTextPositionParam>,
1872}
1873#[cfg(feature = "redact-generated-debug")]
1874impl std::fmt::Debug for CreateCheckoutSessionCustomText {
1875    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1876        f.debug_struct("CreateCheckoutSessionCustomText").finish_non_exhaustive()
1877    }
1878}
1879impl CreateCheckoutSessionCustomText {
1880    pub fn new() -> Self {
1881        Self {
1882            after_submit: None,
1883            shipping_address: None,
1884            submit: None,
1885            terms_of_service_acceptance: None,
1886        }
1887    }
1888}
1889impl Default for CreateCheckoutSessionCustomText {
1890    fn default() -> Self {
1891        Self::new()
1892    }
1893}
1894/// Configure whether a Checkout Session creates a [Customer](https://docs.stripe.com/api/customers) during Session confirmation.
1895///
1896/// When a Customer is not created, you can still retrieve email, address, and other customer data entered in Checkout.
1897/// with [customer_details](https://docs.stripe.com/api/checkout/sessions/object#checkout_session_object-customer_details).
1898///
1899/// Sessions that don't create Customers instead are grouped by [guest customers](https://docs.stripe.com/payments/checkout/guest-customers).
1900/// in the Dashboard.
1901/// Promotion codes limited to first time customers will return invalid for these Sessions.
1902///
1903/// Can only be set in `payment` and `setup` mode.
1904#[derive(Clone, Eq, PartialEq)]
1905#[non_exhaustive]
1906pub enum CreateCheckoutSessionCustomerCreation {
1907    Always,
1908    IfRequired,
1909    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1910    Unknown(String),
1911}
1912impl CreateCheckoutSessionCustomerCreation {
1913    pub fn as_str(&self) -> &str {
1914        use CreateCheckoutSessionCustomerCreation::*;
1915        match self {
1916            Always => "always",
1917            IfRequired => "if_required",
1918            Unknown(v) => v,
1919        }
1920    }
1921}
1922
1923impl std::str::FromStr for CreateCheckoutSessionCustomerCreation {
1924    type Err = std::convert::Infallible;
1925    fn from_str(s: &str) -> Result<Self, Self::Err> {
1926        use CreateCheckoutSessionCustomerCreation::*;
1927        match s {
1928            "always" => Ok(Always),
1929            "if_required" => Ok(IfRequired),
1930            v => {
1931                tracing::warn!(
1932                    "Unknown value '{}' for enum '{}'",
1933                    v,
1934                    "CreateCheckoutSessionCustomerCreation"
1935                );
1936                Ok(Unknown(v.to_owned()))
1937            }
1938        }
1939    }
1940}
1941impl std::fmt::Display for CreateCheckoutSessionCustomerCreation {
1942    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1943        f.write_str(self.as_str())
1944    }
1945}
1946
1947#[cfg(not(feature = "redact-generated-debug"))]
1948impl std::fmt::Debug for CreateCheckoutSessionCustomerCreation {
1949    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1950        f.write_str(self.as_str())
1951    }
1952}
1953#[cfg(feature = "redact-generated-debug")]
1954impl std::fmt::Debug for CreateCheckoutSessionCustomerCreation {
1955    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1956        f.debug_struct(stringify!(CreateCheckoutSessionCustomerCreation)).finish_non_exhaustive()
1957    }
1958}
1959impl serde::Serialize for CreateCheckoutSessionCustomerCreation {
1960    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1961    where
1962        S: serde::Serializer,
1963    {
1964        serializer.serialize_str(self.as_str())
1965    }
1966}
1967#[cfg(feature = "deserialize")]
1968impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionCustomerCreation {
1969    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1970        use std::str::FromStr;
1971        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1972        Ok(Self::from_str(&s).expect("infallible"))
1973    }
1974}
1975/// Controls what fields on Customer can be updated by the Checkout Session.
1976/// Can only be provided when `customer` is provided.
1977#[derive(Clone, Eq, PartialEq)]
1978#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
1979#[derive(serde::Serialize)]
1980pub struct CreateCheckoutSessionCustomerUpdate {
1981    /// Describes whether Checkout saves the billing address onto `customer.address`.
1982    /// To always collect a full billing address, use `billing_address_collection`. Defaults to `never`.
1983    #[serde(skip_serializing_if = "Option::is_none")]
1984    pub address: Option<CreateCheckoutSessionCustomerUpdateAddress>,
1985    /// Describes whether Checkout saves the name onto `customer.name`. Defaults to `never`.
1986    #[serde(skip_serializing_if = "Option::is_none")]
1987    pub name: Option<CreateCheckoutSessionCustomerUpdateName>,
1988    /// Describes whether Checkout saves shipping information onto `customer.shipping`.
1989    /// To collect shipping information, use `shipping_address_collection`. Defaults to `never`.
1990    #[serde(skip_serializing_if = "Option::is_none")]
1991    pub shipping: Option<CreateCheckoutSessionCustomerUpdateShipping>,
1992}
1993#[cfg(feature = "redact-generated-debug")]
1994impl std::fmt::Debug for CreateCheckoutSessionCustomerUpdate {
1995    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1996        f.debug_struct("CreateCheckoutSessionCustomerUpdate").finish_non_exhaustive()
1997    }
1998}
1999impl CreateCheckoutSessionCustomerUpdate {
2000    pub fn new() -> Self {
2001        Self { address: None, name: None, shipping: None }
2002    }
2003}
2004impl Default for CreateCheckoutSessionCustomerUpdate {
2005    fn default() -> Self {
2006        Self::new()
2007    }
2008}
2009/// Describes whether Checkout saves the billing address onto `customer.address`.
2010/// To always collect a full billing address, use `billing_address_collection`. Defaults to `never`.
2011#[derive(Clone, Eq, PartialEq)]
2012#[non_exhaustive]
2013pub enum CreateCheckoutSessionCustomerUpdateAddress {
2014    Auto,
2015    Never,
2016    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2017    Unknown(String),
2018}
2019impl CreateCheckoutSessionCustomerUpdateAddress {
2020    pub fn as_str(&self) -> &str {
2021        use CreateCheckoutSessionCustomerUpdateAddress::*;
2022        match self {
2023            Auto => "auto",
2024            Never => "never",
2025            Unknown(v) => v,
2026        }
2027    }
2028}
2029
2030impl std::str::FromStr for CreateCheckoutSessionCustomerUpdateAddress {
2031    type Err = std::convert::Infallible;
2032    fn from_str(s: &str) -> Result<Self, Self::Err> {
2033        use CreateCheckoutSessionCustomerUpdateAddress::*;
2034        match s {
2035            "auto" => Ok(Auto),
2036            "never" => Ok(Never),
2037            v => {
2038                tracing::warn!(
2039                    "Unknown value '{}' for enum '{}'",
2040                    v,
2041                    "CreateCheckoutSessionCustomerUpdateAddress"
2042                );
2043                Ok(Unknown(v.to_owned()))
2044            }
2045        }
2046    }
2047}
2048impl std::fmt::Display for CreateCheckoutSessionCustomerUpdateAddress {
2049    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2050        f.write_str(self.as_str())
2051    }
2052}
2053
2054#[cfg(not(feature = "redact-generated-debug"))]
2055impl std::fmt::Debug for CreateCheckoutSessionCustomerUpdateAddress {
2056    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2057        f.write_str(self.as_str())
2058    }
2059}
2060#[cfg(feature = "redact-generated-debug")]
2061impl std::fmt::Debug for CreateCheckoutSessionCustomerUpdateAddress {
2062    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2063        f.debug_struct(stringify!(CreateCheckoutSessionCustomerUpdateAddress))
2064            .finish_non_exhaustive()
2065    }
2066}
2067impl serde::Serialize for CreateCheckoutSessionCustomerUpdateAddress {
2068    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2069    where
2070        S: serde::Serializer,
2071    {
2072        serializer.serialize_str(self.as_str())
2073    }
2074}
2075#[cfg(feature = "deserialize")]
2076impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionCustomerUpdateAddress {
2077    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2078        use std::str::FromStr;
2079        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2080        Ok(Self::from_str(&s).expect("infallible"))
2081    }
2082}
2083/// Describes whether Checkout saves the name onto `customer.name`. Defaults to `never`.
2084#[derive(Clone, Eq, PartialEq)]
2085#[non_exhaustive]
2086pub enum CreateCheckoutSessionCustomerUpdateName {
2087    Auto,
2088    Never,
2089    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2090    Unknown(String),
2091}
2092impl CreateCheckoutSessionCustomerUpdateName {
2093    pub fn as_str(&self) -> &str {
2094        use CreateCheckoutSessionCustomerUpdateName::*;
2095        match self {
2096            Auto => "auto",
2097            Never => "never",
2098            Unknown(v) => v,
2099        }
2100    }
2101}
2102
2103impl std::str::FromStr for CreateCheckoutSessionCustomerUpdateName {
2104    type Err = std::convert::Infallible;
2105    fn from_str(s: &str) -> Result<Self, Self::Err> {
2106        use CreateCheckoutSessionCustomerUpdateName::*;
2107        match s {
2108            "auto" => Ok(Auto),
2109            "never" => Ok(Never),
2110            v => {
2111                tracing::warn!(
2112                    "Unknown value '{}' for enum '{}'",
2113                    v,
2114                    "CreateCheckoutSessionCustomerUpdateName"
2115                );
2116                Ok(Unknown(v.to_owned()))
2117            }
2118        }
2119    }
2120}
2121impl std::fmt::Display for CreateCheckoutSessionCustomerUpdateName {
2122    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2123        f.write_str(self.as_str())
2124    }
2125}
2126
2127#[cfg(not(feature = "redact-generated-debug"))]
2128impl std::fmt::Debug for CreateCheckoutSessionCustomerUpdateName {
2129    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2130        f.write_str(self.as_str())
2131    }
2132}
2133#[cfg(feature = "redact-generated-debug")]
2134impl std::fmt::Debug for CreateCheckoutSessionCustomerUpdateName {
2135    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2136        f.debug_struct(stringify!(CreateCheckoutSessionCustomerUpdateName)).finish_non_exhaustive()
2137    }
2138}
2139impl serde::Serialize for CreateCheckoutSessionCustomerUpdateName {
2140    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2141    where
2142        S: serde::Serializer,
2143    {
2144        serializer.serialize_str(self.as_str())
2145    }
2146}
2147#[cfg(feature = "deserialize")]
2148impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionCustomerUpdateName {
2149    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2150        use std::str::FromStr;
2151        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2152        Ok(Self::from_str(&s).expect("infallible"))
2153    }
2154}
2155/// Describes whether Checkout saves shipping information onto `customer.shipping`.
2156/// To collect shipping information, use `shipping_address_collection`. Defaults to `never`.
2157#[derive(Clone, Eq, PartialEq)]
2158#[non_exhaustive]
2159pub enum CreateCheckoutSessionCustomerUpdateShipping {
2160    Auto,
2161    Never,
2162    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2163    Unknown(String),
2164}
2165impl CreateCheckoutSessionCustomerUpdateShipping {
2166    pub fn as_str(&self) -> &str {
2167        use CreateCheckoutSessionCustomerUpdateShipping::*;
2168        match self {
2169            Auto => "auto",
2170            Never => "never",
2171            Unknown(v) => v,
2172        }
2173    }
2174}
2175
2176impl std::str::FromStr for CreateCheckoutSessionCustomerUpdateShipping {
2177    type Err = std::convert::Infallible;
2178    fn from_str(s: &str) -> Result<Self, Self::Err> {
2179        use CreateCheckoutSessionCustomerUpdateShipping::*;
2180        match s {
2181            "auto" => Ok(Auto),
2182            "never" => Ok(Never),
2183            v => {
2184                tracing::warn!(
2185                    "Unknown value '{}' for enum '{}'",
2186                    v,
2187                    "CreateCheckoutSessionCustomerUpdateShipping"
2188                );
2189                Ok(Unknown(v.to_owned()))
2190            }
2191        }
2192    }
2193}
2194impl std::fmt::Display for CreateCheckoutSessionCustomerUpdateShipping {
2195    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2196        f.write_str(self.as_str())
2197    }
2198}
2199
2200#[cfg(not(feature = "redact-generated-debug"))]
2201impl std::fmt::Debug for CreateCheckoutSessionCustomerUpdateShipping {
2202    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2203        f.write_str(self.as_str())
2204    }
2205}
2206#[cfg(feature = "redact-generated-debug")]
2207impl std::fmt::Debug for CreateCheckoutSessionCustomerUpdateShipping {
2208    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2209        f.debug_struct(stringify!(CreateCheckoutSessionCustomerUpdateShipping))
2210            .finish_non_exhaustive()
2211    }
2212}
2213impl serde::Serialize for CreateCheckoutSessionCustomerUpdateShipping {
2214    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2215    where
2216        S: serde::Serializer,
2217    {
2218        serializer.serialize_str(self.as_str())
2219    }
2220}
2221#[cfg(feature = "deserialize")]
2222impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionCustomerUpdateShipping {
2223    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2224        use std::str::FromStr;
2225        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2226        Ok(Self::from_str(&s).expect("infallible"))
2227    }
2228}
2229/// The coupon or promotion code to apply to this Session. Currently, only up to one may be specified.
2230#[derive(Clone, Eq, PartialEq)]
2231#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
2232#[derive(serde::Serialize)]
2233pub struct CreateCheckoutSessionDiscounts {
2234    /// The ID of the coupon to apply to this Session.
2235    #[serde(skip_serializing_if = "Option::is_none")]
2236    pub coupon: Option<String>,
2237    /// The ID of a promotion code to apply to this Session.
2238    #[serde(skip_serializing_if = "Option::is_none")]
2239    pub promotion_code: Option<String>,
2240}
2241#[cfg(feature = "redact-generated-debug")]
2242impl std::fmt::Debug for CreateCheckoutSessionDiscounts {
2243    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2244        f.debug_struct("CreateCheckoutSessionDiscounts").finish_non_exhaustive()
2245    }
2246}
2247impl CreateCheckoutSessionDiscounts {
2248    pub fn new() -> Self {
2249        Self { coupon: None, promotion_code: None }
2250    }
2251}
2252impl Default for CreateCheckoutSessionDiscounts {
2253    fn default() -> Self {
2254        Self::new()
2255    }
2256}
2257/// A list of the types of payment methods (e.g., `card`) that should be excluded from this Checkout Session.
2258/// This should only be used when payment methods for this Checkout Session are managed through the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods).
2259#[derive(Clone, Eq, PartialEq)]
2260#[non_exhaustive]
2261pub enum CreateCheckoutSessionExcludedPaymentMethodTypes {
2262    AcssDebit,
2263    Affirm,
2264    AfterpayClearpay,
2265    Alipay,
2266    Alma,
2267    AmazonPay,
2268    AuBecsDebit,
2269    BacsDebit,
2270    Bancontact,
2271    Billie,
2272    Bizum,
2273    Blik,
2274    Boleto,
2275    Card,
2276    Cashapp,
2277    Crypto,
2278    CustomerBalance,
2279    Eps,
2280    Fpx,
2281    Giropay,
2282    Grabpay,
2283    Ideal,
2284    KakaoPay,
2285    Klarna,
2286    Konbini,
2287    KrCard,
2288    MbWay,
2289    Mobilepay,
2290    Multibanco,
2291    NaverPay,
2292    NzBankAccount,
2293    Oxxo,
2294    P24,
2295    PayByBank,
2296    Payco,
2297    Paynow,
2298    Paypal,
2299    Payto,
2300    Pix,
2301    Promptpay,
2302    RevolutPay,
2303    SamsungPay,
2304    Satispay,
2305    Scalapay,
2306    SepaDebit,
2307    Sofort,
2308    Sunbit,
2309    Swish,
2310    Twint,
2311    Upi,
2312    UsBankAccount,
2313    WechatPay,
2314    Zip,
2315    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2316    Unknown(String),
2317}
2318impl CreateCheckoutSessionExcludedPaymentMethodTypes {
2319    pub fn as_str(&self) -> &str {
2320        use CreateCheckoutSessionExcludedPaymentMethodTypes::*;
2321        match self {
2322            AcssDebit => "acss_debit",
2323            Affirm => "affirm",
2324            AfterpayClearpay => "afterpay_clearpay",
2325            Alipay => "alipay",
2326            Alma => "alma",
2327            AmazonPay => "amazon_pay",
2328            AuBecsDebit => "au_becs_debit",
2329            BacsDebit => "bacs_debit",
2330            Bancontact => "bancontact",
2331            Billie => "billie",
2332            Bizum => "bizum",
2333            Blik => "blik",
2334            Boleto => "boleto",
2335            Card => "card",
2336            Cashapp => "cashapp",
2337            Crypto => "crypto",
2338            CustomerBalance => "customer_balance",
2339            Eps => "eps",
2340            Fpx => "fpx",
2341            Giropay => "giropay",
2342            Grabpay => "grabpay",
2343            Ideal => "ideal",
2344            KakaoPay => "kakao_pay",
2345            Klarna => "klarna",
2346            Konbini => "konbini",
2347            KrCard => "kr_card",
2348            MbWay => "mb_way",
2349            Mobilepay => "mobilepay",
2350            Multibanco => "multibanco",
2351            NaverPay => "naver_pay",
2352            NzBankAccount => "nz_bank_account",
2353            Oxxo => "oxxo",
2354            P24 => "p24",
2355            PayByBank => "pay_by_bank",
2356            Payco => "payco",
2357            Paynow => "paynow",
2358            Paypal => "paypal",
2359            Payto => "payto",
2360            Pix => "pix",
2361            Promptpay => "promptpay",
2362            RevolutPay => "revolut_pay",
2363            SamsungPay => "samsung_pay",
2364            Satispay => "satispay",
2365            Scalapay => "scalapay",
2366            SepaDebit => "sepa_debit",
2367            Sofort => "sofort",
2368            Sunbit => "sunbit",
2369            Swish => "swish",
2370            Twint => "twint",
2371            Upi => "upi",
2372            UsBankAccount => "us_bank_account",
2373            WechatPay => "wechat_pay",
2374            Zip => "zip",
2375            Unknown(v) => v,
2376        }
2377    }
2378}
2379
2380impl std::str::FromStr for CreateCheckoutSessionExcludedPaymentMethodTypes {
2381    type Err = std::convert::Infallible;
2382    fn from_str(s: &str) -> Result<Self, Self::Err> {
2383        use CreateCheckoutSessionExcludedPaymentMethodTypes::*;
2384        match s {
2385            "acss_debit" => Ok(AcssDebit),
2386            "affirm" => Ok(Affirm),
2387            "afterpay_clearpay" => Ok(AfterpayClearpay),
2388            "alipay" => Ok(Alipay),
2389            "alma" => Ok(Alma),
2390            "amazon_pay" => Ok(AmazonPay),
2391            "au_becs_debit" => Ok(AuBecsDebit),
2392            "bacs_debit" => Ok(BacsDebit),
2393            "bancontact" => Ok(Bancontact),
2394            "billie" => Ok(Billie),
2395            "bizum" => Ok(Bizum),
2396            "blik" => Ok(Blik),
2397            "boleto" => Ok(Boleto),
2398            "card" => Ok(Card),
2399            "cashapp" => Ok(Cashapp),
2400            "crypto" => Ok(Crypto),
2401            "customer_balance" => Ok(CustomerBalance),
2402            "eps" => Ok(Eps),
2403            "fpx" => Ok(Fpx),
2404            "giropay" => Ok(Giropay),
2405            "grabpay" => Ok(Grabpay),
2406            "ideal" => Ok(Ideal),
2407            "kakao_pay" => Ok(KakaoPay),
2408            "klarna" => Ok(Klarna),
2409            "konbini" => Ok(Konbini),
2410            "kr_card" => Ok(KrCard),
2411            "mb_way" => Ok(MbWay),
2412            "mobilepay" => Ok(Mobilepay),
2413            "multibanco" => Ok(Multibanco),
2414            "naver_pay" => Ok(NaverPay),
2415            "nz_bank_account" => Ok(NzBankAccount),
2416            "oxxo" => Ok(Oxxo),
2417            "p24" => Ok(P24),
2418            "pay_by_bank" => Ok(PayByBank),
2419            "payco" => Ok(Payco),
2420            "paynow" => Ok(Paynow),
2421            "paypal" => Ok(Paypal),
2422            "payto" => Ok(Payto),
2423            "pix" => Ok(Pix),
2424            "promptpay" => Ok(Promptpay),
2425            "revolut_pay" => Ok(RevolutPay),
2426            "samsung_pay" => Ok(SamsungPay),
2427            "satispay" => Ok(Satispay),
2428            "scalapay" => Ok(Scalapay),
2429            "sepa_debit" => Ok(SepaDebit),
2430            "sofort" => Ok(Sofort),
2431            "sunbit" => Ok(Sunbit),
2432            "swish" => Ok(Swish),
2433            "twint" => Ok(Twint),
2434            "upi" => Ok(Upi),
2435            "us_bank_account" => Ok(UsBankAccount),
2436            "wechat_pay" => Ok(WechatPay),
2437            "zip" => Ok(Zip),
2438            v => {
2439                tracing::warn!(
2440                    "Unknown value '{}' for enum '{}'",
2441                    v,
2442                    "CreateCheckoutSessionExcludedPaymentMethodTypes"
2443                );
2444                Ok(Unknown(v.to_owned()))
2445            }
2446        }
2447    }
2448}
2449impl std::fmt::Display for CreateCheckoutSessionExcludedPaymentMethodTypes {
2450    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2451        f.write_str(self.as_str())
2452    }
2453}
2454
2455#[cfg(not(feature = "redact-generated-debug"))]
2456impl std::fmt::Debug for CreateCheckoutSessionExcludedPaymentMethodTypes {
2457    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2458        f.write_str(self.as_str())
2459    }
2460}
2461#[cfg(feature = "redact-generated-debug")]
2462impl std::fmt::Debug for CreateCheckoutSessionExcludedPaymentMethodTypes {
2463    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2464        f.debug_struct(stringify!(CreateCheckoutSessionExcludedPaymentMethodTypes))
2465            .finish_non_exhaustive()
2466    }
2467}
2468impl serde::Serialize for CreateCheckoutSessionExcludedPaymentMethodTypes {
2469    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2470    where
2471        S: serde::Serializer,
2472    {
2473        serializer.serialize_str(self.as_str())
2474    }
2475}
2476#[cfg(feature = "deserialize")]
2477impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionExcludedPaymentMethodTypes {
2478    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2479        use std::str::FromStr;
2480        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2481        Ok(Self::from_str(&s).expect("infallible"))
2482    }
2483}
2484/// Generate a post-purchase Invoice for one-time payments.
2485#[derive(Clone)]
2486#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
2487#[derive(serde::Serialize)]
2488pub struct CreateCheckoutSessionInvoiceCreation {
2489    /// Set to `true` to enable invoice creation.
2490    pub enabled: bool,
2491    /// Parameters passed when creating invoices for payment-mode Checkout Sessions.
2492    #[serde(skip_serializing_if = "Option::is_none")]
2493    pub invoice_data: Option<CreateCheckoutSessionInvoiceCreationInvoiceData>,
2494}
2495#[cfg(feature = "redact-generated-debug")]
2496impl std::fmt::Debug for CreateCheckoutSessionInvoiceCreation {
2497    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2498        f.debug_struct("CreateCheckoutSessionInvoiceCreation").finish_non_exhaustive()
2499    }
2500}
2501impl CreateCheckoutSessionInvoiceCreation {
2502    pub fn new(enabled: impl Into<bool>) -> Self {
2503        Self { enabled: enabled.into(), invoice_data: None }
2504    }
2505}
2506/// Parameters passed when creating invoices for payment-mode Checkout Sessions.
2507#[derive(Clone)]
2508#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
2509#[derive(serde::Serialize)]
2510pub struct CreateCheckoutSessionInvoiceCreationInvoiceData {
2511    /// The account tax IDs associated with the invoice.
2512    #[serde(skip_serializing_if = "Option::is_none")]
2513    pub account_tax_ids: Option<Vec<String>>,
2514    /// Default custom fields to be displayed on invoices for this customer.
2515    #[serde(skip_serializing_if = "Option::is_none")]
2516    pub custom_fields: Option<Vec<CreateCheckoutSessionInvoiceCreationInvoiceDataCustomFields>>,
2517    /// An arbitrary string attached to the object. Often useful for displaying to users.
2518    #[serde(skip_serializing_if = "Option::is_none")]
2519    pub description: Option<String>,
2520    /// Default footer to be displayed on invoices for this customer.
2521    #[serde(skip_serializing_if = "Option::is_none")]
2522    pub footer: Option<String>,
2523    /// The connected account that issues the invoice.
2524    /// The invoice is presented with the branding and support information of the specified account.
2525    #[serde(skip_serializing_if = "Option::is_none")]
2526    pub issuer: Option<CreateCheckoutSessionInvoiceCreationInvoiceDataIssuer>,
2527    /// Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object.
2528    /// This can be useful for storing additional information about the object in a structured format.
2529    /// Individual keys can be unset by posting an empty value to them.
2530    /// All keys can be unset by posting an empty value to `metadata`.
2531    #[serde(skip_serializing_if = "Option::is_none")]
2532    pub metadata: Option<std::collections::HashMap<String, String>>,
2533    /// Default options for invoice PDF rendering for this customer.
2534    #[serde(skip_serializing_if = "Option::is_none")]
2535    pub rendering_options: Option<CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptions>,
2536}
2537#[cfg(feature = "redact-generated-debug")]
2538impl std::fmt::Debug for CreateCheckoutSessionInvoiceCreationInvoiceData {
2539    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2540        f.debug_struct("CreateCheckoutSessionInvoiceCreationInvoiceData").finish_non_exhaustive()
2541    }
2542}
2543impl CreateCheckoutSessionInvoiceCreationInvoiceData {
2544    pub fn new() -> Self {
2545        Self {
2546            account_tax_ids: None,
2547            custom_fields: None,
2548            description: None,
2549            footer: None,
2550            issuer: None,
2551            metadata: None,
2552            rendering_options: None,
2553        }
2554    }
2555}
2556impl Default for CreateCheckoutSessionInvoiceCreationInvoiceData {
2557    fn default() -> Self {
2558        Self::new()
2559    }
2560}
2561/// Default custom fields to be displayed on invoices for this customer.
2562#[derive(Clone, Eq, PartialEq)]
2563#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
2564#[derive(serde::Serialize)]
2565pub struct CreateCheckoutSessionInvoiceCreationInvoiceDataCustomFields {
2566    /// The name of the custom field. This may be up to 40 characters.
2567    pub name: String,
2568    /// The value of the custom field. This may be up to 140 characters.
2569    pub value: String,
2570}
2571#[cfg(feature = "redact-generated-debug")]
2572impl std::fmt::Debug for CreateCheckoutSessionInvoiceCreationInvoiceDataCustomFields {
2573    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2574        f.debug_struct("CreateCheckoutSessionInvoiceCreationInvoiceDataCustomFields")
2575            .finish_non_exhaustive()
2576    }
2577}
2578impl CreateCheckoutSessionInvoiceCreationInvoiceDataCustomFields {
2579    pub fn new(name: impl Into<String>, value: impl Into<String>) -> Self {
2580        Self { name: name.into(), value: value.into() }
2581    }
2582}
2583/// The connected account that issues the invoice.
2584/// The invoice is presented with the branding and support information of the specified account.
2585#[derive(Clone, Eq, PartialEq)]
2586#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
2587#[derive(serde::Serialize)]
2588pub struct CreateCheckoutSessionInvoiceCreationInvoiceDataIssuer {
2589    /// The connected account being referenced when `type` is `account`.
2590    #[serde(skip_serializing_if = "Option::is_none")]
2591    pub account: Option<String>,
2592    /// Type of the account referenced in the request.
2593    #[serde(rename = "type")]
2594    pub type_: CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType,
2595}
2596#[cfg(feature = "redact-generated-debug")]
2597impl std::fmt::Debug for CreateCheckoutSessionInvoiceCreationInvoiceDataIssuer {
2598    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2599        f.debug_struct("CreateCheckoutSessionInvoiceCreationInvoiceDataIssuer")
2600            .finish_non_exhaustive()
2601    }
2602}
2603impl CreateCheckoutSessionInvoiceCreationInvoiceDataIssuer {
2604    pub fn new(
2605        type_: impl Into<CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType>,
2606    ) -> Self {
2607        Self { account: None, type_: type_.into() }
2608    }
2609}
2610/// Type of the account referenced in the request.
2611#[derive(Clone, Eq, PartialEq)]
2612#[non_exhaustive]
2613pub enum CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType {
2614    Account,
2615    Self_,
2616    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2617    Unknown(String),
2618}
2619impl CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType {
2620    pub fn as_str(&self) -> &str {
2621        use CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType::*;
2622        match self {
2623            Account => "account",
2624            Self_ => "self",
2625            Unknown(v) => v,
2626        }
2627    }
2628}
2629
2630impl std::str::FromStr for CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType {
2631    type Err = std::convert::Infallible;
2632    fn from_str(s: &str) -> Result<Self, Self::Err> {
2633        use CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType::*;
2634        match s {
2635            "account" => Ok(Account),
2636            "self" => Ok(Self_),
2637            v => {
2638                tracing::warn!(
2639                    "Unknown value '{}' for enum '{}'",
2640                    v,
2641                    "CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType"
2642                );
2643                Ok(Unknown(v.to_owned()))
2644            }
2645        }
2646    }
2647}
2648impl std::fmt::Display for CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType {
2649    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2650        f.write_str(self.as_str())
2651    }
2652}
2653
2654#[cfg(not(feature = "redact-generated-debug"))]
2655impl std::fmt::Debug for CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType {
2656    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2657        f.write_str(self.as_str())
2658    }
2659}
2660#[cfg(feature = "redact-generated-debug")]
2661impl std::fmt::Debug for CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType {
2662    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2663        f.debug_struct(stringify!(CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType))
2664            .finish_non_exhaustive()
2665    }
2666}
2667impl serde::Serialize for CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType {
2668    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2669    where
2670        S: serde::Serializer,
2671    {
2672        serializer.serialize_str(self.as_str())
2673    }
2674}
2675#[cfg(feature = "deserialize")]
2676impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType {
2677    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2678        use std::str::FromStr;
2679        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2680        Ok(Self::from_str(&s).expect("infallible"))
2681    }
2682}
2683/// Default options for invoice PDF rendering for this customer.
2684#[derive(Clone, Eq, PartialEq)]
2685#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
2686#[derive(serde::Serialize)]
2687pub struct CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptions {
2688    /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs.
2689    /// One of `exclude_tax` or `include_inclusive_tax`.
2690    /// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts.
2691    /// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
2692    #[serde(skip_serializing_if = "Option::is_none")]
2693    pub amount_tax_display:
2694        Option<CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay>,
2695    /// ID of the invoice rendering template to use for this invoice.
2696    #[serde(skip_serializing_if = "Option::is_none")]
2697    pub template: Option<String>,
2698}
2699#[cfg(feature = "redact-generated-debug")]
2700impl std::fmt::Debug for CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptions {
2701    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2702        f.debug_struct("CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptions")
2703            .finish_non_exhaustive()
2704    }
2705}
2706impl CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptions {
2707    pub fn new() -> Self {
2708        Self { amount_tax_display: None, template: None }
2709    }
2710}
2711impl Default for CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptions {
2712    fn default() -> Self {
2713        Self::new()
2714    }
2715}
2716/// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs.
2717/// One of `exclude_tax` or `include_inclusive_tax`.
2718/// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts.
2719/// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
2720#[derive(Clone, Eq, PartialEq)]
2721#[non_exhaustive]
2722pub enum CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay {
2723    ExcludeTax,
2724    IncludeInclusiveTax,
2725    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2726    Unknown(String),
2727}
2728impl CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay {
2729    pub fn as_str(&self) -> &str {
2730        use CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay::*;
2731        match self {
2732            ExcludeTax => "exclude_tax",
2733            IncludeInclusiveTax => "include_inclusive_tax",
2734            Unknown(v) => v,
2735        }
2736    }
2737}
2738
2739impl std::str::FromStr
2740    for CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay
2741{
2742    type Err = std::convert::Infallible;
2743    fn from_str(s: &str) -> Result<Self, Self::Err> {
2744        use CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay::*;
2745        match s {
2746            "exclude_tax" => Ok(ExcludeTax),
2747            "include_inclusive_tax" => Ok(IncludeInclusiveTax),
2748            v => {
2749                tracing::warn!(
2750                    "Unknown value '{}' for enum '{}'",
2751                    v,
2752                    "CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay"
2753                );
2754                Ok(Unknown(v.to_owned()))
2755            }
2756        }
2757    }
2758}
2759impl std::fmt::Display
2760    for CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay
2761{
2762    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2763        f.write_str(self.as_str())
2764    }
2765}
2766
2767#[cfg(not(feature = "redact-generated-debug"))]
2768impl std::fmt::Debug
2769    for CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay
2770{
2771    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2772        f.write_str(self.as_str())
2773    }
2774}
2775#[cfg(feature = "redact-generated-debug")]
2776impl std::fmt::Debug
2777    for CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay
2778{
2779    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2780        f.debug_struct(stringify!(
2781            CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay
2782        ))
2783        .finish_non_exhaustive()
2784    }
2785}
2786impl serde::Serialize
2787    for CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay
2788{
2789    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2790    where
2791        S: serde::Serializer,
2792    {
2793        serializer.serialize_str(self.as_str())
2794    }
2795}
2796#[cfg(feature = "deserialize")]
2797impl<'de> serde::Deserialize<'de>
2798    for CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay
2799{
2800    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2801        use std::str::FromStr;
2802        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2803        Ok(Self::from_str(&s).expect("infallible"))
2804    }
2805}
2806/// A list of items the customer is purchasing.
2807/// Use this parameter to pass one-time or recurring [Prices](https://docs.stripe.com/api/prices).
2808/// The parameter is required for `payment` and `subscription` mode.
2809///
2810/// For `payment` mode, there is a maximum of 100 line items, however it is recommended to consolidate line items if there are more than a few dozen.
2811///
2812/// For `subscription` mode, there is a maximum of 20 line items with recurring Prices and 20 line items with one-time Prices.
2813/// Line items with one-time Prices will be on the initial invoice only.
2814#[derive(Clone)]
2815#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
2816#[derive(serde::Serialize)]
2817pub struct CreateCheckoutSessionLineItems {
2818    /// When set, provides configuration for this item’s quantity to be adjusted by the customer during Checkout.
2819    #[serde(skip_serializing_if = "Option::is_none")]
2820    pub adjustable_quantity: Option<CreateCheckoutSessionLineItemsAdjustableQuantity>,
2821    /// Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object.
2822    /// This can be useful for storing additional information about the object in a structured format.
2823    /// Individual keys can be unset by posting an empty value to them.
2824    /// All keys can be unset by posting an empty value to `metadata`.
2825    #[serde(skip_serializing_if = "Option::is_none")]
2826    pub metadata: Option<std::collections::HashMap<String, String>>,
2827    /// The ID of the [Price](https://docs.stripe.com/api/prices) or [Plan](https://docs.stripe.com/api/plans) object.
2828    /// One of `price` or `price_data` is required.
2829    #[serde(skip_serializing_if = "Option::is_none")]
2830    pub price: Option<String>,
2831    /// Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline.
2832    /// One of `price` or `price_data` is required.
2833    #[serde(skip_serializing_if = "Option::is_none")]
2834    pub price_data: Option<CreateCheckoutSessionLineItemsPriceData>,
2835    /// The quantity of the line item being purchased.
2836    /// Quantity should not be defined when `recurring.usage_type=metered`.
2837    #[serde(skip_serializing_if = "Option::is_none")]
2838    pub quantity: Option<u64>,
2839    /// The [tax rates](https://docs.stripe.com/api/tax_rates) which apply to this line item.
2840    #[serde(skip_serializing_if = "Option::is_none")]
2841    pub tax_rates: Option<Vec<String>>,
2842}
2843#[cfg(feature = "redact-generated-debug")]
2844impl std::fmt::Debug for CreateCheckoutSessionLineItems {
2845    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2846        f.debug_struct("CreateCheckoutSessionLineItems").finish_non_exhaustive()
2847    }
2848}
2849impl CreateCheckoutSessionLineItems {
2850    pub fn new() -> Self {
2851        Self {
2852            adjustable_quantity: None,
2853            metadata: None,
2854            price: None,
2855            price_data: None,
2856            quantity: None,
2857            tax_rates: None,
2858        }
2859    }
2860}
2861impl Default for CreateCheckoutSessionLineItems {
2862    fn default() -> Self {
2863        Self::new()
2864    }
2865}
2866/// When set, provides configuration for this item’s quantity to be adjusted by the customer during Checkout.
2867#[derive(Copy, Clone, Eq, PartialEq)]
2868#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
2869#[derive(serde::Serialize)]
2870pub struct CreateCheckoutSessionLineItemsAdjustableQuantity {
2871    /// Set to true if the quantity can be adjusted to any non-negative integer.
2872    pub enabled: bool,
2873    /// The maximum quantity the customer can purchase for the Checkout Session.
2874    /// By default this value is 99.
2875    /// You can specify a value up to 999999.
2876    #[serde(skip_serializing_if = "Option::is_none")]
2877    pub maximum: Option<i64>,
2878    /// The minimum quantity the customer must purchase for the Checkout Session.
2879    /// By default this value is 0.
2880    #[serde(skip_serializing_if = "Option::is_none")]
2881    pub minimum: Option<i64>,
2882}
2883#[cfg(feature = "redact-generated-debug")]
2884impl std::fmt::Debug for CreateCheckoutSessionLineItemsAdjustableQuantity {
2885    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2886        f.debug_struct("CreateCheckoutSessionLineItemsAdjustableQuantity").finish_non_exhaustive()
2887    }
2888}
2889impl CreateCheckoutSessionLineItemsAdjustableQuantity {
2890    pub fn new(enabled: impl Into<bool>) -> Self {
2891        Self { enabled: enabled.into(), maximum: None, minimum: None }
2892    }
2893}
2894/// Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline.
2895/// One of `price` or `price_data` is required.
2896#[derive(Clone)]
2897#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
2898#[derive(serde::Serialize)]
2899pub struct CreateCheckoutSessionLineItemsPriceData {
2900    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
2901    /// Must be a [supported currency](https://stripe.com/docs/currencies).
2902    pub currency: stripe_types::Currency,
2903    /// The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
2904    /// One of `product` or `product_data` is required.
2905    #[serde(skip_serializing_if = "Option::is_none")]
2906    pub product: Option<String>,
2907    /// Data used to generate a new [Product](https://docs.stripe.com/api/products) object inline.
2908    /// One of `product` or `product_data` is required.
2909    #[serde(skip_serializing_if = "Option::is_none")]
2910    pub product_data: Option<ProductData>,
2911    /// The recurring components of a price such as `interval` and `interval_count`.
2912    #[serde(skip_serializing_if = "Option::is_none")]
2913    pub recurring: Option<CreateCheckoutSessionLineItemsPriceDataRecurring>,
2914    /// Only required if a [default tax behavior](https://docs.stripe.com/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings.
2915    /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes.
2916    /// One of `inclusive`, `exclusive`, or `unspecified`.
2917    /// Once specified as either `inclusive` or `exclusive`, it cannot be changed.
2918    #[serde(skip_serializing_if = "Option::is_none")]
2919    pub tax_behavior: Option<CreateCheckoutSessionLineItemsPriceDataTaxBehavior>,
2920    /// A non-negative integer in cents (or local equivalent) representing how much to charge.
2921    /// One of `unit_amount` or `unit_amount_decimal` is required.
2922    #[serde(skip_serializing_if = "Option::is_none")]
2923    pub unit_amount: Option<i64>,
2924    /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places.
2925    /// Only one of `unit_amount` and `unit_amount_decimal` can be set.
2926    #[serde(skip_serializing_if = "Option::is_none")]
2927    pub unit_amount_decimal: Option<String>,
2928}
2929#[cfg(feature = "redact-generated-debug")]
2930impl std::fmt::Debug for CreateCheckoutSessionLineItemsPriceData {
2931    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2932        f.debug_struct("CreateCheckoutSessionLineItemsPriceData").finish_non_exhaustive()
2933    }
2934}
2935impl CreateCheckoutSessionLineItemsPriceData {
2936    pub fn new(currency: impl Into<stripe_types::Currency>) -> Self {
2937        Self {
2938            currency: currency.into(),
2939            product: None,
2940            product_data: None,
2941            recurring: None,
2942            tax_behavior: None,
2943            unit_amount: None,
2944            unit_amount_decimal: None,
2945        }
2946    }
2947}
2948/// The recurring components of a price such as `interval` and `interval_count`.
2949#[derive(Clone, Eq, PartialEq)]
2950#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
2951#[derive(serde::Serialize)]
2952pub struct CreateCheckoutSessionLineItemsPriceDataRecurring {
2953    /// Specifies billing frequency. Either `day`, `week`, `month` or `year`.
2954    pub interval: CreateCheckoutSessionLineItemsPriceDataRecurringInterval,
2955    /// The number of intervals between subscription billings.
2956    /// For example, `interval=month` and `interval_count=3` bills every 3 months.
2957    /// Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).
2958    #[serde(skip_serializing_if = "Option::is_none")]
2959    pub interval_count: Option<u64>,
2960}
2961#[cfg(feature = "redact-generated-debug")]
2962impl std::fmt::Debug for CreateCheckoutSessionLineItemsPriceDataRecurring {
2963    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2964        f.debug_struct("CreateCheckoutSessionLineItemsPriceDataRecurring").finish_non_exhaustive()
2965    }
2966}
2967impl CreateCheckoutSessionLineItemsPriceDataRecurring {
2968    pub fn new(
2969        interval: impl Into<CreateCheckoutSessionLineItemsPriceDataRecurringInterval>,
2970    ) -> Self {
2971        Self { interval: interval.into(), interval_count: None }
2972    }
2973}
2974/// Specifies billing frequency. Either `day`, `week`, `month` or `year`.
2975#[derive(Clone, Eq, PartialEq)]
2976#[non_exhaustive]
2977pub enum CreateCheckoutSessionLineItemsPriceDataRecurringInterval {
2978    Day,
2979    Month,
2980    Week,
2981    Year,
2982    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2983    Unknown(String),
2984}
2985impl CreateCheckoutSessionLineItemsPriceDataRecurringInterval {
2986    pub fn as_str(&self) -> &str {
2987        use CreateCheckoutSessionLineItemsPriceDataRecurringInterval::*;
2988        match self {
2989            Day => "day",
2990            Month => "month",
2991            Week => "week",
2992            Year => "year",
2993            Unknown(v) => v,
2994        }
2995    }
2996}
2997
2998impl std::str::FromStr for CreateCheckoutSessionLineItemsPriceDataRecurringInterval {
2999    type Err = std::convert::Infallible;
3000    fn from_str(s: &str) -> Result<Self, Self::Err> {
3001        use CreateCheckoutSessionLineItemsPriceDataRecurringInterval::*;
3002        match s {
3003            "day" => Ok(Day),
3004            "month" => Ok(Month),
3005            "week" => Ok(Week),
3006            "year" => Ok(Year),
3007            v => {
3008                tracing::warn!(
3009                    "Unknown value '{}' for enum '{}'",
3010                    v,
3011                    "CreateCheckoutSessionLineItemsPriceDataRecurringInterval"
3012                );
3013                Ok(Unknown(v.to_owned()))
3014            }
3015        }
3016    }
3017}
3018impl std::fmt::Display for CreateCheckoutSessionLineItemsPriceDataRecurringInterval {
3019    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3020        f.write_str(self.as_str())
3021    }
3022}
3023
3024#[cfg(not(feature = "redact-generated-debug"))]
3025impl std::fmt::Debug for CreateCheckoutSessionLineItemsPriceDataRecurringInterval {
3026    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3027        f.write_str(self.as_str())
3028    }
3029}
3030#[cfg(feature = "redact-generated-debug")]
3031impl std::fmt::Debug for CreateCheckoutSessionLineItemsPriceDataRecurringInterval {
3032    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3033        f.debug_struct(stringify!(CreateCheckoutSessionLineItemsPriceDataRecurringInterval))
3034            .finish_non_exhaustive()
3035    }
3036}
3037impl serde::Serialize for CreateCheckoutSessionLineItemsPriceDataRecurringInterval {
3038    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3039    where
3040        S: serde::Serializer,
3041    {
3042        serializer.serialize_str(self.as_str())
3043    }
3044}
3045#[cfg(feature = "deserialize")]
3046impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionLineItemsPriceDataRecurringInterval {
3047    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3048        use std::str::FromStr;
3049        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3050        Ok(Self::from_str(&s).expect("infallible"))
3051    }
3052}
3053/// Only required if a [default tax behavior](https://docs.stripe.com/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings.
3054/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes.
3055/// One of `inclusive`, `exclusive`, or `unspecified`.
3056/// Once specified as either `inclusive` or `exclusive`, it cannot be changed.
3057#[derive(Clone, Eq, PartialEq)]
3058#[non_exhaustive]
3059pub enum CreateCheckoutSessionLineItemsPriceDataTaxBehavior {
3060    Exclusive,
3061    Inclusive,
3062    Unspecified,
3063    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3064    Unknown(String),
3065}
3066impl CreateCheckoutSessionLineItemsPriceDataTaxBehavior {
3067    pub fn as_str(&self) -> &str {
3068        use CreateCheckoutSessionLineItemsPriceDataTaxBehavior::*;
3069        match self {
3070            Exclusive => "exclusive",
3071            Inclusive => "inclusive",
3072            Unspecified => "unspecified",
3073            Unknown(v) => v,
3074        }
3075    }
3076}
3077
3078impl std::str::FromStr for CreateCheckoutSessionLineItemsPriceDataTaxBehavior {
3079    type Err = std::convert::Infallible;
3080    fn from_str(s: &str) -> Result<Self, Self::Err> {
3081        use CreateCheckoutSessionLineItemsPriceDataTaxBehavior::*;
3082        match s {
3083            "exclusive" => Ok(Exclusive),
3084            "inclusive" => Ok(Inclusive),
3085            "unspecified" => Ok(Unspecified),
3086            v => {
3087                tracing::warn!(
3088                    "Unknown value '{}' for enum '{}'",
3089                    v,
3090                    "CreateCheckoutSessionLineItemsPriceDataTaxBehavior"
3091                );
3092                Ok(Unknown(v.to_owned()))
3093            }
3094        }
3095    }
3096}
3097impl std::fmt::Display for CreateCheckoutSessionLineItemsPriceDataTaxBehavior {
3098    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3099        f.write_str(self.as_str())
3100    }
3101}
3102
3103#[cfg(not(feature = "redact-generated-debug"))]
3104impl std::fmt::Debug for CreateCheckoutSessionLineItemsPriceDataTaxBehavior {
3105    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3106        f.write_str(self.as_str())
3107    }
3108}
3109#[cfg(feature = "redact-generated-debug")]
3110impl std::fmt::Debug for CreateCheckoutSessionLineItemsPriceDataTaxBehavior {
3111    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3112        f.debug_struct(stringify!(CreateCheckoutSessionLineItemsPriceDataTaxBehavior))
3113            .finish_non_exhaustive()
3114    }
3115}
3116impl serde::Serialize for CreateCheckoutSessionLineItemsPriceDataTaxBehavior {
3117    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3118    where
3119        S: serde::Serializer,
3120    {
3121        serializer.serialize_str(self.as_str())
3122    }
3123}
3124#[cfg(feature = "deserialize")]
3125impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionLineItemsPriceDataTaxBehavior {
3126    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3127        use std::str::FromStr;
3128        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3129        Ok(Self::from_str(&s).expect("infallible"))
3130    }
3131}
3132/// Settings for Managed Payments for this Checkout Session and resulting [PaymentIntents](/api/payment_intents/object), [Invoices](/api/invoices/object), and [Subscriptions](/api/subscriptions/object).
3133#[derive(Copy, Clone, Eq, PartialEq)]
3134#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
3135#[derive(serde::Serialize)]
3136pub struct CreateCheckoutSessionManagedPayments {
3137    /// Set to `true` to enable [Managed Payments](https://docs.stripe.com/payments/managed-payments), Stripe's merchant of record solution, for this session.
3138    #[serde(skip_serializing_if = "Option::is_none")]
3139    pub enabled: Option<bool>,
3140}
3141#[cfg(feature = "redact-generated-debug")]
3142impl std::fmt::Debug for CreateCheckoutSessionManagedPayments {
3143    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3144        f.debug_struct("CreateCheckoutSessionManagedPayments").finish_non_exhaustive()
3145    }
3146}
3147impl CreateCheckoutSessionManagedPayments {
3148    pub fn new() -> Self {
3149        Self { enabled: None }
3150    }
3151}
3152impl Default for CreateCheckoutSessionManagedPayments {
3153    fn default() -> Self {
3154        Self::new()
3155    }
3156}
3157/// Controls name collection settings for the session.
3158///
3159/// You can configure Checkout to collect your customers' business names, individual names, or both.
3160/// Each name field can be either required or optional.
3161///
3162/// If a [Customer](https://docs.stripe.com/api/customers) is created or provided, the names can be saved to the Customer object as well.
3163#[derive(Copy, Clone, Eq, PartialEq)]
3164#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
3165#[derive(serde::Serialize)]
3166pub struct CreateCheckoutSessionNameCollection {
3167    /// Controls settings applied for collecting the customer's business name on the session.
3168    #[serde(skip_serializing_if = "Option::is_none")]
3169    pub business: Option<CreateCheckoutSessionNameCollectionBusiness>,
3170    /// Controls settings applied for collecting the customer's individual name on the session.
3171    #[serde(skip_serializing_if = "Option::is_none")]
3172    pub individual: Option<CreateCheckoutSessionNameCollectionIndividual>,
3173}
3174#[cfg(feature = "redact-generated-debug")]
3175impl std::fmt::Debug for CreateCheckoutSessionNameCollection {
3176    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3177        f.debug_struct("CreateCheckoutSessionNameCollection").finish_non_exhaustive()
3178    }
3179}
3180impl CreateCheckoutSessionNameCollection {
3181    pub fn new() -> Self {
3182        Self { business: None, individual: None }
3183    }
3184}
3185impl Default for CreateCheckoutSessionNameCollection {
3186    fn default() -> Self {
3187        Self::new()
3188    }
3189}
3190/// Controls settings applied for collecting the customer's business name on the session.
3191#[derive(Copy, Clone, Eq, PartialEq)]
3192#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
3193#[derive(serde::Serialize)]
3194pub struct CreateCheckoutSessionNameCollectionBusiness {
3195    /// Enable business name collection on the Checkout Session. Defaults to `false`.
3196    pub enabled: bool,
3197    /// Whether the customer is required to provide a business name before completing the Checkout Session.
3198    /// Defaults to `false`.
3199    #[serde(skip_serializing_if = "Option::is_none")]
3200    pub optional: Option<bool>,
3201}
3202#[cfg(feature = "redact-generated-debug")]
3203impl std::fmt::Debug for CreateCheckoutSessionNameCollectionBusiness {
3204    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3205        f.debug_struct("CreateCheckoutSessionNameCollectionBusiness").finish_non_exhaustive()
3206    }
3207}
3208impl CreateCheckoutSessionNameCollectionBusiness {
3209    pub fn new(enabled: impl Into<bool>) -> Self {
3210        Self { enabled: enabled.into(), optional: None }
3211    }
3212}
3213/// Controls settings applied for collecting the customer's individual name on the session.
3214#[derive(Copy, Clone, Eq, PartialEq)]
3215#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
3216#[derive(serde::Serialize)]
3217pub struct CreateCheckoutSessionNameCollectionIndividual {
3218    /// Enable individual name collection on the Checkout Session. Defaults to `false`.
3219    pub enabled: bool,
3220    /// Whether the customer is required to provide their name before completing the Checkout Session.
3221    /// Defaults to `false`.
3222    #[serde(skip_serializing_if = "Option::is_none")]
3223    pub optional: Option<bool>,
3224}
3225#[cfg(feature = "redact-generated-debug")]
3226impl std::fmt::Debug for CreateCheckoutSessionNameCollectionIndividual {
3227    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3228        f.debug_struct("CreateCheckoutSessionNameCollectionIndividual").finish_non_exhaustive()
3229    }
3230}
3231impl CreateCheckoutSessionNameCollectionIndividual {
3232    pub fn new(enabled: impl Into<bool>) -> Self {
3233        Self { enabled: enabled.into(), optional: None }
3234    }
3235}
3236/// A list of optional items the customer can add to their order at checkout.
3237/// Use this parameter to pass one-time or recurring [Prices](https://docs.stripe.com/api/prices).
3238///
3239/// There is a maximum of 10 optional items allowed on a Checkout Session, and the existing limits on the number of line items allowed on a Checkout Session apply to the combined number of line items and optional items.
3240///
3241/// For `payment` mode, there is a maximum of 100 combined line items and optional items, however it is recommended to consolidate items if there are more than a few dozen.
3242///
3243/// For `subscription` mode, there is a maximum of 20 line items and optional items with recurring Prices and 20 line items and optional items with one-time Prices.
3244///
3245/// You can't set this parameter if `ui_mode` is `custom`.
3246#[derive(Clone, Eq, PartialEq)]
3247#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
3248#[derive(serde::Serialize)]
3249pub struct CreateCheckoutSessionOptionalItems {
3250    /// When set, provides configuration for the customer to adjust the quantity of the line item created when a customer chooses to add this optional item to their order.
3251    #[serde(skip_serializing_if = "Option::is_none")]
3252    pub adjustable_quantity: Option<CreateCheckoutSessionOptionalItemsAdjustableQuantity>,
3253    /// The ID of the [Price](https://docs.stripe.com/api/prices) or [Plan](https://docs.stripe.com/api/plans) object.
3254    pub price: String,
3255    /// The initial quantity of the line item created when a customer chooses to add this optional item to their order.
3256    pub quantity: u64,
3257}
3258#[cfg(feature = "redact-generated-debug")]
3259impl std::fmt::Debug for CreateCheckoutSessionOptionalItems {
3260    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3261        f.debug_struct("CreateCheckoutSessionOptionalItems").finish_non_exhaustive()
3262    }
3263}
3264impl CreateCheckoutSessionOptionalItems {
3265    pub fn new(price: impl Into<String>, quantity: impl Into<u64>) -> Self {
3266        Self { adjustable_quantity: None, price: price.into(), quantity: quantity.into() }
3267    }
3268}
3269/// When set, provides configuration for the customer to adjust the quantity of the line item created when a customer chooses to add this optional item to their order.
3270#[derive(Copy, Clone, Eq, PartialEq)]
3271#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
3272#[derive(serde::Serialize)]
3273pub struct CreateCheckoutSessionOptionalItemsAdjustableQuantity {
3274    /// Set to true if the quantity can be adjusted to any non-negative integer.
3275    pub enabled: bool,
3276    /// The maximum quantity of this item the customer can purchase.
3277    /// By default this value is 99.
3278    /// You can specify a value up to 999999.
3279    #[serde(skip_serializing_if = "Option::is_none")]
3280    pub maximum: Option<i64>,
3281    /// The minimum quantity of this item the customer must purchase, if they choose to purchase it.
3282    /// Because this item is optional, the customer will always be able to remove it from their order, even if the `minimum` configured here is greater than 0.
3283    /// By default this value is 0.
3284    #[serde(skip_serializing_if = "Option::is_none")]
3285    pub minimum: Option<i64>,
3286}
3287#[cfg(feature = "redact-generated-debug")]
3288impl std::fmt::Debug for CreateCheckoutSessionOptionalItemsAdjustableQuantity {
3289    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3290        f.debug_struct("CreateCheckoutSessionOptionalItemsAdjustableQuantity")
3291            .finish_non_exhaustive()
3292    }
3293}
3294impl CreateCheckoutSessionOptionalItemsAdjustableQuantity {
3295    pub fn new(enabled: impl Into<bool>) -> Self {
3296        Self { enabled: enabled.into(), maximum: None, minimum: None }
3297    }
3298}
3299/// A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode.
3300#[derive(Clone)]
3301#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
3302#[derive(serde::Serialize)]
3303pub struct CreateCheckoutSessionPaymentIntentData {
3304    /// 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.
3305    /// The amount of the application fee collected will be capped at the total amount captured.
3306    /// For more information, see the PaymentIntents [use case for connected accounts](https://docs.stripe.com/payments/connected-accounts).
3307    #[serde(skip_serializing_if = "Option::is_none")]
3308    pub application_fee_amount: Option<i64>,
3309    /// Controls when the funds will be captured from the customer's account.
3310    #[serde(skip_serializing_if = "Option::is_none")]
3311    pub capture_method: Option<CreateCheckoutSessionPaymentIntentDataCaptureMethod>,
3312    /// An arbitrary string attached to the object. Often useful for displaying to users.
3313    #[serde(skip_serializing_if = "Option::is_none")]
3314    pub description: Option<String>,
3315    /// Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object.
3316    /// This can be useful for storing additional information about the object in a structured format.
3317    /// Individual keys can be unset by posting an empty value to them.
3318    /// All keys can be unset by posting an empty value to `metadata`.
3319    #[serde(skip_serializing_if = "Option::is_none")]
3320    pub metadata: Option<std::collections::HashMap<String, String>>,
3321    /// The Stripe account ID for which these funds are intended. For details,
3322    /// see the PaymentIntents [use case for connected
3323    /// accounts](/docs/payments/connected-accounts).
3324    #[serde(skip_serializing_if = "Option::is_none")]
3325    pub on_behalf_of: Option<String>,
3326    /// Email address that the receipt for the resulting payment will be sent to.
3327    /// If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails).
3328    #[serde(skip_serializing_if = "Option::is_none")]
3329    pub receipt_email: Option<String>,
3330    /// Indicates that you intend to [make future payments](https://docs.stripe.com/payments/payment-intents#future-usage) with the payment.
3331    /// method collected by this Checkout Session.
3332    ///
3333    /// When setting this to `on_session`, Checkout will show a notice to the
3334    /// customer that their payment details will be saved.
3335    ///
3336    /// When setting this to `off_session`, Checkout will show a notice to the
3337    /// customer that their payment details will be saved and used for future
3338    /// payments.
3339    ///
3340    /// If a Customer has been provided or Checkout creates a new Customer,
3341    /// Checkout will attach the payment method to the Customer.
3342    ///
3343    /// If Checkout does not create a Customer, the payment method is not attached
3344    /// to a Customer. To reuse the payment method, you can retrieve it from the
3345    /// Checkout Session's PaymentIntent.
3346    ///
3347    /// When processing card payments, Checkout also uses `setup_future_usage`
3348    /// to dynamically optimize your payment flow and comply with regional
3349    /// legislation and network rules, such as SCA.
3350    #[serde(skip_serializing_if = "Option::is_none")]
3351    pub setup_future_usage: Option<CreateCheckoutSessionPaymentIntentDataSetupFutureUsage>,
3352    /// Shipping information for this payment.
3353    #[serde(skip_serializing_if = "Option::is_none")]
3354    pub shipping: Option<CreateCheckoutSessionPaymentIntentDataShipping>,
3355    /// Text that appears on the customer's statement as the statement descriptor for a non-card charge.
3356    /// This value overrides the account's default statement descriptor.
3357    /// For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors).
3358    ///
3359    /// Setting this value for a card charge returns an error.
3360    /// For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead.
3361    #[serde(skip_serializing_if = "Option::is_none")]
3362    pub statement_descriptor: Option<String>,
3363    /// Provides information about a card charge.
3364    /// 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.
3365    #[serde(skip_serializing_if = "Option::is_none")]
3366    pub statement_descriptor_suffix: Option<String>,
3367    /// The parameters used to automatically create a Transfer when the payment succeeds.
3368    /// For more information, see the PaymentIntents [use case for connected accounts](https://docs.stripe.com/payments/connected-accounts).
3369    #[serde(skip_serializing_if = "Option::is_none")]
3370    pub transfer_data: Option<CreateCheckoutSessionPaymentIntentDataTransferData>,
3371    /// A string that identifies the resulting payment as part of a group.
3372    /// See the PaymentIntents [use case for connected accounts](https://docs.stripe.com/connect/separate-charges-and-transfers) for details.
3373    #[serde(skip_serializing_if = "Option::is_none")]
3374    pub transfer_group: Option<String>,
3375}
3376#[cfg(feature = "redact-generated-debug")]
3377impl std::fmt::Debug for CreateCheckoutSessionPaymentIntentData {
3378    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3379        f.debug_struct("CreateCheckoutSessionPaymentIntentData").finish_non_exhaustive()
3380    }
3381}
3382impl CreateCheckoutSessionPaymentIntentData {
3383    pub fn new() -> Self {
3384        Self {
3385            application_fee_amount: None,
3386            capture_method: None,
3387            description: None,
3388            metadata: None,
3389            on_behalf_of: None,
3390            receipt_email: None,
3391            setup_future_usage: None,
3392            shipping: None,
3393            statement_descriptor: None,
3394            statement_descriptor_suffix: None,
3395            transfer_data: None,
3396            transfer_group: None,
3397        }
3398    }
3399}
3400impl Default for CreateCheckoutSessionPaymentIntentData {
3401    fn default() -> Self {
3402        Self::new()
3403    }
3404}
3405/// Controls when the funds will be captured from the customer's account.
3406#[derive(Clone, Eq, PartialEq)]
3407#[non_exhaustive]
3408pub enum CreateCheckoutSessionPaymentIntentDataCaptureMethod {
3409    Automatic,
3410    AutomaticAsync,
3411    Manual,
3412    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3413    Unknown(String),
3414}
3415impl CreateCheckoutSessionPaymentIntentDataCaptureMethod {
3416    pub fn as_str(&self) -> &str {
3417        use CreateCheckoutSessionPaymentIntentDataCaptureMethod::*;
3418        match self {
3419            Automatic => "automatic",
3420            AutomaticAsync => "automatic_async",
3421            Manual => "manual",
3422            Unknown(v) => v,
3423        }
3424    }
3425}
3426
3427impl std::str::FromStr for CreateCheckoutSessionPaymentIntentDataCaptureMethod {
3428    type Err = std::convert::Infallible;
3429    fn from_str(s: &str) -> Result<Self, Self::Err> {
3430        use CreateCheckoutSessionPaymentIntentDataCaptureMethod::*;
3431        match s {
3432            "automatic" => Ok(Automatic),
3433            "automatic_async" => Ok(AutomaticAsync),
3434            "manual" => Ok(Manual),
3435            v => {
3436                tracing::warn!(
3437                    "Unknown value '{}' for enum '{}'",
3438                    v,
3439                    "CreateCheckoutSessionPaymentIntentDataCaptureMethod"
3440                );
3441                Ok(Unknown(v.to_owned()))
3442            }
3443        }
3444    }
3445}
3446impl std::fmt::Display for CreateCheckoutSessionPaymentIntentDataCaptureMethod {
3447    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3448        f.write_str(self.as_str())
3449    }
3450}
3451
3452#[cfg(not(feature = "redact-generated-debug"))]
3453impl std::fmt::Debug for CreateCheckoutSessionPaymentIntentDataCaptureMethod {
3454    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3455        f.write_str(self.as_str())
3456    }
3457}
3458#[cfg(feature = "redact-generated-debug")]
3459impl std::fmt::Debug for CreateCheckoutSessionPaymentIntentDataCaptureMethod {
3460    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3461        f.debug_struct(stringify!(CreateCheckoutSessionPaymentIntentDataCaptureMethod))
3462            .finish_non_exhaustive()
3463    }
3464}
3465impl serde::Serialize for CreateCheckoutSessionPaymentIntentDataCaptureMethod {
3466    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3467    where
3468        S: serde::Serializer,
3469    {
3470        serializer.serialize_str(self.as_str())
3471    }
3472}
3473#[cfg(feature = "deserialize")]
3474impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionPaymentIntentDataCaptureMethod {
3475    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3476        use std::str::FromStr;
3477        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3478        Ok(Self::from_str(&s).expect("infallible"))
3479    }
3480}
3481/// Indicates that you intend to [make future payments](https://docs.stripe.com/payments/payment-intents#future-usage) with the payment.
3482/// method collected by this Checkout Session.
3483///
3484/// When setting this to `on_session`, Checkout will show a notice to the
3485/// customer that their payment details will be saved.
3486///
3487/// When setting this to `off_session`, Checkout will show a notice to the
3488/// customer that their payment details will be saved and used for future
3489/// payments.
3490///
3491/// If a Customer has been provided or Checkout creates a new Customer,
3492/// Checkout will attach the payment method to the Customer.
3493///
3494/// If Checkout does not create a Customer, the payment method is not attached
3495/// to a Customer. To reuse the payment method, you can retrieve it from the
3496/// Checkout Session's PaymentIntent.
3497///
3498/// When processing card payments, Checkout also uses `setup_future_usage`
3499/// to dynamically optimize your payment flow and comply with regional
3500/// legislation and network rules, such as SCA.
3501#[derive(Clone, Eq, PartialEq)]
3502#[non_exhaustive]
3503pub enum CreateCheckoutSessionPaymentIntentDataSetupFutureUsage {
3504    OffSession,
3505    OnSession,
3506    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3507    Unknown(String),
3508}
3509impl CreateCheckoutSessionPaymentIntentDataSetupFutureUsage {
3510    pub fn as_str(&self) -> &str {
3511        use CreateCheckoutSessionPaymentIntentDataSetupFutureUsage::*;
3512        match self {
3513            OffSession => "off_session",
3514            OnSession => "on_session",
3515            Unknown(v) => v,
3516        }
3517    }
3518}
3519
3520impl std::str::FromStr for CreateCheckoutSessionPaymentIntentDataSetupFutureUsage {
3521    type Err = std::convert::Infallible;
3522    fn from_str(s: &str) -> Result<Self, Self::Err> {
3523        use CreateCheckoutSessionPaymentIntentDataSetupFutureUsage::*;
3524        match s {
3525            "off_session" => Ok(OffSession),
3526            "on_session" => Ok(OnSession),
3527            v => {
3528                tracing::warn!(
3529                    "Unknown value '{}' for enum '{}'",
3530                    v,
3531                    "CreateCheckoutSessionPaymentIntentDataSetupFutureUsage"
3532                );
3533                Ok(Unknown(v.to_owned()))
3534            }
3535        }
3536    }
3537}
3538impl std::fmt::Display for CreateCheckoutSessionPaymentIntentDataSetupFutureUsage {
3539    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3540        f.write_str(self.as_str())
3541    }
3542}
3543
3544#[cfg(not(feature = "redact-generated-debug"))]
3545impl std::fmt::Debug for CreateCheckoutSessionPaymentIntentDataSetupFutureUsage {
3546    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3547        f.write_str(self.as_str())
3548    }
3549}
3550#[cfg(feature = "redact-generated-debug")]
3551impl std::fmt::Debug for CreateCheckoutSessionPaymentIntentDataSetupFutureUsage {
3552    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3553        f.debug_struct(stringify!(CreateCheckoutSessionPaymentIntentDataSetupFutureUsage))
3554            .finish_non_exhaustive()
3555    }
3556}
3557impl serde::Serialize for CreateCheckoutSessionPaymentIntentDataSetupFutureUsage {
3558    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3559    where
3560        S: serde::Serializer,
3561    {
3562        serializer.serialize_str(self.as_str())
3563    }
3564}
3565#[cfg(feature = "deserialize")]
3566impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionPaymentIntentDataSetupFutureUsage {
3567    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3568        use std::str::FromStr;
3569        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3570        Ok(Self::from_str(&s).expect("infallible"))
3571    }
3572}
3573/// Shipping information for this payment.
3574#[derive(Clone, Eq, PartialEq)]
3575#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
3576#[derive(serde::Serialize)]
3577pub struct CreateCheckoutSessionPaymentIntentDataShipping {
3578    /// Shipping address.
3579    pub address: CreateCheckoutSessionPaymentIntentDataShippingAddress,
3580    /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
3581    #[serde(skip_serializing_if = "Option::is_none")]
3582    pub carrier: Option<String>,
3583    /// Recipient name.
3584    pub name: String,
3585    /// Recipient phone (including extension).
3586    #[serde(skip_serializing_if = "Option::is_none")]
3587    pub phone: Option<String>,
3588    /// The tracking number for a physical product, obtained from the delivery service.
3589    /// If multiple tracking numbers were generated for this purchase, please separate them with commas.
3590    #[serde(skip_serializing_if = "Option::is_none")]
3591    pub tracking_number: Option<String>,
3592}
3593#[cfg(feature = "redact-generated-debug")]
3594impl std::fmt::Debug for CreateCheckoutSessionPaymentIntentDataShipping {
3595    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3596        f.debug_struct("CreateCheckoutSessionPaymentIntentDataShipping").finish_non_exhaustive()
3597    }
3598}
3599impl CreateCheckoutSessionPaymentIntentDataShipping {
3600    pub fn new(
3601        address: impl Into<CreateCheckoutSessionPaymentIntentDataShippingAddress>,
3602        name: impl Into<String>,
3603    ) -> Self {
3604        Self {
3605            address: address.into(),
3606            carrier: None,
3607            name: name.into(),
3608            phone: None,
3609            tracking_number: None,
3610        }
3611    }
3612}
3613/// Shipping address.
3614#[derive(Clone, Eq, PartialEq)]
3615#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
3616#[derive(serde::Serialize)]
3617pub struct CreateCheckoutSessionPaymentIntentDataShippingAddress {
3618    /// City, district, suburb, town, or village.
3619    #[serde(skip_serializing_if = "Option::is_none")]
3620    pub city: Option<String>,
3621    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
3622    #[serde(skip_serializing_if = "Option::is_none")]
3623    pub country: Option<String>,
3624    /// Address line 1, such as the street, PO Box, or company name.
3625    pub line1: String,
3626    /// Address line 2, such as the apartment, suite, unit, or building.
3627    #[serde(skip_serializing_if = "Option::is_none")]
3628    pub line2: Option<String>,
3629    /// ZIP or postal code.
3630    #[serde(skip_serializing_if = "Option::is_none")]
3631    pub postal_code: Option<String>,
3632    /// State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)).
3633    #[serde(skip_serializing_if = "Option::is_none")]
3634    pub state: Option<String>,
3635}
3636#[cfg(feature = "redact-generated-debug")]
3637impl std::fmt::Debug for CreateCheckoutSessionPaymentIntentDataShippingAddress {
3638    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3639        f.debug_struct("CreateCheckoutSessionPaymentIntentDataShippingAddress")
3640            .finish_non_exhaustive()
3641    }
3642}
3643impl CreateCheckoutSessionPaymentIntentDataShippingAddress {
3644    pub fn new(line1: impl Into<String>) -> Self {
3645        Self {
3646            city: None,
3647            country: None,
3648            line1: line1.into(),
3649            line2: None,
3650            postal_code: None,
3651            state: None,
3652        }
3653    }
3654}
3655/// The parameters used to automatically create a Transfer when the payment succeeds.
3656/// For more information, see the PaymentIntents [use case for connected accounts](https://docs.stripe.com/payments/connected-accounts).
3657#[derive(Clone, Eq, PartialEq)]
3658#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
3659#[derive(serde::Serialize)]
3660pub struct CreateCheckoutSessionPaymentIntentDataTransferData {
3661    /// The amount that will be transferred automatically when a charge succeeds.
3662    #[serde(skip_serializing_if = "Option::is_none")]
3663    pub amount: Option<i64>,
3664    /// If specified, successful charges will be attributed to the destination
3665    /// account for tax reporting, and the funds from charges will be transferred
3666    /// to the destination account. The ID of the resulting transfer will be
3667    /// returned on the successful charge's `transfer` field.
3668    pub destination: String,
3669}
3670#[cfg(feature = "redact-generated-debug")]
3671impl std::fmt::Debug for CreateCheckoutSessionPaymentIntentDataTransferData {
3672    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3673        f.debug_struct("CreateCheckoutSessionPaymentIntentDataTransferData").finish_non_exhaustive()
3674    }
3675}
3676impl CreateCheckoutSessionPaymentIntentDataTransferData {
3677    pub fn new(destination: impl Into<String>) -> Self {
3678        Self { amount: None, destination: destination.into() }
3679    }
3680}
3681/// Specify whether Checkout should collect a payment method.
3682/// When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.
3683/// This may occur if the Checkout Session includes a free trial or a discount.
3684///
3685/// Can only be set in `subscription` mode. Defaults to `always`.
3686///
3687/// If you'd like information on how to collect a payment method outside of Checkout, read the guide on configuring [subscriptions with a free trial](https://docs.stripe.com/payments/checkout/free-trials).
3688#[derive(Clone, Eq, PartialEq)]
3689#[non_exhaustive]
3690pub enum CreateCheckoutSessionPaymentMethodCollection {
3691    Always,
3692    IfRequired,
3693    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3694    Unknown(String),
3695}
3696impl CreateCheckoutSessionPaymentMethodCollection {
3697    pub fn as_str(&self) -> &str {
3698        use CreateCheckoutSessionPaymentMethodCollection::*;
3699        match self {
3700            Always => "always",
3701            IfRequired => "if_required",
3702            Unknown(v) => v,
3703        }
3704    }
3705}
3706
3707impl std::str::FromStr for CreateCheckoutSessionPaymentMethodCollection {
3708    type Err = std::convert::Infallible;
3709    fn from_str(s: &str) -> Result<Self, Self::Err> {
3710        use CreateCheckoutSessionPaymentMethodCollection::*;
3711        match s {
3712            "always" => Ok(Always),
3713            "if_required" => Ok(IfRequired),
3714            v => {
3715                tracing::warn!(
3716                    "Unknown value '{}' for enum '{}'",
3717                    v,
3718                    "CreateCheckoutSessionPaymentMethodCollection"
3719                );
3720                Ok(Unknown(v.to_owned()))
3721            }
3722        }
3723    }
3724}
3725impl std::fmt::Display for CreateCheckoutSessionPaymentMethodCollection {
3726    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3727        f.write_str(self.as_str())
3728    }
3729}
3730
3731#[cfg(not(feature = "redact-generated-debug"))]
3732impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodCollection {
3733    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3734        f.write_str(self.as_str())
3735    }
3736}
3737#[cfg(feature = "redact-generated-debug")]
3738impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodCollection {
3739    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3740        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodCollection))
3741            .finish_non_exhaustive()
3742    }
3743}
3744impl serde::Serialize for CreateCheckoutSessionPaymentMethodCollection {
3745    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3746    where
3747        S: serde::Serializer,
3748    {
3749        serializer.serialize_str(self.as_str())
3750    }
3751}
3752#[cfg(feature = "deserialize")]
3753impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionPaymentMethodCollection {
3754    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3755        use std::str::FromStr;
3756        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3757        Ok(Self::from_str(&s).expect("infallible"))
3758    }
3759}
3760/// This parameter allows you to set some attributes on the payment method created during a Checkout session.
3761#[derive(Clone, Eq, PartialEq)]
3762#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
3763#[derive(serde::Serialize)]
3764pub struct CreateCheckoutSessionPaymentMethodData {
3765    /// Allow redisplay will be set on the payment method on confirmation and indicates whether this payment method can be shown again to the customer in a checkout flow.
3766    /// Only set this field if you wish to override the allow_redisplay value determined by Checkout.
3767    #[serde(skip_serializing_if = "Option::is_none")]
3768    pub allow_redisplay: Option<CreateCheckoutSessionPaymentMethodDataAllowRedisplay>,
3769}
3770#[cfg(feature = "redact-generated-debug")]
3771impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodData {
3772    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3773        f.debug_struct("CreateCheckoutSessionPaymentMethodData").finish_non_exhaustive()
3774    }
3775}
3776impl CreateCheckoutSessionPaymentMethodData {
3777    pub fn new() -> Self {
3778        Self { allow_redisplay: None }
3779    }
3780}
3781impl Default for CreateCheckoutSessionPaymentMethodData {
3782    fn default() -> Self {
3783        Self::new()
3784    }
3785}
3786/// Allow redisplay will be set on the payment method on confirmation and indicates whether this payment method can be shown again to the customer in a checkout flow.
3787/// Only set this field if you wish to override the allow_redisplay value determined by Checkout.
3788#[derive(Clone, Eq, PartialEq)]
3789#[non_exhaustive]
3790pub enum CreateCheckoutSessionPaymentMethodDataAllowRedisplay {
3791    Always,
3792    Limited,
3793    Unspecified,
3794    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3795    Unknown(String),
3796}
3797impl CreateCheckoutSessionPaymentMethodDataAllowRedisplay {
3798    pub fn as_str(&self) -> &str {
3799        use CreateCheckoutSessionPaymentMethodDataAllowRedisplay::*;
3800        match self {
3801            Always => "always",
3802            Limited => "limited",
3803            Unspecified => "unspecified",
3804            Unknown(v) => v,
3805        }
3806    }
3807}
3808
3809impl std::str::FromStr for CreateCheckoutSessionPaymentMethodDataAllowRedisplay {
3810    type Err = std::convert::Infallible;
3811    fn from_str(s: &str) -> Result<Self, Self::Err> {
3812        use CreateCheckoutSessionPaymentMethodDataAllowRedisplay::*;
3813        match s {
3814            "always" => Ok(Always),
3815            "limited" => Ok(Limited),
3816            "unspecified" => Ok(Unspecified),
3817            v => {
3818                tracing::warn!(
3819                    "Unknown value '{}' for enum '{}'",
3820                    v,
3821                    "CreateCheckoutSessionPaymentMethodDataAllowRedisplay"
3822                );
3823                Ok(Unknown(v.to_owned()))
3824            }
3825        }
3826    }
3827}
3828impl std::fmt::Display for CreateCheckoutSessionPaymentMethodDataAllowRedisplay {
3829    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3830        f.write_str(self.as_str())
3831    }
3832}
3833
3834#[cfg(not(feature = "redact-generated-debug"))]
3835impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodDataAllowRedisplay {
3836    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3837        f.write_str(self.as_str())
3838    }
3839}
3840#[cfg(feature = "redact-generated-debug")]
3841impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodDataAllowRedisplay {
3842    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3843        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodDataAllowRedisplay))
3844            .finish_non_exhaustive()
3845    }
3846}
3847impl serde::Serialize for CreateCheckoutSessionPaymentMethodDataAllowRedisplay {
3848    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3849    where
3850        S: serde::Serializer,
3851    {
3852        serializer.serialize_str(self.as_str())
3853    }
3854}
3855#[cfg(feature = "deserialize")]
3856impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionPaymentMethodDataAllowRedisplay {
3857    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3858        use std::str::FromStr;
3859        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3860        Ok(Self::from_str(&s).expect("infallible"))
3861    }
3862}
3863/// Payment-method-specific configuration.
3864#[derive(Clone)]
3865#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
3866#[derive(serde::Serialize)]
3867pub struct CreateCheckoutSessionPaymentMethodOptions {
3868    /// contains details about the ACSS Debit payment method options.
3869    /// You can't set this parameter if `ui_mode` is `elements`.
3870    #[serde(skip_serializing_if = "Option::is_none")]
3871    pub acss_debit: Option<CreateCheckoutSessionPaymentMethodOptionsAcssDebit>,
3872    /// contains details about the Affirm payment method options.
3873    #[serde(skip_serializing_if = "Option::is_none")]
3874    pub affirm: Option<CreateCheckoutSessionPaymentMethodOptionsAffirm>,
3875    /// contains details about the Afterpay Clearpay payment method options.
3876    #[serde(skip_serializing_if = "Option::is_none")]
3877    pub afterpay_clearpay: Option<CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpay>,
3878    /// contains details about the Alipay payment method options.
3879    #[serde(skip_serializing_if = "Option::is_none")]
3880    pub alipay: Option<CreateCheckoutSessionPaymentMethodOptionsAlipay>,
3881    /// contains details about the Alma payment method options.
3882    #[serde(skip_serializing_if = "Option::is_none")]
3883    pub alma: Option<CreateCheckoutSessionPaymentMethodOptionsAlma>,
3884    /// contains details about the AmazonPay payment method options.
3885    #[serde(skip_serializing_if = "Option::is_none")]
3886    pub amazon_pay: Option<CreateCheckoutSessionPaymentMethodOptionsAmazonPay>,
3887    /// contains details about the AU Becs Debit payment method options.
3888    #[serde(skip_serializing_if = "Option::is_none")]
3889    pub au_becs_debit: Option<CreateCheckoutSessionPaymentMethodOptionsAuBecsDebit>,
3890    /// contains details about the Bacs Debit payment method options.
3891    #[serde(skip_serializing_if = "Option::is_none")]
3892    pub bacs_debit: Option<CreateCheckoutSessionPaymentMethodOptionsBacsDebit>,
3893    /// contains details about the Bancontact payment method options.
3894    #[serde(skip_serializing_if = "Option::is_none")]
3895    pub bancontact: Option<CreateCheckoutSessionPaymentMethodOptionsBancontact>,
3896    /// contains details about the Billie payment method options.
3897    #[serde(skip_serializing_if = "Option::is_none")]
3898    pub billie: Option<CreateCheckoutSessionPaymentMethodOptionsBillie>,
3899    /// contains details about the Boleto payment method options.
3900    #[serde(skip_serializing_if = "Option::is_none")]
3901    pub boleto: Option<CreateCheckoutSessionPaymentMethodOptionsBoleto>,
3902    /// contains details about the Card payment method options.
3903    #[serde(skip_serializing_if = "Option::is_none")]
3904    pub card: Option<CreateCheckoutSessionPaymentMethodOptionsCard>,
3905    /// contains details about the Cashapp Pay payment method options.
3906    #[serde(skip_serializing_if = "Option::is_none")]
3907    pub cashapp: Option<CreateCheckoutSessionPaymentMethodOptionsCashapp>,
3908    /// contains details about the Crypto payment method options.
3909    #[serde(skip_serializing_if = "Option::is_none")]
3910    pub crypto: Option<CreateCheckoutSessionPaymentMethodOptionsCrypto>,
3911    /// contains details about the Customer Balance payment method options.
3912    #[serde(skip_serializing_if = "Option::is_none")]
3913    pub customer_balance: Option<CreateCheckoutSessionPaymentMethodOptionsCustomerBalance>,
3914    /// contains details about the DemoPay payment method options.
3915    #[serde(skip_serializing_if = "Option::is_none")]
3916    pub demo_pay: Option<CreateCheckoutSessionPaymentMethodOptionsDemoPay>,
3917    /// contains details about the EPS payment method options.
3918    #[serde(skip_serializing_if = "Option::is_none")]
3919    pub eps: Option<CreateCheckoutSessionPaymentMethodOptionsEps>,
3920    /// contains details about the FPX payment method options.
3921    #[serde(skip_serializing_if = "Option::is_none")]
3922    pub fpx: Option<CreateCheckoutSessionPaymentMethodOptionsFpx>,
3923    /// contains details about the Giropay payment method options.
3924    #[serde(skip_serializing_if = "Option::is_none")]
3925    pub giropay: Option<CreateCheckoutSessionPaymentMethodOptionsGiropay>,
3926    /// contains details about the Grabpay payment method options.
3927    #[serde(skip_serializing_if = "Option::is_none")]
3928    pub grabpay: Option<CreateCheckoutSessionPaymentMethodOptionsGrabpay>,
3929    /// contains details about the Ideal payment method options.
3930    #[serde(skip_serializing_if = "Option::is_none")]
3931    pub ideal: Option<CreateCheckoutSessionPaymentMethodOptionsIdeal>,
3932    /// contains details about the Kakao Pay payment method options.
3933    #[serde(skip_serializing_if = "Option::is_none")]
3934    pub kakao_pay: Option<CreateCheckoutSessionPaymentMethodOptionsKakaoPay>,
3935    /// contains details about the Klarna payment method options.
3936    #[serde(skip_serializing_if = "Option::is_none")]
3937    pub klarna: Option<CreateCheckoutSessionPaymentMethodOptionsKlarna>,
3938    /// contains details about the Konbini payment method options.
3939    #[serde(skip_serializing_if = "Option::is_none")]
3940    pub konbini: Option<CreateCheckoutSessionPaymentMethodOptionsKonbini>,
3941    /// contains details about the Korean card payment method options.
3942    #[serde(skip_serializing_if = "Option::is_none")]
3943    pub kr_card: Option<CreateCheckoutSessionPaymentMethodOptionsKrCard>,
3944    /// contains details about the Link payment method options (Link is also known as Onelink in the UK).
3945    #[serde(skip_serializing_if = "Option::is_none")]
3946    pub link: Option<CreateCheckoutSessionPaymentMethodOptionsLink>,
3947    /// contains details about the Mobilepay payment method options.
3948    #[serde(skip_serializing_if = "Option::is_none")]
3949    pub mobilepay: Option<CreateCheckoutSessionPaymentMethodOptionsMobilepay>,
3950    /// contains details about the Multibanco payment method options.
3951    #[serde(skip_serializing_if = "Option::is_none")]
3952    pub multibanco: Option<CreateCheckoutSessionPaymentMethodOptionsMultibanco>,
3953    /// contains details about the Naver Pay payment method options.
3954    #[serde(skip_serializing_if = "Option::is_none")]
3955    pub naver_pay: Option<CreateCheckoutSessionPaymentMethodOptionsNaverPay>,
3956    /// contains details about the OXXO payment method options.
3957    #[serde(skip_serializing_if = "Option::is_none")]
3958    pub oxxo: Option<CreateCheckoutSessionPaymentMethodOptionsOxxo>,
3959    /// contains details about the P24 payment method options.
3960    #[serde(skip_serializing_if = "Option::is_none")]
3961    pub p24: Option<CreateCheckoutSessionPaymentMethodOptionsP24>,
3962    /// contains details about the Pay By Bank payment method options.
3963    #[serde(skip_serializing_if = "Option::is_none")]
3964    #[serde(with = "stripe_types::with_serde_json_opt")]
3965    pub pay_by_bank: Option<miniserde::json::Value>,
3966    /// contains details about the PAYCO payment method options.
3967    #[serde(skip_serializing_if = "Option::is_none")]
3968    pub payco: Option<CreateCheckoutSessionPaymentMethodOptionsPayco>,
3969    /// contains details about the PayNow payment method options.
3970    #[serde(skip_serializing_if = "Option::is_none")]
3971    pub paynow: Option<CreateCheckoutSessionPaymentMethodOptionsPaynow>,
3972    /// contains details about the PayPal payment method options.
3973    #[serde(skip_serializing_if = "Option::is_none")]
3974    pub paypal: Option<CreateCheckoutSessionPaymentMethodOptionsPaypal>,
3975    /// contains details about the PayTo payment method options.
3976    #[serde(skip_serializing_if = "Option::is_none")]
3977    pub payto: Option<CreateCheckoutSessionPaymentMethodOptionsPayto>,
3978    /// contains details about the Pix payment method options.
3979    #[serde(skip_serializing_if = "Option::is_none")]
3980    pub pix: Option<CreateCheckoutSessionPaymentMethodOptionsPix>,
3981    /// contains details about the RevolutPay payment method options.
3982    #[serde(skip_serializing_if = "Option::is_none")]
3983    pub revolut_pay: Option<CreateCheckoutSessionPaymentMethodOptionsRevolutPay>,
3984    /// contains details about the Samsung Pay payment method options.
3985    #[serde(skip_serializing_if = "Option::is_none")]
3986    pub samsung_pay: Option<CreateCheckoutSessionPaymentMethodOptionsSamsungPay>,
3987    /// contains details about the Satispay payment method options.
3988    #[serde(skip_serializing_if = "Option::is_none")]
3989    pub satispay: Option<CreateCheckoutSessionPaymentMethodOptionsSatispay>,
3990    /// contains details about the Scalapay payment method options.
3991    #[serde(skip_serializing_if = "Option::is_none")]
3992    pub scalapay: Option<CreateCheckoutSessionPaymentMethodOptionsScalapay>,
3993    /// contains details about the Sepa Debit payment method options.
3994    #[serde(skip_serializing_if = "Option::is_none")]
3995    pub sepa_debit: Option<CreateCheckoutSessionPaymentMethodOptionsSepaDebit>,
3996    /// contains details about the Sofort payment method options.
3997    #[serde(skip_serializing_if = "Option::is_none")]
3998    pub sofort: Option<CreateCheckoutSessionPaymentMethodOptionsSofort>,
3999    /// contains details about the Sunbit payment method options.
4000    #[serde(skip_serializing_if = "Option::is_none")]
4001    pub sunbit: Option<CreateCheckoutSessionPaymentMethodOptionsSunbit>,
4002    /// contains details about the Swish payment method options.
4003    #[serde(skip_serializing_if = "Option::is_none")]
4004    pub swish: Option<CreateCheckoutSessionPaymentMethodOptionsSwish>,
4005    /// contains details about the TWINT payment method options.
4006    #[serde(skip_serializing_if = "Option::is_none")]
4007    pub twint: Option<CreateCheckoutSessionPaymentMethodOptionsTwint>,
4008    /// contains details about the UPI payment method options.
4009    #[serde(skip_serializing_if = "Option::is_none")]
4010    pub upi: Option<CreateCheckoutSessionPaymentMethodOptionsUpi>,
4011    /// contains details about the Us Bank Account payment method options.
4012    #[serde(skip_serializing_if = "Option::is_none")]
4013    pub us_bank_account: Option<CreateCheckoutSessionPaymentMethodOptionsUsBankAccount>,
4014    /// contains details about the WeChat Pay payment method options.
4015    #[serde(skip_serializing_if = "Option::is_none")]
4016    pub wechat_pay: Option<CreateCheckoutSessionPaymentMethodOptionsWechatPay>,
4017}
4018#[cfg(feature = "redact-generated-debug")]
4019impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptions {
4020    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4021        f.debug_struct("CreateCheckoutSessionPaymentMethodOptions").finish_non_exhaustive()
4022    }
4023}
4024impl CreateCheckoutSessionPaymentMethodOptions {
4025    pub fn new() -> Self {
4026        Self {
4027            acss_debit: None,
4028            affirm: None,
4029            afterpay_clearpay: None,
4030            alipay: None,
4031            alma: None,
4032            amazon_pay: None,
4033            au_becs_debit: None,
4034            bacs_debit: None,
4035            bancontact: None,
4036            billie: None,
4037            boleto: None,
4038            card: None,
4039            cashapp: None,
4040            crypto: None,
4041            customer_balance: None,
4042            demo_pay: None,
4043            eps: None,
4044            fpx: None,
4045            giropay: None,
4046            grabpay: None,
4047            ideal: None,
4048            kakao_pay: None,
4049            klarna: None,
4050            konbini: None,
4051            kr_card: None,
4052            link: None,
4053            mobilepay: None,
4054            multibanco: None,
4055            naver_pay: None,
4056            oxxo: None,
4057            p24: None,
4058            pay_by_bank: None,
4059            payco: None,
4060            paynow: None,
4061            paypal: None,
4062            payto: None,
4063            pix: None,
4064            revolut_pay: None,
4065            samsung_pay: None,
4066            satispay: None,
4067            scalapay: None,
4068            sepa_debit: None,
4069            sofort: None,
4070            sunbit: None,
4071            swish: None,
4072            twint: None,
4073            upi: None,
4074            us_bank_account: None,
4075            wechat_pay: None,
4076        }
4077    }
4078}
4079impl Default for CreateCheckoutSessionPaymentMethodOptions {
4080    fn default() -> Self {
4081        Self::new()
4082    }
4083}
4084/// contains details about the ACSS Debit payment method options.
4085/// You can't set this parameter if `ui_mode` is `elements`.
4086#[derive(Clone, Eq, PartialEq)]
4087#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
4088#[derive(serde::Serialize)]
4089pub struct CreateCheckoutSessionPaymentMethodOptionsAcssDebit {
4090    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
4091    /// Must be a [supported currency](https://stripe.com/docs/currencies).
4092    /// This is only accepted for Checkout Sessions in `setup` mode.
4093    #[serde(skip_serializing_if = "Option::is_none")]
4094    pub currency: Option<CreateCheckoutSessionPaymentMethodOptionsAcssDebitCurrency>,
4095    /// Additional fields for Mandate creation
4096    #[serde(skip_serializing_if = "Option::is_none")]
4097    pub mandate_options: Option<CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptions>,
4098    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
4099    ///
4100    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
4101    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
4102    ///
4103    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
4104    ///
4105    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
4106    #[serde(skip_serializing_if = "Option::is_none")]
4107    pub setup_future_usage:
4108        Option<CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage>,
4109    /// Controls when Stripe will attempt to debit the funds from the customer's account.
4110    /// The date must be a string in YYYY-MM-DD format.
4111    /// The date must be in the future and between 3 and 15 calendar days from now.
4112    #[serde(skip_serializing_if = "Option::is_none")]
4113    pub target_date: Option<String>,
4114    /// Verification method for the intent
4115    #[serde(skip_serializing_if = "Option::is_none")]
4116    pub verification_method:
4117        Option<CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod>,
4118}
4119#[cfg(feature = "redact-generated-debug")]
4120impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAcssDebit {
4121    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4122        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsAcssDebit").finish_non_exhaustive()
4123    }
4124}
4125impl CreateCheckoutSessionPaymentMethodOptionsAcssDebit {
4126    pub fn new() -> Self {
4127        Self {
4128            currency: None,
4129            mandate_options: None,
4130            setup_future_usage: None,
4131            target_date: None,
4132            verification_method: None,
4133        }
4134    }
4135}
4136impl Default for CreateCheckoutSessionPaymentMethodOptionsAcssDebit {
4137    fn default() -> Self {
4138        Self::new()
4139    }
4140}
4141/// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
4142/// Must be a [supported currency](https://stripe.com/docs/currencies).
4143/// This is only accepted for Checkout Sessions in `setup` mode.
4144#[derive(Clone, Eq, PartialEq)]
4145#[non_exhaustive]
4146pub enum CreateCheckoutSessionPaymentMethodOptionsAcssDebitCurrency {
4147    Cad,
4148    Usd,
4149    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4150    Unknown(String),
4151}
4152impl CreateCheckoutSessionPaymentMethodOptionsAcssDebitCurrency {
4153    pub fn as_str(&self) -> &str {
4154        use CreateCheckoutSessionPaymentMethodOptionsAcssDebitCurrency::*;
4155        match self {
4156            Cad => "cad",
4157            Usd => "usd",
4158            Unknown(v) => v,
4159        }
4160    }
4161}
4162
4163impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsAcssDebitCurrency {
4164    type Err = std::convert::Infallible;
4165    fn from_str(s: &str) -> Result<Self, Self::Err> {
4166        use CreateCheckoutSessionPaymentMethodOptionsAcssDebitCurrency::*;
4167        match s {
4168            "cad" => Ok(Cad),
4169            "usd" => Ok(Usd),
4170            v => {
4171                tracing::warn!(
4172                    "Unknown value '{}' for enum '{}'",
4173                    v,
4174                    "CreateCheckoutSessionPaymentMethodOptionsAcssDebitCurrency"
4175                );
4176                Ok(Unknown(v.to_owned()))
4177            }
4178        }
4179    }
4180}
4181impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsAcssDebitCurrency {
4182    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4183        f.write_str(self.as_str())
4184    }
4185}
4186
4187#[cfg(not(feature = "redact-generated-debug"))]
4188impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAcssDebitCurrency {
4189    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4190        f.write_str(self.as_str())
4191    }
4192}
4193#[cfg(feature = "redact-generated-debug")]
4194impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAcssDebitCurrency {
4195    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4196        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsAcssDebitCurrency))
4197            .finish_non_exhaustive()
4198    }
4199}
4200impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsAcssDebitCurrency {
4201    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4202    where
4203        S: serde::Serializer,
4204    {
4205        serializer.serialize_str(self.as_str())
4206    }
4207}
4208#[cfg(feature = "deserialize")]
4209impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionPaymentMethodOptionsAcssDebitCurrency {
4210    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4211        use std::str::FromStr;
4212        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4213        Ok(Self::from_str(&s).expect("infallible"))
4214    }
4215}
4216/// Additional fields for Mandate creation
4217#[derive(Clone, Eq, PartialEq)]
4218#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
4219#[derive(serde::Serialize)]
4220pub struct CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptions {
4221    /// A URL for custom mandate text to render during confirmation step.
4222    /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,.
4223    /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent.
4224    #[serde(skip_serializing_if = "Option::is_none")]
4225    pub custom_mandate_url: Option<String>,
4226    /// List of Stripe products where this mandate can be selected automatically.
4227    /// Only usable in `setup` mode.
4228    #[serde(skip_serializing_if = "Option::is_none")]
4229    pub default_for:
4230        Option<Vec<CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor>>,
4231    /// Description of the mandate interval.
4232    /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'.
4233    #[serde(skip_serializing_if = "Option::is_none")]
4234    pub interval_description: Option<String>,
4235    /// Payment schedule for the mandate.
4236    #[serde(skip_serializing_if = "Option::is_none")]
4237    pub payment_schedule:
4238        Option<CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
4239    /// Transaction type of the mandate.
4240    #[serde(skip_serializing_if = "Option::is_none")]
4241    pub transaction_type:
4242        Option<CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
4243}
4244#[cfg(feature = "redact-generated-debug")]
4245impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptions {
4246    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4247        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptions")
4248            .finish_non_exhaustive()
4249    }
4250}
4251impl CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptions {
4252    pub fn new() -> Self {
4253        Self {
4254            custom_mandate_url: None,
4255            default_for: None,
4256            interval_description: None,
4257            payment_schedule: None,
4258            transaction_type: None,
4259        }
4260    }
4261}
4262impl Default for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptions {
4263    fn default() -> Self {
4264        Self::new()
4265    }
4266}
4267/// List of Stripe products where this mandate can be selected automatically.
4268/// Only usable in `setup` mode.
4269#[derive(Clone, Eq, PartialEq)]
4270#[non_exhaustive]
4271pub enum CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
4272    Invoice,
4273    Subscription,
4274    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4275    Unknown(String),
4276}
4277impl CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
4278    pub fn as_str(&self) -> &str {
4279        use CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
4280        match self {
4281            Invoice => "invoice",
4282            Subscription => "subscription",
4283            Unknown(v) => v,
4284        }
4285    }
4286}
4287
4288impl std::str::FromStr
4289    for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
4290{
4291    type Err = std::convert::Infallible;
4292    fn from_str(s: &str) -> Result<Self, Self::Err> {
4293        use CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
4294        match s {
4295            "invoice" => Ok(Invoice),
4296            "subscription" => Ok(Subscription),
4297            v => {
4298                tracing::warn!(
4299                    "Unknown value '{}' for enum '{}'",
4300                    v,
4301                    "CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor"
4302                );
4303                Ok(Unknown(v.to_owned()))
4304            }
4305        }
4306    }
4307}
4308impl std::fmt::Display
4309    for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
4310{
4311    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4312        f.write_str(self.as_str())
4313    }
4314}
4315
4316#[cfg(not(feature = "redact-generated-debug"))]
4317impl std::fmt::Debug
4318    for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
4319{
4320    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4321        f.write_str(self.as_str())
4322    }
4323}
4324#[cfg(feature = "redact-generated-debug")]
4325impl std::fmt::Debug
4326    for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
4327{
4328    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4329        f.debug_struct(stringify!(
4330            CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
4331        ))
4332        .finish_non_exhaustive()
4333    }
4334}
4335impl serde::Serialize
4336    for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
4337{
4338    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4339    where
4340        S: serde::Serializer,
4341    {
4342        serializer.serialize_str(self.as_str())
4343    }
4344}
4345#[cfg(feature = "deserialize")]
4346impl<'de> serde::Deserialize<'de>
4347    for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
4348{
4349    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4350        use std::str::FromStr;
4351        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4352        Ok(Self::from_str(&s).expect("infallible"))
4353    }
4354}
4355/// Payment schedule for the mandate.
4356#[derive(Clone, Eq, PartialEq)]
4357#[non_exhaustive]
4358pub enum CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
4359    Combined,
4360    Interval,
4361    Sporadic,
4362    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4363    Unknown(String),
4364}
4365impl CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
4366    pub fn as_str(&self) -> &str {
4367        use CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
4368        match self {
4369            Combined => "combined",
4370            Interval => "interval",
4371            Sporadic => "sporadic",
4372            Unknown(v) => v,
4373        }
4374    }
4375}
4376
4377impl std::str::FromStr
4378    for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
4379{
4380    type Err = std::convert::Infallible;
4381    fn from_str(s: &str) -> Result<Self, Self::Err> {
4382        use CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
4383        match s {
4384            "combined" => Ok(Combined),
4385            "interval" => Ok(Interval),
4386            "sporadic" => Ok(Sporadic),
4387            v => {
4388                tracing::warn!(
4389                    "Unknown value '{}' for enum '{}'",
4390                    v,
4391                    "CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"
4392                );
4393                Ok(Unknown(v.to_owned()))
4394            }
4395        }
4396    }
4397}
4398impl std::fmt::Display
4399    for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
4400{
4401    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4402        f.write_str(self.as_str())
4403    }
4404}
4405
4406#[cfg(not(feature = "redact-generated-debug"))]
4407impl std::fmt::Debug
4408    for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
4409{
4410    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4411        f.write_str(self.as_str())
4412    }
4413}
4414#[cfg(feature = "redact-generated-debug")]
4415impl std::fmt::Debug
4416    for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
4417{
4418    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4419        f.debug_struct(stringify!(
4420            CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
4421        ))
4422        .finish_non_exhaustive()
4423    }
4424}
4425impl serde::Serialize
4426    for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
4427{
4428    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4429    where
4430        S: serde::Serializer,
4431    {
4432        serializer.serialize_str(self.as_str())
4433    }
4434}
4435#[cfg(feature = "deserialize")]
4436impl<'de> serde::Deserialize<'de>
4437    for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
4438{
4439    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4440        use std::str::FromStr;
4441        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4442        Ok(Self::from_str(&s).expect("infallible"))
4443    }
4444}
4445/// Transaction type of the mandate.
4446#[derive(Clone, Eq, PartialEq)]
4447#[non_exhaustive]
4448pub enum CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
4449    Business,
4450    Personal,
4451    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4452    Unknown(String),
4453}
4454impl CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
4455    pub fn as_str(&self) -> &str {
4456        use CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
4457        match self {
4458            Business => "business",
4459            Personal => "personal",
4460            Unknown(v) => v,
4461        }
4462    }
4463}
4464
4465impl std::str::FromStr
4466    for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
4467{
4468    type Err = std::convert::Infallible;
4469    fn from_str(s: &str) -> Result<Self, Self::Err> {
4470        use CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
4471        match s {
4472            "business" => Ok(Business),
4473            "personal" => Ok(Personal),
4474            v => {
4475                tracing::warn!(
4476                    "Unknown value '{}' for enum '{}'",
4477                    v,
4478                    "CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"
4479                );
4480                Ok(Unknown(v.to_owned()))
4481            }
4482        }
4483    }
4484}
4485impl std::fmt::Display
4486    for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
4487{
4488    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4489        f.write_str(self.as_str())
4490    }
4491}
4492
4493#[cfg(not(feature = "redact-generated-debug"))]
4494impl std::fmt::Debug
4495    for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
4496{
4497    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4498        f.write_str(self.as_str())
4499    }
4500}
4501#[cfg(feature = "redact-generated-debug")]
4502impl std::fmt::Debug
4503    for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
4504{
4505    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4506        f.debug_struct(stringify!(
4507            CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
4508        ))
4509        .finish_non_exhaustive()
4510    }
4511}
4512impl serde::Serialize
4513    for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
4514{
4515    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4516    where
4517        S: serde::Serializer,
4518    {
4519        serializer.serialize_str(self.as_str())
4520    }
4521}
4522#[cfg(feature = "deserialize")]
4523impl<'de> serde::Deserialize<'de>
4524    for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
4525{
4526    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4527        use std::str::FromStr;
4528        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4529        Ok(Self::from_str(&s).expect("infallible"))
4530    }
4531}
4532/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
4533///
4534/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
4535/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
4536///
4537/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
4538///
4539/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
4540#[derive(Clone, Eq, PartialEq)]
4541#[non_exhaustive]
4542pub enum CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage {
4543    None,
4544    OffSession,
4545    OnSession,
4546    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4547    Unknown(String),
4548}
4549impl CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage {
4550    pub fn as_str(&self) -> &str {
4551        use CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage::*;
4552        match self {
4553            None => "none",
4554            OffSession => "off_session",
4555            OnSession => "on_session",
4556            Unknown(v) => v,
4557        }
4558    }
4559}
4560
4561impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage {
4562    type Err = std::convert::Infallible;
4563    fn from_str(s: &str) -> Result<Self, Self::Err> {
4564        use CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage::*;
4565        match s {
4566            "none" => Ok(None),
4567            "off_session" => Ok(OffSession),
4568            "on_session" => Ok(OnSession),
4569            v => {
4570                tracing::warn!(
4571                    "Unknown value '{}' for enum '{}'",
4572                    v,
4573                    "CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage"
4574                );
4575                Ok(Unknown(v.to_owned()))
4576            }
4577        }
4578    }
4579}
4580impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage {
4581    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4582        f.write_str(self.as_str())
4583    }
4584}
4585
4586#[cfg(not(feature = "redact-generated-debug"))]
4587impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage {
4588    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4589        f.write_str(self.as_str())
4590    }
4591}
4592#[cfg(feature = "redact-generated-debug")]
4593impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage {
4594    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4595        f.debug_struct(stringify!(
4596            CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage
4597        ))
4598        .finish_non_exhaustive()
4599    }
4600}
4601impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage {
4602    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4603    where
4604        S: serde::Serializer,
4605    {
4606        serializer.serialize_str(self.as_str())
4607    }
4608}
4609#[cfg(feature = "deserialize")]
4610impl<'de> serde::Deserialize<'de>
4611    for CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage
4612{
4613    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4614        use std::str::FromStr;
4615        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4616        Ok(Self::from_str(&s).expect("infallible"))
4617    }
4618}
4619/// Verification method for the intent
4620#[derive(Clone, Eq, PartialEq)]
4621#[non_exhaustive]
4622pub enum CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod {
4623    Automatic,
4624    Instant,
4625    Microdeposits,
4626    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4627    Unknown(String),
4628}
4629impl CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod {
4630    pub fn as_str(&self) -> &str {
4631        use CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod::*;
4632        match self {
4633            Automatic => "automatic",
4634            Instant => "instant",
4635            Microdeposits => "microdeposits",
4636            Unknown(v) => v,
4637        }
4638    }
4639}
4640
4641impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod {
4642    type Err = std::convert::Infallible;
4643    fn from_str(s: &str) -> Result<Self, Self::Err> {
4644        use CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod::*;
4645        match s {
4646            "automatic" => Ok(Automatic),
4647            "instant" => Ok(Instant),
4648            "microdeposits" => Ok(Microdeposits),
4649            v => {
4650                tracing::warn!(
4651                    "Unknown value '{}' for enum '{}'",
4652                    v,
4653                    "CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod"
4654                );
4655                Ok(Unknown(v.to_owned()))
4656            }
4657        }
4658    }
4659}
4660impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod {
4661    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4662        f.write_str(self.as_str())
4663    }
4664}
4665
4666#[cfg(not(feature = "redact-generated-debug"))]
4667impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod {
4668    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4669        f.write_str(self.as_str())
4670    }
4671}
4672#[cfg(feature = "redact-generated-debug")]
4673impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod {
4674    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4675        f.debug_struct(stringify!(
4676            CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod
4677        ))
4678        .finish_non_exhaustive()
4679    }
4680}
4681impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod {
4682    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4683    where
4684        S: serde::Serializer,
4685    {
4686        serializer.serialize_str(self.as_str())
4687    }
4688}
4689#[cfg(feature = "deserialize")]
4690impl<'de> serde::Deserialize<'de>
4691    for CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod
4692{
4693    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4694        use std::str::FromStr;
4695        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4696        Ok(Self::from_str(&s).expect("infallible"))
4697    }
4698}
4699/// contains details about the Affirm payment method options.
4700#[derive(Clone, Eq, PartialEq)]
4701#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
4702#[derive(serde::Serialize)]
4703pub struct CreateCheckoutSessionPaymentMethodOptionsAffirm {
4704    /// Controls when the funds will be captured from the customer's account.
4705    #[serde(skip_serializing_if = "Option::is_none")]
4706    pub capture_method: Option<CreateCheckoutSessionPaymentMethodOptionsAffirmCaptureMethod>,
4707    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
4708    ///
4709    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
4710    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
4711    ///
4712    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
4713    ///
4714    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
4715    #[serde(skip_serializing_if = "Option::is_none")]
4716    pub setup_future_usage: Option<CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage>,
4717}
4718#[cfg(feature = "redact-generated-debug")]
4719impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAffirm {
4720    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4721        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsAffirm").finish_non_exhaustive()
4722    }
4723}
4724impl CreateCheckoutSessionPaymentMethodOptionsAffirm {
4725    pub fn new() -> Self {
4726        Self { capture_method: None, setup_future_usage: None }
4727    }
4728}
4729impl Default for CreateCheckoutSessionPaymentMethodOptionsAffirm {
4730    fn default() -> Self {
4731        Self::new()
4732    }
4733}
4734/// Controls when the funds will be captured from the customer's account.
4735#[derive(Clone, Eq, PartialEq)]
4736#[non_exhaustive]
4737pub enum CreateCheckoutSessionPaymentMethodOptionsAffirmCaptureMethod {
4738    Manual,
4739    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4740    Unknown(String),
4741}
4742impl CreateCheckoutSessionPaymentMethodOptionsAffirmCaptureMethod {
4743    pub fn as_str(&self) -> &str {
4744        use CreateCheckoutSessionPaymentMethodOptionsAffirmCaptureMethod::*;
4745        match self {
4746            Manual => "manual",
4747            Unknown(v) => v,
4748        }
4749    }
4750}
4751
4752impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsAffirmCaptureMethod {
4753    type Err = std::convert::Infallible;
4754    fn from_str(s: &str) -> Result<Self, Self::Err> {
4755        use CreateCheckoutSessionPaymentMethodOptionsAffirmCaptureMethod::*;
4756        match s {
4757            "manual" => Ok(Manual),
4758            v => {
4759                tracing::warn!(
4760                    "Unknown value '{}' for enum '{}'",
4761                    v,
4762                    "CreateCheckoutSessionPaymentMethodOptionsAffirmCaptureMethod"
4763                );
4764                Ok(Unknown(v.to_owned()))
4765            }
4766        }
4767    }
4768}
4769impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsAffirmCaptureMethod {
4770    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4771        f.write_str(self.as_str())
4772    }
4773}
4774
4775#[cfg(not(feature = "redact-generated-debug"))]
4776impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAffirmCaptureMethod {
4777    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4778        f.write_str(self.as_str())
4779    }
4780}
4781#[cfg(feature = "redact-generated-debug")]
4782impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAffirmCaptureMethod {
4783    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4784        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsAffirmCaptureMethod))
4785            .finish_non_exhaustive()
4786    }
4787}
4788impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsAffirmCaptureMethod {
4789    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4790    where
4791        S: serde::Serializer,
4792    {
4793        serializer.serialize_str(self.as_str())
4794    }
4795}
4796#[cfg(feature = "deserialize")]
4797impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionPaymentMethodOptionsAffirmCaptureMethod {
4798    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4799        use std::str::FromStr;
4800        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4801        Ok(Self::from_str(&s).expect("infallible"))
4802    }
4803}
4804/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
4805///
4806/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
4807/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
4808///
4809/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
4810///
4811/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
4812#[derive(Clone, Eq, PartialEq)]
4813#[non_exhaustive]
4814pub enum CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage {
4815    None,
4816    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4817    Unknown(String),
4818}
4819impl CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage {
4820    pub fn as_str(&self) -> &str {
4821        use CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage::*;
4822        match self {
4823            None => "none",
4824            Unknown(v) => v,
4825        }
4826    }
4827}
4828
4829impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage {
4830    type Err = std::convert::Infallible;
4831    fn from_str(s: &str) -> Result<Self, Self::Err> {
4832        use CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage::*;
4833        match s {
4834            "none" => Ok(None),
4835            v => {
4836                tracing::warn!(
4837                    "Unknown value '{}' for enum '{}'",
4838                    v,
4839                    "CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage"
4840                );
4841                Ok(Unknown(v.to_owned()))
4842            }
4843        }
4844    }
4845}
4846impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage {
4847    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4848        f.write_str(self.as_str())
4849    }
4850}
4851
4852#[cfg(not(feature = "redact-generated-debug"))]
4853impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage {
4854    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4855        f.write_str(self.as_str())
4856    }
4857}
4858#[cfg(feature = "redact-generated-debug")]
4859impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage {
4860    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4861        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage))
4862            .finish_non_exhaustive()
4863    }
4864}
4865impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage {
4866    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4867    where
4868        S: serde::Serializer,
4869    {
4870        serializer.serialize_str(self.as_str())
4871    }
4872}
4873#[cfg(feature = "deserialize")]
4874impl<'de> serde::Deserialize<'de>
4875    for CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage
4876{
4877    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4878        use std::str::FromStr;
4879        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4880        Ok(Self::from_str(&s).expect("infallible"))
4881    }
4882}
4883/// contains details about the Afterpay Clearpay payment method options.
4884#[derive(Clone, Eq, PartialEq)]
4885#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
4886#[derive(serde::Serialize)]
4887pub struct CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpay {
4888    /// Controls when the funds will be captured from the customer's account.
4889    #[serde(skip_serializing_if = "Option::is_none")]
4890    pub capture_method:
4891        Option<CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpayCaptureMethod>,
4892    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
4893    ///
4894    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
4895    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
4896    ///
4897    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
4898    ///
4899    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
4900    #[serde(skip_serializing_if = "Option::is_none")]
4901    pub setup_future_usage:
4902        Option<CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage>,
4903}
4904#[cfg(feature = "redact-generated-debug")]
4905impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpay {
4906    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4907        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpay")
4908            .finish_non_exhaustive()
4909    }
4910}
4911impl CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpay {
4912    pub fn new() -> Self {
4913        Self { capture_method: None, setup_future_usage: None }
4914    }
4915}
4916impl Default for CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpay {
4917    fn default() -> Self {
4918        Self::new()
4919    }
4920}
4921/// Controls when the funds will be captured from the customer's account.
4922#[derive(Clone, Eq, PartialEq)]
4923#[non_exhaustive]
4924pub enum CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpayCaptureMethod {
4925    Manual,
4926    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4927    Unknown(String),
4928}
4929impl CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpayCaptureMethod {
4930    pub fn as_str(&self) -> &str {
4931        use CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpayCaptureMethod::*;
4932        match self {
4933            Manual => "manual",
4934            Unknown(v) => v,
4935        }
4936    }
4937}
4938
4939impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpayCaptureMethod {
4940    type Err = std::convert::Infallible;
4941    fn from_str(s: &str) -> Result<Self, Self::Err> {
4942        use CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpayCaptureMethod::*;
4943        match s {
4944            "manual" => Ok(Manual),
4945            v => {
4946                tracing::warn!(
4947                    "Unknown value '{}' for enum '{}'",
4948                    v,
4949                    "CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpayCaptureMethod"
4950                );
4951                Ok(Unknown(v.to_owned()))
4952            }
4953        }
4954    }
4955}
4956impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpayCaptureMethod {
4957    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4958        f.write_str(self.as_str())
4959    }
4960}
4961
4962#[cfg(not(feature = "redact-generated-debug"))]
4963impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpayCaptureMethod {
4964    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4965        f.write_str(self.as_str())
4966    }
4967}
4968#[cfg(feature = "redact-generated-debug")]
4969impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpayCaptureMethod {
4970    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4971        f.debug_struct(stringify!(
4972            CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpayCaptureMethod
4973        ))
4974        .finish_non_exhaustive()
4975    }
4976}
4977impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpayCaptureMethod {
4978    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4979    where
4980        S: serde::Serializer,
4981    {
4982        serializer.serialize_str(self.as_str())
4983    }
4984}
4985#[cfg(feature = "deserialize")]
4986impl<'de> serde::Deserialize<'de>
4987    for CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpayCaptureMethod
4988{
4989    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4990        use std::str::FromStr;
4991        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4992        Ok(Self::from_str(&s).expect("infallible"))
4993    }
4994}
4995/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
4996///
4997/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
4998/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
4999///
5000/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
5001///
5002/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
5003#[derive(Clone, Eq, PartialEq)]
5004#[non_exhaustive]
5005pub enum CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
5006    None,
5007    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5008    Unknown(String),
5009}
5010impl CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
5011    pub fn as_str(&self) -> &str {
5012        use CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*;
5013        match self {
5014            None => "none",
5015            Unknown(v) => v,
5016        }
5017    }
5018}
5019
5020impl std::str::FromStr
5021    for CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage
5022{
5023    type Err = std::convert::Infallible;
5024    fn from_str(s: &str) -> Result<Self, Self::Err> {
5025        use CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*;
5026        match s {
5027            "none" => Ok(None),
5028            v => {
5029                tracing::warn!(
5030                    "Unknown value '{}' for enum '{}'",
5031                    v,
5032                    "CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage"
5033                );
5034                Ok(Unknown(v.to_owned()))
5035            }
5036        }
5037    }
5038}
5039impl std::fmt::Display
5040    for CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage
5041{
5042    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5043        f.write_str(self.as_str())
5044    }
5045}
5046
5047#[cfg(not(feature = "redact-generated-debug"))]
5048impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
5049    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5050        f.write_str(self.as_str())
5051    }
5052}
5053#[cfg(feature = "redact-generated-debug")]
5054impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
5055    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5056        f.debug_struct(stringify!(
5057            CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage
5058        ))
5059        .finish_non_exhaustive()
5060    }
5061}
5062impl serde::Serialize
5063    for CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage
5064{
5065    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5066    where
5067        S: serde::Serializer,
5068    {
5069        serializer.serialize_str(self.as_str())
5070    }
5071}
5072#[cfg(feature = "deserialize")]
5073impl<'de> serde::Deserialize<'de>
5074    for CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage
5075{
5076    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5077        use std::str::FromStr;
5078        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5079        Ok(Self::from_str(&s).expect("infallible"))
5080    }
5081}
5082/// contains details about the Alipay payment method options.
5083#[derive(Clone, Eq, PartialEq)]
5084#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
5085#[derive(serde::Serialize)]
5086pub struct CreateCheckoutSessionPaymentMethodOptionsAlipay {
5087    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
5088    ///
5089    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
5090    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
5091    ///
5092    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
5093    ///
5094    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
5095    #[serde(skip_serializing_if = "Option::is_none")]
5096    pub setup_future_usage: Option<CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage>,
5097}
5098#[cfg(feature = "redact-generated-debug")]
5099impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAlipay {
5100    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5101        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsAlipay").finish_non_exhaustive()
5102    }
5103}
5104impl CreateCheckoutSessionPaymentMethodOptionsAlipay {
5105    pub fn new() -> Self {
5106        Self { setup_future_usage: None }
5107    }
5108}
5109impl Default for CreateCheckoutSessionPaymentMethodOptionsAlipay {
5110    fn default() -> Self {
5111        Self::new()
5112    }
5113}
5114/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
5115///
5116/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
5117/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
5118///
5119/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
5120///
5121/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
5122#[derive(Clone, Eq, PartialEq)]
5123#[non_exhaustive]
5124pub enum CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage {
5125    None,
5126    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5127    Unknown(String),
5128}
5129impl CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage {
5130    pub fn as_str(&self) -> &str {
5131        use CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage::*;
5132        match self {
5133            None => "none",
5134            Unknown(v) => v,
5135        }
5136    }
5137}
5138
5139impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage {
5140    type Err = std::convert::Infallible;
5141    fn from_str(s: &str) -> Result<Self, Self::Err> {
5142        use CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage::*;
5143        match s {
5144            "none" => Ok(None),
5145            v => {
5146                tracing::warn!(
5147                    "Unknown value '{}' for enum '{}'",
5148                    v,
5149                    "CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage"
5150                );
5151                Ok(Unknown(v.to_owned()))
5152            }
5153        }
5154    }
5155}
5156impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage {
5157    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5158        f.write_str(self.as_str())
5159    }
5160}
5161
5162#[cfg(not(feature = "redact-generated-debug"))]
5163impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage {
5164    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5165        f.write_str(self.as_str())
5166    }
5167}
5168#[cfg(feature = "redact-generated-debug")]
5169impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage {
5170    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5171        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage))
5172            .finish_non_exhaustive()
5173    }
5174}
5175impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage {
5176    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5177    where
5178        S: serde::Serializer,
5179    {
5180        serializer.serialize_str(self.as_str())
5181    }
5182}
5183#[cfg(feature = "deserialize")]
5184impl<'de> serde::Deserialize<'de>
5185    for CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage
5186{
5187    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5188        use std::str::FromStr;
5189        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5190        Ok(Self::from_str(&s).expect("infallible"))
5191    }
5192}
5193/// contains details about the Alma payment method options.
5194#[derive(Clone, Eq, PartialEq)]
5195#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
5196#[derive(serde::Serialize)]
5197pub struct CreateCheckoutSessionPaymentMethodOptionsAlma {
5198    /// Controls when the funds will be captured from the customer's account.
5199    #[serde(skip_serializing_if = "Option::is_none")]
5200    pub capture_method: Option<CreateCheckoutSessionPaymentMethodOptionsAlmaCaptureMethod>,
5201}
5202#[cfg(feature = "redact-generated-debug")]
5203impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAlma {
5204    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5205        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsAlma").finish_non_exhaustive()
5206    }
5207}
5208impl CreateCheckoutSessionPaymentMethodOptionsAlma {
5209    pub fn new() -> Self {
5210        Self { capture_method: None }
5211    }
5212}
5213impl Default for CreateCheckoutSessionPaymentMethodOptionsAlma {
5214    fn default() -> Self {
5215        Self::new()
5216    }
5217}
5218/// Controls when the funds will be captured from the customer's account.
5219#[derive(Clone, Eq, PartialEq)]
5220#[non_exhaustive]
5221pub enum CreateCheckoutSessionPaymentMethodOptionsAlmaCaptureMethod {
5222    Manual,
5223    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5224    Unknown(String),
5225}
5226impl CreateCheckoutSessionPaymentMethodOptionsAlmaCaptureMethod {
5227    pub fn as_str(&self) -> &str {
5228        use CreateCheckoutSessionPaymentMethodOptionsAlmaCaptureMethod::*;
5229        match self {
5230            Manual => "manual",
5231            Unknown(v) => v,
5232        }
5233    }
5234}
5235
5236impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsAlmaCaptureMethod {
5237    type Err = std::convert::Infallible;
5238    fn from_str(s: &str) -> Result<Self, Self::Err> {
5239        use CreateCheckoutSessionPaymentMethodOptionsAlmaCaptureMethod::*;
5240        match s {
5241            "manual" => Ok(Manual),
5242            v => {
5243                tracing::warn!(
5244                    "Unknown value '{}' for enum '{}'",
5245                    v,
5246                    "CreateCheckoutSessionPaymentMethodOptionsAlmaCaptureMethod"
5247                );
5248                Ok(Unknown(v.to_owned()))
5249            }
5250        }
5251    }
5252}
5253impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsAlmaCaptureMethod {
5254    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5255        f.write_str(self.as_str())
5256    }
5257}
5258
5259#[cfg(not(feature = "redact-generated-debug"))]
5260impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAlmaCaptureMethod {
5261    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5262        f.write_str(self.as_str())
5263    }
5264}
5265#[cfg(feature = "redact-generated-debug")]
5266impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAlmaCaptureMethod {
5267    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5268        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsAlmaCaptureMethod))
5269            .finish_non_exhaustive()
5270    }
5271}
5272impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsAlmaCaptureMethod {
5273    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5274    where
5275        S: serde::Serializer,
5276    {
5277        serializer.serialize_str(self.as_str())
5278    }
5279}
5280#[cfg(feature = "deserialize")]
5281impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionPaymentMethodOptionsAlmaCaptureMethod {
5282    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5283        use std::str::FromStr;
5284        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5285        Ok(Self::from_str(&s).expect("infallible"))
5286    }
5287}
5288/// contains details about the AmazonPay payment method options.
5289#[derive(Clone, Eq, PartialEq)]
5290#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
5291#[derive(serde::Serialize)]
5292pub struct CreateCheckoutSessionPaymentMethodOptionsAmazonPay {
5293    /// Controls when the funds will be captured from the customer's account.
5294    #[serde(skip_serializing_if = "Option::is_none")]
5295    pub capture_method: Option<CreateCheckoutSessionPaymentMethodOptionsAmazonPayCaptureMethod>,
5296    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
5297    ///
5298    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
5299    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
5300    ///
5301    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
5302    ///
5303    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
5304    #[serde(skip_serializing_if = "Option::is_none")]
5305    pub setup_future_usage:
5306        Option<CreateCheckoutSessionPaymentMethodOptionsAmazonPaySetupFutureUsage>,
5307}
5308#[cfg(feature = "redact-generated-debug")]
5309impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAmazonPay {
5310    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5311        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsAmazonPay").finish_non_exhaustive()
5312    }
5313}
5314impl CreateCheckoutSessionPaymentMethodOptionsAmazonPay {
5315    pub fn new() -> Self {
5316        Self { capture_method: None, setup_future_usage: None }
5317    }
5318}
5319impl Default for CreateCheckoutSessionPaymentMethodOptionsAmazonPay {
5320    fn default() -> Self {
5321        Self::new()
5322    }
5323}
5324/// Controls when the funds will be captured from the customer's account.
5325#[derive(Clone, Eq, PartialEq)]
5326#[non_exhaustive]
5327pub enum CreateCheckoutSessionPaymentMethodOptionsAmazonPayCaptureMethod {
5328    Manual,
5329    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5330    Unknown(String),
5331}
5332impl CreateCheckoutSessionPaymentMethodOptionsAmazonPayCaptureMethod {
5333    pub fn as_str(&self) -> &str {
5334        use CreateCheckoutSessionPaymentMethodOptionsAmazonPayCaptureMethod::*;
5335        match self {
5336            Manual => "manual",
5337            Unknown(v) => v,
5338        }
5339    }
5340}
5341
5342impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsAmazonPayCaptureMethod {
5343    type Err = std::convert::Infallible;
5344    fn from_str(s: &str) -> Result<Self, Self::Err> {
5345        use CreateCheckoutSessionPaymentMethodOptionsAmazonPayCaptureMethod::*;
5346        match s {
5347            "manual" => Ok(Manual),
5348            v => {
5349                tracing::warn!(
5350                    "Unknown value '{}' for enum '{}'",
5351                    v,
5352                    "CreateCheckoutSessionPaymentMethodOptionsAmazonPayCaptureMethod"
5353                );
5354                Ok(Unknown(v.to_owned()))
5355            }
5356        }
5357    }
5358}
5359impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsAmazonPayCaptureMethod {
5360    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5361        f.write_str(self.as_str())
5362    }
5363}
5364
5365#[cfg(not(feature = "redact-generated-debug"))]
5366impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAmazonPayCaptureMethod {
5367    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5368        f.write_str(self.as_str())
5369    }
5370}
5371#[cfg(feature = "redact-generated-debug")]
5372impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAmazonPayCaptureMethod {
5373    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5374        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsAmazonPayCaptureMethod))
5375            .finish_non_exhaustive()
5376    }
5377}
5378impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsAmazonPayCaptureMethod {
5379    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5380    where
5381        S: serde::Serializer,
5382    {
5383        serializer.serialize_str(self.as_str())
5384    }
5385}
5386#[cfg(feature = "deserialize")]
5387impl<'de> serde::Deserialize<'de>
5388    for CreateCheckoutSessionPaymentMethodOptionsAmazonPayCaptureMethod
5389{
5390    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5391        use std::str::FromStr;
5392        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5393        Ok(Self::from_str(&s).expect("infallible"))
5394    }
5395}
5396/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
5397///
5398/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
5399/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
5400///
5401/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
5402///
5403/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
5404#[derive(Clone, Eq, PartialEq)]
5405#[non_exhaustive]
5406pub enum CreateCheckoutSessionPaymentMethodOptionsAmazonPaySetupFutureUsage {
5407    None,
5408    OffSession,
5409    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5410    Unknown(String),
5411}
5412impl CreateCheckoutSessionPaymentMethodOptionsAmazonPaySetupFutureUsage {
5413    pub fn as_str(&self) -> &str {
5414        use CreateCheckoutSessionPaymentMethodOptionsAmazonPaySetupFutureUsage::*;
5415        match self {
5416            None => "none",
5417            OffSession => "off_session",
5418            Unknown(v) => v,
5419        }
5420    }
5421}
5422
5423impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsAmazonPaySetupFutureUsage {
5424    type Err = std::convert::Infallible;
5425    fn from_str(s: &str) -> Result<Self, Self::Err> {
5426        use CreateCheckoutSessionPaymentMethodOptionsAmazonPaySetupFutureUsage::*;
5427        match s {
5428            "none" => Ok(None),
5429            "off_session" => Ok(OffSession),
5430            v => {
5431                tracing::warn!(
5432                    "Unknown value '{}' for enum '{}'",
5433                    v,
5434                    "CreateCheckoutSessionPaymentMethodOptionsAmazonPaySetupFutureUsage"
5435                );
5436                Ok(Unknown(v.to_owned()))
5437            }
5438        }
5439    }
5440}
5441impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsAmazonPaySetupFutureUsage {
5442    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5443        f.write_str(self.as_str())
5444    }
5445}
5446
5447#[cfg(not(feature = "redact-generated-debug"))]
5448impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAmazonPaySetupFutureUsage {
5449    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5450        f.write_str(self.as_str())
5451    }
5452}
5453#[cfg(feature = "redact-generated-debug")]
5454impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAmazonPaySetupFutureUsage {
5455    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5456        f.debug_struct(stringify!(
5457            CreateCheckoutSessionPaymentMethodOptionsAmazonPaySetupFutureUsage
5458        ))
5459        .finish_non_exhaustive()
5460    }
5461}
5462impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsAmazonPaySetupFutureUsage {
5463    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5464    where
5465        S: serde::Serializer,
5466    {
5467        serializer.serialize_str(self.as_str())
5468    }
5469}
5470#[cfg(feature = "deserialize")]
5471impl<'de> serde::Deserialize<'de>
5472    for CreateCheckoutSessionPaymentMethodOptionsAmazonPaySetupFutureUsage
5473{
5474    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5475        use std::str::FromStr;
5476        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5477        Ok(Self::from_str(&s).expect("infallible"))
5478    }
5479}
5480/// contains details about the AU Becs Debit payment method options.
5481#[derive(Clone, Eq, PartialEq)]
5482#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
5483#[derive(serde::Serialize)]
5484pub struct CreateCheckoutSessionPaymentMethodOptionsAuBecsDebit {
5485    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
5486    ///
5487    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
5488    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
5489    ///
5490    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
5491    ///
5492    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
5493    #[serde(skip_serializing_if = "Option::is_none")]
5494    pub setup_future_usage:
5495        Option<CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage>,
5496    /// Controls when Stripe will attempt to debit the funds from the customer's account.
5497    /// The date must be a string in YYYY-MM-DD format.
5498    /// The date must be in the future and between 3 and 15 calendar days from now.
5499    #[serde(skip_serializing_if = "Option::is_none")]
5500    pub target_date: Option<String>,
5501}
5502#[cfg(feature = "redact-generated-debug")]
5503impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAuBecsDebit {
5504    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5505        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsAuBecsDebit")
5506            .finish_non_exhaustive()
5507    }
5508}
5509impl CreateCheckoutSessionPaymentMethodOptionsAuBecsDebit {
5510    pub fn new() -> Self {
5511        Self { setup_future_usage: None, target_date: None }
5512    }
5513}
5514impl Default for CreateCheckoutSessionPaymentMethodOptionsAuBecsDebit {
5515    fn default() -> Self {
5516        Self::new()
5517    }
5518}
5519/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
5520///
5521/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
5522/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
5523///
5524/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
5525///
5526/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
5527#[derive(Clone, Eq, PartialEq)]
5528#[non_exhaustive]
5529pub enum CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
5530    None,
5531    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5532    Unknown(String),
5533}
5534impl CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
5535    pub fn as_str(&self) -> &str {
5536        use CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*;
5537        match self {
5538            None => "none",
5539            Unknown(v) => v,
5540        }
5541    }
5542}
5543
5544impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
5545    type Err = std::convert::Infallible;
5546    fn from_str(s: &str) -> Result<Self, Self::Err> {
5547        use CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*;
5548        match s {
5549            "none" => Ok(None),
5550            v => {
5551                tracing::warn!(
5552                    "Unknown value '{}' for enum '{}'",
5553                    v,
5554                    "CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage"
5555                );
5556                Ok(Unknown(v.to_owned()))
5557            }
5558        }
5559    }
5560}
5561impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
5562    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5563        f.write_str(self.as_str())
5564    }
5565}
5566
5567#[cfg(not(feature = "redact-generated-debug"))]
5568impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
5569    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5570        f.write_str(self.as_str())
5571    }
5572}
5573#[cfg(feature = "redact-generated-debug")]
5574impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
5575    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5576        f.debug_struct(stringify!(
5577            CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage
5578        ))
5579        .finish_non_exhaustive()
5580    }
5581}
5582impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
5583    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5584    where
5585        S: serde::Serializer,
5586    {
5587        serializer.serialize_str(self.as_str())
5588    }
5589}
5590#[cfg(feature = "deserialize")]
5591impl<'de> serde::Deserialize<'de>
5592    for CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage
5593{
5594    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5595        use std::str::FromStr;
5596        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5597        Ok(Self::from_str(&s).expect("infallible"))
5598    }
5599}
5600/// contains details about the Bacs Debit payment method options.
5601#[derive(Clone, Eq, PartialEq)]
5602#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
5603#[derive(serde::Serialize)]
5604pub struct CreateCheckoutSessionPaymentMethodOptionsBacsDebit {
5605    /// Additional fields for Mandate creation
5606    #[serde(skip_serializing_if = "Option::is_none")]
5607    pub mandate_options: Option<CreateCheckoutSessionPaymentMethodOptionsBacsDebitMandateOptions>,
5608    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
5609    ///
5610    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
5611    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
5612    ///
5613    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
5614    ///
5615    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
5616    #[serde(skip_serializing_if = "Option::is_none")]
5617    pub setup_future_usage:
5618        Option<CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage>,
5619    /// Controls when Stripe will attempt to debit the funds from the customer's account.
5620    /// The date must be a string in YYYY-MM-DD format.
5621    /// The date must be in the future and between 3 and 15 calendar days from now.
5622    #[serde(skip_serializing_if = "Option::is_none")]
5623    pub target_date: Option<String>,
5624}
5625#[cfg(feature = "redact-generated-debug")]
5626impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsBacsDebit {
5627    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5628        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsBacsDebit").finish_non_exhaustive()
5629    }
5630}
5631impl CreateCheckoutSessionPaymentMethodOptionsBacsDebit {
5632    pub fn new() -> Self {
5633        Self { mandate_options: None, setup_future_usage: None, target_date: None }
5634    }
5635}
5636impl Default for CreateCheckoutSessionPaymentMethodOptionsBacsDebit {
5637    fn default() -> Self {
5638        Self::new()
5639    }
5640}
5641/// Additional fields for Mandate creation
5642#[derive(Clone, Eq, PartialEq)]
5643#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
5644#[derive(serde::Serialize)]
5645pub struct CreateCheckoutSessionPaymentMethodOptionsBacsDebitMandateOptions {
5646    /// Prefix used to generate the Mandate reference.
5647    /// Must be at most 12 characters long.
5648    /// Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'.
5649    /// Cannot begin with 'DDIC' or 'STRIPE'.
5650    #[serde(skip_serializing_if = "Option::is_none")]
5651    pub reference_prefix: Option<String>,
5652}
5653#[cfg(feature = "redact-generated-debug")]
5654impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsBacsDebitMandateOptions {
5655    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5656        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsBacsDebitMandateOptions")
5657            .finish_non_exhaustive()
5658    }
5659}
5660impl CreateCheckoutSessionPaymentMethodOptionsBacsDebitMandateOptions {
5661    pub fn new() -> Self {
5662        Self { reference_prefix: None }
5663    }
5664}
5665impl Default for CreateCheckoutSessionPaymentMethodOptionsBacsDebitMandateOptions {
5666    fn default() -> Self {
5667        Self::new()
5668    }
5669}
5670/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
5671///
5672/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
5673/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
5674///
5675/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
5676///
5677/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
5678#[derive(Clone, Eq, PartialEq)]
5679#[non_exhaustive]
5680pub enum CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage {
5681    None,
5682    OffSession,
5683    OnSession,
5684    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5685    Unknown(String),
5686}
5687impl CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage {
5688    pub fn as_str(&self) -> &str {
5689        use CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage::*;
5690        match self {
5691            None => "none",
5692            OffSession => "off_session",
5693            OnSession => "on_session",
5694            Unknown(v) => v,
5695        }
5696    }
5697}
5698
5699impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage {
5700    type Err = std::convert::Infallible;
5701    fn from_str(s: &str) -> Result<Self, Self::Err> {
5702        use CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage::*;
5703        match s {
5704            "none" => Ok(None),
5705            "off_session" => Ok(OffSession),
5706            "on_session" => Ok(OnSession),
5707            v => {
5708                tracing::warn!(
5709                    "Unknown value '{}' for enum '{}'",
5710                    v,
5711                    "CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage"
5712                );
5713                Ok(Unknown(v.to_owned()))
5714            }
5715        }
5716    }
5717}
5718impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage {
5719    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5720        f.write_str(self.as_str())
5721    }
5722}
5723
5724#[cfg(not(feature = "redact-generated-debug"))]
5725impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage {
5726    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5727        f.write_str(self.as_str())
5728    }
5729}
5730#[cfg(feature = "redact-generated-debug")]
5731impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage {
5732    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5733        f.debug_struct(stringify!(
5734            CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage
5735        ))
5736        .finish_non_exhaustive()
5737    }
5738}
5739impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage {
5740    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5741    where
5742        S: serde::Serializer,
5743    {
5744        serializer.serialize_str(self.as_str())
5745    }
5746}
5747#[cfg(feature = "deserialize")]
5748impl<'de> serde::Deserialize<'de>
5749    for CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage
5750{
5751    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5752        use std::str::FromStr;
5753        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5754        Ok(Self::from_str(&s).expect("infallible"))
5755    }
5756}
5757/// contains details about the Bancontact payment method options.
5758#[derive(Clone, Eq, PartialEq)]
5759#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
5760#[derive(serde::Serialize)]
5761pub struct CreateCheckoutSessionPaymentMethodOptionsBancontact {
5762    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
5763    ///
5764    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
5765    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
5766    ///
5767    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
5768    ///
5769    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
5770    #[serde(skip_serializing_if = "Option::is_none")]
5771    pub setup_future_usage:
5772        Option<CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage>,
5773}
5774#[cfg(feature = "redact-generated-debug")]
5775impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsBancontact {
5776    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5777        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsBancontact")
5778            .finish_non_exhaustive()
5779    }
5780}
5781impl CreateCheckoutSessionPaymentMethodOptionsBancontact {
5782    pub fn new() -> Self {
5783        Self { setup_future_usage: None }
5784    }
5785}
5786impl Default for CreateCheckoutSessionPaymentMethodOptionsBancontact {
5787    fn default() -> Self {
5788        Self::new()
5789    }
5790}
5791/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
5792///
5793/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
5794/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
5795///
5796/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
5797///
5798/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
5799#[derive(Clone, Eq, PartialEq)]
5800#[non_exhaustive]
5801pub enum CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage {
5802    None,
5803    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5804    Unknown(String),
5805}
5806impl CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage {
5807    pub fn as_str(&self) -> &str {
5808        use CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage::*;
5809        match self {
5810            None => "none",
5811            Unknown(v) => v,
5812        }
5813    }
5814}
5815
5816impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage {
5817    type Err = std::convert::Infallible;
5818    fn from_str(s: &str) -> Result<Self, Self::Err> {
5819        use CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage::*;
5820        match s {
5821            "none" => Ok(None),
5822            v => {
5823                tracing::warn!(
5824                    "Unknown value '{}' for enum '{}'",
5825                    v,
5826                    "CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage"
5827                );
5828                Ok(Unknown(v.to_owned()))
5829            }
5830        }
5831    }
5832}
5833impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage {
5834    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5835        f.write_str(self.as_str())
5836    }
5837}
5838
5839#[cfg(not(feature = "redact-generated-debug"))]
5840impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage {
5841    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5842        f.write_str(self.as_str())
5843    }
5844}
5845#[cfg(feature = "redact-generated-debug")]
5846impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage {
5847    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5848        f.debug_struct(stringify!(
5849            CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage
5850        ))
5851        .finish_non_exhaustive()
5852    }
5853}
5854impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage {
5855    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5856    where
5857        S: serde::Serializer,
5858    {
5859        serializer.serialize_str(self.as_str())
5860    }
5861}
5862#[cfg(feature = "deserialize")]
5863impl<'de> serde::Deserialize<'de>
5864    for CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage
5865{
5866    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5867        use std::str::FromStr;
5868        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5869        Ok(Self::from_str(&s).expect("infallible"))
5870    }
5871}
5872/// contains details about the Billie payment method options.
5873#[derive(Clone, Eq, PartialEq)]
5874#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
5875#[derive(serde::Serialize)]
5876pub struct CreateCheckoutSessionPaymentMethodOptionsBillie {
5877    /// Controls when the funds will be captured from the customer's account.
5878    #[serde(skip_serializing_if = "Option::is_none")]
5879    pub capture_method: Option<CreateCheckoutSessionPaymentMethodOptionsBillieCaptureMethod>,
5880}
5881#[cfg(feature = "redact-generated-debug")]
5882impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsBillie {
5883    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5884        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsBillie").finish_non_exhaustive()
5885    }
5886}
5887impl CreateCheckoutSessionPaymentMethodOptionsBillie {
5888    pub fn new() -> Self {
5889        Self { capture_method: None }
5890    }
5891}
5892impl Default for CreateCheckoutSessionPaymentMethodOptionsBillie {
5893    fn default() -> Self {
5894        Self::new()
5895    }
5896}
5897/// Controls when the funds will be captured from the customer's account.
5898#[derive(Clone, Eq, PartialEq)]
5899#[non_exhaustive]
5900pub enum CreateCheckoutSessionPaymentMethodOptionsBillieCaptureMethod {
5901    Manual,
5902    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5903    Unknown(String),
5904}
5905impl CreateCheckoutSessionPaymentMethodOptionsBillieCaptureMethod {
5906    pub fn as_str(&self) -> &str {
5907        use CreateCheckoutSessionPaymentMethodOptionsBillieCaptureMethod::*;
5908        match self {
5909            Manual => "manual",
5910            Unknown(v) => v,
5911        }
5912    }
5913}
5914
5915impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsBillieCaptureMethod {
5916    type Err = std::convert::Infallible;
5917    fn from_str(s: &str) -> Result<Self, Self::Err> {
5918        use CreateCheckoutSessionPaymentMethodOptionsBillieCaptureMethod::*;
5919        match s {
5920            "manual" => Ok(Manual),
5921            v => {
5922                tracing::warn!(
5923                    "Unknown value '{}' for enum '{}'",
5924                    v,
5925                    "CreateCheckoutSessionPaymentMethodOptionsBillieCaptureMethod"
5926                );
5927                Ok(Unknown(v.to_owned()))
5928            }
5929        }
5930    }
5931}
5932impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsBillieCaptureMethod {
5933    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5934        f.write_str(self.as_str())
5935    }
5936}
5937
5938#[cfg(not(feature = "redact-generated-debug"))]
5939impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsBillieCaptureMethod {
5940    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5941        f.write_str(self.as_str())
5942    }
5943}
5944#[cfg(feature = "redact-generated-debug")]
5945impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsBillieCaptureMethod {
5946    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5947        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsBillieCaptureMethod))
5948            .finish_non_exhaustive()
5949    }
5950}
5951impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsBillieCaptureMethod {
5952    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5953    where
5954        S: serde::Serializer,
5955    {
5956        serializer.serialize_str(self.as_str())
5957    }
5958}
5959#[cfg(feature = "deserialize")]
5960impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionPaymentMethodOptionsBillieCaptureMethod {
5961    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5962        use std::str::FromStr;
5963        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5964        Ok(Self::from_str(&s).expect("infallible"))
5965    }
5966}
5967/// contains details about the Boleto payment method options.
5968#[derive(Clone, Eq, PartialEq)]
5969#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
5970#[derive(serde::Serialize)]
5971pub struct CreateCheckoutSessionPaymentMethodOptionsBoleto {
5972    /// The number of calendar days before a Boleto voucher expires.
5973    /// For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time.
5974    #[serde(skip_serializing_if = "Option::is_none")]
5975    pub expires_after_days: Option<u32>,
5976    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
5977    ///
5978    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
5979    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
5980    ///
5981    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
5982    ///
5983    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
5984    #[serde(skip_serializing_if = "Option::is_none")]
5985    pub setup_future_usage: Option<CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage>,
5986}
5987#[cfg(feature = "redact-generated-debug")]
5988impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsBoleto {
5989    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5990        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsBoleto").finish_non_exhaustive()
5991    }
5992}
5993impl CreateCheckoutSessionPaymentMethodOptionsBoleto {
5994    pub fn new() -> Self {
5995        Self { expires_after_days: None, setup_future_usage: None }
5996    }
5997}
5998impl Default for CreateCheckoutSessionPaymentMethodOptionsBoleto {
5999    fn default() -> Self {
6000        Self::new()
6001    }
6002}
6003/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6004///
6005/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6006/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6007///
6008/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6009///
6010/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6011#[derive(Clone, Eq, PartialEq)]
6012#[non_exhaustive]
6013pub enum CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage {
6014    None,
6015    OffSession,
6016    OnSession,
6017    /// An unrecognized value from Stripe. Should not be used as a request parameter.
6018    Unknown(String),
6019}
6020impl CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage {
6021    pub fn as_str(&self) -> &str {
6022        use CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage::*;
6023        match self {
6024            None => "none",
6025            OffSession => "off_session",
6026            OnSession => "on_session",
6027            Unknown(v) => v,
6028        }
6029    }
6030}
6031
6032impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage {
6033    type Err = std::convert::Infallible;
6034    fn from_str(s: &str) -> Result<Self, Self::Err> {
6035        use CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage::*;
6036        match s {
6037            "none" => Ok(None),
6038            "off_session" => Ok(OffSession),
6039            "on_session" => Ok(OnSession),
6040            v => {
6041                tracing::warn!(
6042                    "Unknown value '{}' for enum '{}'",
6043                    v,
6044                    "CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage"
6045                );
6046                Ok(Unknown(v.to_owned()))
6047            }
6048        }
6049    }
6050}
6051impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage {
6052    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6053        f.write_str(self.as_str())
6054    }
6055}
6056
6057#[cfg(not(feature = "redact-generated-debug"))]
6058impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage {
6059    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6060        f.write_str(self.as_str())
6061    }
6062}
6063#[cfg(feature = "redact-generated-debug")]
6064impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage {
6065    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6066        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage))
6067            .finish_non_exhaustive()
6068    }
6069}
6070impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage {
6071    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6072    where
6073        S: serde::Serializer,
6074    {
6075        serializer.serialize_str(self.as_str())
6076    }
6077}
6078#[cfg(feature = "deserialize")]
6079impl<'de> serde::Deserialize<'de>
6080    for CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage
6081{
6082    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6083        use std::str::FromStr;
6084        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6085        Ok(Self::from_str(&s).expect("infallible"))
6086    }
6087}
6088/// contains details about the Card payment method options.
6089#[derive(Clone, Eq, PartialEq)]
6090#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
6091#[derive(serde::Serialize)]
6092pub struct CreateCheckoutSessionPaymentMethodOptionsCard {
6093    /// Controls when the funds will be captured from the customer's account.
6094    #[serde(skip_serializing_if = "Option::is_none")]
6095    pub capture_method: Option<CreateCheckoutSessionPaymentMethodOptionsCardCaptureMethod>,
6096    /// Installment options for card payments
6097    #[serde(skip_serializing_if = "Option::is_none")]
6098    pub installments: Option<CreateCheckoutSessionPaymentMethodOptionsCardInstallments>,
6099    /// Request ability to [capture beyond the standard authorization validity window](/payments/extended-authorization) for this CheckoutSession.
6100    #[serde(skip_serializing_if = "Option::is_none")]
6101    pub request_extended_authorization:
6102        Option<CreateCheckoutSessionPaymentMethodOptionsCardRequestExtendedAuthorization>,
6103    /// Request ability to [increment the authorization](/payments/incremental-authorization) for this CheckoutSession.
6104    #[serde(skip_serializing_if = "Option::is_none")]
6105    pub request_incremental_authorization:
6106        Option<CreateCheckoutSessionPaymentMethodOptionsCardRequestIncrementalAuthorization>,
6107    /// Request ability to make [multiple captures](/payments/multicapture) for this CheckoutSession.
6108    #[serde(skip_serializing_if = "Option::is_none")]
6109    pub request_multicapture:
6110        Option<CreateCheckoutSessionPaymentMethodOptionsCardRequestMulticapture>,
6111    /// Request ability to [overcapture](/payments/overcapture) for this CheckoutSession.
6112    #[serde(skip_serializing_if = "Option::is_none")]
6113    pub request_overcapture:
6114        Option<CreateCheckoutSessionPaymentMethodOptionsCardRequestOvercapture>,
6115    /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication).
6116    /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
6117    /// If not provided, this value defaults to `automatic`.
6118    /// Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
6119    #[serde(skip_serializing_if = "Option::is_none")]
6120    pub request_three_d_secure:
6121        Option<CreateCheckoutSessionPaymentMethodOptionsCardRequestThreeDSecure>,
6122    /// Restrictions to apply to the card payment method.
6123    /// For example, you can block specific card brands.
6124    /// You can't set this parameter if `ui_mode` is `custom`.
6125    #[serde(skip_serializing_if = "Option::is_none")]
6126    pub restrictions: Option<CreateCheckoutSessionPaymentMethodOptionsCardRestrictions>,
6127    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6128    ///
6129    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6130    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6131    ///
6132    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6133    ///
6134    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6135    #[serde(skip_serializing_if = "Option::is_none")]
6136    pub setup_future_usage: Option<CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage>,
6137    /// Provides information about a card payment that customers see on their statements.
6138    /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor.
6139    /// Maximum 22 characters.
6140    /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters.
6141    #[serde(skip_serializing_if = "Option::is_none")]
6142    pub statement_descriptor_suffix_kana: Option<String>,
6143    /// Provides information about a card payment that customers see on their statements.
6144    /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor.
6145    /// Maximum 17 characters.
6146    /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters.
6147    #[serde(skip_serializing_if = "Option::is_none")]
6148    pub statement_descriptor_suffix_kanji: Option<String>,
6149}
6150#[cfg(feature = "redact-generated-debug")]
6151impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCard {
6152    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6153        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsCard").finish_non_exhaustive()
6154    }
6155}
6156impl CreateCheckoutSessionPaymentMethodOptionsCard {
6157    pub fn new() -> Self {
6158        Self {
6159            capture_method: None,
6160            installments: None,
6161            request_extended_authorization: None,
6162            request_incremental_authorization: None,
6163            request_multicapture: None,
6164            request_overcapture: None,
6165            request_three_d_secure: None,
6166            restrictions: None,
6167            setup_future_usage: None,
6168            statement_descriptor_suffix_kana: None,
6169            statement_descriptor_suffix_kanji: None,
6170        }
6171    }
6172}
6173impl Default for CreateCheckoutSessionPaymentMethodOptionsCard {
6174    fn default() -> Self {
6175        Self::new()
6176    }
6177}
6178/// Controls when the funds will be captured from the customer's account.
6179#[derive(Clone, Eq, PartialEq)]
6180#[non_exhaustive]
6181pub enum CreateCheckoutSessionPaymentMethodOptionsCardCaptureMethod {
6182    Manual,
6183    /// An unrecognized value from Stripe. Should not be used as a request parameter.
6184    Unknown(String),
6185}
6186impl CreateCheckoutSessionPaymentMethodOptionsCardCaptureMethod {
6187    pub fn as_str(&self) -> &str {
6188        use CreateCheckoutSessionPaymentMethodOptionsCardCaptureMethod::*;
6189        match self {
6190            Manual => "manual",
6191            Unknown(v) => v,
6192        }
6193    }
6194}
6195
6196impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsCardCaptureMethod {
6197    type Err = std::convert::Infallible;
6198    fn from_str(s: &str) -> Result<Self, Self::Err> {
6199        use CreateCheckoutSessionPaymentMethodOptionsCardCaptureMethod::*;
6200        match s {
6201            "manual" => Ok(Manual),
6202            v => {
6203                tracing::warn!(
6204                    "Unknown value '{}' for enum '{}'",
6205                    v,
6206                    "CreateCheckoutSessionPaymentMethodOptionsCardCaptureMethod"
6207                );
6208                Ok(Unknown(v.to_owned()))
6209            }
6210        }
6211    }
6212}
6213impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsCardCaptureMethod {
6214    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6215        f.write_str(self.as_str())
6216    }
6217}
6218
6219#[cfg(not(feature = "redact-generated-debug"))]
6220impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCardCaptureMethod {
6221    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6222        f.write_str(self.as_str())
6223    }
6224}
6225#[cfg(feature = "redact-generated-debug")]
6226impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCardCaptureMethod {
6227    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6228        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsCardCaptureMethod))
6229            .finish_non_exhaustive()
6230    }
6231}
6232impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsCardCaptureMethod {
6233    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6234    where
6235        S: serde::Serializer,
6236    {
6237        serializer.serialize_str(self.as_str())
6238    }
6239}
6240#[cfg(feature = "deserialize")]
6241impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionPaymentMethodOptionsCardCaptureMethod {
6242    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6243        use std::str::FromStr;
6244        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6245        Ok(Self::from_str(&s).expect("infallible"))
6246    }
6247}
6248/// Installment options for card payments
6249#[derive(Copy, Clone, Eq, PartialEq)]
6250#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
6251#[derive(serde::Serialize)]
6252pub struct CreateCheckoutSessionPaymentMethodOptionsCardInstallments {
6253    /// Setting to true enables installments for this Checkout Session.
6254    /// Setting to false will prevent any installment plan from applying to a payment.
6255    #[serde(skip_serializing_if = "Option::is_none")]
6256    pub enabled: Option<bool>,
6257}
6258#[cfg(feature = "redact-generated-debug")]
6259impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCardInstallments {
6260    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6261        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsCardInstallments")
6262            .finish_non_exhaustive()
6263    }
6264}
6265impl CreateCheckoutSessionPaymentMethodOptionsCardInstallments {
6266    pub fn new() -> Self {
6267        Self { enabled: None }
6268    }
6269}
6270impl Default for CreateCheckoutSessionPaymentMethodOptionsCardInstallments {
6271    fn default() -> Self {
6272        Self::new()
6273    }
6274}
6275/// Request ability to [capture beyond the standard authorization validity window](/payments/extended-authorization) for this CheckoutSession.
6276#[derive(Clone, Eq, PartialEq)]
6277#[non_exhaustive]
6278pub enum CreateCheckoutSessionPaymentMethodOptionsCardRequestExtendedAuthorization {
6279    IfAvailable,
6280    Never,
6281    /// An unrecognized value from Stripe. Should not be used as a request parameter.
6282    Unknown(String),
6283}
6284impl CreateCheckoutSessionPaymentMethodOptionsCardRequestExtendedAuthorization {
6285    pub fn as_str(&self) -> &str {
6286        use CreateCheckoutSessionPaymentMethodOptionsCardRequestExtendedAuthorization::*;
6287        match self {
6288            IfAvailable => "if_available",
6289            Never => "never",
6290            Unknown(v) => v,
6291        }
6292    }
6293}
6294
6295impl std::str::FromStr
6296    for CreateCheckoutSessionPaymentMethodOptionsCardRequestExtendedAuthorization
6297{
6298    type Err = std::convert::Infallible;
6299    fn from_str(s: &str) -> Result<Self, Self::Err> {
6300        use CreateCheckoutSessionPaymentMethodOptionsCardRequestExtendedAuthorization::*;
6301        match s {
6302            "if_available" => Ok(IfAvailable),
6303            "never" => Ok(Never),
6304            v => {
6305                tracing::warn!(
6306                    "Unknown value '{}' for enum '{}'",
6307                    v,
6308                    "CreateCheckoutSessionPaymentMethodOptionsCardRequestExtendedAuthorization"
6309                );
6310                Ok(Unknown(v.to_owned()))
6311            }
6312        }
6313    }
6314}
6315impl std::fmt::Display
6316    for CreateCheckoutSessionPaymentMethodOptionsCardRequestExtendedAuthorization
6317{
6318    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6319        f.write_str(self.as_str())
6320    }
6321}
6322
6323#[cfg(not(feature = "redact-generated-debug"))]
6324impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCardRequestExtendedAuthorization {
6325    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6326        f.write_str(self.as_str())
6327    }
6328}
6329#[cfg(feature = "redact-generated-debug")]
6330impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCardRequestExtendedAuthorization {
6331    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6332        f.debug_struct(stringify!(
6333            CreateCheckoutSessionPaymentMethodOptionsCardRequestExtendedAuthorization
6334        ))
6335        .finish_non_exhaustive()
6336    }
6337}
6338impl serde::Serialize
6339    for CreateCheckoutSessionPaymentMethodOptionsCardRequestExtendedAuthorization
6340{
6341    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6342    where
6343        S: serde::Serializer,
6344    {
6345        serializer.serialize_str(self.as_str())
6346    }
6347}
6348#[cfg(feature = "deserialize")]
6349impl<'de> serde::Deserialize<'de>
6350    for CreateCheckoutSessionPaymentMethodOptionsCardRequestExtendedAuthorization
6351{
6352    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6353        use std::str::FromStr;
6354        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6355        Ok(Self::from_str(&s).expect("infallible"))
6356    }
6357}
6358/// Request ability to [increment the authorization](/payments/incremental-authorization) for this CheckoutSession.
6359#[derive(Clone, Eq, PartialEq)]
6360#[non_exhaustive]
6361pub enum CreateCheckoutSessionPaymentMethodOptionsCardRequestIncrementalAuthorization {
6362    IfAvailable,
6363    Never,
6364    /// An unrecognized value from Stripe. Should not be used as a request parameter.
6365    Unknown(String),
6366}
6367impl CreateCheckoutSessionPaymentMethodOptionsCardRequestIncrementalAuthorization {
6368    pub fn as_str(&self) -> &str {
6369        use CreateCheckoutSessionPaymentMethodOptionsCardRequestIncrementalAuthorization::*;
6370        match self {
6371            IfAvailable => "if_available",
6372            Never => "never",
6373            Unknown(v) => v,
6374        }
6375    }
6376}
6377
6378impl std::str::FromStr
6379    for CreateCheckoutSessionPaymentMethodOptionsCardRequestIncrementalAuthorization
6380{
6381    type Err = std::convert::Infallible;
6382    fn from_str(s: &str) -> Result<Self, Self::Err> {
6383        use CreateCheckoutSessionPaymentMethodOptionsCardRequestIncrementalAuthorization::*;
6384        match s {
6385            "if_available" => Ok(IfAvailable),
6386            "never" => Ok(Never),
6387            v => {
6388                tracing::warn!(
6389                    "Unknown value '{}' for enum '{}'",
6390                    v,
6391                    "CreateCheckoutSessionPaymentMethodOptionsCardRequestIncrementalAuthorization"
6392                );
6393                Ok(Unknown(v.to_owned()))
6394            }
6395        }
6396    }
6397}
6398impl std::fmt::Display
6399    for CreateCheckoutSessionPaymentMethodOptionsCardRequestIncrementalAuthorization
6400{
6401    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6402        f.write_str(self.as_str())
6403    }
6404}
6405
6406#[cfg(not(feature = "redact-generated-debug"))]
6407impl std::fmt::Debug
6408    for CreateCheckoutSessionPaymentMethodOptionsCardRequestIncrementalAuthorization
6409{
6410    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6411        f.write_str(self.as_str())
6412    }
6413}
6414#[cfg(feature = "redact-generated-debug")]
6415impl std::fmt::Debug
6416    for CreateCheckoutSessionPaymentMethodOptionsCardRequestIncrementalAuthorization
6417{
6418    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6419        f.debug_struct(stringify!(
6420            CreateCheckoutSessionPaymentMethodOptionsCardRequestIncrementalAuthorization
6421        ))
6422        .finish_non_exhaustive()
6423    }
6424}
6425impl serde::Serialize
6426    for CreateCheckoutSessionPaymentMethodOptionsCardRequestIncrementalAuthorization
6427{
6428    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6429    where
6430        S: serde::Serializer,
6431    {
6432        serializer.serialize_str(self.as_str())
6433    }
6434}
6435#[cfg(feature = "deserialize")]
6436impl<'de> serde::Deserialize<'de>
6437    for CreateCheckoutSessionPaymentMethodOptionsCardRequestIncrementalAuthorization
6438{
6439    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6440        use std::str::FromStr;
6441        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6442        Ok(Self::from_str(&s).expect("infallible"))
6443    }
6444}
6445/// Request ability to make [multiple captures](/payments/multicapture) for this CheckoutSession.
6446#[derive(Clone, Eq, PartialEq)]
6447#[non_exhaustive]
6448pub enum CreateCheckoutSessionPaymentMethodOptionsCardRequestMulticapture {
6449    IfAvailable,
6450    Never,
6451    /// An unrecognized value from Stripe. Should not be used as a request parameter.
6452    Unknown(String),
6453}
6454impl CreateCheckoutSessionPaymentMethodOptionsCardRequestMulticapture {
6455    pub fn as_str(&self) -> &str {
6456        use CreateCheckoutSessionPaymentMethodOptionsCardRequestMulticapture::*;
6457        match self {
6458            IfAvailable => "if_available",
6459            Never => "never",
6460            Unknown(v) => v,
6461        }
6462    }
6463}
6464
6465impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsCardRequestMulticapture {
6466    type Err = std::convert::Infallible;
6467    fn from_str(s: &str) -> Result<Self, Self::Err> {
6468        use CreateCheckoutSessionPaymentMethodOptionsCardRequestMulticapture::*;
6469        match s {
6470            "if_available" => Ok(IfAvailable),
6471            "never" => Ok(Never),
6472            v => {
6473                tracing::warn!(
6474                    "Unknown value '{}' for enum '{}'",
6475                    v,
6476                    "CreateCheckoutSessionPaymentMethodOptionsCardRequestMulticapture"
6477                );
6478                Ok(Unknown(v.to_owned()))
6479            }
6480        }
6481    }
6482}
6483impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsCardRequestMulticapture {
6484    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6485        f.write_str(self.as_str())
6486    }
6487}
6488
6489#[cfg(not(feature = "redact-generated-debug"))]
6490impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCardRequestMulticapture {
6491    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6492        f.write_str(self.as_str())
6493    }
6494}
6495#[cfg(feature = "redact-generated-debug")]
6496impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCardRequestMulticapture {
6497    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6498        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsCardRequestMulticapture))
6499            .finish_non_exhaustive()
6500    }
6501}
6502impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsCardRequestMulticapture {
6503    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6504    where
6505        S: serde::Serializer,
6506    {
6507        serializer.serialize_str(self.as_str())
6508    }
6509}
6510#[cfg(feature = "deserialize")]
6511impl<'de> serde::Deserialize<'de>
6512    for CreateCheckoutSessionPaymentMethodOptionsCardRequestMulticapture
6513{
6514    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6515        use std::str::FromStr;
6516        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6517        Ok(Self::from_str(&s).expect("infallible"))
6518    }
6519}
6520/// Request ability to [overcapture](/payments/overcapture) for this CheckoutSession.
6521#[derive(Clone, Eq, PartialEq)]
6522#[non_exhaustive]
6523pub enum CreateCheckoutSessionPaymentMethodOptionsCardRequestOvercapture {
6524    IfAvailable,
6525    Never,
6526    /// An unrecognized value from Stripe. Should not be used as a request parameter.
6527    Unknown(String),
6528}
6529impl CreateCheckoutSessionPaymentMethodOptionsCardRequestOvercapture {
6530    pub fn as_str(&self) -> &str {
6531        use CreateCheckoutSessionPaymentMethodOptionsCardRequestOvercapture::*;
6532        match self {
6533            IfAvailable => "if_available",
6534            Never => "never",
6535            Unknown(v) => v,
6536        }
6537    }
6538}
6539
6540impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsCardRequestOvercapture {
6541    type Err = std::convert::Infallible;
6542    fn from_str(s: &str) -> Result<Self, Self::Err> {
6543        use CreateCheckoutSessionPaymentMethodOptionsCardRequestOvercapture::*;
6544        match s {
6545            "if_available" => Ok(IfAvailable),
6546            "never" => Ok(Never),
6547            v => {
6548                tracing::warn!(
6549                    "Unknown value '{}' for enum '{}'",
6550                    v,
6551                    "CreateCheckoutSessionPaymentMethodOptionsCardRequestOvercapture"
6552                );
6553                Ok(Unknown(v.to_owned()))
6554            }
6555        }
6556    }
6557}
6558impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsCardRequestOvercapture {
6559    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6560        f.write_str(self.as_str())
6561    }
6562}
6563
6564#[cfg(not(feature = "redact-generated-debug"))]
6565impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCardRequestOvercapture {
6566    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6567        f.write_str(self.as_str())
6568    }
6569}
6570#[cfg(feature = "redact-generated-debug")]
6571impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCardRequestOvercapture {
6572    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6573        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsCardRequestOvercapture))
6574            .finish_non_exhaustive()
6575    }
6576}
6577impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsCardRequestOvercapture {
6578    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6579    where
6580        S: serde::Serializer,
6581    {
6582        serializer.serialize_str(self.as_str())
6583    }
6584}
6585#[cfg(feature = "deserialize")]
6586impl<'de> serde::Deserialize<'de>
6587    for CreateCheckoutSessionPaymentMethodOptionsCardRequestOvercapture
6588{
6589    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6590        use std::str::FromStr;
6591        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6592        Ok(Self::from_str(&s).expect("infallible"))
6593    }
6594}
6595/// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication).
6596/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
6597/// If not provided, this value defaults to `automatic`.
6598/// Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
6599#[derive(Clone, Eq, PartialEq)]
6600#[non_exhaustive]
6601pub enum CreateCheckoutSessionPaymentMethodOptionsCardRequestThreeDSecure {
6602    Any,
6603    Automatic,
6604    Challenge,
6605    /// An unrecognized value from Stripe. Should not be used as a request parameter.
6606    Unknown(String),
6607}
6608impl CreateCheckoutSessionPaymentMethodOptionsCardRequestThreeDSecure {
6609    pub fn as_str(&self) -> &str {
6610        use CreateCheckoutSessionPaymentMethodOptionsCardRequestThreeDSecure::*;
6611        match self {
6612            Any => "any",
6613            Automatic => "automatic",
6614            Challenge => "challenge",
6615            Unknown(v) => v,
6616        }
6617    }
6618}
6619
6620impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsCardRequestThreeDSecure {
6621    type Err = std::convert::Infallible;
6622    fn from_str(s: &str) -> Result<Self, Self::Err> {
6623        use CreateCheckoutSessionPaymentMethodOptionsCardRequestThreeDSecure::*;
6624        match s {
6625            "any" => Ok(Any),
6626            "automatic" => Ok(Automatic),
6627            "challenge" => Ok(Challenge),
6628            v => {
6629                tracing::warn!(
6630                    "Unknown value '{}' for enum '{}'",
6631                    v,
6632                    "CreateCheckoutSessionPaymentMethodOptionsCardRequestThreeDSecure"
6633                );
6634                Ok(Unknown(v.to_owned()))
6635            }
6636        }
6637    }
6638}
6639impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsCardRequestThreeDSecure {
6640    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6641        f.write_str(self.as_str())
6642    }
6643}
6644
6645#[cfg(not(feature = "redact-generated-debug"))]
6646impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCardRequestThreeDSecure {
6647    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6648        f.write_str(self.as_str())
6649    }
6650}
6651#[cfg(feature = "redact-generated-debug")]
6652impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCardRequestThreeDSecure {
6653    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6654        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsCardRequestThreeDSecure))
6655            .finish_non_exhaustive()
6656    }
6657}
6658impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsCardRequestThreeDSecure {
6659    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6660    where
6661        S: serde::Serializer,
6662    {
6663        serializer.serialize_str(self.as_str())
6664    }
6665}
6666#[cfg(feature = "deserialize")]
6667impl<'de> serde::Deserialize<'de>
6668    for CreateCheckoutSessionPaymentMethodOptionsCardRequestThreeDSecure
6669{
6670    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6671        use std::str::FromStr;
6672        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6673        Ok(Self::from_str(&s).expect("infallible"))
6674    }
6675}
6676/// Restrictions to apply to the card payment method.
6677/// For example, you can block specific card brands.
6678/// You can't set this parameter if `ui_mode` is `custom`.
6679#[derive(Clone, Eq, PartialEq)]
6680#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
6681#[derive(serde::Serialize)]
6682pub struct CreateCheckoutSessionPaymentMethodOptionsCardRestrictions {
6683    /// The card brands to block.
6684    /// If a customer enters or selects a card belonging to a blocked brand, they can't complete the payment.
6685    #[serde(skip_serializing_if = "Option::is_none")]
6686    pub brands_blocked:
6687        Option<Vec<CreateCheckoutSessionPaymentMethodOptionsCardRestrictionsBrandsBlocked>>,
6688}
6689#[cfg(feature = "redact-generated-debug")]
6690impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCardRestrictions {
6691    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6692        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsCardRestrictions")
6693            .finish_non_exhaustive()
6694    }
6695}
6696impl CreateCheckoutSessionPaymentMethodOptionsCardRestrictions {
6697    pub fn new() -> Self {
6698        Self { brands_blocked: None }
6699    }
6700}
6701impl Default for CreateCheckoutSessionPaymentMethodOptionsCardRestrictions {
6702    fn default() -> Self {
6703        Self::new()
6704    }
6705}
6706/// The card brands to block.
6707/// If a customer enters or selects a card belonging to a blocked brand, they can't complete the payment.
6708#[derive(Clone, Eq, PartialEq)]
6709#[non_exhaustive]
6710pub enum CreateCheckoutSessionPaymentMethodOptionsCardRestrictionsBrandsBlocked {
6711    AmericanExpress,
6712    DiscoverGlobalNetwork,
6713    Mastercard,
6714    Visa,
6715    /// An unrecognized value from Stripe. Should not be used as a request parameter.
6716    Unknown(String),
6717}
6718impl CreateCheckoutSessionPaymentMethodOptionsCardRestrictionsBrandsBlocked {
6719    pub fn as_str(&self) -> &str {
6720        use CreateCheckoutSessionPaymentMethodOptionsCardRestrictionsBrandsBlocked::*;
6721        match self {
6722            AmericanExpress => "american_express",
6723            DiscoverGlobalNetwork => "discover_global_network",
6724            Mastercard => "mastercard",
6725            Visa => "visa",
6726            Unknown(v) => v,
6727        }
6728    }
6729}
6730
6731impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsCardRestrictionsBrandsBlocked {
6732    type Err = std::convert::Infallible;
6733    fn from_str(s: &str) -> Result<Self, Self::Err> {
6734        use CreateCheckoutSessionPaymentMethodOptionsCardRestrictionsBrandsBlocked::*;
6735        match s {
6736            "american_express" => Ok(AmericanExpress),
6737            "discover_global_network" => Ok(DiscoverGlobalNetwork),
6738            "mastercard" => Ok(Mastercard),
6739            "visa" => Ok(Visa),
6740            v => {
6741                tracing::warn!(
6742                    "Unknown value '{}' for enum '{}'",
6743                    v,
6744                    "CreateCheckoutSessionPaymentMethodOptionsCardRestrictionsBrandsBlocked"
6745                );
6746                Ok(Unknown(v.to_owned()))
6747            }
6748        }
6749    }
6750}
6751impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsCardRestrictionsBrandsBlocked {
6752    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6753        f.write_str(self.as_str())
6754    }
6755}
6756
6757#[cfg(not(feature = "redact-generated-debug"))]
6758impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCardRestrictionsBrandsBlocked {
6759    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6760        f.write_str(self.as_str())
6761    }
6762}
6763#[cfg(feature = "redact-generated-debug")]
6764impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCardRestrictionsBrandsBlocked {
6765    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6766        f.debug_struct(stringify!(
6767            CreateCheckoutSessionPaymentMethodOptionsCardRestrictionsBrandsBlocked
6768        ))
6769        .finish_non_exhaustive()
6770    }
6771}
6772impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsCardRestrictionsBrandsBlocked {
6773    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6774    where
6775        S: serde::Serializer,
6776    {
6777        serializer.serialize_str(self.as_str())
6778    }
6779}
6780#[cfg(feature = "deserialize")]
6781impl<'de> serde::Deserialize<'de>
6782    for CreateCheckoutSessionPaymentMethodOptionsCardRestrictionsBrandsBlocked
6783{
6784    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6785        use std::str::FromStr;
6786        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6787        Ok(Self::from_str(&s).expect("infallible"))
6788    }
6789}
6790/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6791///
6792/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6793/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6794///
6795/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6796///
6797/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6798#[derive(Clone, Eq, PartialEq)]
6799#[non_exhaustive]
6800pub enum CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage {
6801    OffSession,
6802    OnSession,
6803    /// An unrecognized value from Stripe. Should not be used as a request parameter.
6804    Unknown(String),
6805}
6806impl CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage {
6807    pub fn as_str(&self) -> &str {
6808        use CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage::*;
6809        match self {
6810            OffSession => "off_session",
6811            OnSession => "on_session",
6812            Unknown(v) => v,
6813        }
6814    }
6815}
6816
6817impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage {
6818    type Err = std::convert::Infallible;
6819    fn from_str(s: &str) -> Result<Self, Self::Err> {
6820        use CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage::*;
6821        match s {
6822            "off_session" => Ok(OffSession),
6823            "on_session" => Ok(OnSession),
6824            v => {
6825                tracing::warn!(
6826                    "Unknown value '{}' for enum '{}'",
6827                    v,
6828                    "CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage"
6829                );
6830                Ok(Unknown(v.to_owned()))
6831            }
6832        }
6833    }
6834}
6835impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage {
6836    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6837        f.write_str(self.as_str())
6838    }
6839}
6840
6841#[cfg(not(feature = "redact-generated-debug"))]
6842impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage {
6843    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6844        f.write_str(self.as_str())
6845    }
6846}
6847#[cfg(feature = "redact-generated-debug")]
6848impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage {
6849    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6850        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage))
6851            .finish_non_exhaustive()
6852    }
6853}
6854impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage {
6855    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6856    where
6857        S: serde::Serializer,
6858    {
6859        serializer.serialize_str(self.as_str())
6860    }
6861}
6862#[cfg(feature = "deserialize")]
6863impl<'de> serde::Deserialize<'de>
6864    for CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage
6865{
6866    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6867        use std::str::FromStr;
6868        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6869        Ok(Self::from_str(&s).expect("infallible"))
6870    }
6871}
6872/// contains details about the Cashapp Pay payment method options.
6873#[derive(Clone, Eq, PartialEq)]
6874#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
6875#[derive(serde::Serialize)]
6876pub struct CreateCheckoutSessionPaymentMethodOptionsCashapp {
6877    /// Controls when the funds will be captured from the customer's account.
6878    #[serde(skip_serializing_if = "Option::is_none")]
6879    pub capture_method: Option<CreateCheckoutSessionPaymentMethodOptionsCashappCaptureMethod>,
6880    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6881    ///
6882    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6883    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6884    ///
6885    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6886    ///
6887    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6888    #[serde(skip_serializing_if = "Option::is_none")]
6889    pub setup_future_usage:
6890        Option<CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage>,
6891}
6892#[cfg(feature = "redact-generated-debug")]
6893impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCashapp {
6894    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6895        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsCashapp").finish_non_exhaustive()
6896    }
6897}
6898impl CreateCheckoutSessionPaymentMethodOptionsCashapp {
6899    pub fn new() -> Self {
6900        Self { capture_method: None, setup_future_usage: None }
6901    }
6902}
6903impl Default for CreateCheckoutSessionPaymentMethodOptionsCashapp {
6904    fn default() -> Self {
6905        Self::new()
6906    }
6907}
6908/// Controls when the funds will be captured from the customer's account.
6909#[derive(Clone, Eq, PartialEq)]
6910#[non_exhaustive]
6911pub enum CreateCheckoutSessionPaymentMethodOptionsCashappCaptureMethod {
6912    Manual,
6913    /// An unrecognized value from Stripe. Should not be used as a request parameter.
6914    Unknown(String),
6915}
6916impl CreateCheckoutSessionPaymentMethodOptionsCashappCaptureMethod {
6917    pub fn as_str(&self) -> &str {
6918        use CreateCheckoutSessionPaymentMethodOptionsCashappCaptureMethod::*;
6919        match self {
6920            Manual => "manual",
6921            Unknown(v) => v,
6922        }
6923    }
6924}
6925
6926impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsCashappCaptureMethod {
6927    type Err = std::convert::Infallible;
6928    fn from_str(s: &str) -> Result<Self, Self::Err> {
6929        use CreateCheckoutSessionPaymentMethodOptionsCashappCaptureMethod::*;
6930        match s {
6931            "manual" => Ok(Manual),
6932            v => {
6933                tracing::warn!(
6934                    "Unknown value '{}' for enum '{}'",
6935                    v,
6936                    "CreateCheckoutSessionPaymentMethodOptionsCashappCaptureMethod"
6937                );
6938                Ok(Unknown(v.to_owned()))
6939            }
6940        }
6941    }
6942}
6943impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsCashappCaptureMethod {
6944    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6945        f.write_str(self.as_str())
6946    }
6947}
6948
6949#[cfg(not(feature = "redact-generated-debug"))]
6950impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCashappCaptureMethod {
6951    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6952        f.write_str(self.as_str())
6953    }
6954}
6955#[cfg(feature = "redact-generated-debug")]
6956impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCashappCaptureMethod {
6957    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6958        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsCashappCaptureMethod))
6959            .finish_non_exhaustive()
6960    }
6961}
6962impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsCashappCaptureMethod {
6963    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6964    where
6965        S: serde::Serializer,
6966    {
6967        serializer.serialize_str(self.as_str())
6968    }
6969}
6970#[cfg(feature = "deserialize")]
6971impl<'de> serde::Deserialize<'de>
6972    for CreateCheckoutSessionPaymentMethodOptionsCashappCaptureMethod
6973{
6974    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6975        use std::str::FromStr;
6976        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6977        Ok(Self::from_str(&s).expect("infallible"))
6978    }
6979}
6980/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6981///
6982/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6983/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6984///
6985/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6986///
6987/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6988#[derive(Clone, Eq, PartialEq)]
6989#[non_exhaustive]
6990pub enum CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage {
6991    None,
6992    OffSession,
6993    OnSession,
6994    /// An unrecognized value from Stripe. Should not be used as a request parameter.
6995    Unknown(String),
6996}
6997impl CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage {
6998    pub fn as_str(&self) -> &str {
6999        use CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage::*;
7000        match self {
7001            None => "none",
7002            OffSession => "off_session",
7003            OnSession => "on_session",
7004            Unknown(v) => v,
7005        }
7006    }
7007}
7008
7009impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage {
7010    type Err = std::convert::Infallible;
7011    fn from_str(s: &str) -> Result<Self, Self::Err> {
7012        use CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage::*;
7013        match s {
7014            "none" => Ok(None),
7015            "off_session" => Ok(OffSession),
7016            "on_session" => Ok(OnSession),
7017            v => {
7018                tracing::warn!(
7019                    "Unknown value '{}' for enum '{}'",
7020                    v,
7021                    "CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage"
7022                );
7023                Ok(Unknown(v.to_owned()))
7024            }
7025        }
7026    }
7027}
7028impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage {
7029    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7030        f.write_str(self.as_str())
7031    }
7032}
7033
7034#[cfg(not(feature = "redact-generated-debug"))]
7035impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage {
7036    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7037        f.write_str(self.as_str())
7038    }
7039}
7040#[cfg(feature = "redact-generated-debug")]
7041impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage {
7042    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7043        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage))
7044            .finish_non_exhaustive()
7045    }
7046}
7047impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage {
7048    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7049    where
7050        S: serde::Serializer,
7051    {
7052        serializer.serialize_str(self.as_str())
7053    }
7054}
7055#[cfg(feature = "deserialize")]
7056impl<'de> serde::Deserialize<'de>
7057    for CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage
7058{
7059    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7060        use std::str::FromStr;
7061        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7062        Ok(Self::from_str(&s).expect("infallible"))
7063    }
7064}
7065/// contains details about the Crypto payment method options.
7066#[derive(Clone, Eq, PartialEq)]
7067#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
7068#[derive(serde::Serialize)]
7069pub struct CreateCheckoutSessionPaymentMethodOptionsCrypto {
7070    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7071    ///
7072    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7073    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7074    ///
7075    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7076    ///
7077    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7078    #[serde(skip_serializing_if = "Option::is_none")]
7079    pub setup_future_usage: Option<CreateCheckoutSessionPaymentMethodOptionsCryptoSetupFutureUsage>,
7080}
7081#[cfg(feature = "redact-generated-debug")]
7082impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCrypto {
7083    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7084        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsCrypto").finish_non_exhaustive()
7085    }
7086}
7087impl CreateCheckoutSessionPaymentMethodOptionsCrypto {
7088    pub fn new() -> Self {
7089        Self { setup_future_usage: None }
7090    }
7091}
7092impl Default for CreateCheckoutSessionPaymentMethodOptionsCrypto {
7093    fn default() -> Self {
7094        Self::new()
7095    }
7096}
7097/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7098///
7099/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7100/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7101///
7102/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7103///
7104/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7105#[derive(Clone, Eq, PartialEq)]
7106#[non_exhaustive]
7107pub enum CreateCheckoutSessionPaymentMethodOptionsCryptoSetupFutureUsage {
7108    None,
7109    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7110    Unknown(String),
7111}
7112impl CreateCheckoutSessionPaymentMethodOptionsCryptoSetupFutureUsage {
7113    pub fn as_str(&self) -> &str {
7114        use CreateCheckoutSessionPaymentMethodOptionsCryptoSetupFutureUsage::*;
7115        match self {
7116            None => "none",
7117            Unknown(v) => v,
7118        }
7119    }
7120}
7121
7122impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsCryptoSetupFutureUsage {
7123    type Err = std::convert::Infallible;
7124    fn from_str(s: &str) -> Result<Self, Self::Err> {
7125        use CreateCheckoutSessionPaymentMethodOptionsCryptoSetupFutureUsage::*;
7126        match s {
7127            "none" => Ok(None),
7128            v => {
7129                tracing::warn!(
7130                    "Unknown value '{}' for enum '{}'",
7131                    v,
7132                    "CreateCheckoutSessionPaymentMethodOptionsCryptoSetupFutureUsage"
7133                );
7134                Ok(Unknown(v.to_owned()))
7135            }
7136        }
7137    }
7138}
7139impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsCryptoSetupFutureUsage {
7140    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7141        f.write_str(self.as_str())
7142    }
7143}
7144
7145#[cfg(not(feature = "redact-generated-debug"))]
7146impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCryptoSetupFutureUsage {
7147    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7148        f.write_str(self.as_str())
7149    }
7150}
7151#[cfg(feature = "redact-generated-debug")]
7152impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCryptoSetupFutureUsage {
7153    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7154        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsCryptoSetupFutureUsage))
7155            .finish_non_exhaustive()
7156    }
7157}
7158impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsCryptoSetupFutureUsage {
7159    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7160    where
7161        S: serde::Serializer,
7162    {
7163        serializer.serialize_str(self.as_str())
7164    }
7165}
7166#[cfg(feature = "deserialize")]
7167impl<'de> serde::Deserialize<'de>
7168    for CreateCheckoutSessionPaymentMethodOptionsCryptoSetupFutureUsage
7169{
7170    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7171        use std::str::FromStr;
7172        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7173        Ok(Self::from_str(&s).expect("infallible"))
7174    }
7175}
7176/// contains details about the Customer Balance payment method options.
7177#[derive(Clone, Eq, PartialEq)]
7178#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
7179#[derive(serde::Serialize)]
7180pub struct CreateCheckoutSessionPaymentMethodOptionsCustomerBalance {
7181    /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
7182    #[serde(skip_serializing_if = "Option::is_none")]
7183    pub bank_transfer: Option<CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransfer>,
7184    /// The funding method type to be used when there are not enough funds in the customer balance.
7185    /// Permitted values include: `bank_transfer`.
7186    #[serde(skip_serializing_if = "Option::is_none")]
7187    pub funding_type: Option<CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType>,
7188    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7189    ///
7190    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7191    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7192    ///
7193    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7194    ///
7195    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7196    #[serde(skip_serializing_if = "Option::is_none")]
7197    pub setup_future_usage:
7198        Option<CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage>,
7199}
7200#[cfg(feature = "redact-generated-debug")]
7201impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCustomerBalance {
7202    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7203        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsCustomerBalance")
7204            .finish_non_exhaustive()
7205    }
7206}
7207impl CreateCheckoutSessionPaymentMethodOptionsCustomerBalance {
7208    pub fn new() -> Self {
7209        Self { bank_transfer: None, funding_type: None, setup_future_usage: None }
7210    }
7211}
7212impl Default for CreateCheckoutSessionPaymentMethodOptionsCustomerBalance {
7213    fn default() -> Self {
7214        Self::new()
7215    }
7216}
7217/// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
7218#[derive(Clone, Eq, PartialEq)]
7219#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
7220#[derive(serde::Serialize)]
7221pub struct CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransfer {
7222    /// Configuration for eu_bank_transfer funding type.
7223#[serde(skip_serializing_if = "Option::is_none")]
7224pub eu_bank_transfer: Option<CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer>,
7225        /// List of address types that should be returned in the financial_addresses response.
7226    /// If not specified, all valid types will be returned.
7227    ///
7228    /// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`.
7229#[serde(skip_serializing_if = "Option::is_none")]
7230pub requested_address_types: Option<Vec<CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes>>,
7231    /// The list of bank transfer types that this PaymentIntent is allowed to use for funding.
7232#[serde(rename = "type")]
7233pub type_: CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType,
7234
7235}
7236#[cfg(feature = "redact-generated-debug")]
7237impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransfer {
7238    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7239        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransfer")
7240            .finish_non_exhaustive()
7241    }
7242}
7243impl CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransfer {
7244    pub fn new(
7245        type_: impl Into<CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType>,
7246    ) -> Self {
7247        Self { eu_bank_transfer: None, requested_address_types: None, type_: type_.into() }
7248    }
7249}
7250/// Configuration for eu_bank_transfer funding type.
7251#[derive(Clone, Eq, PartialEq)]
7252#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
7253#[derive(serde::Serialize)]
7254pub struct CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer {
7255    /// The desired country code of the bank account information.
7256    /// Permitted values include: `DE`, `FR`, `IE`, or `NL`.
7257    pub country: String,
7258}
7259#[cfg(feature = "redact-generated-debug")]
7260impl std::fmt::Debug
7261    for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer
7262{
7263    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7264        f.debug_struct(
7265            "CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer",
7266        )
7267        .finish_non_exhaustive()
7268    }
7269}
7270impl CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer {
7271    pub fn new(country: impl Into<String>) -> Self {
7272        Self { country: country.into() }
7273    }
7274}
7275/// List of address types that should be returned in the financial_addresses response.
7276/// If not specified, all valid types will be returned.
7277///
7278/// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`.
7279#[derive(Clone, Eq, PartialEq)]
7280#[non_exhaustive]
7281pub enum CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
7282    Aba,
7283    Iban,
7284    Sepa,
7285    SortCode,
7286    Spei,
7287    Swift,
7288    Zengin,
7289    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7290    Unknown(String),
7291}
7292impl CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
7293    pub fn as_str(&self) -> &str {
7294        use CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*;
7295        match self {
7296            Aba => "aba",
7297            Iban => "iban",
7298            Sepa => "sepa",
7299            SortCode => "sort_code",
7300            Spei => "spei",
7301            Swift => "swift",
7302            Zengin => "zengin",
7303            Unknown(v) => v,
7304        }
7305    }
7306}
7307
7308impl std::str::FromStr
7309    for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
7310{
7311    type Err = std::convert::Infallible;
7312    fn from_str(s: &str) -> Result<Self, Self::Err> {
7313        use CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*;
7314        match s {
7315            "aba" => Ok(Aba),
7316            "iban" => Ok(Iban),
7317            "sepa" => Ok(Sepa),
7318            "sort_code" => Ok(SortCode),
7319            "spei" => Ok(Spei),
7320            "swift" => Ok(Swift),
7321            "zengin" => Ok(Zengin),
7322            v => {
7323                tracing::warn!(
7324                    "Unknown value '{}' for enum '{}'",
7325                    v,
7326                    "CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes"
7327                );
7328                Ok(Unknown(v.to_owned()))
7329            }
7330        }
7331    }
7332}
7333impl std::fmt::Display
7334    for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
7335{
7336    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7337        f.write_str(self.as_str())
7338    }
7339}
7340
7341#[cfg(not(feature = "redact-generated-debug"))]
7342impl std::fmt::Debug
7343    for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
7344{
7345    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7346        f.write_str(self.as_str())
7347    }
7348}
7349#[cfg(feature = "redact-generated-debug")]
7350impl std::fmt::Debug
7351    for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
7352{
7353    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7354        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes)).finish_non_exhaustive()
7355    }
7356}
7357impl serde::Serialize
7358    for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
7359{
7360    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7361    where
7362        S: serde::Serializer,
7363    {
7364        serializer.serialize_str(self.as_str())
7365    }
7366}
7367#[cfg(feature = "deserialize")]
7368impl<'de> serde::Deserialize<'de>
7369    for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
7370{
7371    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7372        use std::str::FromStr;
7373        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7374        Ok(Self::from_str(&s).expect("infallible"))
7375    }
7376}
7377/// The list of bank transfer types that this PaymentIntent is allowed to use for funding.
7378#[derive(Clone, Eq, PartialEq)]
7379#[non_exhaustive]
7380pub enum CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType {
7381    EuBankTransfer,
7382    GbBankTransfer,
7383    JpBankTransfer,
7384    MxBankTransfer,
7385    UsBankTransfer,
7386    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7387    Unknown(String),
7388}
7389impl CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType {
7390    pub fn as_str(&self) -> &str {
7391        use CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType::*;
7392        match self {
7393            EuBankTransfer => "eu_bank_transfer",
7394            GbBankTransfer => "gb_bank_transfer",
7395            JpBankTransfer => "jp_bank_transfer",
7396            MxBankTransfer => "mx_bank_transfer",
7397            UsBankTransfer => "us_bank_transfer",
7398            Unknown(v) => v,
7399        }
7400    }
7401}
7402
7403impl std::str::FromStr
7404    for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType
7405{
7406    type Err = std::convert::Infallible;
7407    fn from_str(s: &str) -> Result<Self, Self::Err> {
7408        use CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType::*;
7409        match s {
7410            "eu_bank_transfer" => Ok(EuBankTransfer),
7411            "gb_bank_transfer" => Ok(GbBankTransfer),
7412            "jp_bank_transfer" => Ok(JpBankTransfer),
7413            "mx_bank_transfer" => Ok(MxBankTransfer),
7414            "us_bank_transfer" => Ok(UsBankTransfer),
7415            v => {
7416                tracing::warn!(
7417                    "Unknown value '{}' for enum '{}'",
7418                    v,
7419                    "CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType"
7420                );
7421                Ok(Unknown(v.to_owned()))
7422            }
7423        }
7424    }
7425}
7426impl std::fmt::Display
7427    for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType
7428{
7429    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7430        f.write_str(self.as_str())
7431    }
7432}
7433
7434#[cfg(not(feature = "redact-generated-debug"))]
7435impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType {
7436    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7437        f.write_str(self.as_str())
7438    }
7439}
7440#[cfg(feature = "redact-generated-debug")]
7441impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType {
7442    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7443        f.debug_struct(stringify!(
7444            CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType
7445        ))
7446        .finish_non_exhaustive()
7447    }
7448}
7449impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType {
7450    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7451    where
7452        S: serde::Serializer,
7453    {
7454        serializer.serialize_str(self.as_str())
7455    }
7456}
7457#[cfg(feature = "deserialize")]
7458impl<'de> serde::Deserialize<'de>
7459    for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType
7460{
7461    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7462        use std::str::FromStr;
7463        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7464        Ok(Self::from_str(&s).expect("infallible"))
7465    }
7466}
7467/// The funding method type to be used when there are not enough funds in the customer balance.
7468/// Permitted values include: `bank_transfer`.
7469#[derive(Clone, Eq, PartialEq)]
7470#[non_exhaustive]
7471pub enum CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType {
7472    BankTransfer,
7473    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7474    Unknown(String),
7475}
7476impl CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType {
7477    pub fn as_str(&self) -> &str {
7478        use CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType::*;
7479        match self {
7480            BankTransfer => "bank_transfer",
7481            Unknown(v) => v,
7482        }
7483    }
7484}
7485
7486impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType {
7487    type Err = std::convert::Infallible;
7488    fn from_str(s: &str) -> Result<Self, Self::Err> {
7489        use CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType::*;
7490        match s {
7491            "bank_transfer" => Ok(BankTransfer),
7492            v => {
7493                tracing::warn!(
7494                    "Unknown value '{}' for enum '{}'",
7495                    v,
7496                    "CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType"
7497                );
7498                Ok(Unknown(v.to_owned()))
7499            }
7500        }
7501    }
7502}
7503impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType {
7504    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7505        f.write_str(self.as_str())
7506    }
7507}
7508
7509#[cfg(not(feature = "redact-generated-debug"))]
7510impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType {
7511    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7512        f.write_str(self.as_str())
7513    }
7514}
7515#[cfg(feature = "redact-generated-debug")]
7516impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType {
7517    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7518        f.debug_struct(stringify!(
7519            CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType
7520        ))
7521        .finish_non_exhaustive()
7522    }
7523}
7524impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType {
7525    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7526    where
7527        S: serde::Serializer,
7528    {
7529        serializer.serialize_str(self.as_str())
7530    }
7531}
7532#[cfg(feature = "deserialize")]
7533impl<'de> serde::Deserialize<'de>
7534    for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType
7535{
7536    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7537        use std::str::FromStr;
7538        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7539        Ok(Self::from_str(&s).expect("infallible"))
7540    }
7541}
7542/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7543///
7544/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7545/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7546///
7547/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7548///
7549/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7550#[derive(Clone, Eq, PartialEq)]
7551#[non_exhaustive]
7552pub enum CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
7553    None,
7554    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7555    Unknown(String),
7556}
7557impl CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
7558    pub fn as_str(&self) -> &str {
7559        use CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*;
7560        match self {
7561            None => "none",
7562            Unknown(v) => v,
7563        }
7564    }
7565}
7566
7567impl std::str::FromStr
7568    for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage
7569{
7570    type Err = std::convert::Infallible;
7571    fn from_str(s: &str) -> Result<Self, Self::Err> {
7572        use CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*;
7573        match s {
7574            "none" => Ok(None),
7575            v => {
7576                tracing::warn!(
7577                    "Unknown value '{}' for enum '{}'",
7578                    v,
7579                    "CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage"
7580                );
7581                Ok(Unknown(v.to_owned()))
7582            }
7583        }
7584    }
7585}
7586impl std::fmt::Display
7587    for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage
7588{
7589    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7590        f.write_str(self.as_str())
7591    }
7592}
7593
7594#[cfg(not(feature = "redact-generated-debug"))]
7595impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
7596    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7597        f.write_str(self.as_str())
7598    }
7599}
7600#[cfg(feature = "redact-generated-debug")]
7601impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
7602    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7603        f.debug_struct(stringify!(
7604            CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage
7605        ))
7606        .finish_non_exhaustive()
7607    }
7608}
7609impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
7610    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7611    where
7612        S: serde::Serializer,
7613    {
7614        serializer.serialize_str(self.as_str())
7615    }
7616}
7617#[cfg(feature = "deserialize")]
7618impl<'de> serde::Deserialize<'de>
7619    for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage
7620{
7621    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7622        use std::str::FromStr;
7623        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7624        Ok(Self::from_str(&s).expect("infallible"))
7625    }
7626}
7627/// contains details about the DemoPay payment method options.
7628#[derive(Clone, Eq, PartialEq)]
7629#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
7630#[derive(serde::Serialize)]
7631pub struct CreateCheckoutSessionPaymentMethodOptionsDemoPay {
7632    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7633    ///
7634    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7635    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7636    ///
7637    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7638    ///
7639    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7640    #[serde(skip_serializing_if = "Option::is_none")]
7641    pub setup_future_usage:
7642        Option<CreateCheckoutSessionPaymentMethodOptionsDemoPaySetupFutureUsage>,
7643}
7644#[cfg(feature = "redact-generated-debug")]
7645impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsDemoPay {
7646    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7647        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsDemoPay").finish_non_exhaustive()
7648    }
7649}
7650impl CreateCheckoutSessionPaymentMethodOptionsDemoPay {
7651    pub fn new() -> Self {
7652        Self { setup_future_usage: None }
7653    }
7654}
7655impl Default for CreateCheckoutSessionPaymentMethodOptionsDemoPay {
7656    fn default() -> Self {
7657        Self::new()
7658    }
7659}
7660/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7661///
7662/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7663/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7664///
7665/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7666///
7667/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7668#[derive(Clone, Eq, PartialEq)]
7669#[non_exhaustive]
7670pub enum CreateCheckoutSessionPaymentMethodOptionsDemoPaySetupFutureUsage {
7671    None,
7672    OffSession,
7673    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7674    Unknown(String),
7675}
7676impl CreateCheckoutSessionPaymentMethodOptionsDemoPaySetupFutureUsage {
7677    pub fn as_str(&self) -> &str {
7678        use CreateCheckoutSessionPaymentMethodOptionsDemoPaySetupFutureUsage::*;
7679        match self {
7680            None => "none",
7681            OffSession => "off_session",
7682            Unknown(v) => v,
7683        }
7684    }
7685}
7686
7687impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsDemoPaySetupFutureUsage {
7688    type Err = std::convert::Infallible;
7689    fn from_str(s: &str) -> Result<Self, Self::Err> {
7690        use CreateCheckoutSessionPaymentMethodOptionsDemoPaySetupFutureUsage::*;
7691        match s {
7692            "none" => Ok(None),
7693            "off_session" => Ok(OffSession),
7694            v => {
7695                tracing::warn!(
7696                    "Unknown value '{}' for enum '{}'",
7697                    v,
7698                    "CreateCheckoutSessionPaymentMethodOptionsDemoPaySetupFutureUsage"
7699                );
7700                Ok(Unknown(v.to_owned()))
7701            }
7702        }
7703    }
7704}
7705impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsDemoPaySetupFutureUsage {
7706    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7707        f.write_str(self.as_str())
7708    }
7709}
7710
7711#[cfg(not(feature = "redact-generated-debug"))]
7712impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsDemoPaySetupFutureUsage {
7713    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7714        f.write_str(self.as_str())
7715    }
7716}
7717#[cfg(feature = "redact-generated-debug")]
7718impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsDemoPaySetupFutureUsage {
7719    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7720        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsDemoPaySetupFutureUsage))
7721            .finish_non_exhaustive()
7722    }
7723}
7724impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsDemoPaySetupFutureUsage {
7725    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7726    where
7727        S: serde::Serializer,
7728    {
7729        serializer.serialize_str(self.as_str())
7730    }
7731}
7732#[cfg(feature = "deserialize")]
7733impl<'de> serde::Deserialize<'de>
7734    for CreateCheckoutSessionPaymentMethodOptionsDemoPaySetupFutureUsage
7735{
7736    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7737        use std::str::FromStr;
7738        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7739        Ok(Self::from_str(&s).expect("infallible"))
7740    }
7741}
7742/// contains details about the EPS payment method options.
7743#[derive(Clone, Eq, PartialEq)]
7744#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
7745#[derive(serde::Serialize)]
7746pub struct CreateCheckoutSessionPaymentMethodOptionsEps {
7747    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7748    ///
7749    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7750    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7751    ///
7752    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7753    ///
7754    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7755    #[serde(skip_serializing_if = "Option::is_none")]
7756    pub setup_future_usage: Option<CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage>,
7757}
7758#[cfg(feature = "redact-generated-debug")]
7759impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsEps {
7760    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7761        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsEps").finish_non_exhaustive()
7762    }
7763}
7764impl CreateCheckoutSessionPaymentMethodOptionsEps {
7765    pub fn new() -> Self {
7766        Self { setup_future_usage: None }
7767    }
7768}
7769impl Default for CreateCheckoutSessionPaymentMethodOptionsEps {
7770    fn default() -> Self {
7771        Self::new()
7772    }
7773}
7774/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7775///
7776/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7777/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7778///
7779/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7780///
7781/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7782#[derive(Clone, Eq, PartialEq)]
7783#[non_exhaustive]
7784pub enum CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage {
7785    None,
7786    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7787    Unknown(String),
7788}
7789impl CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage {
7790    pub fn as_str(&self) -> &str {
7791        use CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage::*;
7792        match self {
7793            None => "none",
7794            Unknown(v) => v,
7795        }
7796    }
7797}
7798
7799impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage {
7800    type Err = std::convert::Infallible;
7801    fn from_str(s: &str) -> Result<Self, Self::Err> {
7802        use CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage::*;
7803        match s {
7804            "none" => Ok(None),
7805            v => {
7806                tracing::warn!(
7807                    "Unknown value '{}' for enum '{}'",
7808                    v,
7809                    "CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage"
7810                );
7811                Ok(Unknown(v.to_owned()))
7812            }
7813        }
7814    }
7815}
7816impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage {
7817    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7818        f.write_str(self.as_str())
7819    }
7820}
7821
7822#[cfg(not(feature = "redact-generated-debug"))]
7823impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage {
7824    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7825        f.write_str(self.as_str())
7826    }
7827}
7828#[cfg(feature = "redact-generated-debug")]
7829impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage {
7830    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7831        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage))
7832            .finish_non_exhaustive()
7833    }
7834}
7835impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage {
7836    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7837    where
7838        S: serde::Serializer,
7839    {
7840        serializer.serialize_str(self.as_str())
7841    }
7842}
7843#[cfg(feature = "deserialize")]
7844impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage {
7845    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7846        use std::str::FromStr;
7847        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7848        Ok(Self::from_str(&s).expect("infallible"))
7849    }
7850}
7851/// contains details about the FPX payment method options.
7852#[derive(Clone, Eq, PartialEq)]
7853#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
7854#[derive(serde::Serialize)]
7855pub struct CreateCheckoutSessionPaymentMethodOptionsFpx {
7856    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7857    ///
7858    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7859    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7860    ///
7861    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7862    ///
7863    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7864    #[serde(skip_serializing_if = "Option::is_none")]
7865    pub setup_future_usage: Option<CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage>,
7866}
7867#[cfg(feature = "redact-generated-debug")]
7868impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsFpx {
7869    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7870        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsFpx").finish_non_exhaustive()
7871    }
7872}
7873impl CreateCheckoutSessionPaymentMethodOptionsFpx {
7874    pub fn new() -> Self {
7875        Self { setup_future_usage: None }
7876    }
7877}
7878impl Default for CreateCheckoutSessionPaymentMethodOptionsFpx {
7879    fn default() -> Self {
7880        Self::new()
7881    }
7882}
7883/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7884///
7885/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7886/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7887///
7888/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7889///
7890/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7891#[derive(Clone, Eq, PartialEq)]
7892#[non_exhaustive]
7893pub enum CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage {
7894    None,
7895    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7896    Unknown(String),
7897}
7898impl CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage {
7899    pub fn as_str(&self) -> &str {
7900        use CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage::*;
7901        match self {
7902            None => "none",
7903            Unknown(v) => v,
7904        }
7905    }
7906}
7907
7908impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage {
7909    type Err = std::convert::Infallible;
7910    fn from_str(s: &str) -> Result<Self, Self::Err> {
7911        use CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage::*;
7912        match s {
7913            "none" => Ok(None),
7914            v => {
7915                tracing::warn!(
7916                    "Unknown value '{}' for enum '{}'",
7917                    v,
7918                    "CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage"
7919                );
7920                Ok(Unknown(v.to_owned()))
7921            }
7922        }
7923    }
7924}
7925impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage {
7926    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7927        f.write_str(self.as_str())
7928    }
7929}
7930
7931#[cfg(not(feature = "redact-generated-debug"))]
7932impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage {
7933    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7934        f.write_str(self.as_str())
7935    }
7936}
7937#[cfg(feature = "redact-generated-debug")]
7938impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage {
7939    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7940        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage))
7941            .finish_non_exhaustive()
7942    }
7943}
7944impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage {
7945    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7946    where
7947        S: serde::Serializer,
7948    {
7949        serializer.serialize_str(self.as_str())
7950    }
7951}
7952#[cfg(feature = "deserialize")]
7953impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage {
7954    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7955        use std::str::FromStr;
7956        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7957        Ok(Self::from_str(&s).expect("infallible"))
7958    }
7959}
7960/// contains details about the Giropay payment method options.
7961#[derive(Clone, Eq, PartialEq)]
7962#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
7963#[derive(serde::Serialize)]
7964pub struct CreateCheckoutSessionPaymentMethodOptionsGiropay {
7965    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7966    ///
7967    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7968    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7969    ///
7970    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7971    ///
7972    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7973    #[serde(skip_serializing_if = "Option::is_none")]
7974    pub setup_future_usage:
7975        Option<CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage>,
7976}
7977#[cfg(feature = "redact-generated-debug")]
7978impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsGiropay {
7979    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7980        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsGiropay").finish_non_exhaustive()
7981    }
7982}
7983impl CreateCheckoutSessionPaymentMethodOptionsGiropay {
7984    pub fn new() -> Self {
7985        Self { setup_future_usage: None }
7986    }
7987}
7988impl Default for CreateCheckoutSessionPaymentMethodOptionsGiropay {
7989    fn default() -> Self {
7990        Self::new()
7991    }
7992}
7993/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7994///
7995/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7996/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7997///
7998/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7999///
8000/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8001#[derive(Clone, Eq, PartialEq)]
8002#[non_exhaustive]
8003pub enum CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage {
8004    None,
8005    /// An unrecognized value from Stripe. Should not be used as a request parameter.
8006    Unknown(String),
8007}
8008impl CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage {
8009    pub fn as_str(&self) -> &str {
8010        use CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage::*;
8011        match self {
8012            None => "none",
8013            Unknown(v) => v,
8014        }
8015    }
8016}
8017
8018impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage {
8019    type Err = std::convert::Infallible;
8020    fn from_str(s: &str) -> Result<Self, Self::Err> {
8021        use CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage::*;
8022        match s {
8023            "none" => Ok(None),
8024            v => {
8025                tracing::warn!(
8026                    "Unknown value '{}' for enum '{}'",
8027                    v,
8028                    "CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage"
8029                );
8030                Ok(Unknown(v.to_owned()))
8031            }
8032        }
8033    }
8034}
8035impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage {
8036    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8037        f.write_str(self.as_str())
8038    }
8039}
8040
8041#[cfg(not(feature = "redact-generated-debug"))]
8042impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage {
8043    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8044        f.write_str(self.as_str())
8045    }
8046}
8047#[cfg(feature = "redact-generated-debug")]
8048impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage {
8049    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8050        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage))
8051            .finish_non_exhaustive()
8052    }
8053}
8054impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage {
8055    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8056    where
8057        S: serde::Serializer,
8058    {
8059        serializer.serialize_str(self.as_str())
8060    }
8061}
8062#[cfg(feature = "deserialize")]
8063impl<'de> serde::Deserialize<'de>
8064    for CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage
8065{
8066    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8067        use std::str::FromStr;
8068        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8069        Ok(Self::from_str(&s).expect("infallible"))
8070    }
8071}
8072/// contains details about the Grabpay payment method options.
8073#[derive(Clone, Eq, PartialEq)]
8074#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
8075#[derive(serde::Serialize)]
8076pub struct CreateCheckoutSessionPaymentMethodOptionsGrabpay {
8077    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8078    ///
8079    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8080    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8081    ///
8082    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8083    ///
8084    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8085    #[serde(skip_serializing_if = "Option::is_none")]
8086    pub setup_future_usage:
8087        Option<CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage>,
8088}
8089#[cfg(feature = "redact-generated-debug")]
8090impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsGrabpay {
8091    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8092        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsGrabpay").finish_non_exhaustive()
8093    }
8094}
8095impl CreateCheckoutSessionPaymentMethodOptionsGrabpay {
8096    pub fn new() -> Self {
8097        Self { setup_future_usage: None }
8098    }
8099}
8100impl Default for CreateCheckoutSessionPaymentMethodOptionsGrabpay {
8101    fn default() -> Self {
8102        Self::new()
8103    }
8104}
8105/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8106///
8107/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8108/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8109///
8110/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8111///
8112/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8113#[derive(Clone, Eq, PartialEq)]
8114#[non_exhaustive]
8115pub enum CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage {
8116    None,
8117    /// An unrecognized value from Stripe. Should not be used as a request parameter.
8118    Unknown(String),
8119}
8120impl CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage {
8121    pub fn as_str(&self) -> &str {
8122        use CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage::*;
8123        match self {
8124            None => "none",
8125            Unknown(v) => v,
8126        }
8127    }
8128}
8129
8130impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage {
8131    type Err = std::convert::Infallible;
8132    fn from_str(s: &str) -> Result<Self, Self::Err> {
8133        use CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage::*;
8134        match s {
8135            "none" => Ok(None),
8136            v => {
8137                tracing::warn!(
8138                    "Unknown value '{}' for enum '{}'",
8139                    v,
8140                    "CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage"
8141                );
8142                Ok(Unknown(v.to_owned()))
8143            }
8144        }
8145    }
8146}
8147impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage {
8148    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8149        f.write_str(self.as_str())
8150    }
8151}
8152
8153#[cfg(not(feature = "redact-generated-debug"))]
8154impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage {
8155    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8156        f.write_str(self.as_str())
8157    }
8158}
8159#[cfg(feature = "redact-generated-debug")]
8160impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage {
8161    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8162        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage))
8163            .finish_non_exhaustive()
8164    }
8165}
8166impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage {
8167    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8168    where
8169        S: serde::Serializer,
8170    {
8171        serializer.serialize_str(self.as_str())
8172    }
8173}
8174#[cfg(feature = "deserialize")]
8175impl<'de> serde::Deserialize<'de>
8176    for CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage
8177{
8178    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8179        use std::str::FromStr;
8180        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8181        Ok(Self::from_str(&s).expect("infallible"))
8182    }
8183}
8184/// contains details about the Ideal payment method options.
8185#[derive(Clone, Eq, PartialEq)]
8186#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
8187#[derive(serde::Serialize)]
8188pub struct CreateCheckoutSessionPaymentMethodOptionsIdeal {
8189    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8190    ///
8191    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8192    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8193    ///
8194    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8195    ///
8196    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8197    #[serde(skip_serializing_if = "Option::is_none")]
8198    pub setup_future_usage: Option<CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage>,
8199}
8200#[cfg(feature = "redact-generated-debug")]
8201impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsIdeal {
8202    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8203        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsIdeal").finish_non_exhaustive()
8204    }
8205}
8206impl CreateCheckoutSessionPaymentMethodOptionsIdeal {
8207    pub fn new() -> Self {
8208        Self { setup_future_usage: None }
8209    }
8210}
8211impl Default for CreateCheckoutSessionPaymentMethodOptionsIdeal {
8212    fn default() -> Self {
8213        Self::new()
8214    }
8215}
8216/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8217///
8218/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8219/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8220///
8221/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8222///
8223/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8224#[derive(Clone, Eq, PartialEq)]
8225#[non_exhaustive]
8226pub enum CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage {
8227    None,
8228    /// An unrecognized value from Stripe. Should not be used as a request parameter.
8229    Unknown(String),
8230}
8231impl CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage {
8232    pub fn as_str(&self) -> &str {
8233        use CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage::*;
8234        match self {
8235            None => "none",
8236            Unknown(v) => v,
8237        }
8238    }
8239}
8240
8241impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage {
8242    type Err = std::convert::Infallible;
8243    fn from_str(s: &str) -> Result<Self, Self::Err> {
8244        use CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage::*;
8245        match s {
8246            "none" => Ok(None),
8247            v => {
8248                tracing::warn!(
8249                    "Unknown value '{}' for enum '{}'",
8250                    v,
8251                    "CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage"
8252                );
8253                Ok(Unknown(v.to_owned()))
8254            }
8255        }
8256    }
8257}
8258impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage {
8259    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8260        f.write_str(self.as_str())
8261    }
8262}
8263
8264#[cfg(not(feature = "redact-generated-debug"))]
8265impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage {
8266    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8267        f.write_str(self.as_str())
8268    }
8269}
8270#[cfg(feature = "redact-generated-debug")]
8271impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage {
8272    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8273        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage))
8274            .finish_non_exhaustive()
8275    }
8276}
8277impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage {
8278    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8279    where
8280        S: serde::Serializer,
8281    {
8282        serializer.serialize_str(self.as_str())
8283    }
8284}
8285#[cfg(feature = "deserialize")]
8286impl<'de> serde::Deserialize<'de>
8287    for CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage
8288{
8289    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8290        use std::str::FromStr;
8291        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8292        Ok(Self::from_str(&s).expect("infallible"))
8293    }
8294}
8295/// contains details about the Kakao Pay payment method options.
8296#[derive(Clone, Eq, PartialEq)]
8297#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
8298#[derive(serde::Serialize)]
8299pub struct CreateCheckoutSessionPaymentMethodOptionsKakaoPay {
8300    /// Controls when the funds will be captured from the customer's account.
8301    #[serde(skip_serializing_if = "Option::is_none")]
8302    pub capture_method: Option<CreateCheckoutSessionPaymentMethodOptionsKakaoPayCaptureMethod>,
8303    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8304    ///
8305    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8306    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8307    ///
8308    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8309    ///
8310    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8311    #[serde(skip_serializing_if = "Option::is_none")]
8312    pub setup_future_usage:
8313        Option<CreateCheckoutSessionPaymentMethodOptionsKakaoPaySetupFutureUsage>,
8314}
8315#[cfg(feature = "redact-generated-debug")]
8316impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsKakaoPay {
8317    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8318        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsKakaoPay").finish_non_exhaustive()
8319    }
8320}
8321impl CreateCheckoutSessionPaymentMethodOptionsKakaoPay {
8322    pub fn new() -> Self {
8323        Self { capture_method: None, setup_future_usage: None }
8324    }
8325}
8326impl Default for CreateCheckoutSessionPaymentMethodOptionsKakaoPay {
8327    fn default() -> Self {
8328        Self::new()
8329    }
8330}
8331/// Controls when the funds will be captured from the customer's account.
8332#[derive(Clone, Eq, PartialEq)]
8333#[non_exhaustive]
8334pub enum CreateCheckoutSessionPaymentMethodOptionsKakaoPayCaptureMethod {
8335    Manual,
8336    /// An unrecognized value from Stripe. Should not be used as a request parameter.
8337    Unknown(String),
8338}
8339impl CreateCheckoutSessionPaymentMethodOptionsKakaoPayCaptureMethod {
8340    pub fn as_str(&self) -> &str {
8341        use CreateCheckoutSessionPaymentMethodOptionsKakaoPayCaptureMethod::*;
8342        match self {
8343            Manual => "manual",
8344            Unknown(v) => v,
8345        }
8346    }
8347}
8348
8349impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsKakaoPayCaptureMethod {
8350    type Err = std::convert::Infallible;
8351    fn from_str(s: &str) -> Result<Self, Self::Err> {
8352        use CreateCheckoutSessionPaymentMethodOptionsKakaoPayCaptureMethod::*;
8353        match s {
8354            "manual" => Ok(Manual),
8355            v => {
8356                tracing::warn!(
8357                    "Unknown value '{}' for enum '{}'",
8358                    v,
8359                    "CreateCheckoutSessionPaymentMethodOptionsKakaoPayCaptureMethod"
8360                );
8361                Ok(Unknown(v.to_owned()))
8362            }
8363        }
8364    }
8365}
8366impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsKakaoPayCaptureMethod {
8367    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8368        f.write_str(self.as_str())
8369    }
8370}
8371
8372#[cfg(not(feature = "redact-generated-debug"))]
8373impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsKakaoPayCaptureMethod {
8374    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8375        f.write_str(self.as_str())
8376    }
8377}
8378#[cfg(feature = "redact-generated-debug")]
8379impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsKakaoPayCaptureMethod {
8380    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8381        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsKakaoPayCaptureMethod))
8382            .finish_non_exhaustive()
8383    }
8384}
8385impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsKakaoPayCaptureMethod {
8386    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8387    where
8388        S: serde::Serializer,
8389    {
8390        serializer.serialize_str(self.as_str())
8391    }
8392}
8393#[cfg(feature = "deserialize")]
8394impl<'de> serde::Deserialize<'de>
8395    for CreateCheckoutSessionPaymentMethodOptionsKakaoPayCaptureMethod
8396{
8397    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8398        use std::str::FromStr;
8399        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8400        Ok(Self::from_str(&s).expect("infallible"))
8401    }
8402}
8403/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8404///
8405/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8406/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8407///
8408/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8409///
8410/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8411#[derive(Clone, Eq, PartialEq)]
8412#[non_exhaustive]
8413pub enum CreateCheckoutSessionPaymentMethodOptionsKakaoPaySetupFutureUsage {
8414    None,
8415    OffSession,
8416    /// An unrecognized value from Stripe. Should not be used as a request parameter.
8417    Unknown(String),
8418}
8419impl CreateCheckoutSessionPaymentMethodOptionsKakaoPaySetupFutureUsage {
8420    pub fn as_str(&self) -> &str {
8421        use CreateCheckoutSessionPaymentMethodOptionsKakaoPaySetupFutureUsage::*;
8422        match self {
8423            None => "none",
8424            OffSession => "off_session",
8425            Unknown(v) => v,
8426        }
8427    }
8428}
8429
8430impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsKakaoPaySetupFutureUsage {
8431    type Err = std::convert::Infallible;
8432    fn from_str(s: &str) -> Result<Self, Self::Err> {
8433        use CreateCheckoutSessionPaymentMethodOptionsKakaoPaySetupFutureUsage::*;
8434        match s {
8435            "none" => Ok(None),
8436            "off_session" => Ok(OffSession),
8437            v => {
8438                tracing::warn!(
8439                    "Unknown value '{}' for enum '{}'",
8440                    v,
8441                    "CreateCheckoutSessionPaymentMethodOptionsKakaoPaySetupFutureUsage"
8442                );
8443                Ok(Unknown(v.to_owned()))
8444            }
8445        }
8446    }
8447}
8448impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsKakaoPaySetupFutureUsage {
8449    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8450        f.write_str(self.as_str())
8451    }
8452}
8453
8454#[cfg(not(feature = "redact-generated-debug"))]
8455impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsKakaoPaySetupFutureUsage {
8456    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8457        f.write_str(self.as_str())
8458    }
8459}
8460#[cfg(feature = "redact-generated-debug")]
8461impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsKakaoPaySetupFutureUsage {
8462    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8463        f.debug_struct(stringify!(
8464            CreateCheckoutSessionPaymentMethodOptionsKakaoPaySetupFutureUsage
8465        ))
8466        .finish_non_exhaustive()
8467    }
8468}
8469impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsKakaoPaySetupFutureUsage {
8470    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8471    where
8472        S: serde::Serializer,
8473    {
8474        serializer.serialize_str(self.as_str())
8475    }
8476}
8477#[cfg(feature = "deserialize")]
8478impl<'de> serde::Deserialize<'de>
8479    for CreateCheckoutSessionPaymentMethodOptionsKakaoPaySetupFutureUsage
8480{
8481    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8482        use std::str::FromStr;
8483        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8484        Ok(Self::from_str(&s).expect("infallible"))
8485    }
8486}
8487/// contains details about the Klarna payment method options.
8488#[derive(Clone, Eq, PartialEq)]
8489#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
8490#[derive(serde::Serialize)]
8491pub struct CreateCheckoutSessionPaymentMethodOptionsKlarna {
8492    /// Controls when the funds will be captured from the customer's account.
8493    #[serde(skip_serializing_if = "Option::is_none")]
8494    pub capture_method: Option<CreateCheckoutSessionPaymentMethodOptionsKlarnaCaptureMethod>,
8495    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8496    ///
8497    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8498    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8499    ///
8500    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8501    ///
8502    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8503    #[serde(skip_serializing_if = "Option::is_none")]
8504    pub setup_future_usage: Option<CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage>,
8505    /// Subscription details if the Checkout Session sets up a future subscription.
8506    #[serde(skip_serializing_if = "Option::is_none")]
8507    pub subscriptions: Option<Vec<CreateCheckoutSessionPaymentMethodOptionsKlarnaSubscriptions>>,
8508}
8509#[cfg(feature = "redact-generated-debug")]
8510impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsKlarna {
8511    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8512        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsKlarna").finish_non_exhaustive()
8513    }
8514}
8515impl CreateCheckoutSessionPaymentMethodOptionsKlarna {
8516    pub fn new() -> Self {
8517        Self { capture_method: None, setup_future_usage: None, subscriptions: None }
8518    }
8519}
8520impl Default for CreateCheckoutSessionPaymentMethodOptionsKlarna {
8521    fn default() -> Self {
8522        Self::new()
8523    }
8524}
8525/// Controls when the funds will be captured from the customer's account.
8526#[derive(Clone, Eq, PartialEq)]
8527#[non_exhaustive]
8528pub enum CreateCheckoutSessionPaymentMethodOptionsKlarnaCaptureMethod {
8529    Manual,
8530    /// An unrecognized value from Stripe. Should not be used as a request parameter.
8531    Unknown(String),
8532}
8533impl CreateCheckoutSessionPaymentMethodOptionsKlarnaCaptureMethod {
8534    pub fn as_str(&self) -> &str {
8535        use CreateCheckoutSessionPaymentMethodOptionsKlarnaCaptureMethod::*;
8536        match self {
8537            Manual => "manual",
8538            Unknown(v) => v,
8539        }
8540    }
8541}
8542
8543impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsKlarnaCaptureMethod {
8544    type Err = std::convert::Infallible;
8545    fn from_str(s: &str) -> Result<Self, Self::Err> {
8546        use CreateCheckoutSessionPaymentMethodOptionsKlarnaCaptureMethod::*;
8547        match s {
8548            "manual" => Ok(Manual),
8549            v => {
8550                tracing::warn!(
8551                    "Unknown value '{}' for enum '{}'",
8552                    v,
8553                    "CreateCheckoutSessionPaymentMethodOptionsKlarnaCaptureMethod"
8554                );
8555                Ok(Unknown(v.to_owned()))
8556            }
8557        }
8558    }
8559}
8560impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsKlarnaCaptureMethod {
8561    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8562        f.write_str(self.as_str())
8563    }
8564}
8565
8566#[cfg(not(feature = "redact-generated-debug"))]
8567impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsKlarnaCaptureMethod {
8568    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8569        f.write_str(self.as_str())
8570    }
8571}
8572#[cfg(feature = "redact-generated-debug")]
8573impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsKlarnaCaptureMethod {
8574    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8575        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsKlarnaCaptureMethod))
8576            .finish_non_exhaustive()
8577    }
8578}
8579impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsKlarnaCaptureMethod {
8580    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8581    where
8582        S: serde::Serializer,
8583    {
8584        serializer.serialize_str(self.as_str())
8585    }
8586}
8587#[cfg(feature = "deserialize")]
8588impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionPaymentMethodOptionsKlarnaCaptureMethod {
8589    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8590        use std::str::FromStr;
8591        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8592        Ok(Self::from_str(&s).expect("infallible"))
8593    }
8594}
8595/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8596///
8597/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8598/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8599///
8600/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8601///
8602/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8603#[derive(Clone, Eq, PartialEq)]
8604#[non_exhaustive]
8605pub enum CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage {
8606    None,
8607    /// An unrecognized value from Stripe. Should not be used as a request parameter.
8608    Unknown(String),
8609}
8610impl CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage {
8611    pub fn as_str(&self) -> &str {
8612        use CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage::*;
8613        match self {
8614            None => "none",
8615            Unknown(v) => v,
8616        }
8617    }
8618}
8619
8620impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage {
8621    type Err = std::convert::Infallible;
8622    fn from_str(s: &str) -> Result<Self, Self::Err> {
8623        use CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage::*;
8624        match s {
8625            "none" => Ok(None),
8626            v => {
8627                tracing::warn!(
8628                    "Unknown value '{}' for enum '{}'",
8629                    v,
8630                    "CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage"
8631                );
8632                Ok(Unknown(v.to_owned()))
8633            }
8634        }
8635    }
8636}
8637impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage {
8638    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8639        f.write_str(self.as_str())
8640    }
8641}
8642
8643#[cfg(not(feature = "redact-generated-debug"))]
8644impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage {
8645    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8646        f.write_str(self.as_str())
8647    }
8648}
8649#[cfg(feature = "redact-generated-debug")]
8650impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage {
8651    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8652        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage))
8653            .finish_non_exhaustive()
8654    }
8655}
8656impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage {
8657    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8658    where
8659        S: serde::Serializer,
8660    {
8661        serializer.serialize_str(self.as_str())
8662    }
8663}
8664#[cfg(feature = "deserialize")]
8665impl<'de> serde::Deserialize<'de>
8666    for CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage
8667{
8668    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8669        use std::str::FromStr;
8670        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8671        Ok(Self::from_str(&s).expect("infallible"))
8672    }
8673}
8674/// Subscription details if the Checkout Session sets up a future subscription.
8675#[derive(Clone, Eq, PartialEq)]
8676#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
8677#[derive(serde::Serialize)]
8678pub struct CreateCheckoutSessionPaymentMethodOptionsKlarnaSubscriptions {
8679    /// Unit of time between subscription charges.
8680    pub interval: CreateCheckoutSessionPaymentMethodOptionsKlarnaSubscriptionsInterval,
8681    /// The number of intervals (specified in the `interval` attribute) between subscription charges.
8682    /// For example, `interval=month` and `interval_count=3` charges every 3 months.
8683    #[serde(skip_serializing_if = "Option::is_none")]
8684    pub interval_count: Option<u64>,
8685    /// Name for subscription.
8686    #[serde(skip_serializing_if = "Option::is_none")]
8687    pub name: Option<String>,
8688    /// Describes the upcoming charge for this subscription.
8689    pub next_billing: CreateCheckoutSessionPaymentMethodOptionsKlarnaSubscriptionsNextBilling,
8690    /// A non-customer-facing reference to correlate subscription charges in the Klarna app.
8691    /// Use a value that persists across subscription charges.
8692    pub reference: String,
8693}
8694#[cfg(feature = "redact-generated-debug")]
8695impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsKlarnaSubscriptions {
8696    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8697        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsKlarnaSubscriptions")
8698            .finish_non_exhaustive()
8699    }
8700}
8701impl CreateCheckoutSessionPaymentMethodOptionsKlarnaSubscriptions {
8702    pub fn new(
8703        interval: impl Into<CreateCheckoutSessionPaymentMethodOptionsKlarnaSubscriptionsInterval>,
8704        next_billing: impl Into<CreateCheckoutSessionPaymentMethodOptionsKlarnaSubscriptionsNextBilling>,
8705        reference: impl Into<String>,
8706    ) -> Self {
8707        Self {
8708            interval: interval.into(),
8709            interval_count: None,
8710            name: None,
8711            next_billing: next_billing.into(),
8712            reference: reference.into(),
8713        }
8714    }
8715}
8716/// Unit of time between subscription charges.
8717#[derive(Clone, Eq, PartialEq)]
8718#[non_exhaustive]
8719pub enum CreateCheckoutSessionPaymentMethodOptionsKlarnaSubscriptionsInterval {
8720    Day,
8721    Month,
8722    Week,
8723    Year,
8724    /// An unrecognized value from Stripe. Should not be used as a request parameter.
8725    Unknown(String),
8726}
8727impl CreateCheckoutSessionPaymentMethodOptionsKlarnaSubscriptionsInterval {
8728    pub fn as_str(&self) -> &str {
8729        use CreateCheckoutSessionPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
8730        match self {
8731            Day => "day",
8732            Month => "month",
8733            Week => "week",
8734            Year => "year",
8735            Unknown(v) => v,
8736        }
8737    }
8738}
8739
8740impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsKlarnaSubscriptionsInterval {
8741    type Err = std::convert::Infallible;
8742    fn from_str(s: &str) -> Result<Self, Self::Err> {
8743        use CreateCheckoutSessionPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
8744        match s {
8745            "day" => Ok(Day),
8746            "month" => Ok(Month),
8747            "week" => Ok(Week),
8748            "year" => Ok(Year),
8749            v => {
8750                tracing::warn!(
8751                    "Unknown value '{}' for enum '{}'",
8752                    v,
8753                    "CreateCheckoutSessionPaymentMethodOptionsKlarnaSubscriptionsInterval"
8754                );
8755                Ok(Unknown(v.to_owned()))
8756            }
8757        }
8758    }
8759}
8760impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsKlarnaSubscriptionsInterval {
8761    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8762        f.write_str(self.as_str())
8763    }
8764}
8765
8766#[cfg(not(feature = "redact-generated-debug"))]
8767impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsKlarnaSubscriptionsInterval {
8768    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8769        f.write_str(self.as_str())
8770    }
8771}
8772#[cfg(feature = "redact-generated-debug")]
8773impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsKlarnaSubscriptionsInterval {
8774    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8775        f.debug_struct(stringify!(
8776            CreateCheckoutSessionPaymentMethodOptionsKlarnaSubscriptionsInterval
8777        ))
8778        .finish_non_exhaustive()
8779    }
8780}
8781impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsKlarnaSubscriptionsInterval {
8782    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8783    where
8784        S: serde::Serializer,
8785    {
8786        serializer.serialize_str(self.as_str())
8787    }
8788}
8789#[cfg(feature = "deserialize")]
8790impl<'de> serde::Deserialize<'de>
8791    for CreateCheckoutSessionPaymentMethodOptionsKlarnaSubscriptionsInterval
8792{
8793    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8794        use std::str::FromStr;
8795        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8796        Ok(Self::from_str(&s).expect("infallible"))
8797    }
8798}
8799/// Describes the upcoming charge for this subscription.
8800#[derive(Clone, Eq, PartialEq)]
8801#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
8802#[derive(serde::Serialize)]
8803pub struct CreateCheckoutSessionPaymentMethodOptionsKlarnaSubscriptionsNextBilling {
8804    /// The amount of the next charge for the subscription.
8805    pub amount: i64,
8806    /// The date of the next charge for the subscription in YYYY-MM-DD format.
8807    pub date: String,
8808}
8809#[cfg(feature = "redact-generated-debug")]
8810impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsKlarnaSubscriptionsNextBilling {
8811    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8812        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsKlarnaSubscriptionsNextBilling")
8813            .finish_non_exhaustive()
8814    }
8815}
8816impl CreateCheckoutSessionPaymentMethodOptionsKlarnaSubscriptionsNextBilling {
8817    pub fn new(amount: impl Into<i64>, date: impl Into<String>) -> Self {
8818        Self { amount: amount.into(), date: date.into() }
8819    }
8820}
8821/// contains details about the Konbini payment method options.
8822#[derive(Clone, Eq, PartialEq)]
8823#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
8824#[derive(serde::Serialize)]
8825pub struct CreateCheckoutSessionPaymentMethodOptionsKonbini {
8826    /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire.
8827    /// For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST.
8828    /// Defaults to 3 days.
8829    #[serde(skip_serializing_if = "Option::is_none")]
8830    pub expires_after_days: Option<u32>,
8831    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8832    ///
8833    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8834    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8835    ///
8836    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8837    ///
8838    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8839    #[serde(skip_serializing_if = "Option::is_none")]
8840    pub setup_future_usage:
8841        Option<CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage>,
8842}
8843#[cfg(feature = "redact-generated-debug")]
8844impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsKonbini {
8845    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8846        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsKonbini").finish_non_exhaustive()
8847    }
8848}
8849impl CreateCheckoutSessionPaymentMethodOptionsKonbini {
8850    pub fn new() -> Self {
8851        Self { expires_after_days: None, setup_future_usage: None }
8852    }
8853}
8854impl Default for CreateCheckoutSessionPaymentMethodOptionsKonbini {
8855    fn default() -> Self {
8856        Self::new()
8857    }
8858}
8859/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8860///
8861/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8862/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8863///
8864/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8865///
8866/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8867#[derive(Clone, Eq, PartialEq)]
8868#[non_exhaustive]
8869pub enum CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage {
8870    None,
8871    /// An unrecognized value from Stripe. Should not be used as a request parameter.
8872    Unknown(String),
8873}
8874impl CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage {
8875    pub fn as_str(&self) -> &str {
8876        use CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage::*;
8877        match self {
8878            None => "none",
8879            Unknown(v) => v,
8880        }
8881    }
8882}
8883
8884impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage {
8885    type Err = std::convert::Infallible;
8886    fn from_str(s: &str) -> Result<Self, Self::Err> {
8887        use CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage::*;
8888        match s {
8889            "none" => Ok(None),
8890            v => {
8891                tracing::warn!(
8892                    "Unknown value '{}' for enum '{}'",
8893                    v,
8894                    "CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage"
8895                );
8896                Ok(Unknown(v.to_owned()))
8897            }
8898        }
8899    }
8900}
8901impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage {
8902    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8903        f.write_str(self.as_str())
8904    }
8905}
8906
8907#[cfg(not(feature = "redact-generated-debug"))]
8908impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage {
8909    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8910        f.write_str(self.as_str())
8911    }
8912}
8913#[cfg(feature = "redact-generated-debug")]
8914impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage {
8915    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8916        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage))
8917            .finish_non_exhaustive()
8918    }
8919}
8920impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage {
8921    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8922    where
8923        S: serde::Serializer,
8924    {
8925        serializer.serialize_str(self.as_str())
8926    }
8927}
8928#[cfg(feature = "deserialize")]
8929impl<'de> serde::Deserialize<'de>
8930    for CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage
8931{
8932    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8933        use std::str::FromStr;
8934        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8935        Ok(Self::from_str(&s).expect("infallible"))
8936    }
8937}
8938/// contains details about the Korean card payment method options.
8939#[derive(Clone, Eq, PartialEq)]
8940#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
8941#[derive(serde::Serialize)]
8942pub struct CreateCheckoutSessionPaymentMethodOptionsKrCard {
8943    /// Controls when the funds will be captured from the customer's account.
8944    #[serde(skip_serializing_if = "Option::is_none")]
8945    pub capture_method: Option<CreateCheckoutSessionPaymentMethodOptionsKrCardCaptureMethod>,
8946    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8947    ///
8948    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8949    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8950    ///
8951    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8952    ///
8953    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8954    #[serde(skip_serializing_if = "Option::is_none")]
8955    pub setup_future_usage: Option<CreateCheckoutSessionPaymentMethodOptionsKrCardSetupFutureUsage>,
8956}
8957#[cfg(feature = "redact-generated-debug")]
8958impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsKrCard {
8959    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8960        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsKrCard").finish_non_exhaustive()
8961    }
8962}
8963impl CreateCheckoutSessionPaymentMethodOptionsKrCard {
8964    pub fn new() -> Self {
8965        Self { capture_method: None, setup_future_usage: None }
8966    }
8967}
8968impl Default for CreateCheckoutSessionPaymentMethodOptionsKrCard {
8969    fn default() -> Self {
8970        Self::new()
8971    }
8972}
8973/// Controls when the funds will be captured from the customer's account.
8974#[derive(Clone, Eq, PartialEq)]
8975#[non_exhaustive]
8976pub enum CreateCheckoutSessionPaymentMethodOptionsKrCardCaptureMethod {
8977    Manual,
8978    /// An unrecognized value from Stripe. Should not be used as a request parameter.
8979    Unknown(String),
8980}
8981impl CreateCheckoutSessionPaymentMethodOptionsKrCardCaptureMethod {
8982    pub fn as_str(&self) -> &str {
8983        use CreateCheckoutSessionPaymentMethodOptionsKrCardCaptureMethod::*;
8984        match self {
8985            Manual => "manual",
8986            Unknown(v) => v,
8987        }
8988    }
8989}
8990
8991impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsKrCardCaptureMethod {
8992    type Err = std::convert::Infallible;
8993    fn from_str(s: &str) -> Result<Self, Self::Err> {
8994        use CreateCheckoutSessionPaymentMethodOptionsKrCardCaptureMethod::*;
8995        match s {
8996            "manual" => Ok(Manual),
8997            v => {
8998                tracing::warn!(
8999                    "Unknown value '{}' for enum '{}'",
9000                    v,
9001                    "CreateCheckoutSessionPaymentMethodOptionsKrCardCaptureMethod"
9002                );
9003                Ok(Unknown(v.to_owned()))
9004            }
9005        }
9006    }
9007}
9008impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsKrCardCaptureMethod {
9009    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9010        f.write_str(self.as_str())
9011    }
9012}
9013
9014#[cfg(not(feature = "redact-generated-debug"))]
9015impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsKrCardCaptureMethod {
9016    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9017        f.write_str(self.as_str())
9018    }
9019}
9020#[cfg(feature = "redact-generated-debug")]
9021impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsKrCardCaptureMethod {
9022    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9023        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsKrCardCaptureMethod))
9024            .finish_non_exhaustive()
9025    }
9026}
9027impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsKrCardCaptureMethod {
9028    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9029    where
9030        S: serde::Serializer,
9031    {
9032        serializer.serialize_str(self.as_str())
9033    }
9034}
9035#[cfg(feature = "deserialize")]
9036impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionPaymentMethodOptionsKrCardCaptureMethod {
9037    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9038        use std::str::FromStr;
9039        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9040        Ok(Self::from_str(&s).expect("infallible"))
9041    }
9042}
9043/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9044///
9045/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9046/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9047///
9048/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9049///
9050/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9051#[derive(Clone, Eq, PartialEq)]
9052#[non_exhaustive]
9053pub enum CreateCheckoutSessionPaymentMethodOptionsKrCardSetupFutureUsage {
9054    None,
9055    OffSession,
9056    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9057    Unknown(String),
9058}
9059impl CreateCheckoutSessionPaymentMethodOptionsKrCardSetupFutureUsage {
9060    pub fn as_str(&self) -> &str {
9061        use CreateCheckoutSessionPaymentMethodOptionsKrCardSetupFutureUsage::*;
9062        match self {
9063            None => "none",
9064            OffSession => "off_session",
9065            Unknown(v) => v,
9066        }
9067    }
9068}
9069
9070impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsKrCardSetupFutureUsage {
9071    type Err = std::convert::Infallible;
9072    fn from_str(s: &str) -> Result<Self, Self::Err> {
9073        use CreateCheckoutSessionPaymentMethodOptionsKrCardSetupFutureUsage::*;
9074        match s {
9075            "none" => Ok(None),
9076            "off_session" => Ok(OffSession),
9077            v => {
9078                tracing::warn!(
9079                    "Unknown value '{}' for enum '{}'",
9080                    v,
9081                    "CreateCheckoutSessionPaymentMethodOptionsKrCardSetupFutureUsage"
9082                );
9083                Ok(Unknown(v.to_owned()))
9084            }
9085        }
9086    }
9087}
9088impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsKrCardSetupFutureUsage {
9089    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9090        f.write_str(self.as_str())
9091    }
9092}
9093
9094#[cfg(not(feature = "redact-generated-debug"))]
9095impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsKrCardSetupFutureUsage {
9096    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9097        f.write_str(self.as_str())
9098    }
9099}
9100#[cfg(feature = "redact-generated-debug")]
9101impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsKrCardSetupFutureUsage {
9102    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9103        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsKrCardSetupFutureUsage))
9104            .finish_non_exhaustive()
9105    }
9106}
9107impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsKrCardSetupFutureUsage {
9108    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9109    where
9110        S: serde::Serializer,
9111    {
9112        serializer.serialize_str(self.as_str())
9113    }
9114}
9115#[cfg(feature = "deserialize")]
9116impl<'de> serde::Deserialize<'de>
9117    for CreateCheckoutSessionPaymentMethodOptionsKrCardSetupFutureUsage
9118{
9119    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9120        use std::str::FromStr;
9121        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9122        Ok(Self::from_str(&s).expect("infallible"))
9123    }
9124}
9125/// contains details about the Link payment method options (Link is also known as Onelink in the UK).
9126#[derive(Clone, Eq, PartialEq)]
9127#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
9128#[derive(serde::Serialize)]
9129pub struct CreateCheckoutSessionPaymentMethodOptionsLink {
9130    /// Controls when the funds will be captured from the customer's account.
9131    #[serde(skip_serializing_if = "Option::is_none")]
9132    pub capture_method: Option<CreateCheckoutSessionPaymentMethodOptionsLinkCaptureMethod>,
9133    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9134    ///
9135    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9136    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9137    ///
9138    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9139    ///
9140    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9141    #[serde(skip_serializing_if = "Option::is_none")]
9142    pub setup_future_usage: Option<CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage>,
9143}
9144#[cfg(feature = "redact-generated-debug")]
9145impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsLink {
9146    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9147        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsLink").finish_non_exhaustive()
9148    }
9149}
9150impl CreateCheckoutSessionPaymentMethodOptionsLink {
9151    pub fn new() -> Self {
9152        Self { capture_method: None, setup_future_usage: None }
9153    }
9154}
9155impl Default for CreateCheckoutSessionPaymentMethodOptionsLink {
9156    fn default() -> Self {
9157        Self::new()
9158    }
9159}
9160/// Controls when the funds will be captured from the customer's account.
9161#[derive(Clone, Eq, PartialEq)]
9162#[non_exhaustive]
9163pub enum CreateCheckoutSessionPaymentMethodOptionsLinkCaptureMethod {
9164    Manual,
9165    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9166    Unknown(String),
9167}
9168impl CreateCheckoutSessionPaymentMethodOptionsLinkCaptureMethod {
9169    pub fn as_str(&self) -> &str {
9170        use CreateCheckoutSessionPaymentMethodOptionsLinkCaptureMethod::*;
9171        match self {
9172            Manual => "manual",
9173            Unknown(v) => v,
9174        }
9175    }
9176}
9177
9178impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsLinkCaptureMethod {
9179    type Err = std::convert::Infallible;
9180    fn from_str(s: &str) -> Result<Self, Self::Err> {
9181        use CreateCheckoutSessionPaymentMethodOptionsLinkCaptureMethod::*;
9182        match s {
9183            "manual" => Ok(Manual),
9184            v => {
9185                tracing::warn!(
9186                    "Unknown value '{}' for enum '{}'",
9187                    v,
9188                    "CreateCheckoutSessionPaymentMethodOptionsLinkCaptureMethod"
9189                );
9190                Ok(Unknown(v.to_owned()))
9191            }
9192        }
9193    }
9194}
9195impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsLinkCaptureMethod {
9196    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9197        f.write_str(self.as_str())
9198    }
9199}
9200
9201#[cfg(not(feature = "redact-generated-debug"))]
9202impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsLinkCaptureMethod {
9203    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9204        f.write_str(self.as_str())
9205    }
9206}
9207#[cfg(feature = "redact-generated-debug")]
9208impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsLinkCaptureMethod {
9209    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9210        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsLinkCaptureMethod))
9211            .finish_non_exhaustive()
9212    }
9213}
9214impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsLinkCaptureMethod {
9215    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9216    where
9217        S: serde::Serializer,
9218    {
9219        serializer.serialize_str(self.as_str())
9220    }
9221}
9222#[cfg(feature = "deserialize")]
9223impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionPaymentMethodOptionsLinkCaptureMethod {
9224    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9225        use std::str::FromStr;
9226        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9227        Ok(Self::from_str(&s).expect("infallible"))
9228    }
9229}
9230/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9231///
9232/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9233/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9234///
9235/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9236///
9237/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9238#[derive(Clone, Eq, PartialEq)]
9239#[non_exhaustive]
9240pub enum CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage {
9241    None,
9242    OffSession,
9243    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9244    Unknown(String),
9245}
9246impl CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage {
9247    pub fn as_str(&self) -> &str {
9248        use CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage::*;
9249        match self {
9250            None => "none",
9251            OffSession => "off_session",
9252            Unknown(v) => v,
9253        }
9254    }
9255}
9256
9257impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage {
9258    type Err = std::convert::Infallible;
9259    fn from_str(s: &str) -> Result<Self, Self::Err> {
9260        use CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage::*;
9261        match s {
9262            "none" => Ok(None),
9263            "off_session" => Ok(OffSession),
9264            v => {
9265                tracing::warn!(
9266                    "Unknown value '{}' for enum '{}'",
9267                    v,
9268                    "CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage"
9269                );
9270                Ok(Unknown(v.to_owned()))
9271            }
9272        }
9273    }
9274}
9275impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage {
9276    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9277        f.write_str(self.as_str())
9278    }
9279}
9280
9281#[cfg(not(feature = "redact-generated-debug"))]
9282impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage {
9283    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9284        f.write_str(self.as_str())
9285    }
9286}
9287#[cfg(feature = "redact-generated-debug")]
9288impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage {
9289    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9290        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage))
9291            .finish_non_exhaustive()
9292    }
9293}
9294impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage {
9295    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9296    where
9297        S: serde::Serializer,
9298    {
9299        serializer.serialize_str(self.as_str())
9300    }
9301}
9302#[cfg(feature = "deserialize")]
9303impl<'de> serde::Deserialize<'de>
9304    for CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage
9305{
9306    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9307        use std::str::FromStr;
9308        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9309        Ok(Self::from_str(&s).expect("infallible"))
9310    }
9311}
9312/// contains details about the Mobilepay payment method options.
9313#[derive(Clone, Eq, PartialEq)]
9314#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
9315#[derive(serde::Serialize)]
9316pub struct CreateCheckoutSessionPaymentMethodOptionsMobilepay {
9317    /// Controls when the funds will be captured from the customer's account.
9318    #[serde(skip_serializing_if = "Option::is_none")]
9319    pub capture_method: Option<CreateCheckoutSessionPaymentMethodOptionsMobilepayCaptureMethod>,
9320    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9321    ///
9322    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9323    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9324    ///
9325    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9326    ///
9327    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9328    #[serde(skip_serializing_if = "Option::is_none")]
9329    pub setup_future_usage:
9330        Option<CreateCheckoutSessionPaymentMethodOptionsMobilepaySetupFutureUsage>,
9331}
9332#[cfg(feature = "redact-generated-debug")]
9333impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsMobilepay {
9334    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9335        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsMobilepay").finish_non_exhaustive()
9336    }
9337}
9338impl CreateCheckoutSessionPaymentMethodOptionsMobilepay {
9339    pub fn new() -> Self {
9340        Self { capture_method: None, setup_future_usage: None }
9341    }
9342}
9343impl Default for CreateCheckoutSessionPaymentMethodOptionsMobilepay {
9344    fn default() -> Self {
9345        Self::new()
9346    }
9347}
9348/// Controls when the funds will be captured from the customer's account.
9349#[derive(Clone, Eq, PartialEq)]
9350#[non_exhaustive]
9351pub enum CreateCheckoutSessionPaymentMethodOptionsMobilepayCaptureMethod {
9352    Manual,
9353    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9354    Unknown(String),
9355}
9356impl CreateCheckoutSessionPaymentMethodOptionsMobilepayCaptureMethod {
9357    pub fn as_str(&self) -> &str {
9358        use CreateCheckoutSessionPaymentMethodOptionsMobilepayCaptureMethod::*;
9359        match self {
9360            Manual => "manual",
9361            Unknown(v) => v,
9362        }
9363    }
9364}
9365
9366impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsMobilepayCaptureMethod {
9367    type Err = std::convert::Infallible;
9368    fn from_str(s: &str) -> Result<Self, Self::Err> {
9369        use CreateCheckoutSessionPaymentMethodOptionsMobilepayCaptureMethod::*;
9370        match s {
9371            "manual" => Ok(Manual),
9372            v => {
9373                tracing::warn!(
9374                    "Unknown value '{}' for enum '{}'",
9375                    v,
9376                    "CreateCheckoutSessionPaymentMethodOptionsMobilepayCaptureMethod"
9377                );
9378                Ok(Unknown(v.to_owned()))
9379            }
9380        }
9381    }
9382}
9383impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsMobilepayCaptureMethod {
9384    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9385        f.write_str(self.as_str())
9386    }
9387}
9388
9389#[cfg(not(feature = "redact-generated-debug"))]
9390impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsMobilepayCaptureMethod {
9391    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9392        f.write_str(self.as_str())
9393    }
9394}
9395#[cfg(feature = "redact-generated-debug")]
9396impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsMobilepayCaptureMethod {
9397    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9398        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsMobilepayCaptureMethod))
9399            .finish_non_exhaustive()
9400    }
9401}
9402impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsMobilepayCaptureMethod {
9403    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9404    where
9405        S: serde::Serializer,
9406    {
9407        serializer.serialize_str(self.as_str())
9408    }
9409}
9410#[cfg(feature = "deserialize")]
9411impl<'de> serde::Deserialize<'de>
9412    for CreateCheckoutSessionPaymentMethodOptionsMobilepayCaptureMethod
9413{
9414    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9415        use std::str::FromStr;
9416        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9417        Ok(Self::from_str(&s).expect("infallible"))
9418    }
9419}
9420/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9421///
9422/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9423/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9424///
9425/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9426///
9427/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9428#[derive(Clone, Eq, PartialEq)]
9429#[non_exhaustive]
9430pub enum CreateCheckoutSessionPaymentMethodOptionsMobilepaySetupFutureUsage {
9431    None,
9432    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9433    Unknown(String),
9434}
9435impl CreateCheckoutSessionPaymentMethodOptionsMobilepaySetupFutureUsage {
9436    pub fn as_str(&self) -> &str {
9437        use CreateCheckoutSessionPaymentMethodOptionsMobilepaySetupFutureUsage::*;
9438        match self {
9439            None => "none",
9440            Unknown(v) => v,
9441        }
9442    }
9443}
9444
9445impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsMobilepaySetupFutureUsage {
9446    type Err = std::convert::Infallible;
9447    fn from_str(s: &str) -> Result<Self, Self::Err> {
9448        use CreateCheckoutSessionPaymentMethodOptionsMobilepaySetupFutureUsage::*;
9449        match s {
9450            "none" => Ok(None),
9451            v => {
9452                tracing::warn!(
9453                    "Unknown value '{}' for enum '{}'",
9454                    v,
9455                    "CreateCheckoutSessionPaymentMethodOptionsMobilepaySetupFutureUsage"
9456                );
9457                Ok(Unknown(v.to_owned()))
9458            }
9459        }
9460    }
9461}
9462impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsMobilepaySetupFutureUsage {
9463    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9464        f.write_str(self.as_str())
9465    }
9466}
9467
9468#[cfg(not(feature = "redact-generated-debug"))]
9469impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsMobilepaySetupFutureUsage {
9470    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9471        f.write_str(self.as_str())
9472    }
9473}
9474#[cfg(feature = "redact-generated-debug")]
9475impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsMobilepaySetupFutureUsage {
9476    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9477        f.debug_struct(stringify!(
9478            CreateCheckoutSessionPaymentMethodOptionsMobilepaySetupFutureUsage
9479        ))
9480        .finish_non_exhaustive()
9481    }
9482}
9483impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsMobilepaySetupFutureUsage {
9484    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9485    where
9486        S: serde::Serializer,
9487    {
9488        serializer.serialize_str(self.as_str())
9489    }
9490}
9491#[cfg(feature = "deserialize")]
9492impl<'de> serde::Deserialize<'de>
9493    for CreateCheckoutSessionPaymentMethodOptionsMobilepaySetupFutureUsage
9494{
9495    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9496        use std::str::FromStr;
9497        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9498        Ok(Self::from_str(&s).expect("infallible"))
9499    }
9500}
9501/// contains details about the Multibanco payment method options.
9502#[derive(Clone, Eq, PartialEq)]
9503#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
9504#[derive(serde::Serialize)]
9505pub struct CreateCheckoutSessionPaymentMethodOptionsMultibanco {
9506    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9507    ///
9508    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9509    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9510    ///
9511    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9512    ///
9513    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9514    #[serde(skip_serializing_if = "Option::is_none")]
9515    pub setup_future_usage:
9516        Option<CreateCheckoutSessionPaymentMethodOptionsMultibancoSetupFutureUsage>,
9517}
9518#[cfg(feature = "redact-generated-debug")]
9519impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsMultibanco {
9520    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9521        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsMultibanco")
9522            .finish_non_exhaustive()
9523    }
9524}
9525impl CreateCheckoutSessionPaymentMethodOptionsMultibanco {
9526    pub fn new() -> Self {
9527        Self { setup_future_usage: None }
9528    }
9529}
9530impl Default for CreateCheckoutSessionPaymentMethodOptionsMultibanco {
9531    fn default() -> Self {
9532        Self::new()
9533    }
9534}
9535/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9536///
9537/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9538/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9539///
9540/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9541///
9542/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9543#[derive(Clone, Eq, PartialEq)]
9544#[non_exhaustive]
9545pub enum CreateCheckoutSessionPaymentMethodOptionsMultibancoSetupFutureUsage {
9546    None,
9547    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9548    Unknown(String),
9549}
9550impl CreateCheckoutSessionPaymentMethodOptionsMultibancoSetupFutureUsage {
9551    pub fn as_str(&self) -> &str {
9552        use CreateCheckoutSessionPaymentMethodOptionsMultibancoSetupFutureUsage::*;
9553        match self {
9554            None => "none",
9555            Unknown(v) => v,
9556        }
9557    }
9558}
9559
9560impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsMultibancoSetupFutureUsage {
9561    type Err = std::convert::Infallible;
9562    fn from_str(s: &str) -> Result<Self, Self::Err> {
9563        use CreateCheckoutSessionPaymentMethodOptionsMultibancoSetupFutureUsage::*;
9564        match s {
9565            "none" => Ok(None),
9566            v => {
9567                tracing::warn!(
9568                    "Unknown value '{}' for enum '{}'",
9569                    v,
9570                    "CreateCheckoutSessionPaymentMethodOptionsMultibancoSetupFutureUsage"
9571                );
9572                Ok(Unknown(v.to_owned()))
9573            }
9574        }
9575    }
9576}
9577impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsMultibancoSetupFutureUsage {
9578    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9579        f.write_str(self.as_str())
9580    }
9581}
9582
9583#[cfg(not(feature = "redact-generated-debug"))]
9584impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsMultibancoSetupFutureUsage {
9585    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9586        f.write_str(self.as_str())
9587    }
9588}
9589#[cfg(feature = "redact-generated-debug")]
9590impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsMultibancoSetupFutureUsage {
9591    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9592        f.debug_struct(stringify!(
9593            CreateCheckoutSessionPaymentMethodOptionsMultibancoSetupFutureUsage
9594        ))
9595        .finish_non_exhaustive()
9596    }
9597}
9598impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsMultibancoSetupFutureUsage {
9599    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9600    where
9601        S: serde::Serializer,
9602    {
9603        serializer.serialize_str(self.as_str())
9604    }
9605}
9606#[cfg(feature = "deserialize")]
9607impl<'de> serde::Deserialize<'de>
9608    for CreateCheckoutSessionPaymentMethodOptionsMultibancoSetupFutureUsage
9609{
9610    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9611        use std::str::FromStr;
9612        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9613        Ok(Self::from_str(&s).expect("infallible"))
9614    }
9615}
9616/// contains details about the Naver Pay payment method options.
9617#[derive(Clone, Eq, PartialEq)]
9618#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
9619#[derive(serde::Serialize)]
9620pub struct CreateCheckoutSessionPaymentMethodOptionsNaverPay {
9621    /// Controls when the funds will be captured from the customer's account.
9622    #[serde(skip_serializing_if = "Option::is_none")]
9623    pub capture_method: Option<CreateCheckoutSessionPaymentMethodOptionsNaverPayCaptureMethod>,
9624    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9625    ///
9626    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9627    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9628    ///
9629    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9630    ///
9631    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9632    #[serde(skip_serializing_if = "Option::is_none")]
9633    pub setup_future_usage:
9634        Option<CreateCheckoutSessionPaymentMethodOptionsNaverPaySetupFutureUsage>,
9635}
9636#[cfg(feature = "redact-generated-debug")]
9637impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsNaverPay {
9638    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9639        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsNaverPay").finish_non_exhaustive()
9640    }
9641}
9642impl CreateCheckoutSessionPaymentMethodOptionsNaverPay {
9643    pub fn new() -> Self {
9644        Self { capture_method: None, setup_future_usage: None }
9645    }
9646}
9647impl Default for CreateCheckoutSessionPaymentMethodOptionsNaverPay {
9648    fn default() -> Self {
9649        Self::new()
9650    }
9651}
9652/// Controls when the funds will be captured from the customer's account.
9653#[derive(Clone, Eq, PartialEq)]
9654#[non_exhaustive]
9655pub enum CreateCheckoutSessionPaymentMethodOptionsNaverPayCaptureMethod {
9656    Manual,
9657    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9658    Unknown(String),
9659}
9660impl CreateCheckoutSessionPaymentMethodOptionsNaverPayCaptureMethod {
9661    pub fn as_str(&self) -> &str {
9662        use CreateCheckoutSessionPaymentMethodOptionsNaverPayCaptureMethod::*;
9663        match self {
9664            Manual => "manual",
9665            Unknown(v) => v,
9666        }
9667    }
9668}
9669
9670impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsNaverPayCaptureMethod {
9671    type Err = std::convert::Infallible;
9672    fn from_str(s: &str) -> Result<Self, Self::Err> {
9673        use CreateCheckoutSessionPaymentMethodOptionsNaverPayCaptureMethod::*;
9674        match s {
9675            "manual" => Ok(Manual),
9676            v => {
9677                tracing::warn!(
9678                    "Unknown value '{}' for enum '{}'",
9679                    v,
9680                    "CreateCheckoutSessionPaymentMethodOptionsNaverPayCaptureMethod"
9681                );
9682                Ok(Unknown(v.to_owned()))
9683            }
9684        }
9685    }
9686}
9687impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsNaverPayCaptureMethod {
9688    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9689        f.write_str(self.as_str())
9690    }
9691}
9692
9693#[cfg(not(feature = "redact-generated-debug"))]
9694impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsNaverPayCaptureMethod {
9695    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9696        f.write_str(self.as_str())
9697    }
9698}
9699#[cfg(feature = "redact-generated-debug")]
9700impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsNaverPayCaptureMethod {
9701    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9702        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsNaverPayCaptureMethod))
9703            .finish_non_exhaustive()
9704    }
9705}
9706impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsNaverPayCaptureMethod {
9707    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9708    where
9709        S: serde::Serializer,
9710    {
9711        serializer.serialize_str(self.as_str())
9712    }
9713}
9714#[cfg(feature = "deserialize")]
9715impl<'de> serde::Deserialize<'de>
9716    for CreateCheckoutSessionPaymentMethodOptionsNaverPayCaptureMethod
9717{
9718    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9719        use std::str::FromStr;
9720        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9721        Ok(Self::from_str(&s).expect("infallible"))
9722    }
9723}
9724/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9725///
9726/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9727/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9728///
9729/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9730///
9731/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9732#[derive(Clone, Eq, PartialEq)]
9733#[non_exhaustive]
9734pub enum CreateCheckoutSessionPaymentMethodOptionsNaverPaySetupFutureUsage {
9735    None,
9736    OffSession,
9737    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9738    Unknown(String),
9739}
9740impl CreateCheckoutSessionPaymentMethodOptionsNaverPaySetupFutureUsage {
9741    pub fn as_str(&self) -> &str {
9742        use CreateCheckoutSessionPaymentMethodOptionsNaverPaySetupFutureUsage::*;
9743        match self {
9744            None => "none",
9745            OffSession => "off_session",
9746            Unknown(v) => v,
9747        }
9748    }
9749}
9750
9751impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsNaverPaySetupFutureUsage {
9752    type Err = std::convert::Infallible;
9753    fn from_str(s: &str) -> Result<Self, Self::Err> {
9754        use CreateCheckoutSessionPaymentMethodOptionsNaverPaySetupFutureUsage::*;
9755        match s {
9756            "none" => Ok(None),
9757            "off_session" => Ok(OffSession),
9758            v => {
9759                tracing::warn!(
9760                    "Unknown value '{}' for enum '{}'",
9761                    v,
9762                    "CreateCheckoutSessionPaymentMethodOptionsNaverPaySetupFutureUsage"
9763                );
9764                Ok(Unknown(v.to_owned()))
9765            }
9766        }
9767    }
9768}
9769impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsNaverPaySetupFutureUsage {
9770    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9771        f.write_str(self.as_str())
9772    }
9773}
9774
9775#[cfg(not(feature = "redact-generated-debug"))]
9776impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsNaverPaySetupFutureUsage {
9777    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9778        f.write_str(self.as_str())
9779    }
9780}
9781#[cfg(feature = "redact-generated-debug")]
9782impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsNaverPaySetupFutureUsage {
9783    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9784        f.debug_struct(stringify!(
9785            CreateCheckoutSessionPaymentMethodOptionsNaverPaySetupFutureUsage
9786        ))
9787        .finish_non_exhaustive()
9788    }
9789}
9790impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsNaverPaySetupFutureUsage {
9791    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9792    where
9793        S: serde::Serializer,
9794    {
9795        serializer.serialize_str(self.as_str())
9796    }
9797}
9798#[cfg(feature = "deserialize")]
9799impl<'de> serde::Deserialize<'de>
9800    for CreateCheckoutSessionPaymentMethodOptionsNaverPaySetupFutureUsage
9801{
9802    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9803        use std::str::FromStr;
9804        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9805        Ok(Self::from_str(&s).expect("infallible"))
9806    }
9807}
9808/// contains details about the OXXO payment method options.
9809#[derive(Clone, Eq, PartialEq)]
9810#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
9811#[derive(serde::Serialize)]
9812pub struct CreateCheckoutSessionPaymentMethodOptionsOxxo {
9813    /// The number of calendar days before an OXXO voucher expires.
9814    /// For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time.
9815    #[serde(skip_serializing_if = "Option::is_none")]
9816    pub expires_after_days: Option<u32>,
9817    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9818    ///
9819    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9820    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9821    ///
9822    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9823    ///
9824    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9825    #[serde(skip_serializing_if = "Option::is_none")]
9826    pub setup_future_usage: Option<CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage>,
9827}
9828#[cfg(feature = "redact-generated-debug")]
9829impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsOxxo {
9830    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9831        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsOxxo").finish_non_exhaustive()
9832    }
9833}
9834impl CreateCheckoutSessionPaymentMethodOptionsOxxo {
9835    pub fn new() -> Self {
9836        Self { expires_after_days: None, setup_future_usage: None }
9837    }
9838}
9839impl Default for CreateCheckoutSessionPaymentMethodOptionsOxxo {
9840    fn default() -> Self {
9841        Self::new()
9842    }
9843}
9844/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9845///
9846/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9847/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9848///
9849/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9850///
9851/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9852#[derive(Clone, Eq, PartialEq)]
9853#[non_exhaustive]
9854pub enum CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage {
9855    None,
9856    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9857    Unknown(String),
9858}
9859impl CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage {
9860    pub fn as_str(&self) -> &str {
9861        use CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage::*;
9862        match self {
9863            None => "none",
9864            Unknown(v) => v,
9865        }
9866    }
9867}
9868
9869impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage {
9870    type Err = std::convert::Infallible;
9871    fn from_str(s: &str) -> Result<Self, Self::Err> {
9872        use CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage::*;
9873        match s {
9874            "none" => Ok(None),
9875            v => {
9876                tracing::warn!(
9877                    "Unknown value '{}' for enum '{}'",
9878                    v,
9879                    "CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage"
9880                );
9881                Ok(Unknown(v.to_owned()))
9882            }
9883        }
9884    }
9885}
9886impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage {
9887    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9888        f.write_str(self.as_str())
9889    }
9890}
9891
9892#[cfg(not(feature = "redact-generated-debug"))]
9893impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage {
9894    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9895        f.write_str(self.as_str())
9896    }
9897}
9898#[cfg(feature = "redact-generated-debug")]
9899impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage {
9900    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9901        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage))
9902            .finish_non_exhaustive()
9903    }
9904}
9905impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage {
9906    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9907    where
9908        S: serde::Serializer,
9909    {
9910        serializer.serialize_str(self.as_str())
9911    }
9912}
9913#[cfg(feature = "deserialize")]
9914impl<'de> serde::Deserialize<'de>
9915    for CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage
9916{
9917    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9918        use std::str::FromStr;
9919        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9920        Ok(Self::from_str(&s).expect("infallible"))
9921    }
9922}
9923/// contains details about the P24 payment method options.
9924#[derive(Clone, Eq, PartialEq)]
9925#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
9926#[derive(serde::Serialize)]
9927pub struct CreateCheckoutSessionPaymentMethodOptionsP24 {
9928    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9929    ///
9930    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9931    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9932    ///
9933    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9934    ///
9935    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9936    #[serde(skip_serializing_if = "Option::is_none")]
9937    pub setup_future_usage: Option<CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage>,
9938    /// Confirm that the payer has accepted the P24 terms and conditions.
9939    #[serde(skip_serializing_if = "Option::is_none")]
9940    pub tos_shown_and_accepted: Option<bool>,
9941}
9942#[cfg(feature = "redact-generated-debug")]
9943impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsP24 {
9944    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9945        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsP24").finish_non_exhaustive()
9946    }
9947}
9948impl CreateCheckoutSessionPaymentMethodOptionsP24 {
9949    pub fn new() -> Self {
9950        Self { setup_future_usage: None, tos_shown_and_accepted: None }
9951    }
9952}
9953impl Default for CreateCheckoutSessionPaymentMethodOptionsP24 {
9954    fn default() -> Self {
9955        Self::new()
9956    }
9957}
9958/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9959///
9960/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9961/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9962///
9963/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9964///
9965/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9966#[derive(Clone, Eq, PartialEq)]
9967#[non_exhaustive]
9968pub enum CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage {
9969    None,
9970    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9971    Unknown(String),
9972}
9973impl CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage {
9974    pub fn as_str(&self) -> &str {
9975        use CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage::*;
9976        match self {
9977            None => "none",
9978            Unknown(v) => v,
9979        }
9980    }
9981}
9982
9983impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage {
9984    type Err = std::convert::Infallible;
9985    fn from_str(s: &str) -> Result<Self, Self::Err> {
9986        use CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage::*;
9987        match s {
9988            "none" => Ok(None),
9989            v => {
9990                tracing::warn!(
9991                    "Unknown value '{}' for enum '{}'",
9992                    v,
9993                    "CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage"
9994                );
9995                Ok(Unknown(v.to_owned()))
9996            }
9997        }
9998    }
9999}
10000impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage {
10001    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10002        f.write_str(self.as_str())
10003    }
10004}
10005
10006#[cfg(not(feature = "redact-generated-debug"))]
10007impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage {
10008    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10009        f.write_str(self.as_str())
10010    }
10011}
10012#[cfg(feature = "redact-generated-debug")]
10013impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage {
10014    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10015        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage))
10016            .finish_non_exhaustive()
10017    }
10018}
10019impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage {
10020    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10021    where
10022        S: serde::Serializer,
10023    {
10024        serializer.serialize_str(self.as_str())
10025    }
10026}
10027#[cfg(feature = "deserialize")]
10028impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage {
10029    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10030        use std::str::FromStr;
10031        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10032        Ok(Self::from_str(&s).expect("infallible"))
10033    }
10034}
10035/// contains details about the PAYCO payment method options.
10036#[derive(Clone, Eq, PartialEq)]
10037#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
10038#[derive(serde::Serialize)]
10039pub struct CreateCheckoutSessionPaymentMethodOptionsPayco {
10040    /// Controls when the funds will be captured from the customer's account.
10041    #[serde(skip_serializing_if = "Option::is_none")]
10042    pub capture_method: Option<CreateCheckoutSessionPaymentMethodOptionsPaycoCaptureMethod>,
10043    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10044    ///
10045    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10046    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10047    ///
10048    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10049    ///
10050    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10051    #[serde(skip_serializing_if = "Option::is_none")]
10052    pub setup_future_usage: Option<CreateCheckoutSessionPaymentMethodOptionsPaycoSetupFutureUsage>,
10053}
10054#[cfg(feature = "redact-generated-debug")]
10055impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPayco {
10056    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10057        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsPayco").finish_non_exhaustive()
10058    }
10059}
10060impl CreateCheckoutSessionPaymentMethodOptionsPayco {
10061    pub fn new() -> Self {
10062        Self { capture_method: None, setup_future_usage: None }
10063    }
10064}
10065impl Default for CreateCheckoutSessionPaymentMethodOptionsPayco {
10066    fn default() -> Self {
10067        Self::new()
10068    }
10069}
10070/// Controls when the funds will be captured from the customer's account.
10071#[derive(Clone, Eq, PartialEq)]
10072#[non_exhaustive]
10073pub enum CreateCheckoutSessionPaymentMethodOptionsPaycoCaptureMethod {
10074    Manual,
10075    /// An unrecognized value from Stripe. Should not be used as a request parameter.
10076    Unknown(String),
10077}
10078impl CreateCheckoutSessionPaymentMethodOptionsPaycoCaptureMethod {
10079    pub fn as_str(&self) -> &str {
10080        use CreateCheckoutSessionPaymentMethodOptionsPaycoCaptureMethod::*;
10081        match self {
10082            Manual => "manual",
10083            Unknown(v) => v,
10084        }
10085    }
10086}
10087
10088impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsPaycoCaptureMethod {
10089    type Err = std::convert::Infallible;
10090    fn from_str(s: &str) -> Result<Self, Self::Err> {
10091        use CreateCheckoutSessionPaymentMethodOptionsPaycoCaptureMethod::*;
10092        match s {
10093            "manual" => Ok(Manual),
10094            v => {
10095                tracing::warn!(
10096                    "Unknown value '{}' for enum '{}'",
10097                    v,
10098                    "CreateCheckoutSessionPaymentMethodOptionsPaycoCaptureMethod"
10099                );
10100                Ok(Unknown(v.to_owned()))
10101            }
10102        }
10103    }
10104}
10105impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsPaycoCaptureMethod {
10106    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10107        f.write_str(self.as_str())
10108    }
10109}
10110
10111#[cfg(not(feature = "redact-generated-debug"))]
10112impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPaycoCaptureMethod {
10113    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10114        f.write_str(self.as_str())
10115    }
10116}
10117#[cfg(feature = "redact-generated-debug")]
10118impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPaycoCaptureMethod {
10119    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10120        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsPaycoCaptureMethod))
10121            .finish_non_exhaustive()
10122    }
10123}
10124impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsPaycoCaptureMethod {
10125    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10126    where
10127        S: serde::Serializer,
10128    {
10129        serializer.serialize_str(self.as_str())
10130    }
10131}
10132#[cfg(feature = "deserialize")]
10133impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionPaymentMethodOptionsPaycoCaptureMethod {
10134    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10135        use std::str::FromStr;
10136        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10137        Ok(Self::from_str(&s).expect("infallible"))
10138    }
10139}
10140/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10141///
10142/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10143/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10144///
10145/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10146///
10147/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10148#[derive(Clone, Eq, PartialEq)]
10149#[non_exhaustive]
10150pub enum CreateCheckoutSessionPaymentMethodOptionsPaycoSetupFutureUsage {
10151    None,
10152    /// An unrecognized value from Stripe. Should not be used as a request parameter.
10153    Unknown(String),
10154}
10155impl CreateCheckoutSessionPaymentMethodOptionsPaycoSetupFutureUsage {
10156    pub fn as_str(&self) -> &str {
10157        use CreateCheckoutSessionPaymentMethodOptionsPaycoSetupFutureUsage::*;
10158        match self {
10159            None => "none",
10160            Unknown(v) => v,
10161        }
10162    }
10163}
10164
10165impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsPaycoSetupFutureUsage {
10166    type Err = std::convert::Infallible;
10167    fn from_str(s: &str) -> Result<Self, Self::Err> {
10168        use CreateCheckoutSessionPaymentMethodOptionsPaycoSetupFutureUsage::*;
10169        match s {
10170            "none" => Ok(None),
10171            v => {
10172                tracing::warn!(
10173                    "Unknown value '{}' for enum '{}'",
10174                    v,
10175                    "CreateCheckoutSessionPaymentMethodOptionsPaycoSetupFutureUsage"
10176                );
10177                Ok(Unknown(v.to_owned()))
10178            }
10179        }
10180    }
10181}
10182impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsPaycoSetupFutureUsage {
10183    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10184        f.write_str(self.as_str())
10185    }
10186}
10187
10188#[cfg(not(feature = "redact-generated-debug"))]
10189impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPaycoSetupFutureUsage {
10190    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10191        f.write_str(self.as_str())
10192    }
10193}
10194#[cfg(feature = "redact-generated-debug")]
10195impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPaycoSetupFutureUsage {
10196    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10197        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsPaycoSetupFutureUsage))
10198            .finish_non_exhaustive()
10199    }
10200}
10201impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsPaycoSetupFutureUsage {
10202    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10203    where
10204        S: serde::Serializer,
10205    {
10206        serializer.serialize_str(self.as_str())
10207    }
10208}
10209#[cfg(feature = "deserialize")]
10210impl<'de> serde::Deserialize<'de>
10211    for CreateCheckoutSessionPaymentMethodOptionsPaycoSetupFutureUsage
10212{
10213    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10214        use std::str::FromStr;
10215        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10216        Ok(Self::from_str(&s).expect("infallible"))
10217    }
10218}
10219/// contains details about the PayNow payment method options.
10220#[derive(Clone, Eq, PartialEq)]
10221#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
10222#[derive(serde::Serialize)]
10223pub struct CreateCheckoutSessionPaymentMethodOptionsPaynow {
10224    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10225    ///
10226    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10227    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10228    ///
10229    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10230    ///
10231    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10232    #[serde(skip_serializing_if = "Option::is_none")]
10233    pub setup_future_usage: Option<CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage>,
10234}
10235#[cfg(feature = "redact-generated-debug")]
10236impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPaynow {
10237    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10238        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsPaynow").finish_non_exhaustive()
10239    }
10240}
10241impl CreateCheckoutSessionPaymentMethodOptionsPaynow {
10242    pub fn new() -> Self {
10243        Self { setup_future_usage: None }
10244    }
10245}
10246impl Default for CreateCheckoutSessionPaymentMethodOptionsPaynow {
10247    fn default() -> Self {
10248        Self::new()
10249    }
10250}
10251/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10252///
10253/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10254/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10255///
10256/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10257///
10258/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10259#[derive(Clone, Eq, PartialEq)]
10260#[non_exhaustive]
10261pub enum CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage {
10262    None,
10263    /// An unrecognized value from Stripe. Should not be used as a request parameter.
10264    Unknown(String),
10265}
10266impl CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage {
10267    pub fn as_str(&self) -> &str {
10268        use CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage::*;
10269        match self {
10270            None => "none",
10271            Unknown(v) => v,
10272        }
10273    }
10274}
10275
10276impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage {
10277    type Err = std::convert::Infallible;
10278    fn from_str(s: &str) -> Result<Self, Self::Err> {
10279        use CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage::*;
10280        match s {
10281            "none" => Ok(None),
10282            v => {
10283                tracing::warn!(
10284                    "Unknown value '{}' for enum '{}'",
10285                    v,
10286                    "CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage"
10287                );
10288                Ok(Unknown(v.to_owned()))
10289            }
10290        }
10291    }
10292}
10293impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage {
10294    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10295        f.write_str(self.as_str())
10296    }
10297}
10298
10299#[cfg(not(feature = "redact-generated-debug"))]
10300impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage {
10301    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10302        f.write_str(self.as_str())
10303    }
10304}
10305#[cfg(feature = "redact-generated-debug")]
10306impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage {
10307    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10308        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage))
10309            .finish_non_exhaustive()
10310    }
10311}
10312impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage {
10313    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10314    where
10315        S: serde::Serializer,
10316    {
10317        serializer.serialize_str(self.as_str())
10318    }
10319}
10320#[cfg(feature = "deserialize")]
10321impl<'de> serde::Deserialize<'de>
10322    for CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage
10323{
10324    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10325        use std::str::FromStr;
10326        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10327        Ok(Self::from_str(&s).expect("infallible"))
10328    }
10329}
10330/// contains details about the PayPal payment method options.
10331#[derive(Clone, Eq, PartialEq)]
10332#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
10333#[derive(serde::Serialize)]
10334pub struct CreateCheckoutSessionPaymentMethodOptionsPaypal {
10335    /// Controls when the funds will be captured from the customer's account.
10336    #[serde(skip_serializing_if = "Option::is_none")]
10337    pub capture_method: Option<CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod>,
10338    /// [Preferred locale](https://docs.stripe.com/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to.
10339    #[serde(skip_serializing_if = "Option::is_none")]
10340    pub preferred_locale: Option<CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale>,
10341    /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID.
10342    /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID.
10343    #[serde(skip_serializing_if = "Option::is_none")]
10344    pub reference: Option<String>,
10345    /// The risk correlation ID for an on-session payment using a saved PayPal payment method.
10346    #[serde(skip_serializing_if = "Option::is_none")]
10347    pub risk_correlation_id: Option<String>,
10348    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10349    ///
10350    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10351    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10352    ///
10353    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10354    ///
10355    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10356    ///
10357    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
10358    #[serde(skip_serializing_if = "Option::is_none")]
10359    pub setup_future_usage: Option<CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage>,
10360}
10361#[cfg(feature = "redact-generated-debug")]
10362impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPaypal {
10363    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10364        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsPaypal").finish_non_exhaustive()
10365    }
10366}
10367impl CreateCheckoutSessionPaymentMethodOptionsPaypal {
10368    pub fn new() -> Self {
10369        Self {
10370            capture_method: None,
10371            preferred_locale: None,
10372            reference: None,
10373            risk_correlation_id: None,
10374            setup_future_usage: None,
10375        }
10376    }
10377}
10378impl Default for CreateCheckoutSessionPaymentMethodOptionsPaypal {
10379    fn default() -> Self {
10380        Self::new()
10381    }
10382}
10383/// Controls when the funds will be captured from the customer's account.
10384#[derive(Clone, Eq, PartialEq)]
10385#[non_exhaustive]
10386pub enum CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod {
10387    Manual,
10388    /// An unrecognized value from Stripe. Should not be used as a request parameter.
10389    Unknown(String),
10390}
10391impl CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod {
10392    pub fn as_str(&self) -> &str {
10393        use CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod::*;
10394        match self {
10395            Manual => "manual",
10396            Unknown(v) => v,
10397        }
10398    }
10399}
10400
10401impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod {
10402    type Err = std::convert::Infallible;
10403    fn from_str(s: &str) -> Result<Self, Self::Err> {
10404        use CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod::*;
10405        match s {
10406            "manual" => Ok(Manual),
10407            v => {
10408                tracing::warn!(
10409                    "Unknown value '{}' for enum '{}'",
10410                    v,
10411                    "CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod"
10412                );
10413                Ok(Unknown(v.to_owned()))
10414            }
10415        }
10416    }
10417}
10418impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod {
10419    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10420        f.write_str(self.as_str())
10421    }
10422}
10423
10424#[cfg(not(feature = "redact-generated-debug"))]
10425impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod {
10426    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10427        f.write_str(self.as_str())
10428    }
10429}
10430#[cfg(feature = "redact-generated-debug")]
10431impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod {
10432    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10433        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod))
10434            .finish_non_exhaustive()
10435    }
10436}
10437impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod {
10438    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10439    where
10440        S: serde::Serializer,
10441    {
10442        serializer.serialize_str(self.as_str())
10443    }
10444}
10445#[cfg(feature = "deserialize")]
10446impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod {
10447    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10448        use std::str::FromStr;
10449        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10450        Ok(Self::from_str(&s).expect("infallible"))
10451    }
10452}
10453/// [Preferred locale](https://docs.stripe.com/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to.
10454#[derive(Clone, Eq, PartialEq)]
10455#[non_exhaustive]
10456pub enum CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale {
10457    CsMinusCz,
10458    DaMinusDk,
10459    DeMinusAt,
10460    DeMinusDe,
10461    DeMinusLu,
10462    ElMinusGr,
10463    EnMinusGb,
10464    EnMinusUs,
10465    EsMinusEs,
10466    FiMinusFi,
10467    FrMinusBe,
10468    FrMinusFr,
10469    FrMinusLu,
10470    HuMinusHu,
10471    ItMinusIt,
10472    NlMinusBe,
10473    NlMinusNl,
10474    PlMinusPl,
10475    PtMinusPt,
10476    SkMinusSk,
10477    SvMinusSe,
10478    /// An unrecognized value from Stripe. Should not be used as a request parameter.
10479    Unknown(String),
10480}
10481impl CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale {
10482    pub fn as_str(&self) -> &str {
10483        use CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::*;
10484        match self {
10485            CsMinusCz => "cs-CZ",
10486            DaMinusDk => "da-DK",
10487            DeMinusAt => "de-AT",
10488            DeMinusDe => "de-DE",
10489            DeMinusLu => "de-LU",
10490            ElMinusGr => "el-GR",
10491            EnMinusGb => "en-GB",
10492            EnMinusUs => "en-US",
10493            EsMinusEs => "es-ES",
10494            FiMinusFi => "fi-FI",
10495            FrMinusBe => "fr-BE",
10496            FrMinusFr => "fr-FR",
10497            FrMinusLu => "fr-LU",
10498            HuMinusHu => "hu-HU",
10499            ItMinusIt => "it-IT",
10500            NlMinusBe => "nl-BE",
10501            NlMinusNl => "nl-NL",
10502            PlMinusPl => "pl-PL",
10503            PtMinusPt => "pt-PT",
10504            SkMinusSk => "sk-SK",
10505            SvMinusSe => "sv-SE",
10506            Unknown(v) => v,
10507        }
10508    }
10509}
10510
10511impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale {
10512    type Err = std::convert::Infallible;
10513    fn from_str(s: &str) -> Result<Self, Self::Err> {
10514        use CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::*;
10515        match s {
10516            "cs-CZ" => Ok(CsMinusCz),
10517            "da-DK" => Ok(DaMinusDk),
10518            "de-AT" => Ok(DeMinusAt),
10519            "de-DE" => Ok(DeMinusDe),
10520            "de-LU" => Ok(DeMinusLu),
10521            "el-GR" => Ok(ElMinusGr),
10522            "en-GB" => Ok(EnMinusGb),
10523            "en-US" => Ok(EnMinusUs),
10524            "es-ES" => Ok(EsMinusEs),
10525            "fi-FI" => Ok(FiMinusFi),
10526            "fr-BE" => Ok(FrMinusBe),
10527            "fr-FR" => Ok(FrMinusFr),
10528            "fr-LU" => Ok(FrMinusLu),
10529            "hu-HU" => Ok(HuMinusHu),
10530            "it-IT" => Ok(ItMinusIt),
10531            "nl-BE" => Ok(NlMinusBe),
10532            "nl-NL" => Ok(NlMinusNl),
10533            "pl-PL" => Ok(PlMinusPl),
10534            "pt-PT" => Ok(PtMinusPt),
10535            "sk-SK" => Ok(SkMinusSk),
10536            "sv-SE" => Ok(SvMinusSe),
10537            v => {
10538                tracing::warn!(
10539                    "Unknown value '{}' for enum '{}'",
10540                    v,
10541                    "CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale"
10542                );
10543                Ok(Unknown(v.to_owned()))
10544            }
10545        }
10546    }
10547}
10548impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale {
10549    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10550        f.write_str(self.as_str())
10551    }
10552}
10553
10554#[cfg(not(feature = "redact-generated-debug"))]
10555impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale {
10556    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10557        f.write_str(self.as_str())
10558    }
10559}
10560#[cfg(feature = "redact-generated-debug")]
10561impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale {
10562    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10563        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale))
10564            .finish_non_exhaustive()
10565    }
10566}
10567impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale {
10568    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10569    where
10570        S: serde::Serializer,
10571    {
10572        serializer.serialize_str(self.as_str())
10573    }
10574}
10575#[cfg(feature = "deserialize")]
10576impl<'de> serde::Deserialize<'de>
10577    for CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale
10578{
10579    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10580        use std::str::FromStr;
10581        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10582        Ok(Self::from_str(&s).expect("infallible"))
10583    }
10584}
10585/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10586///
10587/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10588/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10589///
10590/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10591///
10592/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10593///
10594/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
10595#[derive(Clone, Eq, PartialEq)]
10596#[non_exhaustive]
10597pub enum CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage {
10598    None,
10599    OffSession,
10600    /// An unrecognized value from Stripe. Should not be used as a request parameter.
10601    Unknown(String),
10602}
10603impl CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage {
10604    pub fn as_str(&self) -> &str {
10605        use CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage::*;
10606        match self {
10607            None => "none",
10608            OffSession => "off_session",
10609            Unknown(v) => v,
10610        }
10611    }
10612}
10613
10614impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage {
10615    type Err = std::convert::Infallible;
10616    fn from_str(s: &str) -> Result<Self, Self::Err> {
10617        use CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage::*;
10618        match s {
10619            "none" => Ok(None),
10620            "off_session" => Ok(OffSession),
10621            v => {
10622                tracing::warn!(
10623                    "Unknown value '{}' for enum '{}'",
10624                    v,
10625                    "CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage"
10626                );
10627                Ok(Unknown(v.to_owned()))
10628            }
10629        }
10630    }
10631}
10632impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage {
10633    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10634        f.write_str(self.as_str())
10635    }
10636}
10637
10638#[cfg(not(feature = "redact-generated-debug"))]
10639impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage {
10640    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10641        f.write_str(self.as_str())
10642    }
10643}
10644#[cfg(feature = "redact-generated-debug")]
10645impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage {
10646    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10647        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage))
10648            .finish_non_exhaustive()
10649    }
10650}
10651impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage {
10652    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10653    where
10654        S: serde::Serializer,
10655    {
10656        serializer.serialize_str(self.as_str())
10657    }
10658}
10659#[cfg(feature = "deserialize")]
10660impl<'de> serde::Deserialize<'de>
10661    for CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage
10662{
10663    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10664        use std::str::FromStr;
10665        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10666        Ok(Self::from_str(&s).expect("infallible"))
10667    }
10668}
10669/// contains details about the PayTo payment method options.
10670#[derive(Clone, Eq, PartialEq)]
10671#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
10672#[derive(serde::Serialize)]
10673pub struct CreateCheckoutSessionPaymentMethodOptionsPayto {
10674    /// Additional fields for Mandate creation
10675    #[serde(skip_serializing_if = "Option::is_none")]
10676    pub mandate_options: Option<CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptions>,
10677    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10678    ///
10679    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10680    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10681    ///
10682    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10683    ///
10684    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10685    #[serde(skip_serializing_if = "Option::is_none")]
10686    pub setup_future_usage: Option<CreateCheckoutSessionPaymentMethodOptionsPaytoSetupFutureUsage>,
10687}
10688#[cfg(feature = "redact-generated-debug")]
10689impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPayto {
10690    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10691        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsPayto").finish_non_exhaustive()
10692    }
10693}
10694impl CreateCheckoutSessionPaymentMethodOptionsPayto {
10695    pub fn new() -> Self {
10696        Self { mandate_options: None, setup_future_usage: None }
10697    }
10698}
10699impl Default for CreateCheckoutSessionPaymentMethodOptionsPayto {
10700    fn default() -> Self {
10701        Self::new()
10702    }
10703}
10704/// Additional fields for Mandate creation
10705#[derive(Clone, Eq, PartialEq)]
10706#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
10707#[derive(serde::Serialize)]
10708pub struct CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptions {
10709    /// Amount that will be collected. It is required when `amount_type` is `fixed`.
10710    #[serde(skip_serializing_if = "Option::is_none")]
10711    pub amount: Option<i64>,
10712    /// The type of amount that will be collected.
10713    /// The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively.
10714    /// Defaults to `maximum`.
10715    #[serde(skip_serializing_if = "Option::is_none")]
10716    pub amount_type: Option<CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsAmountType>,
10717    /// Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date.
10718    #[serde(skip_serializing_if = "Option::is_none")]
10719    pub end_date: Option<String>,
10720    /// The periodicity at which payments will be collected. Defaults to `adhoc`.
10721    #[serde(skip_serializing_if = "Option::is_none")]
10722    pub payment_schedule:
10723        Option<CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule>,
10724    /// The number of payments that will be made during a payment period.
10725    /// Defaults to 1 except for when `payment_schedule` is `adhoc`.
10726    /// In that case, it defaults to no limit.
10727    #[serde(skip_serializing_if = "Option::is_none")]
10728    pub payments_per_period: Option<i64>,
10729    /// The purpose for which payments are made. Has a default value based on your merchant category code.
10730    #[serde(skip_serializing_if = "Option::is_none")]
10731    pub purpose: Option<CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsPurpose>,
10732    /// Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to confirmation time.
10733    #[serde(skip_serializing_if = "Option::is_none")]
10734    pub start_date: Option<String>,
10735}
10736#[cfg(feature = "redact-generated-debug")]
10737impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptions {
10738    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10739        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptions")
10740            .finish_non_exhaustive()
10741    }
10742}
10743impl CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptions {
10744    pub fn new() -> Self {
10745        Self {
10746            amount: None,
10747            amount_type: None,
10748            end_date: None,
10749            payment_schedule: None,
10750            payments_per_period: None,
10751            purpose: None,
10752            start_date: None,
10753        }
10754    }
10755}
10756impl Default for CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptions {
10757    fn default() -> Self {
10758        Self::new()
10759    }
10760}
10761/// The type of amount that will be collected.
10762/// The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively.
10763/// Defaults to `maximum`.
10764#[derive(Clone, Eq, PartialEq)]
10765#[non_exhaustive]
10766pub enum CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsAmountType {
10767    Fixed,
10768    Maximum,
10769    /// An unrecognized value from Stripe. Should not be used as a request parameter.
10770    Unknown(String),
10771}
10772impl CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsAmountType {
10773    pub fn as_str(&self) -> &str {
10774        use CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsAmountType::*;
10775        match self {
10776            Fixed => "fixed",
10777            Maximum => "maximum",
10778            Unknown(v) => v,
10779        }
10780    }
10781}
10782
10783impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsAmountType {
10784    type Err = std::convert::Infallible;
10785    fn from_str(s: &str) -> Result<Self, Self::Err> {
10786        use CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsAmountType::*;
10787        match s {
10788            "fixed" => Ok(Fixed),
10789            "maximum" => Ok(Maximum),
10790            v => {
10791                tracing::warn!(
10792                    "Unknown value '{}' for enum '{}'",
10793                    v,
10794                    "CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsAmountType"
10795                );
10796                Ok(Unknown(v.to_owned()))
10797            }
10798        }
10799    }
10800}
10801impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsAmountType {
10802    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10803        f.write_str(self.as_str())
10804    }
10805}
10806
10807#[cfg(not(feature = "redact-generated-debug"))]
10808impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsAmountType {
10809    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10810        f.write_str(self.as_str())
10811    }
10812}
10813#[cfg(feature = "redact-generated-debug")]
10814impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsAmountType {
10815    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10816        f.debug_struct(stringify!(
10817            CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsAmountType
10818        ))
10819        .finish_non_exhaustive()
10820    }
10821}
10822impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsAmountType {
10823    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10824    where
10825        S: serde::Serializer,
10826    {
10827        serializer.serialize_str(self.as_str())
10828    }
10829}
10830#[cfg(feature = "deserialize")]
10831impl<'de> serde::Deserialize<'de>
10832    for CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsAmountType
10833{
10834    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10835        use std::str::FromStr;
10836        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10837        Ok(Self::from_str(&s).expect("infallible"))
10838    }
10839}
10840/// The periodicity at which payments will be collected. Defaults to `adhoc`.
10841#[derive(Clone, Eq, PartialEq)]
10842#[non_exhaustive]
10843pub enum CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
10844    Adhoc,
10845    Annual,
10846    Daily,
10847    Fortnightly,
10848    Monthly,
10849    Quarterly,
10850    SemiAnnual,
10851    Weekly,
10852    /// An unrecognized value from Stripe. Should not be used as a request parameter.
10853    Unknown(String),
10854}
10855impl CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
10856    pub fn as_str(&self) -> &str {
10857        use CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule::*;
10858        match self {
10859            Adhoc => "adhoc",
10860            Annual => "annual",
10861            Daily => "daily",
10862            Fortnightly => "fortnightly",
10863            Monthly => "monthly",
10864            Quarterly => "quarterly",
10865            SemiAnnual => "semi_annual",
10866            Weekly => "weekly",
10867            Unknown(v) => v,
10868        }
10869    }
10870}
10871
10872impl std::str::FromStr
10873    for CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule
10874{
10875    type Err = std::convert::Infallible;
10876    fn from_str(s: &str) -> Result<Self, Self::Err> {
10877        use CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule::*;
10878        match s {
10879            "adhoc" => Ok(Adhoc),
10880            "annual" => Ok(Annual),
10881            "daily" => Ok(Daily),
10882            "fortnightly" => Ok(Fortnightly),
10883            "monthly" => Ok(Monthly),
10884            "quarterly" => Ok(Quarterly),
10885            "semi_annual" => Ok(SemiAnnual),
10886            "weekly" => Ok(Weekly),
10887            v => {
10888                tracing::warn!(
10889                    "Unknown value '{}' for enum '{}'",
10890                    v,
10891                    "CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule"
10892                );
10893                Ok(Unknown(v.to_owned()))
10894            }
10895        }
10896    }
10897}
10898impl std::fmt::Display
10899    for CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule
10900{
10901    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10902        f.write_str(self.as_str())
10903    }
10904}
10905
10906#[cfg(not(feature = "redact-generated-debug"))]
10907impl std::fmt::Debug
10908    for CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule
10909{
10910    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10911        f.write_str(self.as_str())
10912    }
10913}
10914#[cfg(feature = "redact-generated-debug")]
10915impl std::fmt::Debug
10916    for CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule
10917{
10918    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10919        f.debug_struct(stringify!(
10920            CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule
10921        ))
10922        .finish_non_exhaustive()
10923    }
10924}
10925impl serde::Serialize
10926    for CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule
10927{
10928    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10929    where
10930        S: serde::Serializer,
10931    {
10932        serializer.serialize_str(self.as_str())
10933    }
10934}
10935#[cfg(feature = "deserialize")]
10936impl<'de> serde::Deserialize<'de>
10937    for CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule
10938{
10939    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10940        use std::str::FromStr;
10941        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10942        Ok(Self::from_str(&s).expect("infallible"))
10943    }
10944}
10945/// The purpose for which payments are made. Has a default value based on your merchant category code.
10946#[derive(Clone, Eq, PartialEq)]
10947#[non_exhaustive]
10948pub enum CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsPurpose {
10949    DependantSupport,
10950    Government,
10951    Loan,
10952    Mortgage,
10953    Other,
10954    Pension,
10955    Personal,
10956    Retail,
10957    Salary,
10958    Tax,
10959    Utility,
10960    /// An unrecognized value from Stripe. Should not be used as a request parameter.
10961    Unknown(String),
10962}
10963impl CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsPurpose {
10964    pub fn as_str(&self) -> &str {
10965        use CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsPurpose::*;
10966        match self {
10967            DependantSupport => "dependant_support",
10968            Government => "government",
10969            Loan => "loan",
10970            Mortgage => "mortgage",
10971            Other => "other",
10972            Pension => "pension",
10973            Personal => "personal",
10974            Retail => "retail",
10975            Salary => "salary",
10976            Tax => "tax",
10977            Utility => "utility",
10978            Unknown(v) => v,
10979        }
10980    }
10981}
10982
10983impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsPurpose {
10984    type Err = std::convert::Infallible;
10985    fn from_str(s: &str) -> Result<Self, Self::Err> {
10986        use CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsPurpose::*;
10987        match s {
10988            "dependant_support" => Ok(DependantSupport),
10989            "government" => Ok(Government),
10990            "loan" => Ok(Loan),
10991            "mortgage" => Ok(Mortgage),
10992            "other" => Ok(Other),
10993            "pension" => Ok(Pension),
10994            "personal" => Ok(Personal),
10995            "retail" => Ok(Retail),
10996            "salary" => Ok(Salary),
10997            "tax" => Ok(Tax),
10998            "utility" => Ok(Utility),
10999            v => {
11000                tracing::warn!(
11001                    "Unknown value '{}' for enum '{}'",
11002                    v,
11003                    "CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsPurpose"
11004                );
11005                Ok(Unknown(v.to_owned()))
11006            }
11007        }
11008    }
11009}
11010impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsPurpose {
11011    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11012        f.write_str(self.as_str())
11013    }
11014}
11015
11016#[cfg(not(feature = "redact-generated-debug"))]
11017impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsPurpose {
11018    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11019        f.write_str(self.as_str())
11020    }
11021}
11022#[cfg(feature = "redact-generated-debug")]
11023impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsPurpose {
11024    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11025        f.debug_struct(stringify!(
11026            CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsPurpose
11027        ))
11028        .finish_non_exhaustive()
11029    }
11030}
11031impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsPurpose {
11032    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11033    where
11034        S: serde::Serializer,
11035    {
11036        serializer.serialize_str(self.as_str())
11037    }
11038}
11039#[cfg(feature = "deserialize")]
11040impl<'de> serde::Deserialize<'de>
11041    for CreateCheckoutSessionPaymentMethodOptionsPaytoMandateOptionsPurpose
11042{
11043    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11044        use std::str::FromStr;
11045        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11046        Ok(Self::from_str(&s).expect("infallible"))
11047    }
11048}
11049/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
11050///
11051/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
11052/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
11053///
11054/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
11055///
11056/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
11057#[derive(Clone, Eq, PartialEq)]
11058#[non_exhaustive]
11059pub enum CreateCheckoutSessionPaymentMethodOptionsPaytoSetupFutureUsage {
11060    None,
11061    OffSession,
11062    /// An unrecognized value from Stripe. Should not be used as a request parameter.
11063    Unknown(String),
11064}
11065impl CreateCheckoutSessionPaymentMethodOptionsPaytoSetupFutureUsage {
11066    pub fn as_str(&self) -> &str {
11067        use CreateCheckoutSessionPaymentMethodOptionsPaytoSetupFutureUsage::*;
11068        match self {
11069            None => "none",
11070            OffSession => "off_session",
11071            Unknown(v) => v,
11072        }
11073    }
11074}
11075
11076impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsPaytoSetupFutureUsage {
11077    type Err = std::convert::Infallible;
11078    fn from_str(s: &str) -> Result<Self, Self::Err> {
11079        use CreateCheckoutSessionPaymentMethodOptionsPaytoSetupFutureUsage::*;
11080        match s {
11081            "none" => Ok(None),
11082            "off_session" => Ok(OffSession),
11083            v => {
11084                tracing::warn!(
11085                    "Unknown value '{}' for enum '{}'",
11086                    v,
11087                    "CreateCheckoutSessionPaymentMethodOptionsPaytoSetupFutureUsage"
11088                );
11089                Ok(Unknown(v.to_owned()))
11090            }
11091        }
11092    }
11093}
11094impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsPaytoSetupFutureUsage {
11095    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11096        f.write_str(self.as_str())
11097    }
11098}
11099
11100#[cfg(not(feature = "redact-generated-debug"))]
11101impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPaytoSetupFutureUsage {
11102    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11103        f.write_str(self.as_str())
11104    }
11105}
11106#[cfg(feature = "redact-generated-debug")]
11107impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPaytoSetupFutureUsage {
11108    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11109        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsPaytoSetupFutureUsage))
11110            .finish_non_exhaustive()
11111    }
11112}
11113impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsPaytoSetupFutureUsage {
11114    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11115    where
11116        S: serde::Serializer,
11117    {
11118        serializer.serialize_str(self.as_str())
11119    }
11120}
11121#[cfg(feature = "deserialize")]
11122impl<'de> serde::Deserialize<'de>
11123    for CreateCheckoutSessionPaymentMethodOptionsPaytoSetupFutureUsage
11124{
11125    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11126        use std::str::FromStr;
11127        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11128        Ok(Self::from_str(&s).expect("infallible"))
11129    }
11130}
11131/// contains details about the Pix payment method options.
11132#[derive(Clone, Eq, PartialEq)]
11133#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
11134#[derive(serde::Serialize)]
11135pub struct CreateCheckoutSessionPaymentMethodOptionsPix {
11136    /// Determines if the amount includes the IOF tax. Defaults to `never`.
11137    #[serde(skip_serializing_if = "Option::is_none")]
11138    pub amount_includes_iof: Option<CreateCheckoutSessionPaymentMethodOptionsPixAmountIncludesIof>,
11139    /// The number of seconds (between 10 and 1209600) after which Pix payment will expire.
11140    /// Defaults to 86400 seconds.
11141    #[serde(skip_serializing_if = "Option::is_none")]
11142    pub expires_after_seconds: Option<i64>,
11143    /// Additional fields for mandate creation.
11144    #[serde(skip_serializing_if = "Option::is_none")]
11145    pub mandate_options: Option<CreateCheckoutSessionPaymentMethodOptionsPixMandateOptions>,
11146    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
11147    ///
11148    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
11149    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
11150    ///
11151    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
11152    ///
11153    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
11154    #[serde(skip_serializing_if = "Option::is_none")]
11155    pub setup_future_usage: Option<CreateCheckoutSessionPaymentMethodOptionsPixSetupFutureUsage>,
11156}
11157#[cfg(feature = "redact-generated-debug")]
11158impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPix {
11159    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11160        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsPix").finish_non_exhaustive()
11161    }
11162}
11163impl CreateCheckoutSessionPaymentMethodOptionsPix {
11164    pub fn new() -> Self {
11165        Self {
11166            amount_includes_iof: None,
11167            expires_after_seconds: None,
11168            mandate_options: None,
11169            setup_future_usage: None,
11170        }
11171    }
11172}
11173impl Default for CreateCheckoutSessionPaymentMethodOptionsPix {
11174    fn default() -> Self {
11175        Self::new()
11176    }
11177}
11178/// Determines if the amount includes the IOF tax. Defaults to `never`.
11179#[derive(Clone, Eq, PartialEq)]
11180#[non_exhaustive]
11181pub enum CreateCheckoutSessionPaymentMethodOptionsPixAmountIncludesIof {
11182    Always,
11183    Never,
11184    /// An unrecognized value from Stripe. Should not be used as a request parameter.
11185    Unknown(String),
11186}
11187impl CreateCheckoutSessionPaymentMethodOptionsPixAmountIncludesIof {
11188    pub fn as_str(&self) -> &str {
11189        use CreateCheckoutSessionPaymentMethodOptionsPixAmountIncludesIof::*;
11190        match self {
11191            Always => "always",
11192            Never => "never",
11193            Unknown(v) => v,
11194        }
11195    }
11196}
11197
11198impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsPixAmountIncludesIof {
11199    type Err = std::convert::Infallible;
11200    fn from_str(s: &str) -> Result<Self, Self::Err> {
11201        use CreateCheckoutSessionPaymentMethodOptionsPixAmountIncludesIof::*;
11202        match s {
11203            "always" => Ok(Always),
11204            "never" => Ok(Never),
11205            v => {
11206                tracing::warn!(
11207                    "Unknown value '{}' for enum '{}'",
11208                    v,
11209                    "CreateCheckoutSessionPaymentMethodOptionsPixAmountIncludesIof"
11210                );
11211                Ok(Unknown(v.to_owned()))
11212            }
11213        }
11214    }
11215}
11216impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsPixAmountIncludesIof {
11217    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11218        f.write_str(self.as_str())
11219    }
11220}
11221
11222#[cfg(not(feature = "redact-generated-debug"))]
11223impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPixAmountIncludesIof {
11224    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11225        f.write_str(self.as_str())
11226    }
11227}
11228#[cfg(feature = "redact-generated-debug")]
11229impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPixAmountIncludesIof {
11230    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11231        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsPixAmountIncludesIof))
11232            .finish_non_exhaustive()
11233    }
11234}
11235impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsPixAmountIncludesIof {
11236    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11237    where
11238        S: serde::Serializer,
11239    {
11240        serializer.serialize_str(self.as_str())
11241    }
11242}
11243#[cfg(feature = "deserialize")]
11244impl<'de> serde::Deserialize<'de>
11245    for CreateCheckoutSessionPaymentMethodOptionsPixAmountIncludesIof
11246{
11247    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11248        use std::str::FromStr;
11249        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11250        Ok(Self::from_str(&s).expect("infallible"))
11251    }
11252}
11253/// Additional fields for mandate creation.
11254#[derive(Clone, Eq, PartialEq)]
11255#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
11256#[derive(serde::Serialize)]
11257pub struct CreateCheckoutSessionPaymentMethodOptionsPixMandateOptions {
11258    /// Amount to be charged for future payments.
11259    /// Required when `amount_type=fixed`.
11260    /// If not provided for `amount_type=maximum`, defaults to 40000.
11261    #[serde(skip_serializing_if = "Option::is_none")]
11262    pub amount: Option<i64>,
11263    /// Determines if the amount includes the IOF tax. Defaults to `never`.
11264    #[serde(skip_serializing_if = "Option::is_none")]
11265    pub amount_includes_iof:
11266        Option<CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsAmountIncludesIof>,
11267    /// Type of amount. Defaults to `maximum`.
11268    #[serde(skip_serializing_if = "Option::is_none")]
11269    pub amount_type: Option<CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsAmountType>,
11270    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
11271    /// Only `brl` is supported currently.
11272    #[serde(skip_serializing_if = "Option::is_none")]
11273    pub currency: Option<stripe_types::Currency>,
11274    /// Date when the mandate expires and no further payments will be charged, in `YYYY-MM-DD`.
11275    /// If not provided, the mandate will be active until canceled.
11276    /// If provided, end date should be after start date.
11277    #[serde(skip_serializing_if = "Option::is_none")]
11278    pub end_date: Option<String>,
11279    /// Schedule at which the future payments will be charged. Defaults to `monthly`.
11280    #[serde(skip_serializing_if = "Option::is_none")]
11281    pub payment_schedule:
11282        Option<CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsPaymentSchedule>,
11283    /// Subscription name displayed to buyers in their bank app. Defaults to the displayable business name.
11284    #[serde(skip_serializing_if = "Option::is_none")]
11285    pub reference: Option<String>,
11286    /// Start date of the mandate, in `YYYY-MM-DD`.
11287    /// Start date should be at least 3 days in the future.
11288    /// Defaults to 3 days after the current date.
11289    #[serde(skip_serializing_if = "Option::is_none")]
11290    pub start_date: Option<String>,
11291}
11292#[cfg(feature = "redact-generated-debug")]
11293impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPixMandateOptions {
11294    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11295        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsPixMandateOptions")
11296            .finish_non_exhaustive()
11297    }
11298}
11299impl CreateCheckoutSessionPaymentMethodOptionsPixMandateOptions {
11300    pub fn new() -> Self {
11301        Self {
11302            amount: None,
11303            amount_includes_iof: None,
11304            amount_type: None,
11305            currency: None,
11306            end_date: None,
11307            payment_schedule: None,
11308            reference: None,
11309            start_date: None,
11310        }
11311    }
11312}
11313impl Default for CreateCheckoutSessionPaymentMethodOptionsPixMandateOptions {
11314    fn default() -> Self {
11315        Self::new()
11316    }
11317}
11318/// Determines if the amount includes the IOF tax. Defaults to `never`.
11319#[derive(Clone, Eq, PartialEq)]
11320#[non_exhaustive]
11321pub enum CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsAmountIncludesIof {
11322    Always,
11323    Never,
11324    /// An unrecognized value from Stripe. Should not be used as a request parameter.
11325    Unknown(String),
11326}
11327impl CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsAmountIncludesIof {
11328    pub fn as_str(&self) -> &str {
11329        use CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsAmountIncludesIof::*;
11330        match self {
11331            Always => "always",
11332            Never => "never",
11333            Unknown(v) => v,
11334        }
11335    }
11336}
11337
11338impl std::str::FromStr
11339    for CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsAmountIncludesIof
11340{
11341    type Err = std::convert::Infallible;
11342    fn from_str(s: &str) -> Result<Self, Self::Err> {
11343        use CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsAmountIncludesIof::*;
11344        match s {
11345            "always" => Ok(Always),
11346            "never" => Ok(Never),
11347            v => {
11348                tracing::warn!(
11349                    "Unknown value '{}' for enum '{}'",
11350                    v,
11351                    "CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsAmountIncludesIof"
11352                );
11353                Ok(Unknown(v.to_owned()))
11354            }
11355        }
11356    }
11357}
11358impl std::fmt::Display
11359    for CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsAmountIncludesIof
11360{
11361    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11362        f.write_str(self.as_str())
11363    }
11364}
11365
11366#[cfg(not(feature = "redact-generated-debug"))]
11367impl std::fmt::Debug
11368    for CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsAmountIncludesIof
11369{
11370    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11371        f.write_str(self.as_str())
11372    }
11373}
11374#[cfg(feature = "redact-generated-debug")]
11375impl std::fmt::Debug
11376    for CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsAmountIncludesIof
11377{
11378    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11379        f.debug_struct(stringify!(
11380            CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsAmountIncludesIof
11381        ))
11382        .finish_non_exhaustive()
11383    }
11384}
11385impl serde::Serialize
11386    for CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsAmountIncludesIof
11387{
11388    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11389    where
11390        S: serde::Serializer,
11391    {
11392        serializer.serialize_str(self.as_str())
11393    }
11394}
11395#[cfg(feature = "deserialize")]
11396impl<'de> serde::Deserialize<'de>
11397    for CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsAmountIncludesIof
11398{
11399    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11400        use std::str::FromStr;
11401        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11402        Ok(Self::from_str(&s).expect("infallible"))
11403    }
11404}
11405/// Type of amount. Defaults to `maximum`.
11406#[derive(Clone, Eq, PartialEq)]
11407#[non_exhaustive]
11408pub enum CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsAmountType {
11409    Fixed,
11410    Maximum,
11411    /// An unrecognized value from Stripe. Should not be used as a request parameter.
11412    Unknown(String),
11413}
11414impl CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsAmountType {
11415    pub fn as_str(&self) -> &str {
11416        use CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsAmountType::*;
11417        match self {
11418            Fixed => "fixed",
11419            Maximum => "maximum",
11420            Unknown(v) => v,
11421        }
11422    }
11423}
11424
11425impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsAmountType {
11426    type Err = std::convert::Infallible;
11427    fn from_str(s: &str) -> Result<Self, Self::Err> {
11428        use CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsAmountType::*;
11429        match s {
11430            "fixed" => Ok(Fixed),
11431            "maximum" => Ok(Maximum),
11432            v => {
11433                tracing::warn!(
11434                    "Unknown value '{}' for enum '{}'",
11435                    v,
11436                    "CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsAmountType"
11437                );
11438                Ok(Unknown(v.to_owned()))
11439            }
11440        }
11441    }
11442}
11443impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsAmountType {
11444    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11445        f.write_str(self.as_str())
11446    }
11447}
11448
11449#[cfg(not(feature = "redact-generated-debug"))]
11450impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsAmountType {
11451    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11452        f.write_str(self.as_str())
11453    }
11454}
11455#[cfg(feature = "redact-generated-debug")]
11456impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsAmountType {
11457    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11458        f.debug_struct(stringify!(
11459            CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsAmountType
11460        ))
11461        .finish_non_exhaustive()
11462    }
11463}
11464impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsAmountType {
11465    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11466    where
11467        S: serde::Serializer,
11468    {
11469        serializer.serialize_str(self.as_str())
11470    }
11471}
11472#[cfg(feature = "deserialize")]
11473impl<'de> serde::Deserialize<'de>
11474    for CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsAmountType
11475{
11476    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11477        use std::str::FromStr;
11478        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11479        Ok(Self::from_str(&s).expect("infallible"))
11480    }
11481}
11482/// Schedule at which the future payments will be charged. Defaults to `monthly`.
11483#[derive(Clone, Eq, PartialEq)]
11484#[non_exhaustive]
11485pub enum CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsPaymentSchedule {
11486    Halfyearly,
11487    Monthly,
11488    Quarterly,
11489    Weekly,
11490    Yearly,
11491    /// An unrecognized value from Stripe. Should not be used as a request parameter.
11492    Unknown(String),
11493}
11494impl CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsPaymentSchedule {
11495    pub fn as_str(&self) -> &str {
11496        use CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsPaymentSchedule::*;
11497        match self {
11498            Halfyearly => "halfyearly",
11499            Monthly => "monthly",
11500            Quarterly => "quarterly",
11501            Weekly => "weekly",
11502            Yearly => "yearly",
11503            Unknown(v) => v,
11504        }
11505    }
11506}
11507
11508impl std::str::FromStr
11509    for CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsPaymentSchedule
11510{
11511    type Err = std::convert::Infallible;
11512    fn from_str(s: &str) -> Result<Self, Self::Err> {
11513        use CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsPaymentSchedule::*;
11514        match s {
11515            "halfyearly" => Ok(Halfyearly),
11516            "monthly" => Ok(Monthly),
11517            "quarterly" => Ok(Quarterly),
11518            "weekly" => Ok(Weekly),
11519            "yearly" => Ok(Yearly),
11520            v => {
11521                tracing::warn!(
11522                    "Unknown value '{}' for enum '{}'",
11523                    v,
11524                    "CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsPaymentSchedule"
11525                );
11526                Ok(Unknown(v.to_owned()))
11527            }
11528        }
11529    }
11530}
11531impl std::fmt::Display
11532    for CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsPaymentSchedule
11533{
11534    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11535        f.write_str(self.as_str())
11536    }
11537}
11538
11539#[cfg(not(feature = "redact-generated-debug"))]
11540impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsPaymentSchedule {
11541    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11542        f.write_str(self.as_str())
11543    }
11544}
11545#[cfg(feature = "redact-generated-debug")]
11546impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsPaymentSchedule {
11547    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11548        f.debug_struct(stringify!(
11549            CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsPaymentSchedule
11550        ))
11551        .finish_non_exhaustive()
11552    }
11553}
11554impl serde::Serialize
11555    for CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsPaymentSchedule
11556{
11557    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11558    where
11559        S: serde::Serializer,
11560    {
11561        serializer.serialize_str(self.as_str())
11562    }
11563}
11564#[cfg(feature = "deserialize")]
11565impl<'de> serde::Deserialize<'de>
11566    for CreateCheckoutSessionPaymentMethodOptionsPixMandateOptionsPaymentSchedule
11567{
11568    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11569        use std::str::FromStr;
11570        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11571        Ok(Self::from_str(&s).expect("infallible"))
11572    }
11573}
11574/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
11575///
11576/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
11577/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
11578///
11579/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
11580///
11581/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
11582#[derive(Clone, Eq, PartialEq)]
11583#[non_exhaustive]
11584pub enum CreateCheckoutSessionPaymentMethodOptionsPixSetupFutureUsage {
11585    None,
11586    OffSession,
11587    /// An unrecognized value from Stripe. Should not be used as a request parameter.
11588    Unknown(String),
11589}
11590impl CreateCheckoutSessionPaymentMethodOptionsPixSetupFutureUsage {
11591    pub fn as_str(&self) -> &str {
11592        use CreateCheckoutSessionPaymentMethodOptionsPixSetupFutureUsage::*;
11593        match self {
11594            None => "none",
11595            OffSession => "off_session",
11596            Unknown(v) => v,
11597        }
11598    }
11599}
11600
11601impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsPixSetupFutureUsage {
11602    type Err = std::convert::Infallible;
11603    fn from_str(s: &str) -> Result<Self, Self::Err> {
11604        use CreateCheckoutSessionPaymentMethodOptionsPixSetupFutureUsage::*;
11605        match s {
11606            "none" => Ok(None),
11607            "off_session" => Ok(OffSession),
11608            v => {
11609                tracing::warn!(
11610                    "Unknown value '{}' for enum '{}'",
11611                    v,
11612                    "CreateCheckoutSessionPaymentMethodOptionsPixSetupFutureUsage"
11613                );
11614                Ok(Unknown(v.to_owned()))
11615            }
11616        }
11617    }
11618}
11619impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsPixSetupFutureUsage {
11620    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11621        f.write_str(self.as_str())
11622    }
11623}
11624
11625#[cfg(not(feature = "redact-generated-debug"))]
11626impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPixSetupFutureUsage {
11627    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11628        f.write_str(self.as_str())
11629    }
11630}
11631#[cfg(feature = "redact-generated-debug")]
11632impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPixSetupFutureUsage {
11633    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11634        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsPixSetupFutureUsage))
11635            .finish_non_exhaustive()
11636    }
11637}
11638impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsPixSetupFutureUsage {
11639    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11640    where
11641        S: serde::Serializer,
11642    {
11643        serializer.serialize_str(self.as_str())
11644    }
11645}
11646#[cfg(feature = "deserialize")]
11647impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionPaymentMethodOptionsPixSetupFutureUsage {
11648    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11649        use std::str::FromStr;
11650        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11651        Ok(Self::from_str(&s).expect("infallible"))
11652    }
11653}
11654/// contains details about the RevolutPay payment method options.
11655#[derive(Clone, Eq, PartialEq)]
11656#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
11657#[derive(serde::Serialize)]
11658pub struct CreateCheckoutSessionPaymentMethodOptionsRevolutPay {
11659    /// Controls when the funds will be captured from the customer's account.
11660    #[serde(skip_serializing_if = "Option::is_none")]
11661    pub capture_method: Option<CreateCheckoutSessionPaymentMethodOptionsRevolutPayCaptureMethod>,
11662    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
11663    ///
11664    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
11665    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
11666    ///
11667    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
11668    ///
11669    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
11670    #[serde(skip_serializing_if = "Option::is_none")]
11671    pub setup_future_usage:
11672        Option<CreateCheckoutSessionPaymentMethodOptionsRevolutPaySetupFutureUsage>,
11673}
11674#[cfg(feature = "redact-generated-debug")]
11675impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsRevolutPay {
11676    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11677        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsRevolutPay")
11678            .finish_non_exhaustive()
11679    }
11680}
11681impl CreateCheckoutSessionPaymentMethodOptionsRevolutPay {
11682    pub fn new() -> Self {
11683        Self { capture_method: None, setup_future_usage: None }
11684    }
11685}
11686impl Default for CreateCheckoutSessionPaymentMethodOptionsRevolutPay {
11687    fn default() -> Self {
11688        Self::new()
11689    }
11690}
11691/// Controls when the funds will be captured from the customer's account.
11692#[derive(Clone, Eq, PartialEq)]
11693#[non_exhaustive]
11694pub enum CreateCheckoutSessionPaymentMethodOptionsRevolutPayCaptureMethod {
11695    Manual,
11696    /// An unrecognized value from Stripe. Should not be used as a request parameter.
11697    Unknown(String),
11698}
11699impl CreateCheckoutSessionPaymentMethodOptionsRevolutPayCaptureMethod {
11700    pub fn as_str(&self) -> &str {
11701        use CreateCheckoutSessionPaymentMethodOptionsRevolutPayCaptureMethod::*;
11702        match self {
11703            Manual => "manual",
11704            Unknown(v) => v,
11705        }
11706    }
11707}
11708
11709impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsRevolutPayCaptureMethod {
11710    type Err = std::convert::Infallible;
11711    fn from_str(s: &str) -> Result<Self, Self::Err> {
11712        use CreateCheckoutSessionPaymentMethodOptionsRevolutPayCaptureMethod::*;
11713        match s {
11714            "manual" => Ok(Manual),
11715            v => {
11716                tracing::warn!(
11717                    "Unknown value '{}' for enum '{}'",
11718                    v,
11719                    "CreateCheckoutSessionPaymentMethodOptionsRevolutPayCaptureMethod"
11720                );
11721                Ok(Unknown(v.to_owned()))
11722            }
11723        }
11724    }
11725}
11726impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsRevolutPayCaptureMethod {
11727    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11728        f.write_str(self.as_str())
11729    }
11730}
11731
11732#[cfg(not(feature = "redact-generated-debug"))]
11733impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsRevolutPayCaptureMethod {
11734    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11735        f.write_str(self.as_str())
11736    }
11737}
11738#[cfg(feature = "redact-generated-debug")]
11739impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsRevolutPayCaptureMethod {
11740    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11741        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsRevolutPayCaptureMethod))
11742            .finish_non_exhaustive()
11743    }
11744}
11745impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsRevolutPayCaptureMethod {
11746    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11747    where
11748        S: serde::Serializer,
11749    {
11750        serializer.serialize_str(self.as_str())
11751    }
11752}
11753#[cfg(feature = "deserialize")]
11754impl<'de> serde::Deserialize<'de>
11755    for CreateCheckoutSessionPaymentMethodOptionsRevolutPayCaptureMethod
11756{
11757    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11758        use std::str::FromStr;
11759        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11760        Ok(Self::from_str(&s).expect("infallible"))
11761    }
11762}
11763/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
11764///
11765/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
11766/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
11767///
11768/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
11769///
11770/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
11771#[derive(Clone, Eq, PartialEq)]
11772#[non_exhaustive]
11773pub enum CreateCheckoutSessionPaymentMethodOptionsRevolutPaySetupFutureUsage {
11774    None,
11775    OffSession,
11776    /// An unrecognized value from Stripe. Should not be used as a request parameter.
11777    Unknown(String),
11778}
11779impl CreateCheckoutSessionPaymentMethodOptionsRevolutPaySetupFutureUsage {
11780    pub fn as_str(&self) -> &str {
11781        use CreateCheckoutSessionPaymentMethodOptionsRevolutPaySetupFutureUsage::*;
11782        match self {
11783            None => "none",
11784            OffSession => "off_session",
11785            Unknown(v) => v,
11786        }
11787    }
11788}
11789
11790impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsRevolutPaySetupFutureUsage {
11791    type Err = std::convert::Infallible;
11792    fn from_str(s: &str) -> Result<Self, Self::Err> {
11793        use CreateCheckoutSessionPaymentMethodOptionsRevolutPaySetupFutureUsage::*;
11794        match s {
11795            "none" => Ok(None),
11796            "off_session" => Ok(OffSession),
11797            v => {
11798                tracing::warn!(
11799                    "Unknown value '{}' for enum '{}'",
11800                    v,
11801                    "CreateCheckoutSessionPaymentMethodOptionsRevolutPaySetupFutureUsage"
11802                );
11803                Ok(Unknown(v.to_owned()))
11804            }
11805        }
11806    }
11807}
11808impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsRevolutPaySetupFutureUsage {
11809    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11810        f.write_str(self.as_str())
11811    }
11812}
11813
11814#[cfg(not(feature = "redact-generated-debug"))]
11815impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsRevolutPaySetupFutureUsage {
11816    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11817        f.write_str(self.as_str())
11818    }
11819}
11820#[cfg(feature = "redact-generated-debug")]
11821impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsRevolutPaySetupFutureUsage {
11822    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11823        f.debug_struct(stringify!(
11824            CreateCheckoutSessionPaymentMethodOptionsRevolutPaySetupFutureUsage
11825        ))
11826        .finish_non_exhaustive()
11827    }
11828}
11829impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsRevolutPaySetupFutureUsage {
11830    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11831    where
11832        S: serde::Serializer,
11833    {
11834        serializer.serialize_str(self.as_str())
11835    }
11836}
11837#[cfg(feature = "deserialize")]
11838impl<'de> serde::Deserialize<'de>
11839    for CreateCheckoutSessionPaymentMethodOptionsRevolutPaySetupFutureUsage
11840{
11841    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11842        use std::str::FromStr;
11843        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11844        Ok(Self::from_str(&s).expect("infallible"))
11845    }
11846}
11847/// contains details about the Samsung Pay payment method options.
11848#[derive(Clone, Eq, PartialEq)]
11849#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
11850#[derive(serde::Serialize)]
11851pub struct CreateCheckoutSessionPaymentMethodOptionsSamsungPay {
11852    /// Controls when the funds will be captured from the customer's account.
11853    #[serde(skip_serializing_if = "Option::is_none")]
11854    pub capture_method: Option<CreateCheckoutSessionPaymentMethodOptionsSamsungPayCaptureMethod>,
11855    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
11856    ///
11857    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
11858    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
11859    ///
11860    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
11861    ///
11862    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
11863    #[serde(skip_serializing_if = "Option::is_none")]
11864    pub setup_future_usage:
11865        Option<CreateCheckoutSessionPaymentMethodOptionsSamsungPaySetupFutureUsage>,
11866}
11867#[cfg(feature = "redact-generated-debug")]
11868impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsSamsungPay {
11869    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11870        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsSamsungPay")
11871            .finish_non_exhaustive()
11872    }
11873}
11874impl CreateCheckoutSessionPaymentMethodOptionsSamsungPay {
11875    pub fn new() -> Self {
11876        Self { capture_method: None, setup_future_usage: None }
11877    }
11878}
11879impl Default for CreateCheckoutSessionPaymentMethodOptionsSamsungPay {
11880    fn default() -> Self {
11881        Self::new()
11882    }
11883}
11884/// Controls when the funds will be captured from the customer's account.
11885#[derive(Clone, Eq, PartialEq)]
11886#[non_exhaustive]
11887pub enum CreateCheckoutSessionPaymentMethodOptionsSamsungPayCaptureMethod {
11888    Manual,
11889    /// An unrecognized value from Stripe. Should not be used as a request parameter.
11890    Unknown(String),
11891}
11892impl CreateCheckoutSessionPaymentMethodOptionsSamsungPayCaptureMethod {
11893    pub fn as_str(&self) -> &str {
11894        use CreateCheckoutSessionPaymentMethodOptionsSamsungPayCaptureMethod::*;
11895        match self {
11896            Manual => "manual",
11897            Unknown(v) => v,
11898        }
11899    }
11900}
11901
11902impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsSamsungPayCaptureMethod {
11903    type Err = std::convert::Infallible;
11904    fn from_str(s: &str) -> Result<Self, Self::Err> {
11905        use CreateCheckoutSessionPaymentMethodOptionsSamsungPayCaptureMethod::*;
11906        match s {
11907            "manual" => Ok(Manual),
11908            v => {
11909                tracing::warn!(
11910                    "Unknown value '{}' for enum '{}'",
11911                    v,
11912                    "CreateCheckoutSessionPaymentMethodOptionsSamsungPayCaptureMethod"
11913                );
11914                Ok(Unknown(v.to_owned()))
11915            }
11916        }
11917    }
11918}
11919impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsSamsungPayCaptureMethod {
11920    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11921        f.write_str(self.as_str())
11922    }
11923}
11924
11925#[cfg(not(feature = "redact-generated-debug"))]
11926impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsSamsungPayCaptureMethod {
11927    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11928        f.write_str(self.as_str())
11929    }
11930}
11931#[cfg(feature = "redact-generated-debug")]
11932impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsSamsungPayCaptureMethod {
11933    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11934        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsSamsungPayCaptureMethod))
11935            .finish_non_exhaustive()
11936    }
11937}
11938impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsSamsungPayCaptureMethod {
11939    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11940    where
11941        S: serde::Serializer,
11942    {
11943        serializer.serialize_str(self.as_str())
11944    }
11945}
11946#[cfg(feature = "deserialize")]
11947impl<'de> serde::Deserialize<'de>
11948    for CreateCheckoutSessionPaymentMethodOptionsSamsungPayCaptureMethod
11949{
11950    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11951        use std::str::FromStr;
11952        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11953        Ok(Self::from_str(&s).expect("infallible"))
11954    }
11955}
11956/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
11957///
11958/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
11959/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
11960///
11961/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
11962///
11963/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
11964#[derive(Clone, Eq, PartialEq)]
11965#[non_exhaustive]
11966pub enum CreateCheckoutSessionPaymentMethodOptionsSamsungPaySetupFutureUsage {
11967    None,
11968    /// An unrecognized value from Stripe. Should not be used as a request parameter.
11969    Unknown(String),
11970}
11971impl CreateCheckoutSessionPaymentMethodOptionsSamsungPaySetupFutureUsage {
11972    pub fn as_str(&self) -> &str {
11973        use CreateCheckoutSessionPaymentMethodOptionsSamsungPaySetupFutureUsage::*;
11974        match self {
11975            None => "none",
11976            Unknown(v) => v,
11977        }
11978    }
11979}
11980
11981impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsSamsungPaySetupFutureUsage {
11982    type Err = std::convert::Infallible;
11983    fn from_str(s: &str) -> Result<Self, Self::Err> {
11984        use CreateCheckoutSessionPaymentMethodOptionsSamsungPaySetupFutureUsage::*;
11985        match s {
11986            "none" => Ok(None),
11987            v => {
11988                tracing::warn!(
11989                    "Unknown value '{}' for enum '{}'",
11990                    v,
11991                    "CreateCheckoutSessionPaymentMethodOptionsSamsungPaySetupFutureUsage"
11992                );
11993                Ok(Unknown(v.to_owned()))
11994            }
11995        }
11996    }
11997}
11998impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsSamsungPaySetupFutureUsage {
11999    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12000        f.write_str(self.as_str())
12001    }
12002}
12003
12004#[cfg(not(feature = "redact-generated-debug"))]
12005impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsSamsungPaySetupFutureUsage {
12006    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12007        f.write_str(self.as_str())
12008    }
12009}
12010#[cfg(feature = "redact-generated-debug")]
12011impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsSamsungPaySetupFutureUsage {
12012    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12013        f.debug_struct(stringify!(
12014            CreateCheckoutSessionPaymentMethodOptionsSamsungPaySetupFutureUsage
12015        ))
12016        .finish_non_exhaustive()
12017    }
12018}
12019impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsSamsungPaySetupFutureUsage {
12020    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12021    where
12022        S: serde::Serializer,
12023    {
12024        serializer.serialize_str(self.as_str())
12025    }
12026}
12027#[cfg(feature = "deserialize")]
12028impl<'de> serde::Deserialize<'de>
12029    for CreateCheckoutSessionPaymentMethodOptionsSamsungPaySetupFutureUsage
12030{
12031    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12032        use std::str::FromStr;
12033        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12034        Ok(Self::from_str(&s).expect("infallible"))
12035    }
12036}
12037/// contains details about the Satispay payment method options.
12038#[derive(Clone, Eq, PartialEq)]
12039#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
12040#[derive(serde::Serialize)]
12041pub struct CreateCheckoutSessionPaymentMethodOptionsSatispay {
12042    /// Controls when the funds will be captured from the customer's account.
12043    #[serde(skip_serializing_if = "Option::is_none")]
12044    pub capture_method: Option<CreateCheckoutSessionPaymentMethodOptionsSatispayCaptureMethod>,
12045}
12046#[cfg(feature = "redact-generated-debug")]
12047impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsSatispay {
12048    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12049        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsSatispay").finish_non_exhaustive()
12050    }
12051}
12052impl CreateCheckoutSessionPaymentMethodOptionsSatispay {
12053    pub fn new() -> Self {
12054        Self { capture_method: None }
12055    }
12056}
12057impl Default for CreateCheckoutSessionPaymentMethodOptionsSatispay {
12058    fn default() -> Self {
12059        Self::new()
12060    }
12061}
12062/// Controls when the funds will be captured from the customer's account.
12063#[derive(Clone, Eq, PartialEq)]
12064#[non_exhaustive]
12065pub enum CreateCheckoutSessionPaymentMethodOptionsSatispayCaptureMethod {
12066    Manual,
12067    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12068    Unknown(String),
12069}
12070impl CreateCheckoutSessionPaymentMethodOptionsSatispayCaptureMethod {
12071    pub fn as_str(&self) -> &str {
12072        use CreateCheckoutSessionPaymentMethodOptionsSatispayCaptureMethod::*;
12073        match self {
12074            Manual => "manual",
12075            Unknown(v) => v,
12076        }
12077    }
12078}
12079
12080impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsSatispayCaptureMethod {
12081    type Err = std::convert::Infallible;
12082    fn from_str(s: &str) -> Result<Self, Self::Err> {
12083        use CreateCheckoutSessionPaymentMethodOptionsSatispayCaptureMethod::*;
12084        match s {
12085            "manual" => Ok(Manual),
12086            v => {
12087                tracing::warn!(
12088                    "Unknown value '{}' for enum '{}'",
12089                    v,
12090                    "CreateCheckoutSessionPaymentMethodOptionsSatispayCaptureMethod"
12091                );
12092                Ok(Unknown(v.to_owned()))
12093            }
12094        }
12095    }
12096}
12097impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsSatispayCaptureMethod {
12098    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12099        f.write_str(self.as_str())
12100    }
12101}
12102
12103#[cfg(not(feature = "redact-generated-debug"))]
12104impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsSatispayCaptureMethod {
12105    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12106        f.write_str(self.as_str())
12107    }
12108}
12109#[cfg(feature = "redact-generated-debug")]
12110impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsSatispayCaptureMethod {
12111    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12112        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsSatispayCaptureMethod))
12113            .finish_non_exhaustive()
12114    }
12115}
12116impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsSatispayCaptureMethod {
12117    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12118    where
12119        S: serde::Serializer,
12120    {
12121        serializer.serialize_str(self.as_str())
12122    }
12123}
12124#[cfg(feature = "deserialize")]
12125impl<'de> serde::Deserialize<'de>
12126    for CreateCheckoutSessionPaymentMethodOptionsSatispayCaptureMethod
12127{
12128    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12129        use std::str::FromStr;
12130        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12131        Ok(Self::from_str(&s).expect("infallible"))
12132    }
12133}
12134/// contains details about the Scalapay payment method options.
12135#[derive(Clone, Eq, PartialEq)]
12136#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
12137#[derive(serde::Serialize)]
12138pub struct CreateCheckoutSessionPaymentMethodOptionsScalapay {
12139    /// Controls when the funds will be captured from the customer's account.
12140    #[serde(skip_serializing_if = "Option::is_none")]
12141    pub capture_method: Option<CreateCheckoutSessionPaymentMethodOptionsScalapayCaptureMethod>,
12142}
12143#[cfg(feature = "redact-generated-debug")]
12144impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsScalapay {
12145    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12146        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsScalapay").finish_non_exhaustive()
12147    }
12148}
12149impl CreateCheckoutSessionPaymentMethodOptionsScalapay {
12150    pub fn new() -> Self {
12151        Self { capture_method: None }
12152    }
12153}
12154impl Default for CreateCheckoutSessionPaymentMethodOptionsScalapay {
12155    fn default() -> Self {
12156        Self::new()
12157    }
12158}
12159/// Controls when the funds will be captured from the customer's account.
12160#[derive(Clone, Eq, PartialEq)]
12161#[non_exhaustive]
12162pub enum CreateCheckoutSessionPaymentMethodOptionsScalapayCaptureMethod {
12163    Manual,
12164    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12165    Unknown(String),
12166}
12167impl CreateCheckoutSessionPaymentMethodOptionsScalapayCaptureMethod {
12168    pub fn as_str(&self) -> &str {
12169        use CreateCheckoutSessionPaymentMethodOptionsScalapayCaptureMethod::*;
12170        match self {
12171            Manual => "manual",
12172            Unknown(v) => v,
12173        }
12174    }
12175}
12176
12177impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsScalapayCaptureMethod {
12178    type Err = std::convert::Infallible;
12179    fn from_str(s: &str) -> Result<Self, Self::Err> {
12180        use CreateCheckoutSessionPaymentMethodOptionsScalapayCaptureMethod::*;
12181        match s {
12182            "manual" => Ok(Manual),
12183            v => {
12184                tracing::warn!(
12185                    "Unknown value '{}' for enum '{}'",
12186                    v,
12187                    "CreateCheckoutSessionPaymentMethodOptionsScalapayCaptureMethod"
12188                );
12189                Ok(Unknown(v.to_owned()))
12190            }
12191        }
12192    }
12193}
12194impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsScalapayCaptureMethod {
12195    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12196        f.write_str(self.as_str())
12197    }
12198}
12199
12200#[cfg(not(feature = "redact-generated-debug"))]
12201impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsScalapayCaptureMethod {
12202    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12203        f.write_str(self.as_str())
12204    }
12205}
12206#[cfg(feature = "redact-generated-debug")]
12207impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsScalapayCaptureMethod {
12208    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12209        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsScalapayCaptureMethod))
12210            .finish_non_exhaustive()
12211    }
12212}
12213impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsScalapayCaptureMethod {
12214    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12215    where
12216        S: serde::Serializer,
12217    {
12218        serializer.serialize_str(self.as_str())
12219    }
12220}
12221#[cfg(feature = "deserialize")]
12222impl<'de> serde::Deserialize<'de>
12223    for CreateCheckoutSessionPaymentMethodOptionsScalapayCaptureMethod
12224{
12225    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12226        use std::str::FromStr;
12227        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12228        Ok(Self::from_str(&s).expect("infallible"))
12229    }
12230}
12231/// contains details about the Sepa Debit payment method options.
12232#[derive(Clone, Eq, PartialEq)]
12233#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
12234#[derive(serde::Serialize)]
12235pub struct CreateCheckoutSessionPaymentMethodOptionsSepaDebit {
12236    /// Additional fields for Mandate creation
12237    #[serde(skip_serializing_if = "Option::is_none")]
12238    pub mandate_options: Option<CreateCheckoutSessionPaymentMethodOptionsSepaDebitMandateOptions>,
12239    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
12240    ///
12241    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
12242    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
12243    ///
12244    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
12245    ///
12246    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
12247    #[serde(skip_serializing_if = "Option::is_none")]
12248    pub setup_future_usage:
12249        Option<CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage>,
12250    /// Controls when Stripe will attempt to debit the funds from the customer's account.
12251    /// The date must be a string in YYYY-MM-DD format.
12252    /// The date must be in the future and between 3 and 15 calendar days from now.
12253    #[serde(skip_serializing_if = "Option::is_none")]
12254    pub target_date: Option<String>,
12255}
12256#[cfg(feature = "redact-generated-debug")]
12257impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsSepaDebit {
12258    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12259        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsSepaDebit").finish_non_exhaustive()
12260    }
12261}
12262impl CreateCheckoutSessionPaymentMethodOptionsSepaDebit {
12263    pub fn new() -> Self {
12264        Self { mandate_options: None, setup_future_usage: None, target_date: None }
12265    }
12266}
12267impl Default for CreateCheckoutSessionPaymentMethodOptionsSepaDebit {
12268    fn default() -> Self {
12269        Self::new()
12270    }
12271}
12272/// Additional fields for Mandate creation
12273#[derive(Clone, Eq, PartialEq)]
12274#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
12275#[derive(serde::Serialize)]
12276pub struct CreateCheckoutSessionPaymentMethodOptionsSepaDebitMandateOptions {
12277    /// Prefix used to generate the Mandate reference.
12278    /// Must be at most 12 characters long.
12279    /// Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'.
12280    /// Cannot begin with 'STRIPE'.
12281    #[serde(skip_serializing_if = "Option::is_none")]
12282    pub reference_prefix: Option<String>,
12283}
12284#[cfg(feature = "redact-generated-debug")]
12285impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsSepaDebitMandateOptions {
12286    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12287        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsSepaDebitMandateOptions")
12288            .finish_non_exhaustive()
12289    }
12290}
12291impl CreateCheckoutSessionPaymentMethodOptionsSepaDebitMandateOptions {
12292    pub fn new() -> Self {
12293        Self { reference_prefix: None }
12294    }
12295}
12296impl Default for CreateCheckoutSessionPaymentMethodOptionsSepaDebitMandateOptions {
12297    fn default() -> Self {
12298        Self::new()
12299    }
12300}
12301/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
12302///
12303/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
12304/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
12305///
12306/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
12307///
12308/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
12309#[derive(Clone, Eq, PartialEq)]
12310#[non_exhaustive]
12311pub enum CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage {
12312    None,
12313    OffSession,
12314    OnSession,
12315    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12316    Unknown(String),
12317}
12318impl CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage {
12319    pub fn as_str(&self) -> &str {
12320        use CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage::*;
12321        match self {
12322            None => "none",
12323            OffSession => "off_session",
12324            OnSession => "on_session",
12325            Unknown(v) => v,
12326        }
12327    }
12328}
12329
12330impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage {
12331    type Err = std::convert::Infallible;
12332    fn from_str(s: &str) -> Result<Self, Self::Err> {
12333        use CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage::*;
12334        match s {
12335            "none" => Ok(None),
12336            "off_session" => Ok(OffSession),
12337            "on_session" => Ok(OnSession),
12338            v => {
12339                tracing::warn!(
12340                    "Unknown value '{}' for enum '{}'",
12341                    v,
12342                    "CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage"
12343                );
12344                Ok(Unknown(v.to_owned()))
12345            }
12346        }
12347    }
12348}
12349impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage {
12350    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12351        f.write_str(self.as_str())
12352    }
12353}
12354
12355#[cfg(not(feature = "redact-generated-debug"))]
12356impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage {
12357    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12358        f.write_str(self.as_str())
12359    }
12360}
12361#[cfg(feature = "redact-generated-debug")]
12362impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage {
12363    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12364        f.debug_struct(stringify!(
12365            CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage
12366        ))
12367        .finish_non_exhaustive()
12368    }
12369}
12370impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage {
12371    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12372    where
12373        S: serde::Serializer,
12374    {
12375        serializer.serialize_str(self.as_str())
12376    }
12377}
12378#[cfg(feature = "deserialize")]
12379impl<'de> serde::Deserialize<'de>
12380    for CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage
12381{
12382    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12383        use std::str::FromStr;
12384        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12385        Ok(Self::from_str(&s).expect("infallible"))
12386    }
12387}
12388/// contains details about the Sofort payment method options.
12389#[derive(Clone, Eq, PartialEq)]
12390#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
12391#[derive(serde::Serialize)]
12392pub struct CreateCheckoutSessionPaymentMethodOptionsSofort {
12393    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
12394    ///
12395    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
12396    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
12397    ///
12398    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
12399    ///
12400    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
12401    #[serde(skip_serializing_if = "Option::is_none")]
12402    pub setup_future_usage: Option<CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage>,
12403}
12404#[cfg(feature = "redact-generated-debug")]
12405impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsSofort {
12406    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12407        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsSofort").finish_non_exhaustive()
12408    }
12409}
12410impl CreateCheckoutSessionPaymentMethodOptionsSofort {
12411    pub fn new() -> Self {
12412        Self { setup_future_usage: None }
12413    }
12414}
12415impl Default for CreateCheckoutSessionPaymentMethodOptionsSofort {
12416    fn default() -> Self {
12417        Self::new()
12418    }
12419}
12420/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
12421///
12422/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
12423/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
12424///
12425/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
12426///
12427/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
12428#[derive(Clone, Eq, PartialEq)]
12429#[non_exhaustive]
12430pub enum CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage {
12431    None,
12432    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12433    Unknown(String),
12434}
12435impl CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage {
12436    pub fn as_str(&self) -> &str {
12437        use CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage::*;
12438        match self {
12439            None => "none",
12440            Unknown(v) => v,
12441        }
12442    }
12443}
12444
12445impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage {
12446    type Err = std::convert::Infallible;
12447    fn from_str(s: &str) -> Result<Self, Self::Err> {
12448        use CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage::*;
12449        match s {
12450            "none" => Ok(None),
12451            v => {
12452                tracing::warn!(
12453                    "Unknown value '{}' for enum '{}'",
12454                    v,
12455                    "CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage"
12456                );
12457                Ok(Unknown(v.to_owned()))
12458            }
12459        }
12460    }
12461}
12462impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage {
12463    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12464        f.write_str(self.as_str())
12465    }
12466}
12467
12468#[cfg(not(feature = "redact-generated-debug"))]
12469impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage {
12470    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12471        f.write_str(self.as_str())
12472    }
12473}
12474#[cfg(feature = "redact-generated-debug")]
12475impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage {
12476    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12477        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage))
12478            .finish_non_exhaustive()
12479    }
12480}
12481impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage {
12482    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12483    where
12484        S: serde::Serializer,
12485    {
12486        serializer.serialize_str(self.as_str())
12487    }
12488}
12489#[cfg(feature = "deserialize")]
12490impl<'de> serde::Deserialize<'de>
12491    for CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage
12492{
12493    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12494        use std::str::FromStr;
12495        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12496        Ok(Self::from_str(&s).expect("infallible"))
12497    }
12498}
12499/// contains details about the Sunbit payment method options.
12500#[derive(Clone, Eq, PartialEq)]
12501#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
12502#[derive(serde::Serialize)]
12503pub struct CreateCheckoutSessionPaymentMethodOptionsSunbit {
12504    /// Controls when the funds will be captured from the customer's account.
12505    #[serde(skip_serializing_if = "Option::is_none")]
12506    pub capture_method: Option<CreateCheckoutSessionPaymentMethodOptionsSunbitCaptureMethod>,
12507    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
12508    ///
12509    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
12510    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
12511    ///
12512    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
12513    ///
12514    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
12515    #[serde(skip_serializing_if = "Option::is_none")]
12516    pub setup_future_usage: Option<CreateCheckoutSessionPaymentMethodOptionsSunbitSetupFutureUsage>,
12517}
12518#[cfg(feature = "redact-generated-debug")]
12519impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsSunbit {
12520    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12521        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsSunbit").finish_non_exhaustive()
12522    }
12523}
12524impl CreateCheckoutSessionPaymentMethodOptionsSunbit {
12525    pub fn new() -> Self {
12526        Self { capture_method: None, setup_future_usage: None }
12527    }
12528}
12529impl Default for CreateCheckoutSessionPaymentMethodOptionsSunbit {
12530    fn default() -> Self {
12531        Self::new()
12532    }
12533}
12534/// Controls when the funds will be captured from the customer's account.
12535#[derive(Clone, Eq, PartialEq)]
12536#[non_exhaustive]
12537pub enum CreateCheckoutSessionPaymentMethodOptionsSunbitCaptureMethod {
12538    Manual,
12539    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12540    Unknown(String),
12541}
12542impl CreateCheckoutSessionPaymentMethodOptionsSunbitCaptureMethod {
12543    pub fn as_str(&self) -> &str {
12544        use CreateCheckoutSessionPaymentMethodOptionsSunbitCaptureMethod::*;
12545        match self {
12546            Manual => "manual",
12547            Unknown(v) => v,
12548        }
12549    }
12550}
12551
12552impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsSunbitCaptureMethod {
12553    type Err = std::convert::Infallible;
12554    fn from_str(s: &str) -> Result<Self, Self::Err> {
12555        use CreateCheckoutSessionPaymentMethodOptionsSunbitCaptureMethod::*;
12556        match s {
12557            "manual" => Ok(Manual),
12558            v => {
12559                tracing::warn!(
12560                    "Unknown value '{}' for enum '{}'",
12561                    v,
12562                    "CreateCheckoutSessionPaymentMethodOptionsSunbitCaptureMethod"
12563                );
12564                Ok(Unknown(v.to_owned()))
12565            }
12566        }
12567    }
12568}
12569impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsSunbitCaptureMethod {
12570    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12571        f.write_str(self.as_str())
12572    }
12573}
12574
12575#[cfg(not(feature = "redact-generated-debug"))]
12576impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsSunbitCaptureMethod {
12577    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12578        f.write_str(self.as_str())
12579    }
12580}
12581#[cfg(feature = "redact-generated-debug")]
12582impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsSunbitCaptureMethod {
12583    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12584        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsSunbitCaptureMethod))
12585            .finish_non_exhaustive()
12586    }
12587}
12588impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsSunbitCaptureMethod {
12589    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12590    where
12591        S: serde::Serializer,
12592    {
12593        serializer.serialize_str(self.as_str())
12594    }
12595}
12596#[cfg(feature = "deserialize")]
12597impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionPaymentMethodOptionsSunbitCaptureMethod {
12598    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12599        use std::str::FromStr;
12600        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12601        Ok(Self::from_str(&s).expect("infallible"))
12602    }
12603}
12604/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
12605///
12606/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
12607/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
12608///
12609/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
12610///
12611/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
12612#[derive(Clone, Eq, PartialEq)]
12613#[non_exhaustive]
12614pub enum CreateCheckoutSessionPaymentMethodOptionsSunbitSetupFutureUsage {
12615    None,
12616    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12617    Unknown(String),
12618}
12619impl CreateCheckoutSessionPaymentMethodOptionsSunbitSetupFutureUsage {
12620    pub fn as_str(&self) -> &str {
12621        use CreateCheckoutSessionPaymentMethodOptionsSunbitSetupFutureUsage::*;
12622        match self {
12623            None => "none",
12624            Unknown(v) => v,
12625        }
12626    }
12627}
12628
12629impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsSunbitSetupFutureUsage {
12630    type Err = std::convert::Infallible;
12631    fn from_str(s: &str) -> Result<Self, Self::Err> {
12632        use CreateCheckoutSessionPaymentMethodOptionsSunbitSetupFutureUsage::*;
12633        match s {
12634            "none" => Ok(None),
12635            v => {
12636                tracing::warn!(
12637                    "Unknown value '{}' for enum '{}'",
12638                    v,
12639                    "CreateCheckoutSessionPaymentMethodOptionsSunbitSetupFutureUsage"
12640                );
12641                Ok(Unknown(v.to_owned()))
12642            }
12643        }
12644    }
12645}
12646impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsSunbitSetupFutureUsage {
12647    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12648        f.write_str(self.as_str())
12649    }
12650}
12651
12652#[cfg(not(feature = "redact-generated-debug"))]
12653impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsSunbitSetupFutureUsage {
12654    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12655        f.write_str(self.as_str())
12656    }
12657}
12658#[cfg(feature = "redact-generated-debug")]
12659impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsSunbitSetupFutureUsage {
12660    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12661        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsSunbitSetupFutureUsage))
12662            .finish_non_exhaustive()
12663    }
12664}
12665impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsSunbitSetupFutureUsage {
12666    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12667    where
12668        S: serde::Serializer,
12669    {
12670        serializer.serialize_str(self.as_str())
12671    }
12672}
12673#[cfg(feature = "deserialize")]
12674impl<'de> serde::Deserialize<'de>
12675    for CreateCheckoutSessionPaymentMethodOptionsSunbitSetupFutureUsage
12676{
12677    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12678        use std::str::FromStr;
12679        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12680        Ok(Self::from_str(&s).expect("infallible"))
12681    }
12682}
12683/// contains details about the Swish payment method options.
12684#[derive(Clone, Eq, PartialEq)]
12685#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
12686#[derive(serde::Serialize)]
12687pub struct CreateCheckoutSessionPaymentMethodOptionsSwish {
12688    /// The order reference that will be displayed to customers in the Swish application.
12689    /// Defaults to the `id` of the Payment Intent.
12690    #[serde(skip_serializing_if = "Option::is_none")]
12691    pub reference: Option<String>,
12692}
12693#[cfg(feature = "redact-generated-debug")]
12694impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsSwish {
12695    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12696        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsSwish").finish_non_exhaustive()
12697    }
12698}
12699impl CreateCheckoutSessionPaymentMethodOptionsSwish {
12700    pub fn new() -> Self {
12701        Self { reference: None }
12702    }
12703}
12704impl Default for CreateCheckoutSessionPaymentMethodOptionsSwish {
12705    fn default() -> Self {
12706        Self::new()
12707    }
12708}
12709/// contains details about the TWINT payment method options.
12710#[derive(Clone, Eq, PartialEq)]
12711#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
12712#[derive(serde::Serialize)]
12713pub struct CreateCheckoutSessionPaymentMethodOptionsTwint {
12714    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
12715    ///
12716    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
12717    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
12718    ///
12719    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
12720    ///
12721    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
12722    #[serde(skip_serializing_if = "Option::is_none")]
12723    pub setup_future_usage: Option<CreateCheckoutSessionPaymentMethodOptionsTwintSetupFutureUsage>,
12724}
12725#[cfg(feature = "redact-generated-debug")]
12726impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsTwint {
12727    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12728        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsTwint").finish_non_exhaustive()
12729    }
12730}
12731impl CreateCheckoutSessionPaymentMethodOptionsTwint {
12732    pub fn new() -> Self {
12733        Self { setup_future_usage: None }
12734    }
12735}
12736impl Default for CreateCheckoutSessionPaymentMethodOptionsTwint {
12737    fn default() -> Self {
12738        Self::new()
12739    }
12740}
12741/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
12742///
12743/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
12744/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
12745///
12746/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
12747///
12748/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
12749#[derive(Clone, Eq, PartialEq)]
12750#[non_exhaustive]
12751pub enum CreateCheckoutSessionPaymentMethodOptionsTwintSetupFutureUsage {
12752    None,
12753    OffSession,
12754    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12755    Unknown(String),
12756}
12757impl CreateCheckoutSessionPaymentMethodOptionsTwintSetupFutureUsage {
12758    pub fn as_str(&self) -> &str {
12759        use CreateCheckoutSessionPaymentMethodOptionsTwintSetupFutureUsage::*;
12760        match self {
12761            None => "none",
12762            OffSession => "off_session",
12763            Unknown(v) => v,
12764        }
12765    }
12766}
12767
12768impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsTwintSetupFutureUsage {
12769    type Err = std::convert::Infallible;
12770    fn from_str(s: &str) -> Result<Self, Self::Err> {
12771        use CreateCheckoutSessionPaymentMethodOptionsTwintSetupFutureUsage::*;
12772        match s {
12773            "none" => Ok(None),
12774            "off_session" => Ok(OffSession),
12775            v => {
12776                tracing::warn!(
12777                    "Unknown value '{}' for enum '{}'",
12778                    v,
12779                    "CreateCheckoutSessionPaymentMethodOptionsTwintSetupFutureUsage"
12780                );
12781                Ok(Unknown(v.to_owned()))
12782            }
12783        }
12784    }
12785}
12786impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsTwintSetupFutureUsage {
12787    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12788        f.write_str(self.as_str())
12789    }
12790}
12791
12792#[cfg(not(feature = "redact-generated-debug"))]
12793impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsTwintSetupFutureUsage {
12794    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12795        f.write_str(self.as_str())
12796    }
12797}
12798#[cfg(feature = "redact-generated-debug")]
12799impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsTwintSetupFutureUsage {
12800    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12801        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsTwintSetupFutureUsage))
12802            .finish_non_exhaustive()
12803    }
12804}
12805impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsTwintSetupFutureUsage {
12806    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12807    where
12808        S: serde::Serializer,
12809    {
12810        serializer.serialize_str(self.as_str())
12811    }
12812}
12813#[cfg(feature = "deserialize")]
12814impl<'de> serde::Deserialize<'de>
12815    for CreateCheckoutSessionPaymentMethodOptionsTwintSetupFutureUsage
12816{
12817    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12818        use std::str::FromStr;
12819        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12820        Ok(Self::from_str(&s).expect("infallible"))
12821    }
12822}
12823/// contains details about the UPI payment method options.
12824#[derive(Clone, Eq, PartialEq)]
12825#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
12826#[derive(serde::Serialize)]
12827pub struct CreateCheckoutSessionPaymentMethodOptionsUpi {
12828    /// Additional fields for Mandate creation
12829    #[serde(skip_serializing_if = "Option::is_none")]
12830    pub mandate_options: Option<CreateCheckoutSessionPaymentMethodOptionsUpiMandateOptions>,
12831    #[serde(skip_serializing_if = "Option::is_none")]
12832    pub setup_future_usage: Option<CreateCheckoutSessionPaymentMethodOptionsUpiSetupFutureUsage>,
12833}
12834#[cfg(feature = "redact-generated-debug")]
12835impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsUpi {
12836    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12837        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsUpi").finish_non_exhaustive()
12838    }
12839}
12840impl CreateCheckoutSessionPaymentMethodOptionsUpi {
12841    pub fn new() -> Self {
12842        Self { mandate_options: None, setup_future_usage: None }
12843    }
12844}
12845impl Default for CreateCheckoutSessionPaymentMethodOptionsUpi {
12846    fn default() -> Self {
12847        Self::new()
12848    }
12849}
12850/// Additional fields for Mandate creation
12851#[derive(Clone, Eq, PartialEq)]
12852#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
12853#[derive(serde::Serialize)]
12854pub struct CreateCheckoutSessionPaymentMethodOptionsUpiMandateOptions {
12855    /// Amount to be charged for future payments.
12856    #[serde(skip_serializing_if = "Option::is_none")]
12857    pub amount: Option<i64>,
12858    /// One of `fixed` or `maximum`.
12859    /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
12860    /// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
12861    #[serde(skip_serializing_if = "Option::is_none")]
12862    pub amount_type: Option<CreateCheckoutSessionPaymentMethodOptionsUpiMandateOptionsAmountType>,
12863    /// A description of the mandate or subscription that is meant to be displayed to the customer.
12864    #[serde(skip_serializing_if = "Option::is_none")]
12865    pub description: Option<String>,
12866    /// End date of the mandate or subscription.
12867    #[serde(skip_serializing_if = "Option::is_none")]
12868    pub end_date: Option<stripe_types::Timestamp>,
12869}
12870#[cfg(feature = "redact-generated-debug")]
12871impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsUpiMandateOptions {
12872    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12873        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsUpiMandateOptions")
12874            .finish_non_exhaustive()
12875    }
12876}
12877impl CreateCheckoutSessionPaymentMethodOptionsUpiMandateOptions {
12878    pub fn new() -> Self {
12879        Self { amount: None, amount_type: None, description: None, end_date: None }
12880    }
12881}
12882impl Default for CreateCheckoutSessionPaymentMethodOptionsUpiMandateOptions {
12883    fn default() -> Self {
12884        Self::new()
12885    }
12886}
12887/// One of `fixed` or `maximum`.
12888/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
12889/// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
12890#[derive(Clone, Eq, PartialEq)]
12891#[non_exhaustive]
12892pub enum CreateCheckoutSessionPaymentMethodOptionsUpiMandateOptionsAmountType {
12893    Fixed,
12894    Maximum,
12895    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12896    Unknown(String),
12897}
12898impl CreateCheckoutSessionPaymentMethodOptionsUpiMandateOptionsAmountType {
12899    pub fn as_str(&self) -> &str {
12900        use CreateCheckoutSessionPaymentMethodOptionsUpiMandateOptionsAmountType::*;
12901        match self {
12902            Fixed => "fixed",
12903            Maximum => "maximum",
12904            Unknown(v) => v,
12905        }
12906    }
12907}
12908
12909impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsUpiMandateOptionsAmountType {
12910    type Err = std::convert::Infallible;
12911    fn from_str(s: &str) -> Result<Self, Self::Err> {
12912        use CreateCheckoutSessionPaymentMethodOptionsUpiMandateOptionsAmountType::*;
12913        match s {
12914            "fixed" => Ok(Fixed),
12915            "maximum" => Ok(Maximum),
12916            v => {
12917                tracing::warn!(
12918                    "Unknown value '{}' for enum '{}'",
12919                    v,
12920                    "CreateCheckoutSessionPaymentMethodOptionsUpiMandateOptionsAmountType"
12921                );
12922                Ok(Unknown(v.to_owned()))
12923            }
12924        }
12925    }
12926}
12927impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsUpiMandateOptionsAmountType {
12928    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12929        f.write_str(self.as_str())
12930    }
12931}
12932
12933#[cfg(not(feature = "redact-generated-debug"))]
12934impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsUpiMandateOptionsAmountType {
12935    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12936        f.write_str(self.as_str())
12937    }
12938}
12939#[cfg(feature = "redact-generated-debug")]
12940impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsUpiMandateOptionsAmountType {
12941    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12942        f.debug_struct(stringify!(
12943            CreateCheckoutSessionPaymentMethodOptionsUpiMandateOptionsAmountType
12944        ))
12945        .finish_non_exhaustive()
12946    }
12947}
12948impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsUpiMandateOptionsAmountType {
12949    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12950    where
12951        S: serde::Serializer,
12952    {
12953        serializer.serialize_str(self.as_str())
12954    }
12955}
12956#[cfg(feature = "deserialize")]
12957impl<'de> serde::Deserialize<'de>
12958    for CreateCheckoutSessionPaymentMethodOptionsUpiMandateOptionsAmountType
12959{
12960    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12961        use std::str::FromStr;
12962        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12963        Ok(Self::from_str(&s).expect("infallible"))
12964    }
12965}
12966#[derive(Clone, Eq, PartialEq)]
12967#[non_exhaustive]
12968pub enum CreateCheckoutSessionPaymentMethodOptionsUpiSetupFutureUsage {
12969    None,
12970    OffSession,
12971    OnSession,
12972    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12973    Unknown(String),
12974}
12975impl CreateCheckoutSessionPaymentMethodOptionsUpiSetupFutureUsage {
12976    pub fn as_str(&self) -> &str {
12977        use CreateCheckoutSessionPaymentMethodOptionsUpiSetupFutureUsage::*;
12978        match self {
12979            None => "none",
12980            OffSession => "off_session",
12981            OnSession => "on_session",
12982            Unknown(v) => v,
12983        }
12984    }
12985}
12986
12987impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsUpiSetupFutureUsage {
12988    type Err = std::convert::Infallible;
12989    fn from_str(s: &str) -> Result<Self, Self::Err> {
12990        use CreateCheckoutSessionPaymentMethodOptionsUpiSetupFutureUsage::*;
12991        match s {
12992            "none" => Ok(None),
12993            "off_session" => Ok(OffSession),
12994            "on_session" => Ok(OnSession),
12995            v => {
12996                tracing::warn!(
12997                    "Unknown value '{}' for enum '{}'",
12998                    v,
12999                    "CreateCheckoutSessionPaymentMethodOptionsUpiSetupFutureUsage"
13000                );
13001                Ok(Unknown(v.to_owned()))
13002            }
13003        }
13004    }
13005}
13006impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsUpiSetupFutureUsage {
13007    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13008        f.write_str(self.as_str())
13009    }
13010}
13011
13012#[cfg(not(feature = "redact-generated-debug"))]
13013impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsUpiSetupFutureUsage {
13014    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13015        f.write_str(self.as_str())
13016    }
13017}
13018#[cfg(feature = "redact-generated-debug")]
13019impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsUpiSetupFutureUsage {
13020    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13021        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsUpiSetupFutureUsage))
13022            .finish_non_exhaustive()
13023    }
13024}
13025impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsUpiSetupFutureUsage {
13026    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13027    where
13028        S: serde::Serializer,
13029    {
13030        serializer.serialize_str(self.as_str())
13031    }
13032}
13033#[cfg(feature = "deserialize")]
13034impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionPaymentMethodOptionsUpiSetupFutureUsage {
13035    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13036        use std::str::FromStr;
13037        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13038        Ok(Self::from_str(&s).expect("infallible"))
13039    }
13040}
13041/// contains details about the Us Bank Account payment method options.
13042#[derive(Clone, Eq, PartialEq)]
13043#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
13044#[derive(serde::Serialize)]
13045pub struct CreateCheckoutSessionPaymentMethodOptionsUsBankAccount {
13046    /// Additional fields for Financial Connections Session creation
13047    #[serde(skip_serializing_if = "Option::is_none")]
13048    pub financial_connections:
13049        Option<CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnections>,
13050    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
13051    ///
13052    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
13053    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
13054    ///
13055    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
13056    ///
13057    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
13058    #[serde(skip_serializing_if = "Option::is_none")]
13059    pub setup_future_usage:
13060        Option<CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage>,
13061    /// Controls when Stripe will attempt to debit the funds from the customer's account.
13062    /// The date must be a string in YYYY-MM-DD format.
13063    /// The date must be in the future and between 3 and 15 calendar days from now.
13064    #[serde(skip_serializing_if = "Option::is_none")]
13065    pub target_date: Option<String>,
13066    /// Verification method for the intent
13067    #[serde(skip_serializing_if = "Option::is_none")]
13068    pub verification_method:
13069        Option<CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod>,
13070}
13071#[cfg(feature = "redact-generated-debug")]
13072impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsUsBankAccount {
13073    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13074        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsUsBankAccount")
13075            .finish_non_exhaustive()
13076    }
13077}
13078impl CreateCheckoutSessionPaymentMethodOptionsUsBankAccount {
13079    pub fn new() -> Self {
13080        Self {
13081            financial_connections: None,
13082            setup_future_usage: None,
13083            target_date: None,
13084            verification_method: None,
13085        }
13086    }
13087}
13088impl Default for CreateCheckoutSessionPaymentMethodOptionsUsBankAccount {
13089    fn default() -> Self {
13090        Self::new()
13091    }
13092}
13093/// Additional fields for Financial Connections Session creation
13094#[derive(Clone, Eq, PartialEq)]
13095#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
13096#[derive(serde::Serialize)]
13097pub struct CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnections {
13098    /// The list of permissions to request.
13099    /// If this parameter is passed, the `payment_method` permission must be included.
13100    /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
13101    #[serde(skip_serializing_if = "Option::is_none")]
13102    pub permissions: Option<
13103        Vec<CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
13104    >,
13105    /// List of data features that you would like to retrieve upon account creation.
13106    #[serde(skip_serializing_if = "Option::is_none")]
13107    pub prefetch: Option<
13108        Vec<CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>,
13109    >,
13110}
13111#[cfg(feature = "redact-generated-debug")]
13112impl std::fmt::Debug
13113    for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnections
13114{
13115    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13116        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnections")
13117            .finish_non_exhaustive()
13118    }
13119}
13120impl CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnections {
13121    pub fn new() -> Self {
13122        Self { permissions: None, prefetch: None }
13123    }
13124}
13125impl Default for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnections {
13126    fn default() -> Self {
13127        Self::new()
13128    }
13129}
13130/// The list of permissions to request.
13131/// If this parameter is passed, the `payment_method` permission must be included.
13132/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
13133#[derive(Clone, Eq, PartialEq)]
13134#[non_exhaustive]
13135pub enum CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
13136    Balances,
13137    Ownership,
13138    PaymentMethod,
13139    Transactions,
13140    /// An unrecognized value from Stripe. Should not be used as a request parameter.
13141    Unknown(String),
13142}
13143impl CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
13144    pub fn as_str(&self) -> &str {
13145        use CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
13146        match self {
13147            Balances => "balances",
13148            Ownership => "ownership",
13149            PaymentMethod => "payment_method",
13150            Transactions => "transactions",
13151            Unknown(v) => v,
13152        }
13153    }
13154}
13155
13156impl std::str::FromStr
13157    for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
13158{
13159    type Err = std::convert::Infallible;
13160    fn from_str(s: &str) -> Result<Self, Self::Err> {
13161        use CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
13162        match s {
13163            "balances" => Ok(Balances),
13164            "ownership" => Ok(Ownership),
13165            "payment_method" => Ok(PaymentMethod),
13166            "transactions" => Ok(Transactions),
13167            v => {
13168                tracing::warn!(
13169                    "Unknown value '{}' for enum '{}'",
13170                    v,
13171                    "CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"
13172                );
13173                Ok(Unknown(v.to_owned()))
13174            }
13175        }
13176    }
13177}
13178impl std::fmt::Display
13179    for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
13180{
13181    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13182        f.write_str(self.as_str())
13183    }
13184}
13185
13186#[cfg(not(feature = "redact-generated-debug"))]
13187impl std::fmt::Debug
13188    for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
13189{
13190    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13191        f.write_str(self.as_str())
13192    }
13193}
13194#[cfg(feature = "redact-generated-debug")]
13195impl std::fmt::Debug
13196    for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
13197{
13198    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13199        f.debug_struct(stringify!(
13200            CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
13201        ))
13202        .finish_non_exhaustive()
13203    }
13204}
13205impl serde::Serialize
13206    for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
13207{
13208    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13209    where
13210        S: serde::Serializer,
13211    {
13212        serializer.serialize_str(self.as_str())
13213    }
13214}
13215#[cfg(feature = "deserialize")]
13216impl<'de> serde::Deserialize<'de>
13217    for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
13218{
13219    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13220        use std::str::FromStr;
13221        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13222        Ok(Self::from_str(&s).expect("infallible"))
13223    }
13224}
13225/// List of data features that you would like to retrieve upon account creation.
13226#[derive(Clone, Eq, PartialEq)]
13227#[non_exhaustive]
13228pub enum CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
13229    Balances,
13230    Ownership,
13231    Transactions,
13232    /// An unrecognized value from Stripe. Should not be used as a request parameter.
13233    Unknown(String),
13234}
13235impl CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
13236    pub fn as_str(&self) -> &str {
13237        use CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
13238        match self {
13239            Balances => "balances",
13240            Ownership => "ownership",
13241            Transactions => "transactions",
13242            Unknown(v) => v,
13243        }
13244    }
13245}
13246
13247impl std::str::FromStr
13248    for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
13249{
13250    type Err = std::convert::Infallible;
13251    fn from_str(s: &str) -> Result<Self, Self::Err> {
13252        use CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
13253        match s {
13254            "balances" => Ok(Balances),
13255            "ownership" => Ok(Ownership),
13256            "transactions" => Ok(Transactions),
13257            v => {
13258                tracing::warn!(
13259                    "Unknown value '{}' for enum '{}'",
13260                    v,
13261                    "CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"
13262                );
13263                Ok(Unknown(v.to_owned()))
13264            }
13265        }
13266    }
13267}
13268impl std::fmt::Display
13269    for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
13270{
13271    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13272        f.write_str(self.as_str())
13273    }
13274}
13275
13276#[cfg(not(feature = "redact-generated-debug"))]
13277impl std::fmt::Debug
13278    for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
13279{
13280    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13281        f.write_str(self.as_str())
13282    }
13283}
13284#[cfg(feature = "redact-generated-debug")]
13285impl std::fmt::Debug
13286    for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
13287{
13288    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13289        f.debug_struct(stringify!(
13290            CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
13291        ))
13292        .finish_non_exhaustive()
13293    }
13294}
13295impl serde::Serialize
13296    for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
13297{
13298    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13299    where
13300        S: serde::Serializer,
13301    {
13302        serializer.serialize_str(self.as_str())
13303    }
13304}
13305#[cfg(feature = "deserialize")]
13306impl<'de> serde::Deserialize<'de>
13307    for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
13308{
13309    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13310        use std::str::FromStr;
13311        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13312        Ok(Self::from_str(&s).expect("infallible"))
13313    }
13314}
13315/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
13316///
13317/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
13318/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
13319///
13320/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
13321///
13322/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
13323#[derive(Clone, Eq, PartialEq)]
13324#[non_exhaustive]
13325pub enum CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage {
13326    None,
13327    OffSession,
13328    OnSession,
13329    /// An unrecognized value from Stripe. Should not be used as a request parameter.
13330    Unknown(String),
13331}
13332impl CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage {
13333    pub fn as_str(&self) -> &str {
13334        use CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage::*;
13335        match self {
13336            None => "none",
13337            OffSession => "off_session",
13338            OnSession => "on_session",
13339            Unknown(v) => v,
13340        }
13341    }
13342}
13343
13344impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage {
13345    type Err = std::convert::Infallible;
13346    fn from_str(s: &str) -> Result<Self, Self::Err> {
13347        use CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage::*;
13348        match s {
13349            "none" => Ok(None),
13350            "off_session" => Ok(OffSession),
13351            "on_session" => Ok(OnSession),
13352            v => {
13353                tracing::warn!(
13354                    "Unknown value '{}' for enum '{}'",
13355                    v,
13356                    "CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage"
13357                );
13358                Ok(Unknown(v.to_owned()))
13359            }
13360        }
13361    }
13362}
13363impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage {
13364    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13365        f.write_str(self.as_str())
13366    }
13367}
13368
13369#[cfg(not(feature = "redact-generated-debug"))]
13370impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage {
13371    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13372        f.write_str(self.as_str())
13373    }
13374}
13375#[cfg(feature = "redact-generated-debug")]
13376impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage {
13377    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13378        f.debug_struct(stringify!(
13379            CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage
13380        ))
13381        .finish_non_exhaustive()
13382    }
13383}
13384impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage {
13385    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13386    where
13387        S: serde::Serializer,
13388    {
13389        serializer.serialize_str(self.as_str())
13390    }
13391}
13392#[cfg(feature = "deserialize")]
13393impl<'de> serde::Deserialize<'de>
13394    for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage
13395{
13396    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13397        use std::str::FromStr;
13398        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13399        Ok(Self::from_str(&s).expect("infallible"))
13400    }
13401}
13402/// Verification method for the intent
13403#[derive(Clone, Eq, PartialEq)]
13404#[non_exhaustive]
13405pub enum CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod {
13406    Automatic,
13407    Instant,
13408    /// An unrecognized value from Stripe. Should not be used as a request parameter.
13409    Unknown(String),
13410}
13411impl CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod {
13412    pub fn as_str(&self) -> &str {
13413        use CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod::*;
13414        match self {
13415            Automatic => "automatic",
13416            Instant => "instant",
13417            Unknown(v) => v,
13418        }
13419    }
13420}
13421
13422impl std::str::FromStr
13423    for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod
13424{
13425    type Err = std::convert::Infallible;
13426    fn from_str(s: &str) -> Result<Self, Self::Err> {
13427        use CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod::*;
13428        match s {
13429            "automatic" => Ok(Automatic),
13430            "instant" => Ok(Instant),
13431            v => {
13432                tracing::warn!(
13433                    "Unknown value '{}' for enum '{}'",
13434                    v,
13435                    "CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod"
13436                );
13437                Ok(Unknown(v.to_owned()))
13438            }
13439        }
13440    }
13441}
13442impl std::fmt::Display
13443    for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod
13444{
13445    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13446        f.write_str(self.as_str())
13447    }
13448}
13449
13450#[cfg(not(feature = "redact-generated-debug"))]
13451impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod {
13452    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13453        f.write_str(self.as_str())
13454    }
13455}
13456#[cfg(feature = "redact-generated-debug")]
13457impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod {
13458    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13459        f.debug_struct(stringify!(
13460            CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod
13461        ))
13462        .finish_non_exhaustive()
13463    }
13464}
13465impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod {
13466    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13467    where
13468        S: serde::Serializer,
13469    {
13470        serializer.serialize_str(self.as_str())
13471    }
13472}
13473#[cfg(feature = "deserialize")]
13474impl<'de> serde::Deserialize<'de>
13475    for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod
13476{
13477    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13478        use std::str::FromStr;
13479        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13480        Ok(Self::from_str(&s).expect("infallible"))
13481    }
13482}
13483/// contains details about the WeChat Pay payment method options.
13484#[derive(Clone, Eq, PartialEq)]
13485#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
13486#[derive(serde::Serialize)]
13487pub struct CreateCheckoutSessionPaymentMethodOptionsWechatPay {
13488    /// The app ID registered with WeChat Pay. Only required when client is ios or android.
13489    #[serde(skip_serializing_if = "Option::is_none")]
13490    pub app_id: Option<String>,
13491    /// The client type that the end customer will pay from
13492    pub client: CreateCheckoutSessionPaymentMethodOptionsWechatPayClient,
13493    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
13494    ///
13495    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
13496    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
13497    ///
13498    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
13499    ///
13500    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
13501    #[serde(skip_serializing_if = "Option::is_none")]
13502    pub setup_future_usage:
13503        Option<CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage>,
13504}
13505#[cfg(feature = "redact-generated-debug")]
13506impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsWechatPay {
13507    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13508        f.debug_struct("CreateCheckoutSessionPaymentMethodOptionsWechatPay").finish_non_exhaustive()
13509    }
13510}
13511impl CreateCheckoutSessionPaymentMethodOptionsWechatPay {
13512    pub fn new(
13513        client: impl Into<CreateCheckoutSessionPaymentMethodOptionsWechatPayClient>,
13514    ) -> Self {
13515        Self { app_id: None, client: client.into(), setup_future_usage: None }
13516    }
13517}
13518/// The client type that the end customer will pay from
13519#[derive(Clone, Eq, PartialEq)]
13520#[non_exhaustive]
13521pub enum CreateCheckoutSessionPaymentMethodOptionsWechatPayClient {
13522    Android,
13523    Ios,
13524    Web,
13525    /// An unrecognized value from Stripe. Should not be used as a request parameter.
13526    Unknown(String),
13527}
13528impl CreateCheckoutSessionPaymentMethodOptionsWechatPayClient {
13529    pub fn as_str(&self) -> &str {
13530        use CreateCheckoutSessionPaymentMethodOptionsWechatPayClient::*;
13531        match self {
13532            Android => "android",
13533            Ios => "ios",
13534            Web => "web",
13535            Unknown(v) => v,
13536        }
13537    }
13538}
13539
13540impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsWechatPayClient {
13541    type Err = std::convert::Infallible;
13542    fn from_str(s: &str) -> Result<Self, Self::Err> {
13543        use CreateCheckoutSessionPaymentMethodOptionsWechatPayClient::*;
13544        match s {
13545            "android" => Ok(Android),
13546            "ios" => Ok(Ios),
13547            "web" => Ok(Web),
13548            v => {
13549                tracing::warn!(
13550                    "Unknown value '{}' for enum '{}'",
13551                    v,
13552                    "CreateCheckoutSessionPaymentMethodOptionsWechatPayClient"
13553                );
13554                Ok(Unknown(v.to_owned()))
13555            }
13556        }
13557    }
13558}
13559impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsWechatPayClient {
13560    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13561        f.write_str(self.as_str())
13562    }
13563}
13564
13565#[cfg(not(feature = "redact-generated-debug"))]
13566impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsWechatPayClient {
13567    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13568        f.write_str(self.as_str())
13569    }
13570}
13571#[cfg(feature = "redact-generated-debug")]
13572impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsWechatPayClient {
13573    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13574        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodOptionsWechatPayClient))
13575            .finish_non_exhaustive()
13576    }
13577}
13578impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsWechatPayClient {
13579    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13580    where
13581        S: serde::Serializer,
13582    {
13583        serializer.serialize_str(self.as_str())
13584    }
13585}
13586#[cfg(feature = "deserialize")]
13587impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionPaymentMethodOptionsWechatPayClient {
13588    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13589        use std::str::FromStr;
13590        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13591        Ok(Self::from_str(&s).expect("infallible"))
13592    }
13593}
13594/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
13595///
13596/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
13597/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
13598///
13599/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
13600///
13601/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
13602#[derive(Clone, Eq, PartialEq)]
13603#[non_exhaustive]
13604pub enum CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage {
13605    None,
13606    /// An unrecognized value from Stripe. Should not be used as a request parameter.
13607    Unknown(String),
13608}
13609impl CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage {
13610    pub fn as_str(&self) -> &str {
13611        use CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage::*;
13612        match self {
13613            None => "none",
13614            Unknown(v) => v,
13615        }
13616    }
13617}
13618
13619impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage {
13620    type Err = std::convert::Infallible;
13621    fn from_str(s: &str) -> Result<Self, Self::Err> {
13622        use CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage::*;
13623        match s {
13624            "none" => Ok(None),
13625            v => {
13626                tracing::warn!(
13627                    "Unknown value '{}' for enum '{}'",
13628                    v,
13629                    "CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage"
13630                );
13631                Ok(Unknown(v.to_owned()))
13632            }
13633        }
13634    }
13635}
13636impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage {
13637    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13638        f.write_str(self.as_str())
13639    }
13640}
13641
13642#[cfg(not(feature = "redact-generated-debug"))]
13643impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage {
13644    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13645        f.write_str(self.as_str())
13646    }
13647}
13648#[cfg(feature = "redact-generated-debug")]
13649impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage {
13650    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13651        f.debug_struct(stringify!(
13652            CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage
13653        ))
13654        .finish_non_exhaustive()
13655    }
13656}
13657impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage {
13658    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13659    where
13660        S: serde::Serializer,
13661    {
13662        serializer.serialize_str(self.as_str())
13663    }
13664}
13665#[cfg(feature = "deserialize")]
13666impl<'de> serde::Deserialize<'de>
13667    for CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage
13668{
13669    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13670        use std::str::FromStr;
13671        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13672        Ok(Self::from_str(&s).expect("infallible"))
13673    }
13674}
13675/// A list of the types of payment methods (e.g., `card`) this Checkout Session can accept.
13676///
13677/// You can omit this attribute to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods).
13678/// See [Dynamic Payment Methods](https://docs.stripe.com/payments/payment-methods/integration-options#using-dynamic-payment-methods) for more details.
13679///
13680/// Read more about the supported payment methods and their requirements in our [payment
13681/// method details guide](/docs/payments/checkout/payment-methods).
13682///
13683/// If multiple payment methods are passed, Checkout will dynamically reorder them to
13684/// prioritize the most relevant payment methods based on the customer's location and
13685/// other characteristics.
13686#[derive(Clone, Eq, PartialEq)]
13687#[non_exhaustive]
13688pub enum CreateCheckoutSessionPaymentMethodTypes {
13689    AcssDebit,
13690    Affirm,
13691    AfterpayClearpay,
13692    Alipay,
13693    Alma,
13694    AmazonPay,
13695    AuBecsDebit,
13696    BacsDebit,
13697    Bancontact,
13698    Billie,
13699    Bizum,
13700    Blik,
13701    Boleto,
13702    Card,
13703    Cashapp,
13704    Crypto,
13705    CustomerBalance,
13706    Eps,
13707    Fpx,
13708    Giropay,
13709    Grabpay,
13710    Ideal,
13711    KakaoPay,
13712    Klarna,
13713    Konbini,
13714    KrCard,
13715    Link,
13716    MbWay,
13717    Mobilepay,
13718    Multibanco,
13719    NaverPay,
13720    NzBankAccount,
13721    Oxxo,
13722    P24,
13723    PayByBank,
13724    Payco,
13725    Paynow,
13726    Paypal,
13727    Payto,
13728    Pix,
13729    Promptpay,
13730    RevolutPay,
13731    SamsungPay,
13732    Satispay,
13733    Scalapay,
13734    SepaDebit,
13735    Sofort,
13736    Sunbit,
13737    Swish,
13738    Twint,
13739    Upi,
13740    UsBankAccount,
13741    WechatPay,
13742    Zip,
13743    /// An unrecognized value from Stripe. Should not be used as a request parameter.
13744    Unknown(String),
13745}
13746impl CreateCheckoutSessionPaymentMethodTypes {
13747    pub fn as_str(&self) -> &str {
13748        use CreateCheckoutSessionPaymentMethodTypes::*;
13749        match self {
13750            AcssDebit => "acss_debit",
13751            Affirm => "affirm",
13752            AfterpayClearpay => "afterpay_clearpay",
13753            Alipay => "alipay",
13754            Alma => "alma",
13755            AmazonPay => "amazon_pay",
13756            AuBecsDebit => "au_becs_debit",
13757            BacsDebit => "bacs_debit",
13758            Bancontact => "bancontact",
13759            Billie => "billie",
13760            Bizum => "bizum",
13761            Blik => "blik",
13762            Boleto => "boleto",
13763            Card => "card",
13764            Cashapp => "cashapp",
13765            Crypto => "crypto",
13766            CustomerBalance => "customer_balance",
13767            Eps => "eps",
13768            Fpx => "fpx",
13769            Giropay => "giropay",
13770            Grabpay => "grabpay",
13771            Ideal => "ideal",
13772            KakaoPay => "kakao_pay",
13773            Klarna => "klarna",
13774            Konbini => "konbini",
13775            KrCard => "kr_card",
13776            Link => "link",
13777            MbWay => "mb_way",
13778            Mobilepay => "mobilepay",
13779            Multibanco => "multibanco",
13780            NaverPay => "naver_pay",
13781            NzBankAccount => "nz_bank_account",
13782            Oxxo => "oxxo",
13783            P24 => "p24",
13784            PayByBank => "pay_by_bank",
13785            Payco => "payco",
13786            Paynow => "paynow",
13787            Paypal => "paypal",
13788            Payto => "payto",
13789            Pix => "pix",
13790            Promptpay => "promptpay",
13791            RevolutPay => "revolut_pay",
13792            SamsungPay => "samsung_pay",
13793            Satispay => "satispay",
13794            Scalapay => "scalapay",
13795            SepaDebit => "sepa_debit",
13796            Sofort => "sofort",
13797            Sunbit => "sunbit",
13798            Swish => "swish",
13799            Twint => "twint",
13800            Upi => "upi",
13801            UsBankAccount => "us_bank_account",
13802            WechatPay => "wechat_pay",
13803            Zip => "zip",
13804            Unknown(v) => v,
13805        }
13806    }
13807}
13808
13809impl std::str::FromStr for CreateCheckoutSessionPaymentMethodTypes {
13810    type Err = std::convert::Infallible;
13811    fn from_str(s: &str) -> Result<Self, Self::Err> {
13812        use CreateCheckoutSessionPaymentMethodTypes::*;
13813        match s {
13814            "acss_debit" => Ok(AcssDebit),
13815            "affirm" => Ok(Affirm),
13816            "afterpay_clearpay" => Ok(AfterpayClearpay),
13817            "alipay" => Ok(Alipay),
13818            "alma" => Ok(Alma),
13819            "amazon_pay" => Ok(AmazonPay),
13820            "au_becs_debit" => Ok(AuBecsDebit),
13821            "bacs_debit" => Ok(BacsDebit),
13822            "bancontact" => Ok(Bancontact),
13823            "billie" => Ok(Billie),
13824            "bizum" => Ok(Bizum),
13825            "blik" => Ok(Blik),
13826            "boleto" => Ok(Boleto),
13827            "card" => Ok(Card),
13828            "cashapp" => Ok(Cashapp),
13829            "crypto" => Ok(Crypto),
13830            "customer_balance" => Ok(CustomerBalance),
13831            "eps" => Ok(Eps),
13832            "fpx" => Ok(Fpx),
13833            "giropay" => Ok(Giropay),
13834            "grabpay" => Ok(Grabpay),
13835            "ideal" => Ok(Ideal),
13836            "kakao_pay" => Ok(KakaoPay),
13837            "klarna" => Ok(Klarna),
13838            "konbini" => Ok(Konbini),
13839            "kr_card" => Ok(KrCard),
13840            "link" => Ok(Link),
13841            "mb_way" => Ok(MbWay),
13842            "mobilepay" => Ok(Mobilepay),
13843            "multibanco" => Ok(Multibanco),
13844            "naver_pay" => Ok(NaverPay),
13845            "nz_bank_account" => Ok(NzBankAccount),
13846            "oxxo" => Ok(Oxxo),
13847            "p24" => Ok(P24),
13848            "pay_by_bank" => Ok(PayByBank),
13849            "payco" => Ok(Payco),
13850            "paynow" => Ok(Paynow),
13851            "paypal" => Ok(Paypal),
13852            "payto" => Ok(Payto),
13853            "pix" => Ok(Pix),
13854            "promptpay" => Ok(Promptpay),
13855            "revolut_pay" => Ok(RevolutPay),
13856            "samsung_pay" => Ok(SamsungPay),
13857            "satispay" => Ok(Satispay),
13858            "scalapay" => Ok(Scalapay),
13859            "sepa_debit" => Ok(SepaDebit),
13860            "sofort" => Ok(Sofort),
13861            "sunbit" => Ok(Sunbit),
13862            "swish" => Ok(Swish),
13863            "twint" => Ok(Twint),
13864            "upi" => Ok(Upi),
13865            "us_bank_account" => Ok(UsBankAccount),
13866            "wechat_pay" => Ok(WechatPay),
13867            "zip" => Ok(Zip),
13868            v => {
13869                tracing::warn!(
13870                    "Unknown value '{}' for enum '{}'",
13871                    v,
13872                    "CreateCheckoutSessionPaymentMethodTypes"
13873                );
13874                Ok(Unknown(v.to_owned()))
13875            }
13876        }
13877    }
13878}
13879impl std::fmt::Display for CreateCheckoutSessionPaymentMethodTypes {
13880    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13881        f.write_str(self.as_str())
13882    }
13883}
13884
13885#[cfg(not(feature = "redact-generated-debug"))]
13886impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodTypes {
13887    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13888        f.write_str(self.as_str())
13889    }
13890}
13891#[cfg(feature = "redact-generated-debug")]
13892impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodTypes {
13893    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13894        f.debug_struct(stringify!(CreateCheckoutSessionPaymentMethodTypes)).finish_non_exhaustive()
13895    }
13896}
13897impl serde::Serialize for CreateCheckoutSessionPaymentMethodTypes {
13898    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13899    where
13900        S: serde::Serializer,
13901    {
13902        serializer.serialize_str(self.as_str())
13903    }
13904}
13905#[cfg(feature = "deserialize")]
13906impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionPaymentMethodTypes {
13907    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13908        use std::str::FromStr;
13909        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13910        Ok(Self::from_str(&s).expect("infallible"))
13911    }
13912}
13913/// This property is used to set up permissions for various actions (e.g., update) on the CheckoutSession object.
13914/// Can only be set when creating `embedded` or `custom` sessions.
13915///
13916/// For specific permissions, please refer to their dedicated subsections, such as `permissions.update_shipping_details`.
13917#[derive(Clone, Eq, PartialEq)]
13918#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
13919#[derive(serde::Serialize)]
13920pub struct CreateCheckoutSessionPermissions {
13921    /// Determines which entity is allowed to update the shipping details.
13922    ///
13923    /// Default is `client_only`.
13924    /// Stripe Checkout client will automatically update the shipping details.
13925    /// If set to `server_only`, only your server is allowed to update the shipping details.
13926    ///
13927    /// When set to `server_only`, you must add the onShippingDetailsChange event handler when initializing the Stripe Checkout client and manually update the shipping details from your server using the Stripe API.
13928    #[serde(skip_serializing_if = "Option::is_none")]
13929    pub update_shipping_details: Option<CreateCheckoutSessionPermissionsUpdateShippingDetails>,
13930}
13931#[cfg(feature = "redact-generated-debug")]
13932impl std::fmt::Debug for CreateCheckoutSessionPermissions {
13933    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13934        f.debug_struct("CreateCheckoutSessionPermissions").finish_non_exhaustive()
13935    }
13936}
13937impl CreateCheckoutSessionPermissions {
13938    pub fn new() -> Self {
13939        Self { update_shipping_details: None }
13940    }
13941}
13942impl Default for CreateCheckoutSessionPermissions {
13943    fn default() -> Self {
13944        Self::new()
13945    }
13946}
13947/// Determines which entity is allowed to update the shipping details.
13948///
13949/// Default is `client_only`.
13950/// Stripe Checkout client will automatically update the shipping details.
13951/// If set to `server_only`, only your server is allowed to update the shipping details.
13952///
13953/// When set to `server_only`, you must add the onShippingDetailsChange event handler when initializing the Stripe Checkout client and manually update the shipping details from your server using the Stripe API.
13954#[derive(Clone, Eq, PartialEq)]
13955#[non_exhaustive]
13956pub enum CreateCheckoutSessionPermissionsUpdateShippingDetails {
13957    ClientOnly,
13958    ServerOnly,
13959    /// An unrecognized value from Stripe. Should not be used as a request parameter.
13960    Unknown(String),
13961}
13962impl CreateCheckoutSessionPermissionsUpdateShippingDetails {
13963    pub fn as_str(&self) -> &str {
13964        use CreateCheckoutSessionPermissionsUpdateShippingDetails::*;
13965        match self {
13966            ClientOnly => "client_only",
13967            ServerOnly => "server_only",
13968            Unknown(v) => v,
13969        }
13970    }
13971}
13972
13973impl std::str::FromStr for CreateCheckoutSessionPermissionsUpdateShippingDetails {
13974    type Err = std::convert::Infallible;
13975    fn from_str(s: &str) -> Result<Self, Self::Err> {
13976        use CreateCheckoutSessionPermissionsUpdateShippingDetails::*;
13977        match s {
13978            "client_only" => Ok(ClientOnly),
13979            "server_only" => Ok(ServerOnly),
13980            v => {
13981                tracing::warn!(
13982                    "Unknown value '{}' for enum '{}'",
13983                    v,
13984                    "CreateCheckoutSessionPermissionsUpdateShippingDetails"
13985                );
13986                Ok(Unknown(v.to_owned()))
13987            }
13988        }
13989    }
13990}
13991impl std::fmt::Display for CreateCheckoutSessionPermissionsUpdateShippingDetails {
13992    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13993        f.write_str(self.as_str())
13994    }
13995}
13996
13997#[cfg(not(feature = "redact-generated-debug"))]
13998impl std::fmt::Debug for CreateCheckoutSessionPermissionsUpdateShippingDetails {
13999    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14000        f.write_str(self.as_str())
14001    }
14002}
14003#[cfg(feature = "redact-generated-debug")]
14004impl std::fmt::Debug for CreateCheckoutSessionPermissionsUpdateShippingDetails {
14005    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14006        f.debug_struct(stringify!(CreateCheckoutSessionPermissionsUpdateShippingDetails))
14007            .finish_non_exhaustive()
14008    }
14009}
14010impl serde::Serialize for CreateCheckoutSessionPermissionsUpdateShippingDetails {
14011    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14012    where
14013        S: serde::Serializer,
14014    {
14015        serializer.serialize_str(self.as_str())
14016    }
14017}
14018#[cfg(feature = "deserialize")]
14019impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionPermissionsUpdateShippingDetails {
14020    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14021        use std::str::FromStr;
14022        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14023        Ok(Self::from_str(&s).expect("infallible"))
14024    }
14025}
14026/// Controls phone number collection settings for the session.
14027///
14028/// We recommend that you review your privacy policy and check with your legal contacts
14029/// before using this feature.
14030/// Learn more about [collecting phone numbers with Checkout](https://docs.stripe.com/payments/checkout/phone-numbers).
14031#[derive(Copy, Clone, Eq, PartialEq)]
14032#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
14033#[derive(serde::Serialize)]
14034pub struct CreateCheckoutSessionPhoneNumberCollection {
14035    /// Set to `true` to enable phone number collection.
14036    ///
14037    /// Can only be set in `payment` and `subscription` mode.
14038    pub enabled: bool,
14039}
14040#[cfg(feature = "redact-generated-debug")]
14041impl std::fmt::Debug for CreateCheckoutSessionPhoneNumberCollection {
14042    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14043        f.debug_struct("CreateCheckoutSessionPhoneNumberCollection").finish_non_exhaustive()
14044    }
14045}
14046impl CreateCheckoutSessionPhoneNumberCollection {
14047    pub fn new(enabled: impl Into<bool>) -> Self {
14048        Self { enabled: enabled.into() }
14049    }
14050}
14051/// Controls saved payment method settings for the session.
14052/// Only available in `payment` and `subscription` mode.
14053#[derive(Clone, Eq, PartialEq)]
14054#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
14055#[derive(serde::Serialize)]
14056pub struct CreateCheckoutSessionSavedPaymentMethodOptions {
14057    /// Uses the `allow_redisplay` value of each saved payment method to filter the set presented to a returning customer.
14058    /// By default, only saved payment methods with ’allow_redisplay: ‘always’ are shown in Checkout.
14059    #[serde(skip_serializing_if = "Option::is_none")]
14060    pub allow_redisplay_filters:
14061        Option<Vec<CreateCheckoutSessionSavedPaymentMethodOptionsAllowRedisplayFilters>>,
14062    /// Enable customers to choose if they wish to remove their saved payment methods. Disabled by default.
14063    #[serde(skip_serializing_if = "Option::is_none")]
14064    pub payment_method_remove:
14065        Option<CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodRemove>,
14066    /// Enable customers to choose if they wish to save their payment method for future use.
14067    /// Disabled by default.
14068    #[serde(skip_serializing_if = "Option::is_none")]
14069    pub payment_method_save:
14070        Option<CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodSave>,
14071}
14072#[cfg(feature = "redact-generated-debug")]
14073impl std::fmt::Debug for CreateCheckoutSessionSavedPaymentMethodOptions {
14074    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14075        f.debug_struct("CreateCheckoutSessionSavedPaymentMethodOptions").finish_non_exhaustive()
14076    }
14077}
14078impl CreateCheckoutSessionSavedPaymentMethodOptions {
14079    pub fn new() -> Self {
14080        Self {
14081            allow_redisplay_filters: None,
14082            payment_method_remove: None,
14083            payment_method_save: None,
14084        }
14085    }
14086}
14087impl Default for CreateCheckoutSessionSavedPaymentMethodOptions {
14088    fn default() -> Self {
14089        Self::new()
14090    }
14091}
14092/// Uses the `allow_redisplay` value of each saved payment method to filter the set presented to a returning customer.
14093/// By default, only saved payment methods with ’allow_redisplay: ‘always’ are shown in Checkout.
14094#[derive(Clone, Eq, PartialEq)]
14095#[non_exhaustive]
14096pub enum CreateCheckoutSessionSavedPaymentMethodOptionsAllowRedisplayFilters {
14097    Always,
14098    Limited,
14099    Unspecified,
14100    /// An unrecognized value from Stripe. Should not be used as a request parameter.
14101    Unknown(String),
14102}
14103impl CreateCheckoutSessionSavedPaymentMethodOptionsAllowRedisplayFilters {
14104    pub fn as_str(&self) -> &str {
14105        use CreateCheckoutSessionSavedPaymentMethodOptionsAllowRedisplayFilters::*;
14106        match self {
14107            Always => "always",
14108            Limited => "limited",
14109            Unspecified => "unspecified",
14110            Unknown(v) => v,
14111        }
14112    }
14113}
14114
14115impl std::str::FromStr for CreateCheckoutSessionSavedPaymentMethodOptionsAllowRedisplayFilters {
14116    type Err = std::convert::Infallible;
14117    fn from_str(s: &str) -> Result<Self, Self::Err> {
14118        use CreateCheckoutSessionSavedPaymentMethodOptionsAllowRedisplayFilters::*;
14119        match s {
14120            "always" => Ok(Always),
14121            "limited" => Ok(Limited),
14122            "unspecified" => Ok(Unspecified),
14123            v => {
14124                tracing::warn!(
14125                    "Unknown value '{}' for enum '{}'",
14126                    v,
14127                    "CreateCheckoutSessionSavedPaymentMethodOptionsAllowRedisplayFilters"
14128                );
14129                Ok(Unknown(v.to_owned()))
14130            }
14131        }
14132    }
14133}
14134impl std::fmt::Display for CreateCheckoutSessionSavedPaymentMethodOptionsAllowRedisplayFilters {
14135    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14136        f.write_str(self.as_str())
14137    }
14138}
14139
14140#[cfg(not(feature = "redact-generated-debug"))]
14141impl std::fmt::Debug for CreateCheckoutSessionSavedPaymentMethodOptionsAllowRedisplayFilters {
14142    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14143        f.write_str(self.as_str())
14144    }
14145}
14146#[cfg(feature = "redact-generated-debug")]
14147impl std::fmt::Debug for CreateCheckoutSessionSavedPaymentMethodOptionsAllowRedisplayFilters {
14148    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14149        f.debug_struct(stringify!(
14150            CreateCheckoutSessionSavedPaymentMethodOptionsAllowRedisplayFilters
14151        ))
14152        .finish_non_exhaustive()
14153    }
14154}
14155impl serde::Serialize for CreateCheckoutSessionSavedPaymentMethodOptionsAllowRedisplayFilters {
14156    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14157    where
14158        S: serde::Serializer,
14159    {
14160        serializer.serialize_str(self.as_str())
14161    }
14162}
14163#[cfg(feature = "deserialize")]
14164impl<'de> serde::Deserialize<'de>
14165    for CreateCheckoutSessionSavedPaymentMethodOptionsAllowRedisplayFilters
14166{
14167    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14168        use std::str::FromStr;
14169        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14170        Ok(Self::from_str(&s).expect("infallible"))
14171    }
14172}
14173/// Enable customers to choose if they wish to remove their saved payment methods. Disabled by default.
14174#[derive(Clone, Eq, PartialEq)]
14175#[non_exhaustive]
14176pub enum CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodRemove {
14177    Disabled,
14178    Enabled,
14179    /// An unrecognized value from Stripe. Should not be used as a request parameter.
14180    Unknown(String),
14181}
14182impl CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodRemove {
14183    pub fn as_str(&self) -> &str {
14184        use CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodRemove::*;
14185        match self {
14186            Disabled => "disabled",
14187            Enabled => "enabled",
14188            Unknown(v) => v,
14189        }
14190    }
14191}
14192
14193impl std::str::FromStr for CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodRemove {
14194    type Err = std::convert::Infallible;
14195    fn from_str(s: &str) -> Result<Self, Self::Err> {
14196        use CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodRemove::*;
14197        match s {
14198            "disabled" => Ok(Disabled),
14199            "enabled" => Ok(Enabled),
14200            v => {
14201                tracing::warn!(
14202                    "Unknown value '{}' for enum '{}'",
14203                    v,
14204                    "CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodRemove"
14205                );
14206                Ok(Unknown(v.to_owned()))
14207            }
14208        }
14209    }
14210}
14211impl std::fmt::Display for CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodRemove {
14212    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14213        f.write_str(self.as_str())
14214    }
14215}
14216
14217#[cfg(not(feature = "redact-generated-debug"))]
14218impl std::fmt::Debug for CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodRemove {
14219    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14220        f.write_str(self.as_str())
14221    }
14222}
14223#[cfg(feature = "redact-generated-debug")]
14224impl std::fmt::Debug for CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodRemove {
14225    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14226        f.debug_struct(stringify!(
14227            CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodRemove
14228        ))
14229        .finish_non_exhaustive()
14230    }
14231}
14232impl serde::Serialize for CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodRemove {
14233    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14234    where
14235        S: serde::Serializer,
14236    {
14237        serializer.serialize_str(self.as_str())
14238    }
14239}
14240#[cfg(feature = "deserialize")]
14241impl<'de> serde::Deserialize<'de>
14242    for CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodRemove
14243{
14244    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14245        use std::str::FromStr;
14246        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14247        Ok(Self::from_str(&s).expect("infallible"))
14248    }
14249}
14250/// Enable customers to choose if they wish to save their payment method for future use.
14251/// Disabled by default.
14252#[derive(Clone, Eq, PartialEq)]
14253#[non_exhaustive]
14254pub enum CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodSave {
14255    Disabled,
14256    Enabled,
14257    /// An unrecognized value from Stripe. Should not be used as a request parameter.
14258    Unknown(String),
14259}
14260impl CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodSave {
14261    pub fn as_str(&self) -> &str {
14262        use CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodSave::*;
14263        match self {
14264            Disabled => "disabled",
14265            Enabled => "enabled",
14266            Unknown(v) => v,
14267        }
14268    }
14269}
14270
14271impl std::str::FromStr for CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodSave {
14272    type Err = std::convert::Infallible;
14273    fn from_str(s: &str) -> Result<Self, Self::Err> {
14274        use CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodSave::*;
14275        match s {
14276            "disabled" => Ok(Disabled),
14277            "enabled" => Ok(Enabled),
14278            v => {
14279                tracing::warn!(
14280                    "Unknown value '{}' for enum '{}'",
14281                    v,
14282                    "CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodSave"
14283                );
14284                Ok(Unknown(v.to_owned()))
14285            }
14286        }
14287    }
14288}
14289impl std::fmt::Display for CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodSave {
14290    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14291        f.write_str(self.as_str())
14292    }
14293}
14294
14295#[cfg(not(feature = "redact-generated-debug"))]
14296impl std::fmt::Debug for CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodSave {
14297    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14298        f.write_str(self.as_str())
14299    }
14300}
14301#[cfg(feature = "redact-generated-debug")]
14302impl std::fmt::Debug for CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodSave {
14303    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14304        f.debug_struct(stringify!(CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodSave))
14305            .finish_non_exhaustive()
14306    }
14307}
14308impl serde::Serialize for CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodSave {
14309    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14310    where
14311        S: serde::Serializer,
14312    {
14313        serializer.serialize_str(self.as_str())
14314    }
14315}
14316#[cfg(feature = "deserialize")]
14317impl<'de> serde::Deserialize<'de>
14318    for CreateCheckoutSessionSavedPaymentMethodOptionsPaymentMethodSave
14319{
14320    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14321        use std::str::FromStr;
14322        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14323        Ok(Self::from_str(&s).expect("infallible"))
14324    }
14325}
14326/// A subset of parameters to be passed to SetupIntent creation for Checkout Sessions in `setup` mode.
14327#[derive(Clone)]
14328#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
14329#[derive(serde::Serialize)]
14330pub struct CreateCheckoutSessionSetupIntentData {
14331    /// An arbitrary string attached to the object. Often useful for displaying to users.
14332    #[serde(skip_serializing_if = "Option::is_none")]
14333    pub description: Option<String>,
14334    /// Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object.
14335    /// This can be useful for storing additional information about the object in a structured format.
14336    /// Individual keys can be unset by posting an empty value to them.
14337    /// All keys can be unset by posting an empty value to `metadata`.
14338    #[serde(skip_serializing_if = "Option::is_none")]
14339    pub metadata: Option<std::collections::HashMap<String, String>>,
14340    /// The Stripe account for which the setup is intended.
14341    #[serde(skip_serializing_if = "Option::is_none")]
14342    pub on_behalf_of: Option<String>,
14343}
14344#[cfg(feature = "redact-generated-debug")]
14345impl std::fmt::Debug for CreateCheckoutSessionSetupIntentData {
14346    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14347        f.debug_struct("CreateCheckoutSessionSetupIntentData").finish_non_exhaustive()
14348    }
14349}
14350impl CreateCheckoutSessionSetupIntentData {
14351    pub fn new() -> Self {
14352        Self { description: None, metadata: None, on_behalf_of: None }
14353    }
14354}
14355impl Default for CreateCheckoutSessionSetupIntentData {
14356    fn default() -> Self {
14357        Self::new()
14358    }
14359}
14360/// When set, provides configuration for Checkout to collect a shipping address from a customer.
14361#[derive(Clone, Eq, PartialEq)]
14362#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
14363#[derive(serde::Serialize)]
14364pub struct CreateCheckoutSessionShippingAddressCollection {
14365    /// An array of two-letter ISO country codes representing which countries Checkout should provide as options for.
14366    /// shipping locations.
14367    pub allowed_countries: Vec<CreateCheckoutSessionShippingAddressCollectionAllowedCountries>,
14368}
14369#[cfg(feature = "redact-generated-debug")]
14370impl std::fmt::Debug for CreateCheckoutSessionShippingAddressCollection {
14371    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14372        f.debug_struct("CreateCheckoutSessionShippingAddressCollection").finish_non_exhaustive()
14373    }
14374}
14375impl CreateCheckoutSessionShippingAddressCollection {
14376    pub fn new(
14377        allowed_countries: impl Into<
14378            Vec<CreateCheckoutSessionShippingAddressCollectionAllowedCountries>,
14379        >,
14380    ) -> Self {
14381        Self { allowed_countries: allowed_countries.into() }
14382    }
14383}
14384/// An array of two-letter ISO country codes representing which countries Checkout should provide as options for.
14385/// shipping locations.
14386#[derive(Clone, Eq, PartialEq)]
14387#[non_exhaustive]
14388pub enum CreateCheckoutSessionShippingAddressCollectionAllowedCountries {
14389    Ac,
14390    Ad,
14391    Ae,
14392    Af,
14393    Ag,
14394    Ai,
14395    Al,
14396    Am,
14397    Ao,
14398    Aq,
14399    Ar,
14400    At,
14401    Au,
14402    Aw,
14403    Ax,
14404    Az,
14405    Ba,
14406    Bb,
14407    Bd,
14408    Be,
14409    Bf,
14410    Bg,
14411    Bh,
14412    Bi,
14413    Bj,
14414    Bl,
14415    Bm,
14416    Bn,
14417    Bo,
14418    Bq,
14419    Br,
14420    Bs,
14421    Bt,
14422    Bv,
14423    Bw,
14424    By,
14425    Bz,
14426    Ca,
14427    Cd,
14428    Cf,
14429    Cg,
14430    Ch,
14431    Ci,
14432    Ck,
14433    Cl,
14434    Cm,
14435    Cn,
14436    Co,
14437    Cr,
14438    Cv,
14439    Cw,
14440    Cy,
14441    Cz,
14442    De,
14443    Dj,
14444    Dk,
14445    Dm,
14446    Do,
14447    Dz,
14448    Ec,
14449    Ee,
14450    Eg,
14451    Eh,
14452    Er,
14453    Es,
14454    Et,
14455    Fi,
14456    Fj,
14457    Fk,
14458    Fo,
14459    Fr,
14460    Ga,
14461    Gb,
14462    Gd,
14463    Ge,
14464    Gf,
14465    Gg,
14466    Gh,
14467    Gi,
14468    Gl,
14469    Gm,
14470    Gn,
14471    Gp,
14472    Gq,
14473    Gr,
14474    Gs,
14475    Gt,
14476    Gu,
14477    Gw,
14478    Gy,
14479    Hk,
14480    Hn,
14481    Hr,
14482    Ht,
14483    Hu,
14484    Id,
14485    Ie,
14486    Il,
14487    Im,
14488    In,
14489    Io,
14490    Iq,
14491    Is,
14492    It,
14493    Je,
14494    Jm,
14495    Jo,
14496    Jp,
14497    Ke,
14498    Kg,
14499    Kh,
14500    Ki,
14501    Km,
14502    Kn,
14503    Kr,
14504    Kw,
14505    Ky,
14506    Kz,
14507    La,
14508    Lb,
14509    Lc,
14510    Li,
14511    Lk,
14512    Lr,
14513    Ls,
14514    Lt,
14515    Lu,
14516    Lv,
14517    Ly,
14518    Ma,
14519    Mc,
14520    Md,
14521    Me,
14522    Mf,
14523    Mg,
14524    Mk,
14525    Ml,
14526    Mm,
14527    Mn,
14528    Mo,
14529    Mq,
14530    Mr,
14531    Ms,
14532    Mt,
14533    Mu,
14534    Mv,
14535    Mw,
14536    Mx,
14537    My,
14538    Mz,
14539    Na,
14540    Nc,
14541    Ne,
14542    Ng,
14543    Ni,
14544    Nl,
14545    No,
14546    Np,
14547    Nr,
14548    Nu,
14549    Nz,
14550    Om,
14551    Pa,
14552    Pe,
14553    Pf,
14554    Pg,
14555    Ph,
14556    Pk,
14557    Pl,
14558    Pm,
14559    Pn,
14560    Pr,
14561    Ps,
14562    Pt,
14563    Py,
14564    Qa,
14565    Re,
14566    Ro,
14567    Rs,
14568    Ru,
14569    Rw,
14570    Sa,
14571    Sb,
14572    Sc,
14573    Sd,
14574    Se,
14575    Sg,
14576    Sh,
14577    Si,
14578    Sj,
14579    Sk,
14580    Sl,
14581    Sm,
14582    Sn,
14583    So,
14584    Sr,
14585    Ss,
14586    St,
14587    Sv,
14588    Sx,
14589    Sz,
14590    Ta,
14591    Tc,
14592    Td,
14593    Tf,
14594    Tg,
14595    Th,
14596    Tj,
14597    Tk,
14598    Tl,
14599    Tm,
14600    Tn,
14601    To,
14602    Tr,
14603    Tt,
14604    Tv,
14605    Tw,
14606    Tz,
14607    Ua,
14608    Ug,
14609    Us,
14610    Uy,
14611    Uz,
14612    Va,
14613    Vc,
14614    Ve,
14615    Vg,
14616    Vn,
14617    Vu,
14618    Wf,
14619    Ws,
14620    Xk,
14621    Ye,
14622    Yt,
14623    Za,
14624    Zm,
14625    Zw,
14626    Zz,
14627    /// An unrecognized value from Stripe. Should not be used as a request parameter.
14628    Unknown(String),
14629}
14630impl CreateCheckoutSessionShippingAddressCollectionAllowedCountries {
14631    pub fn as_str(&self) -> &str {
14632        use CreateCheckoutSessionShippingAddressCollectionAllowedCountries::*;
14633        match self {
14634            Ac => "AC",
14635            Ad => "AD",
14636            Ae => "AE",
14637            Af => "AF",
14638            Ag => "AG",
14639            Ai => "AI",
14640            Al => "AL",
14641            Am => "AM",
14642            Ao => "AO",
14643            Aq => "AQ",
14644            Ar => "AR",
14645            At => "AT",
14646            Au => "AU",
14647            Aw => "AW",
14648            Ax => "AX",
14649            Az => "AZ",
14650            Ba => "BA",
14651            Bb => "BB",
14652            Bd => "BD",
14653            Be => "BE",
14654            Bf => "BF",
14655            Bg => "BG",
14656            Bh => "BH",
14657            Bi => "BI",
14658            Bj => "BJ",
14659            Bl => "BL",
14660            Bm => "BM",
14661            Bn => "BN",
14662            Bo => "BO",
14663            Bq => "BQ",
14664            Br => "BR",
14665            Bs => "BS",
14666            Bt => "BT",
14667            Bv => "BV",
14668            Bw => "BW",
14669            By => "BY",
14670            Bz => "BZ",
14671            Ca => "CA",
14672            Cd => "CD",
14673            Cf => "CF",
14674            Cg => "CG",
14675            Ch => "CH",
14676            Ci => "CI",
14677            Ck => "CK",
14678            Cl => "CL",
14679            Cm => "CM",
14680            Cn => "CN",
14681            Co => "CO",
14682            Cr => "CR",
14683            Cv => "CV",
14684            Cw => "CW",
14685            Cy => "CY",
14686            Cz => "CZ",
14687            De => "DE",
14688            Dj => "DJ",
14689            Dk => "DK",
14690            Dm => "DM",
14691            Do => "DO",
14692            Dz => "DZ",
14693            Ec => "EC",
14694            Ee => "EE",
14695            Eg => "EG",
14696            Eh => "EH",
14697            Er => "ER",
14698            Es => "ES",
14699            Et => "ET",
14700            Fi => "FI",
14701            Fj => "FJ",
14702            Fk => "FK",
14703            Fo => "FO",
14704            Fr => "FR",
14705            Ga => "GA",
14706            Gb => "GB",
14707            Gd => "GD",
14708            Ge => "GE",
14709            Gf => "GF",
14710            Gg => "GG",
14711            Gh => "GH",
14712            Gi => "GI",
14713            Gl => "GL",
14714            Gm => "GM",
14715            Gn => "GN",
14716            Gp => "GP",
14717            Gq => "GQ",
14718            Gr => "GR",
14719            Gs => "GS",
14720            Gt => "GT",
14721            Gu => "GU",
14722            Gw => "GW",
14723            Gy => "GY",
14724            Hk => "HK",
14725            Hn => "HN",
14726            Hr => "HR",
14727            Ht => "HT",
14728            Hu => "HU",
14729            Id => "ID",
14730            Ie => "IE",
14731            Il => "IL",
14732            Im => "IM",
14733            In => "IN",
14734            Io => "IO",
14735            Iq => "IQ",
14736            Is => "IS",
14737            It => "IT",
14738            Je => "JE",
14739            Jm => "JM",
14740            Jo => "JO",
14741            Jp => "JP",
14742            Ke => "KE",
14743            Kg => "KG",
14744            Kh => "KH",
14745            Ki => "KI",
14746            Km => "KM",
14747            Kn => "KN",
14748            Kr => "KR",
14749            Kw => "KW",
14750            Ky => "KY",
14751            Kz => "KZ",
14752            La => "LA",
14753            Lb => "LB",
14754            Lc => "LC",
14755            Li => "LI",
14756            Lk => "LK",
14757            Lr => "LR",
14758            Ls => "LS",
14759            Lt => "LT",
14760            Lu => "LU",
14761            Lv => "LV",
14762            Ly => "LY",
14763            Ma => "MA",
14764            Mc => "MC",
14765            Md => "MD",
14766            Me => "ME",
14767            Mf => "MF",
14768            Mg => "MG",
14769            Mk => "MK",
14770            Ml => "ML",
14771            Mm => "MM",
14772            Mn => "MN",
14773            Mo => "MO",
14774            Mq => "MQ",
14775            Mr => "MR",
14776            Ms => "MS",
14777            Mt => "MT",
14778            Mu => "MU",
14779            Mv => "MV",
14780            Mw => "MW",
14781            Mx => "MX",
14782            My => "MY",
14783            Mz => "MZ",
14784            Na => "NA",
14785            Nc => "NC",
14786            Ne => "NE",
14787            Ng => "NG",
14788            Ni => "NI",
14789            Nl => "NL",
14790            No => "NO",
14791            Np => "NP",
14792            Nr => "NR",
14793            Nu => "NU",
14794            Nz => "NZ",
14795            Om => "OM",
14796            Pa => "PA",
14797            Pe => "PE",
14798            Pf => "PF",
14799            Pg => "PG",
14800            Ph => "PH",
14801            Pk => "PK",
14802            Pl => "PL",
14803            Pm => "PM",
14804            Pn => "PN",
14805            Pr => "PR",
14806            Ps => "PS",
14807            Pt => "PT",
14808            Py => "PY",
14809            Qa => "QA",
14810            Re => "RE",
14811            Ro => "RO",
14812            Rs => "RS",
14813            Ru => "RU",
14814            Rw => "RW",
14815            Sa => "SA",
14816            Sb => "SB",
14817            Sc => "SC",
14818            Sd => "SD",
14819            Se => "SE",
14820            Sg => "SG",
14821            Sh => "SH",
14822            Si => "SI",
14823            Sj => "SJ",
14824            Sk => "SK",
14825            Sl => "SL",
14826            Sm => "SM",
14827            Sn => "SN",
14828            So => "SO",
14829            Sr => "SR",
14830            Ss => "SS",
14831            St => "ST",
14832            Sv => "SV",
14833            Sx => "SX",
14834            Sz => "SZ",
14835            Ta => "TA",
14836            Tc => "TC",
14837            Td => "TD",
14838            Tf => "TF",
14839            Tg => "TG",
14840            Th => "TH",
14841            Tj => "TJ",
14842            Tk => "TK",
14843            Tl => "TL",
14844            Tm => "TM",
14845            Tn => "TN",
14846            To => "TO",
14847            Tr => "TR",
14848            Tt => "TT",
14849            Tv => "TV",
14850            Tw => "TW",
14851            Tz => "TZ",
14852            Ua => "UA",
14853            Ug => "UG",
14854            Us => "US",
14855            Uy => "UY",
14856            Uz => "UZ",
14857            Va => "VA",
14858            Vc => "VC",
14859            Ve => "VE",
14860            Vg => "VG",
14861            Vn => "VN",
14862            Vu => "VU",
14863            Wf => "WF",
14864            Ws => "WS",
14865            Xk => "XK",
14866            Ye => "YE",
14867            Yt => "YT",
14868            Za => "ZA",
14869            Zm => "ZM",
14870            Zw => "ZW",
14871            Zz => "ZZ",
14872            Unknown(v) => v,
14873        }
14874    }
14875}
14876
14877impl std::str::FromStr for CreateCheckoutSessionShippingAddressCollectionAllowedCountries {
14878    type Err = std::convert::Infallible;
14879    fn from_str(s: &str) -> Result<Self, Self::Err> {
14880        use CreateCheckoutSessionShippingAddressCollectionAllowedCountries::*;
14881        match s {
14882            "AC" => Ok(Ac),
14883            "AD" => Ok(Ad),
14884            "AE" => Ok(Ae),
14885            "AF" => Ok(Af),
14886            "AG" => Ok(Ag),
14887            "AI" => Ok(Ai),
14888            "AL" => Ok(Al),
14889            "AM" => Ok(Am),
14890            "AO" => Ok(Ao),
14891            "AQ" => Ok(Aq),
14892            "AR" => Ok(Ar),
14893            "AT" => Ok(At),
14894            "AU" => Ok(Au),
14895            "AW" => Ok(Aw),
14896            "AX" => Ok(Ax),
14897            "AZ" => Ok(Az),
14898            "BA" => Ok(Ba),
14899            "BB" => Ok(Bb),
14900            "BD" => Ok(Bd),
14901            "BE" => Ok(Be),
14902            "BF" => Ok(Bf),
14903            "BG" => Ok(Bg),
14904            "BH" => Ok(Bh),
14905            "BI" => Ok(Bi),
14906            "BJ" => Ok(Bj),
14907            "BL" => Ok(Bl),
14908            "BM" => Ok(Bm),
14909            "BN" => Ok(Bn),
14910            "BO" => Ok(Bo),
14911            "BQ" => Ok(Bq),
14912            "BR" => Ok(Br),
14913            "BS" => Ok(Bs),
14914            "BT" => Ok(Bt),
14915            "BV" => Ok(Bv),
14916            "BW" => Ok(Bw),
14917            "BY" => Ok(By),
14918            "BZ" => Ok(Bz),
14919            "CA" => Ok(Ca),
14920            "CD" => Ok(Cd),
14921            "CF" => Ok(Cf),
14922            "CG" => Ok(Cg),
14923            "CH" => Ok(Ch),
14924            "CI" => Ok(Ci),
14925            "CK" => Ok(Ck),
14926            "CL" => Ok(Cl),
14927            "CM" => Ok(Cm),
14928            "CN" => Ok(Cn),
14929            "CO" => Ok(Co),
14930            "CR" => Ok(Cr),
14931            "CV" => Ok(Cv),
14932            "CW" => Ok(Cw),
14933            "CY" => Ok(Cy),
14934            "CZ" => Ok(Cz),
14935            "DE" => Ok(De),
14936            "DJ" => Ok(Dj),
14937            "DK" => Ok(Dk),
14938            "DM" => Ok(Dm),
14939            "DO" => Ok(Do),
14940            "DZ" => Ok(Dz),
14941            "EC" => Ok(Ec),
14942            "EE" => Ok(Ee),
14943            "EG" => Ok(Eg),
14944            "EH" => Ok(Eh),
14945            "ER" => Ok(Er),
14946            "ES" => Ok(Es),
14947            "ET" => Ok(Et),
14948            "FI" => Ok(Fi),
14949            "FJ" => Ok(Fj),
14950            "FK" => Ok(Fk),
14951            "FO" => Ok(Fo),
14952            "FR" => Ok(Fr),
14953            "GA" => Ok(Ga),
14954            "GB" => Ok(Gb),
14955            "GD" => Ok(Gd),
14956            "GE" => Ok(Ge),
14957            "GF" => Ok(Gf),
14958            "GG" => Ok(Gg),
14959            "GH" => Ok(Gh),
14960            "GI" => Ok(Gi),
14961            "GL" => Ok(Gl),
14962            "GM" => Ok(Gm),
14963            "GN" => Ok(Gn),
14964            "GP" => Ok(Gp),
14965            "GQ" => Ok(Gq),
14966            "GR" => Ok(Gr),
14967            "GS" => Ok(Gs),
14968            "GT" => Ok(Gt),
14969            "GU" => Ok(Gu),
14970            "GW" => Ok(Gw),
14971            "GY" => Ok(Gy),
14972            "HK" => Ok(Hk),
14973            "HN" => Ok(Hn),
14974            "HR" => Ok(Hr),
14975            "HT" => Ok(Ht),
14976            "HU" => Ok(Hu),
14977            "ID" => Ok(Id),
14978            "IE" => Ok(Ie),
14979            "IL" => Ok(Il),
14980            "IM" => Ok(Im),
14981            "IN" => Ok(In),
14982            "IO" => Ok(Io),
14983            "IQ" => Ok(Iq),
14984            "IS" => Ok(Is),
14985            "IT" => Ok(It),
14986            "JE" => Ok(Je),
14987            "JM" => Ok(Jm),
14988            "JO" => Ok(Jo),
14989            "JP" => Ok(Jp),
14990            "KE" => Ok(Ke),
14991            "KG" => Ok(Kg),
14992            "KH" => Ok(Kh),
14993            "KI" => Ok(Ki),
14994            "KM" => Ok(Km),
14995            "KN" => Ok(Kn),
14996            "KR" => Ok(Kr),
14997            "KW" => Ok(Kw),
14998            "KY" => Ok(Ky),
14999            "KZ" => Ok(Kz),
15000            "LA" => Ok(La),
15001            "LB" => Ok(Lb),
15002            "LC" => Ok(Lc),
15003            "LI" => Ok(Li),
15004            "LK" => Ok(Lk),
15005            "LR" => Ok(Lr),
15006            "LS" => Ok(Ls),
15007            "LT" => Ok(Lt),
15008            "LU" => Ok(Lu),
15009            "LV" => Ok(Lv),
15010            "LY" => Ok(Ly),
15011            "MA" => Ok(Ma),
15012            "MC" => Ok(Mc),
15013            "MD" => Ok(Md),
15014            "ME" => Ok(Me),
15015            "MF" => Ok(Mf),
15016            "MG" => Ok(Mg),
15017            "MK" => Ok(Mk),
15018            "ML" => Ok(Ml),
15019            "MM" => Ok(Mm),
15020            "MN" => Ok(Mn),
15021            "MO" => Ok(Mo),
15022            "MQ" => Ok(Mq),
15023            "MR" => Ok(Mr),
15024            "MS" => Ok(Ms),
15025            "MT" => Ok(Mt),
15026            "MU" => Ok(Mu),
15027            "MV" => Ok(Mv),
15028            "MW" => Ok(Mw),
15029            "MX" => Ok(Mx),
15030            "MY" => Ok(My),
15031            "MZ" => Ok(Mz),
15032            "NA" => Ok(Na),
15033            "NC" => Ok(Nc),
15034            "NE" => Ok(Ne),
15035            "NG" => Ok(Ng),
15036            "NI" => Ok(Ni),
15037            "NL" => Ok(Nl),
15038            "NO" => Ok(No),
15039            "NP" => Ok(Np),
15040            "NR" => Ok(Nr),
15041            "NU" => Ok(Nu),
15042            "NZ" => Ok(Nz),
15043            "OM" => Ok(Om),
15044            "PA" => Ok(Pa),
15045            "PE" => Ok(Pe),
15046            "PF" => Ok(Pf),
15047            "PG" => Ok(Pg),
15048            "PH" => Ok(Ph),
15049            "PK" => Ok(Pk),
15050            "PL" => Ok(Pl),
15051            "PM" => Ok(Pm),
15052            "PN" => Ok(Pn),
15053            "PR" => Ok(Pr),
15054            "PS" => Ok(Ps),
15055            "PT" => Ok(Pt),
15056            "PY" => Ok(Py),
15057            "QA" => Ok(Qa),
15058            "RE" => Ok(Re),
15059            "RO" => Ok(Ro),
15060            "RS" => Ok(Rs),
15061            "RU" => Ok(Ru),
15062            "RW" => Ok(Rw),
15063            "SA" => Ok(Sa),
15064            "SB" => Ok(Sb),
15065            "SC" => Ok(Sc),
15066            "SD" => Ok(Sd),
15067            "SE" => Ok(Se),
15068            "SG" => Ok(Sg),
15069            "SH" => Ok(Sh),
15070            "SI" => Ok(Si),
15071            "SJ" => Ok(Sj),
15072            "SK" => Ok(Sk),
15073            "SL" => Ok(Sl),
15074            "SM" => Ok(Sm),
15075            "SN" => Ok(Sn),
15076            "SO" => Ok(So),
15077            "SR" => Ok(Sr),
15078            "SS" => Ok(Ss),
15079            "ST" => Ok(St),
15080            "SV" => Ok(Sv),
15081            "SX" => Ok(Sx),
15082            "SZ" => Ok(Sz),
15083            "TA" => Ok(Ta),
15084            "TC" => Ok(Tc),
15085            "TD" => Ok(Td),
15086            "TF" => Ok(Tf),
15087            "TG" => Ok(Tg),
15088            "TH" => Ok(Th),
15089            "TJ" => Ok(Tj),
15090            "TK" => Ok(Tk),
15091            "TL" => Ok(Tl),
15092            "TM" => Ok(Tm),
15093            "TN" => Ok(Tn),
15094            "TO" => Ok(To),
15095            "TR" => Ok(Tr),
15096            "TT" => Ok(Tt),
15097            "TV" => Ok(Tv),
15098            "TW" => Ok(Tw),
15099            "TZ" => Ok(Tz),
15100            "UA" => Ok(Ua),
15101            "UG" => Ok(Ug),
15102            "US" => Ok(Us),
15103            "UY" => Ok(Uy),
15104            "UZ" => Ok(Uz),
15105            "VA" => Ok(Va),
15106            "VC" => Ok(Vc),
15107            "VE" => Ok(Ve),
15108            "VG" => Ok(Vg),
15109            "VN" => Ok(Vn),
15110            "VU" => Ok(Vu),
15111            "WF" => Ok(Wf),
15112            "WS" => Ok(Ws),
15113            "XK" => Ok(Xk),
15114            "YE" => Ok(Ye),
15115            "YT" => Ok(Yt),
15116            "ZA" => Ok(Za),
15117            "ZM" => Ok(Zm),
15118            "ZW" => Ok(Zw),
15119            "ZZ" => Ok(Zz),
15120            v => {
15121                tracing::warn!(
15122                    "Unknown value '{}' for enum '{}'",
15123                    v,
15124                    "CreateCheckoutSessionShippingAddressCollectionAllowedCountries"
15125                );
15126                Ok(Unknown(v.to_owned()))
15127            }
15128        }
15129    }
15130}
15131impl std::fmt::Display for CreateCheckoutSessionShippingAddressCollectionAllowedCountries {
15132    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15133        f.write_str(self.as_str())
15134    }
15135}
15136
15137#[cfg(not(feature = "redact-generated-debug"))]
15138impl std::fmt::Debug for CreateCheckoutSessionShippingAddressCollectionAllowedCountries {
15139    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15140        f.write_str(self.as_str())
15141    }
15142}
15143#[cfg(feature = "redact-generated-debug")]
15144impl std::fmt::Debug for CreateCheckoutSessionShippingAddressCollectionAllowedCountries {
15145    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15146        f.debug_struct(stringify!(CreateCheckoutSessionShippingAddressCollectionAllowedCountries))
15147            .finish_non_exhaustive()
15148    }
15149}
15150impl serde::Serialize for CreateCheckoutSessionShippingAddressCollectionAllowedCountries {
15151    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15152    where
15153        S: serde::Serializer,
15154    {
15155        serializer.serialize_str(self.as_str())
15156    }
15157}
15158#[cfg(feature = "deserialize")]
15159impl<'de> serde::Deserialize<'de>
15160    for CreateCheckoutSessionShippingAddressCollectionAllowedCountries
15161{
15162    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15163        use std::str::FromStr;
15164        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15165        Ok(Self::from_str(&s).expect("infallible"))
15166    }
15167}
15168/// The shipping rate options to apply to this Session. Up to a maximum of 5.
15169#[derive(Clone)]
15170#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
15171#[derive(serde::Serialize)]
15172pub struct CreateCheckoutSessionShippingOptions {
15173    /// The ID of the Shipping Rate to use for this shipping option.
15174    #[serde(skip_serializing_if = "Option::is_none")]
15175    pub shipping_rate: Option<String>,
15176    /// Parameters to be passed to Shipping Rate creation for this shipping option.
15177    #[serde(skip_serializing_if = "Option::is_none")]
15178    pub shipping_rate_data: Option<CreateCheckoutSessionShippingOptionsShippingRateData>,
15179}
15180#[cfg(feature = "redact-generated-debug")]
15181impl std::fmt::Debug for CreateCheckoutSessionShippingOptions {
15182    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15183        f.debug_struct("CreateCheckoutSessionShippingOptions").finish_non_exhaustive()
15184    }
15185}
15186impl CreateCheckoutSessionShippingOptions {
15187    pub fn new() -> Self {
15188        Self { shipping_rate: None, shipping_rate_data: None }
15189    }
15190}
15191impl Default for CreateCheckoutSessionShippingOptions {
15192    fn default() -> Self {
15193        Self::new()
15194    }
15195}
15196/// Parameters to be passed to Shipping Rate creation for this shipping option.
15197#[derive(Clone)]
15198#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
15199#[derive(serde::Serialize)]
15200pub struct CreateCheckoutSessionShippingOptionsShippingRateData {
15201    /// The estimated range for how long shipping will take, meant to be displayable to the customer.
15202    /// This will appear on CheckoutSessions.
15203    #[serde(skip_serializing_if = "Option::is_none")]
15204    pub delivery_estimate:
15205        Option<CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimate>,
15206    /// The name of the shipping rate, meant to be displayable to the customer.
15207    /// This will appear on CheckoutSessions.
15208    pub display_name: String,
15209    /// Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`.
15210    #[serde(skip_serializing_if = "Option::is_none")]
15211    pub fixed_amount: Option<CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmount>,
15212    /// Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object.
15213    /// This can be useful for storing additional information about the object in a structured format.
15214    /// Individual keys can be unset by posting an empty value to them.
15215    /// All keys can be unset by posting an empty value to `metadata`.
15216    #[serde(skip_serializing_if = "Option::is_none")]
15217    pub metadata: Option<std::collections::HashMap<String, String>>,
15218    /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes.
15219    /// One of `inclusive`, `exclusive`, or `unspecified`.
15220    #[serde(skip_serializing_if = "Option::is_none")]
15221    pub tax_behavior: Option<CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior>,
15222    /// A [tax code](https://docs.stripe.com/tax/tax-categories) ID.
15223    /// The Shipping tax code is `txcd_92010001`.
15224    #[serde(skip_serializing_if = "Option::is_none")]
15225    pub tax_code: Option<String>,
15226    /// The type of calculation to use on the shipping rate.
15227    #[serde(rename = "type")]
15228    #[serde(skip_serializing_if = "Option::is_none")]
15229    pub type_: Option<CreateCheckoutSessionShippingOptionsShippingRateDataType>,
15230}
15231#[cfg(feature = "redact-generated-debug")]
15232impl std::fmt::Debug for CreateCheckoutSessionShippingOptionsShippingRateData {
15233    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15234        f.debug_struct("CreateCheckoutSessionShippingOptionsShippingRateData")
15235            .finish_non_exhaustive()
15236    }
15237}
15238impl CreateCheckoutSessionShippingOptionsShippingRateData {
15239    pub fn new(display_name: impl Into<String>) -> Self {
15240        Self {
15241            delivery_estimate: None,
15242            display_name: display_name.into(),
15243            fixed_amount: None,
15244            metadata: None,
15245            tax_behavior: None,
15246            tax_code: None,
15247            type_: None,
15248        }
15249    }
15250}
15251/// The estimated range for how long shipping will take, meant to be displayable to the customer.
15252/// This will appear on CheckoutSessions.
15253#[derive(Clone, Eq, PartialEq)]
15254#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
15255#[derive(serde::Serialize)]
15256pub struct CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimate {
15257    /// The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite.
15258    #[serde(skip_serializing_if = "Option::is_none")]
15259    pub maximum:
15260        Option<CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximum>,
15261    /// The lower bound of the estimated range. If empty, represents no lower bound.
15262    #[serde(skip_serializing_if = "Option::is_none")]
15263    pub minimum:
15264        Option<CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimum>,
15265}
15266#[cfg(feature = "redact-generated-debug")]
15267impl std::fmt::Debug for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimate {
15268    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15269        f.debug_struct("CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimate")
15270            .finish_non_exhaustive()
15271    }
15272}
15273impl CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimate {
15274    pub fn new() -> Self {
15275        Self { maximum: None, minimum: None }
15276    }
15277}
15278impl Default for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimate {
15279    fn default() -> Self {
15280        Self::new()
15281    }
15282}
15283/// The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite.
15284#[derive(Clone, Eq, PartialEq)]
15285#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
15286#[derive(serde::Serialize)]
15287pub struct CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximum {
15288    /// A unit of time.
15289    pub unit: CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit,
15290    /// Must be greater than 0.
15291    pub value: i64,
15292}
15293#[cfg(feature = "redact-generated-debug")]
15294impl std::fmt::Debug
15295    for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximum
15296{
15297    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15298        f.debug_struct(
15299            "CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximum",
15300        )
15301        .finish_non_exhaustive()
15302    }
15303}
15304impl CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximum {
15305    pub fn new(
15306        unit: impl Into<CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit>,
15307        value: impl Into<i64>,
15308    ) -> Self {
15309        Self { unit: unit.into(), value: value.into() }
15310    }
15311}
15312/// A unit of time.
15313#[derive(Clone, Eq, PartialEq)]
15314#[non_exhaustive]
15315pub enum CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit {
15316    BusinessDay,
15317    Day,
15318    Hour,
15319    Month,
15320    Week,
15321    /// An unrecognized value from Stripe. Should not be used as a request parameter.
15322    Unknown(String),
15323}
15324impl CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit {
15325    pub fn as_str(&self) -> &str {
15326        use CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit::*;
15327        match self {
15328            BusinessDay => "business_day",
15329            Day => "day",
15330            Hour => "hour",
15331            Month => "month",
15332            Week => "week",
15333            Unknown(v) => v,
15334        }
15335    }
15336}
15337
15338impl std::str::FromStr
15339    for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit
15340{
15341    type Err = std::convert::Infallible;
15342    fn from_str(s: &str) -> Result<Self, Self::Err> {
15343        use CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit::*;
15344        match s {
15345            "business_day" => Ok(BusinessDay),
15346            "day" => Ok(Day),
15347            "hour" => Ok(Hour),
15348            "month" => Ok(Month),
15349            "week" => Ok(Week),
15350            v => {
15351                tracing::warn!(
15352                    "Unknown value '{}' for enum '{}'",
15353                    v,
15354                    "CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit"
15355                );
15356                Ok(Unknown(v.to_owned()))
15357            }
15358        }
15359    }
15360}
15361impl std::fmt::Display
15362    for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit
15363{
15364    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15365        f.write_str(self.as_str())
15366    }
15367}
15368
15369#[cfg(not(feature = "redact-generated-debug"))]
15370impl std::fmt::Debug
15371    for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit
15372{
15373    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15374        f.write_str(self.as_str())
15375    }
15376}
15377#[cfg(feature = "redact-generated-debug")]
15378impl std::fmt::Debug
15379    for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit
15380{
15381    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15382        f.debug_struct(stringify!(
15383            CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit
15384        ))
15385        .finish_non_exhaustive()
15386    }
15387}
15388impl serde::Serialize
15389    for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit
15390{
15391    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15392    where
15393        S: serde::Serializer,
15394    {
15395        serializer.serialize_str(self.as_str())
15396    }
15397}
15398#[cfg(feature = "deserialize")]
15399impl<'de> serde::Deserialize<'de>
15400    for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit
15401{
15402    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15403        use std::str::FromStr;
15404        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15405        Ok(Self::from_str(&s).expect("infallible"))
15406    }
15407}
15408/// The lower bound of the estimated range. If empty, represents no lower bound.
15409#[derive(Clone, Eq, PartialEq)]
15410#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
15411#[derive(serde::Serialize)]
15412pub struct CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimum {
15413    /// A unit of time.
15414    pub unit: CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit,
15415    /// Must be greater than 0.
15416    pub value: i64,
15417}
15418#[cfg(feature = "redact-generated-debug")]
15419impl std::fmt::Debug
15420    for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimum
15421{
15422    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15423        f.debug_struct(
15424            "CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimum",
15425        )
15426        .finish_non_exhaustive()
15427    }
15428}
15429impl CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimum {
15430    pub fn new(
15431        unit: impl Into<CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit>,
15432        value: impl Into<i64>,
15433    ) -> Self {
15434        Self { unit: unit.into(), value: value.into() }
15435    }
15436}
15437/// A unit of time.
15438#[derive(Clone, Eq, PartialEq)]
15439#[non_exhaustive]
15440pub enum CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit {
15441    BusinessDay,
15442    Day,
15443    Hour,
15444    Month,
15445    Week,
15446    /// An unrecognized value from Stripe. Should not be used as a request parameter.
15447    Unknown(String),
15448}
15449impl CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit {
15450    pub fn as_str(&self) -> &str {
15451        use CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit::*;
15452        match self {
15453            BusinessDay => "business_day",
15454            Day => "day",
15455            Hour => "hour",
15456            Month => "month",
15457            Week => "week",
15458            Unknown(v) => v,
15459        }
15460    }
15461}
15462
15463impl std::str::FromStr
15464    for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit
15465{
15466    type Err = std::convert::Infallible;
15467    fn from_str(s: &str) -> Result<Self, Self::Err> {
15468        use CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit::*;
15469        match s {
15470            "business_day" => Ok(BusinessDay),
15471            "day" => Ok(Day),
15472            "hour" => Ok(Hour),
15473            "month" => Ok(Month),
15474            "week" => Ok(Week),
15475            v => {
15476                tracing::warn!(
15477                    "Unknown value '{}' for enum '{}'",
15478                    v,
15479                    "CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit"
15480                );
15481                Ok(Unknown(v.to_owned()))
15482            }
15483        }
15484    }
15485}
15486impl std::fmt::Display
15487    for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit
15488{
15489    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15490        f.write_str(self.as_str())
15491    }
15492}
15493
15494#[cfg(not(feature = "redact-generated-debug"))]
15495impl std::fmt::Debug
15496    for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit
15497{
15498    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15499        f.write_str(self.as_str())
15500    }
15501}
15502#[cfg(feature = "redact-generated-debug")]
15503impl std::fmt::Debug
15504    for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit
15505{
15506    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15507        f.debug_struct(stringify!(
15508            CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit
15509        ))
15510        .finish_non_exhaustive()
15511    }
15512}
15513impl serde::Serialize
15514    for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit
15515{
15516    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15517    where
15518        S: serde::Serializer,
15519    {
15520        serializer.serialize_str(self.as_str())
15521    }
15522}
15523#[cfg(feature = "deserialize")]
15524impl<'de> serde::Deserialize<'de>
15525    for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit
15526{
15527    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15528        use std::str::FromStr;
15529        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15530        Ok(Self::from_str(&s).expect("infallible"))
15531    }
15532}
15533/// Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`.
15534#[derive(Clone)]
15535#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
15536#[derive(serde::Serialize)]
15537pub struct CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmount {
15538    /// A non-negative integer in cents representing how much to charge.
15539    pub amount: i64,
15540    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
15541    /// Must be a [supported currency](https://stripe.com/docs/currencies).
15542    pub currency: stripe_types::Currency,
15543    /// Shipping rates defined in each available currency option.
15544    /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
15545    #[serde(skip_serializing_if = "Option::is_none")]
15546    pub currency_options: Option<
15547        std::collections::HashMap<
15548            stripe_types::Currency,
15549            CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptions,
15550        >,
15551    >,
15552}
15553#[cfg(feature = "redact-generated-debug")]
15554impl std::fmt::Debug for CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmount {
15555    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15556        f.debug_struct("CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmount")
15557            .finish_non_exhaustive()
15558    }
15559}
15560impl CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmount {
15561    pub fn new(amount: impl Into<i64>, currency: impl Into<stripe_types::Currency>) -> Self {
15562        Self { amount: amount.into(), currency: currency.into(), currency_options: None }
15563    }
15564}
15565/// Shipping rates defined in each available currency option.
15566/// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
15567#[derive(Clone, Eq, PartialEq)]
15568#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
15569#[derive(serde::Serialize)]
15570pub struct CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptions {
15571    /// A non-negative integer in cents representing how much to charge.
15572    pub amount: i64,
15573    /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes.
15574    /// One of `inclusive`, `exclusive`, or `unspecified`.
15575    #[serde(skip_serializing_if = "Option::is_none")]
15576    pub tax_behavior: Option<
15577        CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior,
15578    >,
15579}
15580#[cfg(feature = "redact-generated-debug")]
15581impl std::fmt::Debug
15582    for CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptions
15583{
15584    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15585        f.debug_struct(
15586            "CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptions",
15587        )
15588        .finish_non_exhaustive()
15589    }
15590}
15591impl CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptions {
15592    pub fn new(amount: impl Into<i64>) -> Self {
15593        Self { amount: amount.into(), tax_behavior: None }
15594    }
15595}
15596/// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes.
15597/// One of `inclusive`, `exclusive`, or `unspecified`.
15598#[derive(Clone, Eq, PartialEq)]
15599#[non_exhaustive]
15600pub enum CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior {
15601    Exclusive,
15602    Inclusive,
15603    Unspecified,
15604    /// An unrecognized value from Stripe. Should not be used as a request parameter.
15605    Unknown(String),
15606}
15607impl CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior {
15608    pub fn as_str(&self) -> &str {
15609        use CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior::*;
15610        match self {
15611            Exclusive => "exclusive",
15612            Inclusive => "inclusive",
15613            Unspecified => "unspecified",
15614            Unknown(v) => v,
15615        }
15616    }
15617}
15618
15619impl std::str::FromStr
15620    for CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior
15621{
15622    type Err = std::convert::Infallible;
15623    fn from_str(s: &str) -> Result<Self, Self::Err> {
15624        use CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior::*;
15625        match s {
15626            "exclusive" => Ok(Exclusive),
15627            "inclusive" => Ok(Inclusive),
15628            "unspecified" => Ok(Unspecified),
15629            v => {
15630                tracing::warn!(
15631                    "Unknown value '{}' for enum '{}'",
15632                    v,
15633                    "CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior"
15634                );
15635                Ok(Unknown(v.to_owned()))
15636            }
15637        }
15638    }
15639}
15640impl std::fmt::Display
15641    for CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior
15642{
15643    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15644        f.write_str(self.as_str())
15645    }
15646}
15647
15648#[cfg(not(feature = "redact-generated-debug"))]
15649impl std::fmt::Debug
15650    for CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior
15651{
15652    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15653        f.write_str(self.as_str())
15654    }
15655}
15656#[cfg(feature = "redact-generated-debug")]
15657impl std::fmt::Debug
15658    for CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior
15659{
15660    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15661        f.debug_struct(stringify!(CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior)).finish_non_exhaustive()
15662    }
15663}
15664impl serde::Serialize
15665    for CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior
15666{
15667    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15668    where
15669        S: serde::Serializer,
15670    {
15671        serializer.serialize_str(self.as_str())
15672    }
15673}
15674#[cfg(feature = "deserialize")]
15675impl<'de> serde::Deserialize<'de>
15676    for CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior
15677{
15678    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15679        use std::str::FromStr;
15680        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15681        Ok(Self::from_str(&s).expect("infallible"))
15682    }
15683}
15684/// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes.
15685/// One of `inclusive`, `exclusive`, or `unspecified`.
15686#[derive(Clone, Eq, PartialEq)]
15687#[non_exhaustive]
15688pub enum CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior {
15689    Exclusive,
15690    Inclusive,
15691    Unspecified,
15692    /// An unrecognized value from Stripe. Should not be used as a request parameter.
15693    Unknown(String),
15694}
15695impl CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior {
15696    pub fn as_str(&self) -> &str {
15697        use CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior::*;
15698        match self {
15699            Exclusive => "exclusive",
15700            Inclusive => "inclusive",
15701            Unspecified => "unspecified",
15702            Unknown(v) => v,
15703        }
15704    }
15705}
15706
15707impl std::str::FromStr for CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior {
15708    type Err = std::convert::Infallible;
15709    fn from_str(s: &str) -> Result<Self, Self::Err> {
15710        use CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior::*;
15711        match s {
15712            "exclusive" => Ok(Exclusive),
15713            "inclusive" => Ok(Inclusive),
15714            "unspecified" => Ok(Unspecified),
15715            v => {
15716                tracing::warn!(
15717                    "Unknown value '{}' for enum '{}'",
15718                    v,
15719                    "CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior"
15720                );
15721                Ok(Unknown(v.to_owned()))
15722            }
15723        }
15724    }
15725}
15726impl std::fmt::Display for CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior {
15727    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15728        f.write_str(self.as_str())
15729    }
15730}
15731
15732#[cfg(not(feature = "redact-generated-debug"))]
15733impl std::fmt::Debug for CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior {
15734    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15735        f.write_str(self.as_str())
15736    }
15737}
15738#[cfg(feature = "redact-generated-debug")]
15739impl std::fmt::Debug for CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior {
15740    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15741        f.debug_struct(stringify!(CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior))
15742            .finish_non_exhaustive()
15743    }
15744}
15745impl serde::Serialize for CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior {
15746    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15747    where
15748        S: serde::Serializer,
15749    {
15750        serializer.serialize_str(self.as_str())
15751    }
15752}
15753#[cfg(feature = "deserialize")]
15754impl<'de> serde::Deserialize<'de>
15755    for CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior
15756{
15757    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15758        use std::str::FromStr;
15759        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15760        Ok(Self::from_str(&s).expect("infallible"))
15761    }
15762}
15763/// The type of calculation to use on the shipping rate.
15764#[derive(Clone, Eq, PartialEq)]
15765#[non_exhaustive]
15766pub enum CreateCheckoutSessionShippingOptionsShippingRateDataType {
15767    FixedAmount,
15768    /// An unrecognized value from Stripe. Should not be used as a request parameter.
15769    Unknown(String),
15770}
15771impl CreateCheckoutSessionShippingOptionsShippingRateDataType {
15772    pub fn as_str(&self) -> &str {
15773        use CreateCheckoutSessionShippingOptionsShippingRateDataType::*;
15774        match self {
15775            FixedAmount => "fixed_amount",
15776            Unknown(v) => v,
15777        }
15778    }
15779}
15780
15781impl std::str::FromStr for CreateCheckoutSessionShippingOptionsShippingRateDataType {
15782    type Err = std::convert::Infallible;
15783    fn from_str(s: &str) -> Result<Self, Self::Err> {
15784        use CreateCheckoutSessionShippingOptionsShippingRateDataType::*;
15785        match s {
15786            "fixed_amount" => Ok(FixedAmount),
15787            v => {
15788                tracing::warn!(
15789                    "Unknown value '{}' for enum '{}'",
15790                    v,
15791                    "CreateCheckoutSessionShippingOptionsShippingRateDataType"
15792                );
15793                Ok(Unknown(v.to_owned()))
15794            }
15795        }
15796    }
15797}
15798impl std::fmt::Display for CreateCheckoutSessionShippingOptionsShippingRateDataType {
15799    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15800        f.write_str(self.as_str())
15801    }
15802}
15803
15804#[cfg(not(feature = "redact-generated-debug"))]
15805impl std::fmt::Debug for CreateCheckoutSessionShippingOptionsShippingRateDataType {
15806    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15807        f.write_str(self.as_str())
15808    }
15809}
15810#[cfg(feature = "redact-generated-debug")]
15811impl std::fmt::Debug for CreateCheckoutSessionShippingOptionsShippingRateDataType {
15812    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15813        f.debug_struct(stringify!(CreateCheckoutSessionShippingOptionsShippingRateDataType))
15814            .finish_non_exhaustive()
15815    }
15816}
15817impl serde::Serialize for CreateCheckoutSessionShippingOptionsShippingRateDataType {
15818    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15819    where
15820        S: serde::Serializer,
15821    {
15822        serializer.serialize_str(self.as_str())
15823    }
15824}
15825#[cfg(feature = "deserialize")]
15826impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionShippingOptionsShippingRateDataType {
15827    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15828        use std::str::FromStr;
15829        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15830        Ok(Self::from_str(&s).expect("infallible"))
15831    }
15832}
15833/// A subset of parameters to be passed to subscription creation for Checkout Sessions in `subscription` mode.
15834#[derive(Clone)]
15835#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
15836#[derive(serde::Serialize)]
15837pub struct CreateCheckoutSessionSubscriptionData {
15838    /// A non-negative decimal between 0 and 100, with at most two decimal places.
15839    /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account.
15840    /// To use an application fee percent, the request must be made on behalf of another account, using the `Stripe-Account` header or an OAuth key.
15841    /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).
15842    #[serde(skip_serializing_if = "Option::is_none")]
15843    pub application_fee_percent: Option<f64>,
15844    /// A future timestamp to anchor the subscription's billing cycle for new subscriptions.
15845    #[serde(skip_serializing_if = "Option::is_none")]
15846    pub billing_cycle_anchor: Option<stripe_types::Timestamp>,
15847    /// Configures when the subscription schedule's billing cycle anchors to a specific day of the week or month.
15848    #[serde(skip_serializing_if = "Option::is_none")]
15849    pub billing_cycle_anchor_config:
15850        Option<CreateCheckoutSessionSubscriptionDataBillingCycleAnchorConfig>,
15851    /// Controls how prorations and invoices for subscriptions are calculated and orchestrated.
15852    #[serde(skip_serializing_if = "Option::is_none")]
15853    pub billing_mode: Option<CreateCheckoutSessionSubscriptionDataBillingMode>,
15854    /// The tax rates that will apply to any subscription item that does not have
15855    /// `tax_rates` set. Invoices created will have their `default_tax_rates` populated
15856    /// from the subscription.
15857    #[serde(skip_serializing_if = "Option::is_none")]
15858    pub default_tax_rates: Option<Vec<String>>,
15859    /// The subscription's description, meant to be displayable to the customer.
15860    /// Use this field to optionally store an explanation of the subscription
15861    /// for rendering in the [customer portal](https://docs.stripe.com/customer-management).
15862    #[serde(skip_serializing_if = "Option::is_none")]
15863    pub description: Option<String>,
15864    /// All invoices will be billed using the specified settings.
15865    #[serde(skip_serializing_if = "Option::is_none")]
15866    pub invoice_settings: Option<CreateCheckoutSessionSubscriptionDataInvoiceSettings>,
15867    /// Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object.
15868    /// This can be useful for storing additional information about the object in a structured format.
15869    /// Individual keys can be unset by posting an empty value to them.
15870    /// All keys can be unset by posting an empty value to `metadata`.
15871    #[serde(skip_serializing_if = "Option::is_none")]
15872    pub metadata: Option<std::collections::HashMap<String, String>>,
15873    /// The account on behalf of which to charge, for each of the subscription's invoices.
15874    #[serde(skip_serializing_if = "Option::is_none")]
15875    pub on_behalf_of: Option<String>,
15876    /// Specifies an interval for how often to bill for any pending invoice items.
15877    /// It is analogous to calling [Create an invoice](https://docs.stripe.com/api#create_invoice) for the given subscription at the specified interval.
15878    #[serde(skip_serializing_if = "Option::is_none")]
15879    pub pending_invoice_item_interval:
15880        Option<CreateCheckoutSessionSubscriptionDataPendingInvoiceItemInterval>,
15881    /// Determines how to handle prorations resulting from the `billing_cycle_anchor`.
15882    /// If no value is passed, the default is `create_prorations`.
15883    #[serde(skip_serializing_if = "Option::is_none")]
15884    pub proration_behavior: Option<CreateCheckoutSessionSubscriptionDataProrationBehavior>,
15885    /// If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges.
15886    #[serde(skip_serializing_if = "Option::is_none")]
15887    pub transfer_data: Option<CreateCheckoutSessionSubscriptionDataTransferData>,
15888    /// Unix timestamp representing the end of the trial period the customer will get before being charged for the first time.
15889    /// Has to be at least 48 hours in the future.
15890    #[serde(skip_serializing_if = "Option::is_none")]
15891    pub trial_end: Option<stripe_types::Timestamp>,
15892    /// Integer representing the number of trial period days before the customer is charged for the first time.
15893    /// Has to be at least 1.
15894    #[serde(skip_serializing_if = "Option::is_none")]
15895    pub trial_period_days: Option<u32>,
15896    /// Settings related to subscription trials.
15897    #[serde(skip_serializing_if = "Option::is_none")]
15898    pub trial_settings: Option<CreateCheckoutSessionSubscriptionDataTrialSettings>,
15899}
15900#[cfg(feature = "redact-generated-debug")]
15901impl std::fmt::Debug for CreateCheckoutSessionSubscriptionData {
15902    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15903        f.debug_struct("CreateCheckoutSessionSubscriptionData").finish_non_exhaustive()
15904    }
15905}
15906impl CreateCheckoutSessionSubscriptionData {
15907    pub fn new() -> Self {
15908        Self {
15909            application_fee_percent: None,
15910            billing_cycle_anchor: None,
15911            billing_cycle_anchor_config: None,
15912            billing_mode: None,
15913            default_tax_rates: None,
15914            description: None,
15915            invoice_settings: None,
15916            metadata: None,
15917            on_behalf_of: None,
15918            pending_invoice_item_interval: None,
15919            proration_behavior: None,
15920            transfer_data: None,
15921            trial_end: None,
15922            trial_period_days: None,
15923            trial_settings: None,
15924        }
15925    }
15926}
15927impl Default for CreateCheckoutSessionSubscriptionData {
15928    fn default() -> Self {
15929        Self::new()
15930    }
15931}
15932/// Configures when the subscription schedule's billing cycle anchors to a specific day of the week or month.
15933#[derive(Copy, Clone, Eq, PartialEq)]
15934#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
15935#[derive(serde::Serialize)]
15936pub struct CreateCheckoutSessionSubscriptionDataBillingCycleAnchorConfig {
15937    /// The day of the month the anchor should be. Ranges from 1 to 31.
15938    pub day_of_month: i64,
15939    /// The hour of the day the anchor should be. Ranges from 0 to 23.
15940    #[serde(skip_serializing_if = "Option::is_none")]
15941    pub hour: Option<i64>,
15942    /// The minute of the hour the anchor should be. Ranges from 0 to 59.
15943    #[serde(skip_serializing_if = "Option::is_none")]
15944    pub minute: Option<i64>,
15945    /// The month to start full cycle periods. Ranges from 1 to 12.
15946    #[serde(skip_serializing_if = "Option::is_none")]
15947    pub month: Option<i64>,
15948    /// The second of the minute the anchor should be. Ranges from 0 to 59.
15949    #[serde(skip_serializing_if = "Option::is_none")]
15950    pub second: Option<i64>,
15951}
15952#[cfg(feature = "redact-generated-debug")]
15953impl std::fmt::Debug for CreateCheckoutSessionSubscriptionDataBillingCycleAnchorConfig {
15954    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15955        f.debug_struct("CreateCheckoutSessionSubscriptionDataBillingCycleAnchorConfig")
15956            .finish_non_exhaustive()
15957    }
15958}
15959impl CreateCheckoutSessionSubscriptionDataBillingCycleAnchorConfig {
15960    pub fn new(day_of_month: impl Into<i64>) -> Self {
15961        Self {
15962            day_of_month: day_of_month.into(),
15963            hour: None,
15964            minute: None,
15965            month: None,
15966            second: None,
15967        }
15968    }
15969}
15970/// Controls how prorations and invoices for subscriptions are calculated and orchestrated.
15971#[derive(Clone, Eq, PartialEq)]
15972#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
15973#[derive(serde::Serialize)]
15974pub struct CreateCheckoutSessionSubscriptionDataBillingMode {
15975    /// Configure behavior for flexible billing mode.
15976    #[serde(skip_serializing_if = "Option::is_none")]
15977    pub flexible: Option<CreateCheckoutSessionSubscriptionDataBillingModeFlexible>,
15978    /// Controls the calculation and orchestration of prorations and invoices for subscriptions.
15979    /// If no value is passed, the default is `flexible`.
15980    #[serde(rename = "type")]
15981    pub type_: CreateCheckoutSessionSubscriptionDataBillingModeType,
15982}
15983#[cfg(feature = "redact-generated-debug")]
15984impl std::fmt::Debug for CreateCheckoutSessionSubscriptionDataBillingMode {
15985    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15986        f.debug_struct("CreateCheckoutSessionSubscriptionDataBillingMode").finish_non_exhaustive()
15987    }
15988}
15989impl CreateCheckoutSessionSubscriptionDataBillingMode {
15990    pub fn new(type_: impl Into<CreateCheckoutSessionSubscriptionDataBillingModeType>) -> Self {
15991        Self { flexible: None, type_: type_.into() }
15992    }
15993}
15994/// Configure behavior for flexible billing mode.
15995#[derive(Clone, Eq, PartialEq)]
15996#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
15997#[derive(serde::Serialize)]
15998pub struct CreateCheckoutSessionSubscriptionDataBillingModeFlexible {
15999    /// Controls how invoices and invoice items display proration amounts and discount amounts.
16000    #[serde(skip_serializing_if = "Option::is_none")]
16001    pub proration_discounts:
16002        Option<CreateCheckoutSessionSubscriptionDataBillingModeFlexibleProrationDiscounts>,
16003}
16004#[cfg(feature = "redact-generated-debug")]
16005impl std::fmt::Debug for CreateCheckoutSessionSubscriptionDataBillingModeFlexible {
16006    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16007        f.debug_struct("CreateCheckoutSessionSubscriptionDataBillingModeFlexible")
16008            .finish_non_exhaustive()
16009    }
16010}
16011impl CreateCheckoutSessionSubscriptionDataBillingModeFlexible {
16012    pub fn new() -> Self {
16013        Self { proration_discounts: None }
16014    }
16015}
16016impl Default for CreateCheckoutSessionSubscriptionDataBillingModeFlexible {
16017    fn default() -> Self {
16018        Self::new()
16019    }
16020}
16021/// Controls how invoices and invoice items display proration amounts and discount amounts.
16022#[derive(Clone, Eq, PartialEq)]
16023#[non_exhaustive]
16024pub enum CreateCheckoutSessionSubscriptionDataBillingModeFlexibleProrationDiscounts {
16025    Included,
16026    Itemized,
16027    /// An unrecognized value from Stripe. Should not be used as a request parameter.
16028    Unknown(String),
16029}
16030impl CreateCheckoutSessionSubscriptionDataBillingModeFlexibleProrationDiscounts {
16031    pub fn as_str(&self) -> &str {
16032        use CreateCheckoutSessionSubscriptionDataBillingModeFlexibleProrationDiscounts::*;
16033        match self {
16034            Included => "included",
16035            Itemized => "itemized",
16036            Unknown(v) => v,
16037        }
16038    }
16039}
16040
16041impl std::str::FromStr
16042    for CreateCheckoutSessionSubscriptionDataBillingModeFlexibleProrationDiscounts
16043{
16044    type Err = std::convert::Infallible;
16045    fn from_str(s: &str) -> Result<Self, Self::Err> {
16046        use CreateCheckoutSessionSubscriptionDataBillingModeFlexibleProrationDiscounts::*;
16047        match s {
16048            "included" => Ok(Included),
16049            "itemized" => Ok(Itemized),
16050            v => {
16051                tracing::warn!(
16052                    "Unknown value '{}' for enum '{}'",
16053                    v,
16054                    "CreateCheckoutSessionSubscriptionDataBillingModeFlexibleProrationDiscounts"
16055                );
16056                Ok(Unknown(v.to_owned()))
16057            }
16058        }
16059    }
16060}
16061impl std::fmt::Display
16062    for CreateCheckoutSessionSubscriptionDataBillingModeFlexibleProrationDiscounts
16063{
16064    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16065        f.write_str(self.as_str())
16066    }
16067}
16068
16069#[cfg(not(feature = "redact-generated-debug"))]
16070impl std::fmt::Debug
16071    for CreateCheckoutSessionSubscriptionDataBillingModeFlexibleProrationDiscounts
16072{
16073    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16074        f.write_str(self.as_str())
16075    }
16076}
16077#[cfg(feature = "redact-generated-debug")]
16078impl std::fmt::Debug
16079    for CreateCheckoutSessionSubscriptionDataBillingModeFlexibleProrationDiscounts
16080{
16081    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16082        f.debug_struct(stringify!(
16083            CreateCheckoutSessionSubscriptionDataBillingModeFlexibleProrationDiscounts
16084        ))
16085        .finish_non_exhaustive()
16086    }
16087}
16088impl serde::Serialize
16089    for CreateCheckoutSessionSubscriptionDataBillingModeFlexibleProrationDiscounts
16090{
16091    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16092    where
16093        S: serde::Serializer,
16094    {
16095        serializer.serialize_str(self.as_str())
16096    }
16097}
16098#[cfg(feature = "deserialize")]
16099impl<'de> serde::Deserialize<'de>
16100    for CreateCheckoutSessionSubscriptionDataBillingModeFlexibleProrationDiscounts
16101{
16102    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16103        use std::str::FromStr;
16104        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16105        Ok(Self::from_str(&s).expect("infallible"))
16106    }
16107}
16108/// Controls the calculation and orchestration of prorations and invoices for subscriptions.
16109/// If no value is passed, the default is `flexible`.
16110#[derive(Clone, Eq, PartialEq)]
16111#[non_exhaustive]
16112pub enum CreateCheckoutSessionSubscriptionDataBillingModeType {
16113    Classic,
16114    Flexible,
16115    /// An unrecognized value from Stripe. Should not be used as a request parameter.
16116    Unknown(String),
16117}
16118impl CreateCheckoutSessionSubscriptionDataBillingModeType {
16119    pub fn as_str(&self) -> &str {
16120        use CreateCheckoutSessionSubscriptionDataBillingModeType::*;
16121        match self {
16122            Classic => "classic",
16123            Flexible => "flexible",
16124            Unknown(v) => v,
16125        }
16126    }
16127}
16128
16129impl std::str::FromStr for CreateCheckoutSessionSubscriptionDataBillingModeType {
16130    type Err = std::convert::Infallible;
16131    fn from_str(s: &str) -> Result<Self, Self::Err> {
16132        use CreateCheckoutSessionSubscriptionDataBillingModeType::*;
16133        match s {
16134            "classic" => Ok(Classic),
16135            "flexible" => Ok(Flexible),
16136            v => {
16137                tracing::warn!(
16138                    "Unknown value '{}' for enum '{}'",
16139                    v,
16140                    "CreateCheckoutSessionSubscriptionDataBillingModeType"
16141                );
16142                Ok(Unknown(v.to_owned()))
16143            }
16144        }
16145    }
16146}
16147impl std::fmt::Display for CreateCheckoutSessionSubscriptionDataBillingModeType {
16148    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16149        f.write_str(self.as_str())
16150    }
16151}
16152
16153#[cfg(not(feature = "redact-generated-debug"))]
16154impl std::fmt::Debug for CreateCheckoutSessionSubscriptionDataBillingModeType {
16155    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16156        f.write_str(self.as_str())
16157    }
16158}
16159#[cfg(feature = "redact-generated-debug")]
16160impl std::fmt::Debug for CreateCheckoutSessionSubscriptionDataBillingModeType {
16161    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16162        f.debug_struct(stringify!(CreateCheckoutSessionSubscriptionDataBillingModeType))
16163            .finish_non_exhaustive()
16164    }
16165}
16166impl serde::Serialize for CreateCheckoutSessionSubscriptionDataBillingModeType {
16167    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16168    where
16169        S: serde::Serializer,
16170    {
16171        serializer.serialize_str(self.as_str())
16172    }
16173}
16174#[cfg(feature = "deserialize")]
16175impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionSubscriptionDataBillingModeType {
16176    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16177        use std::str::FromStr;
16178        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16179        Ok(Self::from_str(&s).expect("infallible"))
16180    }
16181}
16182/// All invoices will be billed using the specified settings.
16183#[derive(Clone, Eq, PartialEq)]
16184#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
16185#[derive(serde::Serialize)]
16186pub struct CreateCheckoutSessionSubscriptionDataInvoiceSettings {
16187    /// The connected account that issues the invoice.
16188    /// The invoice is presented with the branding and support information of the specified account.
16189    #[serde(skip_serializing_if = "Option::is_none")]
16190    pub issuer: Option<CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuer>,
16191}
16192#[cfg(feature = "redact-generated-debug")]
16193impl std::fmt::Debug for CreateCheckoutSessionSubscriptionDataInvoiceSettings {
16194    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16195        f.debug_struct("CreateCheckoutSessionSubscriptionDataInvoiceSettings")
16196            .finish_non_exhaustive()
16197    }
16198}
16199impl CreateCheckoutSessionSubscriptionDataInvoiceSettings {
16200    pub fn new() -> Self {
16201        Self { issuer: None }
16202    }
16203}
16204impl Default for CreateCheckoutSessionSubscriptionDataInvoiceSettings {
16205    fn default() -> Self {
16206        Self::new()
16207    }
16208}
16209/// The connected account that issues the invoice.
16210/// The invoice is presented with the branding and support information of the specified account.
16211#[derive(Clone, Eq, PartialEq)]
16212#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
16213#[derive(serde::Serialize)]
16214pub struct CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuer {
16215    /// The connected account being referenced when `type` is `account`.
16216    #[serde(skip_serializing_if = "Option::is_none")]
16217    pub account: Option<String>,
16218    /// Type of the account referenced in the request.
16219    #[serde(rename = "type")]
16220    pub type_: CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType,
16221}
16222#[cfg(feature = "redact-generated-debug")]
16223impl std::fmt::Debug for CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuer {
16224    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16225        f.debug_struct("CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuer")
16226            .finish_non_exhaustive()
16227    }
16228}
16229impl CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuer {
16230    pub fn new(
16231        type_: impl Into<CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType>,
16232    ) -> Self {
16233        Self { account: None, type_: type_.into() }
16234    }
16235}
16236/// Type of the account referenced in the request.
16237#[derive(Clone, Eq, PartialEq)]
16238#[non_exhaustive]
16239pub enum CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType {
16240    Account,
16241    Self_,
16242    /// An unrecognized value from Stripe. Should not be used as a request parameter.
16243    Unknown(String),
16244}
16245impl CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType {
16246    pub fn as_str(&self) -> &str {
16247        use CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType::*;
16248        match self {
16249            Account => "account",
16250            Self_ => "self",
16251            Unknown(v) => v,
16252        }
16253    }
16254}
16255
16256impl std::str::FromStr for CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType {
16257    type Err = std::convert::Infallible;
16258    fn from_str(s: &str) -> Result<Self, Self::Err> {
16259        use CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType::*;
16260        match s {
16261            "account" => Ok(Account),
16262            "self" => Ok(Self_),
16263            v => {
16264                tracing::warn!(
16265                    "Unknown value '{}' for enum '{}'",
16266                    v,
16267                    "CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType"
16268                );
16269                Ok(Unknown(v.to_owned()))
16270            }
16271        }
16272    }
16273}
16274impl std::fmt::Display for CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType {
16275    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16276        f.write_str(self.as_str())
16277    }
16278}
16279
16280#[cfg(not(feature = "redact-generated-debug"))]
16281impl std::fmt::Debug for CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType {
16282    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16283        f.write_str(self.as_str())
16284    }
16285}
16286#[cfg(feature = "redact-generated-debug")]
16287impl std::fmt::Debug for CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType {
16288    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16289        f.debug_struct(stringify!(CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType))
16290            .finish_non_exhaustive()
16291    }
16292}
16293impl serde::Serialize for CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType {
16294    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16295    where
16296        S: serde::Serializer,
16297    {
16298        serializer.serialize_str(self.as_str())
16299    }
16300}
16301#[cfg(feature = "deserialize")]
16302impl<'de> serde::Deserialize<'de>
16303    for CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType
16304{
16305    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16306        use std::str::FromStr;
16307        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16308        Ok(Self::from_str(&s).expect("infallible"))
16309    }
16310}
16311/// Specifies an interval for how often to bill for any pending invoice items.
16312/// It is analogous to calling [Create an invoice](https://docs.stripe.com/api#create_invoice) for the given subscription at the specified interval.
16313#[derive(Clone, Eq, PartialEq)]
16314#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
16315#[derive(serde::Serialize)]
16316pub struct CreateCheckoutSessionSubscriptionDataPendingInvoiceItemInterval {
16317    /// Specifies invoicing frequency. Either `day`, `week`, `month` or `year`.
16318    pub interval: CreateCheckoutSessionSubscriptionDataPendingInvoiceItemIntervalInterval,
16319    /// The number of intervals between invoices.
16320    /// For example, `interval=month` and `interval_count=3` bills every 3 months.
16321    /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).
16322    #[serde(skip_serializing_if = "Option::is_none")]
16323    pub interval_count: Option<u64>,
16324}
16325#[cfg(feature = "redact-generated-debug")]
16326impl std::fmt::Debug for CreateCheckoutSessionSubscriptionDataPendingInvoiceItemInterval {
16327    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16328        f.debug_struct("CreateCheckoutSessionSubscriptionDataPendingInvoiceItemInterval")
16329            .finish_non_exhaustive()
16330    }
16331}
16332impl CreateCheckoutSessionSubscriptionDataPendingInvoiceItemInterval {
16333    pub fn new(
16334        interval: impl Into<CreateCheckoutSessionSubscriptionDataPendingInvoiceItemIntervalInterval>,
16335    ) -> Self {
16336        Self { interval: interval.into(), interval_count: None }
16337    }
16338}
16339/// Specifies invoicing frequency. Either `day`, `week`, `month` or `year`.
16340#[derive(Clone, Eq, PartialEq)]
16341#[non_exhaustive]
16342pub enum CreateCheckoutSessionSubscriptionDataPendingInvoiceItemIntervalInterval {
16343    Day,
16344    Month,
16345    Week,
16346    Year,
16347    /// An unrecognized value from Stripe. Should not be used as a request parameter.
16348    Unknown(String),
16349}
16350impl CreateCheckoutSessionSubscriptionDataPendingInvoiceItemIntervalInterval {
16351    pub fn as_str(&self) -> &str {
16352        use CreateCheckoutSessionSubscriptionDataPendingInvoiceItemIntervalInterval::*;
16353        match self {
16354            Day => "day",
16355            Month => "month",
16356            Week => "week",
16357            Year => "year",
16358            Unknown(v) => v,
16359        }
16360    }
16361}
16362
16363impl std::str::FromStr for CreateCheckoutSessionSubscriptionDataPendingInvoiceItemIntervalInterval {
16364    type Err = std::convert::Infallible;
16365    fn from_str(s: &str) -> Result<Self, Self::Err> {
16366        use CreateCheckoutSessionSubscriptionDataPendingInvoiceItemIntervalInterval::*;
16367        match s {
16368            "day" => Ok(Day),
16369            "month" => Ok(Month),
16370            "week" => Ok(Week),
16371            "year" => Ok(Year),
16372            v => {
16373                tracing::warn!(
16374                    "Unknown value '{}' for enum '{}'",
16375                    v,
16376                    "CreateCheckoutSessionSubscriptionDataPendingInvoiceItemIntervalInterval"
16377                );
16378                Ok(Unknown(v.to_owned()))
16379            }
16380        }
16381    }
16382}
16383impl std::fmt::Display for CreateCheckoutSessionSubscriptionDataPendingInvoiceItemIntervalInterval {
16384    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16385        f.write_str(self.as_str())
16386    }
16387}
16388
16389#[cfg(not(feature = "redact-generated-debug"))]
16390impl std::fmt::Debug for CreateCheckoutSessionSubscriptionDataPendingInvoiceItemIntervalInterval {
16391    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16392        f.write_str(self.as_str())
16393    }
16394}
16395#[cfg(feature = "redact-generated-debug")]
16396impl std::fmt::Debug for CreateCheckoutSessionSubscriptionDataPendingInvoiceItemIntervalInterval {
16397    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16398        f.debug_struct(stringify!(
16399            CreateCheckoutSessionSubscriptionDataPendingInvoiceItemIntervalInterval
16400        ))
16401        .finish_non_exhaustive()
16402    }
16403}
16404impl serde::Serialize for CreateCheckoutSessionSubscriptionDataPendingInvoiceItemIntervalInterval {
16405    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16406    where
16407        S: serde::Serializer,
16408    {
16409        serializer.serialize_str(self.as_str())
16410    }
16411}
16412#[cfg(feature = "deserialize")]
16413impl<'de> serde::Deserialize<'de>
16414    for CreateCheckoutSessionSubscriptionDataPendingInvoiceItemIntervalInterval
16415{
16416    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16417        use std::str::FromStr;
16418        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16419        Ok(Self::from_str(&s).expect("infallible"))
16420    }
16421}
16422/// Determines how to handle prorations resulting from the `billing_cycle_anchor`.
16423/// If no value is passed, the default is `create_prorations`.
16424#[derive(Clone, Eq, PartialEq)]
16425#[non_exhaustive]
16426pub enum CreateCheckoutSessionSubscriptionDataProrationBehavior {
16427    CreateProrations,
16428    None,
16429    /// An unrecognized value from Stripe. Should not be used as a request parameter.
16430    Unknown(String),
16431}
16432impl CreateCheckoutSessionSubscriptionDataProrationBehavior {
16433    pub fn as_str(&self) -> &str {
16434        use CreateCheckoutSessionSubscriptionDataProrationBehavior::*;
16435        match self {
16436            CreateProrations => "create_prorations",
16437            None => "none",
16438            Unknown(v) => v,
16439        }
16440    }
16441}
16442
16443impl std::str::FromStr for CreateCheckoutSessionSubscriptionDataProrationBehavior {
16444    type Err = std::convert::Infallible;
16445    fn from_str(s: &str) -> Result<Self, Self::Err> {
16446        use CreateCheckoutSessionSubscriptionDataProrationBehavior::*;
16447        match s {
16448            "create_prorations" => Ok(CreateProrations),
16449            "none" => Ok(None),
16450            v => {
16451                tracing::warn!(
16452                    "Unknown value '{}' for enum '{}'",
16453                    v,
16454                    "CreateCheckoutSessionSubscriptionDataProrationBehavior"
16455                );
16456                Ok(Unknown(v.to_owned()))
16457            }
16458        }
16459    }
16460}
16461impl std::fmt::Display for CreateCheckoutSessionSubscriptionDataProrationBehavior {
16462    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16463        f.write_str(self.as_str())
16464    }
16465}
16466
16467#[cfg(not(feature = "redact-generated-debug"))]
16468impl std::fmt::Debug for CreateCheckoutSessionSubscriptionDataProrationBehavior {
16469    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16470        f.write_str(self.as_str())
16471    }
16472}
16473#[cfg(feature = "redact-generated-debug")]
16474impl std::fmt::Debug for CreateCheckoutSessionSubscriptionDataProrationBehavior {
16475    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16476        f.debug_struct(stringify!(CreateCheckoutSessionSubscriptionDataProrationBehavior))
16477            .finish_non_exhaustive()
16478    }
16479}
16480impl serde::Serialize for CreateCheckoutSessionSubscriptionDataProrationBehavior {
16481    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16482    where
16483        S: serde::Serializer,
16484    {
16485        serializer.serialize_str(self.as_str())
16486    }
16487}
16488#[cfg(feature = "deserialize")]
16489impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionSubscriptionDataProrationBehavior {
16490    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16491        use std::str::FromStr;
16492        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16493        Ok(Self::from_str(&s).expect("infallible"))
16494    }
16495}
16496/// If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges.
16497#[derive(Clone)]
16498#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
16499#[derive(serde::Serialize)]
16500pub struct CreateCheckoutSessionSubscriptionDataTransferData {
16501    /// A non-negative decimal between 0 and 100, with at most two decimal places.
16502    /// This represents the percentage of the subscription invoice total that will be transferred to the destination account.
16503    /// By default, the entire amount is transferred to the destination.
16504    #[serde(skip_serializing_if = "Option::is_none")]
16505    pub amount_percent: Option<f64>,
16506    /// ID of an existing, connected Stripe account.
16507    pub destination: String,
16508}
16509#[cfg(feature = "redact-generated-debug")]
16510impl std::fmt::Debug for CreateCheckoutSessionSubscriptionDataTransferData {
16511    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16512        f.debug_struct("CreateCheckoutSessionSubscriptionDataTransferData").finish_non_exhaustive()
16513    }
16514}
16515impl CreateCheckoutSessionSubscriptionDataTransferData {
16516    pub fn new(destination: impl Into<String>) -> Self {
16517        Self { amount_percent: None, destination: destination.into() }
16518    }
16519}
16520/// Settings related to subscription trials.
16521#[derive(Clone, Eq, PartialEq)]
16522#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
16523#[derive(serde::Serialize)]
16524pub struct CreateCheckoutSessionSubscriptionDataTrialSettings {
16525    /// Defines how the subscription should behave when the user's free trial ends.
16526    pub end_behavior: CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehavior,
16527}
16528#[cfg(feature = "redact-generated-debug")]
16529impl std::fmt::Debug for CreateCheckoutSessionSubscriptionDataTrialSettings {
16530    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16531        f.debug_struct("CreateCheckoutSessionSubscriptionDataTrialSettings").finish_non_exhaustive()
16532    }
16533}
16534impl CreateCheckoutSessionSubscriptionDataTrialSettings {
16535    pub fn new(
16536        end_behavior: impl Into<CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehavior>,
16537    ) -> Self {
16538        Self { end_behavior: end_behavior.into() }
16539    }
16540}
16541/// Defines how the subscription should behave when the user's free trial ends.
16542#[derive(Clone, Eq, PartialEq)]
16543#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
16544#[derive(serde::Serialize)]
16545pub struct CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehavior {
16546    /// Indicates how the subscription should change when the trial ends if the user did not provide a payment method.
16547    pub missing_payment_method:
16548        CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod,
16549}
16550#[cfg(feature = "redact-generated-debug")]
16551impl std::fmt::Debug for CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehavior {
16552    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16553        f.debug_struct("CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehavior")
16554            .finish_non_exhaustive()
16555    }
16556}
16557impl CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehavior {
16558    pub fn new(
16559        missing_payment_method: impl Into<
16560            CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod,
16561        >,
16562    ) -> Self {
16563        Self { missing_payment_method: missing_payment_method.into() }
16564    }
16565}
16566/// Indicates how the subscription should change when the trial ends if the user did not provide a payment method.
16567#[derive(Clone, Eq, PartialEq)]
16568#[non_exhaustive]
16569pub enum CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod {
16570    Cancel,
16571    CreateInvoice,
16572    Pause,
16573    /// An unrecognized value from Stripe. Should not be used as a request parameter.
16574    Unknown(String),
16575}
16576impl CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod {
16577    pub fn as_str(&self) -> &str {
16578        use CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod::*;
16579        match self {
16580            Cancel => "cancel",
16581            CreateInvoice => "create_invoice",
16582            Pause => "pause",
16583            Unknown(v) => v,
16584        }
16585    }
16586}
16587
16588impl std::str::FromStr
16589    for CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod
16590{
16591    type Err = std::convert::Infallible;
16592    fn from_str(s: &str) -> Result<Self, Self::Err> {
16593        use CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod::*;
16594        match s {
16595            "cancel" => Ok(Cancel),
16596            "create_invoice" => Ok(CreateInvoice),
16597            "pause" => Ok(Pause),
16598            v => {
16599                tracing::warn!(
16600                    "Unknown value '{}' for enum '{}'",
16601                    v,
16602                    "CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod"
16603                );
16604                Ok(Unknown(v.to_owned()))
16605            }
16606        }
16607    }
16608}
16609impl std::fmt::Display
16610    for CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod
16611{
16612    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16613        f.write_str(self.as_str())
16614    }
16615}
16616
16617#[cfg(not(feature = "redact-generated-debug"))]
16618impl std::fmt::Debug
16619    for CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod
16620{
16621    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16622        f.write_str(self.as_str())
16623    }
16624}
16625#[cfg(feature = "redact-generated-debug")]
16626impl std::fmt::Debug
16627    for CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod
16628{
16629    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16630        f.debug_struct(stringify!(
16631            CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod
16632        ))
16633        .finish_non_exhaustive()
16634    }
16635}
16636impl serde::Serialize
16637    for CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod
16638{
16639    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16640    where
16641        S: serde::Serializer,
16642    {
16643        serializer.serialize_str(self.as_str())
16644    }
16645}
16646#[cfg(feature = "deserialize")]
16647impl<'de> serde::Deserialize<'de>
16648    for CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod
16649{
16650    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16651        use std::str::FromStr;
16652        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16653        Ok(Self::from_str(&s).expect("infallible"))
16654    }
16655}
16656/// Controls tax ID collection during checkout.
16657#[derive(Clone, Eq, PartialEq)]
16658#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
16659#[derive(serde::Serialize)]
16660pub struct CreateCheckoutSessionTaxIdCollection {
16661    /// Enable tax ID collection during checkout. Defaults to `false`.
16662    pub enabled: bool,
16663    /// Describes whether a tax ID is required during checkout.
16664    /// Defaults to `never`.
16665    /// You can't set this parameter if `ui_mode` is `custom`.
16666    #[serde(skip_serializing_if = "Option::is_none")]
16667    pub required: Option<CreateCheckoutSessionTaxIdCollectionRequired>,
16668}
16669#[cfg(feature = "redact-generated-debug")]
16670impl std::fmt::Debug for CreateCheckoutSessionTaxIdCollection {
16671    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16672        f.debug_struct("CreateCheckoutSessionTaxIdCollection").finish_non_exhaustive()
16673    }
16674}
16675impl CreateCheckoutSessionTaxIdCollection {
16676    pub fn new(enabled: impl Into<bool>) -> Self {
16677        Self { enabled: enabled.into(), required: None }
16678    }
16679}
16680/// Describes whether a tax ID is required during checkout.
16681/// Defaults to `never`.
16682/// You can't set this parameter if `ui_mode` is `custom`.
16683#[derive(Clone, Eq, PartialEq)]
16684#[non_exhaustive]
16685pub enum CreateCheckoutSessionTaxIdCollectionRequired {
16686    IfSupported,
16687    Never,
16688    /// An unrecognized value from Stripe. Should not be used as a request parameter.
16689    Unknown(String),
16690}
16691impl CreateCheckoutSessionTaxIdCollectionRequired {
16692    pub fn as_str(&self) -> &str {
16693        use CreateCheckoutSessionTaxIdCollectionRequired::*;
16694        match self {
16695            IfSupported => "if_supported",
16696            Never => "never",
16697            Unknown(v) => v,
16698        }
16699    }
16700}
16701
16702impl std::str::FromStr for CreateCheckoutSessionTaxIdCollectionRequired {
16703    type Err = std::convert::Infallible;
16704    fn from_str(s: &str) -> Result<Self, Self::Err> {
16705        use CreateCheckoutSessionTaxIdCollectionRequired::*;
16706        match s {
16707            "if_supported" => Ok(IfSupported),
16708            "never" => Ok(Never),
16709            v => {
16710                tracing::warn!(
16711                    "Unknown value '{}' for enum '{}'",
16712                    v,
16713                    "CreateCheckoutSessionTaxIdCollectionRequired"
16714                );
16715                Ok(Unknown(v.to_owned()))
16716            }
16717        }
16718    }
16719}
16720impl std::fmt::Display for CreateCheckoutSessionTaxIdCollectionRequired {
16721    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16722        f.write_str(self.as_str())
16723    }
16724}
16725
16726#[cfg(not(feature = "redact-generated-debug"))]
16727impl std::fmt::Debug for CreateCheckoutSessionTaxIdCollectionRequired {
16728    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16729        f.write_str(self.as_str())
16730    }
16731}
16732#[cfg(feature = "redact-generated-debug")]
16733impl std::fmt::Debug for CreateCheckoutSessionTaxIdCollectionRequired {
16734    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16735        f.debug_struct(stringify!(CreateCheckoutSessionTaxIdCollectionRequired))
16736            .finish_non_exhaustive()
16737    }
16738}
16739impl serde::Serialize for CreateCheckoutSessionTaxIdCollectionRequired {
16740    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16741    where
16742        S: serde::Serializer,
16743    {
16744        serializer.serialize_str(self.as_str())
16745    }
16746}
16747#[cfg(feature = "deserialize")]
16748impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionTaxIdCollectionRequired {
16749    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16750        use std::str::FromStr;
16751        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16752        Ok(Self::from_str(&s).expect("infallible"))
16753    }
16754}
16755/// Wallet-specific configuration.
16756#[derive(Clone, Eq, PartialEq)]
16757#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
16758#[derive(serde::Serialize)]
16759pub struct CreateCheckoutSessionWalletOptions {
16760    /// contains details about the Link wallet options (Link is also known as Onelink in the UK).
16761    #[serde(skip_serializing_if = "Option::is_none")]
16762    pub link: Option<CreateCheckoutSessionWalletOptionsLink>,
16763}
16764#[cfg(feature = "redact-generated-debug")]
16765impl std::fmt::Debug for CreateCheckoutSessionWalletOptions {
16766    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16767        f.debug_struct("CreateCheckoutSessionWalletOptions").finish_non_exhaustive()
16768    }
16769}
16770impl CreateCheckoutSessionWalletOptions {
16771    pub fn new() -> Self {
16772        Self { link: None }
16773    }
16774}
16775impl Default for CreateCheckoutSessionWalletOptions {
16776    fn default() -> Self {
16777        Self::new()
16778    }
16779}
16780/// contains details about the Link wallet options (Link is also known as Onelink in the UK).
16781#[derive(Clone, Eq, PartialEq)]
16782#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
16783#[derive(serde::Serialize)]
16784pub struct CreateCheckoutSessionWalletOptionsLink {
16785    /// Specifies whether Checkout should display Link as a payment option.
16786    /// By default, Checkout will display all the supported wallets that the Checkout Session was created with.
16787    /// This is the `auto` behavior, and it is the default choice.
16788    #[serde(skip_serializing_if = "Option::is_none")]
16789    pub display: Option<CreateCheckoutSessionWalletOptionsLinkDisplay>,
16790}
16791#[cfg(feature = "redact-generated-debug")]
16792impl std::fmt::Debug for CreateCheckoutSessionWalletOptionsLink {
16793    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16794        f.debug_struct("CreateCheckoutSessionWalletOptionsLink").finish_non_exhaustive()
16795    }
16796}
16797impl CreateCheckoutSessionWalletOptionsLink {
16798    pub fn new() -> Self {
16799        Self { display: None }
16800    }
16801}
16802impl Default for CreateCheckoutSessionWalletOptionsLink {
16803    fn default() -> Self {
16804        Self::new()
16805    }
16806}
16807/// Specifies whether Checkout should display Link as a payment option.
16808/// By default, Checkout will display all the supported wallets that the Checkout Session was created with.
16809/// This is the `auto` behavior, and it is the default choice.
16810#[derive(Clone, Eq, PartialEq)]
16811#[non_exhaustive]
16812pub enum CreateCheckoutSessionWalletOptionsLinkDisplay {
16813    Auto,
16814    Never,
16815    /// An unrecognized value from Stripe. Should not be used as a request parameter.
16816    Unknown(String),
16817}
16818impl CreateCheckoutSessionWalletOptionsLinkDisplay {
16819    pub fn as_str(&self) -> &str {
16820        use CreateCheckoutSessionWalletOptionsLinkDisplay::*;
16821        match self {
16822            Auto => "auto",
16823            Never => "never",
16824            Unknown(v) => v,
16825        }
16826    }
16827}
16828
16829impl std::str::FromStr for CreateCheckoutSessionWalletOptionsLinkDisplay {
16830    type Err = std::convert::Infallible;
16831    fn from_str(s: &str) -> Result<Self, Self::Err> {
16832        use CreateCheckoutSessionWalletOptionsLinkDisplay::*;
16833        match s {
16834            "auto" => Ok(Auto),
16835            "never" => Ok(Never),
16836            v => {
16837                tracing::warn!(
16838                    "Unknown value '{}' for enum '{}'",
16839                    v,
16840                    "CreateCheckoutSessionWalletOptionsLinkDisplay"
16841                );
16842                Ok(Unknown(v.to_owned()))
16843            }
16844        }
16845    }
16846}
16847impl std::fmt::Display for CreateCheckoutSessionWalletOptionsLinkDisplay {
16848    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16849        f.write_str(self.as_str())
16850    }
16851}
16852
16853#[cfg(not(feature = "redact-generated-debug"))]
16854impl std::fmt::Debug for CreateCheckoutSessionWalletOptionsLinkDisplay {
16855    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16856        f.write_str(self.as_str())
16857    }
16858}
16859#[cfg(feature = "redact-generated-debug")]
16860impl std::fmt::Debug for CreateCheckoutSessionWalletOptionsLinkDisplay {
16861    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16862        f.debug_struct(stringify!(CreateCheckoutSessionWalletOptionsLinkDisplay))
16863            .finish_non_exhaustive()
16864    }
16865}
16866impl serde::Serialize for CreateCheckoutSessionWalletOptionsLinkDisplay {
16867    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16868    where
16869        S: serde::Serializer,
16870    {
16871        serializer.serialize_str(self.as_str())
16872    }
16873}
16874#[cfg(feature = "deserialize")]
16875impl<'de> serde::Deserialize<'de> for CreateCheckoutSessionWalletOptionsLinkDisplay {
16876    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16877        use std::str::FromStr;
16878        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16879        Ok(Self::from_str(&s).expect("infallible"))
16880    }
16881}
16882/// Creates a Checkout Session object.
16883#[derive(Clone)]
16884#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
16885#[derive(serde::Serialize)]
16886pub struct CreateCheckoutSession {
16887    inner: CreateCheckoutSessionBuilder,
16888}
16889#[cfg(feature = "redact-generated-debug")]
16890impl std::fmt::Debug for CreateCheckoutSession {
16891    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16892        f.debug_struct("CreateCheckoutSession").finish_non_exhaustive()
16893    }
16894}
16895impl CreateCheckoutSession {
16896    /// Construct a new `CreateCheckoutSession`.
16897    pub fn new() -> Self {
16898        Self { inner: CreateCheckoutSessionBuilder::new() }
16899    }
16900    /// Settings for price localization with [Adaptive Pricing](https://docs.stripe.com/payments/checkout/adaptive-pricing).
16901    pub fn adaptive_pricing(
16902        mut self,
16903        adaptive_pricing: impl Into<CreateCheckoutSessionAdaptivePricing>,
16904    ) -> Self {
16905        self.inner.adaptive_pricing = Some(adaptive_pricing.into());
16906        self
16907    }
16908    /// Configure actions after a Checkout Session has expired.
16909    /// You can't set this parameter if `ui_mode` is `elements`.
16910    pub fn after_expiration(
16911        mut self,
16912        after_expiration: impl Into<CreateCheckoutSessionAfterExpiration>,
16913    ) -> Self {
16914        self.inner.after_expiration = Some(after_expiration.into());
16915        self
16916    }
16917    /// Enables user redeemable promotion codes.
16918    pub fn allow_promotion_codes(mut self, allow_promotion_codes: impl Into<bool>) -> Self {
16919        self.inner.allow_promotion_codes = Some(allow_promotion_codes.into());
16920        self
16921    }
16922    /// Settings for automatic tax lookup for this session and resulting payments, invoices, and subscriptions.
16923    pub fn automatic_tax(
16924        mut self,
16925        automatic_tax: impl Into<CreateCheckoutSessionAutomaticTax>,
16926    ) -> Self {
16927        self.inner.automatic_tax = Some(automatic_tax.into());
16928        self
16929    }
16930    /// Specify whether Checkout should collect the customer's billing address. Defaults to `auto`.
16931    pub fn billing_address_collection(
16932        mut self,
16933        billing_address_collection: impl Into<stripe_shared::CheckoutSessionBillingAddressCollection>,
16934    ) -> Self {
16935        self.inner.billing_address_collection = Some(billing_address_collection.into());
16936        self
16937    }
16938    /// The branding settings for the Checkout Session.
16939    /// This parameter is not allowed if ui_mode is `elements`.
16940    pub fn branding_settings(
16941        mut self,
16942        branding_settings: impl Into<CreateCheckoutSessionBrandingSettings>,
16943    ) -> Self {
16944        self.inner.branding_settings = Some(branding_settings.into());
16945        self
16946    }
16947    /// If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website.
16948    /// This parameter is not allowed if ui_mode is `embedded_page` or `elements`.
16949    pub fn cancel_url(mut self, cancel_url: impl Into<String>) -> Self {
16950        self.inner.cancel_url = Some(cancel_url.into());
16951        self
16952    }
16953    /// A unique string to reference the Checkout Session. This can be a
16954    /// customer ID, a cart ID, or similar, and can be used to reconcile the
16955    /// session with your internal systems.
16956    pub fn client_reference_id(mut self, client_reference_id: impl Into<String>) -> Self {
16957        self.inner.client_reference_id = Some(client_reference_id.into());
16958        self
16959    }
16960    /// Configure fields for the Checkout Session to gather active consent from customers.
16961    pub fn consent_collection(
16962        mut self,
16963        consent_collection: impl Into<CreateCheckoutSessionConsentCollection>,
16964    ) -> Self {
16965        self.inner.consent_collection = Some(consent_collection.into());
16966        self
16967    }
16968    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
16969    /// Must be a [supported currency](https://stripe.com/docs/currencies).
16970    /// Required in `setup` mode when `payment_method_types` is not set.
16971    pub fn currency(mut self, currency: impl Into<stripe_types::Currency>) -> Self {
16972        self.inner.currency = Some(currency.into());
16973        self
16974    }
16975    /// Collect additional information from your customer using custom fields.
16976    /// Up to 3 fields are supported.
16977    /// You can't set this parameter if `ui_mode` is `custom`.
16978    pub fn custom_fields(
16979        mut self,
16980        custom_fields: impl Into<Vec<CreateCheckoutSessionCustomFields>>,
16981    ) -> Self {
16982        self.inner.custom_fields = Some(custom_fields.into());
16983        self
16984    }
16985    /// Display additional text for your customers using custom text.
16986    /// You can't set this parameter if `ui_mode` is `custom`.
16987    pub fn custom_text(mut self, custom_text: impl Into<CreateCheckoutSessionCustomText>) -> Self {
16988        self.inner.custom_text = Some(custom_text.into());
16989        self
16990    }
16991    /// ID of an existing Customer, if one exists.
16992    /// In `payment` mode, the customer’s most recently saved card.
16993    /// payment method will be used to prefill the email, name, card details, and billing address
16994    /// on the Checkout page.
16995    /// In `subscription` mode, the customer’s [default payment method](https://docs.stripe.com/api/customers/update#update_customer-invoice_settings-default_payment_method).
16996    /// will be used if it’s a card, otherwise the most recently saved card will be used.
16997    /// A valid billing address, billing name and billing email are required on the payment method for Checkout to prefill the customer's card details.
16998    ///
16999    /// If the Customer already has a valid [email](https://docs.stripe.com/api/customers/object#customer_object-email) set, the email will be prefilled and not editable in Checkout.
17000    /// If the Customer does not have a valid `email`, Checkout will set the email entered during the session on the Customer.
17001    ///
17002    /// If blank for Checkout Sessions in `subscription` mode or with `customer_creation` set as `always` in `payment` mode, Checkout will create a new Customer object based on information provided during the payment flow.
17003    ///
17004    /// You can set [`payment_intent_data.setup_future_usage`](https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-payment_intent_data-setup_future_usage) to have Checkout automatically attach the payment method to the Customer you pass in for future reuse.
17005    pub fn customer(mut self, customer: impl Into<String>) -> Self {
17006        self.inner.customer = Some(customer.into());
17007        self
17008    }
17009    /// ID of an existing Account, if one exists. Has the same behavior as `customer`.
17010    pub fn customer_account(mut self, customer_account: impl Into<String>) -> Self {
17011        self.inner.customer_account = Some(customer_account.into());
17012        self
17013    }
17014    /// Configure whether a Checkout Session creates a [Customer](https://docs.stripe.com/api/customers) during Session confirmation.
17015    ///
17016    /// When a Customer is not created, you can still retrieve email, address, and other customer data entered in Checkout.
17017    /// with [customer_details](https://docs.stripe.com/api/checkout/sessions/object#checkout_session_object-customer_details).
17018    ///
17019    /// Sessions that don't create Customers instead are grouped by [guest customers](https://docs.stripe.com/payments/checkout/guest-customers).
17020    /// in the Dashboard.
17021    /// Promotion codes limited to first time customers will return invalid for these Sessions.
17022    ///
17023    /// Can only be set in `payment` and `setup` mode.
17024    pub fn customer_creation(
17025        mut self,
17026        customer_creation: impl Into<CreateCheckoutSessionCustomerCreation>,
17027    ) -> Self {
17028        self.inner.customer_creation = Some(customer_creation.into());
17029        self
17030    }
17031    /// If provided, this value will be used when the Customer object is created.
17032    /// If not provided, customers will be asked to enter their email address.
17033    /// Use this parameter to prefill customer data if you already have an email
17034    /// on file. To access information about the customer once a session is
17035    /// complete, use the `customer` field.
17036    pub fn customer_email(mut self, customer_email: impl Into<String>) -> Self {
17037        self.inner.customer_email = Some(customer_email.into());
17038        self
17039    }
17040    /// Controls what fields on Customer can be updated by the Checkout Session.
17041    /// Can only be provided when `customer` is provided.
17042    pub fn customer_update(
17043        mut self,
17044        customer_update: impl Into<CreateCheckoutSessionCustomerUpdate>,
17045    ) -> Self {
17046        self.inner.customer_update = Some(customer_update.into());
17047        self
17048    }
17049    /// The coupon or promotion code to apply to this Session. Currently, only up to one may be specified.
17050    pub fn discounts(mut self, discounts: impl Into<Vec<CreateCheckoutSessionDiscounts>>) -> Self {
17051        self.inner.discounts = Some(discounts.into());
17052        self
17053    }
17054    /// A list of the types of payment methods (e.g., `card`) that should be excluded from this Checkout Session.
17055    /// This should only be used when payment methods for this Checkout Session are managed through the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods).
17056    pub fn excluded_payment_method_types(
17057        mut self,
17058        excluded_payment_method_types: impl Into<Vec<CreateCheckoutSessionExcludedPaymentMethodTypes>>,
17059    ) -> Self {
17060        self.inner.excluded_payment_method_types = Some(excluded_payment_method_types.into());
17061        self
17062    }
17063    /// Specifies which fields in the response should be expanded.
17064    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
17065        self.inner.expand = Some(expand.into());
17066        self
17067    }
17068    /// The Epoch time in seconds at which the Checkout Session will expire.
17069    /// It can be anywhere from 30 minutes to 24 hours after Checkout Session creation.
17070    /// By default, this value is 24 hours from creation.
17071    pub fn expires_at(mut self, expires_at: impl Into<stripe_types::Timestamp>) -> Self {
17072        self.inner.expires_at = Some(expires_at.into());
17073        self
17074    }
17075    /// The integration identifier for this Checkout Session.
17076    /// Multiple Checkout Sessions can have the same integration identifier.
17077    pub fn integration_identifier(mut self, integration_identifier: impl Into<String>) -> Self {
17078        self.inner.integration_identifier = Some(integration_identifier.into());
17079        self
17080    }
17081    /// Generate a post-purchase Invoice for one-time payments.
17082    pub fn invoice_creation(
17083        mut self,
17084        invoice_creation: impl Into<CreateCheckoutSessionInvoiceCreation>,
17085    ) -> Self {
17086        self.inner.invoice_creation = Some(invoice_creation.into());
17087        self
17088    }
17089    /// A list of items the customer is purchasing.
17090    /// Use this parameter to pass one-time or recurring [Prices](https://docs.stripe.com/api/prices).
17091    /// The parameter is required for `payment` and `subscription` mode.
17092    ///
17093    /// For `payment` mode, there is a maximum of 100 line items, however it is recommended to consolidate line items if there are more than a few dozen.
17094    ///
17095    /// For `subscription` mode, there is a maximum of 20 line items with recurring Prices and 20 line items with one-time Prices.
17096    /// Line items with one-time Prices will be on the initial invoice only.
17097    pub fn line_items(
17098        mut self,
17099        line_items: impl Into<Vec<CreateCheckoutSessionLineItems>>,
17100    ) -> Self {
17101        self.inner.line_items = Some(line_items.into());
17102        self
17103    }
17104    /// The IETF language tag of the locale Checkout is displayed in.
17105    /// If blank or `auto`, the browser's locale is used.
17106    pub fn locale(mut self, locale: impl Into<stripe_shared::CheckoutSessionLocale>) -> Self {
17107        self.inner.locale = Some(locale.into());
17108        self
17109    }
17110    /// Settings for Managed Payments for this Checkout Session and resulting [PaymentIntents](/api/payment_intents/object), [Invoices](/api/invoices/object), and [Subscriptions](/api/subscriptions/object).
17111    pub fn managed_payments(
17112        mut self,
17113        managed_payments: impl Into<CreateCheckoutSessionManagedPayments>,
17114    ) -> Self {
17115        self.inner.managed_payments = Some(managed_payments.into());
17116        self
17117    }
17118    /// Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object.
17119    /// This can be useful for storing additional information about the object in a structured format.
17120    /// Individual keys can be unset by posting an empty value to them.
17121    /// All keys can be unset by posting an empty value to `metadata`.
17122    pub fn metadata(
17123        mut self,
17124        metadata: impl Into<std::collections::HashMap<String, String>>,
17125    ) -> Self {
17126        self.inner.metadata = Some(metadata.into());
17127        self
17128    }
17129    /// The mode of the Checkout Session.
17130    /// Pass `subscription` if the Checkout Session includes at least one recurring item.
17131    pub fn mode(mut self, mode: impl Into<stripe_shared::CheckoutSessionMode>) -> Self {
17132        self.inner.mode = Some(mode.into());
17133        self
17134    }
17135    /// Controls name collection settings for the session.
17136    ///
17137    /// You can configure Checkout to collect your customers' business names, individual names, or both.
17138    /// Each name field can be either required or optional.
17139    ///
17140    /// If a [Customer](https://docs.stripe.com/api/customers) is created or provided, the names can be saved to the Customer object as well.
17141    pub fn name_collection(
17142        mut self,
17143        name_collection: impl Into<CreateCheckoutSessionNameCollection>,
17144    ) -> Self {
17145        self.inner.name_collection = Some(name_collection.into());
17146        self
17147    }
17148    /// A list of optional items the customer can add to their order at checkout.
17149    /// Use this parameter to pass one-time or recurring [Prices](https://docs.stripe.com/api/prices).
17150    ///
17151    /// There is a maximum of 10 optional items allowed on a Checkout Session, and the existing limits on the number of line items allowed on a Checkout Session apply to the combined number of line items and optional items.
17152    ///
17153    /// For `payment` mode, there is a maximum of 100 combined line items and optional items, however it is recommended to consolidate items if there are more than a few dozen.
17154    ///
17155    /// For `subscription` mode, there is a maximum of 20 line items and optional items with recurring Prices and 20 line items and optional items with one-time Prices.
17156    ///
17157    /// You can't set this parameter if `ui_mode` is `custom`.
17158    pub fn optional_items(
17159        mut self,
17160        optional_items: impl Into<Vec<CreateCheckoutSessionOptionalItems>>,
17161    ) -> Self {
17162        self.inner.optional_items = Some(optional_items.into());
17163        self
17164    }
17165    /// Where the user is coming from.
17166    /// This informs the optimizations that are applied to the session.
17167    /// You can't set this parameter if `ui_mode` is `elements`.
17168    pub fn origin_context(
17169        mut self,
17170        origin_context: impl Into<stripe_shared::CheckoutSessionOriginContext>,
17171    ) -> Self {
17172        self.inner.origin_context = Some(origin_context.into());
17173        self
17174    }
17175    /// A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode.
17176    pub fn payment_intent_data(
17177        mut self,
17178        payment_intent_data: impl Into<CreateCheckoutSessionPaymentIntentData>,
17179    ) -> Self {
17180        self.inner.payment_intent_data = Some(payment_intent_data.into());
17181        self
17182    }
17183    /// Specify whether Checkout should collect a payment method.
17184    /// When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.
17185    /// This may occur if the Checkout Session includes a free trial or a discount.
17186    ///
17187    /// Can only be set in `subscription` mode. Defaults to `always`.
17188    ///
17189    /// If you'd like information on how to collect a payment method outside of Checkout, read the guide on configuring [subscriptions with a free trial](https://docs.stripe.com/payments/checkout/free-trials).
17190    pub fn payment_method_collection(
17191        mut self,
17192        payment_method_collection: impl Into<CreateCheckoutSessionPaymentMethodCollection>,
17193    ) -> Self {
17194        self.inner.payment_method_collection = Some(payment_method_collection.into());
17195        self
17196    }
17197    /// The ID of the payment method configuration to use with this Checkout session.
17198    pub fn payment_method_configuration(
17199        mut self,
17200        payment_method_configuration: impl Into<String>,
17201    ) -> Self {
17202        self.inner.payment_method_configuration = Some(payment_method_configuration.into());
17203        self
17204    }
17205    /// This parameter allows you to set some attributes on the payment method created during a Checkout session.
17206    pub fn payment_method_data(
17207        mut self,
17208        payment_method_data: impl Into<CreateCheckoutSessionPaymentMethodData>,
17209    ) -> Self {
17210        self.inner.payment_method_data = Some(payment_method_data.into());
17211        self
17212    }
17213    /// Payment-method-specific configuration.
17214    pub fn payment_method_options(
17215        mut self,
17216        payment_method_options: impl Into<CreateCheckoutSessionPaymentMethodOptions>,
17217    ) -> Self {
17218        self.inner.payment_method_options = Some(payment_method_options.into());
17219        self
17220    }
17221    /// A list of the types of payment methods (e.g., `card`) this Checkout Session can accept.
17222    ///
17223    /// You can omit this attribute to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods).
17224    /// See [Dynamic Payment Methods](https://docs.stripe.com/payments/payment-methods/integration-options#using-dynamic-payment-methods) for more details.
17225    ///
17226    /// Read more about the supported payment methods and their requirements in our [payment
17227    /// method details guide](/docs/payments/checkout/payment-methods).
17228    ///
17229    /// If multiple payment methods are passed, Checkout will dynamically reorder them to
17230    /// prioritize the most relevant payment methods based on the customer's location and
17231    /// other characteristics.
17232    pub fn payment_method_types(
17233        mut self,
17234        payment_method_types: impl Into<Vec<CreateCheckoutSessionPaymentMethodTypes>>,
17235    ) -> Self {
17236        self.inner.payment_method_types = Some(payment_method_types.into());
17237        self
17238    }
17239    /// This property is used to set up permissions for various actions (e.g., update) on the CheckoutSession object.
17240    /// Can only be set when creating `embedded` or `custom` sessions.
17241    ///
17242    /// For specific permissions, please refer to their dedicated subsections, such as `permissions.update_shipping_details`.
17243    pub fn permissions(mut self, permissions: impl Into<CreateCheckoutSessionPermissions>) -> Self {
17244        self.inner.permissions = Some(permissions.into());
17245        self
17246    }
17247    /// Controls phone number collection settings for the session.
17248    ///
17249    /// We recommend that you review your privacy policy and check with your legal contacts
17250    /// before using this feature.
17251    /// Learn more about [collecting phone numbers with Checkout](https://docs.stripe.com/payments/checkout/phone-numbers).
17252    pub fn phone_number_collection(
17253        mut self,
17254        phone_number_collection: impl Into<CreateCheckoutSessionPhoneNumberCollection>,
17255    ) -> Self {
17256        self.inner.phone_number_collection = Some(phone_number_collection.into());
17257        self
17258    }
17259    /// This parameter applies to `ui_mode: embedded_page`.
17260    /// Learn more about the [redirect behavior](https://docs.stripe.com/payments/checkout/custom-success-page?payment-ui=embedded-form) of embedded sessions.
17261    /// Defaults to `always`.
17262    pub fn redirect_on_completion(
17263        mut self,
17264        redirect_on_completion: impl Into<stripe_shared::CheckoutSessionRedirectOnCompletion>,
17265    ) -> Self {
17266        self.inner.redirect_on_completion = Some(redirect_on_completion.into());
17267        self
17268    }
17269    /// The URL to redirect your customer back to after they authenticate or cancel their payment on the
17270    /// payment method's app or site.
17271    /// This parameter is required if `ui_mode` is `embedded_page` or `elements`.
17272    /// and redirect-based payment methods are enabled on the session.
17273    pub fn return_url(mut self, return_url: impl Into<String>) -> Self {
17274        self.inner.return_url = Some(return_url.into());
17275        self
17276    }
17277    /// Controls saved payment method settings for the session.
17278    /// Only available in `payment` and `subscription` mode.
17279    pub fn saved_payment_method_options(
17280        mut self,
17281        saved_payment_method_options: impl Into<CreateCheckoutSessionSavedPaymentMethodOptions>,
17282    ) -> Self {
17283        self.inner.saved_payment_method_options = Some(saved_payment_method_options.into());
17284        self
17285    }
17286    /// A subset of parameters to be passed to SetupIntent creation for Checkout Sessions in `setup` mode.
17287    pub fn setup_intent_data(
17288        mut self,
17289        setup_intent_data: impl Into<CreateCheckoutSessionSetupIntentData>,
17290    ) -> Self {
17291        self.inner.setup_intent_data = Some(setup_intent_data.into());
17292        self
17293    }
17294    /// When set, provides configuration for Checkout to collect a shipping address from a customer.
17295    pub fn shipping_address_collection(
17296        mut self,
17297        shipping_address_collection: impl Into<CreateCheckoutSessionShippingAddressCollection>,
17298    ) -> Self {
17299        self.inner.shipping_address_collection = Some(shipping_address_collection.into());
17300        self
17301    }
17302    /// The shipping rate options to apply to this Session. Up to a maximum of 5.
17303    pub fn shipping_options(
17304        mut self,
17305        shipping_options: impl Into<Vec<CreateCheckoutSessionShippingOptions>>,
17306    ) -> Self {
17307        self.inner.shipping_options = Some(shipping_options.into());
17308        self
17309    }
17310    /// Describes the type of transaction being performed by Checkout in order
17311    /// to customize relevant text on the page, such as the submit button.
17312    ///  `submit_type` can only be specified on Checkout Sessions in
17313    /// `payment` or `subscription` mode. If blank or `auto`, `pay` is used.
17314    /// You can't set this parameter if `ui_mode` is `elements`.
17315    pub fn submit_type(
17316        mut self,
17317        submit_type: impl Into<stripe_shared::CheckoutSessionSubmitType>,
17318    ) -> Self {
17319        self.inner.submit_type = Some(submit_type.into());
17320        self
17321    }
17322    /// A subset of parameters to be passed to subscription creation for Checkout Sessions in `subscription` mode.
17323    pub fn subscription_data(
17324        mut self,
17325        subscription_data: impl Into<CreateCheckoutSessionSubscriptionData>,
17326    ) -> Self {
17327        self.inner.subscription_data = Some(subscription_data.into());
17328        self
17329    }
17330    /// The URL to which Stripe should send customers when payment or setup
17331    /// is complete.
17332    /// This parameter is not allowed if ui_mode is `embedded_page` or `elements`. If you'd like to use
17333    /// information from the successful Checkout Session on your page, read the
17334    /// guide on [customizing your success page](https://docs.stripe.com/payments/checkout/custom-success-page).
17335    pub fn success_url(mut self, success_url: impl Into<String>) -> Self {
17336        self.inner.success_url = Some(success_url.into());
17337        self
17338    }
17339    /// Controls tax ID collection during checkout.
17340    pub fn tax_id_collection(
17341        mut self,
17342        tax_id_collection: impl Into<CreateCheckoutSessionTaxIdCollection>,
17343    ) -> Self {
17344        self.inner.tax_id_collection = Some(tax_id_collection.into());
17345        self
17346    }
17347    /// The UI mode of the Session. Defaults to `hosted_page`.
17348    pub fn ui_mode(mut self, ui_mode: impl Into<stripe_shared::CheckoutSessionUiMode>) -> Self {
17349        self.inner.ui_mode = Some(ui_mode.into());
17350        self
17351    }
17352    /// Wallet-specific configuration.
17353    pub fn wallet_options(
17354        mut self,
17355        wallet_options: impl Into<CreateCheckoutSessionWalletOptions>,
17356    ) -> Self {
17357        self.inner.wallet_options = Some(wallet_options.into());
17358        self
17359    }
17360}
17361impl Default for CreateCheckoutSession {
17362    fn default() -> Self {
17363        Self::new()
17364    }
17365}
17366impl CreateCheckoutSession {
17367    /// Send the request and return the deserialized response.
17368    pub async fn send<C: StripeClient>(
17369        &self,
17370        client: &C,
17371    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
17372        self.customize().send(client).await
17373    }
17374
17375    /// Send the request and return the deserialized response, blocking until completion.
17376    pub fn send_blocking<C: StripeBlockingClient>(
17377        &self,
17378        client: &C,
17379    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
17380        self.customize().send_blocking(client)
17381    }
17382}
17383
17384impl StripeRequest for CreateCheckoutSession {
17385    type Output = stripe_shared::CheckoutSession;
17386
17387    fn build(&self) -> RequestBuilder {
17388        RequestBuilder::new(StripeMethod::Post, "/checkout/sessions").form(&self.inner)
17389    }
17390}
17391#[derive(Clone)]
17392#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
17393#[derive(serde::Serialize)]
17394struct UpdateCheckoutSessionBuilder {
17395    #[serde(skip_serializing_if = "Option::is_none")]
17396    collected_information: Option<UpdateCheckoutSessionCollectedInformation>,
17397    #[serde(skip_serializing_if = "Option::is_none")]
17398    expand: Option<Vec<String>>,
17399    #[serde(skip_serializing_if = "Option::is_none")]
17400    line_items: Option<Vec<UpdateCheckoutSessionLineItems>>,
17401    #[serde(skip_serializing_if = "Option::is_none")]
17402    metadata: Option<std::collections::HashMap<String, String>>,
17403    #[serde(skip_serializing_if = "Option::is_none")]
17404    shipping_options: Option<Vec<UpdateCheckoutSessionShippingOptions>>,
17405}
17406#[cfg(feature = "redact-generated-debug")]
17407impl std::fmt::Debug for UpdateCheckoutSessionBuilder {
17408    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17409        f.debug_struct("UpdateCheckoutSessionBuilder").finish_non_exhaustive()
17410    }
17411}
17412impl UpdateCheckoutSessionBuilder {
17413    fn new() -> Self {
17414        Self {
17415            collected_information: None,
17416            expand: None,
17417            line_items: None,
17418            metadata: None,
17419            shipping_options: None,
17420        }
17421    }
17422}
17423/// Information about the customer collected within the Checkout Session.
17424/// Can only be set when updating `embedded` or `custom` sessions.
17425#[derive(Clone, Eq, PartialEq)]
17426#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
17427#[derive(serde::Serialize)]
17428pub struct UpdateCheckoutSessionCollectedInformation {
17429    /// The shipping details to apply to this Session.
17430    #[serde(skip_serializing_if = "Option::is_none")]
17431    pub shipping_details: Option<UpdateCheckoutSessionCollectedInformationShippingDetails>,
17432}
17433#[cfg(feature = "redact-generated-debug")]
17434impl std::fmt::Debug for UpdateCheckoutSessionCollectedInformation {
17435    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17436        f.debug_struct("UpdateCheckoutSessionCollectedInformation").finish_non_exhaustive()
17437    }
17438}
17439impl UpdateCheckoutSessionCollectedInformation {
17440    pub fn new() -> Self {
17441        Self { shipping_details: None }
17442    }
17443}
17444impl Default for UpdateCheckoutSessionCollectedInformation {
17445    fn default() -> Self {
17446        Self::new()
17447    }
17448}
17449/// The shipping details to apply to this Session.
17450#[derive(Clone, Eq, PartialEq)]
17451#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
17452#[derive(serde::Serialize)]
17453pub struct UpdateCheckoutSessionCollectedInformationShippingDetails {
17454    /// The address of the customer
17455    pub address: UpdateCheckoutSessionCollectedInformationShippingDetailsAddress,
17456    /// The name of customer
17457    pub name: String,
17458}
17459#[cfg(feature = "redact-generated-debug")]
17460impl std::fmt::Debug for UpdateCheckoutSessionCollectedInformationShippingDetails {
17461    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17462        f.debug_struct("UpdateCheckoutSessionCollectedInformationShippingDetails")
17463            .finish_non_exhaustive()
17464    }
17465}
17466impl UpdateCheckoutSessionCollectedInformationShippingDetails {
17467    pub fn new(
17468        address: impl Into<UpdateCheckoutSessionCollectedInformationShippingDetailsAddress>,
17469        name: impl Into<String>,
17470    ) -> Self {
17471        Self { address: address.into(), name: name.into() }
17472    }
17473}
17474/// The address of the customer
17475#[derive(Clone, Eq, PartialEq)]
17476#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
17477#[derive(serde::Serialize)]
17478pub struct UpdateCheckoutSessionCollectedInformationShippingDetailsAddress {
17479    /// City, district, suburb, town, or village.
17480    #[serde(skip_serializing_if = "Option::is_none")]
17481    pub city: Option<String>,
17482    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
17483    pub country: String,
17484    /// Address line 1, such as the street, PO Box, or company name.
17485    pub line1: String,
17486    /// Address line 2, such as the apartment, suite, unit, or building.
17487    #[serde(skip_serializing_if = "Option::is_none")]
17488    pub line2: Option<String>,
17489    /// ZIP or postal code.
17490    #[serde(skip_serializing_if = "Option::is_none")]
17491    pub postal_code: Option<String>,
17492    /// State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)).
17493    #[serde(skip_serializing_if = "Option::is_none")]
17494    pub state: Option<String>,
17495}
17496#[cfg(feature = "redact-generated-debug")]
17497impl std::fmt::Debug for UpdateCheckoutSessionCollectedInformationShippingDetailsAddress {
17498    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17499        f.debug_struct("UpdateCheckoutSessionCollectedInformationShippingDetailsAddress")
17500            .finish_non_exhaustive()
17501    }
17502}
17503impl UpdateCheckoutSessionCollectedInformationShippingDetailsAddress {
17504    pub fn new(country: impl Into<String>, line1: impl Into<String>) -> Self {
17505        Self {
17506            city: None,
17507            country: country.into(),
17508            line1: line1.into(),
17509            line2: None,
17510            postal_code: None,
17511            state: None,
17512        }
17513    }
17514}
17515/// A list of items the customer is purchasing.
17516///
17517/// When updating line items, you must retransmit the entire array of line items.
17518///
17519/// To retain an existing line item, specify its `id`.
17520///
17521/// To update an existing line item, specify its `id` along with the new values of the fields to update.
17522///
17523/// To add a new line item, specify one of `price` or `price_data` and `quantity`.
17524///
17525/// To remove an existing line item, omit the line item's ID from the retransmitted array.
17526///
17527/// To reorder a line item, specify it at the desired position in the retransmitted array.
17528#[derive(Clone)]
17529#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
17530#[derive(serde::Serialize)]
17531pub struct UpdateCheckoutSessionLineItems {
17532    /// When set, provides configuration for this item’s quantity to be adjusted by the customer during Checkout.
17533    #[serde(skip_serializing_if = "Option::is_none")]
17534    pub adjustable_quantity: Option<UpdateCheckoutSessionLineItemsAdjustableQuantity>,
17535    /// ID of an existing line item.
17536    #[serde(skip_serializing_if = "Option::is_none")]
17537    pub id: Option<String>,
17538    /// Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object.
17539    /// This can be useful for storing additional information about the object in a structured format.
17540    /// Individual keys can be unset by posting an empty value to them.
17541    /// All keys can be unset by posting an empty value to `metadata`.
17542    #[serde(skip_serializing_if = "Option::is_none")]
17543    pub metadata: Option<std::collections::HashMap<String, String>>,
17544    /// The ID of the [Price](https://docs.stripe.com/api/prices).
17545    /// One of `price` or `price_data` is required when creating a new line item.
17546    #[serde(skip_serializing_if = "Option::is_none")]
17547    pub price: Option<String>,
17548    /// Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline.
17549    /// One of `price` or `price_data` is required when creating a new line item.
17550    #[serde(skip_serializing_if = "Option::is_none")]
17551    pub price_data: Option<UpdateCheckoutSessionLineItemsPriceData>,
17552    /// The quantity of the line item being purchased.
17553    /// Quantity should not be defined when `recurring.usage_type=metered`.
17554    #[serde(skip_serializing_if = "Option::is_none")]
17555    pub quantity: Option<u64>,
17556    /// The [tax rates](https://docs.stripe.com/api/tax_rates) which apply to this line item.
17557    #[serde(skip_serializing_if = "Option::is_none")]
17558    pub tax_rates: Option<Vec<String>>,
17559}
17560#[cfg(feature = "redact-generated-debug")]
17561impl std::fmt::Debug for UpdateCheckoutSessionLineItems {
17562    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17563        f.debug_struct("UpdateCheckoutSessionLineItems").finish_non_exhaustive()
17564    }
17565}
17566impl UpdateCheckoutSessionLineItems {
17567    pub fn new() -> Self {
17568        Self {
17569            adjustable_quantity: None,
17570            id: None,
17571            metadata: None,
17572            price: None,
17573            price_data: None,
17574            quantity: None,
17575            tax_rates: None,
17576        }
17577    }
17578}
17579impl Default for UpdateCheckoutSessionLineItems {
17580    fn default() -> Self {
17581        Self::new()
17582    }
17583}
17584/// When set, provides configuration for this item’s quantity to be adjusted by the customer during Checkout.
17585#[derive(Copy, Clone, Eq, PartialEq)]
17586#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
17587#[derive(serde::Serialize)]
17588pub struct UpdateCheckoutSessionLineItemsAdjustableQuantity {
17589    /// Set to true if the quantity can be adjusted to any positive integer.
17590    /// Setting to false will remove any previously specified constraints on quantity.
17591    pub enabled: bool,
17592    /// The maximum quantity the customer can purchase for the Checkout Session.
17593    /// By default this value is 99.
17594    /// You can specify a value up to 999999.
17595    #[serde(skip_serializing_if = "Option::is_none")]
17596    pub maximum: Option<i64>,
17597    /// The minimum quantity the customer must purchase for the Checkout Session.
17598    /// By default this value is 0.
17599    #[serde(skip_serializing_if = "Option::is_none")]
17600    pub minimum: Option<i64>,
17601}
17602#[cfg(feature = "redact-generated-debug")]
17603impl std::fmt::Debug for UpdateCheckoutSessionLineItemsAdjustableQuantity {
17604    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17605        f.debug_struct("UpdateCheckoutSessionLineItemsAdjustableQuantity").finish_non_exhaustive()
17606    }
17607}
17608impl UpdateCheckoutSessionLineItemsAdjustableQuantity {
17609    pub fn new(enabled: impl Into<bool>) -> Self {
17610        Self { enabled: enabled.into(), maximum: None, minimum: None }
17611    }
17612}
17613/// Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline.
17614/// One of `price` or `price_data` is required when creating a new line item.
17615#[derive(Clone)]
17616#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
17617#[derive(serde::Serialize)]
17618pub struct UpdateCheckoutSessionLineItemsPriceData {
17619    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
17620    /// Must be a [supported currency](https://stripe.com/docs/currencies).
17621    pub currency: stripe_types::Currency,
17622    /// The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
17623    /// One of `product` or `product_data` is required.
17624    #[serde(skip_serializing_if = "Option::is_none")]
17625    pub product: Option<String>,
17626    /// Data used to generate a new [Product](https://docs.stripe.com/api/products) object inline.
17627    /// One of `product` or `product_data` is required.
17628    #[serde(skip_serializing_if = "Option::is_none")]
17629    pub product_data: Option<ProductData>,
17630    /// The recurring components of a price such as `interval` and `interval_count`.
17631    #[serde(skip_serializing_if = "Option::is_none")]
17632    pub recurring: Option<UpdateCheckoutSessionLineItemsPriceDataRecurring>,
17633    /// Only required if a [default tax behavior](https://docs.stripe.com/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings.
17634    /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes.
17635    /// One of `inclusive`, `exclusive`, or `unspecified`.
17636    /// Once specified as either `inclusive` or `exclusive`, it cannot be changed.
17637    #[serde(skip_serializing_if = "Option::is_none")]
17638    pub tax_behavior: Option<UpdateCheckoutSessionLineItemsPriceDataTaxBehavior>,
17639    /// A non-negative integer in cents (or local equivalent) representing how much to charge.
17640    /// One of `unit_amount` or `unit_amount_decimal` is required.
17641    #[serde(skip_serializing_if = "Option::is_none")]
17642    pub unit_amount: Option<i64>,
17643    /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places.
17644    /// Only one of `unit_amount` and `unit_amount_decimal` can be set.
17645    #[serde(skip_serializing_if = "Option::is_none")]
17646    pub unit_amount_decimal: Option<String>,
17647}
17648#[cfg(feature = "redact-generated-debug")]
17649impl std::fmt::Debug for UpdateCheckoutSessionLineItemsPriceData {
17650    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17651        f.debug_struct("UpdateCheckoutSessionLineItemsPriceData").finish_non_exhaustive()
17652    }
17653}
17654impl UpdateCheckoutSessionLineItemsPriceData {
17655    pub fn new(currency: impl Into<stripe_types::Currency>) -> Self {
17656        Self {
17657            currency: currency.into(),
17658            product: None,
17659            product_data: None,
17660            recurring: None,
17661            tax_behavior: None,
17662            unit_amount: None,
17663            unit_amount_decimal: None,
17664        }
17665    }
17666}
17667/// The recurring components of a price such as `interval` and `interval_count`.
17668#[derive(Clone, Eq, PartialEq)]
17669#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
17670#[derive(serde::Serialize)]
17671pub struct UpdateCheckoutSessionLineItemsPriceDataRecurring {
17672    /// Specifies billing frequency. Either `day`, `week`, `month` or `year`.
17673    pub interval: UpdateCheckoutSessionLineItemsPriceDataRecurringInterval,
17674    /// The number of intervals between subscription billings.
17675    /// For example, `interval=month` and `interval_count=3` bills every 3 months.
17676    /// Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).
17677    #[serde(skip_serializing_if = "Option::is_none")]
17678    pub interval_count: Option<u64>,
17679}
17680#[cfg(feature = "redact-generated-debug")]
17681impl std::fmt::Debug for UpdateCheckoutSessionLineItemsPriceDataRecurring {
17682    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17683        f.debug_struct("UpdateCheckoutSessionLineItemsPriceDataRecurring").finish_non_exhaustive()
17684    }
17685}
17686impl UpdateCheckoutSessionLineItemsPriceDataRecurring {
17687    pub fn new(
17688        interval: impl Into<UpdateCheckoutSessionLineItemsPriceDataRecurringInterval>,
17689    ) -> Self {
17690        Self { interval: interval.into(), interval_count: None }
17691    }
17692}
17693/// Specifies billing frequency. Either `day`, `week`, `month` or `year`.
17694#[derive(Clone, Eq, PartialEq)]
17695#[non_exhaustive]
17696pub enum UpdateCheckoutSessionLineItemsPriceDataRecurringInterval {
17697    Day,
17698    Month,
17699    Week,
17700    Year,
17701    /// An unrecognized value from Stripe. Should not be used as a request parameter.
17702    Unknown(String),
17703}
17704impl UpdateCheckoutSessionLineItemsPriceDataRecurringInterval {
17705    pub fn as_str(&self) -> &str {
17706        use UpdateCheckoutSessionLineItemsPriceDataRecurringInterval::*;
17707        match self {
17708            Day => "day",
17709            Month => "month",
17710            Week => "week",
17711            Year => "year",
17712            Unknown(v) => v,
17713        }
17714    }
17715}
17716
17717impl std::str::FromStr for UpdateCheckoutSessionLineItemsPriceDataRecurringInterval {
17718    type Err = std::convert::Infallible;
17719    fn from_str(s: &str) -> Result<Self, Self::Err> {
17720        use UpdateCheckoutSessionLineItemsPriceDataRecurringInterval::*;
17721        match s {
17722            "day" => Ok(Day),
17723            "month" => Ok(Month),
17724            "week" => Ok(Week),
17725            "year" => Ok(Year),
17726            v => {
17727                tracing::warn!(
17728                    "Unknown value '{}' for enum '{}'",
17729                    v,
17730                    "UpdateCheckoutSessionLineItemsPriceDataRecurringInterval"
17731                );
17732                Ok(Unknown(v.to_owned()))
17733            }
17734        }
17735    }
17736}
17737impl std::fmt::Display for UpdateCheckoutSessionLineItemsPriceDataRecurringInterval {
17738    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17739        f.write_str(self.as_str())
17740    }
17741}
17742
17743#[cfg(not(feature = "redact-generated-debug"))]
17744impl std::fmt::Debug for UpdateCheckoutSessionLineItemsPriceDataRecurringInterval {
17745    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17746        f.write_str(self.as_str())
17747    }
17748}
17749#[cfg(feature = "redact-generated-debug")]
17750impl std::fmt::Debug for UpdateCheckoutSessionLineItemsPriceDataRecurringInterval {
17751    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17752        f.debug_struct(stringify!(UpdateCheckoutSessionLineItemsPriceDataRecurringInterval))
17753            .finish_non_exhaustive()
17754    }
17755}
17756impl serde::Serialize for UpdateCheckoutSessionLineItemsPriceDataRecurringInterval {
17757    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17758    where
17759        S: serde::Serializer,
17760    {
17761        serializer.serialize_str(self.as_str())
17762    }
17763}
17764#[cfg(feature = "deserialize")]
17765impl<'de> serde::Deserialize<'de> for UpdateCheckoutSessionLineItemsPriceDataRecurringInterval {
17766    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17767        use std::str::FromStr;
17768        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17769        Ok(Self::from_str(&s).expect("infallible"))
17770    }
17771}
17772/// Only required if a [default tax behavior](https://docs.stripe.com/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings.
17773/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes.
17774/// One of `inclusive`, `exclusive`, or `unspecified`.
17775/// Once specified as either `inclusive` or `exclusive`, it cannot be changed.
17776#[derive(Clone, Eq, PartialEq)]
17777#[non_exhaustive]
17778pub enum UpdateCheckoutSessionLineItemsPriceDataTaxBehavior {
17779    Exclusive,
17780    Inclusive,
17781    Unspecified,
17782    /// An unrecognized value from Stripe. Should not be used as a request parameter.
17783    Unknown(String),
17784}
17785impl UpdateCheckoutSessionLineItemsPriceDataTaxBehavior {
17786    pub fn as_str(&self) -> &str {
17787        use UpdateCheckoutSessionLineItemsPriceDataTaxBehavior::*;
17788        match self {
17789            Exclusive => "exclusive",
17790            Inclusive => "inclusive",
17791            Unspecified => "unspecified",
17792            Unknown(v) => v,
17793        }
17794    }
17795}
17796
17797impl std::str::FromStr for UpdateCheckoutSessionLineItemsPriceDataTaxBehavior {
17798    type Err = std::convert::Infallible;
17799    fn from_str(s: &str) -> Result<Self, Self::Err> {
17800        use UpdateCheckoutSessionLineItemsPriceDataTaxBehavior::*;
17801        match s {
17802            "exclusive" => Ok(Exclusive),
17803            "inclusive" => Ok(Inclusive),
17804            "unspecified" => Ok(Unspecified),
17805            v => {
17806                tracing::warn!(
17807                    "Unknown value '{}' for enum '{}'",
17808                    v,
17809                    "UpdateCheckoutSessionLineItemsPriceDataTaxBehavior"
17810                );
17811                Ok(Unknown(v.to_owned()))
17812            }
17813        }
17814    }
17815}
17816impl std::fmt::Display for UpdateCheckoutSessionLineItemsPriceDataTaxBehavior {
17817    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17818        f.write_str(self.as_str())
17819    }
17820}
17821
17822#[cfg(not(feature = "redact-generated-debug"))]
17823impl std::fmt::Debug for UpdateCheckoutSessionLineItemsPriceDataTaxBehavior {
17824    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17825        f.write_str(self.as_str())
17826    }
17827}
17828#[cfg(feature = "redact-generated-debug")]
17829impl std::fmt::Debug for UpdateCheckoutSessionLineItemsPriceDataTaxBehavior {
17830    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17831        f.debug_struct(stringify!(UpdateCheckoutSessionLineItemsPriceDataTaxBehavior))
17832            .finish_non_exhaustive()
17833    }
17834}
17835impl serde::Serialize for UpdateCheckoutSessionLineItemsPriceDataTaxBehavior {
17836    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17837    where
17838        S: serde::Serializer,
17839    {
17840        serializer.serialize_str(self.as_str())
17841    }
17842}
17843#[cfg(feature = "deserialize")]
17844impl<'de> serde::Deserialize<'de> for UpdateCheckoutSessionLineItemsPriceDataTaxBehavior {
17845    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17846        use std::str::FromStr;
17847        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17848        Ok(Self::from_str(&s).expect("infallible"))
17849    }
17850}
17851/// The shipping rate options to apply to this Session. Up to a maximum of 5.
17852#[derive(Clone)]
17853#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
17854#[derive(serde::Serialize)]
17855pub struct UpdateCheckoutSessionShippingOptions {
17856    /// The ID of the Shipping Rate to use for this shipping option.
17857    #[serde(skip_serializing_if = "Option::is_none")]
17858    pub shipping_rate: Option<String>,
17859    /// Parameters to be passed to Shipping Rate creation for this shipping option.
17860    #[serde(skip_serializing_if = "Option::is_none")]
17861    pub shipping_rate_data: Option<UpdateCheckoutSessionShippingOptionsShippingRateData>,
17862}
17863#[cfg(feature = "redact-generated-debug")]
17864impl std::fmt::Debug for UpdateCheckoutSessionShippingOptions {
17865    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17866        f.debug_struct("UpdateCheckoutSessionShippingOptions").finish_non_exhaustive()
17867    }
17868}
17869impl UpdateCheckoutSessionShippingOptions {
17870    pub fn new() -> Self {
17871        Self { shipping_rate: None, shipping_rate_data: None }
17872    }
17873}
17874impl Default for UpdateCheckoutSessionShippingOptions {
17875    fn default() -> Self {
17876        Self::new()
17877    }
17878}
17879/// Parameters to be passed to Shipping Rate creation for this shipping option.
17880#[derive(Clone)]
17881#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
17882#[derive(serde::Serialize)]
17883pub struct UpdateCheckoutSessionShippingOptionsShippingRateData {
17884    /// The estimated range for how long shipping will take, meant to be displayable to the customer.
17885    /// This will appear on CheckoutSessions.
17886    #[serde(skip_serializing_if = "Option::is_none")]
17887    pub delivery_estimate:
17888        Option<UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimate>,
17889    /// The name of the shipping rate, meant to be displayable to the customer.
17890    /// This will appear on CheckoutSessions.
17891    pub display_name: String,
17892    /// Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`.
17893    #[serde(skip_serializing_if = "Option::is_none")]
17894    pub fixed_amount: Option<UpdateCheckoutSessionShippingOptionsShippingRateDataFixedAmount>,
17895    /// Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object.
17896    /// This can be useful for storing additional information about the object in a structured format.
17897    /// Individual keys can be unset by posting an empty value to them.
17898    /// All keys can be unset by posting an empty value to `metadata`.
17899    #[serde(skip_serializing_if = "Option::is_none")]
17900    pub metadata: Option<std::collections::HashMap<String, String>>,
17901    /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes.
17902    /// One of `inclusive`, `exclusive`, or `unspecified`.
17903    #[serde(skip_serializing_if = "Option::is_none")]
17904    pub tax_behavior: Option<UpdateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior>,
17905    /// A [tax code](https://docs.stripe.com/tax/tax-categories) ID.
17906    /// The Shipping tax code is `txcd_92010001`.
17907    #[serde(skip_serializing_if = "Option::is_none")]
17908    pub tax_code: Option<String>,
17909    /// The type of calculation to use on the shipping rate.
17910    #[serde(rename = "type")]
17911    #[serde(skip_serializing_if = "Option::is_none")]
17912    pub type_: Option<UpdateCheckoutSessionShippingOptionsShippingRateDataType>,
17913}
17914#[cfg(feature = "redact-generated-debug")]
17915impl std::fmt::Debug for UpdateCheckoutSessionShippingOptionsShippingRateData {
17916    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17917        f.debug_struct("UpdateCheckoutSessionShippingOptionsShippingRateData")
17918            .finish_non_exhaustive()
17919    }
17920}
17921impl UpdateCheckoutSessionShippingOptionsShippingRateData {
17922    pub fn new(display_name: impl Into<String>) -> Self {
17923        Self {
17924            delivery_estimate: None,
17925            display_name: display_name.into(),
17926            fixed_amount: None,
17927            metadata: None,
17928            tax_behavior: None,
17929            tax_code: None,
17930            type_: None,
17931        }
17932    }
17933}
17934/// The estimated range for how long shipping will take, meant to be displayable to the customer.
17935/// This will appear on CheckoutSessions.
17936#[derive(Clone, Eq, PartialEq)]
17937#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
17938#[derive(serde::Serialize)]
17939pub struct UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimate {
17940    /// The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite.
17941    #[serde(skip_serializing_if = "Option::is_none")]
17942    pub maximum:
17943        Option<UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximum>,
17944    /// The lower bound of the estimated range. If empty, represents no lower bound.
17945    #[serde(skip_serializing_if = "Option::is_none")]
17946    pub minimum:
17947        Option<UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimum>,
17948}
17949#[cfg(feature = "redact-generated-debug")]
17950impl std::fmt::Debug for UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimate {
17951    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17952        f.debug_struct("UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimate")
17953            .finish_non_exhaustive()
17954    }
17955}
17956impl UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimate {
17957    pub fn new() -> Self {
17958        Self { maximum: None, minimum: None }
17959    }
17960}
17961impl Default for UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimate {
17962    fn default() -> Self {
17963        Self::new()
17964    }
17965}
17966/// The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite.
17967#[derive(Clone, Eq, PartialEq)]
17968#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
17969#[derive(serde::Serialize)]
17970pub struct UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximum {
17971    /// A unit of time.
17972    pub unit: UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit,
17973    /// Must be greater than 0.
17974    pub value: i64,
17975}
17976#[cfg(feature = "redact-generated-debug")]
17977impl std::fmt::Debug
17978    for UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximum
17979{
17980    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17981        f.debug_struct(
17982            "UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximum",
17983        )
17984        .finish_non_exhaustive()
17985    }
17986}
17987impl UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximum {
17988    pub fn new(
17989        unit: impl Into<UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit>,
17990        value: impl Into<i64>,
17991    ) -> Self {
17992        Self { unit: unit.into(), value: value.into() }
17993    }
17994}
17995/// A unit of time.
17996#[derive(Clone, Eq, PartialEq)]
17997#[non_exhaustive]
17998pub enum UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit {
17999    BusinessDay,
18000    Day,
18001    Hour,
18002    Month,
18003    Week,
18004    /// An unrecognized value from Stripe. Should not be used as a request parameter.
18005    Unknown(String),
18006}
18007impl UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit {
18008    pub fn as_str(&self) -> &str {
18009        use UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit::*;
18010        match self {
18011            BusinessDay => "business_day",
18012            Day => "day",
18013            Hour => "hour",
18014            Month => "month",
18015            Week => "week",
18016            Unknown(v) => v,
18017        }
18018    }
18019}
18020
18021impl std::str::FromStr
18022    for UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit
18023{
18024    type Err = std::convert::Infallible;
18025    fn from_str(s: &str) -> Result<Self, Self::Err> {
18026        use UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit::*;
18027        match s {
18028            "business_day" => Ok(BusinessDay),
18029            "day" => Ok(Day),
18030            "hour" => Ok(Hour),
18031            "month" => Ok(Month),
18032            "week" => Ok(Week),
18033            v => {
18034                tracing::warn!(
18035                    "Unknown value '{}' for enum '{}'",
18036                    v,
18037                    "UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit"
18038                );
18039                Ok(Unknown(v.to_owned()))
18040            }
18041        }
18042    }
18043}
18044impl std::fmt::Display
18045    for UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit
18046{
18047    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18048        f.write_str(self.as_str())
18049    }
18050}
18051
18052#[cfg(not(feature = "redact-generated-debug"))]
18053impl std::fmt::Debug
18054    for UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit
18055{
18056    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18057        f.write_str(self.as_str())
18058    }
18059}
18060#[cfg(feature = "redact-generated-debug")]
18061impl std::fmt::Debug
18062    for UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit
18063{
18064    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18065        f.debug_struct(stringify!(
18066            UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit
18067        ))
18068        .finish_non_exhaustive()
18069    }
18070}
18071impl serde::Serialize
18072    for UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit
18073{
18074    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18075    where
18076        S: serde::Serializer,
18077    {
18078        serializer.serialize_str(self.as_str())
18079    }
18080}
18081#[cfg(feature = "deserialize")]
18082impl<'de> serde::Deserialize<'de>
18083    for UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit
18084{
18085    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18086        use std::str::FromStr;
18087        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18088        Ok(Self::from_str(&s).expect("infallible"))
18089    }
18090}
18091/// The lower bound of the estimated range. If empty, represents no lower bound.
18092#[derive(Clone, Eq, PartialEq)]
18093#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
18094#[derive(serde::Serialize)]
18095pub struct UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimum {
18096    /// A unit of time.
18097    pub unit: UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit,
18098    /// Must be greater than 0.
18099    pub value: i64,
18100}
18101#[cfg(feature = "redact-generated-debug")]
18102impl std::fmt::Debug
18103    for UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimum
18104{
18105    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18106        f.debug_struct(
18107            "UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimum",
18108        )
18109        .finish_non_exhaustive()
18110    }
18111}
18112impl UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimum {
18113    pub fn new(
18114        unit: impl Into<UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit>,
18115        value: impl Into<i64>,
18116    ) -> Self {
18117        Self { unit: unit.into(), value: value.into() }
18118    }
18119}
18120/// A unit of time.
18121#[derive(Clone, Eq, PartialEq)]
18122#[non_exhaustive]
18123pub enum UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit {
18124    BusinessDay,
18125    Day,
18126    Hour,
18127    Month,
18128    Week,
18129    /// An unrecognized value from Stripe. Should not be used as a request parameter.
18130    Unknown(String),
18131}
18132impl UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit {
18133    pub fn as_str(&self) -> &str {
18134        use UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit::*;
18135        match self {
18136            BusinessDay => "business_day",
18137            Day => "day",
18138            Hour => "hour",
18139            Month => "month",
18140            Week => "week",
18141            Unknown(v) => v,
18142        }
18143    }
18144}
18145
18146impl std::str::FromStr
18147    for UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit
18148{
18149    type Err = std::convert::Infallible;
18150    fn from_str(s: &str) -> Result<Self, Self::Err> {
18151        use UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit::*;
18152        match s {
18153            "business_day" => Ok(BusinessDay),
18154            "day" => Ok(Day),
18155            "hour" => Ok(Hour),
18156            "month" => Ok(Month),
18157            "week" => Ok(Week),
18158            v => {
18159                tracing::warn!(
18160                    "Unknown value '{}' for enum '{}'",
18161                    v,
18162                    "UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit"
18163                );
18164                Ok(Unknown(v.to_owned()))
18165            }
18166        }
18167    }
18168}
18169impl std::fmt::Display
18170    for UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit
18171{
18172    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18173        f.write_str(self.as_str())
18174    }
18175}
18176
18177#[cfg(not(feature = "redact-generated-debug"))]
18178impl std::fmt::Debug
18179    for UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit
18180{
18181    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18182        f.write_str(self.as_str())
18183    }
18184}
18185#[cfg(feature = "redact-generated-debug")]
18186impl std::fmt::Debug
18187    for UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit
18188{
18189    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18190        f.debug_struct(stringify!(
18191            UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit
18192        ))
18193        .finish_non_exhaustive()
18194    }
18195}
18196impl serde::Serialize
18197    for UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit
18198{
18199    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18200    where
18201        S: serde::Serializer,
18202    {
18203        serializer.serialize_str(self.as_str())
18204    }
18205}
18206#[cfg(feature = "deserialize")]
18207impl<'de> serde::Deserialize<'de>
18208    for UpdateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit
18209{
18210    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18211        use std::str::FromStr;
18212        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18213        Ok(Self::from_str(&s).expect("infallible"))
18214    }
18215}
18216/// Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`.
18217#[derive(Clone)]
18218#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
18219#[derive(serde::Serialize)]
18220pub struct UpdateCheckoutSessionShippingOptionsShippingRateDataFixedAmount {
18221    /// A non-negative integer in cents representing how much to charge.
18222    pub amount: i64,
18223    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
18224    /// Must be a [supported currency](https://stripe.com/docs/currencies).
18225    pub currency: stripe_types::Currency,
18226    /// Shipping rates defined in each available currency option.
18227    /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
18228    #[serde(skip_serializing_if = "Option::is_none")]
18229    pub currency_options: Option<
18230        std::collections::HashMap<
18231            stripe_types::Currency,
18232            UpdateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptions,
18233        >,
18234    >,
18235}
18236#[cfg(feature = "redact-generated-debug")]
18237impl std::fmt::Debug for UpdateCheckoutSessionShippingOptionsShippingRateDataFixedAmount {
18238    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18239        f.debug_struct("UpdateCheckoutSessionShippingOptionsShippingRateDataFixedAmount")
18240            .finish_non_exhaustive()
18241    }
18242}
18243impl UpdateCheckoutSessionShippingOptionsShippingRateDataFixedAmount {
18244    pub fn new(amount: impl Into<i64>, currency: impl Into<stripe_types::Currency>) -> Self {
18245        Self { amount: amount.into(), currency: currency.into(), currency_options: None }
18246    }
18247}
18248/// Shipping rates defined in each available currency option.
18249/// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
18250#[derive(Clone, Eq, PartialEq)]
18251#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
18252#[derive(serde::Serialize)]
18253pub struct UpdateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptions {
18254    /// A non-negative integer in cents representing how much to charge.
18255    pub amount: i64,
18256    /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes.
18257    /// One of `inclusive`, `exclusive`, or `unspecified`.
18258    #[serde(skip_serializing_if = "Option::is_none")]
18259    pub tax_behavior: Option<
18260        UpdateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior,
18261    >,
18262}
18263#[cfg(feature = "redact-generated-debug")]
18264impl std::fmt::Debug
18265    for UpdateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptions
18266{
18267    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18268        f.debug_struct(
18269            "UpdateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptions",
18270        )
18271        .finish_non_exhaustive()
18272    }
18273}
18274impl UpdateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptions {
18275    pub fn new(amount: impl Into<i64>) -> Self {
18276        Self { amount: amount.into(), tax_behavior: None }
18277    }
18278}
18279/// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes.
18280/// One of `inclusive`, `exclusive`, or `unspecified`.
18281#[derive(Clone, Eq, PartialEq)]
18282#[non_exhaustive]
18283pub enum UpdateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior {
18284    Exclusive,
18285    Inclusive,
18286    Unspecified,
18287    /// An unrecognized value from Stripe. Should not be used as a request parameter.
18288    Unknown(String),
18289}
18290impl UpdateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior {
18291    pub fn as_str(&self) -> &str {
18292        use UpdateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior::*;
18293        match self {
18294            Exclusive => "exclusive",
18295            Inclusive => "inclusive",
18296            Unspecified => "unspecified",
18297            Unknown(v) => v,
18298        }
18299    }
18300}
18301
18302impl std::str::FromStr
18303    for UpdateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior
18304{
18305    type Err = std::convert::Infallible;
18306    fn from_str(s: &str) -> Result<Self, Self::Err> {
18307        use UpdateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior::*;
18308        match s {
18309            "exclusive" => Ok(Exclusive),
18310            "inclusive" => Ok(Inclusive),
18311            "unspecified" => Ok(Unspecified),
18312            v => {
18313                tracing::warn!(
18314                    "Unknown value '{}' for enum '{}'",
18315                    v,
18316                    "UpdateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior"
18317                );
18318                Ok(Unknown(v.to_owned()))
18319            }
18320        }
18321    }
18322}
18323impl std::fmt::Display
18324    for UpdateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior
18325{
18326    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18327        f.write_str(self.as_str())
18328    }
18329}
18330
18331#[cfg(not(feature = "redact-generated-debug"))]
18332impl std::fmt::Debug
18333    for UpdateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior
18334{
18335    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18336        f.write_str(self.as_str())
18337    }
18338}
18339#[cfg(feature = "redact-generated-debug")]
18340impl std::fmt::Debug
18341    for UpdateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior
18342{
18343    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18344        f.debug_struct(stringify!(UpdateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior)).finish_non_exhaustive()
18345    }
18346}
18347impl serde::Serialize
18348    for UpdateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior
18349{
18350    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18351    where
18352        S: serde::Serializer,
18353    {
18354        serializer.serialize_str(self.as_str())
18355    }
18356}
18357#[cfg(feature = "deserialize")]
18358impl<'de> serde::Deserialize<'de>
18359    for UpdateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior
18360{
18361    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18362        use std::str::FromStr;
18363        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18364        Ok(Self::from_str(&s).expect("infallible"))
18365    }
18366}
18367/// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes.
18368/// One of `inclusive`, `exclusive`, or `unspecified`.
18369#[derive(Clone, Eq, PartialEq)]
18370#[non_exhaustive]
18371pub enum UpdateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior {
18372    Exclusive,
18373    Inclusive,
18374    Unspecified,
18375    /// An unrecognized value from Stripe. Should not be used as a request parameter.
18376    Unknown(String),
18377}
18378impl UpdateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior {
18379    pub fn as_str(&self) -> &str {
18380        use UpdateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior::*;
18381        match self {
18382            Exclusive => "exclusive",
18383            Inclusive => "inclusive",
18384            Unspecified => "unspecified",
18385            Unknown(v) => v,
18386        }
18387    }
18388}
18389
18390impl std::str::FromStr for UpdateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior {
18391    type Err = std::convert::Infallible;
18392    fn from_str(s: &str) -> Result<Self, Self::Err> {
18393        use UpdateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior::*;
18394        match s {
18395            "exclusive" => Ok(Exclusive),
18396            "inclusive" => Ok(Inclusive),
18397            "unspecified" => Ok(Unspecified),
18398            v => {
18399                tracing::warn!(
18400                    "Unknown value '{}' for enum '{}'",
18401                    v,
18402                    "UpdateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior"
18403                );
18404                Ok(Unknown(v.to_owned()))
18405            }
18406        }
18407    }
18408}
18409impl std::fmt::Display for UpdateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior {
18410    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18411        f.write_str(self.as_str())
18412    }
18413}
18414
18415#[cfg(not(feature = "redact-generated-debug"))]
18416impl std::fmt::Debug for UpdateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior {
18417    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18418        f.write_str(self.as_str())
18419    }
18420}
18421#[cfg(feature = "redact-generated-debug")]
18422impl std::fmt::Debug for UpdateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior {
18423    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18424        f.debug_struct(stringify!(UpdateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior))
18425            .finish_non_exhaustive()
18426    }
18427}
18428impl serde::Serialize for UpdateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior {
18429    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18430    where
18431        S: serde::Serializer,
18432    {
18433        serializer.serialize_str(self.as_str())
18434    }
18435}
18436#[cfg(feature = "deserialize")]
18437impl<'de> serde::Deserialize<'de>
18438    for UpdateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior
18439{
18440    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18441        use std::str::FromStr;
18442        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18443        Ok(Self::from_str(&s).expect("infallible"))
18444    }
18445}
18446/// The type of calculation to use on the shipping rate.
18447#[derive(Clone, Eq, PartialEq)]
18448#[non_exhaustive]
18449pub enum UpdateCheckoutSessionShippingOptionsShippingRateDataType {
18450    FixedAmount,
18451    /// An unrecognized value from Stripe. Should not be used as a request parameter.
18452    Unknown(String),
18453}
18454impl UpdateCheckoutSessionShippingOptionsShippingRateDataType {
18455    pub fn as_str(&self) -> &str {
18456        use UpdateCheckoutSessionShippingOptionsShippingRateDataType::*;
18457        match self {
18458            FixedAmount => "fixed_amount",
18459            Unknown(v) => v,
18460        }
18461    }
18462}
18463
18464impl std::str::FromStr for UpdateCheckoutSessionShippingOptionsShippingRateDataType {
18465    type Err = std::convert::Infallible;
18466    fn from_str(s: &str) -> Result<Self, Self::Err> {
18467        use UpdateCheckoutSessionShippingOptionsShippingRateDataType::*;
18468        match s {
18469            "fixed_amount" => Ok(FixedAmount),
18470            v => {
18471                tracing::warn!(
18472                    "Unknown value '{}' for enum '{}'",
18473                    v,
18474                    "UpdateCheckoutSessionShippingOptionsShippingRateDataType"
18475                );
18476                Ok(Unknown(v.to_owned()))
18477            }
18478        }
18479    }
18480}
18481impl std::fmt::Display for UpdateCheckoutSessionShippingOptionsShippingRateDataType {
18482    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18483        f.write_str(self.as_str())
18484    }
18485}
18486
18487#[cfg(not(feature = "redact-generated-debug"))]
18488impl std::fmt::Debug for UpdateCheckoutSessionShippingOptionsShippingRateDataType {
18489    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18490        f.write_str(self.as_str())
18491    }
18492}
18493#[cfg(feature = "redact-generated-debug")]
18494impl std::fmt::Debug for UpdateCheckoutSessionShippingOptionsShippingRateDataType {
18495    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18496        f.debug_struct(stringify!(UpdateCheckoutSessionShippingOptionsShippingRateDataType))
18497            .finish_non_exhaustive()
18498    }
18499}
18500impl serde::Serialize for UpdateCheckoutSessionShippingOptionsShippingRateDataType {
18501    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18502    where
18503        S: serde::Serializer,
18504    {
18505        serializer.serialize_str(self.as_str())
18506    }
18507}
18508#[cfg(feature = "deserialize")]
18509impl<'de> serde::Deserialize<'de> for UpdateCheckoutSessionShippingOptionsShippingRateDataType {
18510    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18511        use std::str::FromStr;
18512        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18513        Ok(Self::from_str(&s).expect("infallible"))
18514    }
18515}
18516/// Updates a Checkout Session object.
18517///
18518/// Related guide: <a href="/payments/advanced/dynamic-updates">Dynamically update a Checkout Session</a>.
18519#[derive(Clone)]
18520#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
18521#[derive(serde::Serialize)]
18522pub struct UpdateCheckoutSession {
18523    inner: UpdateCheckoutSessionBuilder,
18524    session: stripe_shared::CheckoutSessionId,
18525}
18526#[cfg(feature = "redact-generated-debug")]
18527impl std::fmt::Debug for UpdateCheckoutSession {
18528    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18529        f.debug_struct("UpdateCheckoutSession").finish_non_exhaustive()
18530    }
18531}
18532impl UpdateCheckoutSession {
18533    /// Construct a new `UpdateCheckoutSession`.
18534    pub fn new(session: impl Into<stripe_shared::CheckoutSessionId>) -> Self {
18535        Self { session: session.into(), inner: UpdateCheckoutSessionBuilder::new() }
18536    }
18537    /// Information about the customer collected within the Checkout Session.
18538    /// Can only be set when updating `embedded` or `custom` sessions.
18539    pub fn collected_information(
18540        mut self,
18541        collected_information: impl Into<UpdateCheckoutSessionCollectedInformation>,
18542    ) -> Self {
18543        self.inner.collected_information = Some(collected_information.into());
18544        self
18545    }
18546    /// Specifies which fields in the response should be expanded.
18547    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
18548        self.inner.expand = Some(expand.into());
18549        self
18550    }
18551    /// A list of items the customer is purchasing.
18552    ///
18553    /// When updating line items, you must retransmit the entire array of line items.
18554    ///
18555    /// To retain an existing line item, specify its `id`.
18556    ///
18557    /// To update an existing line item, specify its `id` along with the new values of the fields to update.
18558    ///
18559    /// To add a new line item, specify one of `price` or `price_data` and `quantity`.
18560    ///
18561    /// To remove an existing line item, omit the line item's ID from the retransmitted array.
18562    ///
18563    /// To reorder a line item, specify it at the desired position in the retransmitted array.
18564    pub fn line_items(
18565        mut self,
18566        line_items: impl Into<Vec<UpdateCheckoutSessionLineItems>>,
18567    ) -> Self {
18568        self.inner.line_items = Some(line_items.into());
18569        self
18570    }
18571    /// Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object.
18572    /// This can be useful for storing additional information about the object in a structured format.
18573    /// Individual keys can be unset by posting an empty value to them.
18574    /// All keys can be unset by posting an empty value to `metadata`.
18575    pub fn metadata(
18576        mut self,
18577        metadata: impl Into<std::collections::HashMap<String, String>>,
18578    ) -> Self {
18579        self.inner.metadata = Some(metadata.into());
18580        self
18581    }
18582    /// The shipping rate options to apply to this Session. Up to a maximum of 5.
18583    pub fn shipping_options(
18584        mut self,
18585        shipping_options: impl Into<Vec<UpdateCheckoutSessionShippingOptions>>,
18586    ) -> Self {
18587        self.inner.shipping_options = Some(shipping_options.into());
18588        self
18589    }
18590}
18591impl UpdateCheckoutSession {
18592    /// Send the request and return the deserialized response.
18593    pub async fn send<C: StripeClient>(
18594        &self,
18595        client: &C,
18596    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
18597        self.customize().send(client).await
18598    }
18599
18600    /// Send the request and return the deserialized response, blocking until completion.
18601    pub fn send_blocking<C: StripeBlockingClient>(
18602        &self,
18603        client: &C,
18604    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
18605        self.customize().send_blocking(client)
18606    }
18607}
18608
18609impl StripeRequest for UpdateCheckoutSession {
18610    type Output = stripe_shared::CheckoutSession;
18611
18612    fn build(&self) -> RequestBuilder {
18613        let session = &self.session;
18614        RequestBuilder::new(StripeMethod::Post, format!("/checkout/sessions/{session}"))
18615            .form(&self.inner)
18616    }
18617}
18618#[derive(Clone, Eq, PartialEq)]
18619#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
18620#[derive(serde::Serialize)]
18621struct ExpireCheckoutSessionBuilder {
18622    #[serde(skip_serializing_if = "Option::is_none")]
18623    expand: Option<Vec<String>>,
18624}
18625#[cfg(feature = "redact-generated-debug")]
18626impl std::fmt::Debug for ExpireCheckoutSessionBuilder {
18627    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18628        f.debug_struct("ExpireCheckoutSessionBuilder").finish_non_exhaustive()
18629    }
18630}
18631impl ExpireCheckoutSessionBuilder {
18632    fn new() -> Self {
18633        Self { expand: None }
18634    }
18635}
18636/// A Checkout Session can be expired when it is in one of these statuses: `open`
18637///
18638/// After it expires, a customer can’t complete a Checkout Session and customers loading the Checkout Session see a message saying the Checkout Session is expired.
18639#[derive(Clone)]
18640#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
18641#[derive(serde::Serialize)]
18642pub struct ExpireCheckoutSession {
18643    inner: ExpireCheckoutSessionBuilder,
18644    session: stripe_shared::CheckoutSessionId,
18645}
18646#[cfg(feature = "redact-generated-debug")]
18647impl std::fmt::Debug for ExpireCheckoutSession {
18648    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18649        f.debug_struct("ExpireCheckoutSession").finish_non_exhaustive()
18650    }
18651}
18652impl ExpireCheckoutSession {
18653    /// Construct a new `ExpireCheckoutSession`.
18654    pub fn new(session: impl Into<stripe_shared::CheckoutSessionId>) -> Self {
18655        Self { session: session.into(), inner: ExpireCheckoutSessionBuilder::new() }
18656    }
18657    /// Specifies which fields in the response should be expanded.
18658    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
18659        self.inner.expand = Some(expand.into());
18660        self
18661    }
18662}
18663impl ExpireCheckoutSession {
18664    /// Send the request and return the deserialized response.
18665    pub async fn send<C: StripeClient>(
18666        &self,
18667        client: &C,
18668    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
18669        self.customize().send(client).await
18670    }
18671
18672    /// Send the request and return the deserialized response, blocking until completion.
18673    pub fn send_blocking<C: StripeBlockingClient>(
18674        &self,
18675        client: &C,
18676    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
18677        self.customize().send_blocking(client)
18678    }
18679}
18680
18681impl StripeRequest for ExpireCheckoutSession {
18682    type Output = stripe_shared::CheckoutSession;
18683
18684    fn build(&self) -> RequestBuilder {
18685        let session = &self.session;
18686        RequestBuilder::new(StripeMethod::Post, format!("/checkout/sessions/{session}/expire"))
18687            .form(&self.inner)
18688    }
18689}
18690
18691#[derive(Clone, Eq, PartialEq)]
18692#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
18693#[derive(serde::Serialize)]
18694pub struct CustomTextPositionParam {
18695    /// Text can be up to 1200 characters in length.
18696    pub message: String,
18697}
18698#[cfg(feature = "redact-generated-debug")]
18699impl std::fmt::Debug for CustomTextPositionParam {
18700    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18701        f.debug_struct("CustomTextPositionParam").finish_non_exhaustive()
18702    }
18703}
18704impl CustomTextPositionParam {
18705    pub fn new(message: impl Into<String>) -> Self {
18706        Self { message: message.into() }
18707    }
18708}
18709#[derive(Clone)]
18710#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
18711#[derive(serde::Serialize)]
18712pub struct ProductData {
18713    /// The product's description, meant to be displayable to the customer.
18714    /// Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.
18715    #[serde(skip_serializing_if = "Option::is_none")]
18716    pub description: Option<String>,
18717    /// A list of up to 8 URLs of images for this product, meant to be displayable to the customer.
18718    #[serde(skip_serializing_if = "Option::is_none")]
18719    pub images: Option<Vec<String>>,
18720    /// Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object.
18721    /// This can be useful for storing additional information about the object in a structured format.
18722    /// Individual keys can be unset by posting an empty value to them.
18723    /// All keys can be unset by posting an empty value to `metadata`.
18724    #[serde(skip_serializing_if = "Option::is_none")]
18725    pub metadata: Option<std::collections::HashMap<String, String>>,
18726    /// The product's name, meant to be displayable to the customer.
18727    pub name: String,
18728    /// A [tax code](https://docs.stripe.com/tax/tax-categories) ID.
18729    #[serde(skip_serializing_if = "Option::is_none")]
18730    pub tax_code: Option<String>,
18731    /// A label that represents units of this product.
18732    /// When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal.
18733    #[serde(skip_serializing_if = "Option::is_none")]
18734    pub unit_label: Option<String>,
18735}
18736#[cfg(feature = "redact-generated-debug")]
18737impl std::fmt::Debug for ProductData {
18738    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18739        f.debug_struct("ProductData").finish_non_exhaustive()
18740    }
18741}
18742impl ProductData {
18743    pub fn new(name: impl Into<String>) -> Self {
18744        Self {
18745            description: None,
18746            images: None,
18747            metadata: None,
18748            name: name.into(),
18749            tax_code: None,
18750            unit_label: None,
18751        }
18752    }
18753}