stripe_core/payment_intent/
requests.rs

1use stripe_client_core::{
2    RequestBuilder, StripeBlockingClient, StripeClient, StripeMethod, StripeRequest,
3};
4
5#[derive(Clone, Debug, serde::Serialize)]
6struct ListPaymentIntentBuilder {
7    #[serde(skip_serializing_if = "Option::is_none")]
8    created: Option<stripe_types::RangeQueryTs>,
9    #[serde(skip_serializing_if = "Option::is_none")]
10    customer: Option<String>,
11    #[serde(skip_serializing_if = "Option::is_none")]
12    ending_before: Option<String>,
13    #[serde(skip_serializing_if = "Option::is_none")]
14    expand: Option<Vec<String>>,
15    #[serde(skip_serializing_if = "Option::is_none")]
16    limit: Option<i64>,
17    #[serde(skip_serializing_if = "Option::is_none")]
18    starting_after: Option<String>,
19}
20impl ListPaymentIntentBuilder {
21    fn new() -> Self {
22        Self {
23            created: None,
24            customer: None,
25            ending_before: None,
26            expand: None,
27            limit: None,
28            starting_after: None,
29        }
30    }
31}
32/// Returns a list of PaymentIntents.
33#[derive(Clone, Debug, serde::Serialize)]
34pub struct ListPaymentIntent {
35    inner: ListPaymentIntentBuilder,
36}
37impl ListPaymentIntent {
38    /// Construct a new `ListPaymentIntent`.
39    pub fn new() -> Self {
40        Self { inner: ListPaymentIntentBuilder::new() }
41    }
42    /// A filter on the list, based on the object `created` field.
43    /// The value can be a string with an integer Unix timestamp or a dictionary with a number of different query options.
44    pub fn created(mut self, created: impl Into<stripe_types::RangeQueryTs>) -> Self {
45        self.inner.created = Some(created.into());
46        self
47    }
48    /// Only return PaymentIntents for the customer that this customer ID specifies.
49    pub fn customer(mut self, customer: impl Into<String>) -> Self {
50        self.inner.customer = Some(customer.into());
51        self
52    }
53    /// A cursor for use in pagination.
54    /// `ending_before` is an object ID that defines your place in the list.
55    /// 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.
56    pub fn ending_before(mut self, ending_before: impl Into<String>) -> Self {
57        self.inner.ending_before = Some(ending_before.into());
58        self
59    }
60    /// Specifies which fields in the response should be expanded.
61    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
62        self.inner.expand = Some(expand.into());
63        self
64    }
65    /// A limit on the number of objects to be returned.
66    /// Limit can range between 1 and 100, and the default is 10.
67    pub fn limit(mut self, limit: impl Into<i64>) -> Self {
68        self.inner.limit = Some(limit.into());
69        self
70    }
71    /// A cursor for use in pagination.
72    /// `starting_after` is an object ID that defines your place in the list.
73    /// 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.
74    pub fn starting_after(mut self, starting_after: impl Into<String>) -> Self {
75        self.inner.starting_after = Some(starting_after.into());
76        self
77    }
78}
79impl Default for ListPaymentIntent {
80    fn default() -> Self {
81        Self::new()
82    }
83}
84impl ListPaymentIntent {
85    /// Send the request and return the deserialized response.
86    pub async fn send<C: StripeClient>(
87        &self,
88        client: &C,
89    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
90        self.customize().send(client).await
91    }
92
93    /// Send the request and return the deserialized response, blocking until completion.
94    pub fn send_blocking<C: StripeBlockingClient>(
95        &self,
96        client: &C,
97    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
98        self.customize().send_blocking(client)
99    }
100
101    pub fn paginate(
102        &self,
103    ) -> stripe_client_core::ListPaginator<stripe_types::List<stripe_shared::PaymentIntent>> {
104        stripe_client_core::ListPaginator::new_list("/payment_intents", &self.inner)
105    }
106}
107
108impl StripeRequest for ListPaymentIntent {
109    type Output = stripe_types::List<stripe_shared::PaymentIntent>;
110
111    fn build(&self) -> RequestBuilder {
112        RequestBuilder::new(StripeMethod::Get, "/payment_intents").query(&self.inner)
113    }
114}
115#[derive(Clone, Debug, serde::Serialize)]
116struct RetrievePaymentIntentBuilder {
117    #[serde(skip_serializing_if = "Option::is_none")]
118    client_secret: Option<String>,
119    #[serde(skip_serializing_if = "Option::is_none")]
120    expand: Option<Vec<String>>,
121}
122impl RetrievePaymentIntentBuilder {
123    fn new() -> Self {
124        Self { client_secret: None, expand: None }
125    }
126}
127/// Retrieves the details of a PaymentIntent that has previously been created.
128///
129/// You can retrieve a PaymentIntent client-side using a publishable key when the `client_secret` is in the query string.
130///
131///
132/// If you retrieve a PaymentIntent with a publishable key, it only returns a subset of properties.
133/// Refer to the [payment intent](https://stripe.com/docs/api#payment_intent_object) object reference for more details.
134#[derive(Clone, Debug, serde::Serialize)]
135pub struct RetrievePaymentIntent {
136    inner: RetrievePaymentIntentBuilder,
137    intent: stripe_shared::PaymentIntentId,
138}
139impl RetrievePaymentIntent {
140    /// Construct a new `RetrievePaymentIntent`.
141    pub fn new(intent: impl Into<stripe_shared::PaymentIntentId>) -> Self {
142        Self { intent: intent.into(), inner: RetrievePaymentIntentBuilder::new() }
143    }
144    /// The client secret of the PaymentIntent.
145    /// We require it if you use a publishable key to retrieve the source.
146    pub fn client_secret(mut self, client_secret: impl Into<String>) -> Self {
147        self.inner.client_secret = Some(client_secret.into());
148        self
149    }
150    /// Specifies which fields in the response should be expanded.
151    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
152        self.inner.expand = Some(expand.into());
153        self
154    }
155}
156impl RetrievePaymentIntent {
157    /// Send the request and return the deserialized response.
158    pub async fn send<C: StripeClient>(
159        &self,
160        client: &C,
161    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
162        self.customize().send(client).await
163    }
164
165    /// Send the request and return the deserialized response, blocking until completion.
166    pub fn send_blocking<C: StripeBlockingClient>(
167        &self,
168        client: &C,
169    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
170        self.customize().send_blocking(client)
171    }
172}
173
174impl StripeRequest for RetrievePaymentIntent {
175    type Output = stripe_shared::PaymentIntent;
176
177    fn build(&self) -> RequestBuilder {
178        let intent = &self.intent;
179        RequestBuilder::new(StripeMethod::Get, format!("/payment_intents/{intent}"))
180            .query(&self.inner)
181    }
182}
183#[derive(Clone, Debug, serde::Serialize)]
184struct SearchPaymentIntentBuilder {
185    #[serde(skip_serializing_if = "Option::is_none")]
186    expand: Option<Vec<String>>,
187    #[serde(skip_serializing_if = "Option::is_none")]
188    limit: Option<i64>,
189    #[serde(skip_serializing_if = "Option::is_none")]
190    page: Option<String>,
191    query: String,
192}
193impl SearchPaymentIntentBuilder {
194    fn new(query: impl Into<String>) -> Self {
195        Self { expand: None, limit: None, page: None, query: query.into() }
196    }
197}
198/// Search for PaymentIntents you’ve previously created using Stripe’s [Search Query Language](https://stripe.com/docs/search#search-query-language).
199/// Don’t use search in read-after-write flows where strict consistency is necessary.
200/// Under normal operating.
201/// conditions, data is searchable in less than a minute.
202/// Occasionally, propagation of new or updated data can be up.
203/// to an hour behind during outages. Search functionality is not available to merchants in India.
204#[derive(Clone, Debug, serde::Serialize)]
205pub struct SearchPaymentIntent {
206    inner: SearchPaymentIntentBuilder,
207}
208impl SearchPaymentIntent {
209    /// Construct a new `SearchPaymentIntent`.
210    pub fn new(query: impl Into<String>) -> Self {
211        Self { inner: SearchPaymentIntentBuilder::new(query.into()) }
212    }
213    /// Specifies which fields in the response should be expanded.
214    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
215        self.inner.expand = Some(expand.into());
216        self
217    }
218    /// A limit on the number of objects to be returned.
219    /// Limit can range between 1 and 100, and the default is 10.
220    pub fn limit(mut self, limit: impl Into<i64>) -> Self {
221        self.inner.limit = Some(limit.into());
222        self
223    }
224    /// A cursor for pagination across multiple pages of results.
225    /// Don't include this parameter on the first call.
226    /// Use the next_page value returned in a previous response to request subsequent results.
227    pub fn page(mut self, page: impl Into<String>) -> Self {
228        self.inner.page = Some(page.into());
229        self
230    }
231}
232impl SearchPaymentIntent {
233    /// Send the request and return the deserialized response.
234    pub async fn send<C: StripeClient>(
235        &self,
236        client: &C,
237    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
238        self.customize().send(client).await
239    }
240
241    /// Send the request and return the deserialized response, blocking until completion.
242    pub fn send_blocking<C: StripeBlockingClient>(
243        &self,
244        client: &C,
245    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
246        self.customize().send_blocking(client)
247    }
248
249    pub fn paginate(
250        &self,
251    ) -> stripe_client_core::ListPaginator<stripe_types::SearchList<stripe_shared::PaymentIntent>>
252    {
253        stripe_client_core::ListPaginator::new_search_list("/payment_intents/search", &self.inner)
254    }
255}
256
257impl StripeRequest for SearchPaymentIntent {
258    type Output = stripe_types::SearchList<stripe_shared::PaymentIntent>;
259
260    fn build(&self) -> RequestBuilder {
261        RequestBuilder::new(StripeMethod::Get, "/payment_intents/search").query(&self.inner)
262    }
263}
264#[derive(Clone, Debug, serde::Serialize)]
265struct CreatePaymentIntentBuilder {
266    amount: i64,
267    #[serde(skip_serializing_if = "Option::is_none")]
268    application_fee_amount: Option<i64>,
269    #[serde(skip_serializing_if = "Option::is_none")]
270    automatic_payment_methods: Option<CreatePaymentIntentAutomaticPaymentMethods>,
271    #[serde(skip_serializing_if = "Option::is_none")]
272    capture_method: Option<stripe_shared::PaymentIntentCaptureMethod>,
273    #[serde(skip_serializing_if = "Option::is_none")]
274    confirm: Option<bool>,
275    #[serde(skip_serializing_if = "Option::is_none")]
276    confirmation_method: Option<stripe_shared::PaymentIntentConfirmationMethod>,
277    #[serde(skip_serializing_if = "Option::is_none")]
278    confirmation_token: Option<String>,
279    currency: stripe_types::Currency,
280    #[serde(skip_serializing_if = "Option::is_none")]
281    customer: Option<String>,
282    #[serde(skip_serializing_if = "Option::is_none")]
283    description: Option<String>,
284    #[serde(skip_serializing_if = "Option::is_none")]
285    error_on_requires_action: Option<bool>,
286    #[serde(skip_serializing_if = "Option::is_none")]
287    excluded_payment_method_types:
288        Option<Vec<stripe_shared::PaymentIntentExcludedPaymentMethodTypes>>,
289    #[serde(skip_serializing_if = "Option::is_none")]
290    expand: Option<Vec<String>>,
291    #[serde(skip_serializing_if = "Option::is_none")]
292    mandate: Option<String>,
293    #[serde(skip_serializing_if = "Option::is_none")]
294    mandate_data: Option<CreatePaymentIntentMandateData>,
295    #[serde(skip_serializing_if = "Option::is_none")]
296    metadata: Option<std::collections::HashMap<String, String>>,
297    #[serde(skip_serializing_if = "Option::is_none")]
298    off_session: Option<CreatePaymentIntentOffSession>,
299    #[serde(skip_serializing_if = "Option::is_none")]
300    on_behalf_of: Option<String>,
301    #[serde(skip_serializing_if = "Option::is_none")]
302    payment_method: Option<String>,
303    #[serde(skip_serializing_if = "Option::is_none")]
304    payment_method_configuration: Option<String>,
305    #[serde(skip_serializing_if = "Option::is_none")]
306    payment_method_data: Option<CreatePaymentIntentPaymentMethodData>,
307    #[serde(skip_serializing_if = "Option::is_none")]
308    payment_method_options: Option<CreatePaymentIntentPaymentMethodOptions>,
309    #[serde(skip_serializing_if = "Option::is_none")]
310    payment_method_types: Option<Vec<String>>,
311    #[serde(skip_serializing_if = "Option::is_none")]
312    radar_options: Option<RadarOptionsWithHiddenOptions>,
313    #[serde(skip_serializing_if = "Option::is_none")]
314    receipt_email: Option<String>,
315    #[serde(skip_serializing_if = "Option::is_none")]
316    return_url: Option<String>,
317    #[serde(skip_serializing_if = "Option::is_none")]
318    setup_future_usage: Option<stripe_shared::PaymentIntentSetupFutureUsage>,
319    #[serde(skip_serializing_if = "Option::is_none")]
320    shipping: Option<CreatePaymentIntentShipping>,
321    #[serde(skip_serializing_if = "Option::is_none")]
322    statement_descriptor: Option<String>,
323    #[serde(skip_serializing_if = "Option::is_none")]
324    statement_descriptor_suffix: Option<String>,
325    #[serde(skip_serializing_if = "Option::is_none")]
326    transfer_data: Option<CreatePaymentIntentTransferData>,
327    #[serde(skip_serializing_if = "Option::is_none")]
328    transfer_group: Option<String>,
329    #[serde(skip_serializing_if = "Option::is_none")]
330    use_stripe_sdk: Option<bool>,
331}
332impl CreatePaymentIntentBuilder {
333    fn new(amount: impl Into<i64>, currency: impl Into<stripe_types::Currency>) -> Self {
334        Self {
335            amount: amount.into(),
336            application_fee_amount: None,
337            automatic_payment_methods: None,
338            capture_method: None,
339            confirm: None,
340            confirmation_method: None,
341            confirmation_token: None,
342            currency: currency.into(),
343            customer: None,
344            description: None,
345            error_on_requires_action: None,
346            excluded_payment_method_types: None,
347            expand: None,
348            mandate: None,
349            mandate_data: None,
350            metadata: None,
351            off_session: None,
352            on_behalf_of: None,
353            payment_method: None,
354            payment_method_configuration: None,
355            payment_method_data: None,
356            payment_method_options: None,
357            payment_method_types: None,
358            radar_options: None,
359            receipt_email: None,
360            return_url: None,
361            setup_future_usage: None,
362            shipping: None,
363            statement_descriptor: None,
364            statement_descriptor_suffix: None,
365            transfer_data: None,
366            transfer_group: None,
367            use_stripe_sdk: None,
368        }
369    }
370}
371/// When you enable this parameter, this PaymentIntent accepts payment methods that you enable in the Dashboard and that are compatible with this PaymentIntent's other parameters.
372#[derive(Copy, Clone, Debug, serde::Serialize)]
373pub struct CreatePaymentIntentAutomaticPaymentMethods {
374    /// Controls whether this PaymentIntent will accept redirect-based payment methods.
375    ///
376    /// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps.
377    /// To [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment.
378    #[serde(skip_serializing_if = "Option::is_none")]
379    pub allow_redirects: Option<CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects>,
380    /// Whether this feature is enabled.
381    pub enabled: bool,
382}
383impl CreatePaymentIntentAutomaticPaymentMethods {
384    pub fn new(enabled: impl Into<bool>) -> Self {
385        Self { allow_redirects: None, enabled: enabled.into() }
386    }
387}
388/// Controls whether this PaymentIntent will accept redirect-based payment methods.
389///
390/// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps.
391/// To [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment.
392#[derive(Copy, Clone, Eq, PartialEq)]
393pub enum CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects {
394    Always,
395    Never,
396}
397impl CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects {
398    pub fn as_str(self) -> &'static str {
399        use CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects::*;
400        match self {
401            Always => "always",
402            Never => "never",
403        }
404    }
405}
406
407impl std::str::FromStr for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects {
408    type Err = stripe_types::StripeParseError;
409    fn from_str(s: &str) -> Result<Self, Self::Err> {
410        use CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects::*;
411        match s {
412            "always" => Ok(Always),
413            "never" => Ok(Never),
414            _ => Err(stripe_types::StripeParseError),
415        }
416    }
417}
418impl std::fmt::Display for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects {
419    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
420        f.write_str(self.as_str())
421    }
422}
423
424impl std::fmt::Debug for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects {
425    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
426        f.write_str(self.as_str())
427    }
428}
429impl serde::Serialize for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects {
430    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
431    where
432        S: serde::Serializer,
433    {
434        serializer.serialize_str(self.as_str())
435    }
436}
437#[cfg(feature = "deserialize")]
438impl<'de> serde::Deserialize<'de> for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects {
439    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
440        use std::str::FromStr;
441        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
442        Self::from_str(&s).map_err(|_| {
443            serde::de::Error::custom(
444                "Unknown value for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects",
445            )
446        })
447    }
448}
449/// This hash contains details about the Mandate to create.
450/// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
451#[derive(Clone, Debug, serde::Serialize)]
452pub struct CreatePaymentIntentMandateData {
453    /// This hash contains details about the customer acceptance of the Mandate.
454    pub customer_acceptance: CreatePaymentIntentMandateDataCustomerAcceptance,
455}
456impl CreatePaymentIntentMandateData {
457    pub fn new(
458        customer_acceptance: impl Into<CreatePaymentIntentMandateDataCustomerAcceptance>,
459    ) -> Self {
460        Self { customer_acceptance: customer_acceptance.into() }
461    }
462}
463/// This hash contains details about the customer acceptance of the Mandate.
464#[derive(Clone, Debug, serde::Serialize)]
465pub struct CreatePaymentIntentMandateDataCustomerAcceptance {
466    /// The time at which the customer accepted the Mandate.
467    #[serde(skip_serializing_if = "Option::is_none")]
468    pub accepted_at: Option<stripe_types::Timestamp>,
469    /// If this is a Mandate accepted offline, this hash contains details about the offline acceptance.
470    #[serde(skip_serializing_if = "Option::is_none")]
471    #[serde(with = "stripe_types::with_serde_json_opt")]
472    pub offline: Option<miniserde::json::Value>,
473    /// If this is a Mandate accepted online, this hash contains details about the online acceptance.
474    #[serde(skip_serializing_if = "Option::is_none")]
475    pub online: Option<OnlineParam>,
476    /// The type of customer acceptance information included with the Mandate.
477    /// One of `online` or `offline`.
478    #[serde(rename = "type")]
479    pub type_: CreatePaymentIntentMandateDataCustomerAcceptanceType,
480}
481impl CreatePaymentIntentMandateDataCustomerAcceptance {
482    pub fn new(type_: impl Into<CreatePaymentIntentMandateDataCustomerAcceptanceType>) -> Self {
483        Self { accepted_at: None, offline: None, online: None, type_: type_.into() }
484    }
485}
486/// The type of customer acceptance information included with the Mandate.
487/// One of `online` or `offline`.
488#[derive(Copy, Clone, Eq, PartialEq)]
489pub enum CreatePaymentIntentMandateDataCustomerAcceptanceType {
490    Offline,
491    Online,
492}
493impl CreatePaymentIntentMandateDataCustomerAcceptanceType {
494    pub fn as_str(self) -> &'static str {
495        use CreatePaymentIntentMandateDataCustomerAcceptanceType::*;
496        match self {
497            Offline => "offline",
498            Online => "online",
499        }
500    }
501}
502
503impl std::str::FromStr for CreatePaymentIntentMandateDataCustomerAcceptanceType {
504    type Err = stripe_types::StripeParseError;
505    fn from_str(s: &str) -> Result<Self, Self::Err> {
506        use CreatePaymentIntentMandateDataCustomerAcceptanceType::*;
507        match s {
508            "offline" => Ok(Offline),
509            "online" => Ok(Online),
510            _ => Err(stripe_types::StripeParseError),
511        }
512    }
513}
514impl std::fmt::Display for CreatePaymentIntentMandateDataCustomerAcceptanceType {
515    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
516        f.write_str(self.as_str())
517    }
518}
519
520impl std::fmt::Debug for CreatePaymentIntentMandateDataCustomerAcceptanceType {
521    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
522        f.write_str(self.as_str())
523    }
524}
525impl serde::Serialize for CreatePaymentIntentMandateDataCustomerAcceptanceType {
526    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
527    where
528        S: serde::Serializer,
529    {
530        serializer.serialize_str(self.as_str())
531    }
532}
533#[cfg(feature = "deserialize")]
534impl<'de> serde::Deserialize<'de> for CreatePaymentIntentMandateDataCustomerAcceptanceType {
535    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
536        use std::str::FromStr;
537        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
538        Self::from_str(&s).map_err(|_| {
539            serde::de::Error::custom(
540                "Unknown value for CreatePaymentIntentMandateDataCustomerAcceptanceType",
541            )
542        })
543    }
544}
545/// Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate.
546/// Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards).
547/// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
548#[derive(Copy, Clone, Debug, serde::Serialize)]
549#[serde(rename_all = "snake_case")]
550pub enum CreatePaymentIntentOffSession {
551    OneOff,
552    Recurring,
553    #[serde(untagged)]
554    Bool(bool),
555}
556/// If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear
557/// in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method).
558/// property on the PaymentIntent.
559#[derive(Clone, Debug, serde::Serialize)]
560pub struct CreatePaymentIntentPaymentMethodData {
561    /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
562    #[serde(skip_serializing_if = "Option::is_none")]
563    pub acss_debit: Option<PaymentMethodParam>,
564    /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
565    #[serde(skip_serializing_if = "Option::is_none")]
566    #[serde(with = "stripe_types::with_serde_json_opt")]
567    pub affirm: Option<miniserde::json::Value>,
568    /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
569    #[serde(skip_serializing_if = "Option::is_none")]
570    #[serde(with = "stripe_types::with_serde_json_opt")]
571    pub afterpay_clearpay: Option<miniserde::json::Value>,
572    /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
573    #[serde(skip_serializing_if = "Option::is_none")]
574    #[serde(with = "stripe_types::with_serde_json_opt")]
575    pub alipay: Option<miniserde::json::Value>,
576    /// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
577    /// Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow.
578    /// The field defaults to `unspecified`.
579    #[serde(skip_serializing_if = "Option::is_none")]
580    pub allow_redisplay: Option<CreatePaymentIntentPaymentMethodDataAllowRedisplay>,
581    /// If this is a Alma PaymentMethod, this hash contains details about the Alma payment method.
582    #[serde(skip_serializing_if = "Option::is_none")]
583    #[serde(with = "stripe_types::with_serde_json_opt")]
584    pub alma: Option<miniserde::json::Value>,
585    /// If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method.
586    #[serde(skip_serializing_if = "Option::is_none")]
587    #[serde(with = "stripe_types::with_serde_json_opt")]
588    pub amazon_pay: Option<miniserde::json::Value>,
589    /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
590    #[serde(skip_serializing_if = "Option::is_none")]
591    pub au_becs_debit: Option<CreatePaymentIntentPaymentMethodDataAuBecsDebit>,
592    /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
593    #[serde(skip_serializing_if = "Option::is_none")]
594    pub bacs_debit: Option<CreatePaymentIntentPaymentMethodDataBacsDebit>,
595    /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
596    #[serde(skip_serializing_if = "Option::is_none")]
597    #[serde(with = "stripe_types::with_serde_json_opt")]
598    pub bancontact: Option<miniserde::json::Value>,
599    /// If this is a `billie` PaymentMethod, this hash contains details about the Billie payment method.
600    #[serde(skip_serializing_if = "Option::is_none")]
601    #[serde(with = "stripe_types::with_serde_json_opt")]
602    pub billie: Option<miniserde::json::Value>,
603    /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
604    #[serde(skip_serializing_if = "Option::is_none")]
605    pub billing_details: Option<CreatePaymentIntentPaymentMethodDataBillingDetails>,
606    /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
607    #[serde(skip_serializing_if = "Option::is_none")]
608    #[serde(with = "stripe_types::with_serde_json_opt")]
609    pub blik: Option<miniserde::json::Value>,
610    /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
611    #[serde(skip_serializing_if = "Option::is_none")]
612    pub boleto: Option<CreatePaymentIntentPaymentMethodDataBoleto>,
613    /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
614    #[serde(skip_serializing_if = "Option::is_none")]
615    #[serde(with = "stripe_types::with_serde_json_opt")]
616    pub cashapp: Option<miniserde::json::Value>,
617    /// If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method.
618    #[serde(skip_serializing_if = "Option::is_none")]
619    #[serde(with = "stripe_types::with_serde_json_opt")]
620    pub crypto: Option<miniserde::json::Value>,
621    /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
622    #[serde(skip_serializing_if = "Option::is_none")]
623    #[serde(with = "stripe_types::with_serde_json_opt")]
624    pub customer_balance: Option<miniserde::json::Value>,
625    /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
626    #[serde(skip_serializing_if = "Option::is_none")]
627    pub eps: Option<CreatePaymentIntentPaymentMethodDataEps>,
628    /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
629    #[serde(skip_serializing_if = "Option::is_none")]
630    pub fpx: Option<CreatePaymentIntentPaymentMethodDataFpx>,
631    /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
632    #[serde(skip_serializing_if = "Option::is_none")]
633    #[serde(with = "stripe_types::with_serde_json_opt")]
634    pub giropay: Option<miniserde::json::Value>,
635    /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
636    #[serde(skip_serializing_if = "Option::is_none")]
637    #[serde(with = "stripe_types::with_serde_json_opt")]
638    pub grabpay: Option<miniserde::json::Value>,
639    /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
640    #[serde(skip_serializing_if = "Option::is_none")]
641    pub ideal: Option<CreatePaymentIntentPaymentMethodDataIdeal>,
642    /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
643    #[serde(skip_serializing_if = "Option::is_none")]
644    #[serde(with = "stripe_types::with_serde_json_opt")]
645    pub interac_present: Option<miniserde::json::Value>,
646    /// If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method.
647    #[serde(skip_serializing_if = "Option::is_none")]
648    #[serde(with = "stripe_types::with_serde_json_opt")]
649    pub kakao_pay: Option<miniserde::json::Value>,
650    /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
651    #[serde(skip_serializing_if = "Option::is_none")]
652    pub klarna: Option<CreatePaymentIntentPaymentMethodDataKlarna>,
653    /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
654    #[serde(skip_serializing_if = "Option::is_none")]
655    #[serde(with = "stripe_types::with_serde_json_opt")]
656    pub konbini: Option<miniserde::json::Value>,
657    /// If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method.
658    #[serde(skip_serializing_if = "Option::is_none")]
659    #[serde(with = "stripe_types::with_serde_json_opt")]
660    pub kr_card: Option<miniserde::json::Value>,
661    /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
662    #[serde(skip_serializing_if = "Option::is_none")]
663    #[serde(with = "stripe_types::with_serde_json_opt")]
664    pub link: Option<miniserde::json::Value>,
665    /// If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method.
666    #[serde(skip_serializing_if = "Option::is_none")]
667    #[serde(with = "stripe_types::with_serde_json_opt")]
668    pub mb_way: Option<miniserde::json::Value>,
669    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
670    /// This can be useful for storing additional information about the object in a structured format.
671    /// Individual keys can be unset by posting an empty value to them.
672    /// All keys can be unset by posting an empty value to `metadata`.
673    #[serde(skip_serializing_if = "Option::is_none")]
674    pub metadata: Option<std::collections::HashMap<String, String>>,
675    /// If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
676    #[serde(skip_serializing_if = "Option::is_none")]
677    #[serde(with = "stripe_types::with_serde_json_opt")]
678    pub mobilepay: Option<miniserde::json::Value>,
679    /// If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method.
680    #[serde(skip_serializing_if = "Option::is_none")]
681    #[serde(with = "stripe_types::with_serde_json_opt")]
682    pub multibanco: Option<miniserde::json::Value>,
683    /// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
684    #[serde(skip_serializing_if = "Option::is_none")]
685    pub naver_pay: Option<CreatePaymentIntentPaymentMethodDataNaverPay>,
686    /// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
687    #[serde(skip_serializing_if = "Option::is_none")]
688    pub nz_bank_account: Option<CreatePaymentIntentPaymentMethodDataNzBankAccount>,
689    /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
690    #[serde(skip_serializing_if = "Option::is_none")]
691    #[serde(with = "stripe_types::with_serde_json_opt")]
692    pub oxxo: Option<miniserde::json::Value>,
693    /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
694    #[serde(skip_serializing_if = "Option::is_none")]
695    pub p24: Option<CreatePaymentIntentPaymentMethodDataP24>,
696    /// If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method.
697    #[serde(skip_serializing_if = "Option::is_none")]
698    #[serde(with = "stripe_types::with_serde_json_opt")]
699    pub pay_by_bank: Option<miniserde::json::Value>,
700    /// If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method.
701    #[serde(skip_serializing_if = "Option::is_none")]
702    #[serde(with = "stripe_types::with_serde_json_opt")]
703    pub payco: Option<miniserde::json::Value>,
704    /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
705    #[serde(skip_serializing_if = "Option::is_none")]
706    #[serde(with = "stripe_types::with_serde_json_opt")]
707    pub paynow: Option<miniserde::json::Value>,
708    /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
709    #[serde(skip_serializing_if = "Option::is_none")]
710    #[serde(with = "stripe_types::with_serde_json_opt")]
711    pub paypal: Option<miniserde::json::Value>,
712    /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
713    #[serde(skip_serializing_if = "Option::is_none")]
714    #[serde(with = "stripe_types::with_serde_json_opt")]
715    pub pix: Option<miniserde::json::Value>,
716    /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
717    #[serde(skip_serializing_if = "Option::is_none")]
718    #[serde(with = "stripe_types::with_serde_json_opt")]
719    pub promptpay: Option<miniserde::json::Value>,
720    /// Options to configure Radar.
721    /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
722    #[serde(skip_serializing_if = "Option::is_none")]
723    pub radar_options: Option<RadarOptionsWithHiddenOptions>,
724    /// If this is a `revolut_pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
725    #[serde(skip_serializing_if = "Option::is_none")]
726    #[serde(with = "stripe_types::with_serde_json_opt")]
727    pub revolut_pay: Option<miniserde::json::Value>,
728    /// If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method.
729    #[serde(skip_serializing_if = "Option::is_none")]
730    #[serde(with = "stripe_types::with_serde_json_opt")]
731    pub samsung_pay: Option<miniserde::json::Value>,
732    /// If this is a `satispay` PaymentMethod, this hash contains details about the Satispay payment method.
733    #[serde(skip_serializing_if = "Option::is_none")]
734    #[serde(with = "stripe_types::with_serde_json_opt")]
735    pub satispay: Option<miniserde::json::Value>,
736    /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
737    #[serde(skip_serializing_if = "Option::is_none")]
738    pub sepa_debit: Option<CreatePaymentIntentPaymentMethodDataSepaDebit>,
739    /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
740    #[serde(skip_serializing_if = "Option::is_none")]
741    pub sofort: Option<CreatePaymentIntentPaymentMethodDataSofort>,
742    /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
743    #[serde(skip_serializing_if = "Option::is_none")]
744    #[serde(with = "stripe_types::with_serde_json_opt")]
745    pub swish: Option<miniserde::json::Value>,
746    /// If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method.
747    #[serde(skip_serializing_if = "Option::is_none")]
748    #[serde(with = "stripe_types::with_serde_json_opt")]
749    pub twint: Option<miniserde::json::Value>,
750    /// The type of the PaymentMethod.
751    /// An additional hash is included on the PaymentMethod with a name matching this value.
752    /// It contains additional information specific to the PaymentMethod type.
753    #[serde(rename = "type")]
754    pub type_: CreatePaymentIntentPaymentMethodDataType,
755    /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
756    #[serde(skip_serializing_if = "Option::is_none")]
757    pub us_bank_account: Option<CreatePaymentIntentPaymentMethodDataUsBankAccount>,
758    /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
759    #[serde(skip_serializing_if = "Option::is_none")]
760    #[serde(with = "stripe_types::with_serde_json_opt")]
761    pub wechat_pay: Option<miniserde::json::Value>,
762    /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
763    #[serde(skip_serializing_if = "Option::is_none")]
764    #[serde(with = "stripe_types::with_serde_json_opt")]
765    pub zip: Option<miniserde::json::Value>,
766}
767impl CreatePaymentIntentPaymentMethodData {
768    pub fn new(type_: impl Into<CreatePaymentIntentPaymentMethodDataType>) -> Self {
769        Self {
770            acss_debit: None,
771            affirm: None,
772            afterpay_clearpay: None,
773            alipay: None,
774            allow_redisplay: None,
775            alma: None,
776            amazon_pay: None,
777            au_becs_debit: None,
778            bacs_debit: None,
779            bancontact: None,
780            billie: None,
781            billing_details: None,
782            blik: None,
783            boleto: None,
784            cashapp: None,
785            crypto: None,
786            customer_balance: None,
787            eps: None,
788            fpx: None,
789            giropay: None,
790            grabpay: None,
791            ideal: None,
792            interac_present: None,
793            kakao_pay: None,
794            klarna: None,
795            konbini: None,
796            kr_card: None,
797            link: None,
798            mb_way: None,
799            metadata: None,
800            mobilepay: None,
801            multibanco: None,
802            naver_pay: None,
803            nz_bank_account: None,
804            oxxo: None,
805            p24: None,
806            pay_by_bank: None,
807            payco: None,
808            paynow: None,
809            paypal: None,
810            pix: None,
811            promptpay: None,
812            radar_options: None,
813            revolut_pay: None,
814            samsung_pay: None,
815            satispay: None,
816            sepa_debit: None,
817            sofort: None,
818            swish: None,
819            twint: None,
820            type_: type_.into(),
821            us_bank_account: None,
822            wechat_pay: None,
823            zip: None,
824        }
825    }
826}
827/// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
828/// Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow.
829/// The field defaults to `unspecified`.
830#[derive(Copy, Clone, Eq, PartialEq)]
831pub enum CreatePaymentIntentPaymentMethodDataAllowRedisplay {
832    Always,
833    Limited,
834    Unspecified,
835}
836impl CreatePaymentIntentPaymentMethodDataAllowRedisplay {
837    pub fn as_str(self) -> &'static str {
838        use CreatePaymentIntentPaymentMethodDataAllowRedisplay::*;
839        match self {
840            Always => "always",
841            Limited => "limited",
842            Unspecified => "unspecified",
843        }
844    }
845}
846
847impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataAllowRedisplay {
848    type Err = stripe_types::StripeParseError;
849    fn from_str(s: &str) -> Result<Self, Self::Err> {
850        use CreatePaymentIntentPaymentMethodDataAllowRedisplay::*;
851        match s {
852            "always" => Ok(Always),
853            "limited" => Ok(Limited),
854            "unspecified" => Ok(Unspecified),
855            _ => Err(stripe_types::StripeParseError),
856        }
857    }
858}
859impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataAllowRedisplay {
860    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
861        f.write_str(self.as_str())
862    }
863}
864
865impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataAllowRedisplay {
866    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
867        f.write_str(self.as_str())
868    }
869}
870impl serde::Serialize for CreatePaymentIntentPaymentMethodDataAllowRedisplay {
871    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
872    where
873        S: serde::Serializer,
874    {
875        serializer.serialize_str(self.as_str())
876    }
877}
878#[cfg(feature = "deserialize")]
879impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataAllowRedisplay {
880    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
881        use std::str::FromStr;
882        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
883        Self::from_str(&s).map_err(|_| {
884            serde::de::Error::custom(
885                "Unknown value for CreatePaymentIntentPaymentMethodDataAllowRedisplay",
886            )
887        })
888    }
889}
890/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
891#[derive(Clone, Debug, serde::Serialize)]
892pub struct CreatePaymentIntentPaymentMethodDataAuBecsDebit {
893    /// The account number for the bank account.
894    pub account_number: String,
895    /// Bank-State-Branch number of the bank account.
896    pub bsb_number: String,
897}
898impl CreatePaymentIntentPaymentMethodDataAuBecsDebit {
899    pub fn new(account_number: impl Into<String>, bsb_number: impl Into<String>) -> Self {
900        Self { account_number: account_number.into(), bsb_number: bsb_number.into() }
901    }
902}
903/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
904#[derive(Clone, Debug, serde::Serialize)]
905pub struct CreatePaymentIntentPaymentMethodDataBacsDebit {
906    /// Account number of the bank account that the funds will be debited from.
907    #[serde(skip_serializing_if = "Option::is_none")]
908    pub account_number: Option<String>,
909    /// Sort code of the bank account. (e.g., `10-20-30`)
910    #[serde(skip_serializing_if = "Option::is_none")]
911    pub sort_code: Option<String>,
912}
913impl CreatePaymentIntentPaymentMethodDataBacsDebit {
914    pub fn new() -> Self {
915        Self { account_number: None, sort_code: None }
916    }
917}
918impl Default for CreatePaymentIntentPaymentMethodDataBacsDebit {
919    fn default() -> Self {
920        Self::new()
921    }
922}
923/// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
924#[derive(Clone, Debug, serde::Serialize)]
925pub struct CreatePaymentIntentPaymentMethodDataBillingDetails {
926    /// Billing address.
927    #[serde(skip_serializing_if = "Option::is_none")]
928    pub address: Option<CreatePaymentIntentPaymentMethodDataBillingDetailsAddress>,
929    /// Email address.
930    #[serde(skip_serializing_if = "Option::is_none")]
931    pub email: Option<String>,
932    /// Full name.
933    #[serde(skip_serializing_if = "Option::is_none")]
934    pub name: Option<String>,
935    /// Billing phone number (including extension).
936    #[serde(skip_serializing_if = "Option::is_none")]
937    pub phone: Option<String>,
938    /// Taxpayer identification number.
939    /// Used only for transactions between LATAM buyers and non-LATAM sellers.
940    #[serde(skip_serializing_if = "Option::is_none")]
941    pub tax_id: Option<String>,
942}
943impl CreatePaymentIntentPaymentMethodDataBillingDetails {
944    pub fn new() -> Self {
945        Self { address: None, email: None, name: None, phone: None, tax_id: None }
946    }
947}
948impl Default for CreatePaymentIntentPaymentMethodDataBillingDetails {
949    fn default() -> Self {
950        Self::new()
951    }
952}
953/// Billing address.
954#[derive(Clone, Debug, serde::Serialize)]
955pub struct CreatePaymentIntentPaymentMethodDataBillingDetailsAddress {
956    /// City, district, suburb, town, or village.
957    #[serde(skip_serializing_if = "Option::is_none")]
958    pub city: Option<String>,
959    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
960    #[serde(skip_serializing_if = "Option::is_none")]
961    pub country: Option<String>,
962    /// Address line 1, such as the street, PO Box, or company name.
963    #[serde(skip_serializing_if = "Option::is_none")]
964    pub line1: Option<String>,
965    /// Address line 2, such as the apartment, suite, unit, or building.
966    #[serde(skip_serializing_if = "Option::is_none")]
967    pub line2: Option<String>,
968    /// ZIP or postal code.
969    #[serde(skip_serializing_if = "Option::is_none")]
970    pub postal_code: Option<String>,
971    /// State, county, province, or region.
972    #[serde(skip_serializing_if = "Option::is_none")]
973    pub state: Option<String>,
974}
975impl CreatePaymentIntentPaymentMethodDataBillingDetailsAddress {
976    pub fn new() -> Self {
977        Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
978    }
979}
980impl Default for CreatePaymentIntentPaymentMethodDataBillingDetailsAddress {
981    fn default() -> Self {
982        Self::new()
983    }
984}
985/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
986#[derive(Clone, Debug, serde::Serialize)]
987pub struct CreatePaymentIntentPaymentMethodDataBoleto {
988    /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)
989    pub tax_id: String,
990}
991impl CreatePaymentIntentPaymentMethodDataBoleto {
992    pub fn new(tax_id: impl Into<String>) -> Self {
993        Self { tax_id: tax_id.into() }
994    }
995}
996/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
997#[derive(Clone, Debug, serde::Serialize)]
998pub struct CreatePaymentIntentPaymentMethodDataEps {
999    /// The customer's bank.
1000    #[serde(skip_serializing_if = "Option::is_none")]
1001    pub bank: Option<CreatePaymentIntentPaymentMethodDataEpsBank>,
1002}
1003impl CreatePaymentIntentPaymentMethodDataEps {
1004    pub fn new() -> Self {
1005        Self { bank: None }
1006    }
1007}
1008impl Default for CreatePaymentIntentPaymentMethodDataEps {
1009    fn default() -> Self {
1010        Self::new()
1011    }
1012}
1013/// The customer's bank.
1014#[derive(Clone, Eq, PartialEq)]
1015#[non_exhaustive]
1016pub enum CreatePaymentIntentPaymentMethodDataEpsBank {
1017    ArzteUndApothekerBank,
1018    AustrianAnadiBankAg,
1019    BankAustria,
1020    BankhausCarlSpangler,
1021    BankhausSchelhammerUndSchatteraAg,
1022    BawagPskAg,
1023    BksBankAg,
1024    BrullKallmusBankAg,
1025    BtvVierLanderBank,
1026    CapitalBankGraweGruppeAg,
1027    DeutscheBankAg,
1028    Dolomitenbank,
1029    EasybankAg,
1030    ErsteBankUndSparkassen,
1031    HypoAlpeadriabankInternationalAg,
1032    HypoBankBurgenlandAktiengesellschaft,
1033    HypoNoeLbFurNiederosterreichUWien,
1034    HypoOberosterreichSalzburgSteiermark,
1035    HypoTirolBankAg,
1036    HypoVorarlbergBankAg,
1037    MarchfelderBank,
1038    OberbankAg,
1039    RaiffeisenBankengruppeOsterreich,
1040    SchoellerbankAg,
1041    SpardaBankWien,
1042    VolksbankGruppe,
1043    VolkskreditbankAg,
1044    VrBankBraunau,
1045    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1046    Unknown(String),
1047}
1048impl CreatePaymentIntentPaymentMethodDataEpsBank {
1049    pub fn as_str(&self) -> &str {
1050        use CreatePaymentIntentPaymentMethodDataEpsBank::*;
1051        match self {
1052            ArzteUndApothekerBank => "arzte_und_apotheker_bank",
1053            AustrianAnadiBankAg => "austrian_anadi_bank_ag",
1054            BankAustria => "bank_austria",
1055            BankhausCarlSpangler => "bankhaus_carl_spangler",
1056            BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag",
1057            BawagPskAg => "bawag_psk_ag",
1058            BksBankAg => "bks_bank_ag",
1059            BrullKallmusBankAg => "brull_kallmus_bank_ag",
1060            BtvVierLanderBank => "btv_vier_lander_bank",
1061            CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
1062            DeutscheBankAg => "deutsche_bank_ag",
1063            Dolomitenbank => "dolomitenbank",
1064            EasybankAg => "easybank_ag",
1065            ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
1066            HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag",
1067            HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft",
1068            HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien",
1069            HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark",
1070            HypoTirolBankAg => "hypo_tirol_bank_ag",
1071            HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
1072            MarchfelderBank => "marchfelder_bank",
1073            OberbankAg => "oberbank_ag",
1074            RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich",
1075            SchoellerbankAg => "schoellerbank_ag",
1076            SpardaBankWien => "sparda_bank_wien",
1077            VolksbankGruppe => "volksbank_gruppe",
1078            VolkskreditbankAg => "volkskreditbank_ag",
1079            VrBankBraunau => "vr_bank_braunau",
1080            Unknown(v) => v,
1081        }
1082    }
1083}
1084
1085impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataEpsBank {
1086    type Err = std::convert::Infallible;
1087    fn from_str(s: &str) -> Result<Self, Self::Err> {
1088        use CreatePaymentIntentPaymentMethodDataEpsBank::*;
1089        match s {
1090            "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank),
1091            "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg),
1092            "bank_austria" => Ok(BankAustria),
1093            "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler),
1094            "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg),
1095            "bawag_psk_ag" => Ok(BawagPskAg),
1096            "bks_bank_ag" => Ok(BksBankAg),
1097            "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg),
1098            "btv_vier_lander_bank" => Ok(BtvVierLanderBank),
1099            "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg),
1100            "deutsche_bank_ag" => Ok(DeutscheBankAg),
1101            "dolomitenbank" => Ok(Dolomitenbank),
1102            "easybank_ag" => Ok(EasybankAg),
1103            "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen),
1104            "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg),
1105            "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft),
1106            "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien),
1107            "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark),
1108            "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg),
1109            "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg),
1110            "marchfelder_bank" => Ok(MarchfelderBank),
1111            "oberbank_ag" => Ok(OberbankAg),
1112            "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich),
1113            "schoellerbank_ag" => Ok(SchoellerbankAg),
1114            "sparda_bank_wien" => Ok(SpardaBankWien),
1115            "volksbank_gruppe" => Ok(VolksbankGruppe),
1116            "volkskreditbank_ag" => Ok(VolkskreditbankAg),
1117            "vr_bank_braunau" => Ok(VrBankBraunau),
1118            v => Ok(Unknown(v.to_owned())),
1119        }
1120    }
1121}
1122impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataEpsBank {
1123    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1124        f.write_str(self.as_str())
1125    }
1126}
1127
1128impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataEpsBank {
1129    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1130        f.write_str(self.as_str())
1131    }
1132}
1133impl serde::Serialize for CreatePaymentIntentPaymentMethodDataEpsBank {
1134    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1135    where
1136        S: serde::Serializer,
1137    {
1138        serializer.serialize_str(self.as_str())
1139    }
1140}
1141#[cfg(feature = "deserialize")]
1142impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataEpsBank {
1143    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1144        use std::str::FromStr;
1145        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1146        Ok(Self::from_str(&s).unwrap())
1147    }
1148}
1149/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
1150#[derive(Clone, Debug, serde::Serialize)]
1151pub struct CreatePaymentIntentPaymentMethodDataFpx {
1152    /// Account holder type for FPX transaction
1153    #[serde(skip_serializing_if = "Option::is_none")]
1154    pub account_holder_type: Option<CreatePaymentIntentPaymentMethodDataFpxAccountHolderType>,
1155    /// The customer's bank.
1156    pub bank: CreatePaymentIntentPaymentMethodDataFpxBank,
1157}
1158impl CreatePaymentIntentPaymentMethodDataFpx {
1159    pub fn new(bank: impl Into<CreatePaymentIntentPaymentMethodDataFpxBank>) -> Self {
1160        Self { account_holder_type: None, bank: bank.into() }
1161    }
1162}
1163/// Account holder type for FPX transaction
1164#[derive(Copy, Clone, Eq, PartialEq)]
1165pub enum CreatePaymentIntentPaymentMethodDataFpxAccountHolderType {
1166    Company,
1167    Individual,
1168}
1169impl CreatePaymentIntentPaymentMethodDataFpxAccountHolderType {
1170    pub fn as_str(self) -> &'static str {
1171        use CreatePaymentIntentPaymentMethodDataFpxAccountHolderType::*;
1172        match self {
1173            Company => "company",
1174            Individual => "individual",
1175        }
1176    }
1177}
1178
1179impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType {
1180    type Err = stripe_types::StripeParseError;
1181    fn from_str(s: &str) -> Result<Self, Self::Err> {
1182        use CreatePaymentIntentPaymentMethodDataFpxAccountHolderType::*;
1183        match s {
1184            "company" => Ok(Company),
1185            "individual" => Ok(Individual),
1186            _ => Err(stripe_types::StripeParseError),
1187        }
1188    }
1189}
1190impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType {
1191    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1192        f.write_str(self.as_str())
1193    }
1194}
1195
1196impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType {
1197    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1198        f.write_str(self.as_str())
1199    }
1200}
1201impl serde::Serialize for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType {
1202    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1203    where
1204        S: serde::Serializer,
1205    {
1206        serializer.serialize_str(self.as_str())
1207    }
1208}
1209#[cfg(feature = "deserialize")]
1210impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType {
1211    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1212        use std::str::FromStr;
1213        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1214        Self::from_str(&s).map_err(|_| {
1215            serde::de::Error::custom(
1216                "Unknown value for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType",
1217            )
1218        })
1219    }
1220}
1221/// The customer's bank.
1222#[derive(Clone, Eq, PartialEq)]
1223#[non_exhaustive]
1224pub enum CreatePaymentIntentPaymentMethodDataFpxBank {
1225    AffinBank,
1226    Agrobank,
1227    AllianceBank,
1228    Ambank,
1229    BankIslam,
1230    BankMuamalat,
1231    BankOfChina,
1232    BankRakyat,
1233    Bsn,
1234    Cimb,
1235    DeutscheBank,
1236    HongLeongBank,
1237    Hsbc,
1238    Kfh,
1239    Maybank2e,
1240    Maybank2u,
1241    Ocbc,
1242    PbEnterprise,
1243    PublicBank,
1244    Rhb,
1245    StandardChartered,
1246    Uob,
1247    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1248    Unknown(String),
1249}
1250impl CreatePaymentIntentPaymentMethodDataFpxBank {
1251    pub fn as_str(&self) -> &str {
1252        use CreatePaymentIntentPaymentMethodDataFpxBank::*;
1253        match self {
1254            AffinBank => "affin_bank",
1255            Agrobank => "agrobank",
1256            AllianceBank => "alliance_bank",
1257            Ambank => "ambank",
1258            BankIslam => "bank_islam",
1259            BankMuamalat => "bank_muamalat",
1260            BankOfChina => "bank_of_china",
1261            BankRakyat => "bank_rakyat",
1262            Bsn => "bsn",
1263            Cimb => "cimb",
1264            DeutscheBank => "deutsche_bank",
1265            HongLeongBank => "hong_leong_bank",
1266            Hsbc => "hsbc",
1267            Kfh => "kfh",
1268            Maybank2e => "maybank2e",
1269            Maybank2u => "maybank2u",
1270            Ocbc => "ocbc",
1271            PbEnterprise => "pb_enterprise",
1272            PublicBank => "public_bank",
1273            Rhb => "rhb",
1274            StandardChartered => "standard_chartered",
1275            Uob => "uob",
1276            Unknown(v) => v,
1277        }
1278    }
1279}
1280
1281impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataFpxBank {
1282    type Err = std::convert::Infallible;
1283    fn from_str(s: &str) -> Result<Self, Self::Err> {
1284        use CreatePaymentIntentPaymentMethodDataFpxBank::*;
1285        match s {
1286            "affin_bank" => Ok(AffinBank),
1287            "agrobank" => Ok(Agrobank),
1288            "alliance_bank" => Ok(AllianceBank),
1289            "ambank" => Ok(Ambank),
1290            "bank_islam" => Ok(BankIslam),
1291            "bank_muamalat" => Ok(BankMuamalat),
1292            "bank_of_china" => Ok(BankOfChina),
1293            "bank_rakyat" => Ok(BankRakyat),
1294            "bsn" => Ok(Bsn),
1295            "cimb" => Ok(Cimb),
1296            "deutsche_bank" => Ok(DeutscheBank),
1297            "hong_leong_bank" => Ok(HongLeongBank),
1298            "hsbc" => Ok(Hsbc),
1299            "kfh" => Ok(Kfh),
1300            "maybank2e" => Ok(Maybank2e),
1301            "maybank2u" => Ok(Maybank2u),
1302            "ocbc" => Ok(Ocbc),
1303            "pb_enterprise" => Ok(PbEnterprise),
1304            "public_bank" => Ok(PublicBank),
1305            "rhb" => Ok(Rhb),
1306            "standard_chartered" => Ok(StandardChartered),
1307            "uob" => Ok(Uob),
1308            v => Ok(Unknown(v.to_owned())),
1309        }
1310    }
1311}
1312impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataFpxBank {
1313    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1314        f.write_str(self.as_str())
1315    }
1316}
1317
1318impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataFpxBank {
1319    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1320        f.write_str(self.as_str())
1321    }
1322}
1323impl serde::Serialize for CreatePaymentIntentPaymentMethodDataFpxBank {
1324    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1325    where
1326        S: serde::Serializer,
1327    {
1328        serializer.serialize_str(self.as_str())
1329    }
1330}
1331#[cfg(feature = "deserialize")]
1332impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataFpxBank {
1333    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1334        use std::str::FromStr;
1335        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1336        Ok(Self::from_str(&s).unwrap())
1337    }
1338}
1339/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
1340#[derive(Clone, Debug, serde::Serialize)]
1341pub struct CreatePaymentIntentPaymentMethodDataIdeal {
1342    /// The customer's bank.
1343    /// Only use this parameter for existing customers.
1344    /// Don't use it for new customers.
1345    #[serde(skip_serializing_if = "Option::is_none")]
1346    pub bank: Option<CreatePaymentIntentPaymentMethodDataIdealBank>,
1347}
1348impl CreatePaymentIntentPaymentMethodDataIdeal {
1349    pub fn new() -> Self {
1350        Self { bank: None }
1351    }
1352}
1353impl Default for CreatePaymentIntentPaymentMethodDataIdeal {
1354    fn default() -> Self {
1355        Self::new()
1356    }
1357}
1358/// The customer's bank.
1359/// Only use this parameter for existing customers.
1360/// Don't use it for new customers.
1361#[derive(Clone, Eq, PartialEq)]
1362#[non_exhaustive]
1363pub enum CreatePaymentIntentPaymentMethodDataIdealBank {
1364    AbnAmro,
1365    AsnBank,
1366    Bunq,
1367    Buut,
1368    Handelsbanken,
1369    Ing,
1370    Knab,
1371    Moneyou,
1372    N26,
1373    Nn,
1374    Rabobank,
1375    Regiobank,
1376    Revolut,
1377    SnsBank,
1378    TriodosBank,
1379    VanLanschot,
1380    Yoursafe,
1381    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1382    Unknown(String),
1383}
1384impl CreatePaymentIntentPaymentMethodDataIdealBank {
1385    pub fn as_str(&self) -> &str {
1386        use CreatePaymentIntentPaymentMethodDataIdealBank::*;
1387        match self {
1388            AbnAmro => "abn_amro",
1389            AsnBank => "asn_bank",
1390            Bunq => "bunq",
1391            Buut => "buut",
1392            Handelsbanken => "handelsbanken",
1393            Ing => "ing",
1394            Knab => "knab",
1395            Moneyou => "moneyou",
1396            N26 => "n26",
1397            Nn => "nn",
1398            Rabobank => "rabobank",
1399            Regiobank => "regiobank",
1400            Revolut => "revolut",
1401            SnsBank => "sns_bank",
1402            TriodosBank => "triodos_bank",
1403            VanLanschot => "van_lanschot",
1404            Yoursafe => "yoursafe",
1405            Unknown(v) => v,
1406        }
1407    }
1408}
1409
1410impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataIdealBank {
1411    type Err = std::convert::Infallible;
1412    fn from_str(s: &str) -> Result<Self, Self::Err> {
1413        use CreatePaymentIntentPaymentMethodDataIdealBank::*;
1414        match s {
1415            "abn_amro" => Ok(AbnAmro),
1416            "asn_bank" => Ok(AsnBank),
1417            "bunq" => Ok(Bunq),
1418            "buut" => Ok(Buut),
1419            "handelsbanken" => Ok(Handelsbanken),
1420            "ing" => Ok(Ing),
1421            "knab" => Ok(Knab),
1422            "moneyou" => Ok(Moneyou),
1423            "n26" => Ok(N26),
1424            "nn" => Ok(Nn),
1425            "rabobank" => Ok(Rabobank),
1426            "regiobank" => Ok(Regiobank),
1427            "revolut" => Ok(Revolut),
1428            "sns_bank" => Ok(SnsBank),
1429            "triodos_bank" => Ok(TriodosBank),
1430            "van_lanschot" => Ok(VanLanschot),
1431            "yoursafe" => Ok(Yoursafe),
1432            v => Ok(Unknown(v.to_owned())),
1433        }
1434    }
1435}
1436impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataIdealBank {
1437    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1438        f.write_str(self.as_str())
1439    }
1440}
1441
1442impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataIdealBank {
1443    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1444        f.write_str(self.as_str())
1445    }
1446}
1447impl serde::Serialize for CreatePaymentIntentPaymentMethodDataIdealBank {
1448    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1449    where
1450        S: serde::Serializer,
1451    {
1452        serializer.serialize_str(self.as_str())
1453    }
1454}
1455#[cfg(feature = "deserialize")]
1456impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataIdealBank {
1457    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1458        use std::str::FromStr;
1459        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1460        Ok(Self::from_str(&s).unwrap())
1461    }
1462}
1463/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
1464#[derive(Copy, Clone, Debug, serde::Serialize)]
1465pub struct CreatePaymentIntentPaymentMethodDataKlarna {
1466    /// Customer's date of birth
1467    #[serde(skip_serializing_if = "Option::is_none")]
1468    pub dob: Option<DateOfBirth>,
1469}
1470impl CreatePaymentIntentPaymentMethodDataKlarna {
1471    pub fn new() -> Self {
1472        Self { dob: None }
1473    }
1474}
1475impl Default for CreatePaymentIntentPaymentMethodDataKlarna {
1476    fn default() -> Self {
1477        Self::new()
1478    }
1479}
1480/// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
1481#[derive(Copy, Clone, Debug, serde::Serialize)]
1482pub struct CreatePaymentIntentPaymentMethodDataNaverPay {
1483    /// Whether to use Naver Pay points or a card to fund this transaction.
1484    /// If not provided, this defaults to `card`.
1485    #[serde(skip_serializing_if = "Option::is_none")]
1486    pub funding: Option<CreatePaymentIntentPaymentMethodDataNaverPayFunding>,
1487}
1488impl CreatePaymentIntentPaymentMethodDataNaverPay {
1489    pub fn new() -> Self {
1490        Self { funding: None }
1491    }
1492}
1493impl Default for CreatePaymentIntentPaymentMethodDataNaverPay {
1494    fn default() -> Self {
1495        Self::new()
1496    }
1497}
1498/// Whether to use Naver Pay points or a card to fund this transaction.
1499/// If not provided, this defaults to `card`.
1500#[derive(Copy, Clone, Eq, PartialEq)]
1501pub enum CreatePaymentIntentPaymentMethodDataNaverPayFunding {
1502    Card,
1503    Points,
1504}
1505impl CreatePaymentIntentPaymentMethodDataNaverPayFunding {
1506    pub fn as_str(self) -> &'static str {
1507        use CreatePaymentIntentPaymentMethodDataNaverPayFunding::*;
1508        match self {
1509            Card => "card",
1510            Points => "points",
1511        }
1512    }
1513}
1514
1515impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataNaverPayFunding {
1516    type Err = stripe_types::StripeParseError;
1517    fn from_str(s: &str) -> Result<Self, Self::Err> {
1518        use CreatePaymentIntentPaymentMethodDataNaverPayFunding::*;
1519        match s {
1520            "card" => Ok(Card),
1521            "points" => Ok(Points),
1522            _ => Err(stripe_types::StripeParseError),
1523        }
1524    }
1525}
1526impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataNaverPayFunding {
1527    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1528        f.write_str(self.as_str())
1529    }
1530}
1531
1532impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataNaverPayFunding {
1533    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1534        f.write_str(self.as_str())
1535    }
1536}
1537impl serde::Serialize for CreatePaymentIntentPaymentMethodDataNaverPayFunding {
1538    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1539    where
1540        S: serde::Serializer,
1541    {
1542        serializer.serialize_str(self.as_str())
1543    }
1544}
1545#[cfg(feature = "deserialize")]
1546impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataNaverPayFunding {
1547    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1548        use std::str::FromStr;
1549        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1550        Self::from_str(&s).map_err(|_| {
1551            serde::de::Error::custom(
1552                "Unknown value for CreatePaymentIntentPaymentMethodDataNaverPayFunding",
1553            )
1554        })
1555    }
1556}
1557/// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
1558#[derive(Clone, Debug, serde::Serialize)]
1559pub struct CreatePaymentIntentPaymentMethodDataNzBankAccount {
1560    /// The name on the bank account.
1561    /// Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod’s billing details.
1562    #[serde(skip_serializing_if = "Option::is_none")]
1563    pub account_holder_name: Option<String>,
1564    /// The account number for the bank account.
1565    pub account_number: String,
1566    /// The numeric code for the bank account's bank.
1567    pub bank_code: String,
1568    /// The numeric code for the bank account's bank branch.
1569    pub branch_code: String,
1570    #[serde(skip_serializing_if = "Option::is_none")]
1571    pub reference: Option<String>,
1572    /// The suffix of the bank account number.
1573    pub suffix: String,
1574}
1575impl CreatePaymentIntentPaymentMethodDataNzBankAccount {
1576    pub fn new(
1577        account_number: impl Into<String>,
1578        bank_code: impl Into<String>,
1579        branch_code: impl Into<String>,
1580        suffix: impl Into<String>,
1581    ) -> Self {
1582        Self {
1583            account_holder_name: None,
1584            account_number: account_number.into(),
1585            bank_code: bank_code.into(),
1586            branch_code: branch_code.into(),
1587            reference: None,
1588            suffix: suffix.into(),
1589        }
1590    }
1591}
1592/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
1593#[derive(Clone, Debug, serde::Serialize)]
1594pub struct CreatePaymentIntentPaymentMethodDataP24 {
1595    /// The customer's bank.
1596    #[serde(skip_serializing_if = "Option::is_none")]
1597    pub bank: Option<CreatePaymentIntentPaymentMethodDataP24Bank>,
1598}
1599impl CreatePaymentIntentPaymentMethodDataP24 {
1600    pub fn new() -> Self {
1601        Self { bank: None }
1602    }
1603}
1604impl Default for CreatePaymentIntentPaymentMethodDataP24 {
1605    fn default() -> Self {
1606        Self::new()
1607    }
1608}
1609/// The customer's bank.
1610#[derive(Clone, Eq, PartialEq)]
1611#[non_exhaustive]
1612pub enum CreatePaymentIntentPaymentMethodDataP24Bank {
1613    AliorBank,
1614    BankMillennium,
1615    BankNowyBfgSa,
1616    BankPekaoSa,
1617    BankiSpbdzielcze,
1618    Blik,
1619    BnpParibas,
1620    Boz,
1621    CitiHandlowy,
1622    CreditAgricole,
1623    Envelobank,
1624    EtransferPocztowy24,
1625    GetinBank,
1626    Ideabank,
1627    Ing,
1628    Inteligo,
1629    MbankMtransfer,
1630    NestPrzelew,
1631    NoblePay,
1632    PbacZIpko,
1633    PlusBank,
1634    SantanderPrzelew24,
1635    TmobileUsbugiBankowe,
1636    ToyotaBank,
1637    Velobank,
1638    VolkswagenBank,
1639    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1640    Unknown(String),
1641}
1642impl CreatePaymentIntentPaymentMethodDataP24Bank {
1643    pub fn as_str(&self) -> &str {
1644        use CreatePaymentIntentPaymentMethodDataP24Bank::*;
1645        match self {
1646            AliorBank => "alior_bank",
1647            BankMillennium => "bank_millennium",
1648            BankNowyBfgSa => "bank_nowy_bfg_sa",
1649            BankPekaoSa => "bank_pekao_sa",
1650            BankiSpbdzielcze => "banki_spbdzielcze",
1651            Blik => "blik",
1652            BnpParibas => "bnp_paribas",
1653            Boz => "boz",
1654            CitiHandlowy => "citi_handlowy",
1655            CreditAgricole => "credit_agricole",
1656            Envelobank => "envelobank",
1657            EtransferPocztowy24 => "etransfer_pocztowy24",
1658            GetinBank => "getin_bank",
1659            Ideabank => "ideabank",
1660            Ing => "ing",
1661            Inteligo => "inteligo",
1662            MbankMtransfer => "mbank_mtransfer",
1663            NestPrzelew => "nest_przelew",
1664            NoblePay => "noble_pay",
1665            PbacZIpko => "pbac_z_ipko",
1666            PlusBank => "plus_bank",
1667            SantanderPrzelew24 => "santander_przelew24",
1668            TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
1669            ToyotaBank => "toyota_bank",
1670            Velobank => "velobank",
1671            VolkswagenBank => "volkswagen_bank",
1672            Unknown(v) => v,
1673        }
1674    }
1675}
1676
1677impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataP24Bank {
1678    type Err = std::convert::Infallible;
1679    fn from_str(s: &str) -> Result<Self, Self::Err> {
1680        use CreatePaymentIntentPaymentMethodDataP24Bank::*;
1681        match s {
1682            "alior_bank" => Ok(AliorBank),
1683            "bank_millennium" => Ok(BankMillennium),
1684            "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa),
1685            "bank_pekao_sa" => Ok(BankPekaoSa),
1686            "banki_spbdzielcze" => Ok(BankiSpbdzielcze),
1687            "blik" => Ok(Blik),
1688            "bnp_paribas" => Ok(BnpParibas),
1689            "boz" => Ok(Boz),
1690            "citi_handlowy" => Ok(CitiHandlowy),
1691            "credit_agricole" => Ok(CreditAgricole),
1692            "envelobank" => Ok(Envelobank),
1693            "etransfer_pocztowy24" => Ok(EtransferPocztowy24),
1694            "getin_bank" => Ok(GetinBank),
1695            "ideabank" => Ok(Ideabank),
1696            "ing" => Ok(Ing),
1697            "inteligo" => Ok(Inteligo),
1698            "mbank_mtransfer" => Ok(MbankMtransfer),
1699            "nest_przelew" => Ok(NestPrzelew),
1700            "noble_pay" => Ok(NoblePay),
1701            "pbac_z_ipko" => Ok(PbacZIpko),
1702            "plus_bank" => Ok(PlusBank),
1703            "santander_przelew24" => Ok(SantanderPrzelew24),
1704            "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe),
1705            "toyota_bank" => Ok(ToyotaBank),
1706            "velobank" => Ok(Velobank),
1707            "volkswagen_bank" => Ok(VolkswagenBank),
1708            v => Ok(Unknown(v.to_owned())),
1709        }
1710    }
1711}
1712impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataP24Bank {
1713    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1714        f.write_str(self.as_str())
1715    }
1716}
1717
1718impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataP24Bank {
1719    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1720        f.write_str(self.as_str())
1721    }
1722}
1723impl serde::Serialize for CreatePaymentIntentPaymentMethodDataP24Bank {
1724    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1725    where
1726        S: serde::Serializer,
1727    {
1728        serializer.serialize_str(self.as_str())
1729    }
1730}
1731#[cfg(feature = "deserialize")]
1732impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataP24Bank {
1733    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1734        use std::str::FromStr;
1735        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1736        Ok(Self::from_str(&s).unwrap())
1737    }
1738}
1739/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
1740#[derive(Clone, Debug, serde::Serialize)]
1741pub struct CreatePaymentIntentPaymentMethodDataSepaDebit {
1742    /// IBAN of the bank account.
1743    pub iban: String,
1744}
1745impl CreatePaymentIntentPaymentMethodDataSepaDebit {
1746    pub fn new(iban: impl Into<String>) -> Self {
1747        Self { iban: iban.into() }
1748    }
1749}
1750/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
1751#[derive(Copy, Clone, Debug, serde::Serialize)]
1752pub struct CreatePaymentIntentPaymentMethodDataSofort {
1753    /// Two-letter ISO code representing the country the bank account is located in.
1754    pub country: CreatePaymentIntentPaymentMethodDataSofortCountry,
1755}
1756impl CreatePaymentIntentPaymentMethodDataSofort {
1757    pub fn new(country: impl Into<CreatePaymentIntentPaymentMethodDataSofortCountry>) -> Self {
1758        Self { country: country.into() }
1759    }
1760}
1761/// Two-letter ISO code representing the country the bank account is located in.
1762#[derive(Copy, Clone, Eq, PartialEq)]
1763pub enum CreatePaymentIntentPaymentMethodDataSofortCountry {
1764    At,
1765    Be,
1766    De,
1767    Es,
1768    It,
1769    Nl,
1770}
1771impl CreatePaymentIntentPaymentMethodDataSofortCountry {
1772    pub fn as_str(self) -> &'static str {
1773        use CreatePaymentIntentPaymentMethodDataSofortCountry::*;
1774        match self {
1775            At => "AT",
1776            Be => "BE",
1777            De => "DE",
1778            Es => "ES",
1779            It => "IT",
1780            Nl => "NL",
1781        }
1782    }
1783}
1784
1785impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataSofortCountry {
1786    type Err = stripe_types::StripeParseError;
1787    fn from_str(s: &str) -> Result<Self, Self::Err> {
1788        use CreatePaymentIntentPaymentMethodDataSofortCountry::*;
1789        match s {
1790            "AT" => Ok(At),
1791            "BE" => Ok(Be),
1792            "DE" => Ok(De),
1793            "ES" => Ok(Es),
1794            "IT" => Ok(It),
1795            "NL" => Ok(Nl),
1796            _ => Err(stripe_types::StripeParseError),
1797        }
1798    }
1799}
1800impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataSofortCountry {
1801    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1802        f.write_str(self.as_str())
1803    }
1804}
1805
1806impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataSofortCountry {
1807    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1808        f.write_str(self.as_str())
1809    }
1810}
1811impl serde::Serialize for CreatePaymentIntentPaymentMethodDataSofortCountry {
1812    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1813    where
1814        S: serde::Serializer,
1815    {
1816        serializer.serialize_str(self.as_str())
1817    }
1818}
1819#[cfg(feature = "deserialize")]
1820impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataSofortCountry {
1821    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1822        use std::str::FromStr;
1823        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1824        Self::from_str(&s).map_err(|_| {
1825            serde::de::Error::custom(
1826                "Unknown value for CreatePaymentIntentPaymentMethodDataSofortCountry",
1827            )
1828        })
1829    }
1830}
1831/// The type of the PaymentMethod.
1832/// An additional hash is included on the PaymentMethod with a name matching this value.
1833/// It contains additional information specific to the PaymentMethod type.
1834#[derive(Clone, Eq, PartialEq)]
1835#[non_exhaustive]
1836pub enum CreatePaymentIntentPaymentMethodDataType {
1837    AcssDebit,
1838    Affirm,
1839    AfterpayClearpay,
1840    Alipay,
1841    Alma,
1842    AmazonPay,
1843    AuBecsDebit,
1844    BacsDebit,
1845    Bancontact,
1846    Billie,
1847    Blik,
1848    Boleto,
1849    Cashapp,
1850    Crypto,
1851    CustomerBalance,
1852    Eps,
1853    Fpx,
1854    Giropay,
1855    Grabpay,
1856    Ideal,
1857    KakaoPay,
1858    Klarna,
1859    Konbini,
1860    KrCard,
1861    Link,
1862    MbWay,
1863    Mobilepay,
1864    Multibanco,
1865    NaverPay,
1866    NzBankAccount,
1867    Oxxo,
1868    P24,
1869    PayByBank,
1870    Payco,
1871    Paynow,
1872    Paypal,
1873    Pix,
1874    Promptpay,
1875    RevolutPay,
1876    SamsungPay,
1877    Satispay,
1878    SepaDebit,
1879    Sofort,
1880    Swish,
1881    Twint,
1882    UsBankAccount,
1883    WechatPay,
1884    Zip,
1885    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1886    Unknown(String),
1887}
1888impl CreatePaymentIntentPaymentMethodDataType {
1889    pub fn as_str(&self) -> &str {
1890        use CreatePaymentIntentPaymentMethodDataType::*;
1891        match self {
1892            AcssDebit => "acss_debit",
1893            Affirm => "affirm",
1894            AfterpayClearpay => "afterpay_clearpay",
1895            Alipay => "alipay",
1896            Alma => "alma",
1897            AmazonPay => "amazon_pay",
1898            AuBecsDebit => "au_becs_debit",
1899            BacsDebit => "bacs_debit",
1900            Bancontact => "bancontact",
1901            Billie => "billie",
1902            Blik => "blik",
1903            Boleto => "boleto",
1904            Cashapp => "cashapp",
1905            Crypto => "crypto",
1906            CustomerBalance => "customer_balance",
1907            Eps => "eps",
1908            Fpx => "fpx",
1909            Giropay => "giropay",
1910            Grabpay => "grabpay",
1911            Ideal => "ideal",
1912            KakaoPay => "kakao_pay",
1913            Klarna => "klarna",
1914            Konbini => "konbini",
1915            KrCard => "kr_card",
1916            Link => "link",
1917            MbWay => "mb_way",
1918            Mobilepay => "mobilepay",
1919            Multibanco => "multibanco",
1920            NaverPay => "naver_pay",
1921            NzBankAccount => "nz_bank_account",
1922            Oxxo => "oxxo",
1923            P24 => "p24",
1924            PayByBank => "pay_by_bank",
1925            Payco => "payco",
1926            Paynow => "paynow",
1927            Paypal => "paypal",
1928            Pix => "pix",
1929            Promptpay => "promptpay",
1930            RevolutPay => "revolut_pay",
1931            SamsungPay => "samsung_pay",
1932            Satispay => "satispay",
1933            SepaDebit => "sepa_debit",
1934            Sofort => "sofort",
1935            Swish => "swish",
1936            Twint => "twint",
1937            UsBankAccount => "us_bank_account",
1938            WechatPay => "wechat_pay",
1939            Zip => "zip",
1940            Unknown(v) => v,
1941        }
1942    }
1943}
1944
1945impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataType {
1946    type Err = std::convert::Infallible;
1947    fn from_str(s: &str) -> Result<Self, Self::Err> {
1948        use CreatePaymentIntentPaymentMethodDataType::*;
1949        match s {
1950            "acss_debit" => Ok(AcssDebit),
1951            "affirm" => Ok(Affirm),
1952            "afterpay_clearpay" => Ok(AfterpayClearpay),
1953            "alipay" => Ok(Alipay),
1954            "alma" => Ok(Alma),
1955            "amazon_pay" => Ok(AmazonPay),
1956            "au_becs_debit" => Ok(AuBecsDebit),
1957            "bacs_debit" => Ok(BacsDebit),
1958            "bancontact" => Ok(Bancontact),
1959            "billie" => Ok(Billie),
1960            "blik" => Ok(Blik),
1961            "boleto" => Ok(Boleto),
1962            "cashapp" => Ok(Cashapp),
1963            "crypto" => Ok(Crypto),
1964            "customer_balance" => Ok(CustomerBalance),
1965            "eps" => Ok(Eps),
1966            "fpx" => Ok(Fpx),
1967            "giropay" => Ok(Giropay),
1968            "grabpay" => Ok(Grabpay),
1969            "ideal" => Ok(Ideal),
1970            "kakao_pay" => Ok(KakaoPay),
1971            "klarna" => Ok(Klarna),
1972            "konbini" => Ok(Konbini),
1973            "kr_card" => Ok(KrCard),
1974            "link" => Ok(Link),
1975            "mb_way" => Ok(MbWay),
1976            "mobilepay" => Ok(Mobilepay),
1977            "multibanco" => Ok(Multibanco),
1978            "naver_pay" => Ok(NaverPay),
1979            "nz_bank_account" => Ok(NzBankAccount),
1980            "oxxo" => Ok(Oxxo),
1981            "p24" => Ok(P24),
1982            "pay_by_bank" => Ok(PayByBank),
1983            "payco" => Ok(Payco),
1984            "paynow" => Ok(Paynow),
1985            "paypal" => Ok(Paypal),
1986            "pix" => Ok(Pix),
1987            "promptpay" => Ok(Promptpay),
1988            "revolut_pay" => Ok(RevolutPay),
1989            "samsung_pay" => Ok(SamsungPay),
1990            "satispay" => Ok(Satispay),
1991            "sepa_debit" => Ok(SepaDebit),
1992            "sofort" => Ok(Sofort),
1993            "swish" => Ok(Swish),
1994            "twint" => Ok(Twint),
1995            "us_bank_account" => Ok(UsBankAccount),
1996            "wechat_pay" => Ok(WechatPay),
1997            "zip" => Ok(Zip),
1998            v => Ok(Unknown(v.to_owned())),
1999        }
2000    }
2001}
2002impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataType {
2003    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2004        f.write_str(self.as_str())
2005    }
2006}
2007
2008impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataType {
2009    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2010        f.write_str(self.as_str())
2011    }
2012}
2013impl serde::Serialize for CreatePaymentIntentPaymentMethodDataType {
2014    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2015    where
2016        S: serde::Serializer,
2017    {
2018        serializer.serialize_str(self.as_str())
2019    }
2020}
2021#[cfg(feature = "deserialize")]
2022impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataType {
2023    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2024        use std::str::FromStr;
2025        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2026        Ok(Self::from_str(&s).unwrap())
2027    }
2028}
2029/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
2030#[derive(Clone, Debug, serde::Serialize)]
2031pub struct CreatePaymentIntentPaymentMethodDataUsBankAccount {
2032    /// Account holder type: individual or company.
2033    #[serde(skip_serializing_if = "Option::is_none")]
2034    pub account_holder_type:
2035        Option<CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType>,
2036    /// Account number of the bank account.
2037    #[serde(skip_serializing_if = "Option::is_none")]
2038    pub account_number: Option<String>,
2039    /// Account type: checkings or savings. Defaults to checking if omitted.
2040    #[serde(skip_serializing_if = "Option::is_none")]
2041    pub account_type: Option<CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType>,
2042    /// The ID of a Financial Connections Account to use as a payment method.
2043    #[serde(skip_serializing_if = "Option::is_none")]
2044    pub financial_connections_account: Option<String>,
2045    /// Routing number of the bank account.
2046    #[serde(skip_serializing_if = "Option::is_none")]
2047    pub routing_number: Option<String>,
2048}
2049impl CreatePaymentIntentPaymentMethodDataUsBankAccount {
2050    pub fn new() -> Self {
2051        Self {
2052            account_holder_type: None,
2053            account_number: None,
2054            account_type: None,
2055            financial_connections_account: None,
2056            routing_number: None,
2057        }
2058    }
2059}
2060impl Default for CreatePaymentIntentPaymentMethodDataUsBankAccount {
2061    fn default() -> Self {
2062        Self::new()
2063    }
2064}
2065/// Account holder type: individual or company.
2066#[derive(Copy, Clone, Eq, PartialEq)]
2067pub enum CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
2068    Company,
2069    Individual,
2070}
2071impl CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
2072    pub fn as_str(self) -> &'static str {
2073        use CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
2074        match self {
2075            Company => "company",
2076            Individual => "individual",
2077        }
2078    }
2079}
2080
2081impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
2082    type Err = stripe_types::StripeParseError;
2083    fn from_str(s: &str) -> Result<Self, Self::Err> {
2084        use CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
2085        match s {
2086            "company" => Ok(Company),
2087            "individual" => Ok(Individual),
2088            _ => Err(stripe_types::StripeParseError),
2089        }
2090    }
2091}
2092impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
2093    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2094        f.write_str(self.as_str())
2095    }
2096}
2097
2098impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
2099    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2100        f.write_str(self.as_str())
2101    }
2102}
2103impl serde::Serialize for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
2104    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2105    where
2106        S: serde::Serializer,
2107    {
2108        serializer.serialize_str(self.as_str())
2109    }
2110}
2111#[cfg(feature = "deserialize")]
2112impl<'de> serde::Deserialize<'de>
2113    for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType
2114{
2115    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2116        use std::str::FromStr;
2117        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2118        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType"))
2119    }
2120}
2121/// Account type: checkings or savings. Defaults to checking if omitted.
2122#[derive(Copy, Clone, Eq, PartialEq)]
2123pub enum CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
2124    Checking,
2125    Savings,
2126}
2127impl CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
2128    pub fn as_str(self) -> &'static str {
2129        use CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType::*;
2130        match self {
2131            Checking => "checking",
2132            Savings => "savings",
2133        }
2134    }
2135}
2136
2137impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
2138    type Err = stripe_types::StripeParseError;
2139    fn from_str(s: &str) -> Result<Self, Self::Err> {
2140        use CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType::*;
2141        match s {
2142            "checking" => Ok(Checking),
2143            "savings" => Ok(Savings),
2144            _ => Err(stripe_types::StripeParseError),
2145        }
2146    }
2147}
2148impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
2149    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2150        f.write_str(self.as_str())
2151    }
2152}
2153
2154impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
2155    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2156        f.write_str(self.as_str())
2157    }
2158}
2159impl serde::Serialize for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
2160    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2161    where
2162        S: serde::Serializer,
2163    {
2164        serializer.serialize_str(self.as_str())
2165    }
2166}
2167#[cfg(feature = "deserialize")]
2168impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
2169    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2170        use std::str::FromStr;
2171        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2172        Self::from_str(&s).map_err(|_| {
2173            serde::de::Error::custom(
2174                "Unknown value for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType",
2175            )
2176        })
2177    }
2178}
2179/// Payment method-specific configuration for this PaymentIntent.
2180#[derive(Clone, Debug, serde::Serialize)]
2181pub struct CreatePaymentIntentPaymentMethodOptions {
2182    /// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options.
2183    #[serde(skip_serializing_if = "Option::is_none")]
2184    pub acss_debit: Option<CreatePaymentIntentPaymentMethodOptionsAcssDebit>,
2185    /// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options.
2186    #[serde(skip_serializing_if = "Option::is_none")]
2187    pub affirm: Option<CreatePaymentIntentPaymentMethodOptionsAffirm>,
2188    /// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options.
2189    #[serde(skip_serializing_if = "Option::is_none")]
2190    pub afterpay_clearpay: Option<CreatePaymentIntentPaymentMethodOptionsAfterpayClearpay>,
2191    /// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options.
2192    #[serde(skip_serializing_if = "Option::is_none")]
2193    pub alipay: Option<CreatePaymentIntentPaymentMethodOptionsAlipay>,
2194    /// If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options.
2195    #[serde(skip_serializing_if = "Option::is_none")]
2196    pub alma: Option<CreatePaymentIntentPaymentMethodOptionsAlma>,
2197    /// If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options.
2198    #[serde(skip_serializing_if = "Option::is_none")]
2199    pub amazon_pay: Option<CreatePaymentIntentPaymentMethodOptionsAmazonPay>,
2200    /// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options.
2201    #[serde(skip_serializing_if = "Option::is_none")]
2202    pub au_becs_debit: Option<CreatePaymentIntentPaymentMethodOptionsAuBecsDebit>,
2203    /// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options.
2204    #[serde(skip_serializing_if = "Option::is_none")]
2205    pub bacs_debit: Option<CreatePaymentIntentPaymentMethodOptionsBacsDebit>,
2206    /// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options.
2207    #[serde(skip_serializing_if = "Option::is_none")]
2208    pub bancontact: Option<CreatePaymentIntentPaymentMethodOptionsBancontact>,
2209    /// If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options.
2210    #[serde(skip_serializing_if = "Option::is_none")]
2211    pub billie: Option<CreatePaymentIntentPaymentMethodOptionsBillie>,
2212    /// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options.
2213    #[serde(skip_serializing_if = "Option::is_none")]
2214    pub blik: Option<CreatePaymentIntentPaymentMethodOptionsBlik>,
2215    /// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options.
2216    #[serde(skip_serializing_if = "Option::is_none")]
2217    pub boleto: Option<CreatePaymentIntentPaymentMethodOptionsBoleto>,
2218    /// Configuration for any card payments attempted on this PaymentIntent.
2219    #[serde(skip_serializing_if = "Option::is_none")]
2220    pub card: Option<CreatePaymentIntentPaymentMethodOptionsCard>,
2221    /// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
2222    #[serde(skip_serializing_if = "Option::is_none")]
2223    pub card_present: Option<CreatePaymentIntentPaymentMethodOptionsCardPresent>,
2224    /// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options.
2225    #[serde(skip_serializing_if = "Option::is_none")]
2226    pub cashapp: Option<CreatePaymentIntentPaymentMethodOptionsCashapp>,
2227    /// If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options.
2228    #[serde(skip_serializing_if = "Option::is_none")]
2229    pub crypto: Option<CreatePaymentIntentPaymentMethodOptionsCrypto>,
2230    /// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options.
2231    #[serde(skip_serializing_if = "Option::is_none")]
2232    pub customer_balance: Option<CreatePaymentIntentPaymentMethodOptionsCustomerBalance>,
2233    /// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
2234    #[serde(skip_serializing_if = "Option::is_none")]
2235    pub eps: Option<CreatePaymentIntentPaymentMethodOptionsEps>,
2236    /// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options.
2237    #[serde(skip_serializing_if = "Option::is_none")]
2238    pub fpx: Option<CreatePaymentIntentPaymentMethodOptionsFpx>,
2239    /// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options.
2240    #[serde(skip_serializing_if = "Option::is_none")]
2241    pub giropay: Option<CreatePaymentIntentPaymentMethodOptionsGiropay>,
2242    /// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options.
2243    #[serde(skip_serializing_if = "Option::is_none")]
2244    pub grabpay: Option<CreatePaymentIntentPaymentMethodOptionsGrabpay>,
2245    /// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options.
2246    #[serde(skip_serializing_if = "Option::is_none")]
2247    pub ideal: Option<CreatePaymentIntentPaymentMethodOptionsIdeal>,
2248    /// If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
2249    #[serde(skip_serializing_if = "Option::is_none")]
2250    #[serde(with = "stripe_types::with_serde_json_opt")]
2251    pub interac_present: Option<miniserde::json::Value>,
2252    /// If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options.
2253    #[serde(skip_serializing_if = "Option::is_none")]
2254    pub kakao_pay: Option<CreatePaymentIntentPaymentMethodOptionsKakaoPay>,
2255    /// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options.
2256    #[serde(skip_serializing_if = "Option::is_none")]
2257    pub klarna: Option<CreatePaymentIntentPaymentMethodOptionsKlarna>,
2258    /// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options.
2259    #[serde(skip_serializing_if = "Option::is_none")]
2260    pub konbini: Option<CreatePaymentIntentPaymentMethodOptionsKonbini>,
2261    /// If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options.
2262    #[serde(skip_serializing_if = "Option::is_none")]
2263    pub kr_card: Option<CreatePaymentIntentPaymentMethodOptionsKrCard>,
2264    /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
2265    #[serde(skip_serializing_if = "Option::is_none")]
2266    pub link: Option<CreatePaymentIntentPaymentMethodOptionsLink>,
2267    /// If this is a `mb_way` PaymentMethod, this sub-hash contains details about the MB WAY payment method options.
2268    #[serde(skip_serializing_if = "Option::is_none")]
2269    pub mb_way: Option<CreatePaymentIntentPaymentMethodOptionsMbWay>,
2270    /// If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options.
2271    #[serde(skip_serializing_if = "Option::is_none")]
2272    pub mobilepay: Option<CreatePaymentIntentPaymentMethodOptionsMobilepay>,
2273    /// If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options.
2274    #[serde(skip_serializing_if = "Option::is_none")]
2275    pub multibanco: Option<CreatePaymentIntentPaymentMethodOptionsMultibanco>,
2276    /// If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options.
2277    #[serde(skip_serializing_if = "Option::is_none")]
2278    pub naver_pay: Option<CreatePaymentIntentPaymentMethodOptionsNaverPay>,
2279    /// If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options.
2280    #[serde(skip_serializing_if = "Option::is_none")]
2281    pub nz_bank_account: Option<CreatePaymentIntentPaymentMethodOptionsNzBankAccount>,
2282    /// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options.
2283    #[serde(skip_serializing_if = "Option::is_none")]
2284    pub oxxo: Option<CreatePaymentIntentPaymentMethodOptionsOxxo>,
2285    /// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options.
2286    #[serde(skip_serializing_if = "Option::is_none")]
2287    pub p24: Option<CreatePaymentIntentPaymentMethodOptionsP24>,
2288    /// If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options.
2289    #[serde(skip_serializing_if = "Option::is_none")]
2290    #[serde(with = "stripe_types::with_serde_json_opt")]
2291    pub pay_by_bank: Option<miniserde::json::Value>,
2292    /// If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options.
2293    #[serde(skip_serializing_if = "Option::is_none")]
2294    pub payco: Option<CreatePaymentIntentPaymentMethodOptionsPayco>,
2295    /// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options.
2296    #[serde(skip_serializing_if = "Option::is_none")]
2297    pub paynow: Option<CreatePaymentIntentPaymentMethodOptionsPaynow>,
2298    /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
2299    #[serde(skip_serializing_if = "Option::is_none")]
2300    pub paypal: Option<CreatePaymentIntentPaymentMethodOptionsPaypal>,
2301    /// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options.
2302    #[serde(skip_serializing_if = "Option::is_none")]
2303    pub pix: Option<CreatePaymentIntentPaymentMethodOptionsPix>,
2304    /// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options.
2305    #[serde(skip_serializing_if = "Option::is_none")]
2306    pub promptpay: Option<CreatePaymentIntentPaymentMethodOptionsPromptpay>,
2307    /// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options.
2308    #[serde(skip_serializing_if = "Option::is_none")]
2309    pub revolut_pay: Option<CreatePaymentIntentPaymentMethodOptionsRevolutPay>,
2310    /// If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options.
2311    #[serde(skip_serializing_if = "Option::is_none")]
2312    pub samsung_pay: Option<CreatePaymentIntentPaymentMethodOptionsSamsungPay>,
2313    /// If this is a `satispay` PaymentMethod, this sub-hash contains details about the Satispay payment method options.
2314    #[serde(skip_serializing_if = "Option::is_none")]
2315    pub satispay: Option<CreatePaymentIntentPaymentMethodOptionsSatispay>,
2316    /// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options.
2317    #[serde(skip_serializing_if = "Option::is_none")]
2318    pub sepa_debit: Option<CreatePaymentIntentPaymentMethodOptionsSepaDebit>,
2319    /// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options.
2320    #[serde(skip_serializing_if = "Option::is_none")]
2321    pub sofort: Option<CreatePaymentIntentPaymentMethodOptionsSofort>,
2322    /// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options.
2323    #[serde(skip_serializing_if = "Option::is_none")]
2324    pub swish: Option<CreatePaymentIntentPaymentMethodOptionsSwish>,
2325    /// If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options.
2326    #[serde(skip_serializing_if = "Option::is_none")]
2327    pub twint: Option<CreatePaymentIntentPaymentMethodOptionsTwint>,
2328    /// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options.
2329    #[serde(skip_serializing_if = "Option::is_none")]
2330    pub us_bank_account: Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccount>,
2331    /// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options.
2332    #[serde(skip_serializing_if = "Option::is_none")]
2333    pub wechat_pay: Option<CreatePaymentIntentPaymentMethodOptionsWechatPay>,
2334    /// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options.
2335    #[serde(skip_serializing_if = "Option::is_none")]
2336    pub zip: Option<CreatePaymentIntentPaymentMethodOptionsZip>,
2337}
2338impl CreatePaymentIntentPaymentMethodOptions {
2339    pub fn new() -> Self {
2340        Self {
2341            acss_debit: None,
2342            affirm: None,
2343            afterpay_clearpay: None,
2344            alipay: None,
2345            alma: None,
2346            amazon_pay: None,
2347            au_becs_debit: None,
2348            bacs_debit: None,
2349            bancontact: None,
2350            billie: None,
2351            blik: None,
2352            boleto: None,
2353            card: None,
2354            card_present: None,
2355            cashapp: None,
2356            crypto: None,
2357            customer_balance: None,
2358            eps: None,
2359            fpx: None,
2360            giropay: None,
2361            grabpay: None,
2362            ideal: None,
2363            interac_present: None,
2364            kakao_pay: None,
2365            klarna: None,
2366            konbini: None,
2367            kr_card: None,
2368            link: None,
2369            mb_way: None,
2370            mobilepay: None,
2371            multibanco: None,
2372            naver_pay: None,
2373            nz_bank_account: None,
2374            oxxo: None,
2375            p24: None,
2376            pay_by_bank: None,
2377            payco: None,
2378            paynow: None,
2379            paypal: None,
2380            pix: None,
2381            promptpay: None,
2382            revolut_pay: None,
2383            samsung_pay: None,
2384            satispay: None,
2385            sepa_debit: None,
2386            sofort: None,
2387            swish: None,
2388            twint: None,
2389            us_bank_account: None,
2390            wechat_pay: None,
2391            zip: None,
2392        }
2393    }
2394}
2395impl Default for CreatePaymentIntentPaymentMethodOptions {
2396    fn default() -> Self {
2397        Self::new()
2398    }
2399}
2400/// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options.
2401#[derive(Clone, Debug, serde::Serialize)]
2402pub struct CreatePaymentIntentPaymentMethodOptionsAcssDebit {
2403    /// Additional fields for Mandate creation
2404    #[serde(skip_serializing_if = "Option::is_none")]
2405    pub mandate_options: Option<CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions>,
2406    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
2407    ///
2408    /// 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.
2409    /// 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.
2410    ///
2411    /// 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.
2412    ///
2413    /// 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).
2414    ///
2415    /// 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`.
2416    #[serde(skip_serializing_if = "Option::is_none")]
2417    pub setup_future_usage:
2418        Option<CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage>,
2419    /// Controls when Stripe will attempt to debit the funds from the customer's account.
2420    /// The date must be a string in YYYY-MM-DD format.
2421    /// The date must be in the future and between 3 and 15 calendar days from now.
2422    #[serde(skip_serializing_if = "Option::is_none")]
2423    pub target_date: Option<String>,
2424    /// Bank account verification method.
2425    #[serde(skip_serializing_if = "Option::is_none")]
2426    pub verification_method:
2427        Option<CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
2428}
2429impl CreatePaymentIntentPaymentMethodOptionsAcssDebit {
2430    pub fn new() -> Self {
2431        Self {
2432            mandate_options: None,
2433            setup_future_usage: None,
2434            target_date: None,
2435            verification_method: None,
2436        }
2437    }
2438}
2439impl Default for CreatePaymentIntentPaymentMethodOptionsAcssDebit {
2440    fn default() -> Self {
2441        Self::new()
2442    }
2443}
2444/// Additional fields for Mandate creation
2445#[derive(Clone, Debug, serde::Serialize)]
2446pub struct CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
2447    /// A URL for custom mandate text to render during confirmation step.
2448    /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,.
2449    /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent.
2450    #[serde(skip_serializing_if = "Option::is_none")]
2451    pub custom_mandate_url: Option<String>,
2452    /// Description of the mandate interval.
2453    /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'.
2454    #[serde(skip_serializing_if = "Option::is_none")]
2455    pub interval_description: Option<String>,
2456    /// Payment schedule for the mandate.
2457    #[serde(skip_serializing_if = "Option::is_none")]
2458    pub payment_schedule:
2459        Option<CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
2460    /// Transaction type of the mandate.
2461    #[serde(skip_serializing_if = "Option::is_none")]
2462    pub transaction_type:
2463        Option<CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
2464}
2465impl CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
2466    pub fn new() -> Self {
2467        Self {
2468            custom_mandate_url: None,
2469            interval_description: None,
2470            payment_schedule: None,
2471            transaction_type: None,
2472        }
2473    }
2474}
2475impl Default for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
2476    fn default() -> Self {
2477        Self::new()
2478    }
2479}
2480/// Payment schedule for the mandate.
2481#[derive(Copy, Clone, Eq, PartialEq)]
2482pub enum CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
2483    Combined,
2484    Interval,
2485    Sporadic,
2486}
2487impl CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
2488    pub fn as_str(self) -> &'static str {
2489        use CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
2490        match self {
2491            Combined => "combined",
2492            Interval => "interval",
2493            Sporadic => "sporadic",
2494        }
2495    }
2496}
2497
2498impl std::str::FromStr
2499    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2500{
2501    type Err = stripe_types::StripeParseError;
2502    fn from_str(s: &str) -> Result<Self, Self::Err> {
2503        use CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
2504        match s {
2505            "combined" => Ok(Combined),
2506            "interval" => Ok(Interval),
2507            "sporadic" => Ok(Sporadic),
2508            _ => Err(stripe_types::StripeParseError),
2509        }
2510    }
2511}
2512impl std::fmt::Display
2513    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2514{
2515    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2516        f.write_str(self.as_str())
2517    }
2518}
2519
2520impl std::fmt::Debug
2521    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2522{
2523    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2524        f.write_str(self.as_str())
2525    }
2526}
2527impl serde::Serialize
2528    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2529{
2530    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2531    where
2532        S: serde::Serializer,
2533    {
2534        serializer.serialize_str(self.as_str())
2535    }
2536}
2537#[cfg(feature = "deserialize")]
2538impl<'de> serde::Deserialize<'de>
2539    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2540{
2541    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2542        use std::str::FromStr;
2543        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2544        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"))
2545    }
2546}
2547/// Transaction type of the mandate.
2548#[derive(Copy, Clone, Eq, PartialEq)]
2549pub enum CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
2550    Business,
2551    Personal,
2552}
2553impl CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
2554    pub fn as_str(self) -> &'static str {
2555        use CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
2556        match self {
2557            Business => "business",
2558            Personal => "personal",
2559        }
2560    }
2561}
2562
2563impl std::str::FromStr
2564    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2565{
2566    type Err = stripe_types::StripeParseError;
2567    fn from_str(s: &str) -> Result<Self, Self::Err> {
2568        use CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
2569        match s {
2570            "business" => Ok(Business),
2571            "personal" => Ok(Personal),
2572            _ => Err(stripe_types::StripeParseError),
2573        }
2574    }
2575}
2576impl std::fmt::Display
2577    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2578{
2579    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2580        f.write_str(self.as_str())
2581    }
2582}
2583
2584impl std::fmt::Debug
2585    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2586{
2587    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2588        f.write_str(self.as_str())
2589    }
2590}
2591impl serde::Serialize
2592    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2593{
2594    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2595    where
2596        S: serde::Serializer,
2597    {
2598        serializer.serialize_str(self.as_str())
2599    }
2600}
2601#[cfg(feature = "deserialize")]
2602impl<'de> serde::Deserialize<'de>
2603    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2604{
2605    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2606        use std::str::FromStr;
2607        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2608        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"))
2609    }
2610}
2611/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
2612///
2613/// 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.
2614/// 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.
2615///
2616/// 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.
2617///
2618/// 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).
2619///
2620/// 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`.
2621#[derive(Copy, Clone, Eq, PartialEq)]
2622pub enum CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
2623    None,
2624    OffSession,
2625    OnSession,
2626}
2627impl CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
2628    pub fn as_str(self) -> &'static str {
2629        use CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*;
2630        match self {
2631            None => "none",
2632            OffSession => "off_session",
2633            OnSession => "on_session",
2634        }
2635    }
2636}
2637
2638impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
2639    type Err = stripe_types::StripeParseError;
2640    fn from_str(s: &str) -> Result<Self, Self::Err> {
2641        use CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*;
2642        match s {
2643            "none" => Ok(None),
2644            "off_session" => Ok(OffSession),
2645            "on_session" => Ok(OnSession),
2646            _ => Err(stripe_types::StripeParseError),
2647        }
2648    }
2649}
2650impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
2651    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2652        f.write_str(self.as_str())
2653    }
2654}
2655
2656impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
2657    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2658        f.write_str(self.as_str())
2659    }
2660}
2661impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
2662    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2663    where
2664        S: serde::Serializer,
2665    {
2666        serializer.serialize_str(self.as_str())
2667    }
2668}
2669#[cfg(feature = "deserialize")]
2670impl<'de> serde::Deserialize<'de>
2671    for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage
2672{
2673    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2674        use std::str::FromStr;
2675        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2676        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage"))
2677    }
2678}
2679/// Bank account verification method.
2680#[derive(Copy, Clone, Eq, PartialEq)]
2681pub enum CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2682    Automatic,
2683    Instant,
2684    Microdeposits,
2685}
2686impl CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2687    pub fn as_str(self) -> &'static str {
2688        use CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
2689        match self {
2690            Automatic => "automatic",
2691            Instant => "instant",
2692            Microdeposits => "microdeposits",
2693        }
2694    }
2695}
2696
2697impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2698    type Err = stripe_types::StripeParseError;
2699    fn from_str(s: &str) -> Result<Self, Self::Err> {
2700        use CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
2701        match s {
2702            "automatic" => Ok(Automatic),
2703            "instant" => Ok(Instant),
2704            "microdeposits" => Ok(Microdeposits),
2705            _ => Err(stripe_types::StripeParseError),
2706        }
2707    }
2708}
2709impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2710    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2711        f.write_str(self.as_str())
2712    }
2713}
2714
2715impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2716    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2717        f.write_str(self.as_str())
2718    }
2719}
2720impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2721    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2722    where
2723        S: serde::Serializer,
2724    {
2725        serializer.serialize_str(self.as_str())
2726    }
2727}
2728#[cfg(feature = "deserialize")]
2729impl<'de> serde::Deserialize<'de>
2730    for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod
2731{
2732    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2733        use std::str::FromStr;
2734        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2735        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod"))
2736    }
2737}
2738/// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options.
2739#[derive(Clone, Debug, serde::Serialize)]
2740pub struct CreatePaymentIntentPaymentMethodOptionsAffirm {
2741    /// Controls when the funds are captured from the customer's account.
2742    ///
2743    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
2744    ///
2745    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
2746    #[serde(skip_serializing_if = "Option::is_none")]
2747    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod>,
2748    /// Preferred language of the Affirm authorization page that the customer is redirected to.
2749    #[serde(skip_serializing_if = "Option::is_none")]
2750    pub preferred_locale: Option<String>,
2751    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
2752    ///
2753    /// 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.
2754    /// 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.
2755    ///
2756    /// 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.
2757    ///
2758    /// 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).
2759    ///
2760    /// 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`.
2761    #[serde(skip_serializing_if = "Option::is_none")]
2762    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage>,
2763}
2764impl CreatePaymentIntentPaymentMethodOptionsAffirm {
2765    pub fn new() -> Self {
2766        Self { capture_method: None, preferred_locale: None, setup_future_usage: None }
2767    }
2768}
2769impl Default for CreatePaymentIntentPaymentMethodOptionsAffirm {
2770    fn default() -> Self {
2771        Self::new()
2772    }
2773}
2774/// Controls when the funds are captured from the customer's account.
2775///
2776/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
2777///
2778/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
2779#[derive(Copy, Clone, Eq, PartialEq)]
2780pub enum CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
2781    Manual,
2782}
2783impl CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
2784    pub fn as_str(self) -> &'static str {
2785        use CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*;
2786        match self {
2787            Manual => "manual",
2788        }
2789    }
2790}
2791
2792impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
2793    type Err = stripe_types::StripeParseError;
2794    fn from_str(s: &str) -> Result<Self, Self::Err> {
2795        use CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*;
2796        match s {
2797            "manual" => Ok(Manual),
2798            _ => Err(stripe_types::StripeParseError),
2799        }
2800    }
2801}
2802impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
2803    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2804        f.write_str(self.as_str())
2805    }
2806}
2807
2808impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
2809    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2810        f.write_str(self.as_str())
2811    }
2812}
2813impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
2814    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2815    where
2816        S: serde::Serializer,
2817    {
2818        serializer.serialize_str(self.as_str())
2819    }
2820}
2821#[cfg(feature = "deserialize")]
2822impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
2823    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2824        use std::str::FromStr;
2825        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2826        Self::from_str(&s).map_err(|_| {
2827            serde::de::Error::custom(
2828                "Unknown value for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod",
2829            )
2830        })
2831    }
2832}
2833/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
2834///
2835/// 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.
2836/// 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.
2837///
2838/// 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.
2839///
2840/// 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).
2841///
2842/// 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`.
2843#[derive(Copy, Clone, Eq, PartialEq)]
2844pub enum CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
2845    None,
2846}
2847impl CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
2848    pub fn as_str(self) -> &'static str {
2849        use CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*;
2850        match self {
2851            None => "none",
2852        }
2853    }
2854}
2855
2856impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
2857    type Err = stripe_types::StripeParseError;
2858    fn from_str(s: &str) -> Result<Self, Self::Err> {
2859        use CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*;
2860        match s {
2861            "none" => Ok(None),
2862            _ => Err(stripe_types::StripeParseError),
2863        }
2864    }
2865}
2866impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
2867    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2868        f.write_str(self.as_str())
2869    }
2870}
2871
2872impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
2873    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2874        f.write_str(self.as_str())
2875    }
2876}
2877impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
2878    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2879    where
2880        S: serde::Serializer,
2881    {
2882        serializer.serialize_str(self.as_str())
2883    }
2884}
2885#[cfg(feature = "deserialize")]
2886impl<'de> serde::Deserialize<'de>
2887    for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage
2888{
2889    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2890        use std::str::FromStr;
2891        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2892        Self::from_str(&s).map_err(|_| {
2893            serde::de::Error::custom(
2894                "Unknown value for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage",
2895            )
2896        })
2897    }
2898}
2899/// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options.
2900#[derive(Clone, Debug, serde::Serialize)]
2901pub struct CreatePaymentIntentPaymentMethodOptionsAfterpayClearpay {
2902    /// Controls when the funds are captured from the customer's account.
2903    ///
2904    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
2905    ///
2906    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
2907    #[serde(skip_serializing_if = "Option::is_none")]
2908    pub capture_method:
2909        Option<CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod>,
2910    /// An internal identifier or reference that this payment corresponds to.
2911    /// You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes.
2912    /// This field differs from the statement descriptor and item name.
2913    #[serde(skip_serializing_if = "Option::is_none")]
2914    pub reference: Option<String>,
2915    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
2916    ///
2917    /// 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.
2918    /// 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.
2919    ///
2920    /// 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.
2921    ///
2922    /// 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).
2923    ///
2924    /// 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`.
2925    #[serde(skip_serializing_if = "Option::is_none")]
2926    pub setup_future_usage:
2927        Option<CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage>,
2928}
2929impl CreatePaymentIntentPaymentMethodOptionsAfterpayClearpay {
2930    pub fn new() -> Self {
2931        Self { capture_method: None, reference: None, setup_future_usage: None }
2932    }
2933}
2934impl Default for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpay {
2935    fn default() -> Self {
2936        Self::new()
2937    }
2938}
2939/// Controls when the funds are captured from the customer's account.
2940///
2941/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
2942///
2943/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
2944#[derive(Copy, Clone, Eq, PartialEq)]
2945pub enum CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
2946    Manual,
2947}
2948impl CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
2949    pub fn as_str(self) -> &'static str {
2950        use CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*;
2951        match self {
2952            Manual => "manual",
2953        }
2954    }
2955}
2956
2957impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
2958    type Err = stripe_types::StripeParseError;
2959    fn from_str(s: &str) -> Result<Self, Self::Err> {
2960        use CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*;
2961        match s {
2962            "manual" => Ok(Manual),
2963            _ => Err(stripe_types::StripeParseError),
2964        }
2965    }
2966}
2967impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
2968    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2969        f.write_str(self.as_str())
2970    }
2971}
2972
2973impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
2974    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2975        f.write_str(self.as_str())
2976    }
2977}
2978impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
2979    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2980    where
2981        S: serde::Serializer,
2982    {
2983        serializer.serialize_str(self.as_str())
2984    }
2985}
2986#[cfg(feature = "deserialize")]
2987impl<'de> serde::Deserialize<'de>
2988    for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod
2989{
2990    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2991        use std::str::FromStr;
2992        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2993        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod"))
2994    }
2995}
2996/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
2997///
2998/// 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.
2999/// 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.
3000///
3001/// 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.
3002///
3003/// 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).
3004///
3005/// 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`.
3006#[derive(Copy, Clone, Eq, PartialEq)]
3007pub enum CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
3008    None,
3009}
3010impl CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
3011    pub fn as_str(self) -> &'static str {
3012        use CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*;
3013        match self {
3014            None => "none",
3015        }
3016    }
3017}
3018
3019impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
3020    type Err = stripe_types::StripeParseError;
3021    fn from_str(s: &str) -> Result<Self, Self::Err> {
3022        use CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*;
3023        match s {
3024            "none" => Ok(None),
3025            _ => Err(stripe_types::StripeParseError),
3026        }
3027    }
3028}
3029impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
3030    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3031        f.write_str(self.as_str())
3032    }
3033}
3034
3035impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
3036    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3037        f.write_str(self.as_str())
3038    }
3039}
3040impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
3041    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3042    where
3043        S: serde::Serializer,
3044    {
3045        serializer.serialize_str(self.as_str())
3046    }
3047}
3048#[cfg(feature = "deserialize")]
3049impl<'de> serde::Deserialize<'de>
3050    for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage
3051{
3052    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3053        use std::str::FromStr;
3054        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3055        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage"))
3056    }
3057}
3058/// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options.
3059#[derive(Copy, Clone, Debug, serde::Serialize)]
3060pub struct CreatePaymentIntentPaymentMethodOptionsAlipay {
3061    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3062    ///
3063    /// 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.
3064    /// 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.
3065    ///
3066    /// 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.
3067    ///
3068    /// 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).
3069    ///
3070    /// 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`.
3071    #[serde(skip_serializing_if = "Option::is_none")]
3072    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage>,
3073}
3074impl CreatePaymentIntentPaymentMethodOptionsAlipay {
3075    pub fn new() -> Self {
3076        Self { setup_future_usage: None }
3077    }
3078}
3079impl Default for CreatePaymentIntentPaymentMethodOptionsAlipay {
3080    fn default() -> Self {
3081        Self::new()
3082    }
3083}
3084/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3085///
3086/// 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.
3087/// 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.
3088///
3089/// 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.
3090///
3091/// 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).
3092///
3093/// 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`.
3094#[derive(Copy, Clone, Eq, PartialEq)]
3095pub enum CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
3096    None,
3097    OffSession,
3098}
3099impl CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
3100    pub fn as_str(self) -> &'static str {
3101        use CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*;
3102        match self {
3103            None => "none",
3104            OffSession => "off_session",
3105        }
3106    }
3107}
3108
3109impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
3110    type Err = stripe_types::StripeParseError;
3111    fn from_str(s: &str) -> Result<Self, Self::Err> {
3112        use CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*;
3113        match s {
3114            "none" => Ok(None),
3115            "off_session" => Ok(OffSession),
3116            _ => Err(stripe_types::StripeParseError),
3117        }
3118    }
3119}
3120impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
3121    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3122        f.write_str(self.as_str())
3123    }
3124}
3125
3126impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
3127    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3128        f.write_str(self.as_str())
3129    }
3130}
3131impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
3132    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3133    where
3134        S: serde::Serializer,
3135    {
3136        serializer.serialize_str(self.as_str())
3137    }
3138}
3139#[cfg(feature = "deserialize")]
3140impl<'de> serde::Deserialize<'de>
3141    for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage
3142{
3143    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3144        use std::str::FromStr;
3145        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3146        Self::from_str(&s).map_err(|_| {
3147            serde::de::Error::custom(
3148                "Unknown value for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage",
3149            )
3150        })
3151    }
3152}
3153/// If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options.
3154#[derive(Copy, Clone, Debug, serde::Serialize)]
3155pub struct CreatePaymentIntentPaymentMethodOptionsAlma {
3156    /// Controls when the funds are captured from the customer's account.
3157    ///
3158    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
3159    ///
3160    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
3161    #[serde(skip_serializing_if = "Option::is_none")]
3162    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod>,
3163}
3164impl CreatePaymentIntentPaymentMethodOptionsAlma {
3165    pub fn new() -> Self {
3166        Self { capture_method: None }
3167    }
3168}
3169impl Default for CreatePaymentIntentPaymentMethodOptionsAlma {
3170    fn default() -> Self {
3171        Self::new()
3172    }
3173}
3174/// Controls when the funds are captured from the customer's account.
3175///
3176/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
3177///
3178/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
3179#[derive(Copy, Clone, Eq, PartialEq)]
3180pub enum CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
3181    Manual,
3182}
3183impl CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
3184    pub fn as_str(self) -> &'static str {
3185        use CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod::*;
3186        match self {
3187            Manual => "manual",
3188        }
3189    }
3190}
3191
3192impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
3193    type Err = stripe_types::StripeParseError;
3194    fn from_str(s: &str) -> Result<Self, Self::Err> {
3195        use CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod::*;
3196        match s {
3197            "manual" => Ok(Manual),
3198            _ => Err(stripe_types::StripeParseError),
3199        }
3200    }
3201}
3202impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
3203    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3204        f.write_str(self.as_str())
3205    }
3206}
3207
3208impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
3209    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3210        f.write_str(self.as_str())
3211    }
3212}
3213impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
3214    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3215    where
3216        S: serde::Serializer,
3217    {
3218        serializer.serialize_str(self.as_str())
3219    }
3220}
3221#[cfg(feature = "deserialize")]
3222impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
3223    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3224        use std::str::FromStr;
3225        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3226        Self::from_str(&s).map_err(|_| {
3227            serde::de::Error::custom(
3228                "Unknown value for CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod",
3229            )
3230        })
3231    }
3232}
3233/// If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options.
3234#[derive(Copy, Clone, Debug, serde::Serialize)]
3235pub struct CreatePaymentIntentPaymentMethodOptionsAmazonPay {
3236    /// Controls when the funds are captured from the customer's account.
3237    ///
3238    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
3239    ///
3240    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
3241    #[serde(skip_serializing_if = "Option::is_none")]
3242    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod>,
3243    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3244    ///
3245    /// 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.
3246    /// 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.
3247    ///
3248    /// 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.
3249    ///
3250    /// 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).
3251    #[serde(skip_serializing_if = "Option::is_none")]
3252    pub setup_future_usage:
3253        Option<CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage>,
3254}
3255impl CreatePaymentIntentPaymentMethodOptionsAmazonPay {
3256    pub fn new() -> Self {
3257        Self { capture_method: None, setup_future_usage: None }
3258    }
3259}
3260impl Default for CreatePaymentIntentPaymentMethodOptionsAmazonPay {
3261    fn default() -> Self {
3262        Self::new()
3263    }
3264}
3265/// Controls when the funds are captured from the customer's account.
3266///
3267/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
3268///
3269/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
3270#[derive(Copy, Clone, Eq, PartialEq)]
3271pub enum CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
3272    Manual,
3273}
3274impl CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
3275    pub fn as_str(self) -> &'static str {
3276        use CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod::*;
3277        match self {
3278            Manual => "manual",
3279        }
3280    }
3281}
3282
3283impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
3284    type Err = stripe_types::StripeParseError;
3285    fn from_str(s: &str) -> Result<Self, Self::Err> {
3286        use CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod::*;
3287        match s {
3288            "manual" => Ok(Manual),
3289            _ => Err(stripe_types::StripeParseError),
3290        }
3291    }
3292}
3293impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
3294    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3295        f.write_str(self.as_str())
3296    }
3297}
3298
3299impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
3300    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3301        f.write_str(self.as_str())
3302    }
3303}
3304impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
3305    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3306    where
3307        S: serde::Serializer,
3308    {
3309        serializer.serialize_str(self.as_str())
3310    }
3311}
3312#[cfg(feature = "deserialize")]
3313impl<'de> serde::Deserialize<'de>
3314    for CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod
3315{
3316    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3317        use std::str::FromStr;
3318        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3319        Self::from_str(&s).map_err(|_| {
3320            serde::de::Error::custom(
3321                "Unknown value for CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod",
3322            )
3323        })
3324    }
3325}
3326/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3327///
3328/// 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.
3329/// 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.
3330///
3331/// 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.
3332///
3333/// 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).
3334#[derive(Copy, Clone, Eq, PartialEq)]
3335pub enum CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
3336    None,
3337    OffSession,
3338}
3339impl CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
3340    pub fn as_str(self) -> &'static str {
3341        use CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage::*;
3342        match self {
3343            None => "none",
3344            OffSession => "off_session",
3345        }
3346    }
3347}
3348
3349impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
3350    type Err = stripe_types::StripeParseError;
3351    fn from_str(s: &str) -> Result<Self, Self::Err> {
3352        use CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage::*;
3353        match s {
3354            "none" => Ok(None),
3355            "off_session" => Ok(OffSession),
3356            _ => Err(stripe_types::StripeParseError),
3357        }
3358    }
3359}
3360impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
3361    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3362        f.write_str(self.as_str())
3363    }
3364}
3365
3366impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
3367    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3368        f.write_str(self.as_str())
3369    }
3370}
3371impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
3372    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3373    where
3374        S: serde::Serializer,
3375    {
3376        serializer.serialize_str(self.as_str())
3377    }
3378}
3379#[cfg(feature = "deserialize")]
3380impl<'de> serde::Deserialize<'de>
3381    for CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage
3382{
3383    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3384        use std::str::FromStr;
3385        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3386        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage"))
3387    }
3388}
3389/// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options.
3390#[derive(Clone, Debug, serde::Serialize)]
3391pub struct CreatePaymentIntentPaymentMethodOptionsAuBecsDebit {
3392    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3393    ///
3394    /// 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.
3395    /// 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.
3396    ///
3397    /// 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.
3398    ///
3399    /// 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).
3400    ///
3401    /// 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`.
3402    #[serde(skip_serializing_if = "Option::is_none")]
3403    pub setup_future_usage:
3404        Option<CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage>,
3405    /// Controls when Stripe will attempt to debit the funds from the customer's account.
3406    /// The date must be a string in YYYY-MM-DD format.
3407    /// The date must be in the future and between 3 and 15 calendar days from now.
3408    #[serde(skip_serializing_if = "Option::is_none")]
3409    pub target_date: Option<String>,
3410}
3411impl CreatePaymentIntentPaymentMethodOptionsAuBecsDebit {
3412    pub fn new() -> Self {
3413        Self { setup_future_usage: None, target_date: None }
3414    }
3415}
3416impl Default for CreatePaymentIntentPaymentMethodOptionsAuBecsDebit {
3417    fn default() -> Self {
3418        Self::new()
3419    }
3420}
3421/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3422///
3423/// 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.
3424/// 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.
3425///
3426/// 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.
3427///
3428/// 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).
3429///
3430/// 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`.
3431#[derive(Copy, Clone, Eq, PartialEq)]
3432pub enum CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
3433    None,
3434    OffSession,
3435    OnSession,
3436}
3437impl CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
3438    pub fn as_str(self) -> &'static str {
3439        use CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*;
3440        match self {
3441            None => "none",
3442            OffSession => "off_session",
3443            OnSession => "on_session",
3444        }
3445    }
3446}
3447
3448impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
3449    type Err = stripe_types::StripeParseError;
3450    fn from_str(s: &str) -> Result<Self, Self::Err> {
3451        use CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*;
3452        match s {
3453            "none" => Ok(None),
3454            "off_session" => Ok(OffSession),
3455            "on_session" => Ok(OnSession),
3456            _ => Err(stripe_types::StripeParseError),
3457        }
3458    }
3459}
3460impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
3461    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3462        f.write_str(self.as_str())
3463    }
3464}
3465
3466impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
3467    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3468        f.write_str(self.as_str())
3469    }
3470}
3471impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
3472    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3473    where
3474        S: serde::Serializer,
3475    {
3476        serializer.serialize_str(self.as_str())
3477    }
3478}
3479#[cfg(feature = "deserialize")]
3480impl<'de> serde::Deserialize<'de>
3481    for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage
3482{
3483    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3484        use std::str::FromStr;
3485        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3486        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage"))
3487    }
3488}
3489/// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options.
3490#[derive(Clone, Debug, serde::Serialize)]
3491pub struct CreatePaymentIntentPaymentMethodOptionsBacsDebit {
3492    /// Additional fields for Mandate creation
3493    #[serde(skip_serializing_if = "Option::is_none")]
3494    pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
3495    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3496    ///
3497    /// 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.
3498    /// 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.
3499    ///
3500    /// 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.
3501    ///
3502    /// 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).
3503    ///
3504    /// 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`.
3505    #[serde(skip_serializing_if = "Option::is_none")]
3506    pub setup_future_usage:
3507        Option<CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage>,
3508    /// Controls when Stripe will attempt to debit the funds from the customer's account.
3509    /// The date must be a string in YYYY-MM-DD format.
3510    /// The date must be in the future and between 3 and 15 calendar days from now.
3511    #[serde(skip_serializing_if = "Option::is_none")]
3512    pub target_date: Option<String>,
3513}
3514impl CreatePaymentIntentPaymentMethodOptionsBacsDebit {
3515    pub fn new() -> Self {
3516        Self { mandate_options: None, setup_future_usage: None, target_date: None }
3517    }
3518}
3519impl Default for CreatePaymentIntentPaymentMethodOptionsBacsDebit {
3520    fn default() -> Self {
3521        Self::new()
3522    }
3523}
3524/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3525///
3526/// 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.
3527/// 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.
3528///
3529/// 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.
3530///
3531/// 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).
3532///
3533/// 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`.
3534#[derive(Copy, Clone, Eq, PartialEq)]
3535pub enum CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
3536    None,
3537    OffSession,
3538    OnSession,
3539}
3540impl CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
3541    pub fn as_str(self) -> &'static str {
3542        use CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*;
3543        match self {
3544            None => "none",
3545            OffSession => "off_session",
3546            OnSession => "on_session",
3547        }
3548    }
3549}
3550
3551impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
3552    type Err = stripe_types::StripeParseError;
3553    fn from_str(s: &str) -> Result<Self, Self::Err> {
3554        use CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*;
3555        match s {
3556            "none" => Ok(None),
3557            "off_session" => Ok(OffSession),
3558            "on_session" => Ok(OnSession),
3559            _ => Err(stripe_types::StripeParseError),
3560        }
3561    }
3562}
3563impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
3564    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3565        f.write_str(self.as_str())
3566    }
3567}
3568
3569impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
3570    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3571        f.write_str(self.as_str())
3572    }
3573}
3574impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
3575    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3576    where
3577        S: serde::Serializer,
3578    {
3579        serializer.serialize_str(self.as_str())
3580    }
3581}
3582#[cfg(feature = "deserialize")]
3583impl<'de> serde::Deserialize<'de>
3584    for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage
3585{
3586    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3587        use std::str::FromStr;
3588        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3589        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage"))
3590    }
3591}
3592/// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options.
3593#[derive(Copy, Clone, Debug, serde::Serialize)]
3594pub struct CreatePaymentIntentPaymentMethodOptionsBancontact {
3595    /// Preferred language of the Bancontact authorization page that the customer is redirected to.
3596    #[serde(skip_serializing_if = "Option::is_none")]
3597    pub preferred_language:
3598        Option<CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage>,
3599    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3600    ///
3601    /// 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.
3602    /// 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.
3603    ///
3604    /// 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.
3605    ///
3606    /// 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).
3607    ///
3608    /// 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`.
3609    #[serde(skip_serializing_if = "Option::is_none")]
3610    pub setup_future_usage:
3611        Option<CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage>,
3612}
3613impl CreatePaymentIntentPaymentMethodOptionsBancontact {
3614    pub fn new() -> Self {
3615        Self { preferred_language: None, setup_future_usage: None }
3616    }
3617}
3618impl Default for CreatePaymentIntentPaymentMethodOptionsBancontact {
3619    fn default() -> Self {
3620        Self::new()
3621    }
3622}
3623/// Preferred language of the Bancontact authorization page that the customer is redirected to.
3624#[derive(Copy, Clone, Eq, PartialEq)]
3625pub enum CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
3626    De,
3627    En,
3628    Fr,
3629    Nl,
3630}
3631impl CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
3632    pub fn as_str(self) -> &'static str {
3633        use CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*;
3634        match self {
3635            De => "de",
3636            En => "en",
3637            Fr => "fr",
3638            Nl => "nl",
3639        }
3640    }
3641}
3642
3643impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
3644    type Err = stripe_types::StripeParseError;
3645    fn from_str(s: &str) -> Result<Self, Self::Err> {
3646        use CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*;
3647        match s {
3648            "de" => Ok(De),
3649            "en" => Ok(En),
3650            "fr" => Ok(Fr),
3651            "nl" => Ok(Nl),
3652            _ => Err(stripe_types::StripeParseError),
3653        }
3654    }
3655}
3656impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
3657    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3658        f.write_str(self.as_str())
3659    }
3660}
3661
3662impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
3663    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3664        f.write_str(self.as_str())
3665    }
3666}
3667impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
3668    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3669    where
3670        S: serde::Serializer,
3671    {
3672        serializer.serialize_str(self.as_str())
3673    }
3674}
3675#[cfg(feature = "deserialize")]
3676impl<'de> serde::Deserialize<'de>
3677    for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage
3678{
3679    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3680        use std::str::FromStr;
3681        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3682        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage"))
3683    }
3684}
3685/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3686///
3687/// 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.
3688/// 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.
3689///
3690/// 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.
3691///
3692/// 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).
3693///
3694/// 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`.
3695#[derive(Copy, Clone, Eq, PartialEq)]
3696pub enum CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
3697    None,
3698    OffSession,
3699}
3700impl CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
3701    pub fn as_str(self) -> &'static str {
3702        use CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*;
3703        match self {
3704            None => "none",
3705            OffSession => "off_session",
3706        }
3707    }
3708}
3709
3710impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
3711    type Err = stripe_types::StripeParseError;
3712    fn from_str(s: &str) -> Result<Self, Self::Err> {
3713        use CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*;
3714        match s {
3715            "none" => Ok(None),
3716            "off_session" => Ok(OffSession),
3717            _ => Err(stripe_types::StripeParseError),
3718        }
3719    }
3720}
3721impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
3722    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3723        f.write_str(self.as_str())
3724    }
3725}
3726
3727impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
3728    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3729        f.write_str(self.as_str())
3730    }
3731}
3732impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
3733    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3734    where
3735        S: serde::Serializer,
3736    {
3737        serializer.serialize_str(self.as_str())
3738    }
3739}
3740#[cfg(feature = "deserialize")]
3741impl<'de> serde::Deserialize<'de>
3742    for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage
3743{
3744    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3745        use std::str::FromStr;
3746        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3747        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage"))
3748    }
3749}
3750/// If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options.
3751#[derive(Copy, Clone, Debug, serde::Serialize)]
3752pub struct CreatePaymentIntentPaymentMethodOptionsBillie {
3753    /// Controls when the funds are captured from the customer's account.
3754    ///
3755    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
3756    ///
3757    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
3758    #[serde(skip_serializing_if = "Option::is_none")]
3759    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod>,
3760}
3761impl CreatePaymentIntentPaymentMethodOptionsBillie {
3762    pub fn new() -> Self {
3763        Self { capture_method: None }
3764    }
3765}
3766impl Default for CreatePaymentIntentPaymentMethodOptionsBillie {
3767    fn default() -> Self {
3768        Self::new()
3769    }
3770}
3771/// Controls when the funds are captured from the customer's account.
3772///
3773/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
3774///
3775/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
3776#[derive(Copy, Clone, Eq, PartialEq)]
3777pub enum CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
3778    Manual,
3779}
3780impl CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
3781    pub fn as_str(self) -> &'static str {
3782        use CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod::*;
3783        match self {
3784            Manual => "manual",
3785        }
3786    }
3787}
3788
3789impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
3790    type Err = stripe_types::StripeParseError;
3791    fn from_str(s: &str) -> Result<Self, Self::Err> {
3792        use CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod::*;
3793        match s {
3794            "manual" => Ok(Manual),
3795            _ => Err(stripe_types::StripeParseError),
3796        }
3797    }
3798}
3799impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
3800    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3801        f.write_str(self.as_str())
3802    }
3803}
3804
3805impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
3806    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3807        f.write_str(self.as_str())
3808    }
3809}
3810impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
3811    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3812    where
3813        S: serde::Serializer,
3814    {
3815        serializer.serialize_str(self.as_str())
3816    }
3817}
3818#[cfg(feature = "deserialize")]
3819impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
3820    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3821        use std::str::FromStr;
3822        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3823        Self::from_str(&s).map_err(|_| {
3824            serde::de::Error::custom(
3825                "Unknown value for CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod",
3826            )
3827        })
3828    }
3829}
3830/// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options.
3831#[derive(Clone, Debug, serde::Serialize)]
3832pub struct CreatePaymentIntentPaymentMethodOptionsBlik {
3833    /// The 6-digit BLIK code that a customer has generated using their banking application.
3834    /// Can only be set on confirmation.
3835    #[serde(skip_serializing_if = "Option::is_none")]
3836    pub code: Option<String>,
3837    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3838    ///
3839    /// 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.
3840    /// 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.
3841    ///
3842    /// 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.
3843    ///
3844    /// 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).
3845    ///
3846    /// 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`.
3847    #[serde(skip_serializing_if = "Option::is_none")]
3848    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage>,
3849}
3850impl CreatePaymentIntentPaymentMethodOptionsBlik {
3851    pub fn new() -> Self {
3852        Self { code: None, setup_future_usage: None }
3853    }
3854}
3855impl Default for CreatePaymentIntentPaymentMethodOptionsBlik {
3856    fn default() -> Self {
3857        Self::new()
3858    }
3859}
3860/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3861///
3862/// 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.
3863/// 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.
3864///
3865/// 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.
3866///
3867/// 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).
3868///
3869/// 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`.
3870#[derive(Copy, Clone, Eq, PartialEq)]
3871pub enum CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
3872    None,
3873}
3874impl CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
3875    pub fn as_str(self) -> &'static str {
3876        use CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::*;
3877        match self {
3878            None => "none",
3879        }
3880    }
3881}
3882
3883impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
3884    type Err = stripe_types::StripeParseError;
3885    fn from_str(s: &str) -> Result<Self, Self::Err> {
3886        use CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::*;
3887        match s {
3888            "none" => Ok(None),
3889            _ => Err(stripe_types::StripeParseError),
3890        }
3891    }
3892}
3893impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
3894    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3895        f.write_str(self.as_str())
3896    }
3897}
3898
3899impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
3900    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3901        f.write_str(self.as_str())
3902    }
3903}
3904impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
3905    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3906    where
3907        S: serde::Serializer,
3908    {
3909        serializer.serialize_str(self.as_str())
3910    }
3911}
3912#[cfg(feature = "deserialize")]
3913impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
3914    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3915        use std::str::FromStr;
3916        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3917        Self::from_str(&s).map_err(|_| {
3918            serde::de::Error::custom(
3919                "Unknown value for CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage",
3920            )
3921        })
3922    }
3923}
3924/// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options.
3925#[derive(Copy, Clone, Debug, serde::Serialize)]
3926pub struct CreatePaymentIntentPaymentMethodOptionsBoleto {
3927    /// The number of calendar days before a Boleto voucher expires.
3928    /// 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.
3929    #[serde(skip_serializing_if = "Option::is_none")]
3930    pub expires_after_days: Option<u32>,
3931    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3932    ///
3933    /// 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.
3934    /// 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.
3935    ///
3936    /// 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.
3937    ///
3938    /// 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).
3939    ///
3940    /// 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`.
3941    #[serde(skip_serializing_if = "Option::is_none")]
3942    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage>,
3943}
3944impl CreatePaymentIntentPaymentMethodOptionsBoleto {
3945    pub fn new() -> Self {
3946        Self { expires_after_days: None, setup_future_usage: None }
3947    }
3948}
3949impl Default for CreatePaymentIntentPaymentMethodOptionsBoleto {
3950    fn default() -> Self {
3951        Self::new()
3952    }
3953}
3954/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3955///
3956/// 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.
3957/// 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.
3958///
3959/// 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.
3960///
3961/// 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).
3962///
3963/// 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`.
3964#[derive(Copy, Clone, Eq, PartialEq)]
3965pub enum CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
3966    None,
3967    OffSession,
3968    OnSession,
3969}
3970impl CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
3971    pub fn as_str(self) -> &'static str {
3972        use CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*;
3973        match self {
3974            None => "none",
3975            OffSession => "off_session",
3976            OnSession => "on_session",
3977        }
3978    }
3979}
3980
3981impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
3982    type Err = stripe_types::StripeParseError;
3983    fn from_str(s: &str) -> Result<Self, Self::Err> {
3984        use CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*;
3985        match s {
3986            "none" => Ok(None),
3987            "off_session" => Ok(OffSession),
3988            "on_session" => Ok(OnSession),
3989            _ => Err(stripe_types::StripeParseError),
3990        }
3991    }
3992}
3993impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
3994    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3995        f.write_str(self.as_str())
3996    }
3997}
3998
3999impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
4000    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4001        f.write_str(self.as_str())
4002    }
4003}
4004impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
4005    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4006    where
4007        S: serde::Serializer,
4008    {
4009        serializer.serialize_str(self.as_str())
4010    }
4011}
4012#[cfg(feature = "deserialize")]
4013impl<'de> serde::Deserialize<'de>
4014    for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage
4015{
4016    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4017        use std::str::FromStr;
4018        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4019        Self::from_str(&s).map_err(|_| {
4020            serde::de::Error::custom(
4021                "Unknown value for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage",
4022            )
4023        })
4024    }
4025}
4026/// Configuration for any card payments attempted on this PaymentIntent.
4027#[derive(Clone, Debug, serde::Serialize)]
4028pub struct CreatePaymentIntentPaymentMethodOptionsCard {
4029    /// Controls when the funds are captured from the customer's account.
4030    ///
4031    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
4032    ///
4033    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
4034    #[serde(skip_serializing_if = "Option::is_none")]
4035    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod>,
4036    /// A single-use `cvc_update` Token that represents a card CVC value.
4037    /// When provided, the CVC value will be verified during the card payment attempt.
4038    /// This parameter can only be provided during confirmation.
4039    #[serde(skip_serializing_if = "Option::is_none")]
4040    pub cvc_token: Option<String>,
4041    /// Installment configuration for payments attempted on this PaymentIntent.
4042    ///
4043    /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
4044    #[serde(skip_serializing_if = "Option::is_none")]
4045    pub installments: Option<CreatePaymentIntentPaymentMethodOptionsCardInstallments>,
4046    /// Configuration options for setting up an eMandate for cards issued in India.
4047    #[serde(skip_serializing_if = "Option::is_none")]
4048    pub mandate_options: Option<CreatePaymentIntentPaymentMethodOptionsCardMandateOptions>,
4049    /// When specified, this parameter indicates that a transaction will be marked
4050    /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This
4051    /// parameter can only be provided during confirmation.
4052    #[serde(skip_serializing_if = "Option::is_none")]
4053    pub moto: Option<bool>,
4054    /// Selected network to process this PaymentIntent on.
4055    /// Depends on the available networks of the card attached to the PaymentIntent.
4056    /// Can be only set confirm-time.
4057    #[serde(skip_serializing_if = "Option::is_none")]
4058    pub network: Option<CreatePaymentIntentPaymentMethodOptionsCardNetwork>,
4059    /// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent.
4060    #[serde(skip_serializing_if = "Option::is_none")]
4061    pub request_extended_authorization:
4062        Option<CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization>,
4063    /// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent.
4064    #[serde(skip_serializing_if = "Option::is_none")]
4065    pub request_incremental_authorization:
4066        Option<CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization>,
4067    /// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent.
4068    #[serde(skip_serializing_if = "Option::is_none")]
4069    pub request_multicapture:
4070        Option<CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture>,
4071    /// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent.
4072    #[serde(skip_serializing_if = "Option::is_none")]
4073    pub request_overcapture: Option<CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture>,
4074    /// 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://stripe.com/docs/strong-customer-authentication).
4075    /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
4076    /// If not provided, this value defaults to `automatic`.
4077    /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
4078    #[serde(skip_serializing_if = "Option::is_none")]
4079    pub request_three_d_secure:
4080        Option<CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure>,
4081    /// When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e.
4082    /// using the cvc_token parameter).
4083    #[serde(skip_serializing_if = "Option::is_none")]
4084    pub require_cvc_recollection: Option<bool>,
4085    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
4086    ///
4087    /// 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.
4088    /// 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.
4089    ///
4090    /// 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.
4091    ///
4092    /// 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).
4093    ///
4094    /// 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`.
4095    #[serde(skip_serializing_if = "Option::is_none")]
4096    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage>,
4097    /// Provides information about a card payment that customers see on their statements.
4098    /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor.
4099    /// Maximum 22 characters.
4100    /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters.
4101    #[serde(skip_serializing_if = "Option::is_none")]
4102    pub statement_descriptor_suffix_kana: Option<String>,
4103    /// Provides information about a card payment that customers see on their statements.
4104    /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor.
4105    /// Maximum 17 characters.
4106    /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters.
4107    #[serde(skip_serializing_if = "Option::is_none")]
4108    pub statement_descriptor_suffix_kanji: Option<String>,
4109    /// If 3D Secure authentication was performed with a third-party provider,
4110    /// the authentication details to use for this payment.
4111    #[serde(skip_serializing_if = "Option::is_none")]
4112    pub three_d_secure: Option<CreatePaymentIntentPaymentMethodOptionsCardThreeDSecure>,
4113}
4114impl CreatePaymentIntentPaymentMethodOptionsCard {
4115    pub fn new() -> Self {
4116        Self {
4117            capture_method: None,
4118            cvc_token: None,
4119            installments: None,
4120            mandate_options: None,
4121            moto: None,
4122            network: None,
4123            request_extended_authorization: None,
4124            request_incremental_authorization: None,
4125            request_multicapture: None,
4126            request_overcapture: None,
4127            request_three_d_secure: None,
4128            require_cvc_recollection: None,
4129            setup_future_usage: None,
4130            statement_descriptor_suffix_kana: None,
4131            statement_descriptor_suffix_kanji: None,
4132            three_d_secure: None,
4133        }
4134    }
4135}
4136impl Default for CreatePaymentIntentPaymentMethodOptionsCard {
4137    fn default() -> Self {
4138        Self::new()
4139    }
4140}
4141/// Controls when the funds are captured from the customer's account.
4142///
4143/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
4144///
4145/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
4146#[derive(Copy, Clone, Eq, PartialEq)]
4147pub enum CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
4148    Manual,
4149}
4150impl CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
4151    pub fn as_str(self) -> &'static str {
4152        use CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod::*;
4153        match self {
4154            Manual => "manual",
4155        }
4156    }
4157}
4158
4159impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
4160    type Err = stripe_types::StripeParseError;
4161    fn from_str(s: &str) -> Result<Self, Self::Err> {
4162        use CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod::*;
4163        match s {
4164            "manual" => Ok(Manual),
4165            _ => Err(stripe_types::StripeParseError),
4166        }
4167    }
4168}
4169impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
4170    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4171        f.write_str(self.as_str())
4172    }
4173}
4174
4175impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
4176    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4177        f.write_str(self.as_str())
4178    }
4179}
4180impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
4181    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4182    where
4183        S: serde::Serializer,
4184    {
4185        serializer.serialize_str(self.as_str())
4186    }
4187}
4188#[cfg(feature = "deserialize")]
4189impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
4190    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4191        use std::str::FromStr;
4192        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4193        Self::from_str(&s).map_err(|_| {
4194            serde::de::Error::custom(
4195                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod",
4196            )
4197        })
4198    }
4199}
4200/// Installment configuration for payments attempted on this PaymentIntent.
4201///
4202/// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
4203#[derive(Copy, Clone, Debug, serde::Serialize)]
4204pub struct CreatePaymentIntentPaymentMethodOptionsCardInstallments {
4205    /// Setting to true enables installments for this PaymentIntent.
4206    /// This will cause the response to contain a list of available installment plans.
4207    /// Setting to false will prevent any selected plan from applying to a charge.
4208    #[serde(skip_serializing_if = "Option::is_none")]
4209    pub enabled: Option<bool>,
4210    /// The selected installment plan to use for this payment attempt.
4211    /// This parameter can only be provided during confirmation.
4212    #[serde(skip_serializing_if = "Option::is_none")]
4213    pub plan: Option<CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan>,
4214}
4215impl CreatePaymentIntentPaymentMethodOptionsCardInstallments {
4216    pub fn new() -> Self {
4217        Self { enabled: None, plan: None }
4218    }
4219}
4220impl Default for CreatePaymentIntentPaymentMethodOptionsCardInstallments {
4221    fn default() -> Self {
4222        Self::new()
4223    }
4224}
4225/// The selected installment plan to use for this payment attempt.
4226/// This parameter can only be provided during confirmation.
4227#[derive(Copy, Clone, Debug, serde::Serialize)]
4228pub struct CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan {
4229    /// For `fixed_count` installment plans, this is required.
4230    /// It represents the number of installment payments your customer will make to their credit card.
4231    #[serde(skip_serializing_if = "Option::is_none")]
4232    pub count: Option<u64>,
4233    /// For `fixed_count` installment plans, this is required.
4234    /// It represents the interval between installment payments your customer will make to their credit card.
4235    /// One of `month`.
4236    #[serde(skip_serializing_if = "Option::is_none")]
4237    pub interval: Option<CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval>,
4238    /// Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
4239    #[serde(rename = "type")]
4240    pub type_: CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType,
4241}
4242impl CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan {
4243    pub fn new(
4244        type_: impl Into<CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType>,
4245    ) -> Self {
4246        Self { count: None, interval: None, type_: type_.into() }
4247    }
4248}
4249/// For `fixed_count` installment plans, this is required.
4250/// It represents the interval between installment payments your customer will make to their credit card.
4251/// One of `month`.
4252#[derive(Copy, Clone, Eq, PartialEq)]
4253pub enum CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
4254    Month,
4255}
4256impl CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
4257    pub fn as_str(self) -> &'static str {
4258        use CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*;
4259        match self {
4260            Month => "month",
4261        }
4262    }
4263}
4264
4265impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
4266    type Err = stripe_types::StripeParseError;
4267    fn from_str(s: &str) -> Result<Self, Self::Err> {
4268        use CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*;
4269        match s {
4270            "month" => Ok(Month),
4271            _ => Err(stripe_types::StripeParseError),
4272        }
4273    }
4274}
4275impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
4276    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4277        f.write_str(self.as_str())
4278    }
4279}
4280
4281impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
4282    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4283        f.write_str(self.as_str())
4284    }
4285}
4286impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
4287    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4288    where
4289        S: serde::Serializer,
4290    {
4291        serializer.serialize_str(self.as_str())
4292    }
4293}
4294#[cfg(feature = "deserialize")]
4295impl<'de> serde::Deserialize<'de>
4296    for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval
4297{
4298    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4299        use std::str::FromStr;
4300        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4301        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval"))
4302    }
4303}
4304/// Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
4305#[derive(Copy, Clone, Eq, PartialEq)]
4306pub enum CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
4307    Bonus,
4308    FixedCount,
4309    Revolving,
4310}
4311impl CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
4312    pub fn as_str(self) -> &'static str {
4313        use CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*;
4314        match self {
4315            Bonus => "bonus",
4316            FixedCount => "fixed_count",
4317            Revolving => "revolving",
4318        }
4319    }
4320}
4321
4322impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
4323    type Err = stripe_types::StripeParseError;
4324    fn from_str(s: &str) -> Result<Self, Self::Err> {
4325        use CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*;
4326        match s {
4327            "bonus" => Ok(Bonus),
4328            "fixed_count" => Ok(FixedCount),
4329            "revolving" => Ok(Revolving),
4330            _ => Err(stripe_types::StripeParseError),
4331        }
4332    }
4333}
4334impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
4335    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4336        f.write_str(self.as_str())
4337    }
4338}
4339
4340impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
4341    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4342        f.write_str(self.as_str())
4343    }
4344}
4345impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
4346    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4347    where
4348        S: serde::Serializer,
4349    {
4350        serializer.serialize_str(self.as_str())
4351    }
4352}
4353#[cfg(feature = "deserialize")]
4354impl<'de> serde::Deserialize<'de>
4355    for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType
4356{
4357    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4358        use std::str::FromStr;
4359        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4360        Self::from_str(&s).map_err(|_| {
4361            serde::de::Error::custom(
4362                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType",
4363            )
4364        })
4365    }
4366}
4367/// Configuration options for setting up an eMandate for cards issued in India.
4368#[derive(Clone, Debug, serde::Serialize)]
4369pub struct CreatePaymentIntentPaymentMethodOptionsCardMandateOptions {
4370    /// Amount to be charged for future payments.
4371    pub amount: i64,
4372    /// One of `fixed` or `maximum`.
4373    /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
4374    /// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
4375    pub amount_type: CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType,
4376    /// A description of the mandate or subscription that is meant to be displayed to the customer.
4377    #[serde(skip_serializing_if = "Option::is_none")]
4378    pub description: Option<String>,
4379    /// End date of the mandate or subscription.
4380    /// If not provided, the mandate will be active until canceled.
4381    /// If provided, end date should be after start date.
4382    #[serde(skip_serializing_if = "Option::is_none")]
4383    pub end_date: Option<stripe_types::Timestamp>,
4384    /// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
4385    pub interval: CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval,
4386    /// The number of intervals between payments.
4387    /// For example, `interval=month` and `interval_count=3` indicates one payment every three months.
4388    /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).
4389    /// This parameter is optional when `interval=sporadic`.
4390    #[serde(skip_serializing_if = "Option::is_none")]
4391    pub interval_count: Option<u64>,
4392    /// Unique identifier for the mandate or subscription.
4393    pub reference: String,
4394    /// Start date of the mandate or subscription. Start date should not be lesser than yesterday.
4395    pub start_date: stripe_types::Timestamp,
4396    /// Specifies the type of mandates supported. Possible values are `india`.
4397    #[serde(skip_serializing_if = "Option::is_none")]
4398    pub supported_types:
4399        Option<Vec<CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
4400}
4401impl CreatePaymentIntentPaymentMethodOptionsCardMandateOptions {
4402    pub fn new(
4403        amount: impl Into<i64>,
4404        amount_type: impl Into<CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
4405        interval: impl Into<CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval>,
4406        reference: impl Into<String>,
4407        start_date: impl Into<stripe_types::Timestamp>,
4408    ) -> Self {
4409        Self {
4410            amount: amount.into(),
4411            amount_type: amount_type.into(),
4412            description: None,
4413            end_date: None,
4414            interval: interval.into(),
4415            interval_count: None,
4416            reference: reference.into(),
4417            start_date: start_date.into(),
4418            supported_types: None,
4419        }
4420    }
4421}
4422/// One of `fixed` or `maximum`.
4423/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
4424/// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
4425#[derive(Copy, Clone, Eq, PartialEq)]
4426pub enum CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
4427    Fixed,
4428    Maximum,
4429}
4430impl CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
4431    pub fn as_str(self) -> &'static str {
4432        use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
4433        match self {
4434            Fixed => "fixed",
4435            Maximum => "maximum",
4436        }
4437    }
4438}
4439
4440impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
4441    type Err = stripe_types::StripeParseError;
4442    fn from_str(s: &str) -> Result<Self, Self::Err> {
4443        use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
4444        match s {
4445            "fixed" => Ok(Fixed),
4446            "maximum" => Ok(Maximum),
4447            _ => Err(stripe_types::StripeParseError),
4448        }
4449    }
4450}
4451impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
4452    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4453        f.write_str(self.as_str())
4454    }
4455}
4456
4457impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
4458    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4459        f.write_str(self.as_str())
4460    }
4461}
4462impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
4463    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4464    where
4465        S: serde::Serializer,
4466    {
4467        serializer.serialize_str(self.as_str())
4468    }
4469}
4470#[cfg(feature = "deserialize")]
4471impl<'de> serde::Deserialize<'de>
4472    for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType
4473{
4474    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4475        use std::str::FromStr;
4476        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4477        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType"))
4478    }
4479}
4480/// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
4481#[derive(Copy, Clone, Eq, PartialEq)]
4482pub enum CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
4483    Day,
4484    Month,
4485    Sporadic,
4486    Week,
4487    Year,
4488}
4489impl CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
4490    pub fn as_str(self) -> &'static str {
4491        use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
4492        match self {
4493            Day => "day",
4494            Month => "month",
4495            Sporadic => "sporadic",
4496            Week => "week",
4497            Year => "year",
4498        }
4499    }
4500}
4501
4502impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
4503    type Err = stripe_types::StripeParseError;
4504    fn from_str(s: &str) -> Result<Self, Self::Err> {
4505        use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
4506        match s {
4507            "day" => Ok(Day),
4508            "month" => Ok(Month),
4509            "sporadic" => Ok(Sporadic),
4510            "week" => Ok(Week),
4511            "year" => Ok(Year),
4512            _ => Err(stripe_types::StripeParseError),
4513        }
4514    }
4515}
4516impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
4517    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4518        f.write_str(self.as_str())
4519    }
4520}
4521
4522impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
4523    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4524        f.write_str(self.as_str())
4525    }
4526}
4527impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
4528    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4529    where
4530        S: serde::Serializer,
4531    {
4532        serializer.serialize_str(self.as_str())
4533    }
4534}
4535#[cfg(feature = "deserialize")]
4536impl<'de> serde::Deserialize<'de>
4537    for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval
4538{
4539    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4540        use std::str::FromStr;
4541        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4542        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval"))
4543    }
4544}
4545/// Specifies the type of mandates supported. Possible values are `india`.
4546#[derive(Copy, Clone, Eq, PartialEq)]
4547pub enum CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
4548    India,
4549}
4550impl CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
4551    pub fn as_str(self) -> &'static str {
4552        use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
4553        match self {
4554            India => "india",
4555        }
4556    }
4557}
4558
4559impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
4560    type Err = stripe_types::StripeParseError;
4561    fn from_str(s: &str) -> Result<Self, Self::Err> {
4562        use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
4563        match s {
4564            "india" => Ok(India),
4565            _ => Err(stripe_types::StripeParseError),
4566        }
4567    }
4568}
4569impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
4570    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4571        f.write_str(self.as_str())
4572    }
4573}
4574
4575impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
4576    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4577        f.write_str(self.as_str())
4578    }
4579}
4580impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
4581    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4582    where
4583        S: serde::Serializer,
4584    {
4585        serializer.serialize_str(self.as_str())
4586    }
4587}
4588#[cfg(feature = "deserialize")]
4589impl<'de> serde::Deserialize<'de>
4590    for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
4591{
4592    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4593        use std::str::FromStr;
4594        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4595        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"))
4596    }
4597}
4598/// Selected network to process this PaymentIntent on.
4599/// Depends on the available networks of the card attached to the PaymentIntent.
4600/// Can be only set confirm-time.
4601#[derive(Copy, Clone, Eq, PartialEq)]
4602pub enum CreatePaymentIntentPaymentMethodOptionsCardNetwork {
4603    Amex,
4604    CartesBancaires,
4605    Diners,
4606    Discover,
4607    EftposAu,
4608    Girocard,
4609    Interac,
4610    Jcb,
4611    Link,
4612    Mastercard,
4613    Unionpay,
4614    Unknown,
4615    Visa,
4616}
4617impl CreatePaymentIntentPaymentMethodOptionsCardNetwork {
4618    pub fn as_str(self) -> &'static str {
4619        use CreatePaymentIntentPaymentMethodOptionsCardNetwork::*;
4620        match self {
4621            Amex => "amex",
4622            CartesBancaires => "cartes_bancaires",
4623            Diners => "diners",
4624            Discover => "discover",
4625            EftposAu => "eftpos_au",
4626            Girocard => "girocard",
4627            Interac => "interac",
4628            Jcb => "jcb",
4629            Link => "link",
4630            Mastercard => "mastercard",
4631            Unionpay => "unionpay",
4632            Unknown => "unknown",
4633            Visa => "visa",
4634        }
4635    }
4636}
4637
4638impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardNetwork {
4639    type Err = stripe_types::StripeParseError;
4640    fn from_str(s: &str) -> Result<Self, Self::Err> {
4641        use CreatePaymentIntentPaymentMethodOptionsCardNetwork::*;
4642        match s {
4643            "amex" => Ok(Amex),
4644            "cartes_bancaires" => Ok(CartesBancaires),
4645            "diners" => Ok(Diners),
4646            "discover" => Ok(Discover),
4647            "eftpos_au" => Ok(EftposAu),
4648            "girocard" => Ok(Girocard),
4649            "interac" => Ok(Interac),
4650            "jcb" => Ok(Jcb),
4651            "link" => Ok(Link),
4652            "mastercard" => Ok(Mastercard),
4653            "unionpay" => Ok(Unionpay),
4654            "unknown" => Ok(Unknown),
4655            "visa" => Ok(Visa),
4656            _ => Err(stripe_types::StripeParseError),
4657        }
4658    }
4659}
4660impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardNetwork {
4661    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4662        f.write_str(self.as_str())
4663    }
4664}
4665
4666impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardNetwork {
4667    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4668        f.write_str(self.as_str())
4669    }
4670}
4671impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardNetwork {
4672    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4673    where
4674        S: serde::Serializer,
4675    {
4676        serializer.serialize_str(self.as_str())
4677    }
4678}
4679#[cfg(feature = "deserialize")]
4680impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsCardNetwork {
4681    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4682        use std::str::FromStr;
4683        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4684        Self::from_str(&s).map_err(|_| {
4685            serde::de::Error::custom(
4686                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCardNetwork",
4687            )
4688        })
4689    }
4690}
4691/// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent.
4692#[derive(Copy, Clone, Eq, PartialEq)]
4693pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
4694    IfAvailable,
4695    Never,
4696}
4697impl CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
4698    pub fn as_str(self) -> &'static str {
4699        use CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*;
4700        match self {
4701            IfAvailable => "if_available",
4702            Never => "never",
4703        }
4704    }
4705}
4706
4707impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
4708    type Err = stripe_types::StripeParseError;
4709    fn from_str(s: &str) -> Result<Self, Self::Err> {
4710        use CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*;
4711        match s {
4712            "if_available" => Ok(IfAvailable),
4713            "never" => Ok(Never),
4714            _ => Err(stripe_types::StripeParseError),
4715        }
4716    }
4717}
4718impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
4719    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4720        f.write_str(self.as_str())
4721    }
4722}
4723
4724impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
4725    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4726        f.write_str(self.as_str())
4727    }
4728}
4729impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
4730    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4731    where
4732        S: serde::Serializer,
4733    {
4734        serializer.serialize_str(self.as_str())
4735    }
4736}
4737#[cfg(feature = "deserialize")]
4738impl<'de> serde::Deserialize<'de>
4739    for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization
4740{
4741    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4742        use std::str::FromStr;
4743        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4744        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization"))
4745    }
4746}
4747/// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent.
4748#[derive(Copy, Clone, Eq, PartialEq)]
4749pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization {
4750    IfAvailable,
4751    Never,
4752}
4753impl CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization {
4754    pub fn as_str(self) -> &'static str {
4755        use CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*;
4756        match self {
4757            IfAvailable => "if_available",
4758            Never => "never",
4759        }
4760    }
4761}
4762
4763impl std::str::FromStr
4764    for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
4765{
4766    type Err = stripe_types::StripeParseError;
4767    fn from_str(s: &str) -> Result<Self, Self::Err> {
4768        use CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*;
4769        match s {
4770            "if_available" => Ok(IfAvailable),
4771            "never" => Ok(Never),
4772            _ => Err(stripe_types::StripeParseError),
4773        }
4774    }
4775}
4776impl std::fmt::Display
4777    for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
4778{
4779    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4780        f.write_str(self.as_str())
4781    }
4782}
4783
4784impl std::fmt::Debug
4785    for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
4786{
4787    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4788        f.write_str(self.as_str())
4789    }
4790}
4791impl serde::Serialize
4792    for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
4793{
4794    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4795    where
4796        S: serde::Serializer,
4797    {
4798        serializer.serialize_str(self.as_str())
4799    }
4800}
4801#[cfg(feature = "deserialize")]
4802impl<'de> serde::Deserialize<'de>
4803    for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
4804{
4805    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4806        use std::str::FromStr;
4807        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4808        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization"))
4809    }
4810}
4811/// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent.
4812#[derive(Copy, Clone, Eq, PartialEq)]
4813pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
4814    IfAvailable,
4815    Never,
4816}
4817impl CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
4818    pub fn as_str(self) -> &'static str {
4819        use CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture::*;
4820        match self {
4821            IfAvailable => "if_available",
4822            Never => "never",
4823        }
4824    }
4825}
4826
4827impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
4828    type Err = stripe_types::StripeParseError;
4829    fn from_str(s: &str) -> Result<Self, Self::Err> {
4830        use CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture::*;
4831        match s {
4832            "if_available" => Ok(IfAvailable),
4833            "never" => Ok(Never),
4834            _ => Err(stripe_types::StripeParseError),
4835        }
4836    }
4837}
4838impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
4839    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4840        f.write_str(self.as_str())
4841    }
4842}
4843
4844impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
4845    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4846        f.write_str(self.as_str())
4847    }
4848}
4849impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
4850    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4851    where
4852        S: serde::Serializer,
4853    {
4854        serializer.serialize_str(self.as_str())
4855    }
4856}
4857#[cfg(feature = "deserialize")]
4858impl<'de> serde::Deserialize<'de>
4859    for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture
4860{
4861    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4862        use std::str::FromStr;
4863        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4864        Self::from_str(&s).map_err(|_| {
4865            serde::de::Error::custom(
4866                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture",
4867            )
4868        })
4869    }
4870}
4871/// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent.
4872#[derive(Copy, Clone, Eq, PartialEq)]
4873pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
4874    IfAvailable,
4875    Never,
4876}
4877impl CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
4878    pub fn as_str(self) -> &'static str {
4879        use CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture::*;
4880        match self {
4881            IfAvailable => "if_available",
4882            Never => "never",
4883        }
4884    }
4885}
4886
4887impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
4888    type Err = stripe_types::StripeParseError;
4889    fn from_str(s: &str) -> Result<Self, Self::Err> {
4890        use CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture::*;
4891        match s {
4892            "if_available" => Ok(IfAvailable),
4893            "never" => Ok(Never),
4894            _ => Err(stripe_types::StripeParseError),
4895        }
4896    }
4897}
4898impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
4899    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4900        f.write_str(self.as_str())
4901    }
4902}
4903
4904impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
4905    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4906        f.write_str(self.as_str())
4907    }
4908}
4909impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
4910    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4911    where
4912        S: serde::Serializer,
4913    {
4914        serializer.serialize_str(self.as_str())
4915    }
4916}
4917#[cfg(feature = "deserialize")]
4918impl<'de> serde::Deserialize<'de>
4919    for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture
4920{
4921    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4922        use std::str::FromStr;
4923        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4924        Self::from_str(&s).map_err(|_| {
4925            serde::de::Error::custom(
4926                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture",
4927            )
4928        })
4929    }
4930}
4931/// 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://stripe.com/docs/strong-customer-authentication).
4932/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
4933/// If not provided, this value defaults to `automatic`.
4934/// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
4935#[derive(Copy, Clone, Eq, PartialEq)]
4936pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
4937    Any,
4938    Automatic,
4939    Challenge,
4940}
4941impl CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
4942    pub fn as_str(self) -> &'static str {
4943        use CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
4944        match self {
4945            Any => "any",
4946            Automatic => "automatic",
4947            Challenge => "challenge",
4948        }
4949    }
4950}
4951
4952impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
4953    type Err = stripe_types::StripeParseError;
4954    fn from_str(s: &str) -> Result<Self, Self::Err> {
4955        use CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
4956        match s {
4957            "any" => Ok(Any),
4958            "automatic" => Ok(Automatic),
4959            "challenge" => Ok(Challenge),
4960            _ => Err(stripe_types::StripeParseError),
4961        }
4962    }
4963}
4964impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
4965    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4966        f.write_str(self.as_str())
4967    }
4968}
4969
4970impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
4971    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4972        f.write_str(self.as_str())
4973    }
4974}
4975impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
4976    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4977    where
4978        S: serde::Serializer,
4979    {
4980        serializer.serialize_str(self.as_str())
4981    }
4982}
4983#[cfg(feature = "deserialize")]
4984impl<'de> serde::Deserialize<'de>
4985    for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure
4986{
4987    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4988        use std::str::FromStr;
4989        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4990        Self::from_str(&s).map_err(|_| {
4991            serde::de::Error::custom(
4992                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure",
4993            )
4994        })
4995    }
4996}
4997/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
4998///
4999/// 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.
5000/// 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.
5001///
5002/// 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.
5003///
5004/// 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).
5005///
5006/// 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`.
5007#[derive(Copy, Clone, Eq, PartialEq)]
5008pub enum CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
5009    None,
5010    OffSession,
5011    OnSession,
5012}
5013impl CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
5014    pub fn as_str(self) -> &'static str {
5015        use CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*;
5016        match self {
5017            None => "none",
5018            OffSession => "off_session",
5019            OnSession => "on_session",
5020        }
5021    }
5022}
5023
5024impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
5025    type Err = stripe_types::StripeParseError;
5026    fn from_str(s: &str) -> Result<Self, Self::Err> {
5027        use CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*;
5028        match s {
5029            "none" => Ok(None),
5030            "off_session" => Ok(OffSession),
5031            "on_session" => Ok(OnSession),
5032            _ => Err(stripe_types::StripeParseError),
5033        }
5034    }
5035}
5036impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
5037    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5038        f.write_str(self.as_str())
5039    }
5040}
5041
5042impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
5043    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5044        f.write_str(self.as_str())
5045    }
5046}
5047impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
5048    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5049    where
5050        S: serde::Serializer,
5051    {
5052        serializer.serialize_str(self.as_str())
5053    }
5054}
5055#[cfg(feature = "deserialize")]
5056impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
5057    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5058        use std::str::FromStr;
5059        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5060        Self::from_str(&s).map_err(|_| {
5061            serde::de::Error::custom(
5062                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage",
5063            )
5064        })
5065    }
5066}
5067/// If 3D Secure authentication was performed with a third-party provider,
5068/// the authentication details to use for this payment.
5069#[derive(Clone, Debug, serde::Serialize)]
5070pub struct CreatePaymentIntentPaymentMethodOptionsCardThreeDSecure {
5071    /// The `transStatus` returned from the card Issuer’s ACS in the ARes.
5072    #[serde(skip_serializing_if = "Option::is_none")]
5073    pub ares_trans_status:
5074        Option<CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
5075    /// The cryptogram, also known as the "authentication value" (AAV, CAVV or
5076    /// AEVV). This value is 20 bytes, base64-encoded into a 28-character string.
5077    /// (Most 3D Secure providers will return the base64-encoded version, which
5078    /// is what you should specify here.)
5079    pub cryptogram: String,
5080    /// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
5081    /// provider and indicates what degree of authentication was performed.
5082    #[serde(skip_serializing_if = "Option::is_none")]
5083    pub electronic_commerce_indicator:
5084        Option<CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
5085    /// The exemption requested via 3DS and accepted by the issuer at authentication time.
5086    #[serde(skip_serializing_if = "Option::is_none")]
5087    pub exemption_indicator:
5088        Option<CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator>,
5089    /// Network specific 3DS fields. Network specific arguments require an
5090    /// explicit card brand choice. The parameter `payment_method_options.card.network``
5091    /// must be populated accordingly
5092    #[serde(skip_serializing_if = "Option::is_none")]
5093    pub network_options:
5094        Option<CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
5095    /// The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the
5096    /// AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99.
5097    #[serde(skip_serializing_if = "Option::is_none")]
5098    pub requestor_challenge_indicator: Option<String>,
5099    /// For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server
5100    /// Transaction ID (dsTransID).
5101    pub transaction_id: String,
5102    /// The version of 3D Secure that was performed.
5103    pub version: CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion,
5104}
5105impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecure {
5106    pub fn new(
5107        cryptogram: impl Into<String>,
5108        transaction_id: impl Into<String>,
5109        version: impl Into<CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion>,
5110    ) -> Self {
5111        Self {
5112            ares_trans_status: None,
5113            cryptogram: cryptogram.into(),
5114            electronic_commerce_indicator: None,
5115            exemption_indicator: None,
5116            network_options: None,
5117            requestor_challenge_indicator: None,
5118            transaction_id: transaction_id.into(),
5119            version: version.into(),
5120        }
5121    }
5122}
5123/// The `transStatus` returned from the card Issuer’s ACS in the ARes.
5124#[derive(Copy, Clone, Eq, PartialEq)]
5125pub enum CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
5126    A,
5127    C,
5128    I,
5129    N,
5130    R,
5131    U,
5132    Y,
5133}
5134impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
5135    pub fn as_str(self) -> &'static str {
5136        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
5137        match self {
5138            A => "A",
5139            C => "C",
5140            I => "I",
5141            N => "N",
5142            R => "R",
5143            U => "U",
5144            Y => "Y",
5145        }
5146    }
5147}
5148
5149impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
5150    type Err = stripe_types::StripeParseError;
5151    fn from_str(s: &str) -> Result<Self, Self::Err> {
5152        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
5153        match s {
5154            "A" => Ok(A),
5155            "C" => Ok(C),
5156            "I" => Ok(I),
5157            "N" => Ok(N),
5158            "R" => Ok(R),
5159            "U" => Ok(U),
5160            "Y" => Ok(Y),
5161            _ => Err(stripe_types::StripeParseError),
5162        }
5163    }
5164}
5165impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
5166    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5167        f.write_str(self.as_str())
5168    }
5169}
5170
5171impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
5172    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5173        f.write_str(self.as_str())
5174    }
5175}
5176impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
5177    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5178    where
5179        S: serde::Serializer,
5180    {
5181        serializer.serialize_str(self.as_str())
5182    }
5183}
5184#[cfg(feature = "deserialize")]
5185impl<'de> serde::Deserialize<'de>
5186    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
5187{
5188    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5189        use std::str::FromStr;
5190        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5191        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"))
5192    }
5193}
5194/// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
5195/// provider and indicates what degree of authentication was performed.
5196#[derive(Copy, Clone, Eq, PartialEq)]
5197pub enum CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
5198    V01,
5199    V02,
5200    V05,
5201    V06,
5202    V07,
5203}
5204impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
5205    pub fn as_str(self) -> &'static str {
5206        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
5207        match self {
5208            V01 => "01",
5209            V02 => "02",
5210            V05 => "05",
5211            V06 => "06",
5212            V07 => "07",
5213        }
5214    }
5215}
5216
5217impl std::str::FromStr
5218    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
5219{
5220    type Err = stripe_types::StripeParseError;
5221    fn from_str(s: &str) -> Result<Self, Self::Err> {
5222        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
5223        match s {
5224            "01" => Ok(V01),
5225            "02" => Ok(V02),
5226            "05" => Ok(V05),
5227            "06" => Ok(V06),
5228            "07" => Ok(V07),
5229            _ => Err(stripe_types::StripeParseError),
5230        }
5231    }
5232}
5233impl std::fmt::Display
5234    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
5235{
5236    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5237        f.write_str(self.as_str())
5238    }
5239}
5240
5241impl std::fmt::Debug
5242    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
5243{
5244    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5245        f.write_str(self.as_str())
5246    }
5247}
5248impl serde::Serialize
5249    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
5250{
5251    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5252    where
5253        S: serde::Serializer,
5254    {
5255        serializer.serialize_str(self.as_str())
5256    }
5257}
5258#[cfg(feature = "deserialize")]
5259impl<'de> serde::Deserialize<'de>
5260    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
5261{
5262    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5263        use std::str::FromStr;
5264        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5265        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"))
5266    }
5267}
5268/// The exemption requested via 3DS and accepted by the issuer at authentication time.
5269#[derive(Copy, Clone, Eq, PartialEq)]
5270pub enum CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator {
5271    LowRisk,
5272    None,
5273}
5274impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator {
5275    pub fn as_str(self) -> &'static str {
5276        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::*;
5277        match self {
5278            LowRisk => "low_risk",
5279            None => "none",
5280        }
5281    }
5282}
5283
5284impl std::str::FromStr
5285    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
5286{
5287    type Err = stripe_types::StripeParseError;
5288    fn from_str(s: &str) -> Result<Self, Self::Err> {
5289        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::*;
5290        match s {
5291            "low_risk" => Ok(LowRisk),
5292            "none" => Ok(None),
5293            _ => Err(stripe_types::StripeParseError),
5294        }
5295    }
5296}
5297impl std::fmt::Display
5298    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
5299{
5300    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5301        f.write_str(self.as_str())
5302    }
5303}
5304
5305impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator {
5306    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5307        f.write_str(self.as_str())
5308    }
5309}
5310impl serde::Serialize
5311    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
5312{
5313    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5314    where
5315        S: serde::Serializer,
5316    {
5317        serializer.serialize_str(self.as_str())
5318    }
5319}
5320#[cfg(feature = "deserialize")]
5321impl<'de> serde::Deserialize<'de>
5322    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
5323{
5324    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5325        use std::str::FromStr;
5326        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5327        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator"))
5328    }
5329}
5330/// Network specific 3DS fields. Network specific arguments require an
5331/// explicit card brand choice. The parameter `payment_method_options.card.network``
5332/// must be populated accordingly
5333#[derive(Clone, Debug, serde::Serialize)]
5334pub struct CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
5335    /// Cartes Bancaires-specific 3DS fields.
5336    #[serde(skip_serializing_if = "Option::is_none")]
5337    pub cartes_bancaires: Option<
5338        CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires,
5339    >,
5340}
5341impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
5342    pub fn new() -> Self {
5343        Self { cartes_bancaires: None }
5344    }
5345}
5346impl Default for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
5347    fn default() -> Self {
5348        Self::new()
5349    }
5350}
5351/// Cartes Bancaires-specific 3DS fields.
5352#[derive(Clone, Debug, serde::Serialize)]
5353pub struct CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
5354    /// The cryptogram calculation algorithm used by the card Issuer's ACS
5355    /// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
5356    /// messageExtension: CB-AVALGO
5357pub cb_avalgo: CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
5358    /// The exemption indicator returned from Cartes Bancaires in the ARes.
5359    /// message extension: CB-EXEMPTION; string (4 characters)
5360    /// This is a 3 byte bitmap (low significant byte first and most significant
5361    /// bit first) that has been Base64 encoded
5362#[serde(skip_serializing_if = "Option::is_none")]
5363pub cb_exemption: Option<String>,
5364    /// The risk score returned from Cartes Bancaires in the ARes.
5365    /// message extension: CB-SCORE; numeric value 0-99
5366#[serde(skip_serializing_if = "Option::is_none")]
5367pub cb_score: Option<i64>,
5368
5369}
5370impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
5371    pub fn new(
5372        cb_avalgo: impl Into<CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
5373    ) -> Self {
5374        Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
5375    }
5376}
5377/// The cryptogram calculation algorithm used by the card Issuer's ACS
5378/// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
5379/// messageExtension: CB-AVALGO
5380#[derive(Copy, Clone, Eq, PartialEq)]
5381pub enum CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
5382{
5383    V0,
5384    V1,
5385    V2,
5386    V3,
5387    V4,
5388    A,
5389}
5390impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
5391    pub fn as_str(self) -> &'static str {
5392        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
5393        match self {
5394            V0 => "0",
5395            V1 => "1",
5396            V2 => "2",
5397            V3 => "3",
5398            V4 => "4",
5399            A => "A",
5400        }
5401    }
5402}
5403
5404impl std::str::FromStr
5405    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
5406{
5407    type Err = stripe_types::StripeParseError;
5408    fn from_str(s: &str) -> Result<Self, Self::Err> {
5409        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
5410        match s {
5411            "0" => Ok(V0),
5412            "1" => Ok(V1),
5413            "2" => Ok(V2),
5414            "3" => Ok(V3),
5415            "4" => Ok(V4),
5416            "A" => Ok(A),
5417            _ => Err(stripe_types::StripeParseError),
5418        }
5419    }
5420}
5421impl std::fmt::Display
5422    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
5423{
5424    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5425        f.write_str(self.as_str())
5426    }
5427}
5428
5429impl std::fmt::Debug
5430    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
5431{
5432    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5433        f.write_str(self.as_str())
5434    }
5435}
5436impl serde::Serialize
5437    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
5438{
5439    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5440    where
5441        S: serde::Serializer,
5442    {
5443        serializer.serialize_str(self.as_str())
5444    }
5445}
5446#[cfg(feature = "deserialize")]
5447impl<'de> serde::Deserialize<'de>
5448    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
5449{
5450    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5451        use std::str::FromStr;
5452        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5453        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"))
5454    }
5455}
5456/// The version of 3D Secure that was performed.
5457#[derive(Copy, Clone, Eq, PartialEq)]
5458pub enum CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
5459    V1_0_2,
5460    V2_1_0,
5461    V2_2_0,
5462}
5463impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
5464    pub fn as_str(self) -> &'static str {
5465        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
5466        match self {
5467            V1_0_2 => "1.0.2",
5468            V2_1_0 => "2.1.0",
5469            V2_2_0 => "2.2.0",
5470        }
5471    }
5472}
5473
5474impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
5475    type Err = stripe_types::StripeParseError;
5476    fn from_str(s: &str) -> Result<Self, Self::Err> {
5477        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
5478        match s {
5479            "1.0.2" => Ok(V1_0_2),
5480            "2.1.0" => Ok(V2_1_0),
5481            "2.2.0" => Ok(V2_2_0),
5482            _ => Err(stripe_types::StripeParseError),
5483        }
5484    }
5485}
5486impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
5487    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5488        f.write_str(self.as_str())
5489    }
5490}
5491
5492impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
5493    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5494        f.write_str(self.as_str())
5495    }
5496}
5497impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
5498    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5499    where
5500        S: serde::Serializer,
5501    {
5502        serializer.serialize_str(self.as_str())
5503    }
5504}
5505#[cfg(feature = "deserialize")]
5506impl<'de> serde::Deserialize<'de>
5507    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion
5508{
5509    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5510        use std::str::FromStr;
5511        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5512        Self::from_str(&s).map_err(|_| {
5513            serde::de::Error::custom(
5514                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion",
5515            )
5516        })
5517    }
5518}
5519/// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
5520#[derive(Copy, Clone, Debug, serde::Serialize)]
5521pub struct CreatePaymentIntentPaymentMethodOptionsCardPresent {
5522    /// Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity).
5523    #[serde(skip_serializing_if = "Option::is_none")]
5524    pub request_extended_authorization: Option<bool>,
5525    /// Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible.
5526    /// Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support.
5527    #[serde(skip_serializing_if = "Option::is_none")]
5528    pub request_incremental_authorization_support: Option<bool>,
5529    /// Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes.
5530    #[serde(skip_serializing_if = "Option::is_none")]
5531    pub routing: Option<CreatePaymentIntentPaymentMethodOptionsCardPresentRouting>,
5532}
5533impl CreatePaymentIntentPaymentMethodOptionsCardPresent {
5534    pub fn new() -> Self {
5535        Self {
5536            request_extended_authorization: None,
5537            request_incremental_authorization_support: None,
5538            routing: None,
5539        }
5540    }
5541}
5542impl Default for CreatePaymentIntentPaymentMethodOptionsCardPresent {
5543    fn default() -> Self {
5544        Self::new()
5545    }
5546}
5547/// Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes.
5548#[derive(Copy, Clone, Debug, serde::Serialize)]
5549pub struct CreatePaymentIntentPaymentMethodOptionsCardPresentRouting {
5550    /// Routing requested priority
5551    #[serde(skip_serializing_if = "Option::is_none")]
5552    pub requested_priority:
5553        Option<CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority>,
5554}
5555impl CreatePaymentIntentPaymentMethodOptionsCardPresentRouting {
5556    pub fn new() -> Self {
5557        Self { requested_priority: None }
5558    }
5559}
5560impl Default for CreatePaymentIntentPaymentMethodOptionsCardPresentRouting {
5561    fn default() -> Self {
5562        Self::new()
5563    }
5564}
5565/// Routing requested priority
5566#[derive(Copy, Clone, Eq, PartialEq)]
5567pub enum CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority {
5568    Domestic,
5569    International,
5570}
5571impl CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority {
5572    pub fn as_str(self) -> &'static str {
5573        use CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority::*;
5574        match self {
5575            Domestic => "domestic",
5576            International => "international",
5577        }
5578    }
5579}
5580
5581impl std::str::FromStr
5582    for CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
5583{
5584    type Err = stripe_types::StripeParseError;
5585    fn from_str(s: &str) -> Result<Self, Self::Err> {
5586        use CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority::*;
5587        match s {
5588            "domestic" => Ok(Domestic),
5589            "international" => Ok(International),
5590            _ => Err(stripe_types::StripeParseError),
5591        }
5592    }
5593}
5594impl std::fmt::Display
5595    for CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
5596{
5597    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5598        f.write_str(self.as_str())
5599    }
5600}
5601
5602impl std::fmt::Debug
5603    for CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
5604{
5605    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5606        f.write_str(self.as_str())
5607    }
5608}
5609impl serde::Serialize
5610    for CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
5611{
5612    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5613    where
5614        S: serde::Serializer,
5615    {
5616        serializer.serialize_str(self.as_str())
5617    }
5618}
5619#[cfg(feature = "deserialize")]
5620impl<'de> serde::Deserialize<'de>
5621    for CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
5622{
5623    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5624        use std::str::FromStr;
5625        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5626        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority"))
5627    }
5628}
5629/// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options.
5630#[derive(Copy, Clone, Debug, serde::Serialize)]
5631pub struct CreatePaymentIntentPaymentMethodOptionsCashapp {
5632    /// Controls when the funds are captured from the customer's account.
5633    ///
5634    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
5635    ///
5636    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
5637    #[serde(skip_serializing_if = "Option::is_none")]
5638    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod>,
5639    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
5640    ///
5641    /// 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.
5642    /// 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.
5643    ///
5644    /// 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.
5645    ///
5646    /// 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).
5647    ///
5648    /// 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`.
5649    #[serde(skip_serializing_if = "Option::is_none")]
5650    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage>,
5651}
5652impl CreatePaymentIntentPaymentMethodOptionsCashapp {
5653    pub fn new() -> Self {
5654        Self { capture_method: None, setup_future_usage: None }
5655    }
5656}
5657impl Default for CreatePaymentIntentPaymentMethodOptionsCashapp {
5658    fn default() -> Self {
5659        Self::new()
5660    }
5661}
5662/// Controls when the funds are captured from the customer's account.
5663///
5664/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
5665///
5666/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
5667#[derive(Copy, Clone, Eq, PartialEq)]
5668pub enum CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
5669    Manual,
5670}
5671impl CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
5672    pub fn as_str(self) -> &'static str {
5673        use CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod::*;
5674        match self {
5675            Manual => "manual",
5676        }
5677    }
5678}
5679
5680impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
5681    type Err = stripe_types::StripeParseError;
5682    fn from_str(s: &str) -> Result<Self, Self::Err> {
5683        use CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod::*;
5684        match s {
5685            "manual" => Ok(Manual),
5686            _ => Err(stripe_types::StripeParseError),
5687        }
5688    }
5689}
5690impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
5691    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5692        f.write_str(self.as_str())
5693    }
5694}
5695
5696impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
5697    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5698        f.write_str(self.as_str())
5699    }
5700}
5701impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
5702    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5703    where
5704        S: serde::Serializer,
5705    {
5706        serializer.serialize_str(self.as_str())
5707    }
5708}
5709#[cfg(feature = "deserialize")]
5710impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
5711    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5712        use std::str::FromStr;
5713        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5714        Self::from_str(&s).map_err(|_| {
5715            serde::de::Error::custom(
5716                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod",
5717            )
5718        })
5719    }
5720}
5721/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
5722///
5723/// 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.
5724/// 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.
5725///
5726/// 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.
5727///
5728/// 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).
5729///
5730/// 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`.
5731#[derive(Copy, Clone, Eq, PartialEq)]
5732pub enum CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
5733    None,
5734    OffSession,
5735    OnSession,
5736}
5737impl CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
5738    pub fn as_str(self) -> &'static str {
5739        use CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*;
5740        match self {
5741            None => "none",
5742            OffSession => "off_session",
5743            OnSession => "on_session",
5744        }
5745    }
5746}
5747
5748impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
5749    type Err = stripe_types::StripeParseError;
5750    fn from_str(s: &str) -> Result<Self, Self::Err> {
5751        use CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*;
5752        match s {
5753            "none" => Ok(None),
5754            "off_session" => Ok(OffSession),
5755            "on_session" => Ok(OnSession),
5756            _ => Err(stripe_types::StripeParseError),
5757        }
5758    }
5759}
5760impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
5761    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5762        f.write_str(self.as_str())
5763    }
5764}
5765
5766impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
5767    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5768        f.write_str(self.as_str())
5769    }
5770}
5771impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
5772    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5773    where
5774        S: serde::Serializer,
5775    {
5776        serializer.serialize_str(self.as_str())
5777    }
5778}
5779#[cfg(feature = "deserialize")]
5780impl<'de> serde::Deserialize<'de>
5781    for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage
5782{
5783    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5784        use std::str::FromStr;
5785        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5786        Self::from_str(&s).map_err(|_| {
5787            serde::de::Error::custom(
5788                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage",
5789            )
5790        })
5791    }
5792}
5793/// If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options.
5794#[derive(Copy, Clone, Debug, serde::Serialize)]
5795pub struct CreatePaymentIntentPaymentMethodOptionsCrypto {
5796    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
5797    ///
5798    /// 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.
5799    /// 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.
5800    ///
5801    /// 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.
5802    ///
5803    /// 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).
5804    ///
5805    /// 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`.
5806    #[serde(skip_serializing_if = "Option::is_none")]
5807    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage>,
5808}
5809impl CreatePaymentIntentPaymentMethodOptionsCrypto {
5810    pub fn new() -> Self {
5811        Self { setup_future_usage: None }
5812    }
5813}
5814impl Default for CreatePaymentIntentPaymentMethodOptionsCrypto {
5815    fn default() -> Self {
5816        Self::new()
5817    }
5818}
5819/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
5820///
5821/// 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.
5822/// 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.
5823///
5824/// 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.
5825///
5826/// 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).
5827///
5828/// 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`.
5829#[derive(Copy, Clone, Eq, PartialEq)]
5830pub enum CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
5831    None,
5832}
5833impl CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
5834    pub fn as_str(self) -> &'static str {
5835        use CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage::*;
5836        match self {
5837            None => "none",
5838        }
5839    }
5840}
5841
5842impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
5843    type Err = stripe_types::StripeParseError;
5844    fn from_str(s: &str) -> Result<Self, Self::Err> {
5845        use CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage::*;
5846        match s {
5847            "none" => Ok(None),
5848            _ => Err(stripe_types::StripeParseError),
5849        }
5850    }
5851}
5852impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
5853    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5854        f.write_str(self.as_str())
5855    }
5856}
5857
5858impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
5859    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5860        f.write_str(self.as_str())
5861    }
5862}
5863impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
5864    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5865    where
5866        S: serde::Serializer,
5867    {
5868        serializer.serialize_str(self.as_str())
5869    }
5870}
5871#[cfg(feature = "deserialize")]
5872impl<'de> serde::Deserialize<'de>
5873    for CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage
5874{
5875    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5876        use std::str::FromStr;
5877        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5878        Self::from_str(&s).map_err(|_| {
5879            serde::de::Error::custom(
5880                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage",
5881            )
5882        })
5883    }
5884}
5885/// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options.
5886#[derive(Clone, Debug, serde::Serialize)]
5887pub struct CreatePaymentIntentPaymentMethodOptionsCustomerBalance {
5888    /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
5889    #[serde(skip_serializing_if = "Option::is_none")]
5890    pub bank_transfer: Option<CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer>,
5891    /// The funding method type to be used when there are not enough funds in the customer balance.
5892    /// Permitted values include: `bank_transfer`.
5893    #[serde(skip_serializing_if = "Option::is_none")]
5894    pub funding_type: Option<CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType>,
5895    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
5896    ///
5897    /// 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.
5898    /// 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.
5899    ///
5900    /// 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.
5901    ///
5902    /// 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).
5903    ///
5904    /// 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`.
5905    #[serde(skip_serializing_if = "Option::is_none")]
5906    pub setup_future_usage:
5907        Option<CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage>,
5908}
5909impl CreatePaymentIntentPaymentMethodOptionsCustomerBalance {
5910    pub fn new() -> Self {
5911        Self { bank_transfer: None, funding_type: None, setup_future_usage: None }
5912    }
5913}
5914impl Default for CreatePaymentIntentPaymentMethodOptionsCustomerBalance {
5915    fn default() -> Self {
5916        Self::new()
5917    }
5918}
5919/// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
5920#[derive(Clone, Debug, serde::Serialize)]
5921pub struct CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer {
5922    /// Configuration for the eu_bank_transfer funding type.
5923    #[serde(skip_serializing_if = "Option::is_none")]
5924    pub eu_bank_transfer: Option<EuBankTransferParams>,
5925    /// List of address types that should be returned in the financial_addresses response.
5926    /// If not specified, all valid types will be returned.
5927    ///
5928    /// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`.
5929    #[serde(skip_serializing_if = "Option::is_none")]
5930    pub requested_address_types: Option<
5931        Vec<
5932            CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes,
5933        >,
5934    >,
5935    /// The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`.
5936    #[serde(rename = "type")]
5937    pub type_: CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType,
5938}
5939impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer {
5940    pub fn new(
5941        type_: impl Into<CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType>,
5942    ) -> Self {
5943        Self { eu_bank_transfer: None, requested_address_types: None, type_: type_.into() }
5944    }
5945}
5946/// List of address types that should be returned in the financial_addresses response.
5947/// If not specified, all valid types will be returned.
5948///
5949/// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`.
5950#[derive(Copy, Clone, Eq, PartialEq)]
5951pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
5952    Aba,
5953    Iban,
5954    Sepa,
5955    SortCode,
5956    Spei,
5957    Swift,
5958    Zengin,
5959}
5960impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
5961    pub fn as_str(self) -> &'static str {
5962        use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*;
5963        match self {
5964            Aba => "aba",
5965            Iban => "iban",
5966            Sepa => "sepa",
5967            SortCode => "sort_code",
5968            Spei => "spei",
5969            Swift => "swift",
5970            Zengin => "zengin",
5971        }
5972    }
5973}
5974
5975impl std::str::FromStr
5976    for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
5977{
5978    type Err = stripe_types::StripeParseError;
5979    fn from_str(s: &str) -> Result<Self, Self::Err> {
5980        use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*;
5981        match s {
5982            "aba" => Ok(Aba),
5983            "iban" => Ok(Iban),
5984            "sepa" => Ok(Sepa),
5985            "sort_code" => Ok(SortCode),
5986            "spei" => Ok(Spei),
5987            "swift" => Ok(Swift),
5988            "zengin" => Ok(Zengin),
5989            _ => Err(stripe_types::StripeParseError),
5990        }
5991    }
5992}
5993impl std::fmt::Display
5994    for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
5995{
5996    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5997        f.write_str(self.as_str())
5998    }
5999}
6000
6001impl std::fmt::Debug
6002    for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
6003{
6004    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6005        f.write_str(self.as_str())
6006    }
6007}
6008impl serde::Serialize
6009    for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
6010{
6011    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6012    where
6013        S: serde::Serializer,
6014    {
6015        serializer.serialize_str(self.as_str())
6016    }
6017}
6018#[cfg(feature = "deserialize")]
6019impl<'de> serde::Deserialize<'de>
6020    for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
6021{
6022    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6023        use std::str::FromStr;
6024        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6025        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes"))
6026    }
6027}
6028/// The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`.
6029#[derive(Copy, Clone, Eq, PartialEq)]
6030pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
6031    EuBankTransfer,
6032    GbBankTransfer,
6033    JpBankTransfer,
6034    MxBankTransfer,
6035    UsBankTransfer,
6036}
6037impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
6038    pub fn as_str(self) -> &'static str {
6039        use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*;
6040        match self {
6041            EuBankTransfer => "eu_bank_transfer",
6042            GbBankTransfer => "gb_bank_transfer",
6043            JpBankTransfer => "jp_bank_transfer",
6044            MxBankTransfer => "mx_bank_transfer",
6045            UsBankTransfer => "us_bank_transfer",
6046        }
6047    }
6048}
6049
6050impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
6051    type Err = stripe_types::StripeParseError;
6052    fn from_str(s: &str) -> Result<Self, Self::Err> {
6053        use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*;
6054        match s {
6055            "eu_bank_transfer" => Ok(EuBankTransfer),
6056            "gb_bank_transfer" => Ok(GbBankTransfer),
6057            "jp_bank_transfer" => Ok(JpBankTransfer),
6058            "mx_bank_transfer" => Ok(MxBankTransfer),
6059            "us_bank_transfer" => Ok(UsBankTransfer),
6060            _ => Err(stripe_types::StripeParseError),
6061        }
6062    }
6063}
6064impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
6065    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6066        f.write_str(self.as_str())
6067    }
6068}
6069
6070impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
6071    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6072        f.write_str(self.as_str())
6073    }
6074}
6075impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
6076    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6077    where
6078        S: serde::Serializer,
6079    {
6080        serializer.serialize_str(self.as_str())
6081    }
6082}
6083#[cfg(feature = "deserialize")]
6084impl<'de> serde::Deserialize<'de>
6085    for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType
6086{
6087    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6088        use std::str::FromStr;
6089        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6090        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType"))
6091    }
6092}
6093/// The funding method type to be used when there are not enough funds in the customer balance.
6094/// Permitted values include: `bank_transfer`.
6095#[derive(Copy, Clone, Eq, PartialEq)]
6096pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
6097    BankTransfer,
6098}
6099impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
6100    pub fn as_str(self) -> &'static str {
6101        use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*;
6102        match self {
6103            BankTransfer => "bank_transfer",
6104        }
6105    }
6106}
6107
6108impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
6109    type Err = stripe_types::StripeParseError;
6110    fn from_str(s: &str) -> Result<Self, Self::Err> {
6111        use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*;
6112        match s {
6113            "bank_transfer" => Ok(BankTransfer),
6114            _ => Err(stripe_types::StripeParseError),
6115        }
6116    }
6117}
6118impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
6119    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6120        f.write_str(self.as_str())
6121    }
6122}
6123
6124impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
6125    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6126        f.write_str(self.as_str())
6127    }
6128}
6129impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
6130    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6131    where
6132        S: serde::Serializer,
6133    {
6134        serializer.serialize_str(self.as_str())
6135    }
6136}
6137#[cfg(feature = "deserialize")]
6138impl<'de> serde::Deserialize<'de>
6139    for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType
6140{
6141    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6142        use std::str::FromStr;
6143        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6144        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType"))
6145    }
6146}
6147/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6148///
6149/// 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.
6150/// 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.
6151///
6152/// 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.
6153///
6154/// 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).
6155///
6156/// 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`.
6157#[derive(Copy, Clone, Eq, PartialEq)]
6158pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
6159    None,
6160}
6161impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
6162    pub fn as_str(self) -> &'static str {
6163        use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*;
6164        match self {
6165            None => "none",
6166        }
6167    }
6168}
6169
6170impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
6171    type Err = stripe_types::StripeParseError;
6172    fn from_str(s: &str) -> Result<Self, Self::Err> {
6173        use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*;
6174        match s {
6175            "none" => Ok(None),
6176            _ => Err(stripe_types::StripeParseError),
6177        }
6178    }
6179}
6180impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
6181    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6182        f.write_str(self.as_str())
6183    }
6184}
6185
6186impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
6187    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6188        f.write_str(self.as_str())
6189    }
6190}
6191impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
6192    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6193    where
6194        S: serde::Serializer,
6195    {
6196        serializer.serialize_str(self.as_str())
6197    }
6198}
6199#[cfg(feature = "deserialize")]
6200impl<'de> serde::Deserialize<'de>
6201    for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage
6202{
6203    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6204        use std::str::FromStr;
6205        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6206        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage"))
6207    }
6208}
6209/// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
6210#[derive(Copy, Clone, Debug, serde::Serialize)]
6211pub struct CreatePaymentIntentPaymentMethodOptionsEps {
6212    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6213    ///
6214    /// 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.
6215    /// 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.
6216    ///
6217    /// 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.
6218    ///
6219    /// 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).
6220    ///
6221    /// 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`.
6222    #[serde(skip_serializing_if = "Option::is_none")]
6223    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage>,
6224}
6225impl CreatePaymentIntentPaymentMethodOptionsEps {
6226    pub fn new() -> Self {
6227        Self { setup_future_usage: None }
6228    }
6229}
6230impl Default for CreatePaymentIntentPaymentMethodOptionsEps {
6231    fn default() -> Self {
6232        Self::new()
6233    }
6234}
6235/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6236///
6237/// 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.
6238/// 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.
6239///
6240/// 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.
6241///
6242/// 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).
6243///
6244/// 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`.
6245#[derive(Copy, Clone, Eq, PartialEq)]
6246pub enum CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
6247    None,
6248}
6249impl CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
6250    pub fn as_str(self) -> &'static str {
6251        use CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*;
6252        match self {
6253            None => "none",
6254        }
6255    }
6256}
6257
6258impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
6259    type Err = stripe_types::StripeParseError;
6260    fn from_str(s: &str) -> Result<Self, Self::Err> {
6261        use CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*;
6262        match s {
6263            "none" => Ok(None),
6264            _ => Err(stripe_types::StripeParseError),
6265        }
6266    }
6267}
6268impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
6269    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6270        f.write_str(self.as_str())
6271    }
6272}
6273
6274impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
6275    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6276        f.write_str(self.as_str())
6277    }
6278}
6279impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
6280    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6281    where
6282        S: serde::Serializer,
6283    {
6284        serializer.serialize_str(self.as_str())
6285    }
6286}
6287#[cfg(feature = "deserialize")]
6288impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
6289    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6290        use std::str::FromStr;
6291        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6292        Self::from_str(&s).map_err(|_| {
6293            serde::de::Error::custom(
6294                "Unknown value for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage",
6295            )
6296        })
6297    }
6298}
6299/// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options.
6300#[derive(Copy, Clone, Debug, serde::Serialize)]
6301pub struct CreatePaymentIntentPaymentMethodOptionsFpx {
6302    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6303    ///
6304    /// 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.
6305    /// 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.
6306    ///
6307    /// 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.
6308    ///
6309    /// 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).
6310    ///
6311    /// 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`.
6312    #[serde(skip_serializing_if = "Option::is_none")]
6313    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage>,
6314}
6315impl CreatePaymentIntentPaymentMethodOptionsFpx {
6316    pub fn new() -> Self {
6317        Self { setup_future_usage: None }
6318    }
6319}
6320impl Default for CreatePaymentIntentPaymentMethodOptionsFpx {
6321    fn default() -> Self {
6322        Self::new()
6323    }
6324}
6325/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6326///
6327/// 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.
6328/// 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.
6329///
6330/// 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.
6331///
6332/// 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).
6333///
6334/// 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`.
6335#[derive(Copy, Clone, Eq, PartialEq)]
6336pub enum CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
6337    None,
6338}
6339impl CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
6340    pub fn as_str(self) -> &'static str {
6341        use CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*;
6342        match self {
6343            None => "none",
6344        }
6345    }
6346}
6347
6348impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
6349    type Err = stripe_types::StripeParseError;
6350    fn from_str(s: &str) -> Result<Self, Self::Err> {
6351        use CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*;
6352        match s {
6353            "none" => Ok(None),
6354            _ => Err(stripe_types::StripeParseError),
6355        }
6356    }
6357}
6358impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
6359    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6360        f.write_str(self.as_str())
6361    }
6362}
6363
6364impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
6365    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6366        f.write_str(self.as_str())
6367    }
6368}
6369impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
6370    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6371    where
6372        S: serde::Serializer,
6373    {
6374        serializer.serialize_str(self.as_str())
6375    }
6376}
6377#[cfg(feature = "deserialize")]
6378impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
6379    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6380        use std::str::FromStr;
6381        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6382        Self::from_str(&s).map_err(|_| {
6383            serde::de::Error::custom(
6384                "Unknown value for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage",
6385            )
6386        })
6387    }
6388}
6389/// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options.
6390#[derive(Copy, Clone, Debug, serde::Serialize)]
6391pub struct CreatePaymentIntentPaymentMethodOptionsGiropay {
6392    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6393    ///
6394    /// 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.
6395    /// 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.
6396    ///
6397    /// 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.
6398    ///
6399    /// 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).
6400    ///
6401    /// 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`.
6402    #[serde(skip_serializing_if = "Option::is_none")]
6403    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage>,
6404}
6405impl CreatePaymentIntentPaymentMethodOptionsGiropay {
6406    pub fn new() -> Self {
6407        Self { setup_future_usage: None }
6408    }
6409}
6410impl Default for CreatePaymentIntentPaymentMethodOptionsGiropay {
6411    fn default() -> Self {
6412        Self::new()
6413    }
6414}
6415/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6416///
6417/// 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.
6418/// 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.
6419///
6420/// 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.
6421///
6422/// 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).
6423///
6424/// 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`.
6425#[derive(Copy, Clone, Eq, PartialEq)]
6426pub enum CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
6427    None,
6428}
6429impl CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
6430    pub fn as_str(self) -> &'static str {
6431        use CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*;
6432        match self {
6433            None => "none",
6434        }
6435    }
6436}
6437
6438impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
6439    type Err = stripe_types::StripeParseError;
6440    fn from_str(s: &str) -> Result<Self, Self::Err> {
6441        use CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*;
6442        match s {
6443            "none" => Ok(None),
6444            _ => Err(stripe_types::StripeParseError),
6445        }
6446    }
6447}
6448impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
6449    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6450        f.write_str(self.as_str())
6451    }
6452}
6453
6454impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
6455    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6456        f.write_str(self.as_str())
6457    }
6458}
6459impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
6460    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6461    where
6462        S: serde::Serializer,
6463    {
6464        serializer.serialize_str(self.as_str())
6465    }
6466}
6467#[cfg(feature = "deserialize")]
6468impl<'de> serde::Deserialize<'de>
6469    for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage
6470{
6471    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6472        use std::str::FromStr;
6473        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6474        Self::from_str(&s).map_err(|_| {
6475            serde::de::Error::custom(
6476                "Unknown value for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage",
6477            )
6478        })
6479    }
6480}
6481/// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options.
6482#[derive(Copy, Clone, Debug, serde::Serialize)]
6483pub struct CreatePaymentIntentPaymentMethodOptionsGrabpay {
6484    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6485    ///
6486    /// 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.
6487    /// 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.
6488    ///
6489    /// 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.
6490    ///
6491    /// 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).
6492    ///
6493    /// 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`.
6494    #[serde(skip_serializing_if = "Option::is_none")]
6495    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage>,
6496}
6497impl CreatePaymentIntentPaymentMethodOptionsGrabpay {
6498    pub fn new() -> Self {
6499        Self { setup_future_usage: None }
6500    }
6501}
6502impl Default for CreatePaymentIntentPaymentMethodOptionsGrabpay {
6503    fn default() -> Self {
6504        Self::new()
6505    }
6506}
6507/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6508///
6509/// 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.
6510/// 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.
6511///
6512/// 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.
6513///
6514/// 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).
6515///
6516/// 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`.
6517#[derive(Copy, Clone, Eq, PartialEq)]
6518pub enum CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
6519    None,
6520}
6521impl CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
6522    pub fn as_str(self) -> &'static str {
6523        use CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*;
6524        match self {
6525            None => "none",
6526        }
6527    }
6528}
6529
6530impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
6531    type Err = stripe_types::StripeParseError;
6532    fn from_str(s: &str) -> Result<Self, Self::Err> {
6533        use CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*;
6534        match s {
6535            "none" => Ok(None),
6536            _ => Err(stripe_types::StripeParseError),
6537        }
6538    }
6539}
6540impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
6541    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6542        f.write_str(self.as_str())
6543    }
6544}
6545
6546impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
6547    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6548        f.write_str(self.as_str())
6549    }
6550}
6551impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
6552    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6553    where
6554        S: serde::Serializer,
6555    {
6556        serializer.serialize_str(self.as_str())
6557    }
6558}
6559#[cfg(feature = "deserialize")]
6560impl<'de> serde::Deserialize<'de>
6561    for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage
6562{
6563    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6564        use std::str::FromStr;
6565        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6566        Self::from_str(&s).map_err(|_| {
6567            serde::de::Error::custom(
6568                "Unknown value for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage",
6569            )
6570        })
6571    }
6572}
6573/// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options.
6574#[derive(Copy, Clone, Debug, serde::Serialize)]
6575pub struct CreatePaymentIntentPaymentMethodOptionsIdeal {
6576    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6577    ///
6578    /// 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.
6579    /// 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.
6580    ///
6581    /// 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.
6582    ///
6583    /// 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).
6584    ///
6585    /// 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`.
6586    #[serde(skip_serializing_if = "Option::is_none")]
6587    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage>,
6588}
6589impl CreatePaymentIntentPaymentMethodOptionsIdeal {
6590    pub fn new() -> Self {
6591        Self { setup_future_usage: None }
6592    }
6593}
6594impl Default for CreatePaymentIntentPaymentMethodOptionsIdeal {
6595    fn default() -> Self {
6596        Self::new()
6597    }
6598}
6599/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6600///
6601/// 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.
6602/// 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.
6603///
6604/// 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.
6605///
6606/// 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).
6607///
6608/// 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`.
6609#[derive(Copy, Clone, Eq, PartialEq)]
6610pub enum CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
6611    None,
6612    OffSession,
6613}
6614impl CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
6615    pub fn as_str(self) -> &'static str {
6616        use CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*;
6617        match self {
6618            None => "none",
6619            OffSession => "off_session",
6620        }
6621    }
6622}
6623
6624impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
6625    type Err = stripe_types::StripeParseError;
6626    fn from_str(s: &str) -> Result<Self, Self::Err> {
6627        use CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*;
6628        match s {
6629            "none" => Ok(None),
6630            "off_session" => Ok(OffSession),
6631            _ => Err(stripe_types::StripeParseError),
6632        }
6633    }
6634}
6635impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
6636    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6637        f.write_str(self.as_str())
6638    }
6639}
6640
6641impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
6642    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6643        f.write_str(self.as_str())
6644    }
6645}
6646impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
6647    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6648    where
6649        S: serde::Serializer,
6650    {
6651        serializer.serialize_str(self.as_str())
6652    }
6653}
6654#[cfg(feature = "deserialize")]
6655impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
6656    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6657        use std::str::FromStr;
6658        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6659        Self::from_str(&s).map_err(|_| {
6660            serde::de::Error::custom(
6661                "Unknown value for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage",
6662            )
6663        })
6664    }
6665}
6666/// If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options.
6667#[derive(Copy, Clone, Debug, serde::Serialize)]
6668pub struct CreatePaymentIntentPaymentMethodOptionsKakaoPay {
6669    /// Controls when the funds are captured from the customer's account.
6670    ///
6671    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
6672    ///
6673    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
6674    #[serde(skip_serializing_if = "Option::is_none")]
6675    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod>,
6676    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6677    ///
6678    /// 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.
6679    /// 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.
6680    ///
6681    /// 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.
6682    ///
6683    /// 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).
6684    #[serde(skip_serializing_if = "Option::is_none")]
6685    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage>,
6686}
6687impl CreatePaymentIntentPaymentMethodOptionsKakaoPay {
6688    pub fn new() -> Self {
6689        Self { capture_method: None, setup_future_usage: None }
6690    }
6691}
6692impl Default for CreatePaymentIntentPaymentMethodOptionsKakaoPay {
6693    fn default() -> Self {
6694        Self::new()
6695    }
6696}
6697/// Controls when the funds are captured from the customer's account.
6698///
6699/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
6700///
6701/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
6702#[derive(Copy, Clone, Eq, PartialEq)]
6703pub enum CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
6704    Manual,
6705}
6706impl CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
6707    pub fn as_str(self) -> &'static str {
6708        use CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod::*;
6709        match self {
6710            Manual => "manual",
6711        }
6712    }
6713}
6714
6715impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
6716    type Err = stripe_types::StripeParseError;
6717    fn from_str(s: &str) -> Result<Self, Self::Err> {
6718        use CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod::*;
6719        match s {
6720            "manual" => Ok(Manual),
6721            _ => Err(stripe_types::StripeParseError),
6722        }
6723    }
6724}
6725impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
6726    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6727        f.write_str(self.as_str())
6728    }
6729}
6730
6731impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
6732    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6733        f.write_str(self.as_str())
6734    }
6735}
6736impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
6737    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6738    where
6739        S: serde::Serializer,
6740    {
6741        serializer.serialize_str(self.as_str())
6742    }
6743}
6744#[cfg(feature = "deserialize")]
6745impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
6746    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6747        use std::str::FromStr;
6748        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6749        Self::from_str(&s).map_err(|_| {
6750            serde::de::Error::custom(
6751                "Unknown value for CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod",
6752            )
6753        })
6754    }
6755}
6756/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6757///
6758/// 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.
6759/// 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.
6760///
6761/// 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.
6762///
6763/// 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).
6764#[derive(Copy, Clone, Eq, PartialEq)]
6765pub enum CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
6766    None,
6767    OffSession,
6768}
6769impl CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
6770    pub fn as_str(self) -> &'static str {
6771        use CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage::*;
6772        match self {
6773            None => "none",
6774            OffSession => "off_session",
6775        }
6776    }
6777}
6778
6779impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
6780    type Err = stripe_types::StripeParseError;
6781    fn from_str(s: &str) -> Result<Self, Self::Err> {
6782        use CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage::*;
6783        match s {
6784            "none" => Ok(None),
6785            "off_session" => Ok(OffSession),
6786            _ => Err(stripe_types::StripeParseError),
6787        }
6788    }
6789}
6790impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
6791    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6792        f.write_str(self.as_str())
6793    }
6794}
6795
6796impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
6797    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6798        f.write_str(self.as_str())
6799    }
6800}
6801impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
6802    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6803    where
6804        S: serde::Serializer,
6805    {
6806        serializer.serialize_str(self.as_str())
6807    }
6808}
6809#[cfg(feature = "deserialize")]
6810impl<'de> serde::Deserialize<'de>
6811    for CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage
6812{
6813    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6814        use std::str::FromStr;
6815        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6816        Self::from_str(&s).map_err(|_| {
6817            serde::de::Error::custom(
6818                "Unknown value for CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage",
6819            )
6820        })
6821    }
6822}
6823/// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options.
6824#[derive(Clone, Debug, serde::Serialize)]
6825pub struct CreatePaymentIntentPaymentMethodOptionsKlarna {
6826    /// Controls when the funds are captured from the customer's account.
6827    ///
6828    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
6829    ///
6830    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
6831    #[serde(skip_serializing_if = "Option::is_none")]
6832    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod>,
6833    /// On-demand details if setting up or charging an on-demand payment.
6834    #[serde(skip_serializing_if = "Option::is_none")]
6835    pub on_demand: Option<CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemand>,
6836    /// Preferred language of the Klarna authorization page that the customer is redirected to
6837    #[serde(skip_serializing_if = "Option::is_none")]
6838    pub preferred_locale: Option<CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale>,
6839    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6840    ///
6841    /// 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.
6842    /// 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.
6843    ///
6844    /// 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.
6845    ///
6846    /// 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).
6847    ///
6848    /// 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`.
6849    #[serde(skip_serializing_if = "Option::is_none")]
6850    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage>,
6851    /// Subscription details if setting up or charging a subscription.
6852    #[serde(skip_serializing_if = "Option::is_none")]
6853    pub subscriptions: Option<Vec<CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptions>>,
6854}
6855impl CreatePaymentIntentPaymentMethodOptionsKlarna {
6856    pub fn new() -> Self {
6857        Self {
6858            capture_method: None,
6859            on_demand: None,
6860            preferred_locale: None,
6861            setup_future_usage: None,
6862            subscriptions: None,
6863        }
6864    }
6865}
6866impl Default for CreatePaymentIntentPaymentMethodOptionsKlarna {
6867    fn default() -> Self {
6868        Self::new()
6869    }
6870}
6871/// Controls when the funds are captured from the customer's account.
6872///
6873/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
6874///
6875/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
6876#[derive(Copy, Clone, Eq, PartialEq)]
6877pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
6878    Manual,
6879}
6880impl CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
6881    pub fn as_str(self) -> &'static str {
6882        use CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*;
6883        match self {
6884            Manual => "manual",
6885        }
6886    }
6887}
6888
6889impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
6890    type Err = stripe_types::StripeParseError;
6891    fn from_str(s: &str) -> Result<Self, Self::Err> {
6892        use CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*;
6893        match s {
6894            "manual" => Ok(Manual),
6895            _ => Err(stripe_types::StripeParseError),
6896        }
6897    }
6898}
6899impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
6900    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6901        f.write_str(self.as_str())
6902    }
6903}
6904
6905impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
6906    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6907        f.write_str(self.as_str())
6908    }
6909}
6910impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
6911    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6912    where
6913        S: serde::Serializer,
6914    {
6915        serializer.serialize_str(self.as_str())
6916    }
6917}
6918#[cfg(feature = "deserialize")]
6919impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
6920    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6921        use std::str::FromStr;
6922        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6923        Self::from_str(&s).map_err(|_| {
6924            serde::de::Error::custom(
6925                "Unknown value for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod",
6926            )
6927        })
6928    }
6929}
6930/// On-demand details if setting up or charging an on-demand payment.
6931#[derive(Copy, Clone, Debug, serde::Serialize)]
6932pub struct CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemand {
6933    /// Your average amount value.
6934    /// You can use a value across your customer base, or segment based on customer type, country, etc.
6935    #[serde(skip_serializing_if = "Option::is_none")]
6936    pub average_amount: Option<i64>,
6937    /// The maximum value you may charge a customer per purchase.
6938    /// You can use a value across your customer base, or segment based on customer type, country, etc.
6939    #[serde(skip_serializing_if = "Option::is_none")]
6940    pub maximum_amount: Option<i64>,
6941    /// The lowest or minimum value you may charge a customer per purchase.
6942    /// You can use a value across your customer base, or segment based on customer type, country, etc.
6943    #[serde(skip_serializing_if = "Option::is_none")]
6944    pub minimum_amount: Option<i64>,
6945    /// Interval at which the customer is making purchases
6946    #[serde(skip_serializing_if = "Option::is_none")]
6947    pub purchase_interval:
6948        Option<CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
6949    /// The number of `purchase_interval` between charges
6950    #[serde(skip_serializing_if = "Option::is_none")]
6951    pub purchase_interval_count: Option<u64>,
6952}
6953impl CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemand {
6954    pub fn new() -> Self {
6955        Self {
6956            average_amount: None,
6957            maximum_amount: None,
6958            minimum_amount: None,
6959            purchase_interval: None,
6960            purchase_interval_count: None,
6961        }
6962    }
6963}
6964impl Default for CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemand {
6965    fn default() -> Self {
6966        Self::new()
6967    }
6968}
6969/// Interval at which the customer is making purchases
6970#[derive(Copy, Clone, Eq, PartialEq)]
6971pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
6972    Day,
6973    Month,
6974    Week,
6975    Year,
6976}
6977impl CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
6978    pub fn as_str(self) -> &'static str {
6979        use CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
6980        match self {
6981            Day => "day",
6982            Month => "month",
6983            Week => "week",
6984            Year => "year",
6985        }
6986    }
6987}
6988
6989impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
6990    type Err = stripe_types::StripeParseError;
6991    fn from_str(s: &str) -> Result<Self, Self::Err> {
6992        use CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
6993        match s {
6994            "day" => Ok(Day),
6995            "month" => Ok(Month),
6996            "week" => Ok(Week),
6997            "year" => Ok(Year),
6998            _ => Err(stripe_types::StripeParseError),
6999        }
7000    }
7001}
7002impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7003    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7004        f.write_str(self.as_str())
7005    }
7006}
7007
7008impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7009    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7010        f.write_str(self.as_str())
7011    }
7012}
7013impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7014    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7015    where
7016        S: serde::Serializer,
7017    {
7018        serializer.serialize_str(self.as_str())
7019    }
7020}
7021#[cfg(feature = "deserialize")]
7022impl<'de> serde::Deserialize<'de>
7023    for CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
7024{
7025    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7026        use std::str::FromStr;
7027        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7028        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"))
7029    }
7030}
7031/// Preferred language of the Klarna authorization page that the customer is redirected to
7032#[derive(Clone, Eq, PartialEq)]
7033#[non_exhaustive]
7034pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
7035    CsMinusCz,
7036    DaMinusDk,
7037    DeMinusAt,
7038    DeMinusCh,
7039    DeMinusDe,
7040    ElMinusGr,
7041    EnMinusAt,
7042    EnMinusAu,
7043    EnMinusBe,
7044    EnMinusCa,
7045    EnMinusCh,
7046    EnMinusCz,
7047    EnMinusDe,
7048    EnMinusDk,
7049    EnMinusEs,
7050    EnMinusFi,
7051    EnMinusFr,
7052    EnMinusGb,
7053    EnMinusGr,
7054    EnMinusIe,
7055    EnMinusIt,
7056    EnMinusNl,
7057    EnMinusNo,
7058    EnMinusNz,
7059    EnMinusPl,
7060    EnMinusPt,
7061    EnMinusRo,
7062    EnMinusSe,
7063    EnMinusUs,
7064    EsMinusEs,
7065    EsMinusUs,
7066    FiMinusFi,
7067    FrMinusBe,
7068    FrMinusCa,
7069    FrMinusCh,
7070    FrMinusFr,
7071    ItMinusCh,
7072    ItMinusIt,
7073    NbMinusNo,
7074    NlMinusBe,
7075    NlMinusNl,
7076    PlMinusPl,
7077    PtMinusPt,
7078    RoMinusRo,
7079    SvMinusFi,
7080    SvMinusSe,
7081    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7082    Unknown(String),
7083}
7084impl CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
7085    pub fn as_str(&self) -> &str {
7086        use CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
7087        match self {
7088            CsMinusCz => "cs-CZ",
7089            DaMinusDk => "da-DK",
7090            DeMinusAt => "de-AT",
7091            DeMinusCh => "de-CH",
7092            DeMinusDe => "de-DE",
7093            ElMinusGr => "el-GR",
7094            EnMinusAt => "en-AT",
7095            EnMinusAu => "en-AU",
7096            EnMinusBe => "en-BE",
7097            EnMinusCa => "en-CA",
7098            EnMinusCh => "en-CH",
7099            EnMinusCz => "en-CZ",
7100            EnMinusDe => "en-DE",
7101            EnMinusDk => "en-DK",
7102            EnMinusEs => "en-ES",
7103            EnMinusFi => "en-FI",
7104            EnMinusFr => "en-FR",
7105            EnMinusGb => "en-GB",
7106            EnMinusGr => "en-GR",
7107            EnMinusIe => "en-IE",
7108            EnMinusIt => "en-IT",
7109            EnMinusNl => "en-NL",
7110            EnMinusNo => "en-NO",
7111            EnMinusNz => "en-NZ",
7112            EnMinusPl => "en-PL",
7113            EnMinusPt => "en-PT",
7114            EnMinusRo => "en-RO",
7115            EnMinusSe => "en-SE",
7116            EnMinusUs => "en-US",
7117            EsMinusEs => "es-ES",
7118            EsMinusUs => "es-US",
7119            FiMinusFi => "fi-FI",
7120            FrMinusBe => "fr-BE",
7121            FrMinusCa => "fr-CA",
7122            FrMinusCh => "fr-CH",
7123            FrMinusFr => "fr-FR",
7124            ItMinusCh => "it-CH",
7125            ItMinusIt => "it-IT",
7126            NbMinusNo => "nb-NO",
7127            NlMinusBe => "nl-BE",
7128            NlMinusNl => "nl-NL",
7129            PlMinusPl => "pl-PL",
7130            PtMinusPt => "pt-PT",
7131            RoMinusRo => "ro-RO",
7132            SvMinusFi => "sv-FI",
7133            SvMinusSe => "sv-SE",
7134            Unknown(v) => v,
7135        }
7136    }
7137}
7138
7139impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
7140    type Err = std::convert::Infallible;
7141    fn from_str(s: &str) -> Result<Self, Self::Err> {
7142        use CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
7143        match s {
7144            "cs-CZ" => Ok(CsMinusCz),
7145            "da-DK" => Ok(DaMinusDk),
7146            "de-AT" => Ok(DeMinusAt),
7147            "de-CH" => Ok(DeMinusCh),
7148            "de-DE" => Ok(DeMinusDe),
7149            "el-GR" => Ok(ElMinusGr),
7150            "en-AT" => Ok(EnMinusAt),
7151            "en-AU" => Ok(EnMinusAu),
7152            "en-BE" => Ok(EnMinusBe),
7153            "en-CA" => Ok(EnMinusCa),
7154            "en-CH" => Ok(EnMinusCh),
7155            "en-CZ" => Ok(EnMinusCz),
7156            "en-DE" => Ok(EnMinusDe),
7157            "en-DK" => Ok(EnMinusDk),
7158            "en-ES" => Ok(EnMinusEs),
7159            "en-FI" => Ok(EnMinusFi),
7160            "en-FR" => Ok(EnMinusFr),
7161            "en-GB" => Ok(EnMinusGb),
7162            "en-GR" => Ok(EnMinusGr),
7163            "en-IE" => Ok(EnMinusIe),
7164            "en-IT" => Ok(EnMinusIt),
7165            "en-NL" => Ok(EnMinusNl),
7166            "en-NO" => Ok(EnMinusNo),
7167            "en-NZ" => Ok(EnMinusNz),
7168            "en-PL" => Ok(EnMinusPl),
7169            "en-PT" => Ok(EnMinusPt),
7170            "en-RO" => Ok(EnMinusRo),
7171            "en-SE" => Ok(EnMinusSe),
7172            "en-US" => Ok(EnMinusUs),
7173            "es-ES" => Ok(EsMinusEs),
7174            "es-US" => Ok(EsMinusUs),
7175            "fi-FI" => Ok(FiMinusFi),
7176            "fr-BE" => Ok(FrMinusBe),
7177            "fr-CA" => Ok(FrMinusCa),
7178            "fr-CH" => Ok(FrMinusCh),
7179            "fr-FR" => Ok(FrMinusFr),
7180            "it-CH" => Ok(ItMinusCh),
7181            "it-IT" => Ok(ItMinusIt),
7182            "nb-NO" => Ok(NbMinusNo),
7183            "nl-BE" => Ok(NlMinusBe),
7184            "nl-NL" => Ok(NlMinusNl),
7185            "pl-PL" => Ok(PlMinusPl),
7186            "pt-PT" => Ok(PtMinusPt),
7187            "ro-RO" => Ok(RoMinusRo),
7188            "sv-FI" => Ok(SvMinusFi),
7189            "sv-SE" => Ok(SvMinusSe),
7190            v => Ok(Unknown(v.to_owned())),
7191        }
7192    }
7193}
7194impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
7195    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7196        f.write_str(self.as_str())
7197    }
7198}
7199
7200impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
7201    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7202        f.write_str(self.as_str())
7203    }
7204}
7205impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
7206    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7207    where
7208        S: serde::Serializer,
7209    {
7210        serializer.serialize_str(self.as_str())
7211    }
7212}
7213#[cfg(feature = "deserialize")]
7214impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
7215    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7216        use std::str::FromStr;
7217        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7218        Ok(Self::from_str(&s).unwrap())
7219    }
7220}
7221/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7222///
7223/// 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.
7224/// 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.
7225///
7226/// 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.
7227///
7228/// 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).
7229///
7230/// 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`.
7231#[derive(Copy, Clone, Eq, PartialEq)]
7232pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
7233    None,
7234    OffSession,
7235    OnSession,
7236}
7237impl CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
7238    pub fn as_str(self) -> &'static str {
7239        use CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*;
7240        match self {
7241            None => "none",
7242            OffSession => "off_session",
7243            OnSession => "on_session",
7244        }
7245    }
7246}
7247
7248impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
7249    type Err = stripe_types::StripeParseError;
7250    fn from_str(s: &str) -> Result<Self, Self::Err> {
7251        use CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*;
7252        match s {
7253            "none" => Ok(None),
7254            "off_session" => Ok(OffSession),
7255            "on_session" => Ok(OnSession),
7256            _ => Err(stripe_types::StripeParseError),
7257        }
7258    }
7259}
7260impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
7261    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7262        f.write_str(self.as_str())
7263    }
7264}
7265
7266impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
7267    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7268        f.write_str(self.as_str())
7269    }
7270}
7271impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
7272    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7273    where
7274        S: serde::Serializer,
7275    {
7276        serializer.serialize_str(self.as_str())
7277    }
7278}
7279#[cfg(feature = "deserialize")]
7280impl<'de> serde::Deserialize<'de>
7281    for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage
7282{
7283    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7284        use std::str::FromStr;
7285        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7286        Self::from_str(&s).map_err(|_| {
7287            serde::de::Error::custom(
7288                "Unknown value for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage",
7289            )
7290        })
7291    }
7292}
7293/// Subscription details if setting up or charging a subscription.
7294#[derive(Clone, Debug, serde::Serialize)]
7295pub struct CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptions {
7296    /// Unit of time between subscription charges.
7297    pub interval: CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
7298    /// The number of intervals (specified in the `interval` attribute) between subscription charges.
7299    /// For example, `interval=month` and `interval_count=3` charges every 3 months.
7300    #[serde(skip_serializing_if = "Option::is_none")]
7301    pub interval_count: Option<u64>,
7302    /// Name for subscription.
7303    #[serde(skip_serializing_if = "Option::is_none")]
7304    pub name: Option<String>,
7305    /// Describes the upcoming charge for this subscription.
7306    #[serde(skip_serializing_if = "Option::is_none")]
7307    pub next_billing: Option<SubscriptionNextBillingParam>,
7308    /// A non-customer-facing reference to correlate subscription charges in the Klarna app.
7309    /// Use a value that persists across subscription charges.
7310    pub reference: String,
7311}
7312impl CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptions {
7313    pub fn new(
7314        interval: impl Into<CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
7315        reference: impl Into<String>,
7316    ) -> Self {
7317        Self {
7318            interval: interval.into(),
7319            interval_count: None,
7320            name: None,
7321            next_billing: None,
7322            reference: reference.into(),
7323        }
7324    }
7325}
7326/// Unit of time between subscription charges.
7327#[derive(Copy, Clone, Eq, PartialEq)]
7328pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7329    Day,
7330    Month,
7331    Week,
7332    Year,
7333}
7334impl CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7335    pub fn as_str(self) -> &'static str {
7336        use CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
7337        match self {
7338            Day => "day",
7339            Month => "month",
7340            Week => "week",
7341            Year => "year",
7342        }
7343    }
7344}
7345
7346impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7347    type Err = stripe_types::StripeParseError;
7348    fn from_str(s: &str) -> Result<Self, Self::Err> {
7349        use CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
7350        match s {
7351            "day" => Ok(Day),
7352            "month" => Ok(Month),
7353            "week" => Ok(Week),
7354            "year" => Ok(Year),
7355            _ => Err(stripe_types::StripeParseError),
7356        }
7357    }
7358}
7359impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7360    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7361        f.write_str(self.as_str())
7362    }
7363}
7364
7365impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7366    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7367        f.write_str(self.as_str())
7368    }
7369}
7370impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7371    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7372    where
7373        S: serde::Serializer,
7374    {
7375        serializer.serialize_str(self.as_str())
7376    }
7377}
7378#[cfg(feature = "deserialize")]
7379impl<'de> serde::Deserialize<'de>
7380    for CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
7381{
7382    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7383        use std::str::FromStr;
7384        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7385        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"))
7386    }
7387}
7388/// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options.
7389#[derive(Clone, Debug, serde::Serialize)]
7390pub struct CreatePaymentIntentPaymentMethodOptionsKonbini {
7391    /// An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores.
7392    /// Must not consist of only zeroes and could be rejected in case of insufficient uniqueness.
7393    /// We recommend to use the customer's phone number.
7394    #[serde(skip_serializing_if = "Option::is_none")]
7395    pub confirmation_number: Option<String>,
7396    /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire.
7397    /// 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.
7398    /// Defaults to 3 days.
7399    #[serde(skip_serializing_if = "Option::is_none")]
7400    pub expires_after_days: Option<u32>,
7401    /// The timestamp at which the Konbini payment instructions will expire.
7402    /// Only one of `expires_after_days` or `expires_at` may be set.
7403    #[serde(skip_serializing_if = "Option::is_none")]
7404    pub expires_at: Option<stripe_types::Timestamp>,
7405    /// A product descriptor of up to 22 characters, which will appear to customers at the convenience store.
7406    #[serde(skip_serializing_if = "Option::is_none")]
7407    pub product_description: Option<String>,
7408    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7409    ///
7410    /// 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.
7411    /// 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.
7412    ///
7413    /// 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.
7414    ///
7415    /// 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).
7416    ///
7417    /// 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`.
7418    #[serde(skip_serializing_if = "Option::is_none")]
7419    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage>,
7420}
7421impl CreatePaymentIntentPaymentMethodOptionsKonbini {
7422    pub fn new() -> Self {
7423        Self {
7424            confirmation_number: None,
7425            expires_after_days: None,
7426            expires_at: None,
7427            product_description: None,
7428            setup_future_usage: None,
7429        }
7430    }
7431}
7432impl Default for CreatePaymentIntentPaymentMethodOptionsKonbini {
7433    fn default() -> Self {
7434        Self::new()
7435    }
7436}
7437/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7438///
7439/// 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.
7440/// 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.
7441///
7442/// 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.
7443///
7444/// 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).
7445///
7446/// 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`.
7447#[derive(Copy, Clone, Eq, PartialEq)]
7448pub enum CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
7449    None,
7450}
7451impl CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
7452    pub fn as_str(self) -> &'static str {
7453        use CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*;
7454        match self {
7455            None => "none",
7456        }
7457    }
7458}
7459
7460impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
7461    type Err = stripe_types::StripeParseError;
7462    fn from_str(s: &str) -> Result<Self, Self::Err> {
7463        use CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*;
7464        match s {
7465            "none" => Ok(None),
7466            _ => Err(stripe_types::StripeParseError),
7467        }
7468    }
7469}
7470impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
7471    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7472        f.write_str(self.as_str())
7473    }
7474}
7475
7476impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
7477    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7478        f.write_str(self.as_str())
7479    }
7480}
7481impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
7482    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7483    where
7484        S: serde::Serializer,
7485    {
7486        serializer.serialize_str(self.as_str())
7487    }
7488}
7489#[cfg(feature = "deserialize")]
7490impl<'de> serde::Deserialize<'de>
7491    for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage
7492{
7493    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7494        use std::str::FromStr;
7495        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7496        Self::from_str(&s).map_err(|_| {
7497            serde::de::Error::custom(
7498                "Unknown value for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage",
7499            )
7500        })
7501    }
7502}
7503/// If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options.
7504#[derive(Copy, Clone, Debug, serde::Serialize)]
7505pub struct CreatePaymentIntentPaymentMethodOptionsKrCard {
7506    /// Controls when the funds are captured from the customer's account.
7507    ///
7508    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
7509    ///
7510    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
7511    #[serde(skip_serializing_if = "Option::is_none")]
7512    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod>,
7513    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7514    ///
7515    /// 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.
7516    /// 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.
7517    ///
7518    /// 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.
7519    ///
7520    /// 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).
7521    #[serde(skip_serializing_if = "Option::is_none")]
7522    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage>,
7523}
7524impl CreatePaymentIntentPaymentMethodOptionsKrCard {
7525    pub fn new() -> Self {
7526        Self { capture_method: None, setup_future_usage: None }
7527    }
7528}
7529impl Default for CreatePaymentIntentPaymentMethodOptionsKrCard {
7530    fn default() -> Self {
7531        Self::new()
7532    }
7533}
7534/// Controls when the funds are captured from the customer's account.
7535///
7536/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
7537///
7538/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
7539#[derive(Copy, Clone, Eq, PartialEq)]
7540pub enum CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
7541    Manual,
7542}
7543impl CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
7544    pub fn as_str(self) -> &'static str {
7545        use CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod::*;
7546        match self {
7547            Manual => "manual",
7548        }
7549    }
7550}
7551
7552impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
7553    type Err = stripe_types::StripeParseError;
7554    fn from_str(s: &str) -> Result<Self, Self::Err> {
7555        use CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod::*;
7556        match s {
7557            "manual" => Ok(Manual),
7558            _ => Err(stripe_types::StripeParseError),
7559        }
7560    }
7561}
7562impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
7563    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7564        f.write_str(self.as_str())
7565    }
7566}
7567
7568impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
7569    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7570        f.write_str(self.as_str())
7571    }
7572}
7573impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
7574    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7575    where
7576        S: serde::Serializer,
7577    {
7578        serializer.serialize_str(self.as_str())
7579    }
7580}
7581#[cfg(feature = "deserialize")]
7582impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
7583    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7584        use std::str::FromStr;
7585        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7586        Self::from_str(&s).map_err(|_| {
7587            serde::de::Error::custom(
7588                "Unknown value for CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod",
7589            )
7590        })
7591    }
7592}
7593/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7594///
7595/// 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.
7596/// 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.
7597///
7598/// 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.
7599///
7600/// 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).
7601#[derive(Copy, Clone, Eq, PartialEq)]
7602pub enum CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
7603    None,
7604    OffSession,
7605}
7606impl CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
7607    pub fn as_str(self) -> &'static str {
7608        use CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage::*;
7609        match self {
7610            None => "none",
7611            OffSession => "off_session",
7612        }
7613    }
7614}
7615
7616impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
7617    type Err = stripe_types::StripeParseError;
7618    fn from_str(s: &str) -> Result<Self, Self::Err> {
7619        use CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage::*;
7620        match s {
7621            "none" => Ok(None),
7622            "off_session" => Ok(OffSession),
7623            _ => Err(stripe_types::StripeParseError),
7624        }
7625    }
7626}
7627impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
7628    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7629        f.write_str(self.as_str())
7630    }
7631}
7632
7633impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
7634    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7635        f.write_str(self.as_str())
7636    }
7637}
7638impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
7639    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7640    where
7641        S: serde::Serializer,
7642    {
7643        serializer.serialize_str(self.as_str())
7644    }
7645}
7646#[cfg(feature = "deserialize")]
7647impl<'de> serde::Deserialize<'de>
7648    for CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage
7649{
7650    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7651        use std::str::FromStr;
7652        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7653        Self::from_str(&s).map_err(|_| {
7654            serde::de::Error::custom(
7655                "Unknown value for CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage",
7656            )
7657        })
7658    }
7659}
7660/// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
7661#[derive(Clone, Debug, serde::Serialize)]
7662pub struct CreatePaymentIntentPaymentMethodOptionsLink {
7663    /// Controls when the funds are captured from the customer's account.
7664    ///
7665    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
7666    ///
7667    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
7668    #[serde(skip_serializing_if = "Option::is_none")]
7669    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod>,
7670    /// \[Deprecated\] This is a legacy parameter that no longer has any function.
7671    #[serde(skip_serializing_if = "Option::is_none")]
7672    pub persistent_token: Option<String>,
7673    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7674    ///
7675    /// 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.
7676    /// 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.
7677    ///
7678    /// 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.
7679    ///
7680    /// 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).
7681    ///
7682    /// 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`.
7683    #[serde(skip_serializing_if = "Option::is_none")]
7684    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage>,
7685}
7686impl CreatePaymentIntentPaymentMethodOptionsLink {
7687    pub fn new() -> Self {
7688        Self { capture_method: None, persistent_token: None, setup_future_usage: None }
7689    }
7690}
7691impl Default for CreatePaymentIntentPaymentMethodOptionsLink {
7692    fn default() -> Self {
7693        Self::new()
7694    }
7695}
7696/// Controls when the funds are captured from the customer's account.
7697///
7698/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
7699///
7700/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
7701#[derive(Copy, Clone, Eq, PartialEq)]
7702pub enum CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
7703    Manual,
7704}
7705impl CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
7706    pub fn as_str(self) -> &'static str {
7707        use CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod::*;
7708        match self {
7709            Manual => "manual",
7710        }
7711    }
7712}
7713
7714impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
7715    type Err = stripe_types::StripeParseError;
7716    fn from_str(s: &str) -> Result<Self, Self::Err> {
7717        use CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod::*;
7718        match s {
7719            "manual" => Ok(Manual),
7720            _ => Err(stripe_types::StripeParseError),
7721        }
7722    }
7723}
7724impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
7725    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7726        f.write_str(self.as_str())
7727    }
7728}
7729
7730impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
7731    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7732        f.write_str(self.as_str())
7733    }
7734}
7735impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
7736    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7737    where
7738        S: serde::Serializer,
7739    {
7740        serializer.serialize_str(self.as_str())
7741    }
7742}
7743#[cfg(feature = "deserialize")]
7744impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
7745    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7746        use std::str::FromStr;
7747        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7748        Self::from_str(&s).map_err(|_| {
7749            serde::de::Error::custom(
7750                "Unknown value for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod",
7751            )
7752        })
7753    }
7754}
7755/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7756///
7757/// 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.
7758/// 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.
7759///
7760/// 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.
7761///
7762/// 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).
7763///
7764/// 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`.
7765#[derive(Copy, Clone, Eq, PartialEq)]
7766pub enum CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
7767    None,
7768    OffSession,
7769}
7770impl CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
7771    pub fn as_str(self) -> &'static str {
7772        use CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*;
7773        match self {
7774            None => "none",
7775            OffSession => "off_session",
7776        }
7777    }
7778}
7779
7780impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
7781    type Err = stripe_types::StripeParseError;
7782    fn from_str(s: &str) -> Result<Self, Self::Err> {
7783        use CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*;
7784        match s {
7785            "none" => Ok(None),
7786            "off_session" => Ok(OffSession),
7787            _ => Err(stripe_types::StripeParseError),
7788        }
7789    }
7790}
7791impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
7792    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7793        f.write_str(self.as_str())
7794    }
7795}
7796
7797impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
7798    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7799        f.write_str(self.as_str())
7800    }
7801}
7802impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
7803    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7804    where
7805        S: serde::Serializer,
7806    {
7807        serializer.serialize_str(self.as_str())
7808    }
7809}
7810#[cfg(feature = "deserialize")]
7811impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
7812    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7813        use std::str::FromStr;
7814        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7815        Self::from_str(&s).map_err(|_| {
7816            serde::de::Error::custom(
7817                "Unknown value for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage",
7818            )
7819        })
7820    }
7821}
7822/// If this is a `mb_way` PaymentMethod, this sub-hash contains details about the MB WAY payment method options.
7823#[derive(Copy, Clone, Debug, serde::Serialize)]
7824pub struct CreatePaymentIntentPaymentMethodOptionsMbWay {
7825    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7826    ///
7827    /// 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.
7828    /// 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.
7829    ///
7830    /// 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.
7831    ///
7832    /// 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).
7833    ///
7834    /// 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`.
7835    #[serde(skip_serializing_if = "Option::is_none")]
7836    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage>,
7837}
7838impl CreatePaymentIntentPaymentMethodOptionsMbWay {
7839    pub fn new() -> Self {
7840        Self { setup_future_usage: None }
7841    }
7842}
7843impl Default for CreatePaymentIntentPaymentMethodOptionsMbWay {
7844    fn default() -> Self {
7845        Self::new()
7846    }
7847}
7848/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7849///
7850/// 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.
7851/// 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.
7852///
7853/// 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.
7854///
7855/// 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).
7856///
7857/// 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`.
7858#[derive(Copy, Clone, Eq, PartialEq)]
7859pub enum CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
7860    None,
7861}
7862impl CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
7863    pub fn as_str(self) -> &'static str {
7864        use CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage::*;
7865        match self {
7866            None => "none",
7867        }
7868    }
7869}
7870
7871impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
7872    type Err = stripe_types::StripeParseError;
7873    fn from_str(s: &str) -> Result<Self, Self::Err> {
7874        use CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage::*;
7875        match s {
7876            "none" => Ok(None),
7877            _ => Err(stripe_types::StripeParseError),
7878        }
7879    }
7880}
7881impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
7882    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7883        f.write_str(self.as_str())
7884    }
7885}
7886
7887impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
7888    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7889        f.write_str(self.as_str())
7890    }
7891}
7892impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
7893    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7894    where
7895        S: serde::Serializer,
7896    {
7897        serializer.serialize_str(self.as_str())
7898    }
7899}
7900#[cfg(feature = "deserialize")]
7901impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
7902    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7903        use std::str::FromStr;
7904        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7905        Self::from_str(&s).map_err(|_| {
7906            serde::de::Error::custom(
7907                "Unknown value for CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage",
7908            )
7909        })
7910    }
7911}
7912/// If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options.
7913#[derive(Copy, Clone, Debug, serde::Serialize)]
7914pub struct CreatePaymentIntentPaymentMethodOptionsMobilepay {
7915    /// Controls when the funds are captured from the customer's account.
7916    ///
7917    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
7918    ///
7919    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
7920    #[serde(skip_serializing_if = "Option::is_none")]
7921    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod>,
7922    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7923    ///
7924    /// 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.
7925    /// 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.
7926    ///
7927    /// 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.
7928    ///
7929    /// 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).
7930    ///
7931    /// 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`.
7932    #[serde(skip_serializing_if = "Option::is_none")]
7933    pub setup_future_usage:
7934        Option<CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage>,
7935}
7936impl CreatePaymentIntentPaymentMethodOptionsMobilepay {
7937    pub fn new() -> Self {
7938        Self { capture_method: None, setup_future_usage: None }
7939    }
7940}
7941impl Default for CreatePaymentIntentPaymentMethodOptionsMobilepay {
7942    fn default() -> Self {
7943        Self::new()
7944    }
7945}
7946/// Controls when the funds are captured from the customer's account.
7947///
7948/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
7949///
7950/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
7951#[derive(Copy, Clone, Eq, PartialEq)]
7952pub enum CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
7953    Manual,
7954}
7955impl CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
7956    pub fn as_str(self) -> &'static str {
7957        use CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod::*;
7958        match self {
7959            Manual => "manual",
7960        }
7961    }
7962}
7963
7964impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
7965    type Err = stripe_types::StripeParseError;
7966    fn from_str(s: &str) -> Result<Self, Self::Err> {
7967        use CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod::*;
7968        match s {
7969            "manual" => Ok(Manual),
7970            _ => Err(stripe_types::StripeParseError),
7971        }
7972    }
7973}
7974impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
7975    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7976        f.write_str(self.as_str())
7977    }
7978}
7979
7980impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
7981    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7982        f.write_str(self.as_str())
7983    }
7984}
7985impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
7986    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7987    where
7988        S: serde::Serializer,
7989    {
7990        serializer.serialize_str(self.as_str())
7991    }
7992}
7993#[cfg(feature = "deserialize")]
7994impl<'de> serde::Deserialize<'de>
7995    for CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod
7996{
7997    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7998        use std::str::FromStr;
7999        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8000        Self::from_str(&s).map_err(|_| {
8001            serde::de::Error::custom(
8002                "Unknown value for CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod",
8003            )
8004        })
8005    }
8006}
8007/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8008///
8009/// 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.
8010/// 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.
8011///
8012/// 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.
8013///
8014/// 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).
8015///
8016/// 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`.
8017#[derive(Copy, Clone, Eq, PartialEq)]
8018pub enum CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
8019    None,
8020}
8021impl CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
8022    pub fn as_str(self) -> &'static str {
8023        use CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage::*;
8024        match self {
8025            None => "none",
8026        }
8027    }
8028}
8029
8030impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
8031    type Err = stripe_types::StripeParseError;
8032    fn from_str(s: &str) -> Result<Self, Self::Err> {
8033        use CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage::*;
8034        match s {
8035            "none" => Ok(None),
8036            _ => Err(stripe_types::StripeParseError),
8037        }
8038    }
8039}
8040impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
8041    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8042        f.write_str(self.as_str())
8043    }
8044}
8045
8046impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
8047    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8048        f.write_str(self.as_str())
8049    }
8050}
8051impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
8052    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8053    where
8054        S: serde::Serializer,
8055    {
8056        serializer.serialize_str(self.as_str())
8057    }
8058}
8059#[cfg(feature = "deserialize")]
8060impl<'de> serde::Deserialize<'de>
8061    for CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage
8062{
8063    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8064        use std::str::FromStr;
8065        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8066        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage"))
8067    }
8068}
8069/// If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options.
8070#[derive(Copy, Clone, Debug, serde::Serialize)]
8071pub struct CreatePaymentIntentPaymentMethodOptionsMultibanco {
8072    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8073    ///
8074    /// 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.
8075    /// 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.
8076    ///
8077    /// 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.
8078    ///
8079    /// 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).
8080    ///
8081    /// 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`.
8082    #[serde(skip_serializing_if = "Option::is_none")]
8083    pub setup_future_usage:
8084        Option<CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage>,
8085}
8086impl CreatePaymentIntentPaymentMethodOptionsMultibanco {
8087    pub fn new() -> Self {
8088        Self { setup_future_usage: None }
8089    }
8090}
8091impl Default for CreatePaymentIntentPaymentMethodOptionsMultibanco {
8092    fn default() -> Self {
8093        Self::new()
8094    }
8095}
8096/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8097///
8098/// 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.
8099/// 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.
8100///
8101/// 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.
8102///
8103/// 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).
8104///
8105/// 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`.
8106#[derive(Copy, Clone, Eq, PartialEq)]
8107pub enum CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
8108    None,
8109}
8110impl CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
8111    pub fn as_str(self) -> &'static str {
8112        use CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage::*;
8113        match self {
8114            None => "none",
8115        }
8116    }
8117}
8118
8119impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
8120    type Err = stripe_types::StripeParseError;
8121    fn from_str(s: &str) -> Result<Self, Self::Err> {
8122        use CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage::*;
8123        match s {
8124            "none" => Ok(None),
8125            _ => Err(stripe_types::StripeParseError),
8126        }
8127    }
8128}
8129impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
8130    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8131        f.write_str(self.as_str())
8132    }
8133}
8134
8135impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
8136    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8137        f.write_str(self.as_str())
8138    }
8139}
8140impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
8141    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8142    where
8143        S: serde::Serializer,
8144    {
8145        serializer.serialize_str(self.as_str())
8146    }
8147}
8148#[cfg(feature = "deserialize")]
8149impl<'de> serde::Deserialize<'de>
8150    for CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage
8151{
8152    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8153        use std::str::FromStr;
8154        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8155        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage"))
8156    }
8157}
8158/// If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options.
8159#[derive(Copy, Clone, Debug, serde::Serialize)]
8160pub struct CreatePaymentIntentPaymentMethodOptionsNaverPay {
8161    /// Controls when the funds are captured from the customer's account.
8162    ///
8163    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
8164    ///
8165    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
8166    #[serde(skip_serializing_if = "Option::is_none")]
8167    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod>,
8168    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8169    ///
8170    /// 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.
8171    /// 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.
8172    ///
8173    /// 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.
8174    ///
8175    /// 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).
8176    #[serde(skip_serializing_if = "Option::is_none")]
8177    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage>,
8178}
8179impl CreatePaymentIntentPaymentMethodOptionsNaverPay {
8180    pub fn new() -> Self {
8181        Self { capture_method: None, setup_future_usage: None }
8182    }
8183}
8184impl Default for CreatePaymentIntentPaymentMethodOptionsNaverPay {
8185    fn default() -> Self {
8186        Self::new()
8187    }
8188}
8189/// Controls when the funds are captured from the customer's account.
8190///
8191/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
8192///
8193/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
8194#[derive(Copy, Clone, Eq, PartialEq)]
8195pub enum CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
8196    Manual,
8197}
8198impl CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
8199    pub fn as_str(self) -> &'static str {
8200        use CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod::*;
8201        match self {
8202            Manual => "manual",
8203        }
8204    }
8205}
8206
8207impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
8208    type Err = stripe_types::StripeParseError;
8209    fn from_str(s: &str) -> Result<Self, Self::Err> {
8210        use CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod::*;
8211        match s {
8212            "manual" => Ok(Manual),
8213            _ => Err(stripe_types::StripeParseError),
8214        }
8215    }
8216}
8217impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
8218    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8219        f.write_str(self.as_str())
8220    }
8221}
8222
8223impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
8224    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8225        f.write_str(self.as_str())
8226    }
8227}
8228impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
8229    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8230    where
8231        S: serde::Serializer,
8232    {
8233        serializer.serialize_str(self.as_str())
8234    }
8235}
8236#[cfg(feature = "deserialize")]
8237impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
8238    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8239        use std::str::FromStr;
8240        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8241        Self::from_str(&s).map_err(|_| {
8242            serde::de::Error::custom(
8243                "Unknown value for CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod",
8244            )
8245        })
8246    }
8247}
8248/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8249///
8250/// 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.
8251/// 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.
8252///
8253/// 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.
8254///
8255/// 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).
8256#[derive(Copy, Clone, Eq, PartialEq)]
8257pub enum CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
8258    None,
8259    OffSession,
8260}
8261impl CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
8262    pub fn as_str(self) -> &'static str {
8263        use CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage::*;
8264        match self {
8265            None => "none",
8266            OffSession => "off_session",
8267        }
8268    }
8269}
8270
8271impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
8272    type Err = stripe_types::StripeParseError;
8273    fn from_str(s: &str) -> Result<Self, Self::Err> {
8274        use CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage::*;
8275        match s {
8276            "none" => Ok(None),
8277            "off_session" => Ok(OffSession),
8278            _ => Err(stripe_types::StripeParseError),
8279        }
8280    }
8281}
8282impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
8283    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8284        f.write_str(self.as_str())
8285    }
8286}
8287
8288impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
8289    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8290        f.write_str(self.as_str())
8291    }
8292}
8293impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
8294    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8295    where
8296        S: serde::Serializer,
8297    {
8298        serializer.serialize_str(self.as_str())
8299    }
8300}
8301#[cfg(feature = "deserialize")]
8302impl<'de> serde::Deserialize<'de>
8303    for CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage
8304{
8305    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8306        use std::str::FromStr;
8307        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8308        Self::from_str(&s).map_err(|_| {
8309            serde::de::Error::custom(
8310                "Unknown value for CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage",
8311            )
8312        })
8313    }
8314}
8315/// If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options.
8316#[derive(Clone, Debug, serde::Serialize)]
8317pub struct CreatePaymentIntentPaymentMethodOptionsNzBankAccount {
8318    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8319    ///
8320    /// 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.
8321    /// 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.
8322    ///
8323    /// 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.
8324    ///
8325    /// 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).
8326    ///
8327    /// 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`.
8328    #[serde(skip_serializing_if = "Option::is_none")]
8329    pub setup_future_usage:
8330        Option<CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage>,
8331    /// Controls when Stripe will attempt to debit the funds from the customer's account.
8332    /// The date must be a string in YYYY-MM-DD format.
8333    /// The date must be in the future and between 3 and 15 calendar days from now.
8334    #[serde(skip_serializing_if = "Option::is_none")]
8335    pub target_date: Option<String>,
8336}
8337impl CreatePaymentIntentPaymentMethodOptionsNzBankAccount {
8338    pub fn new() -> Self {
8339        Self { setup_future_usage: None, target_date: None }
8340    }
8341}
8342impl Default for CreatePaymentIntentPaymentMethodOptionsNzBankAccount {
8343    fn default() -> Self {
8344        Self::new()
8345    }
8346}
8347/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8348///
8349/// 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.
8350/// 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.
8351///
8352/// 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.
8353///
8354/// 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).
8355///
8356/// 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`.
8357#[derive(Copy, Clone, Eq, PartialEq)]
8358pub enum CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
8359    None,
8360    OffSession,
8361    OnSession,
8362}
8363impl CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
8364    pub fn as_str(self) -> &'static str {
8365        use CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage::*;
8366        match self {
8367            None => "none",
8368            OffSession => "off_session",
8369            OnSession => "on_session",
8370        }
8371    }
8372}
8373
8374impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
8375    type Err = stripe_types::StripeParseError;
8376    fn from_str(s: &str) -> Result<Self, Self::Err> {
8377        use CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage::*;
8378        match s {
8379            "none" => Ok(None),
8380            "off_session" => Ok(OffSession),
8381            "on_session" => Ok(OnSession),
8382            _ => Err(stripe_types::StripeParseError),
8383        }
8384    }
8385}
8386impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
8387    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8388        f.write_str(self.as_str())
8389    }
8390}
8391
8392impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
8393    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8394        f.write_str(self.as_str())
8395    }
8396}
8397impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
8398    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8399    where
8400        S: serde::Serializer,
8401    {
8402        serializer.serialize_str(self.as_str())
8403    }
8404}
8405#[cfg(feature = "deserialize")]
8406impl<'de> serde::Deserialize<'de>
8407    for CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage
8408{
8409    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8410        use std::str::FromStr;
8411        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8412        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage"))
8413    }
8414}
8415/// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options.
8416#[derive(Copy, Clone, Debug, serde::Serialize)]
8417pub struct CreatePaymentIntentPaymentMethodOptionsOxxo {
8418    /// The number of calendar days before an OXXO voucher expires.
8419    /// 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.
8420    #[serde(skip_serializing_if = "Option::is_none")]
8421    pub expires_after_days: Option<u32>,
8422    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8423    ///
8424    /// 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.
8425    /// 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.
8426    ///
8427    /// 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.
8428    ///
8429    /// 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).
8430    ///
8431    /// 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`.
8432    #[serde(skip_serializing_if = "Option::is_none")]
8433    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage>,
8434}
8435impl CreatePaymentIntentPaymentMethodOptionsOxxo {
8436    pub fn new() -> Self {
8437        Self { expires_after_days: None, setup_future_usage: None }
8438    }
8439}
8440impl Default for CreatePaymentIntentPaymentMethodOptionsOxxo {
8441    fn default() -> Self {
8442        Self::new()
8443    }
8444}
8445/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8446///
8447/// 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.
8448/// 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.
8449///
8450/// 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.
8451///
8452/// 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).
8453///
8454/// 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`.
8455#[derive(Copy, Clone, Eq, PartialEq)]
8456pub enum CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
8457    None,
8458}
8459impl CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
8460    pub fn as_str(self) -> &'static str {
8461        use CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*;
8462        match self {
8463            None => "none",
8464        }
8465    }
8466}
8467
8468impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
8469    type Err = stripe_types::StripeParseError;
8470    fn from_str(s: &str) -> Result<Self, Self::Err> {
8471        use CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*;
8472        match s {
8473            "none" => Ok(None),
8474            _ => Err(stripe_types::StripeParseError),
8475        }
8476    }
8477}
8478impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
8479    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8480        f.write_str(self.as_str())
8481    }
8482}
8483
8484impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
8485    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8486        f.write_str(self.as_str())
8487    }
8488}
8489impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
8490    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8491    where
8492        S: serde::Serializer,
8493    {
8494        serializer.serialize_str(self.as_str())
8495    }
8496}
8497#[cfg(feature = "deserialize")]
8498impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
8499    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8500        use std::str::FromStr;
8501        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8502        Self::from_str(&s).map_err(|_| {
8503            serde::de::Error::custom(
8504                "Unknown value for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage",
8505            )
8506        })
8507    }
8508}
8509/// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options.
8510#[derive(Copy, Clone, Debug, serde::Serialize)]
8511pub struct CreatePaymentIntentPaymentMethodOptionsP24 {
8512    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8513    ///
8514    /// 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.
8515    /// 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.
8516    ///
8517    /// 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.
8518    ///
8519    /// 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).
8520    ///
8521    /// 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`.
8522    #[serde(skip_serializing_if = "Option::is_none")]
8523    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage>,
8524    /// Confirm that the payer has accepted the P24 terms and conditions.
8525    #[serde(skip_serializing_if = "Option::is_none")]
8526    pub tos_shown_and_accepted: Option<bool>,
8527}
8528impl CreatePaymentIntentPaymentMethodOptionsP24 {
8529    pub fn new() -> Self {
8530        Self { setup_future_usage: None, tos_shown_and_accepted: None }
8531    }
8532}
8533impl Default for CreatePaymentIntentPaymentMethodOptionsP24 {
8534    fn default() -> Self {
8535        Self::new()
8536    }
8537}
8538/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8539///
8540/// 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.
8541/// 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.
8542///
8543/// 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.
8544///
8545/// 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).
8546///
8547/// 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`.
8548#[derive(Copy, Clone, Eq, PartialEq)]
8549pub enum CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
8550    None,
8551}
8552impl CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
8553    pub fn as_str(self) -> &'static str {
8554        use CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*;
8555        match self {
8556            None => "none",
8557        }
8558    }
8559}
8560
8561impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
8562    type Err = stripe_types::StripeParseError;
8563    fn from_str(s: &str) -> Result<Self, Self::Err> {
8564        use CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*;
8565        match s {
8566            "none" => Ok(None),
8567            _ => Err(stripe_types::StripeParseError),
8568        }
8569    }
8570}
8571impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
8572    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8573        f.write_str(self.as_str())
8574    }
8575}
8576
8577impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
8578    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8579        f.write_str(self.as_str())
8580    }
8581}
8582impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
8583    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8584    where
8585        S: serde::Serializer,
8586    {
8587        serializer.serialize_str(self.as_str())
8588    }
8589}
8590#[cfg(feature = "deserialize")]
8591impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
8592    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8593        use std::str::FromStr;
8594        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8595        Self::from_str(&s).map_err(|_| {
8596            serde::de::Error::custom(
8597                "Unknown value for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage",
8598            )
8599        })
8600    }
8601}
8602/// If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options.
8603#[derive(Copy, Clone, Debug, serde::Serialize)]
8604pub struct CreatePaymentIntentPaymentMethodOptionsPayco {
8605    /// Controls when the funds are captured from the customer's account.
8606    ///
8607    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
8608    ///
8609    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
8610    #[serde(skip_serializing_if = "Option::is_none")]
8611    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod>,
8612}
8613impl CreatePaymentIntentPaymentMethodOptionsPayco {
8614    pub fn new() -> Self {
8615        Self { capture_method: None }
8616    }
8617}
8618impl Default for CreatePaymentIntentPaymentMethodOptionsPayco {
8619    fn default() -> Self {
8620        Self::new()
8621    }
8622}
8623/// Controls when the funds are captured from the customer's account.
8624///
8625/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
8626///
8627/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
8628#[derive(Copy, Clone, Eq, PartialEq)]
8629pub enum CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
8630    Manual,
8631}
8632impl CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
8633    pub fn as_str(self) -> &'static str {
8634        use CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod::*;
8635        match self {
8636            Manual => "manual",
8637        }
8638    }
8639}
8640
8641impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
8642    type Err = stripe_types::StripeParseError;
8643    fn from_str(s: &str) -> Result<Self, Self::Err> {
8644        use CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod::*;
8645        match s {
8646            "manual" => Ok(Manual),
8647            _ => Err(stripe_types::StripeParseError),
8648        }
8649    }
8650}
8651impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
8652    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8653        f.write_str(self.as_str())
8654    }
8655}
8656
8657impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
8658    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8659        f.write_str(self.as_str())
8660    }
8661}
8662impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
8663    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8664    where
8665        S: serde::Serializer,
8666    {
8667        serializer.serialize_str(self.as_str())
8668    }
8669}
8670#[cfg(feature = "deserialize")]
8671impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
8672    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8673        use std::str::FromStr;
8674        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8675        Self::from_str(&s).map_err(|_| {
8676            serde::de::Error::custom(
8677                "Unknown value for CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod",
8678            )
8679        })
8680    }
8681}
8682/// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options.
8683#[derive(Copy, Clone, Debug, serde::Serialize)]
8684pub struct CreatePaymentIntentPaymentMethodOptionsPaynow {
8685    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8686    ///
8687    /// 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.
8688    /// 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.
8689    ///
8690    /// 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.
8691    ///
8692    /// 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).
8693    ///
8694    /// 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`.
8695    #[serde(skip_serializing_if = "Option::is_none")]
8696    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage>,
8697}
8698impl CreatePaymentIntentPaymentMethodOptionsPaynow {
8699    pub fn new() -> Self {
8700        Self { setup_future_usage: None }
8701    }
8702}
8703impl Default for CreatePaymentIntentPaymentMethodOptionsPaynow {
8704    fn default() -> Self {
8705        Self::new()
8706    }
8707}
8708/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8709///
8710/// 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.
8711/// 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.
8712///
8713/// 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.
8714///
8715/// 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).
8716///
8717/// 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`.
8718#[derive(Copy, Clone, Eq, PartialEq)]
8719pub enum CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
8720    None,
8721}
8722impl CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
8723    pub fn as_str(self) -> &'static str {
8724        use CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*;
8725        match self {
8726            None => "none",
8727        }
8728    }
8729}
8730
8731impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
8732    type Err = stripe_types::StripeParseError;
8733    fn from_str(s: &str) -> Result<Self, Self::Err> {
8734        use CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*;
8735        match s {
8736            "none" => Ok(None),
8737            _ => Err(stripe_types::StripeParseError),
8738        }
8739    }
8740}
8741impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
8742    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8743        f.write_str(self.as_str())
8744    }
8745}
8746
8747impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
8748    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8749        f.write_str(self.as_str())
8750    }
8751}
8752impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
8753    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8754    where
8755        S: serde::Serializer,
8756    {
8757        serializer.serialize_str(self.as_str())
8758    }
8759}
8760#[cfg(feature = "deserialize")]
8761impl<'de> serde::Deserialize<'de>
8762    for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage
8763{
8764    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8765        use std::str::FromStr;
8766        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8767        Self::from_str(&s).map_err(|_| {
8768            serde::de::Error::custom(
8769                "Unknown value for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage",
8770            )
8771        })
8772    }
8773}
8774/// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
8775#[derive(Clone, Debug, serde::Serialize)]
8776pub struct CreatePaymentIntentPaymentMethodOptionsPaypal {
8777    /// Controls when the funds will be captured from the customer's account.
8778    #[serde(skip_serializing_if = "Option::is_none")]
8779    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod>,
8780    /// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to.
8781    #[serde(skip_serializing_if = "Option::is_none")]
8782    pub preferred_locale: Option<CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale>,
8783    /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID.
8784    /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID.
8785    #[serde(skip_serializing_if = "Option::is_none")]
8786    pub reference: Option<String>,
8787    /// The risk correlation ID for an on-session payment using a saved PayPal payment method.
8788    #[serde(skip_serializing_if = "Option::is_none")]
8789    pub risk_correlation_id: Option<String>,
8790    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8791    ///
8792    /// 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.
8793    /// 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.
8794    ///
8795    /// 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.
8796    ///
8797    /// 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).
8798    ///
8799    /// 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`.
8800    #[serde(skip_serializing_if = "Option::is_none")]
8801    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage>,
8802}
8803impl CreatePaymentIntentPaymentMethodOptionsPaypal {
8804    pub fn new() -> Self {
8805        Self {
8806            capture_method: None,
8807            preferred_locale: None,
8808            reference: None,
8809            risk_correlation_id: None,
8810            setup_future_usage: None,
8811        }
8812    }
8813}
8814impl Default for CreatePaymentIntentPaymentMethodOptionsPaypal {
8815    fn default() -> Self {
8816        Self::new()
8817    }
8818}
8819/// Controls when the funds will be captured from the customer's account.
8820#[derive(Copy, Clone, Eq, PartialEq)]
8821pub enum CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
8822    Manual,
8823}
8824impl CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
8825    pub fn as_str(self) -> &'static str {
8826        use CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*;
8827        match self {
8828            Manual => "manual",
8829        }
8830    }
8831}
8832
8833impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
8834    type Err = stripe_types::StripeParseError;
8835    fn from_str(s: &str) -> Result<Self, Self::Err> {
8836        use CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*;
8837        match s {
8838            "manual" => Ok(Manual),
8839            _ => Err(stripe_types::StripeParseError),
8840        }
8841    }
8842}
8843impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
8844    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8845        f.write_str(self.as_str())
8846    }
8847}
8848
8849impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
8850    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8851        f.write_str(self.as_str())
8852    }
8853}
8854impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
8855    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8856    where
8857        S: serde::Serializer,
8858    {
8859        serializer.serialize_str(self.as_str())
8860    }
8861}
8862#[cfg(feature = "deserialize")]
8863impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
8864    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8865        use std::str::FromStr;
8866        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8867        Self::from_str(&s).map_err(|_| {
8868            serde::de::Error::custom(
8869                "Unknown value for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod",
8870            )
8871        })
8872    }
8873}
8874/// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to.
8875#[derive(Clone, Eq, PartialEq)]
8876#[non_exhaustive]
8877pub enum CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
8878    CsMinusCz,
8879    DaMinusDk,
8880    DeMinusAt,
8881    DeMinusDe,
8882    DeMinusLu,
8883    ElMinusGr,
8884    EnMinusGb,
8885    EnMinusUs,
8886    EsMinusEs,
8887    FiMinusFi,
8888    FrMinusBe,
8889    FrMinusFr,
8890    FrMinusLu,
8891    HuMinusHu,
8892    ItMinusIt,
8893    NlMinusBe,
8894    NlMinusNl,
8895    PlMinusPl,
8896    PtMinusPt,
8897    SkMinusSk,
8898    SvMinusSe,
8899    /// An unrecognized value from Stripe. Should not be used as a request parameter.
8900    Unknown(String),
8901}
8902impl CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
8903    pub fn as_str(&self) -> &str {
8904        use CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*;
8905        match self {
8906            CsMinusCz => "cs-CZ",
8907            DaMinusDk => "da-DK",
8908            DeMinusAt => "de-AT",
8909            DeMinusDe => "de-DE",
8910            DeMinusLu => "de-LU",
8911            ElMinusGr => "el-GR",
8912            EnMinusGb => "en-GB",
8913            EnMinusUs => "en-US",
8914            EsMinusEs => "es-ES",
8915            FiMinusFi => "fi-FI",
8916            FrMinusBe => "fr-BE",
8917            FrMinusFr => "fr-FR",
8918            FrMinusLu => "fr-LU",
8919            HuMinusHu => "hu-HU",
8920            ItMinusIt => "it-IT",
8921            NlMinusBe => "nl-BE",
8922            NlMinusNl => "nl-NL",
8923            PlMinusPl => "pl-PL",
8924            PtMinusPt => "pt-PT",
8925            SkMinusSk => "sk-SK",
8926            SvMinusSe => "sv-SE",
8927            Unknown(v) => v,
8928        }
8929    }
8930}
8931
8932impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
8933    type Err = std::convert::Infallible;
8934    fn from_str(s: &str) -> Result<Self, Self::Err> {
8935        use CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*;
8936        match s {
8937            "cs-CZ" => Ok(CsMinusCz),
8938            "da-DK" => Ok(DaMinusDk),
8939            "de-AT" => Ok(DeMinusAt),
8940            "de-DE" => Ok(DeMinusDe),
8941            "de-LU" => Ok(DeMinusLu),
8942            "el-GR" => Ok(ElMinusGr),
8943            "en-GB" => Ok(EnMinusGb),
8944            "en-US" => Ok(EnMinusUs),
8945            "es-ES" => Ok(EsMinusEs),
8946            "fi-FI" => Ok(FiMinusFi),
8947            "fr-BE" => Ok(FrMinusBe),
8948            "fr-FR" => Ok(FrMinusFr),
8949            "fr-LU" => Ok(FrMinusLu),
8950            "hu-HU" => Ok(HuMinusHu),
8951            "it-IT" => Ok(ItMinusIt),
8952            "nl-BE" => Ok(NlMinusBe),
8953            "nl-NL" => Ok(NlMinusNl),
8954            "pl-PL" => Ok(PlMinusPl),
8955            "pt-PT" => Ok(PtMinusPt),
8956            "sk-SK" => Ok(SkMinusSk),
8957            "sv-SE" => Ok(SvMinusSe),
8958            v => Ok(Unknown(v.to_owned())),
8959        }
8960    }
8961}
8962impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
8963    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8964        f.write_str(self.as_str())
8965    }
8966}
8967
8968impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
8969    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8970        f.write_str(self.as_str())
8971    }
8972}
8973impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
8974    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8975    where
8976        S: serde::Serializer,
8977    {
8978        serializer.serialize_str(self.as_str())
8979    }
8980}
8981#[cfg(feature = "deserialize")]
8982impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
8983    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8984        use std::str::FromStr;
8985        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8986        Ok(Self::from_str(&s).unwrap())
8987    }
8988}
8989/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8990///
8991/// 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.
8992/// 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.
8993///
8994/// 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.
8995///
8996/// 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).
8997///
8998/// 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`.
8999#[derive(Copy, Clone, Eq, PartialEq)]
9000pub enum CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
9001    None,
9002    OffSession,
9003}
9004impl CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
9005    pub fn as_str(self) -> &'static str {
9006        use CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*;
9007        match self {
9008            None => "none",
9009            OffSession => "off_session",
9010        }
9011    }
9012}
9013
9014impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
9015    type Err = stripe_types::StripeParseError;
9016    fn from_str(s: &str) -> Result<Self, Self::Err> {
9017        use CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*;
9018        match s {
9019            "none" => Ok(None),
9020            "off_session" => Ok(OffSession),
9021            _ => Err(stripe_types::StripeParseError),
9022        }
9023    }
9024}
9025impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
9026    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9027        f.write_str(self.as_str())
9028    }
9029}
9030
9031impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
9032    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9033        f.write_str(self.as_str())
9034    }
9035}
9036impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
9037    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9038    where
9039        S: serde::Serializer,
9040    {
9041        serializer.serialize_str(self.as_str())
9042    }
9043}
9044#[cfg(feature = "deserialize")]
9045impl<'de> serde::Deserialize<'de>
9046    for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage
9047{
9048    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9049        use std::str::FromStr;
9050        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9051        Self::from_str(&s).map_err(|_| {
9052            serde::de::Error::custom(
9053                "Unknown value for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage",
9054            )
9055        })
9056    }
9057}
9058/// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options.
9059#[derive(Copy, Clone, Debug, serde::Serialize)]
9060pub struct CreatePaymentIntentPaymentMethodOptionsPix {
9061    /// Determines if the amount includes the IOF tax. Defaults to `never`.
9062    #[serde(skip_serializing_if = "Option::is_none")]
9063    pub amount_includes_iof: Option<CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof>,
9064    /// The number of seconds (between 10 and 1209600) after which Pix payment will expire.
9065    /// Defaults to 86400 seconds.
9066    #[serde(skip_serializing_if = "Option::is_none")]
9067    pub expires_after_seconds: Option<i64>,
9068    /// The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future).
9069    /// Defaults to 1 day in the future.
9070    #[serde(skip_serializing_if = "Option::is_none")]
9071    pub expires_at: Option<stripe_types::Timestamp>,
9072    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9073    ///
9074    /// 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.
9075    /// 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.
9076    ///
9077    /// 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.
9078    ///
9079    /// 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).
9080    ///
9081    /// 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`.
9082    #[serde(skip_serializing_if = "Option::is_none")]
9083    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage>,
9084}
9085impl CreatePaymentIntentPaymentMethodOptionsPix {
9086    pub fn new() -> Self {
9087        Self {
9088            amount_includes_iof: None,
9089            expires_after_seconds: None,
9090            expires_at: None,
9091            setup_future_usage: None,
9092        }
9093    }
9094}
9095impl Default for CreatePaymentIntentPaymentMethodOptionsPix {
9096    fn default() -> Self {
9097        Self::new()
9098    }
9099}
9100/// Determines if the amount includes the IOF tax. Defaults to `never`.
9101#[derive(Copy, Clone, Eq, PartialEq)]
9102pub enum CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
9103    Always,
9104    Never,
9105}
9106impl CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
9107    pub fn as_str(self) -> &'static str {
9108        use CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof::*;
9109        match self {
9110            Always => "always",
9111            Never => "never",
9112        }
9113    }
9114}
9115
9116impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
9117    type Err = stripe_types::StripeParseError;
9118    fn from_str(s: &str) -> Result<Self, Self::Err> {
9119        use CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof::*;
9120        match s {
9121            "always" => Ok(Always),
9122            "never" => Ok(Never),
9123            _ => Err(stripe_types::StripeParseError),
9124        }
9125    }
9126}
9127impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
9128    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9129        f.write_str(self.as_str())
9130    }
9131}
9132
9133impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
9134    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9135        f.write_str(self.as_str())
9136    }
9137}
9138impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
9139    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9140    where
9141        S: serde::Serializer,
9142    {
9143        serializer.serialize_str(self.as_str())
9144    }
9145}
9146#[cfg(feature = "deserialize")]
9147impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
9148    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9149        use std::str::FromStr;
9150        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9151        Self::from_str(&s).map_err(|_| {
9152            serde::de::Error::custom(
9153                "Unknown value for CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof",
9154            )
9155        })
9156    }
9157}
9158/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9159///
9160/// 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.
9161/// 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.
9162///
9163/// 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.
9164///
9165/// 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).
9166///
9167/// 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`.
9168#[derive(Copy, Clone, Eq, PartialEq)]
9169pub enum CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
9170    None,
9171}
9172impl CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
9173    pub fn as_str(self) -> &'static str {
9174        use CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*;
9175        match self {
9176            None => "none",
9177        }
9178    }
9179}
9180
9181impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
9182    type Err = stripe_types::StripeParseError;
9183    fn from_str(s: &str) -> Result<Self, Self::Err> {
9184        use CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*;
9185        match s {
9186            "none" => Ok(None),
9187            _ => Err(stripe_types::StripeParseError),
9188        }
9189    }
9190}
9191impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
9192    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9193        f.write_str(self.as_str())
9194    }
9195}
9196
9197impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
9198    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9199        f.write_str(self.as_str())
9200    }
9201}
9202impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
9203    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9204    where
9205        S: serde::Serializer,
9206    {
9207        serializer.serialize_str(self.as_str())
9208    }
9209}
9210#[cfg(feature = "deserialize")]
9211impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
9212    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9213        use std::str::FromStr;
9214        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9215        Self::from_str(&s).map_err(|_| {
9216            serde::de::Error::custom(
9217                "Unknown value for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage",
9218            )
9219        })
9220    }
9221}
9222/// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options.
9223#[derive(Copy, Clone, Debug, serde::Serialize)]
9224pub struct CreatePaymentIntentPaymentMethodOptionsPromptpay {
9225    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9226    ///
9227    /// 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.
9228    /// 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.
9229    ///
9230    /// 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.
9231    ///
9232    /// 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).
9233    ///
9234    /// 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`.
9235    #[serde(skip_serializing_if = "Option::is_none")]
9236    pub setup_future_usage:
9237        Option<CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage>,
9238}
9239impl CreatePaymentIntentPaymentMethodOptionsPromptpay {
9240    pub fn new() -> Self {
9241        Self { setup_future_usage: None }
9242    }
9243}
9244impl Default for CreatePaymentIntentPaymentMethodOptionsPromptpay {
9245    fn default() -> Self {
9246        Self::new()
9247    }
9248}
9249/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9250///
9251/// 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.
9252/// 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.
9253///
9254/// 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.
9255///
9256/// 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).
9257///
9258/// 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`.
9259#[derive(Copy, Clone, Eq, PartialEq)]
9260pub enum CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
9261    None,
9262}
9263impl CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
9264    pub fn as_str(self) -> &'static str {
9265        use CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*;
9266        match self {
9267            None => "none",
9268        }
9269    }
9270}
9271
9272impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
9273    type Err = stripe_types::StripeParseError;
9274    fn from_str(s: &str) -> Result<Self, Self::Err> {
9275        use CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*;
9276        match s {
9277            "none" => Ok(None),
9278            _ => Err(stripe_types::StripeParseError),
9279        }
9280    }
9281}
9282impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
9283    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9284        f.write_str(self.as_str())
9285    }
9286}
9287
9288impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
9289    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9290        f.write_str(self.as_str())
9291    }
9292}
9293impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
9294    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9295    where
9296        S: serde::Serializer,
9297    {
9298        serializer.serialize_str(self.as_str())
9299    }
9300}
9301#[cfg(feature = "deserialize")]
9302impl<'de> serde::Deserialize<'de>
9303    for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage
9304{
9305    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9306        use std::str::FromStr;
9307        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9308        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage"))
9309    }
9310}
9311/// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options.
9312#[derive(Copy, Clone, Debug, serde::Serialize)]
9313pub struct CreatePaymentIntentPaymentMethodOptionsRevolutPay {
9314    /// Controls when the funds are captured from the customer's account.
9315    ///
9316    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
9317    ///
9318    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
9319    #[serde(skip_serializing_if = "Option::is_none")]
9320    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod>,
9321    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9322    ///
9323    /// 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.
9324    /// 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.
9325    ///
9326    /// 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.
9327    ///
9328    /// 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).
9329    #[serde(skip_serializing_if = "Option::is_none")]
9330    pub setup_future_usage:
9331        Option<CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage>,
9332}
9333impl CreatePaymentIntentPaymentMethodOptionsRevolutPay {
9334    pub fn new() -> Self {
9335        Self { capture_method: None, setup_future_usage: None }
9336    }
9337}
9338impl Default for CreatePaymentIntentPaymentMethodOptionsRevolutPay {
9339    fn default() -> Self {
9340        Self::new()
9341    }
9342}
9343/// Controls when the funds are captured from the customer's account.
9344///
9345/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
9346///
9347/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
9348#[derive(Copy, Clone, Eq, PartialEq)]
9349pub enum CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
9350    Manual,
9351}
9352impl CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
9353    pub fn as_str(self) -> &'static str {
9354        use CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod::*;
9355        match self {
9356            Manual => "manual",
9357        }
9358    }
9359}
9360
9361impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
9362    type Err = stripe_types::StripeParseError;
9363    fn from_str(s: &str) -> Result<Self, Self::Err> {
9364        use CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod::*;
9365        match s {
9366            "manual" => Ok(Manual),
9367            _ => Err(stripe_types::StripeParseError),
9368        }
9369    }
9370}
9371impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
9372    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9373        f.write_str(self.as_str())
9374    }
9375}
9376
9377impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
9378    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9379        f.write_str(self.as_str())
9380    }
9381}
9382impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
9383    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9384    where
9385        S: serde::Serializer,
9386    {
9387        serializer.serialize_str(self.as_str())
9388    }
9389}
9390#[cfg(feature = "deserialize")]
9391impl<'de> serde::Deserialize<'de>
9392    for CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod
9393{
9394    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9395        use std::str::FromStr;
9396        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9397        Self::from_str(&s).map_err(|_| {
9398            serde::de::Error::custom(
9399                "Unknown value for CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod",
9400            )
9401        })
9402    }
9403}
9404/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9405///
9406/// 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.
9407/// 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.
9408///
9409/// 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.
9410///
9411/// 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).
9412#[derive(Copy, Clone, Eq, PartialEq)]
9413pub enum CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
9414    None,
9415    OffSession,
9416}
9417impl CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
9418    pub fn as_str(self) -> &'static str {
9419        use CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*;
9420        match self {
9421            None => "none",
9422            OffSession => "off_session",
9423        }
9424    }
9425}
9426
9427impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
9428    type Err = stripe_types::StripeParseError;
9429    fn from_str(s: &str) -> Result<Self, Self::Err> {
9430        use CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*;
9431        match s {
9432            "none" => Ok(None),
9433            "off_session" => Ok(OffSession),
9434            _ => Err(stripe_types::StripeParseError),
9435        }
9436    }
9437}
9438impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
9439    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9440        f.write_str(self.as_str())
9441    }
9442}
9443
9444impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
9445    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9446        f.write_str(self.as_str())
9447    }
9448}
9449impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
9450    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9451    where
9452        S: serde::Serializer,
9453    {
9454        serializer.serialize_str(self.as_str())
9455    }
9456}
9457#[cfg(feature = "deserialize")]
9458impl<'de> serde::Deserialize<'de>
9459    for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage
9460{
9461    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9462        use std::str::FromStr;
9463        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9464        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage"))
9465    }
9466}
9467/// If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options.
9468#[derive(Copy, Clone, Debug, serde::Serialize)]
9469pub struct CreatePaymentIntentPaymentMethodOptionsSamsungPay {
9470    /// Controls when the funds are captured from the customer's account.
9471    ///
9472    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
9473    ///
9474    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
9475    #[serde(skip_serializing_if = "Option::is_none")]
9476    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod>,
9477}
9478impl CreatePaymentIntentPaymentMethodOptionsSamsungPay {
9479    pub fn new() -> Self {
9480        Self { capture_method: None }
9481    }
9482}
9483impl Default for CreatePaymentIntentPaymentMethodOptionsSamsungPay {
9484    fn default() -> Self {
9485        Self::new()
9486    }
9487}
9488/// Controls when the funds are captured from the customer's account.
9489///
9490/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
9491///
9492/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
9493#[derive(Copy, Clone, Eq, PartialEq)]
9494pub enum CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
9495    Manual,
9496}
9497impl CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
9498    pub fn as_str(self) -> &'static str {
9499        use CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod::*;
9500        match self {
9501            Manual => "manual",
9502        }
9503    }
9504}
9505
9506impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
9507    type Err = stripe_types::StripeParseError;
9508    fn from_str(s: &str) -> Result<Self, Self::Err> {
9509        use CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod::*;
9510        match s {
9511            "manual" => Ok(Manual),
9512            _ => Err(stripe_types::StripeParseError),
9513        }
9514    }
9515}
9516impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
9517    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9518        f.write_str(self.as_str())
9519    }
9520}
9521
9522impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
9523    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9524        f.write_str(self.as_str())
9525    }
9526}
9527impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
9528    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9529    where
9530        S: serde::Serializer,
9531    {
9532        serializer.serialize_str(self.as_str())
9533    }
9534}
9535#[cfg(feature = "deserialize")]
9536impl<'de> serde::Deserialize<'de>
9537    for CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod
9538{
9539    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9540        use std::str::FromStr;
9541        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9542        Self::from_str(&s).map_err(|_| {
9543            serde::de::Error::custom(
9544                "Unknown value for CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod",
9545            )
9546        })
9547    }
9548}
9549/// If this is a `satispay` PaymentMethod, this sub-hash contains details about the Satispay payment method options.
9550#[derive(Copy, Clone, Debug, serde::Serialize)]
9551pub struct CreatePaymentIntentPaymentMethodOptionsSatispay {
9552    /// Controls when the funds are captured from the customer's account.
9553    ///
9554    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
9555    ///
9556    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
9557    #[serde(skip_serializing_if = "Option::is_none")]
9558    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod>,
9559}
9560impl CreatePaymentIntentPaymentMethodOptionsSatispay {
9561    pub fn new() -> Self {
9562        Self { capture_method: None }
9563    }
9564}
9565impl Default for CreatePaymentIntentPaymentMethodOptionsSatispay {
9566    fn default() -> Self {
9567        Self::new()
9568    }
9569}
9570/// Controls when the funds are captured from the customer's account.
9571///
9572/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
9573///
9574/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
9575#[derive(Copy, Clone, Eq, PartialEq)]
9576pub enum CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
9577    Manual,
9578}
9579impl CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
9580    pub fn as_str(self) -> &'static str {
9581        use CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod::*;
9582        match self {
9583            Manual => "manual",
9584        }
9585    }
9586}
9587
9588impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
9589    type Err = stripe_types::StripeParseError;
9590    fn from_str(s: &str) -> Result<Self, Self::Err> {
9591        use CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod::*;
9592        match s {
9593            "manual" => Ok(Manual),
9594            _ => Err(stripe_types::StripeParseError),
9595        }
9596    }
9597}
9598impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
9599    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9600        f.write_str(self.as_str())
9601    }
9602}
9603
9604impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
9605    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9606        f.write_str(self.as_str())
9607    }
9608}
9609impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
9610    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9611    where
9612        S: serde::Serializer,
9613    {
9614        serializer.serialize_str(self.as_str())
9615    }
9616}
9617#[cfg(feature = "deserialize")]
9618impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
9619    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9620        use std::str::FromStr;
9621        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9622        Self::from_str(&s).map_err(|_| {
9623            serde::de::Error::custom(
9624                "Unknown value for CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod",
9625            )
9626        })
9627    }
9628}
9629/// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options.
9630#[derive(Clone, Debug, serde::Serialize)]
9631pub struct CreatePaymentIntentPaymentMethodOptionsSepaDebit {
9632    /// Additional fields for Mandate creation
9633    #[serde(skip_serializing_if = "Option::is_none")]
9634    pub mandate_options: Option<CreatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions>,
9635    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9636    ///
9637    /// 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.
9638    /// 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.
9639    ///
9640    /// 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.
9641    ///
9642    /// 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).
9643    ///
9644    /// 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`.
9645    #[serde(skip_serializing_if = "Option::is_none")]
9646    pub setup_future_usage:
9647        Option<CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage>,
9648    /// Controls when Stripe will attempt to debit the funds from the customer's account.
9649    /// The date must be a string in YYYY-MM-DD format.
9650    /// The date must be in the future and between 3 and 15 calendar days from now.
9651    #[serde(skip_serializing_if = "Option::is_none")]
9652    pub target_date: Option<String>,
9653}
9654impl CreatePaymentIntentPaymentMethodOptionsSepaDebit {
9655    pub fn new() -> Self {
9656        Self { mandate_options: None, setup_future_usage: None, target_date: None }
9657    }
9658}
9659impl Default for CreatePaymentIntentPaymentMethodOptionsSepaDebit {
9660    fn default() -> Self {
9661        Self::new()
9662    }
9663}
9664/// Additional fields for Mandate creation
9665#[derive(Clone, Debug, serde::Serialize)]
9666pub struct CreatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
9667    /// Prefix used to generate the Mandate reference.
9668    /// Must be at most 12 characters long.
9669    /// Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'.
9670    /// Cannot begin with 'STRIPE'.
9671    #[serde(skip_serializing_if = "Option::is_none")]
9672    pub reference_prefix: Option<String>,
9673}
9674impl CreatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
9675    pub fn new() -> Self {
9676        Self { reference_prefix: None }
9677    }
9678}
9679impl Default for CreatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
9680    fn default() -> Self {
9681        Self::new()
9682    }
9683}
9684/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9685///
9686/// 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.
9687/// 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.
9688///
9689/// 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.
9690///
9691/// 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).
9692///
9693/// 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`.
9694#[derive(Copy, Clone, Eq, PartialEq)]
9695pub enum CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
9696    None,
9697    OffSession,
9698    OnSession,
9699}
9700impl CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
9701    pub fn as_str(self) -> &'static str {
9702        use CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*;
9703        match self {
9704            None => "none",
9705            OffSession => "off_session",
9706            OnSession => "on_session",
9707        }
9708    }
9709}
9710
9711impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
9712    type Err = stripe_types::StripeParseError;
9713    fn from_str(s: &str) -> Result<Self, Self::Err> {
9714        use CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*;
9715        match s {
9716            "none" => Ok(None),
9717            "off_session" => Ok(OffSession),
9718            "on_session" => Ok(OnSession),
9719            _ => Err(stripe_types::StripeParseError),
9720        }
9721    }
9722}
9723impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
9724    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9725        f.write_str(self.as_str())
9726    }
9727}
9728
9729impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
9730    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9731        f.write_str(self.as_str())
9732    }
9733}
9734impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
9735    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9736    where
9737        S: serde::Serializer,
9738    {
9739        serializer.serialize_str(self.as_str())
9740    }
9741}
9742#[cfg(feature = "deserialize")]
9743impl<'de> serde::Deserialize<'de>
9744    for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage
9745{
9746    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9747        use std::str::FromStr;
9748        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9749        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage"))
9750    }
9751}
9752/// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options.
9753#[derive(Copy, Clone, Debug, serde::Serialize)]
9754pub struct CreatePaymentIntentPaymentMethodOptionsSofort {
9755    /// Language shown to the payer on redirect.
9756    #[serde(skip_serializing_if = "Option::is_none")]
9757    pub preferred_language: Option<CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage>,
9758    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9759    ///
9760    /// 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.
9761    /// 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.
9762    ///
9763    /// 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.
9764    ///
9765    /// 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).
9766    ///
9767    /// 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`.
9768    #[serde(skip_serializing_if = "Option::is_none")]
9769    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage>,
9770}
9771impl CreatePaymentIntentPaymentMethodOptionsSofort {
9772    pub fn new() -> Self {
9773        Self { preferred_language: None, setup_future_usage: None }
9774    }
9775}
9776impl Default for CreatePaymentIntentPaymentMethodOptionsSofort {
9777    fn default() -> Self {
9778        Self::new()
9779    }
9780}
9781/// Language shown to the payer on redirect.
9782#[derive(Copy, Clone, Eq, PartialEq)]
9783pub enum CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
9784    De,
9785    En,
9786    Es,
9787    Fr,
9788    It,
9789    Nl,
9790    Pl,
9791}
9792impl CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
9793    pub fn as_str(self) -> &'static str {
9794        use CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*;
9795        match self {
9796            De => "de",
9797            En => "en",
9798            Es => "es",
9799            Fr => "fr",
9800            It => "it",
9801            Nl => "nl",
9802            Pl => "pl",
9803        }
9804    }
9805}
9806
9807impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
9808    type Err = stripe_types::StripeParseError;
9809    fn from_str(s: &str) -> Result<Self, Self::Err> {
9810        use CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*;
9811        match s {
9812            "de" => Ok(De),
9813            "en" => Ok(En),
9814            "es" => Ok(Es),
9815            "fr" => Ok(Fr),
9816            "it" => Ok(It),
9817            "nl" => Ok(Nl),
9818            "pl" => Ok(Pl),
9819            _ => Err(stripe_types::StripeParseError),
9820        }
9821    }
9822}
9823impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
9824    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9825        f.write_str(self.as_str())
9826    }
9827}
9828
9829impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
9830    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9831        f.write_str(self.as_str())
9832    }
9833}
9834impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
9835    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9836    where
9837        S: serde::Serializer,
9838    {
9839        serializer.serialize_str(self.as_str())
9840    }
9841}
9842#[cfg(feature = "deserialize")]
9843impl<'de> serde::Deserialize<'de>
9844    for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage
9845{
9846    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9847        use std::str::FromStr;
9848        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9849        Self::from_str(&s).map_err(|_| {
9850            serde::de::Error::custom(
9851                "Unknown value for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage",
9852            )
9853        })
9854    }
9855}
9856/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9857///
9858/// 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.
9859/// 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.
9860///
9861/// 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.
9862///
9863/// 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).
9864///
9865/// 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`.
9866#[derive(Copy, Clone, Eq, PartialEq)]
9867pub enum CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
9868    None,
9869    OffSession,
9870}
9871impl CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
9872    pub fn as_str(self) -> &'static str {
9873        use CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*;
9874        match self {
9875            None => "none",
9876            OffSession => "off_session",
9877        }
9878    }
9879}
9880
9881impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
9882    type Err = stripe_types::StripeParseError;
9883    fn from_str(s: &str) -> Result<Self, Self::Err> {
9884        use CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*;
9885        match s {
9886            "none" => Ok(None),
9887            "off_session" => Ok(OffSession),
9888            _ => Err(stripe_types::StripeParseError),
9889        }
9890    }
9891}
9892impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
9893    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9894        f.write_str(self.as_str())
9895    }
9896}
9897
9898impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
9899    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9900        f.write_str(self.as_str())
9901    }
9902}
9903impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
9904    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9905    where
9906        S: serde::Serializer,
9907    {
9908        serializer.serialize_str(self.as_str())
9909    }
9910}
9911#[cfg(feature = "deserialize")]
9912impl<'de> serde::Deserialize<'de>
9913    for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage
9914{
9915    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9916        use std::str::FromStr;
9917        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9918        Self::from_str(&s).map_err(|_| {
9919            serde::de::Error::custom(
9920                "Unknown value for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage",
9921            )
9922        })
9923    }
9924}
9925/// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options.
9926#[derive(Clone, Debug, serde::Serialize)]
9927pub struct CreatePaymentIntentPaymentMethodOptionsSwish {
9928    /// A reference for this payment to be displayed in the Swish app.
9929    #[serde(skip_serializing_if = "Option::is_none")]
9930    pub reference: Option<String>,
9931    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9932    ///
9933    /// 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.
9934    /// 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.
9935    ///
9936    /// 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.
9937    ///
9938    /// 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).
9939    ///
9940    /// 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`.
9941    #[serde(skip_serializing_if = "Option::is_none")]
9942    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage>,
9943}
9944impl CreatePaymentIntentPaymentMethodOptionsSwish {
9945    pub fn new() -> Self {
9946        Self { reference: None, setup_future_usage: None }
9947    }
9948}
9949impl Default for CreatePaymentIntentPaymentMethodOptionsSwish {
9950    fn default() -> Self {
9951        Self::new()
9952    }
9953}
9954/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9955///
9956/// 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.
9957/// 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.
9958///
9959/// 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.
9960///
9961/// 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).
9962///
9963/// 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`.
9964#[derive(Copy, Clone, Eq, PartialEq)]
9965pub enum CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
9966    None,
9967}
9968impl CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
9969    pub fn as_str(self) -> &'static str {
9970        use CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::*;
9971        match self {
9972            None => "none",
9973        }
9974    }
9975}
9976
9977impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
9978    type Err = stripe_types::StripeParseError;
9979    fn from_str(s: &str) -> Result<Self, Self::Err> {
9980        use CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::*;
9981        match s {
9982            "none" => Ok(None),
9983            _ => Err(stripe_types::StripeParseError),
9984        }
9985    }
9986}
9987impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
9988    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9989        f.write_str(self.as_str())
9990    }
9991}
9992
9993impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
9994    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9995        f.write_str(self.as_str())
9996    }
9997}
9998impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
9999    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10000    where
10001        S: serde::Serializer,
10002    {
10003        serializer.serialize_str(self.as_str())
10004    }
10005}
10006#[cfg(feature = "deserialize")]
10007impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
10008    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10009        use std::str::FromStr;
10010        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10011        Self::from_str(&s).map_err(|_| {
10012            serde::de::Error::custom(
10013                "Unknown value for CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage",
10014            )
10015        })
10016    }
10017}
10018/// If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options.
10019#[derive(Copy, Clone, Debug, serde::Serialize)]
10020pub struct CreatePaymentIntentPaymentMethodOptionsTwint {
10021    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10022    ///
10023    /// 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.
10024    /// 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.
10025    ///
10026    /// 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.
10027    ///
10028    /// 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).
10029    ///
10030    /// 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`.
10031    #[serde(skip_serializing_if = "Option::is_none")]
10032    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage>,
10033}
10034impl CreatePaymentIntentPaymentMethodOptionsTwint {
10035    pub fn new() -> Self {
10036        Self { setup_future_usage: None }
10037    }
10038}
10039impl Default for CreatePaymentIntentPaymentMethodOptionsTwint {
10040    fn default() -> Self {
10041        Self::new()
10042    }
10043}
10044/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10045///
10046/// 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.
10047/// 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.
10048///
10049/// 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.
10050///
10051/// 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).
10052///
10053/// 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`.
10054#[derive(Copy, Clone, Eq, PartialEq)]
10055pub enum CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
10056    None,
10057}
10058impl CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
10059    pub fn as_str(self) -> &'static str {
10060        use CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage::*;
10061        match self {
10062            None => "none",
10063        }
10064    }
10065}
10066
10067impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
10068    type Err = stripe_types::StripeParseError;
10069    fn from_str(s: &str) -> Result<Self, Self::Err> {
10070        use CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage::*;
10071        match s {
10072            "none" => Ok(None),
10073            _ => Err(stripe_types::StripeParseError),
10074        }
10075    }
10076}
10077impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
10078    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10079        f.write_str(self.as_str())
10080    }
10081}
10082
10083impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
10084    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10085        f.write_str(self.as_str())
10086    }
10087}
10088impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
10089    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10090    where
10091        S: serde::Serializer,
10092    {
10093        serializer.serialize_str(self.as_str())
10094    }
10095}
10096#[cfg(feature = "deserialize")]
10097impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
10098    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10099        use std::str::FromStr;
10100        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10101        Self::from_str(&s).map_err(|_| {
10102            serde::de::Error::custom(
10103                "Unknown value for CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage",
10104            )
10105        })
10106    }
10107}
10108/// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options.
10109#[derive(Clone, Debug, serde::Serialize)]
10110pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccount {
10111    /// Additional fields for Financial Connections Session creation
10112    #[serde(skip_serializing_if = "Option::is_none")]
10113    pub financial_connections:
10114        Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
10115    /// Additional fields for Mandate creation
10116    #[serde(skip_serializing_if = "Option::is_none")]
10117    pub mandate_options: Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
10118    /// Additional fields for network related functions
10119    #[serde(skip_serializing_if = "Option::is_none")]
10120    pub networks: Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks>,
10121    /// Preferred transaction settlement speed
10122    #[serde(skip_serializing_if = "Option::is_none")]
10123    pub preferred_settlement_speed:
10124        Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed>,
10125    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10126    ///
10127    /// 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.
10128    /// 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.
10129    ///
10130    /// 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.
10131    ///
10132    /// 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).
10133    ///
10134    /// 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`.
10135    #[serde(skip_serializing_if = "Option::is_none")]
10136    pub setup_future_usage:
10137        Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage>,
10138    /// Controls when Stripe will attempt to debit the funds from the customer's account.
10139    /// The date must be a string in YYYY-MM-DD format.
10140    /// The date must be in the future and between 3 and 15 calendar days from now.
10141    #[serde(skip_serializing_if = "Option::is_none")]
10142    pub target_date: Option<String>,
10143    /// Bank account verification method.
10144    #[serde(skip_serializing_if = "Option::is_none")]
10145    pub verification_method:
10146        Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
10147}
10148impl CreatePaymentIntentPaymentMethodOptionsUsBankAccount {
10149    pub fn new() -> Self {
10150        Self {
10151            financial_connections: None,
10152            mandate_options: None,
10153            networks: None,
10154            preferred_settlement_speed: None,
10155            setup_future_usage: None,
10156            target_date: None,
10157            verification_method: None,
10158        }
10159    }
10160}
10161impl Default for CreatePaymentIntentPaymentMethodOptionsUsBankAccount {
10162    fn default() -> Self {
10163        Self::new()
10164    }
10165}
10166/// Additional fields for Financial Connections Session creation
10167#[derive(Clone, Debug, serde::Serialize)]
10168pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
10169    /// Provide filters for the linked accounts that the customer can select for the payment method.
10170    #[serde(skip_serializing_if = "Option::is_none")]
10171    pub filters:
10172        Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
10173    /// The list of permissions to request.
10174    /// If this parameter is passed, the `payment_method` permission must be included.
10175    /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
10176    #[serde(skip_serializing_if = "Option::is_none")]
10177    pub permissions: Option<
10178        Vec<CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
10179    >,
10180    /// List of data features that you would like to retrieve upon account creation.
10181    #[serde(skip_serializing_if = "Option::is_none")]
10182    pub prefetch: Option<
10183        Vec<CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>,
10184    >,
10185    /// For webview integrations only.
10186    /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.
10187    #[serde(skip_serializing_if = "Option::is_none")]
10188    pub return_url: Option<String>,
10189}
10190impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
10191    pub fn new() -> Self {
10192        Self { filters: None, permissions: None, prefetch: None, return_url: None }
10193    }
10194}
10195impl Default for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
10196    fn default() -> Self {
10197        Self::new()
10198    }
10199}
10200/// Provide filters for the linked accounts that the customer can select for the payment method.
10201#[derive(Clone, Debug, serde::Serialize)]
10202pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
10203        /// The account subcategories to use to filter for selectable accounts.
10204    /// Valid subcategories are `checking` and `savings`.
10205#[serde(skip_serializing_if = "Option::is_none")]
10206pub account_subcategories: Option<Vec<CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
10207
10208}
10209impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
10210    pub fn new() -> Self {
10211        Self { account_subcategories: None }
10212    }
10213}
10214impl Default for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
10215    fn default() -> Self {
10216        Self::new()
10217    }
10218}
10219/// The account subcategories to use to filter for selectable accounts.
10220/// Valid subcategories are `checking` and `savings`.
10221#[derive(Copy, Clone, Eq, PartialEq)]
10222pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
10223{
10224    Checking,
10225    Savings,
10226}
10227impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
10228    pub fn as_str(self) -> &'static str {
10229        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
10230        match self {
10231Checking => "checking",
10232Savings => "savings",
10233
10234        }
10235    }
10236}
10237
10238impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
10239    type Err = stripe_types::StripeParseError;
10240    fn from_str(s: &str) -> Result<Self, Self::Err> {
10241        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
10242        match s {
10243    "checking" => Ok(Checking),
10244"savings" => Ok(Savings),
10245_ => Err(stripe_types::StripeParseError)
10246
10247        }
10248    }
10249}
10250impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
10251    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10252        f.write_str(self.as_str())
10253    }
10254}
10255
10256impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
10257    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10258        f.write_str(self.as_str())
10259    }
10260}
10261impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
10262    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
10263        serializer.serialize_str(self.as_str())
10264    }
10265}
10266#[cfg(feature = "deserialize")]
10267impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
10268    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10269        use std::str::FromStr;
10270        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10271        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"))
10272    }
10273}
10274/// The list of permissions to request.
10275/// If this parameter is passed, the `payment_method` permission must be included.
10276/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
10277#[derive(Copy, Clone, Eq, PartialEq)]
10278pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
10279    Balances,
10280    Ownership,
10281    PaymentMethod,
10282    Transactions,
10283}
10284impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
10285    pub fn as_str(self) -> &'static str {
10286        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
10287        match self {
10288            Balances => "balances",
10289            Ownership => "ownership",
10290            PaymentMethod => "payment_method",
10291            Transactions => "transactions",
10292        }
10293    }
10294}
10295
10296impl std::str::FromStr
10297    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
10298{
10299    type Err = stripe_types::StripeParseError;
10300    fn from_str(s: &str) -> Result<Self, Self::Err> {
10301        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
10302        match s {
10303            "balances" => Ok(Balances),
10304            "ownership" => Ok(Ownership),
10305            "payment_method" => Ok(PaymentMethod),
10306            "transactions" => Ok(Transactions),
10307            _ => Err(stripe_types::StripeParseError),
10308        }
10309    }
10310}
10311impl std::fmt::Display
10312    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
10313{
10314    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10315        f.write_str(self.as_str())
10316    }
10317}
10318
10319impl std::fmt::Debug
10320    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
10321{
10322    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10323        f.write_str(self.as_str())
10324    }
10325}
10326impl serde::Serialize
10327    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
10328{
10329    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10330    where
10331        S: serde::Serializer,
10332    {
10333        serializer.serialize_str(self.as_str())
10334    }
10335}
10336#[cfg(feature = "deserialize")]
10337impl<'de> serde::Deserialize<'de>
10338    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
10339{
10340    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10341        use std::str::FromStr;
10342        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10343        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"))
10344    }
10345}
10346/// List of data features that you would like to retrieve upon account creation.
10347#[derive(Copy, Clone, Eq, PartialEq)]
10348pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
10349    Balances,
10350    Ownership,
10351    Transactions,
10352}
10353impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
10354    pub fn as_str(self) -> &'static str {
10355        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
10356        match self {
10357            Balances => "balances",
10358            Ownership => "ownership",
10359            Transactions => "transactions",
10360        }
10361    }
10362}
10363
10364impl std::str::FromStr
10365    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
10366{
10367    type Err = stripe_types::StripeParseError;
10368    fn from_str(s: &str) -> Result<Self, Self::Err> {
10369        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
10370        match s {
10371            "balances" => Ok(Balances),
10372            "ownership" => Ok(Ownership),
10373            "transactions" => Ok(Transactions),
10374            _ => Err(stripe_types::StripeParseError),
10375        }
10376    }
10377}
10378impl std::fmt::Display
10379    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
10380{
10381    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10382        f.write_str(self.as_str())
10383    }
10384}
10385
10386impl std::fmt::Debug
10387    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
10388{
10389    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10390        f.write_str(self.as_str())
10391    }
10392}
10393impl serde::Serialize
10394    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
10395{
10396    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10397    where
10398        S: serde::Serializer,
10399    {
10400        serializer.serialize_str(self.as_str())
10401    }
10402}
10403#[cfg(feature = "deserialize")]
10404impl<'de> serde::Deserialize<'de>
10405    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
10406{
10407    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10408        use std::str::FromStr;
10409        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10410        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"))
10411    }
10412}
10413/// Additional fields for Mandate creation
10414#[derive(Copy, Clone, Debug, serde::Serialize)]
10415pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
10416    /// The method used to collect offline mandate customer acceptance.
10417    #[serde(skip_serializing_if = "Option::is_none")]
10418    pub collection_method:
10419        Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
10420}
10421impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
10422    pub fn new() -> Self {
10423        Self { collection_method: None }
10424    }
10425}
10426impl Default for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
10427    fn default() -> Self {
10428        Self::new()
10429    }
10430}
10431/// The method used to collect offline mandate customer acceptance.
10432#[derive(Copy, Clone, Eq, PartialEq)]
10433pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
10434    Paper,
10435}
10436impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
10437    pub fn as_str(self) -> &'static str {
10438        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
10439        match self {
10440            Paper => "paper",
10441        }
10442    }
10443}
10444
10445impl std::str::FromStr
10446    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
10447{
10448    type Err = stripe_types::StripeParseError;
10449    fn from_str(s: &str) -> Result<Self, Self::Err> {
10450        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
10451        match s {
10452            "paper" => Ok(Paper),
10453            _ => Err(stripe_types::StripeParseError),
10454        }
10455    }
10456}
10457impl std::fmt::Display
10458    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
10459{
10460    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10461        f.write_str(self.as_str())
10462    }
10463}
10464
10465impl std::fmt::Debug
10466    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
10467{
10468    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10469        f.write_str(self.as_str())
10470    }
10471}
10472impl serde::Serialize
10473    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
10474{
10475    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10476    where
10477        S: serde::Serializer,
10478    {
10479        serializer.serialize_str(self.as_str())
10480    }
10481}
10482#[cfg(feature = "deserialize")]
10483impl<'de> serde::Deserialize<'de>
10484    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
10485{
10486    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10487        use std::str::FromStr;
10488        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10489        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"))
10490    }
10491}
10492/// Additional fields for network related functions
10493#[derive(Clone, Debug, serde::Serialize)]
10494pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
10495    /// Triggers validations to run across the selected networks
10496    #[serde(skip_serializing_if = "Option::is_none")]
10497    pub requested:
10498        Option<Vec<CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
10499}
10500impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
10501    pub fn new() -> Self {
10502        Self { requested: None }
10503    }
10504}
10505impl Default for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
10506    fn default() -> Self {
10507        Self::new()
10508    }
10509}
10510/// Triggers validations to run across the selected networks
10511#[derive(Copy, Clone, Eq, PartialEq)]
10512pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
10513    Ach,
10514    UsDomesticWire,
10515}
10516impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
10517    pub fn as_str(self) -> &'static str {
10518        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
10519        match self {
10520            Ach => "ach",
10521            UsDomesticWire => "us_domestic_wire",
10522        }
10523    }
10524}
10525
10526impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
10527    type Err = stripe_types::StripeParseError;
10528    fn from_str(s: &str) -> Result<Self, Self::Err> {
10529        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
10530        match s {
10531            "ach" => Ok(Ach),
10532            "us_domestic_wire" => Ok(UsDomesticWire),
10533            _ => Err(stripe_types::StripeParseError),
10534        }
10535    }
10536}
10537impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
10538    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10539        f.write_str(self.as_str())
10540    }
10541}
10542
10543impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
10544    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10545        f.write_str(self.as_str())
10546    }
10547}
10548impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
10549    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10550    where
10551        S: serde::Serializer,
10552    {
10553        serializer.serialize_str(self.as_str())
10554    }
10555}
10556#[cfg(feature = "deserialize")]
10557impl<'de> serde::Deserialize<'de>
10558    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested
10559{
10560    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10561        use std::str::FromStr;
10562        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10563        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested"))
10564    }
10565}
10566/// Preferred transaction settlement speed
10567#[derive(Copy, Clone, Eq, PartialEq)]
10568pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed {
10569    Fastest,
10570    Standard,
10571}
10572impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed {
10573    pub fn as_str(self) -> &'static str {
10574        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*;
10575        match self {
10576            Fastest => "fastest",
10577            Standard => "standard",
10578        }
10579    }
10580}
10581
10582impl std::str::FromStr
10583    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
10584{
10585    type Err = stripe_types::StripeParseError;
10586    fn from_str(s: &str) -> Result<Self, Self::Err> {
10587        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*;
10588        match s {
10589            "fastest" => Ok(Fastest),
10590            "standard" => Ok(Standard),
10591            _ => Err(stripe_types::StripeParseError),
10592        }
10593    }
10594}
10595impl std::fmt::Display
10596    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
10597{
10598    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10599        f.write_str(self.as_str())
10600    }
10601}
10602
10603impl std::fmt::Debug
10604    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
10605{
10606    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10607        f.write_str(self.as_str())
10608    }
10609}
10610impl serde::Serialize
10611    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
10612{
10613    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10614    where
10615        S: serde::Serializer,
10616    {
10617        serializer.serialize_str(self.as_str())
10618    }
10619}
10620#[cfg(feature = "deserialize")]
10621impl<'de> serde::Deserialize<'de>
10622    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
10623{
10624    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10625        use std::str::FromStr;
10626        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10627        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed"))
10628    }
10629}
10630/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10631///
10632/// 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.
10633/// 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.
10634///
10635/// 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.
10636///
10637/// 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).
10638///
10639/// 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`.
10640#[derive(Copy, Clone, Eq, PartialEq)]
10641pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
10642    None,
10643    OffSession,
10644    OnSession,
10645}
10646impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
10647    pub fn as_str(self) -> &'static str {
10648        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*;
10649        match self {
10650            None => "none",
10651            OffSession => "off_session",
10652            OnSession => "on_session",
10653        }
10654    }
10655}
10656
10657impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
10658    type Err = stripe_types::StripeParseError;
10659    fn from_str(s: &str) -> Result<Self, Self::Err> {
10660        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*;
10661        match s {
10662            "none" => Ok(None),
10663            "off_session" => Ok(OffSession),
10664            "on_session" => Ok(OnSession),
10665            _ => Err(stripe_types::StripeParseError),
10666        }
10667    }
10668}
10669impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
10670    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10671        f.write_str(self.as_str())
10672    }
10673}
10674
10675impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
10676    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10677        f.write_str(self.as_str())
10678    }
10679}
10680impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
10681    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10682    where
10683        S: serde::Serializer,
10684    {
10685        serializer.serialize_str(self.as_str())
10686    }
10687}
10688#[cfg(feature = "deserialize")]
10689impl<'de> serde::Deserialize<'de>
10690    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage
10691{
10692    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10693        use std::str::FromStr;
10694        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10695        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage"))
10696    }
10697}
10698/// Bank account verification method.
10699#[derive(Copy, Clone, Eq, PartialEq)]
10700pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
10701    Automatic,
10702    Instant,
10703    Microdeposits,
10704}
10705impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
10706    pub fn as_str(self) -> &'static str {
10707        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
10708        match self {
10709            Automatic => "automatic",
10710            Instant => "instant",
10711            Microdeposits => "microdeposits",
10712        }
10713    }
10714}
10715
10716impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
10717    type Err = stripe_types::StripeParseError;
10718    fn from_str(s: &str) -> Result<Self, Self::Err> {
10719        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
10720        match s {
10721            "automatic" => Ok(Automatic),
10722            "instant" => Ok(Instant),
10723            "microdeposits" => Ok(Microdeposits),
10724            _ => Err(stripe_types::StripeParseError),
10725        }
10726    }
10727}
10728impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
10729    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10730        f.write_str(self.as_str())
10731    }
10732}
10733
10734impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
10735    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10736        f.write_str(self.as_str())
10737    }
10738}
10739impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
10740    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10741    where
10742        S: serde::Serializer,
10743    {
10744        serializer.serialize_str(self.as_str())
10745    }
10746}
10747#[cfg(feature = "deserialize")]
10748impl<'de> serde::Deserialize<'de>
10749    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod
10750{
10751    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10752        use std::str::FromStr;
10753        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10754        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod"))
10755    }
10756}
10757/// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options.
10758#[derive(Clone, Debug, serde::Serialize)]
10759pub struct CreatePaymentIntentPaymentMethodOptionsWechatPay {
10760    /// The app ID registered with WeChat Pay. Only required when client is ios or android.
10761    #[serde(skip_serializing_if = "Option::is_none")]
10762    pub app_id: Option<String>,
10763    /// The client type that the end customer will pay from
10764    #[serde(skip_serializing_if = "Option::is_none")]
10765    pub client: Option<CreatePaymentIntentPaymentMethodOptionsWechatPayClient>,
10766    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10767    ///
10768    /// 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.
10769    /// 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.
10770    ///
10771    /// 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.
10772    ///
10773    /// 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).
10774    ///
10775    /// 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`.
10776    #[serde(skip_serializing_if = "Option::is_none")]
10777    pub setup_future_usage:
10778        Option<CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage>,
10779}
10780impl CreatePaymentIntentPaymentMethodOptionsWechatPay {
10781    pub fn new() -> Self {
10782        Self { app_id: None, client: None, setup_future_usage: None }
10783    }
10784}
10785impl Default for CreatePaymentIntentPaymentMethodOptionsWechatPay {
10786    fn default() -> Self {
10787        Self::new()
10788    }
10789}
10790/// The client type that the end customer will pay from
10791#[derive(Copy, Clone, Eq, PartialEq)]
10792pub enum CreatePaymentIntentPaymentMethodOptionsWechatPayClient {
10793    Android,
10794    Ios,
10795    Web,
10796}
10797impl CreatePaymentIntentPaymentMethodOptionsWechatPayClient {
10798    pub fn as_str(self) -> &'static str {
10799        use CreatePaymentIntentPaymentMethodOptionsWechatPayClient::*;
10800        match self {
10801            Android => "android",
10802            Ios => "ios",
10803            Web => "web",
10804        }
10805    }
10806}
10807
10808impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsWechatPayClient {
10809    type Err = stripe_types::StripeParseError;
10810    fn from_str(s: &str) -> Result<Self, Self::Err> {
10811        use CreatePaymentIntentPaymentMethodOptionsWechatPayClient::*;
10812        match s {
10813            "android" => Ok(Android),
10814            "ios" => Ok(Ios),
10815            "web" => Ok(Web),
10816            _ => Err(stripe_types::StripeParseError),
10817        }
10818    }
10819}
10820impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsWechatPayClient {
10821    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10822        f.write_str(self.as_str())
10823    }
10824}
10825
10826impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsWechatPayClient {
10827    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10828        f.write_str(self.as_str())
10829    }
10830}
10831impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsWechatPayClient {
10832    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10833    where
10834        S: serde::Serializer,
10835    {
10836        serializer.serialize_str(self.as_str())
10837    }
10838}
10839#[cfg(feature = "deserialize")]
10840impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsWechatPayClient {
10841    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10842        use std::str::FromStr;
10843        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10844        Self::from_str(&s).map_err(|_| {
10845            serde::de::Error::custom(
10846                "Unknown value for CreatePaymentIntentPaymentMethodOptionsWechatPayClient",
10847            )
10848        })
10849    }
10850}
10851/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10852///
10853/// 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.
10854/// 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.
10855///
10856/// 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.
10857///
10858/// 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).
10859///
10860/// 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`.
10861#[derive(Copy, Clone, Eq, PartialEq)]
10862pub enum CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
10863    None,
10864}
10865impl CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
10866    pub fn as_str(self) -> &'static str {
10867        use CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*;
10868        match self {
10869            None => "none",
10870        }
10871    }
10872}
10873
10874impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
10875    type Err = stripe_types::StripeParseError;
10876    fn from_str(s: &str) -> Result<Self, Self::Err> {
10877        use CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*;
10878        match s {
10879            "none" => Ok(None),
10880            _ => Err(stripe_types::StripeParseError),
10881        }
10882    }
10883}
10884impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
10885    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10886        f.write_str(self.as_str())
10887    }
10888}
10889
10890impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
10891    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10892        f.write_str(self.as_str())
10893    }
10894}
10895impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
10896    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10897    where
10898        S: serde::Serializer,
10899    {
10900        serializer.serialize_str(self.as_str())
10901    }
10902}
10903#[cfg(feature = "deserialize")]
10904impl<'de> serde::Deserialize<'de>
10905    for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage
10906{
10907    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10908        use std::str::FromStr;
10909        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10910        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage"))
10911    }
10912}
10913/// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options.
10914#[derive(Copy, Clone, Debug, serde::Serialize)]
10915pub struct CreatePaymentIntentPaymentMethodOptionsZip {
10916    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10917    ///
10918    /// 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.
10919    /// 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.
10920    ///
10921    /// 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.
10922    ///
10923    /// 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).
10924    ///
10925    /// 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`.
10926    #[serde(skip_serializing_if = "Option::is_none")]
10927    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage>,
10928}
10929impl CreatePaymentIntentPaymentMethodOptionsZip {
10930    pub fn new() -> Self {
10931        Self { setup_future_usage: None }
10932    }
10933}
10934impl Default for CreatePaymentIntentPaymentMethodOptionsZip {
10935    fn default() -> Self {
10936        Self::new()
10937    }
10938}
10939/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10940///
10941/// 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.
10942/// 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.
10943///
10944/// 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.
10945///
10946/// 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).
10947///
10948/// 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`.
10949#[derive(Copy, Clone, Eq, PartialEq)]
10950pub enum CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
10951    None,
10952}
10953impl CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
10954    pub fn as_str(self) -> &'static str {
10955        use CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*;
10956        match self {
10957            None => "none",
10958        }
10959    }
10960}
10961
10962impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
10963    type Err = stripe_types::StripeParseError;
10964    fn from_str(s: &str) -> Result<Self, Self::Err> {
10965        use CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*;
10966        match s {
10967            "none" => Ok(None),
10968            _ => Err(stripe_types::StripeParseError),
10969        }
10970    }
10971}
10972impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
10973    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10974        f.write_str(self.as_str())
10975    }
10976}
10977
10978impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
10979    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10980        f.write_str(self.as_str())
10981    }
10982}
10983impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
10984    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10985    where
10986        S: serde::Serializer,
10987    {
10988        serializer.serialize_str(self.as_str())
10989    }
10990}
10991#[cfg(feature = "deserialize")]
10992impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
10993    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10994        use std::str::FromStr;
10995        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10996        Self::from_str(&s).map_err(|_| {
10997            serde::de::Error::custom(
10998                "Unknown value for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage",
10999            )
11000        })
11001    }
11002}
11003/// Shipping information for this PaymentIntent.
11004#[derive(Clone, Debug, serde::Serialize)]
11005pub struct CreatePaymentIntentShipping {
11006    /// Shipping address.
11007    pub address: CreatePaymentIntentShippingAddress,
11008    /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
11009    #[serde(skip_serializing_if = "Option::is_none")]
11010    pub carrier: Option<String>,
11011    /// Recipient name.
11012    pub name: String,
11013    /// Recipient phone (including extension).
11014    #[serde(skip_serializing_if = "Option::is_none")]
11015    pub phone: Option<String>,
11016    /// The tracking number for a physical product, obtained from the delivery service.
11017    /// If multiple tracking numbers were generated for this purchase, please separate them with commas.
11018    #[serde(skip_serializing_if = "Option::is_none")]
11019    pub tracking_number: Option<String>,
11020}
11021impl CreatePaymentIntentShipping {
11022    pub fn new(
11023        address: impl Into<CreatePaymentIntentShippingAddress>,
11024        name: impl Into<String>,
11025    ) -> Self {
11026        Self {
11027            address: address.into(),
11028            carrier: None,
11029            name: name.into(),
11030            phone: None,
11031            tracking_number: None,
11032        }
11033    }
11034}
11035/// Shipping address.
11036#[derive(Clone, Debug, serde::Serialize)]
11037pub struct CreatePaymentIntentShippingAddress {
11038    /// City, district, suburb, town, or village.
11039    #[serde(skip_serializing_if = "Option::is_none")]
11040    pub city: Option<String>,
11041    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
11042    #[serde(skip_serializing_if = "Option::is_none")]
11043    pub country: Option<String>,
11044    /// Address line 1, such as the street, PO Box, or company name.
11045    #[serde(skip_serializing_if = "Option::is_none")]
11046    pub line1: Option<String>,
11047    /// Address line 2, such as the apartment, suite, unit, or building.
11048    #[serde(skip_serializing_if = "Option::is_none")]
11049    pub line2: Option<String>,
11050    /// ZIP or postal code.
11051    #[serde(skip_serializing_if = "Option::is_none")]
11052    pub postal_code: Option<String>,
11053    /// State, county, province, or region.
11054    #[serde(skip_serializing_if = "Option::is_none")]
11055    pub state: Option<String>,
11056}
11057impl CreatePaymentIntentShippingAddress {
11058    pub fn new() -> Self {
11059        Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
11060    }
11061}
11062impl Default for CreatePaymentIntentShippingAddress {
11063    fn default() -> Self {
11064        Self::new()
11065    }
11066}
11067/// The parameters that you can use to automatically create a Transfer.
11068/// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
11069#[derive(Clone, Debug, serde::Serialize)]
11070pub struct CreatePaymentIntentTransferData {
11071    /// The amount that will be transferred automatically when a charge succeeds.
11072    /// The amount is capped at the total transaction amount and if no amount is set,
11073    /// the full amount is transferred.
11074    ///
11075    /// If you intend to collect a fee and you need a more robust reporting experience, using
11076    /// [application_fee_amount](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-application_fee_amount).
11077    /// might be a better fit for your integration.
11078    #[serde(skip_serializing_if = "Option::is_none")]
11079    pub amount: Option<i64>,
11080    /// If specified, successful charges will be attributed to the destination
11081    /// account for tax reporting, and the funds from charges will be transferred
11082    /// to the destination account. The ID of the resulting transfer will be
11083    /// returned on the successful charge's `transfer` field.
11084    pub destination: String,
11085}
11086impl CreatePaymentIntentTransferData {
11087    pub fn new(destination: impl Into<String>) -> Self {
11088        Self { amount: None, destination: destination.into() }
11089    }
11090}
11091/// Creates a PaymentIntent object.
11092///
11093/// After the PaymentIntent is created, attach a payment method and [confirm](https://stripe.com/docs/api/payment_intents/confirm).
11094/// to continue the payment. Learn more about [the available payment flows
11095/// with the Payment Intents API](https://stripe.com/docs/payments/payment-intents).
11096///
11097/// When you use `confirm=true` during creation, it’s equivalent to creating
11098/// and confirming the PaymentIntent in the same call. You can use any parameters
11099/// available in the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) when you supply
11100/// `confirm=true`.
11101#[derive(Clone, Debug, serde::Serialize)]
11102pub struct CreatePaymentIntent {
11103    inner: CreatePaymentIntentBuilder,
11104}
11105impl CreatePaymentIntent {
11106    /// Construct a new `CreatePaymentIntent`.
11107    pub fn new(amount: impl Into<i64>, currency: impl Into<stripe_types::Currency>) -> Self {
11108        Self { inner: CreatePaymentIntentBuilder::new(amount.into(), currency.into()) }
11109    }
11110    /// 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.
11111    /// The amount of the application fee collected will be capped at the total amount captured.
11112    /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
11113    pub fn application_fee_amount(mut self, application_fee_amount: impl Into<i64>) -> Self {
11114        self.inner.application_fee_amount = Some(application_fee_amount.into());
11115        self
11116    }
11117    /// When you enable this parameter, this PaymentIntent accepts payment methods that you enable in the Dashboard and that are compatible with this PaymentIntent's other parameters.
11118    pub fn automatic_payment_methods(
11119        mut self,
11120        automatic_payment_methods: impl Into<CreatePaymentIntentAutomaticPaymentMethods>,
11121    ) -> Self {
11122        self.inner.automatic_payment_methods = Some(automatic_payment_methods.into());
11123        self
11124    }
11125    /// Controls when the funds will be captured from the customer's account.
11126    pub fn capture_method(
11127        mut self,
11128        capture_method: impl Into<stripe_shared::PaymentIntentCaptureMethod>,
11129    ) -> Self {
11130        self.inner.capture_method = Some(capture_method.into());
11131        self
11132    }
11133    /// Set to `true` to attempt to [confirm this PaymentIntent](https://stripe.com/docs/api/payment_intents/confirm) immediately.
11134    /// This parameter defaults to `false`.
11135    /// When creating and confirming a PaymentIntent at the same time, you can also provide the parameters available in the [Confirm API](https://stripe.com/docs/api/payment_intents/confirm).
11136    pub fn confirm(mut self, confirm: impl Into<bool>) -> Self {
11137        self.inner.confirm = Some(confirm.into());
11138        self
11139    }
11140    /// Describes whether we can confirm this PaymentIntent automatically, or if it requires customer action to confirm the payment.
11141    pub fn confirmation_method(
11142        mut self,
11143        confirmation_method: impl Into<stripe_shared::PaymentIntentConfirmationMethod>,
11144    ) -> Self {
11145        self.inner.confirmation_method = Some(confirmation_method.into());
11146        self
11147    }
11148    /// ID of the ConfirmationToken used to confirm this PaymentIntent.
11149    ///
11150    /// If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence.
11151    pub fn confirmation_token(mut self, confirmation_token: impl Into<String>) -> Self {
11152        self.inner.confirmation_token = Some(confirmation_token.into());
11153        self
11154    }
11155    /// ID of the Customer this PaymentIntent belongs to, if one exists.
11156    ///
11157    /// Payment methods attached to other Customers cannot be used with this PaymentIntent.
11158    ///
11159    /// If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete.
11160    /// If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead.
11161    pub fn customer(mut self, customer: impl Into<String>) -> Self {
11162        self.inner.customer = Some(customer.into());
11163        self
11164    }
11165    /// An arbitrary string attached to the object. Often useful for displaying to users.
11166    pub fn description(mut self, description: impl Into<String>) -> Self {
11167        self.inner.description = Some(description.into());
11168        self
11169    }
11170    /// Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`.
11171    /// Use this parameter for simpler integrations that don't handle customer actions, such as [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication).
11172    /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
11173    pub fn error_on_requires_action(mut self, error_on_requires_action: impl Into<bool>) -> Self {
11174        self.inner.error_on_requires_action = Some(error_on_requires_action.into());
11175        self
11176    }
11177    /// The list of payment method types to exclude from use with this payment.
11178    pub fn excluded_payment_method_types(
11179        mut self,
11180        excluded_payment_method_types: impl Into<
11181            Vec<stripe_shared::PaymentIntentExcludedPaymentMethodTypes>,
11182        >,
11183    ) -> Self {
11184        self.inner.excluded_payment_method_types = Some(excluded_payment_method_types.into());
11185        self
11186    }
11187    /// Specifies which fields in the response should be expanded.
11188    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
11189        self.inner.expand = Some(expand.into());
11190        self
11191    }
11192    /// ID of the mandate that's used for this payment.
11193    /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
11194    pub fn mandate(mut self, mandate: impl Into<String>) -> Self {
11195        self.inner.mandate = Some(mandate.into());
11196        self
11197    }
11198    /// This hash contains details about the Mandate to create.
11199    /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
11200    pub fn mandate_data(mut self, mandate_data: impl Into<CreatePaymentIntentMandateData>) -> Self {
11201        self.inner.mandate_data = Some(mandate_data.into());
11202        self
11203    }
11204    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
11205    /// This can be useful for storing additional information about the object in a structured format.
11206    /// Individual keys can be unset by posting an empty value to them.
11207    /// All keys can be unset by posting an empty value to `metadata`.
11208    pub fn metadata(
11209        mut self,
11210        metadata: impl Into<std::collections::HashMap<String, String>>,
11211    ) -> Self {
11212        self.inner.metadata = Some(metadata.into());
11213        self
11214    }
11215    /// Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate.
11216    /// Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards).
11217    /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
11218    pub fn off_session(mut self, off_session: impl Into<CreatePaymentIntentOffSession>) -> Self {
11219        self.inner.off_session = Some(off_session.into());
11220        self
11221    }
11222    /// The Stripe account ID that these funds are intended for.
11223    /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
11224    pub fn on_behalf_of(mut self, on_behalf_of: impl Into<String>) -> Self {
11225        self.inner.on_behalf_of = Some(on_behalf_of.into());
11226        self
11227    }
11228    /// ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods#compatibility) object) to attach to this PaymentIntent.
11229    ///
11230    /// If you don't provide the `payment_method` parameter or the `source` parameter with `confirm=true`, `source` automatically populates with `customer.default_source` to improve migration for users of the Charges API.
11231    /// We recommend that you explicitly provide the `payment_method` moving forward.
11232    /// If the payment method is attached to a Customer, you must also provide the ID of that Customer as the [customer](https://stripe.com/docs/api#create_payment_intent-customer) parameter of this PaymentIntent.
11233    /// end
11234    pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
11235        self.inner.payment_method = Some(payment_method.into());
11236        self
11237    }
11238    /// The ID of the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) to use with this PaymentIntent.
11239    pub fn payment_method_configuration(
11240        mut self,
11241        payment_method_configuration: impl Into<String>,
11242    ) -> Self {
11243        self.inner.payment_method_configuration = Some(payment_method_configuration.into());
11244        self
11245    }
11246    /// If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear
11247    /// in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method).
11248    /// property on the PaymentIntent.
11249    pub fn payment_method_data(
11250        mut self,
11251        payment_method_data: impl Into<CreatePaymentIntentPaymentMethodData>,
11252    ) -> Self {
11253        self.inner.payment_method_data = Some(payment_method_data.into());
11254        self
11255    }
11256    /// Payment method-specific configuration for this PaymentIntent.
11257    pub fn payment_method_options(
11258        mut self,
11259        payment_method_options: impl Into<CreatePaymentIntentPaymentMethodOptions>,
11260    ) -> Self {
11261        self.inner.payment_method_options = Some(payment_method_options.into());
11262        self
11263    }
11264    /// The list of payment method types (for example, a card) that this PaymentIntent can use.
11265    /// If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods).
11266    /// A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type).
11267    pub fn payment_method_types(mut self, payment_method_types: impl Into<Vec<String>>) -> Self {
11268        self.inner.payment_method_types = Some(payment_method_types.into());
11269        self
11270    }
11271    /// Options to configure Radar.
11272    /// Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session).
11273    pub fn radar_options(
11274        mut self,
11275        radar_options: impl Into<RadarOptionsWithHiddenOptions>,
11276    ) -> Self {
11277        self.inner.radar_options = Some(radar_options.into());
11278        self
11279    }
11280    /// Email address to send the receipt to.
11281    /// If you specify `receipt_email` for a payment in live mode, you send a receipt regardless of your [email settings](https://dashboard.stripe.com/account/emails).
11282    pub fn receipt_email(mut self, receipt_email: impl Into<String>) -> Self {
11283        self.inner.receipt_email = Some(receipt_email.into());
11284        self
11285    }
11286    /// The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site.
11287    /// If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme.
11288    /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
11289    pub fn return_url(mut self, return_url: impl Into<String>) -> Self {
11290        self.inner.return_url = Some(return_url.into());
11291        self
11292    }
11293    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
11294    ///
11295    /// 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.
11296    /// 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.
11297    ///
11298    /// 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.
11299    ///
11300    /// 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).
11301    pub fn setup_future_usage(
11302        mut self,
11303        setup_future_usage: impl Into<stripe_shared::PaymentIntentSetupFutureUsage>,
11304    ) -> Self {
11305        self.inner.setup_future_usage = Some(setup_future_usage.into());
11306        self
11307    }
11308    /// Shipping information for this PaymentIntent.
11309    pub fn shipping(mut self, shipping: impl Into<CreatePaymentIntentShipping>) -> Self {
11310        self.inner.shipping = Some(shipping.into());
11311        self
11312    }
11313    /// Text that appears on the customer's statement as the statement descriptor for a non-card charge.
11314    /// This value overrides the account's default statement descriptor.
11315    /// For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors).
11316    ///
11317    /// Setting this value for a card charge returns an error.
11318    /// For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead.
11319    pub fn statement_descriptor(mut self, statement_descriptor: impl Into<String>) -> Self {
11320        self.inner.statement_descriptor = Some(statement_descriptor.into());
11321        self
11322    }
11323    /// Provides information about a card charge.
11324    /// 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.
11325    pub fn statement_descriptor_suffix(
11326        mut self,
11327        statement_descriptor_suffix: impl Into<String>,
11328    ) -> Self {
11329        self.inner.statement_descriptor_suffix = Some(statement_descriptor_suffix.into());
11330        self
11331    }
11332    /// The parameters that you can use to automatically create a Transfer.
11333    /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
11334    pub fn transfer_data(
11335        mut self,
11336        transfer_data: impl Into<CreatePaymentIntentTransferData>,
11337    ) -> Self {
11338        self.inner.transfer_data = Some(transfer_data.into());
11339        self
11340    }
11341    /// A string that identifies the resulting payment as part of a group.
11342    /// Learn more about the [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers).
11343    pub fn transfer_group(mut self, transfer_group: impl Into<String>) -> Self {
11344        self.inner.transfer_group = Some(transfer_group.into());
11345        self
11346    }
11347    /// Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions.
11348    pub fn use_stripe_sdk(mut self, use_stripe_sdk: impl Into<bool>) -> Self {
11349        self.inner.use_stripe_sdk = Some(use_stripe_sdk.into());
11350        self
11351    }
11352}
11353impl CreatePaymentIntent {
11354    /// Send the request and return the deserialized response.
11355    pub async fn send<C: StripeClient>(
11356        &self,
11357        client: &C,
11358    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
11359        self.customize().send(client).await
11360    }
11361
11362    /// Send the request and return the deserialized response, blocking until completion.
11363    pub fn send_blocking<C: StripeBlockingClient>(
11364        &self,
11365        client: &C,
11366    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
11367        self.customize().send_blocking(client)
11368    }
11369}
11370
11371impl StripeRequest for CreatePaymentIntent {
11372    type Output = stripe_shared::PaymentIntent;
11373
11374    fn build(&self) -> RequestBuilder {
11375        RequestBuilder::new(StripeMethod::Post, "/payment_intents").form(&self.inner)
11376    }
11377}
11378#[derive(Clone, Debug, serde::Serialize)]
11379struct UpdatePaymentIntentBuilder {
11380    #[serde(skip_serializing_if = "Option::is_none")]
11381    amount: Option<i64>,
11382    #[serde(skip_serializing_if = "Option::is_none")]
11383    application_fee_amount: Option<i64>,
11384    #[serde(skip_serializing_if = "Option::is_none")]
11385    capture_method: Option<stripe_shared::PaymentIntentCaptureMethod>,
11386    #[serde(skip_serializing_if = "Option::is_none")]
11387    currency: Option<stripe_types::Currency>,
11388    #[serde(skip_serializing_if = "Option::is_none")]
11389    customer: Option<String>,
11390    #[serde(skip_serializing_if = "Option::is_none")]
11391    description: Option<String>,
11392    #[serde(skip_serializing_if = "Option::is_none")]
11393    excluded_payment_method_types:
11394        Option<Vec<stripe_shared::PaymentIntentExcludedPaymentMethodTypes>>,
11395    #[serde(skip_serializing_if = "Option::is_none")]
11396    expand: Option<Vec<String>>,
11397    #[serde(skip_serializing_if = "Option::is_none")]
11398    metadata: Option<std::collections::HashMap<String, String>>,
11399    #[serde(skip_serializing_if = "Option::is_none")]
11400    payment_method: Option<String>,
11401    #[serde(skip_serializing_if = "Option::is_none")]
11402    payment_method_configuration: Option<String>,
11403    #[serde(skip_serializing_if = "Option::is_none")]
11404    payment_method_data: Option<UpdatePaymentIntentPaymentMethodData>,
11405    #[serde(skip_serializing_if = "Option::is_none")]
11406    payment_method_options: Option<UpdatePaymentIntentPaymentMethodOptions>,
11407    #[serde(skip_serializing_if = "Option::is_none")]
11408    payment_method_types: Option<Vec<String>>,
11409    #[serde(skip_serializing_if = "Option::is_none")]
11410    receipt_email: Option<String>,
11411    #[serde(skip_serializing_if = "Option::is_none")]
11412    setup_future_usage: Option<stripe_shared::PaymentIntentSetupFutureUsage>,
11413    #[serde(skip_serializing_if = "Option::is_none")]
11414    shipping: Option<UpdatePaymentIntentShipping>,
11415    #[serde(skip_serializing_if = "Option::is_none")]
11416    statement_descriptor: Option<String>,
11417    #[serde(skip_serializing_if = "Option::is_none")]
11418    statement_descriptor_suffix: Option<String>,
11419    #[serde(skip_serializing_if = "Option::is_none")]
11420    transfer_data: Option<UpdatePaymentIntentTransferData>,
11421    #[serde(skip_serializing_if = "Option::is_none")]
11422    transfer_group: Option<String>,
11423}
11424impl UpdatePaymentIntentBuilder {
11425    fn new() -> Self {
11426        Self {
11427            amount: None,
11428            application_fee_amount: None,
11429            capture_method: None,
11430            currency: None,
11431            customer: None,
11432            description: None,
11433            excluded_payment_method_types: None,
11434            expand: None,
11435            metadata: None,
11436            payment_method: None,
11437            payment_method_configuration: None,
11438            payment_method_data: None,
11439            payment_method_options: None,
11440            payment_method_types: None,
11441            receipt_email: None,
11442            setup_future_usage: None,
11443            shipping: None,
11444            statement_descriptor: None,
11445            statement_descriptor_suffix: None,
11446            transfer_data: None,
11447            transfer_group: None,
11448        }
11449    }
11450}
11451/// If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear
11452/// in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method).
11453/// property on the PaymentIntent.
11454#[derive(Clone, Debug, serde::Serialize)]
11455pub struct UpdatePaymentIntentPaymentMethodData {
11456    /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
11457    #[serde(skip_serializing_if = "Option::is_none")]
11458    pub acss_debit: Option<PaymentMethodParam>,
11459    /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
11460    #[serde(skip_serializing_if = "Option::is_none")]
11461    #[serde(with = "stripe_types::with_serde_json_opt")]
11462    pub affirm: Option<miniserde::json::Value>,
11463    /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
11464    #[serde(skip_serializing_if = "Option::is_none")]
11465    #[serde(with = "stripe_types::with_serde_json_opt")]
11466    pub afterpay_clearpay: Option<miniserde::json::Value>,
11467    /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
11468    #[serde(skip_serializing_if = "Option::is_none")]
11469    #[serde(with = "stripe_types::with_serde_json_opt")]
11470    pub alipay: Option<miniserde::json::Value>,
11471    /// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
11472    /// Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow.
11473    /// The field defaults to `unspecified`.
11474    #[serde(skip_serializing_if = "Option::is_none")]
11475    pub allow_redisplay: Option<UpdatePaymentIntentPaymentMethodDataAllowRedisplay>,
11476    /// If this is a Alma PaymentMethod, this hash contains details about the Alma payment method.
11477    #[serde(skip_serializing_if = "Option::is_none")]
11478    #[serde(with = "stripe_types::with_serde_json_opt")]
11479    pub alma: Option<miniserde::json::Value>,
11480    /// If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method.
11481    #[serde(skip_serializing_if = "Option::is_none")]
11482    #[serde(with = "stripe_types::with_serde_json_opt")]
11483    pub amazon_pay: Option<miniserde::json::Value>,
11484    /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
11485    #[serde(skip_serializing_if = "Option::is_none")]
11486    pub au_becs_debit: Option<UpdatePaymentIntentPaymentMethodDataAuBecsDebit>,
11487    /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
11488    #[serde(skip_serializing_if = "Option::is_none")]
11489    pub bacs_debit: Option<UpdatePaymentIntentPaymentMethodDataBacsDebit>,
11490    /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
11491    #[serde(skip_serializing_if = "Option::is_none")]
11492    #[serde(with = "stripe_types::with_serde_json_opt")]
11493    pub bancontact: Option<miniserde::json::Value>,
11494    /// If this is a `billie` PaymentMethod, this hash contains details about the Billie payment method.
11495    #[serde(skip_serializing_if = "Option::is_none")]
11496    #[serde(with = "stripe_types::with_serde_json_opt")]
11497    pub billie: Option<miniserde::json::Value>,
11498    /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
11499    #[serde(skip_serializing_if = "Option::is_none")]
11500    pub billing_details: Option<UpdatePaymentIntentPaymentMethodDataBillingDetails>,
11501    /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
11502    #[serde(skip_serializing_if = "Option::is_none")]
11503    #[serde(with = "stripe_types::with_serde_json_opt")]
11504    pub blik: Option<miniserde::json::Value>,
11505    /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
11506    #[serde(skip_serializing_if = "Option::is_none")]
11507    pub boleto: Option<UpdatePaymentIntentPaymentMethodDataBoleto>,
11508    /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
11509    #[serde(skip_serializing_if = "Option::is_none")]
11510    #[serde(with = "stripe_types::with_serde_json_opt")]
11511    pub cashapp: Option<miniserde::json::Value>,
11512    /// If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method.
11513    #[serde(skip_serializing_if = "Option::is_none")]
11514    #[serde(with = "stripe_types::with_serde_json_opt")]
11515    pub crypto: Option<miniserde::json::Value>,
11516    /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
11517    #[serde(skip_serializing_if = "Option::is_none")]
11518    #[serde(with = "stripe_types::with_serde_json_opt")]
11519    pub customer_balance: Option<miniserde::json::Value>,
11520    /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
11521    #[serde(skip_serializing_if = "Option::is_none")]
11522    pub eps: Option<UpdatePaymentIntentPaymentMethodDataEps>,
11523    /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
11524    #[serde(skip_serializing_if = "Option::is_none")]
11525    pub fpx: Option<UpdatePaymentIntentPaymentMethodDataFpx>,
11526    /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
11527    #[serde(skip_serializing_if = "Option::is_none")]
11528    #[serde(with = "stripe_types::with_serde_json_opt")]
11529    pub giropay: Option<miniserde::json::Value>,
11530    /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
11531    #[serde(skip_serializing_if = "Option::is_none")]
11532    #[serde(with = "stripe_types::with_serde_json_opt")]
11533    pub grabpay: Option<miniserde::json::Value>,
11534    /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
11535    #[serde(skip_serializing_if = "Option::is_none")]
11536    pub ideal: Option<UpdatePaymentIntentPaymentMethodDataIdeal>,
11537    /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
11538    #[serde(skip_serializing_if = "Option::is_none")]
11539    #[serde(with = "stripe_types::with_serde_json_opt")]
11540    pub interac_present: Option<miniserde::json::Value>,
11541    /// If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method.
11542    #[serde(skip_serializing_if = "Option::is_none")]
11543    #[serde(with = "stripe_types::with_serde_json_opt")]
11544    pub kakao_pay: Option<miniserde::json::Value>,
11545    /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
11546    #[serde(skip_serializing_if = "Option::is_none")]
11547    pub klarna: Option<UpdatePaymentIntentPaymentMethodDataKlarna>,
11548    /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
11549    #[serde(skip_serializing_if = "Option::is_none")]
11550    #[serde(with = "stripe_types::with_serde_json_opt")]
11551    pub konbini: Option<miniserde::json::Value>,
11552    /// If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method.
11553    #[serde(skip_serializing_if = "Option::is_none")]
11554    #[serde(with = "stripe_types::with_serde_json_opt")]
11555    pub kr_card: Option<miniserde::json::Value>,
11556    /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
11557    #[serde(skip_serializing_if = "Option::is_none")]
11558    #[serde(with = "stripe_types::with_serde_json_opt")]
11559    pub link: Option<miniserde::json::Value>,
11560    /// If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method.
11561    #[serde(skip_serializing_if = "Option::is_none")]
11562    #[serde(with = "stripe_types::with_serde_json_opt")]
11563    pub mb_way: Option<miniserde::json::Value>,
11564    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
11565    /// This can be useful for storing additional information about the object in a structured format.
11566    /// Individual keys can be unset by posting an empty value to them.
11567    /// All keys can be unset by posting an empty value to `metadata`.
11568    #[serde(skip_serializing_if = "Option::is_none")]
11569    pub metadata: Option<std::collections::HashMap<String, String>>,
11570    /// If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
11571    #[serde(skip_serializing_if = "Option::is_none")]
11572    #[serde(with = "stripe_types::with_serde_json_opt")]
11573    pub mobilepay: Option<miniserde::json::Value>,
11574    /// If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method.
11575    #[serde(skip_serializing_if = "Option::is_none")]
11576    #[serde(with = "stripe_types::with_serde_json_opt")]
11577    pub multibanco: Option<miniserde::json::Value>,
11578    /// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
11579    #[serde(skip_serializing_if = "Option::is_none")]
11580    pub naver_pay: Option<UpdatePaymentIntentPaymentMethodDataNaverPay>,
11581    /// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
11582    #[serde(skip_serializing_if = "Option::is_none")]
11583    pub nz_bank_account: Option<UpdatePaymentIntentPaymentMethodDataNzBankAccount>,
11584    /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
11585    #[serde(skip_serializing_if = "Option::is_none")]
11586    #[serde(with = "stripe_types::with_serde_json_opt")]
11587    pub oxxo: Option<miniserde::json::Value>,
11588    /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
11589    #[serde(skip_serializing_if = "Option::is_none")]
11590    pub p24: Option<UpdatePaymentIntentPaymentMethodDataP24>,
11591    /// If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method.
11592    #[serde(skip_serializing_if = "Option::is_none")]
11593    #[serde(with = "stripe_types::with_serde_json_opt")]
11594    pub pay_by_bank: Option<miniserde::json::Value>,
11595    /// If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method.
11596    #[serde(skip_serializing_if = "Option::is_none")]
11597    #[serde(with = "stripe_types::with_serde_json_opt")]
11598    pub payco: Option<miniserde::json::Value>,
11599    /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
11600    #[serde(skip_serializing_if = "Option::is_none")]
11601    #[serde(with = "stripe_types::with_serde_json_opt")]
11602    pub paynow: Option<miniserde::json::Value>,
11603    /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
11604    #[serde(skip_serializing_if = "Option::is_none")]
11605    #[serde(with = "stripe_types::with_serde_json_opt")]
11606    pub paypal: Option<miniserde::json::Value>,
11607    /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
11608    #[serde(skip_serializing_if = "Option::is_none")]
11609    #[serde(with = "stripe_types::with_serde_json_opt")]
11610    pub pix: Option<miniserde::json::Value>,
11611    /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
11612    #[serde(skip_serializing_if = "Option::is_none")]
11613    #[serde(with = "stripe_types::with_serde_json_opt")]
11614    pub promptpay: Option<miniserde::json::Value>,
11615    /// Options to configure Radar.
11616    /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
11617    #[serde(skip_serializing_if = "Option::is_none")]
11618    pub radar_options: Option<RadarOptionsWithHiddenOptions>,
11619    /// If this is a `revolut_pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
11620    #[serde(skip_serializing_if = "Option::is_none")]
11621    #[serde(with = "stripe_types::with_serde_json_opt")]
11622    pub revolut_pay: Option<miniserde::json::Value>,
11623    /// If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method.
11624    #[serde(skip_serializing_if = "Option::is_none")]
11625    #[serde(with = "stripe_types::with_serde_json_opt")]
11626    pub samsung_pay: Option<miniserde::json::Value>,
11627    /// If this is a `satispay` PaymentMethod, this hash contains details about the Satispay payment method.
11628    #[serde(skip_serializing_if = "Option::is_none")]
11629    #[serde(with = "stripe_types::with_serde_json_opt")]
11630    pub satispay: Option<miniserde::json::Value>,
11631    /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
11632    #[serde(skip_serializing_if = "Option::is_none")]
11633    pub sepa_debit: Option<UpdatePaymentIntentPaymentMethodDataSepaDebit>,
11634    /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
11635    #[serde(skip_serializing_if = "Option::is_none")]
11636    pub sofort: Option<UpdatePaymentIntentPaymentMethodDataSofort>,
11637    /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
11638    #[serde(skip_serializing_if = "Option::is_none")]
11639    #[serde(with = "stripe_types::with_serde_json_opt")]
11640    pub swish: Option<miniserde::json::Value>,
11641    /// If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method.
11642    #[serde(skip_serializing_if = "Option::is_none")]
11643    #[serde(with = "stripe_types::with_serde_json_opt")]
11644    pub twint: Option<miniserde::json::Value>,
11645    /// The type of the PaymentMethod.
11646    /// An additional hash is included on the PaymentMethod with a name matching this value.
11647    /// It contains additional information specific to the PaymentMethod type.
11648    #[serde(rename = "type")]
11649    pub type_: UpdatePaymentIntentPaymentMethodDataType,
11650    /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
11651    #[serde(skip_serializing_if = "Option::is_none")]
11652    pub us_bank_account: Option<UpdatePaymentIntentPaymentMethodDataUsBankAccount>,
11653    /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
11654    #[serde(skip_serializing_if = "Option::is_none")]
11655    #[serde(with = "stripe_types::with_serde_json_opt")]
11656    pub wechat_pay: Option<miniserde::json::Value>,
11657    /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
11658    #[serde(skip_serializing_if = "Option::is_none")]
11659    #[serde(with = "stripe_types::with_serde_json_opt")]
11660    pub zip: Option<miniserde::json::Value>,
11661}
11662impl UpdatePaymentIntentPaymentMethodData {
11663    pub fn new(type_: impl Into<UpdatePaymentIntentPaymentMethodDataType>) -> Self {
11664        Self {
11665            acss_debit: None,
11666            affirm: None,
11667            afterpay_clearpay: None,
11668            alipay: None,
11669            allow_redisplay: None,
11670            alma: None,
11671            amazon_pay: None,
11672            au_becs_debit: None,
11673            bacs_debit: None,
11674            bancontact: None,
11675            billie: None,
11676            billing_details: None,
11677            blik: None,
11678            boleto: None,
11679            cashapp: None,
11680            crypto: None,
11681            customer_balance: None,
11682            eps: None,
11683            fpx: None,
11684            giropay: None,
11685            grabpay: None,
11686            ideal: None,
11687            interac_present: None,
11688            kakao_pay: None,
11689            klarna: None,
11690            konbini: None,
11691            kr_card: None,
11692            link: None,
11693            mb_way: None,
11694            metadata: None,
11695            mobilepay: None,
11696            multibanco: None,
11697            naver_pay: None,
11698            nz_bank_account: None,
11699            oxxo: None,
11700            p24: None,
11701            pay_by_bank: None,
11702            payco: None,
11703            paynow: None,
11704            paypal: None,
11705            pix: None,
11706            promptpay: None,
11707            radar_options: None,
11708            revolut_pay: None,
11709            samsung_pay: None,
11710            satispay: None,
11711            sepa_debit: None,
11712            sofort: None,
11713            swish: None,
11714            twint: None,
11715            type_: type_.into(),
11716            us_bank_account: None,
11717            wechat_pay: None,
11718            zip: None,
11719        }
11720    }
11721}
11722/// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
11723/// Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow.
11724/// The field defaults to `unspecified`.
11725#[derive(Copy, Clone, Eq, PartialEq)]
11726pub enum UpdatePaymentIntentPaymentMethodDataAllowRedisplay {
11727    Always,
11728    Limited,
11729    Unspecified,
11730}
11731impl UpdatePaymentIntentPaymentMethodDataAllowRedisplay {
11732    pub fn as_str(self) -> &'static str {
11733        use UpdatePaymentIntentPaymentMethodDataAllowRedisplay::*;
11734        match self {
11735            Always => "always",
11736            Limited => "limited",
11737            Unspecified => "unspecified",
11738        }
11739    }
11740}
11741
11742impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataAllowRedisplay {
11743    type Err = stripe_types::StripeParseError;
11744    fn from_str(s: &str) -> Result<Self, Self::Err> {
11745        use UpdatePaymentIntentPaymentMethodDataAllowRedisplay::*;
11746        match s {
11747            "always" => Ok(Always),
11748            "limited" => Ok(Limited),
11749            "unspecified" => Ok(Unspecified),
11750            _ => Err(stripe_types::StripeParseError),
11751        }
11752    }
11753}
11754impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataAllowRedisplay {
11755    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11756        f.write_str(self.as_str())
11757    }
11758}
11759
11760impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataAllowRedisplay {
11761    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11762        f.write_str(self.as_str())
11763    }
11764}
11765impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataAllowRedisplay {
11766    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11767    where
11768        S: serde::Serializer,
11769    {
11770        serializer.serialize_str(self.as_str())
11771    }
11772}
11773#[cfg(feature = "deserialize")]
11774impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataAllowRedisplay {
11775    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11776        use std::str::FromStr;
11777        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11778        Self::from_str(&s).map_err(|_| {
11779            serde::de::Error::custom(
11780                "Unknown value for UpdatePaymentIntentPaymentMethodDataAllowRedisplay",
11781            )
11782        })
11783    }
11784}
11785/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
11786#[derive(Clone, Debug, serde::Serialize)]
11787pub struct UpdatePaymentIntentPaymentMethodDataAuBecsDebit {
11788    /// The account number for the bank account.
11789    pub account_number: String,
11790    /// Bank-State-Branch number of the bank account.
11791    pub bsb_number: String,
11792}
11793impl UpdatePaymentIntentPaymentMethodDataAuBecsDebit {
11794    pub fn new(account_number: impl Into<String>, bsb_number: impl Into<String>) -> Self {
11795        Self { account_number: account_number.into(), bsb_number: bsb_number.into() }
11796    }
11797}
11798/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
11799#[derive(Clone, Debug, serde::Serialize)]
11800pub struct UpdatePaymentIntentPaymentMethodDataBacsDebit {
11801    /// Account number of the bank account that the funds will be debited from.
11802    #[serde(skip_serializing_if = "Option::is_none")]
11803    pub account_number: Option<String>,
11804    /// Sort code of the bank account. (e.g., `10-20-30`)
11805    #[serde(skip_serializing_if = "Option::is_none")]
11806    pub sort_code: Option<String>,
11807}
11808impl UpdatePaymentIntentPaymentMethodDataBacsDebit {
11809    pub fn new() -> Self {
11810        Self { account_number: None, sort_code: None }
11811    }
11812}
11813impl Default for UpdatePaymentIntentPaymentMethodDataBacsDebit {
11814    fn default() -> Self {
11815        Self::new()
11816    }
11817}
11818/// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
11819#[derive(Clone, Debug, serde::Serialize)]
11820pub struct UpdatePaymentIntentPaymentMethodDataBillingDetails {
11821    /// Billing address.
11822    #[serde(skip_serializing_if = "Option::is_none")]
11823    pub address: Option<UpdatePaymentIntentPaymentMethodDataBillingDetailsAddress>,
11824    /// Email address.
11825    #[serde(skip_serializing_if = "Option::is_none")]
11826    pub email: Option<String>,
11827    /// Full name.
11828    #[serde(skip_serializing_if = "Option::is_none")]
11829    pub name: Option<String>,
11830    /// Billing phone number (including extension).
11831    #[serde(skip_serializing_if = "Option::is_none")]
11832    pub phone: Option<String>,
11833    /// Taxpayer identification number.
11834    /// Used only for transactions between LATAM buyers and non-LATAM sellers.
11835    #[serde(skip_serializing_if = "Option::is_none")]
11836    pub tax_id: Option<String>,
11837}
11838impl UpdatePaymentIntentPaymentMethodDataBillingDetails {
11839    pub fn new() -> Self {
11840        Self { address: None, email: None, name: None, phone: None, tax_id: None }
11841    }
11842}
11843impl Default for UpdatePaymentIntentPaymentMethodDataBillingDetails {
11844    fn default() -> Self {
11845        Self::new()
11846    }
11847}
11848/// Billing address.
11849#[derive(Clone, Debug, serde::Serialize)]
11850pub struct UpdatePaymentIntentPaymentMethodDataBillingDetailsAddress {
11851    /// City, district, suburb, town, or village.
11852    #[serde(skip_serializing_if = "Option::is_none")]
11853    pub city: Option<String>,
11854    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
11855    #[serde(skip_serializing_if = "Option::is_none")]
11856    pub country: Option<String>,
11857    /// Address line 1, such as the street, PO Box, or company name.
11858    #[serde(skip_serializing_if = "Option::is_none")]
11859    pub line1: Option<String>,
11860    /// Address line 2, such as the apartment, suite, unit, or building.
11861    #[serde(skip_serializing_if = "Option::is_none")]
11862    pub line2: Option<String>,
11863    /// ZIP or postal code.
11864    #[serde(skip_serializing_if = "Option::is_none")]
11865    pub postal_code: Option<String>,
11866    /// State, county, province, or region.
11867    #[serde(skip_serializing_if = "Option::is_none")]
11868    pub state: Option<String>,
11869}
11870impl UpdatePaymentIntentPaymentMethodDataBillingDetailsAddress {
11871    pub fn new() -> Self {
11872        Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
11873    }
11874}
11875impl Default for UpdatePaymentIntentPaymentMethodDataBillingDetailsAddress {
11876    fn default() -> Self {
11877        Self::new()
11878    }
11879}
11880/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
11881#[derive(Clone, Debug, serde::Serialize)]
11882pub struct UpdatePaymentIntentPaymentMethodDataBoleto {
11883    /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)
11884    pub tax_id: String,
11885}
11886impl UpdatePaymentIntentPaymentMethodDataBoleto {
11887    pub fn new(tax_id: impl Into<String>) -> Self {
11888        Self { tax_id: tax_id.into() }
11889    }
11890}
11891/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
11892#[derive(Clone, Debug, serde::Serialize)]
11893pub struct UpdatePaymentIntentPaymentMethodDataEps {
11894    /// The customer's bank.
11895    #[serde(skip_serializing_if = "Option::is_none")]
11896    pub bank: Option<UpdatePaymentIntentPaymentMethodDataEpsBank>,
11897}
11898impl UpdatePaymentIntentPaymentMethodDataEps {
11899    pub fn new() -> Self {
11900        Self { bank: None }
11901    }
11902}
11903impl Default for UpdatePaymentIntentPaymentMethodDataEps {
11904    fn default() -> Self {
11905        Self::new()
11906    }
11907}
11908/// The customer's bank.
11909#[derive(Clone, Eq, PartialEq)]
11910#[non_exhaustive]
11911pub enum UpdatePaymentIntentPaymentMethodDataEpsBank {
11912    ArzteUndApothekerBank,
11913    AustrianAnadiBankAg,
11914    BankAustria,
11915    BankhausCarlSpangler,
11916    BankhausSchelhammerUndSchatteraAg,
11917    BawagPskAg,
11918    BksBankAg,
11919    BrullKallmusBankAg,
11920    BtvVierLanderBank,
11921    CapitalBankGraweGruppeAg,
11922    DeutscheBankAg,
11923    Dolomitenbank,
11924    EasybankAg,
11925    ErsteBankUndSparkassen,
11926    HypoAlpeadriabankInternationalAg,
11927    HypoBankBurgenlandAktiengesellschaft,
11928    HypoNoeLbFurNiederosterreichUWien,
11929    HypoOberosterreichSalzburgSteiermark,
11930    HypoTirolBankAg,
11931    HypoVorarlbergBankAg,
11932    MarchfelderBank,
11933    OberbankAg,
11934    RaiffeisenBankengruppeOsterreich,
11935    SchoellerbankAg,
11936    SpardaBankWien,
11937    VolksbankGruppe,
11938    VolkskreditbankAg,
11939    VrBankBraunau,
11940    /// An unrecognized value from Stripe. Should not be used as a request parameter.
11941    Unknown(String),
11942}
11943impl UpdatePaymentIntentPaymentMethodDataEpsBank {
11944    pub fn as_str(&self) -> &str {
11945        use UpdatePaymentIntentPaymentMethodDataEpsBank::*;
11946        match self {
11947            ArzteUndApothekerBank => "arzte_und_apotheker_bank",
11948            AustrianAnadiBankAg => "austrian_anadi_bank_ag",
11949            BankAustria => "bank_austria",
11950            BankhausCarlSpangler => "bankhaus_carl_spangler",
11951            BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag",
11952            BawagPskAg => "bawag_psk_ag",
11953            BksBankAg => "bks_bank_ag",
11954            BrullKallmusBankAg => "brull_kallmus_bank_ag",
11955            BtvVierLanderBank => "btv_vier_lander_bank",
11956            CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
11957            DeutscheBankAg => "deutsche_bank_ag",
11958            Dolomitenbank => "dolomitenbank",
11959            EasybankAg => "easybank_ag",
11960            ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
11961            HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag",
11962            HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft",
11963            HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien",
11964            HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark",
11965            HypoTirolBankAg => "hypo_tirol_bank_ag",
11966            HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
11967            MarchfelderBank => "marchfelder_bank",
11968            OberbankAg => "oberbank_ag",
11969            RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich",
11970            SchoellerbankAg => "schoellerbank_ag",
11971            SpardaBankWien => "sparda_bank_wien",
11972            VolksbankGruppe => "volksbank_gruppe",
11973            VolkskreditbankAg => "volkskreditbank_ag",
11974            VrBankBraunau => "vr_bank_braunau",
11975            Unknown(v) => v,
11976        }
11977    }
11978}
11979
11980impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataEpsBank {
11981    type Err = std::convert::Infallible;
11982    fn from_str(s: &str) -> Result<Self, Self::Err> {
11983        use UpdatePaymentIntentPaymentMethodDataEpsBank::*;
11984        match s {
11985            "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank),
11986            "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg),
11987            "bank_austria" => Ok(BankAustria),
11988            "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler),
11989            "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg),
11990            "bawag_psk_ag" => Ok(BawagPskAg),
11991            "bks_bank_ag" => Ok(BksBankAg),
11992            "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg),
11993            "btv_vier_lander_bank" => Ok(BtvVierLanderBank),
11994            "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg),
11995            "deutsche_bank_ag" => Ok(DeutscheBankAg),
11996            "dolomitenbank" => Ok(Dolomitenbank),
11997            "easybank_ag" => Ok(EasybankAg),
11998            "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen),
11999            "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg),
12000            "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft),
12001            "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien),
12002            "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark),
12003            "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg),
12004            "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg),
12005            "marchfelder_bank" => Ok(MarchfelderBank),
12006            "oberbank_ag" => Ok(OberbankAg),
12007            "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich),
12008            "schoellerbank_ag" => Ok(SchoellerbankAg),
12009            "sparda_bank_wien" => Ok(SpardaBankWien),
12010            "volksbank_gruppe" => Ok(VolksbankGruppe),
12011            "volkskreditbank_ag" => Ok(VolkskreditbankAg),
12012            "vr_bank_braunau" => Ok(VrBankBraunau),
12013            v => Ok(Unknown(v.to_owned())),
12014        }
12015    }
12016}
12017impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataEpsBank {
12018    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12019        f.write_str(self.as_str())
12020    }
12021}
12022
12023impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataEpsBank {
12024    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12025        f.write_str(self.as_str())
12026    }
12027}
12028impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataEpsBank {
12029    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12030    where
12031        S: serde::Serializer,
12032    {
12033        serializer.serialize_str(self.as_str())
12034    }
12035}
12036#[cfg(feature = "deserialize")]
12037impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataEpsBank {
12038    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12039        use std::str::FromStr;
12040        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12041        Ok(Self::from_str(&s).unwrap())
12042    }
12043}
12044/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
12045#[derive(Clone, Debug, serde::Serialize)]
12046pub struct UpdatePaymentIntentPaymentMethodDataFpx {
12047    /// Account holder type for FPX transaction
12048    #[serde(skip_serializing_if = "Option::is_none")]
12049    pub account_holder_type: Option<UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType>,
12050    /// The customer's bank.
12051    pub bank: UpdatePaymentIntentPaymentMethodDataFpxBank,
12052}
12053impl UpdatePaymentIntentPaymentMethodDataFpx {
12054    pub fn new(bank: impl Into<UpdatePaymentIntentPaymentMethodDataFpxBank>) -> Self {
12055        Self { account_holder_type: None, bank: bank.into() }
12056    }
12057}
12058/// Account holder type for FPX transaction
12059#[derive(Copy, Clone, Eq, PartialEq)]
12060pub enum UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType {
12061    Company,
12062    Individual,
12063}
12064impl UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType {
12065    pub fn as_str(self) -> &'static str {
12066        use UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType::*;
12067        match self {
12068            Company => "company",
12069            Individual => "individual",
12070        }
12071    }
12072}
12073
12074impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType {
12075    type Err = stripe_types::StripeParseError;
12076    fn from_str(s: &str) -> Result<Self, Self::Err> {
12077        use UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType::*;
12078        match s {
12079            "company" => Ok(Company),
12080            "individual" => Ok(Individual),
12081            _ => Err(stripe_types::StripeParseError),
12082        }
12083    }
12084}
12085impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType {
12086    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12087        f.write_str(self.as_str())
12088    }
12089}
12090
12091impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType {
12092    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12093        f.write_str(self.as_str())
12094    }
12095}
12096impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType {
12097    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12098    where
12099        S: serde::Serializer,
12100    {
12101        serializer.serialize_str(self.as_str())
12102    }
12103}
12104#[cfg(feature = "deserialize")]
12105impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType {
12106    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12107        use std::str::FromStr;
12108        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12109        Self::from_str(&s).map_err(|_| {
12110            serde::de::Error::custom(
12111                "Unknown value for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType",
12112            )
12113        })
12114    }
12115}
12116/// The customer's bank.
12117#[derive(Clone, Eq, PartialEq)]
12118#[non_exhaustive]
12119pub enum UpdatePaymentIntentPaymentMethodDataFpxBank {
12120    AffinBank,
12121    Agrobank,
12122    AllianceBank,
12123    Ambank,
12124    BankIslam,
12125    BankMuamalat,
12126    BankOfChina,
12127    BankRakyat,
12128    Bsn,
12129    Cimb,
12130    DeutscheBank,
12131    HongLeongBank,
12132    Hsbc,
12133    Kfh,
12134    Maybank2e,
12135    Maybank2u,
12136    Ocbc,
12137    PbEnterprise,
12138    PublicBank,
12139    Rhb,
12140    StandardChartered,
12141    Uob,
12142    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12143    Unknown(String),
12144}
12145impl UpdatePaymentIntentPaymentMethodDataFpxBank {
12146    pub fn as_str(&self) -> &str {
12147        use UpdatePaymentIntentPaymentMethodDataFpxBank::*;
12148        match self {
12149            AffinBank => "affin_bank",
12150            Agrobank => "agrobank",
12151            AllianceBank => "alliance_bank",
12152            Ambank => "ambank",
12153            BankIslam => "bank_islam",
12154            BankMuamalat => "bank_muamalat",
12155            BankOfChina => "bank_of_china",
12156            BankRakyat => "bank_rakyat",
12157            Bsn => "bsn",
12158            Cimb => "cimb",
12159            DeutscheBank => "deutsche_bank",
12160            HongLeongBank => "hong_leong_bank",
12161            Hsbc => "hsbc",
12162            Kfh => "kfh",
12163            Maybank2e => "maybank2e",
12164            Maybank2u => "maybank2u",
12165            Ocbc => "ocbc",
12166            PbEnterprise => "pb_enterprise",
12167            PublicBank => "public_bank",
12168            Rhb => "rhb",
12169            StandardChartered => "standard_chartered",
12170            Uob => "uob",
12171            Unknown(v) => v,
12172        }
12173    }
12174}
12175
12176impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataFpxBank {
12177    type Err = std::convert::Infallible;
12178    fn from_str(s: &str) -> Result<Self, Self::Err> {
12179        use UpdatePaymentIntentPaymentMethodDataFpxBank::*;
12180        match s {
12181            "affin_bank" => Ok(AffinBank),
12182            "agrobank" => Ok(Agrobank),
12183            "alliance_bank" => Ok(AllianceBank),
12184            "ambank" => Ok(Ambank),
12185            "bank_islam" => Ok(BankIslam),
12186            "bank_muamalat" => Ok(BankMuamalat),
12187            "bank_of_china" => Ok(BankOfChina),
12188            "bank_rakyat" => Ok(BankRakyat),
12189            "bsn" => Ok(Bsn),
12190            "cimb" => Ok(Cimb),
12191            "deutsche_bank" => Ok(DeutscheBank),
12192            "hong_leong_bank" => Ok(HongLeongBank),
12193            "hsbc" => Ok(Hsbc),
12194            "kfh" => Ok(Kfh),
12195            "maybank2e" => Ok(Maybank2e),
12196            "maybank2u" => Ok(Maybank2u),
12197            "ocbc" => Ok(Ocbc),
12198            "pb_enterprise" => Ok(PbEnterprise),
12199            "public_bank" => Ok(PublicBank),
12200            "rhb" => Ok(Rhb),
12201            "standard_chartered" => Ok(StandardChartered),
12202            "uob" => Ok(Uob),
12203            v => Ok(Unknown(v.to_owned())),
12204        }
12205    }
12206}
12207impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataFpxBank {
12208    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12209        f.write_str(self.as_str())
12210    }
12211}
12212
12213impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataFpxBank {
12214    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12215        f.write_str(self.as_str())
12216    }
12217}
12218impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataFpxBank {
12219    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12220    where
12221        S: serde::Serializer,
12222    {
12223        serializer.serialize_str(self.as_str())
12224    }
12225}
12226#[cfg(feature = "deserialize")]
12227impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataFpxBank {
12228    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12229        use std::str::FromStr;
12230        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12231        Ok(Self::from_str(&s).unwrap())
12232    }
12233}
12234/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
12235#[derive(Clone, Debug, serde::Serialize)]
12236pub struct UpdatePaymentIntentPaymentMethodDataIdeal {
12237    /// The customer's bank.
12238    /// Only use this parameter for existing customers.
12239    /// Don't use it for new customers.
12240    #[serde(skip_serializing_if = "Option::is_none")]
12241    pub bank: Option<UpdatePaymentIntentPaymentMethodDataIdealBank>,
12242}
12243impl UpdatePaymentIntentPaymentMethodDataIdeal {
12244    pub fn new() -> Self {
12245        Self { bank: None }
12246    }
12247}
12248impl Default for UpdatePaymentIntentPaymentMethodDataIdeal {
12249    fn default() -> Self {
12250        Self::new()
12251    }
12252}
12253/// The customer's bank.
12254/// Only use this parameter for existing customers.
12255/// Don't use it for new customers.
12256#[derive(Clone, Eq, PartialEq)]
12257#[non_exhaustive]
12258pub enum UpdatePaymentIntentPaymentMethodDataIdealBank {
12259    AbnAmro,
12260    AsnBank,
12261    Bunq,
12262    Buut,
12263    Handelsbanken,
12264    Ing,
12265    Knab,
12266    Moneyou,
12267    N26,
12268    Nn,
12269    Rabobank,
12270    Regiobank,
12271    Revolut,
12272    SnsBank,
12273    TriodosBank,
12274    VanLanschot,
12275    Yoursafe,
12276    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12277    Unknown(String),
12278}
12279impl UpdatePaymentIntentPaymentMethodDataIdealBank {
12280    pub fn as_str(&self) -> &str {
12281        use UpdatePaymentIntentPaymentMethodDataIdealBank::*;
12282        match self {
12283            AbnAmro => "abn_amro",
12284            AsnBank => "asn_bank",
12285            Bunq => "bunq",
12286            Buut => "buut",
12287            Handelsbanken => "handelsbanken",
12288            Ing => "ing",
12289            Knab => "knab",
12290            Moneyou => "moneyou",
12291            N26 => "n26",
12292            Nn => "nn",
12293            Rabobank => "rabobank",
12294            Regiobank => "regiobank",
12295            Revolut => "revolut",
12296            SnsBank => "sns_bank",
12297            TriodosBank => "triodos_bank",
12298            VanLanschot => "van_lanschot",
12299            Yoursafe => "yoursafe",
12300            Unknown(v) => v,
12301        }
12302    }
12303}
12304
12305impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataIdealBank {
12306    type Err = std::convert::Infallible;
12307    fn from_str(s: &str) -> Result<Self, Self::Err> {
12308        use UpdatePaymentIntentPaymentMethodDataIdealBank::*;
12309        match s {
12310            "abn_amro" => Ok(AbnAmro),
12311            "asn_bank" => Ok(AsnBank),
12312            "bunq" => Ok(Bunq),
12313            "buut" => Ok(Buut),
12314            "handelsbanken" => Ok(Handelsbanken),
12315            "ing" => Ok(Ing),
12316            "knab" => Ok(Knab),
12317            "moneyou" => Ok(Moneyou),
12318            "n26" => Ok(N26),
12319            "nn" => Ok(Nn),
12320            "rabobank" => Ok(Rabobank),
12321            "regiobank" => Ok(Regiobank),
12322            "revolut" => Ok(Revolut),
12323            "sns_bank" => Ok(SnsBank),
12324            "triodos_bank" => Ok(TriodosBank),
12325            "van_lanschot" => Ok(VanLanschot),
12326            "yoursafe" => Ok(Yoursafe),
12327            v => Ok(Unknown(v.to_owned())),
12328        }
12329    }
12330}
12331impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataIdealBank {
12332    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12333        f.write_str(self.as_str())
12334    }
12335}
12336
12337impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataIdealBank {
12338    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12339        f.write_str(self.as_str())
12340    }
12341}
12342impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataIdealBank {
12343    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12344    where
12345        S: serde::Serializer,
12346    {
12347        serializer.serialize_str(self.as_str())
12348    }
12349}
12350#[cfg(feature = "deserialize")]
12351impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataIdealBank {
12352    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12353        use std::str::FromStr;
12354        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12355        Ok(Self::from_str(&s).unwrap())
12356    }
12357}
12358/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
12359#[derive(Copy, Clone, Debug, serde::Serialize)]
12360pub struct UpdatePaymentIntentPaymentMethodDataKlarna {
12361    /// Customer's date of birth
12362    #[serde(skip_serializing_if = "Option::is_none")]
12363    pub dob: Option<DateOfBirth>,
12364}
12365impl UpdatePaymentIntentPaymentMethodDataKlarna {
12366    pub fn new() -> Self {
12367        Self { dob: None }
12368    }
12369}
12370impl Default for UpdatePaymentIntentPaymentMethodDataKlarna {
12371    fn default() -> Self {
12372        Self::new()
12373    }
12374}
12375/// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
12376#[derive(Copy, Clone, Debug, serde::Serialize)]
12377pub struct UpdatePaymentIntentPaymentMethodDataNaverPay {
12378    /// Whether to use Naver Pay points or a card to fund this transaction.
12379    /// If not provided, this defaults to `card`.
12380    #[serde(skip_serializing_if = "Option::is_none")]
12381    pub funding: Option<UpdatePaymentIntentPaymentMethodDataNaverPayFunding>,
12382}
12383impl UpdatePaymentIntentPaymentMethodDataNaverPay {
12384    pub fn new() -> Self {
12385        Self { funding: None }
12386    }
12387}
12388impl Default for UpdatePaymentIntentPaymentMethodDataNaverPay {
12389    fn default() -> Self {
12390        Self::new()
12391    }
12392}
12393/// Whether to use Naver Pay points or a card to fund this transaction.
12394/// If not provided, this defaults to `card`.
12395#[derive(Copy, Clone, Eq, PartialEq)]
12396pub enum UpdatePaymentIntentPaymentMethodDataNaverPayFunding {
12397    Card,
12398    Points,
12399}
12400impl UpdatePaymentIntentPaymentMethodDataNaverPayFunding {
12401    pub fn as_str(self) -> &'static str {
12402        use UpdatePaymentIntentPaymentMethodDataNaverPayFunding::*;
12403        match self {
12404            Card => "card",
12405            Points => "points",
12406        }
12407    }
12408}
12409
12410impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataNaverPayFunding {
12411    type Err = stripe_types::StripeParseError;
12412    fn from_str(s: &str) -> Result<Self, Self::Err> {
12413        use UpdatePaymentIntentPaymentMethodDataNaverPayFunding::*;
12414        match s {
12415            "card" => Ok(Card),
12416            "points" => Ok(Points),
12417            _ => Err(stripe_types::StripeParseError),
12418        }
12419    }
12420}
12421impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataNaverPayFunding {
12422    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12423        f.write_str(self.as_str())
12424    }
12425}
12426
12427impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataNaverPayFunding {
12428    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12429        f.write_str(self.as_str())
12430    }
12431}
12432impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataNaverPayFunding {
12433    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12434    where
12435        S: serde::Serializer,
12436    {
12437        serializer.serialize_str(self.as_str())
12438    }
12439}
12440#[cfg(feature = "deserialize")]
12441impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataNaverPayFunding {
12442    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12443        use std::str::FromStr;
12444        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12445        Self::from_str(&s).map_err(|_| {
12446            serde::de::Error::custom(
12447                "Unknown value for UpdatePaymentIntentPaymentMethodDataNaverPayFunding",
12448            )
12449        })
12450    }
12451}
12452/// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
12453#[derive(Clone, Debug, serde::Serialize)]
12454pub struct UpdatePaymentIntentPaymentMethodDataNzBankAccount {
12455    /// The name on the bank account.
12456    /// Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod’s billing details.
12457    #[serde(skip_serializing_if = "Option::is_none")]
12458    pub account_holder_name: Option<String>,
12459    /// The account number for the bank account.
12460    pub account_number: String,
12461    /// The numeric code for the bank account's bank.
12462    pub bank_code: String,
12463    /// The numeric code for the bank account's bank branch.
12464    pub branch_code: String,
12465    #[serde(skip_serializing_if = "Option::is_none")]
12466    pub reference: Option<String>,
12467    /// The suffix of the bank account number.
12468    pub suffix: String,
12469}
12470impl UpdatePaymentIntentPaymentMethodDataNzBankAccount {
12471    pub fn new(
12472        account_number: impl Into<String>,
12473        bank_code: impl Into<String>,
12474        branch_code: impl Into<String>,
12475        suffix: impl Into<String>,
12476    ) -> Self {
12477        Self {
12478            account_holder_name: None,
12479            account_number: account_number.into(),
12480            bank_code: bank_code.into(),
12481            branch_code: branch_code.into(),
12482            reference: None,
12483            suffix: suffix.into(),
12484        }
12485    }
12486}
12487/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
12488#[derive(Clone, Debug, serde::Serialize)]
12489pub struct UpdatePaymentIntentPaymentMethodDataP24 {
12490    /// The customer's bank.
12491    #[serde(skip_serializing_if = "Option::is_none")]
12492    pub bank: Option<UpdatePaymentIntentPaymentMethodDataP24Bank>,
12493}
12494impl UpdatePaymentIntentPaymentMethodDataP24 {
12495    pub fn new() -> Self {
12496        Self { bank: None }
12497    }
12498}
12499impl Default for UpdatePaymentIntentPaymentMethodDataP24 {
12500    fn default() -> Self {
12501        Self::new()
12502    }
12503}
12504/// The customer's bank.
12505#[derive(Clone, Eq, PartialEq)]
12506#[non_exhaustive]
12507pub enum UpdatePaymentIntentPaymentMethodDataP24Bank {
12508    AliorBank,
12509    BankMillennium,
12510    BankNowyBfgSa,
12511    BankPekaoSa,
12512    BankiSpbdzielcze,
12513    Blik,
12514    BnpParibas,
12515    Boz,
12516    CitiHandlowy,
12517    CreditAgricole,
12518    Envelobank,
12519    EtransferPocztowy24,
12520    GetinBank,
12521    Ideabank,
12522    Ing,
12523    Inteligo,
12524    MbankMtransfer,
12525    NestPrzelew,
12526    NoblePay,
12527    PbacZIpko,
12528    PlusBank,
12529    SantanderPrzelew24,
12530    TmobileUsbugiBankowe,
12531    ToyotaBank,
12532    Velobank,
12533    VolkswagenBank,
12534    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12535    Unknown(String),
12536}
12537impl UpdatePaymentIntentPaymentMethodDataP24Bank {
12538    pub fn as_str(&self) -> &str {
12539        use UpdatePaymentIntentPaymentMethodDataP24Bank::*;
12540        match self {
12541            AliorBank => "alior_bank",
12542            BankMillennium => "bank_millennium",
12543            BankNowyBfgSa => "bank_nowy_bfg_sa",
12544            BankPekaoSa => "bank_pekao_sa",
12545            BankiSpbdzielcze => "banki_spbdzielcze",
12546            Blik => "blik",
12547            BnpParibas => "bnp_paribas",
12548            Boz => "boz",
12549            CitiHandlowy => "citi_handlowy",
12550            CreditAgricole => "credit_agricole",
12551            Envelobank => "envelobank",
12552            EtransferPocztowy24 => "etransfer_pocztowy24",
12553            GetinBank => "getin_bank",
12554            Ideabank => "ideabank",
12555            Ing => "ing",
12556            Inteligo => "inteligo",
12557            MbankMtransfer => "mbank_mtransfer",
12558            NestPrzelew => "nest_przelew",
12559            NoblePay => "noble_pay",
12560            PbacZIpko => "pbac_z_ipko",
12561            PlusBank => "plus_bank",
12562            SantanderPrzelew24 => "santander_przelew24",
12563            TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
12564            ToyotaBank => "toyota_bank",
12565            Velobank => "velobank",
12566            VolkswagenBank => "volkswagen_bank",
12567            Unknown(v) => v,
12568        }
12569    }
12570}
12571
12572impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataP24Bank {
12573    type Err = std::convert::Infallible;
12574    fn from_str(s: &str) -> Result<Self, Self::Err> {
12575        use UpdatePaymentIntentPaymentMethodDataP24Bank::*;
12576        match s {
12577            "alior_bank" => Ok(AliorBank),
12578            "bank_millennium" => Ok(BankMillennium),
12579            "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa),
12580            "bank_pekao_sa" => Ok(BankPekaoSa),
12581            "banki_spbdzielcze" => Ok(BankiSpbdzielcze),
12582            "blik" => Ok(Blik),
12583            "bnp_paribas" => Ok(BnpParibas),
12584            "boz" => Ok(Boz),
12585            "citi_handlowy" => Ok(CitiHandlowy),
12586            "credit_agricole" => Ok(CreditAgricole),
12587            "envelobank" => Ok(Envelobank),
12588            "etransfer_pocztowy24" => Ok(EtransferPocztowy24),
12589            "getin_bank" => Ok(GetinBank),
12590            "ideabank" => Ok(Ideabank),
12591            "ing" => Ok(Ing),
12592            "inteligo" => Ok(Inteligo),
12593            "mbank_mtransfer" => Ok(MbankMtransfer),
12594            "nest_przelew" => Ok(NestPrzelew),
12595            "noble_pay" => Ok(NoblePay),
12596            "pbac_z_ipko" => Ok(PbacZIpko),
12597            "plus_bank" => Ok(PlusBank),
12598            "santander_przelew24" => Ok(SantanderPrzelew24),
12599            "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe),
12600            "toyota_bank" => Ok(ToyotaBank),
12601            "velobank" => Ok(Velobank),
12602            "volkswagen_bank" => Ok(VolkswagenBank),
12603            v => Ok(Unknown(v.to_owned())),
12604        }
12605    }
12606}
12607impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataP24Bank {
12608    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12609        f.write_str(self.as_str())
12610    }
12611}
12612
12613impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataP24Bank {
12614    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12615        f.write_str(self.as_str())
12616    }
12617}
12618impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataP24Bank {
12619    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12620    where
12621        S: serde::Serializer,
12622    {
12623        serializer.serialize_str(self.as_str())
12624    }
12625}
12626#[cfg(feature = "deserialize")]
12627impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataP24Bank {
12628    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12629        use std::str::FromStr;
12630        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12631        Ok(Self::from_str(&s).unwrap())
12632    }
12633}
12634/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
12635#[derive(Clone, Debug, serde::Serialize)]
12636pub struct UpdatePaymentIntentPaymentMethodDataSepaDebit {
12637    /// IBAN of the bank account.
12638    pub iban: String,
12639}
12640impl UpdatePaymentIntentPaymentMethodDataSepaDebit {
12641    pub fn new(iban: impl Into<String>) -> Self {
12642        Self { iban: iban.into() }
12643    }
12644}
12645/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
12646#[derive(Copy, Clone, Debug, serde::Serialize)]
12647pub struct UpdatePaymentIntentPaymentMethodDataSofort {
12648    /// Two-letter ISO code representing the country the bank account is located in.
12649    pub country: UpdatePaymentIntentPaymentMethodDataSofortCountry,
12650}
12651impl UpdatePaymentIntentPaymentMethodDataSofort {
12652    pub fn new(country: impl Into<UpdatePaymentIntentPaymentMethodDataSofortCountry>) -> Self {
12653        Self { country: country.into() }
12654    }
12655}
12656/// Two-letter ISO code representing the country the bank account is located in.
12657#[derive(Copy, Clone, Eq, PartialEq)]
12658pub enum UpdatePaymentIntentPaymentMethodDataSofortCountry {
12659    At,
12660    Be,
12661    De,
12662    Es,
12663    It,
12664    Nl,
12665}
12666impl UpdatePaymentIntentPaymentMethodDataSofortCountry {
12667    pub fn as_str(self) -> &'static str {
12668        use UpdatePaymentIntentPaymentMethodDataSofortCountry::*;
12669        match self {
12670            At => "AT",
12671            Be => "BE",
12672            De => "DE",
12673            Es => "ES",
12674            It => "IT",
12675            Nl => "NL",
12676        }
12677    }
12678}
12679
12680impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataSofortCountry {
12681    type Err = stripe_types::StripeParseError;
12682    fn from_str(s: &str) -> Result<Self, Self::Err> {
12683        use UpdatePaymentIntentPaymentMethodDataSofortCountry::*;
12684        match s {
12685            "AT" => Ok(At),
12686            "BE" => Ok(Be),
12687            "DE" => Ok(De),
12688            "ES" => Ok(Es),
12689            "IT" => Ok(It),
12690            "NL" => Ok(Nl),
12691            _ => Err(stripe_types::StripeParseError),
12692        }
12693    }
12694}
12695impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataSofortCountry {
12696    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12697        f.write_str(self.as_str())
12698    }
12699}
12700
12701impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataSofortCountry {
12702    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12703        f.write_str(self.as_str())
12704    }
12705}
12706impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataSofortCountry {
12707    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12708    where
12709        S: serde::Serializer,
12710    {
12711        serializer.serialize_str(self.as_str())
12712    }
12713}
12714#[cfg(feature = "deserialize")]
12715impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataSofortCountry {
12716    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12717        use std::str::FromStr;
12718        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12719        Self::from_str(&s).map_err(|_| {
12720            serde::de::Error::custom(
12721                "Unknown value for UpdatePaymentIntentPaymentMethodDataSofortCountry",
12722            )
12723        })
12724    }
12725}
12726/// The type of the PaymentMethod.
12727/// An additional hash is included on the PaymentMethod with a name matching this value.
12728/// It contains additional information specific to the PaymentMethod type.
12729#[derive(Clone, Eq, PartialEq)]
12730#[non_exhaustive]
12731pub enum UpdatePaymentIntentPaymentMethodDataType {
12732    AcssDebit,
12733    Affirm,
12734    AfterpayClearpay,
12735    Alipay,
12736    Alma,
12737    AmazonPay,
12738    AuBecsDebit,
12739    BacsDebit,
12740    Bancontact,
12741    Billie,
12742    Blik,
12743    Boleto,
12744    Cashapp,
12745    Crypto,
12746    CustomerBalance,
12747    Eps,
12748    Fpx,
12749    Giropay,
12750    Grabpay,
12751    Ideal,
12752    KakaoPay,
12753    Klarna,
12754    Konbini,
12755    KrCard,
12756    Link,
12757    MbWay,
12758    Mobilepay,
12759    Multibanco,
12760    NaverPay,
12761    NzBankAccount,
12762    Oxxo,
12763    P24,
12764    PayByBank,
12765    Payco,
12766    Paynow,
12767    Paypal,
12768    Pix,
12769    Promptpay,
12770    RevolutPay,
12771    SamsungPay,
12772    Satispay,
12773    SepaDebit,
12774    Sofort,
12775    Swish,
12776    Twint,
12777    UsBankAccount,
12778    WechatPay,
12779    Zip,
12780    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12781    Unknown(String),
12782}
12783impl UpdatePaymentIntentPaymentMethodDataType {
12784    pub fn as_str(&self) -> &str {
12785        use UpdatePaymentIntentPaymentMethodDataType::*;
12786        match self {
12787            AcssDebit => "acss_debit",
12788            Affirm => "affirm",
12789            AfterpayClearpay => "afterpay_clearpay",
12790            Alipay => "alipay",
12791            Alma => "alma",
12792            AmazonPay => "amazon_pay",
12793            AuBecsDebit => "au_becs_debit",
12794            BacsDebit => "bacs_debit",
12795            Bancontact => "bancontact",
12796            Billie => "billie",
12797            Blik => "blik",
12798            Boleto => "boleto",
12799            Cashapp => "cashapp",
12800            Crypto => "crypto",
12801            CustomerBalance => "customer_balance",
12802            Eps => "eps",
12803            Fpx => "fpx",
12804            Giropay => "giropay",
12805            Grabpay => "grabpay",
12806            Ideal => "ideal",
12807            KakaoPay => "kakao_pay",
12808            Klarna => "klarna",
12809            Konbini => "konbini",
12810            KrCard => "kr_card",
12811            Link => "link",
12812            MbWay => "mb_way",
12813            Mobilepay => "mobilepay",
12814            Multibanco => "multibanco",
12815            NaverPay => "naver_pay",
12816            NzBankAccount => "nz_bank_account",
12817            Oxxo => "oxxo",
12818            P24 => "p24",
12819            PayByBank => "pay_by_bank",
12820            Payco => "payco",
12821            Paynow => "paynow",
12822            Paypal => "paypal",
12823            Pix => "pix",
12824            Promptpay => "promptpay",
12825            RevolutPay => "revolut_pay",
12826            SamsungPay => "samsung_pay",
12827            Satispay => "satispay",
12828            SepaDebit => "sepa_debit",
12829            Sofort => "sofort",
12830            Swish => "swish",
12831            Twint => "twint",
12832            UsBankAccount => "us_bank_account",
12833            WechatPay => "wechat_pay",
12834            Zip => "zip",
12835            Unknown(v) => v,
12836        }
12837    }
12838}
12839
12840impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataType {
12841    type Err = std::convert::Infallible;
12842    fn from_str(s: &str) -> Result<Self, Self::Err> {
12843        use UpdatePaymentIntentPaymentMethodDataType::*;
12844        match s {
12845            "acss_debit" => Ok(AcssDebit),
12846            "affirm" => Ok(Affirm),
12847            "afterpay_clearpay" => Ok(AfterpayClearpay),
12848            "alipay" => Ok(Alipay),
12849            "alma" => Ok(Alma),
12850            "amazon_pay" => Ok(AmazonPay),
12851            "au_becs_debit" => Ok(AuBecsDebit),
12852            "bacs_debit" => Ok(BacsDebit),
12853            "bancontact" => Ok(Bancontact),
12854            "billie" => Ok(Billie),
12855            "blik" => Ok(Blik),
12856            "boleto" => Ok(Boleto),
12857            "cashapp" => Ok(Cashapp),
12858            "crypto" => Ok(Crypto),
12859            "customer_balance" => Ok(CustomerBalance),
12860            "eps" => Ok(Eps),
12861            "fpx" => Ok(Fpx),
12862            "giropay" => Ok(Giropay),
12863            "grabpay" => Ok(Grabpay),
12864            "ideal" => Ok(Ideal),
12865            "kakao_pay" => Ok(KakaoPay),
12866            "klarna" => Ok(Klarna),
12867            "konbini" => Ok(Konbini),
12868            "kr_card" => Ok(KrCard),
12869            "link" => Ok(Link),
12870            "mb_way" => Ok(MbWay),
12871            "mobilepay" => Ok(Mobilepay),
12872            "multibanco" => Ok(Multibanco),
12873            "naver_pay" => Ok(NaverPay),
12874            "nz_bank_account" => Ok(NzBankAccount),
12875            "oxxo" => Ok(Oxxo),
12876            "p24" => Ok(P24),
12877            "pay_by_bank" => Ok(PayByBank),
12878            "payco" => Ok(Payco),
12879            "paynow" => Ok(Paynow),
12880            "paypal" => Ok(Paypal),
12881            "pix" => Ok(Pix),
12882            "promptpay" => Ok(Promptpay),
12883            "revolut_pay" => Ok(RevolutPay),
12884            "samsung_pay" => Ok(SamsungPay),
12885            "satispay" => Ok(Satispay),
12886            "sepa_debit" => Ok(SepaDebit),
12887            "sofort" => Ok(Sofort),
12888            "swish" => Ok(Swish),
12889            "twint" => Ok(Twint),
12890            "us_bank_account" => Ok(UsBankAccount),
12891            "wechat_pay" => Ok(WechatPay),
12892            "zip" => Ok(Zip),
12893            v => Ok(Unknown(v.to_owned())),
12894        }
12895    }
12896}
12897impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataType {
12898    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12899        f.write_str(self.as_str())
12900    }
12901}
12902
12903impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataType {
12904    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12905        f.write_str(self.as_str())
12906    }
12907}
12908impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataType {
12909    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12910    where
12911        S: serde::Serializer,
12912    {
12913        serializer.serialize_str(self.as_str())
12914    }
12915}
12916#[cfg(feature = "deserialize")]
12917impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataType {
12918    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12919        use std::str::FromStr;
12920        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12921        Ok(Self::from_str(&s).unwrap())
12922    }
12923}
12924/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
12925#[derive(Clone, Debug, serde::Serialize)]
12926pub struct UpdatePaymentIntentPaymentMethodDataUsBankAccount {
12927    /// Account holder type: individual or company.
12928    #[serde(skip_serializing_if = "Option::is_none")]
12929    pub account_holder_type:
12930        Option<UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType>,
12931    /// Account number of the bank account.
12932    #[serde(skip_serializing_if = "Option::is_none")]
12933    pub account_number: Option<String>,
12934    /// Account type: checkings or savings. Defaults to checking if omitted.
12935    #[serde(skip_serializing_if = "Option::is_none")]
12936    pub account_type: Option<UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType>,
12937    /// The ID of a Financial Connections Account to use as a payment method.
12938    #[serde(skip_serializing_if = "Option::is_none")]
12939    pub financial_connections_account: Option<String>,
12940    /// Routing number of the bank account.
12941    #[serde(skip_serializing_if = "Option::is_none")]
12942    pub routing_number: Option<String>,
12943}
12944impl UpdatePaymentIntentPaymentMethodDataUsBankAccount {
12945    pub fn new() -> Self {
12946        Self {
12947            account_holder_type: None,
12948            account_number: None,
12949            account_type: None,
12950            financial_connections_account: None,
12951            routing_number: None,
12952        }
12953    }
12954}
12955impl Default for UpdatePaymentIntentPaymentMethodDataUsBankAccount {
12956    fn default() -> Self {
12957        Self::new()
12958    }
12959}
12960/// Account holder type: individual or company.
12961#[derive(Copy, Clone, Eq, PartialEq)]
12962pub enum UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
12963    Company,
12964    Individual,
12965}
12966impl UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
12967    pub fn as_str(self) -> &'static str {
12968        use UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
12969        match self {
12970            Company => "company",
12971            Individual => "individual",
12972        }
12973    }
12974}
12975
12976impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
12977    type Err = stripe_types::StripeParseError;
12978    fn from_str(s: &str) -> Result<Self, Self::Err> {
12979        use UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
12980        match s {
12981            "company" => Ok(Company),
12982            "individual" => Ok(Individual),
12983            _ => Err(stripe_types::StripeParseError),
12984        }
12985    }
12986}
12987impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
12988    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12989        f.write_str(self.as_str())
12990    }
12991}
12992
12993impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
12994    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12995        f.write_str(self.as_str())
12996    }
12997}
12998impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
12999    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13000    where
13001        S: serde::Serializer,
13002    {
13003        serializer.serialize_str(self.as_str())
13004    }
13005}
13006#[cfg(feature = "deserialize")]
13007impl<'de> serde::Deserialize<'de>
13008    for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType
13009{
13010    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13011        use std::str::FromStr;
13012        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13013        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType"))
13014    }
13015}
13016/// Account type: checkings or savings. Defaults to checking if omitted.
13017#[derive(Copy, Clone, Eq, PartialEq)]
13018pub enum UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
13019    Checking,
13020    Savings,
13021}
13022impl UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
13023    pub fn as_str(self) -> &'static str {
13024        use UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType::*;
13025        match self {
13026            Checking => "checking",
13027            Savings => "savings",
13028        }
13029    }
13030}
13031
13032impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
13033    type Err = stripe_types::StripeParseError;
13034    fn from_str(s: &str) -> Result<Self, Self::Err> {
13035        use UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType::*;
13036        match s {
13037            "checking" => Ok(Checking),
13038            "savings" => Ok(Savings),
13039            _ => Err(stripe_types::StripeParseError),
13040        }
13041    }
13042}
13043impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
13044    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13045        f.write_str(self.as_str())
13046    }
13047}
13048
13049impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
13050    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13051        f.write_str(self.as_str())
13052    }
13053}
13054impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
13055    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13056    where
13057        S: serde::Serializer,
13058    {
13059        serializer.serialize_str(self.as_str())
13060    }
13061}
13062#[cfg(feature = "deserialize")]
13063impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
13064    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13065        use std::str::FromStr;
13066        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13067        Self::from_str(&s).map_err(|_| {
13068            serde::de::Error::custom(
13069                "Unknown value for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType",
13070            )
13071        })
13072    }
13073}
13074/// Payment-method-specific configuration for this PaymentIntent.
13075#[derive(Clone, Debug, serde::Serialize)]
13076pub struct UpdatePaymentIntentPaymentMethodOptions {
13077    /// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options.
13078    #[serde(skip_serializing_if = "Option::is_none")]
13079    pub acss_debit: Option<UpdatePaymentIntentPaymentMethodOptionsAcssDebit>,
13080    /// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options.
13081    #[serde(skip_serializing_if = "Option::is_none")]
13082    pub affirm: Option<UpdatePaymentIntentPaymentMethodOptionsAffirm>,
13083    /// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options.
13084    #[serde(skip_serializing_if = "Option::is_none")]
13085    pub afterpay_clearpay: Option<UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpay>,
13086    /// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options.
13087    #[serde(skip_serializing_if = "Option::is_none")]
13088    pub alipay: Option<UpdatePaymentIntentPaymentMethodOptionsAlipay>,
13089    /// If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options.
13090    #[serde(skip_serializing_if = "Option::is_none")]
13091    pub alma: Option<UpdatePaymentIntentPaymentMethodOptionsAlma>,
13092    /// If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options.
13093    #[serde(skip_serializing_if = "Option::is_none")]
13094    pub amazon_pay: Option<UpdatePaymentIntentPaymentMethodOptionsAmazonPay>,
13095    /// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options.
13096    #[serde(skip_serializing_if = "Option::is_none")]
13097    pub au_becs_debit: Option<UpdatePaymentIntentPaymentMethodOptionsAuBecsDebit>,
13098    /// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options.
13099    #[serde(skip_serializing_if = "Option::is_none")]
13100    pub bacs_debit: Option<UpdatePaymentIntentPaymentMethodOptionsBacsDebit>,
13101    /// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options.
13102    #[serde(skip_serializing_if = "Option::is_none")]
13103    pub bancontact: Option<UpdatePaymentIntentPaymentMethodOptionsBancontact>,
13104    /// If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options.
13105    #[serde(skip_serializing_if = "Option::is_none")]
13106    pub billie: Option<UpdatePaymentIntentPaymentMethodOptionsBillie>,
13107    /// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options.
13108    #[serde(skip_serializing_if = "Option::is_none")]
13109    pub blik: Option<UpdatePaymentIntentPaymentMethodOptionsBlik>,
13110    /// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options.
13111    #[serde(skip_serializing_if = "Option::is_none")]
13112    pub boleto: Option<UpdatePaymentIntentPaymentMethodOptionsBoleto>,
13113    /// Configuration for any card payments attempted on this PaymentIntent.
13114    #[serde(skip_serializing_if = "Option::is_none")]
13115    pub card: Option<UpdatePaymentIntentPaymentMethodOptionsCard>,
13116    /// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
13117    #[serde(skip_serializing_if = "Option::is_none")]
13118    pub card_present: Option<UpdatePaymentIntentPaymentMethodOptionsCardPresent>,
13119    /// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options.
13120    #[serde(skip_serializing_if = "Option::is_none")]
13121    pub cashapp: Option<UpdatePaymentIntentPaymentMethodOptionsCashapp>,
13122    /// If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options.
13123    #[serde(skip_serializing_if = "Option::is_none")]
13124    pub crypto: Option<UpdatePaymentIntentPaymentMethodOptionsCrypto>,
13125    /// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options.
13126    #[serde(skip_serializing_if = "Option::is_none")]
13127    pub customer_balance: Option<UpdatePaymentIntentPaymentMethodOptionsCustomerBalance>,
13128    /// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
13129    #[serde(skip_serializing_if = "Option::is_none")]
13130    pub eps: Option<UpdatePaymentIntentPaymentMethodOptionsEps>,
13131    /// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options.
13132    #[serde(skip_serializing_if = "Option::is_none")]
13133    pub fpx: Option<UpdatePaymentIntentPaymentMethodOptionsFpx>,
13134    /// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options.
13135    #[serde(skip_serializing_if = "Option::is_none")]
13136    pub giropay: Option<UpdatePaymentIntentPaymentMethodOptionsGiropay>,
13137    /// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options.
13138    #[serde(skip_serializing_if = "Option::is_none")]
13139    pub grabpay: Option<UpdatePaymentIntentPaymentMethodOptionsGrabpay>,
13140    /// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options.
13141    #[serde(skip_serializing_if = "Option::is_none")]
13142    pub ideal: Option<UpdatePaymentIntentPaymentMethodOptionsIdeal>,
13143    /// If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
13144    #[serde(skip_serializing_if = "Option::is_none")]
13145    #[serde(with = "stripe_types::with_serde_json_opt")]
13146    pub interac_present: Option<miniserde::json::Value>,
13147    /// If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options.
13148    #[serde(skip_serializing_if = "Option::is_none")]
13149    pub kakao_pay: Option<UpdatePaymentIntentPaymentMethodOptionsKakaoPay>,
13150    /// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options.
13151    #[serde(skip_serializing_if = "Option::is_none")]
13152    pub klarna: Option<UpdatePaymentIntentPaymentMethodOptionsKlarna>,
13153    /// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options.
13154    #[serde(skip_serializing_if = "Option::is_none")]
13155    pub konbini: Option<UpdatePaymentIntentPaymentMethodOptionsKonbini>,
13156    /// If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options.
13157    #[serde(skip_serializing_if = "Option::is_none")]
13158    pub kr_card: Option<UpdatePaymentIntentPaymentMethodOptionsKrCard>,
13159    /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
13160    #[serde(skip_serializing_if = "Option::is_none")]
13161    pub link: Option<UpdatePaymentIntentPaymentMethodOptionsLink>,
13162    /// If this is a `mb_way` PaymentMethod, this sub-hash contains details about the MB WAY payment method options.
13163    #[serde(skip_serializing_if = "Option::is_none")]
13164    pub mb_way: Option<UpdatePaymentIntentPaymentMethodOptionsMbWay>,
13165    /// If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options.
13166    #[serde(skip_serializing_if = "Option::is_none")]
13167    pub mobilepay: Option<UpdatePaymentIntentPaymentMethodOptionsMobilepay>,
13168    /// If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options.
13169    #[serde(skip_serializing_if = "Option::is_none")]
13170    pub multibanco: Option<UpdatePaymentIntentPaymentMethodOptionsMultibanco>,
13171    /// If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options.
13172    #[serde(skip_serializing_if = "Option::is_none")]
13173    pub naver_pay: Option<UpdatePaymentIntentPaymentMethodOptionsNaverPay>,
13174    /// If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options.
13175    #[serde(skip_serializing_if = "Option::is_none")]
13176    pub nz_bank_account: Option<UpdatePaymentIntentPaymentMethodOptionsNzBankAccount>,
13177    /// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options.
13178    #[serde(skip_serializing_if = "Option::is_none")]
13179    pub oxxo: Option<UpdatePaymentIntentPaymentMethodOptionsOxxo>,
13180    /// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options.
13181    #[serde(skip_serializing_if = "Option::is_none")]
13182    pub p24: Option<UpdatePaymentIntentPaymentMethodOptionsP24>,
13183    /// If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options.
13184    #[serde(skip_serializing_if = "Option::is_none")]
13185    #[serde(with = "stripe_types::with_serde_json_opt")]
13186    pub pay_by_bank: Option<miniserde::json::Value>,
13187    /// If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options.
13188    #[serde(skip_serializing_if = "Option::is_none")]
13189    pub payco: Option<UpdatePaymentIntentPaymentMethodOptionsPayco>,
13190    /// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options.
13191    #[serde(skip_serializing_if = "Option::is_none")]
13192    pub paynow: Option<UpdatePaymentIntentPaymentMethodOptionsPaynow>,
13193    /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
13194    #[serde(skip_serializing_if = "Option::is_none")]
13195    pub paypal: Option<UpdatePaymentIntentPaymentMethodOptionsPaypal>,
13196    /// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options.
13197    #[serde(skip_serializing_if = "Option::is_none")]
13198    pub pix: Option<UpdatePaymentIntentPaymentMethodOptionsPix>,
13199    /// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options.
13200    #[serde(skip_serializing_if = "Option::is_none")]
13201    pub promptpay: Option<UpdatePaymentIntentPaymentMethodOptionsPromptpay>,
13202    /// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options.
13203    #[serde(skip_serializing_if = "Option::is_none")]
13204    pub revolut_pay: Option<UpdatePaymentIntentPaymentMethodOptionsRevolutPay>,
13205    /// If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options.
13206    #[serde(skip_serializing_if = "Option::is_none")]
13207    pub samsung_pay: Option<UpdatePaymentIntentPaymentMethodOptionsSamsungPay>,
13208    /// If this is a `satispay` PaymentMethod, this sub-hash contains details about the Satispay payment method options.
13209    #[serde(skip_serializing_if = "Option::is_none")]
13210    pub satispay: Option<UpdatePaymentIntentPaymentMethodOptionsSatispay>,
13211    /// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options.
13212    #[serde(skip_serializing_if = "Option::is_none")]
13213    pub sepa_debit: Option<UpdatePaymentIntentPaymentMethodOptionsSepaDebit>,
13214    /// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options.
13215    #[serde(skip_serializing_if = "Option::is_none")]
13216    pub sofort: Option<UpdatePaymentIntentPaymentMethodOptionsSofort>,
13217    /// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options.
13218    #[serde(skip_serializing_if = "Option::is_none")]
13219    pub swish: Option<UpdatePaymentIntentPaymentMethodOptionsSwish>,
13220    /// If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options.
13221    #[serde(skip_serializing_if = "Option::is_none")]
13222    pub twint: Option<UpdatePaymentIntentPaymentMethodOptionsTwint>,
13223    /// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options.
13224    #[serde(skip_serializing_if = "Option::is_none")]
13225    pub us_bank_account: Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccount>,
13226    /// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options.
13227    #[serde(skip_serializing_if = "Option::is_none")]
13228    pub wechat_pay: Option<UpdatePaymentIntentPaymentMethodOptionsWechatPay>,
13229    /// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options.
13230    #[serde(skip_serializing_if = "Option::is_none")]
13231    pub zip: Option<UpdatePaymentIntentPaymentMethodOptionsZip>,
13232}
13233impl UpdatePaymentIntentPaymentMethodOptions {
13234    pub fn new() -> Self {
13235        Self {
13236            acss_debit: None,
13237            affirm: None,
13238            afterpay_clearpay: None,
13239            alipay: None,
13240            alma: None,
13241            amazon_pay: None,
13242            au_becs_debit: None,
13243            bacs_debit: None,
13244            bancontact: None,
13245            billie: None,
13246            blik: None,
13247            boleto: None,
13248            card: None,
13249            card_present: None,
13250            cashapp: None,
13251            crypto: None,
13252            customer_balance: None,
13253            eps: None,
13254            fpx: None,
13255            giropay: None,
13256            grabpay: None,
13257            ideal: None,
13258            interac_present: None,
13259            kakao_pay: None,
13260            klarna: None,
13261            konbini: None,
13262            kr_card: None,
13263            link: None,
13264            mb_way: None,
13265            mobilepay: None,
13266            multibanco: None,
13267            naver_pay: None,
13268            nz_bank_account: None,
13269            oxxo: None,
13270            p24: None,
13271            pay_by_bank: None,
13272            payco: None,
13273            paynow: None,
13274            paypal: None,
13275            pix: None,
13276            promptpay: None,
13277            revolut_pay: None,
13278            samsung_pay: None,
13279            satispay: None,
13280            sepa_debit: None,
13281            sofort: None,
13282            swish: None,
13283            twint: None,
13284            us_bank_account: None,
13285            wechat_pay: None,
13286            zip: None,
13287        }
13288    }
13289}
13290impl Default for UpdatePaymentIntentPaymentMethodOptions {
13291    fn default() -> Self {
13292        Self::new()
13293    }
13294}
13295/// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options.
13296#[derive(Clone, Debug, serde::Serialize)]
13297pub struct UpdatePaymentIntentPaymentMethodOptionsAcssDebit {
13298    /// Additional fields for Mandate creation
13299    #[serde(skip_serializing_if = "Option::is_none")]
13300    pub mandate_options: Option<UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions>,
13301    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
13302    ///
13303    /// 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.
13304    /// 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.
13305    ///
13306    /// 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.
13307    ///
13308    /// 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).
13309    ///
13310    /// 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`.
13311    #[serde(skip_serializing_if = "Option::is_none")]
13312    pub setup_future_usage:
13313        Option<UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage>,
13314    /// Controls when Stripe will attempt to debit the funds from the customer's account.
13315    /// The date must be a string in YYYY-MM-DD format.
13316    /// The date must be in the future and between 3 and 15 calendar days from now.
13317    #[serde(skip_serializing_if = "Option::is_none")]
13318    pub target_date: Option<String>,
13319    /// Bank account verification method.
13320    #[serde(skip_serializing_if = "Option::is_none")]
13321    pub verification_method:
13322        Option<UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
13323}
13324impl UpdatePaymentIntentPaymentMethodOptionsAcssDebit {
13325    pub fn new() -> Self {
13326        Self {
13327            mandate_options: None,
13328            setup_future_usage: None,
13329            target_date: None,
13330            verification_method: None,
13331        }
13332    }
13333}
13334impl Default for UpdatePaymentIntentPaymentMethodOptionsAcssDebit {
13335    fn default() -> Self {
13336        Self::new()
13337    }
13338}
13339/// Additional fields for Mandate creation
13340#[derive(Clone, Debug, serde::Serialize)]
13341pub struct UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
13342    /// A URL for custom mandate text to render during confirmation step.
13343    /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,.
13344    /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent.
13345    #[serde(skip_serializing_if = "Option::is_none")]
13346    pub custom_mandate_url: Option<String>,
13347    /// Description of the mandate interval.
13348    /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'.
13349    #[serde(skip_serializing_if = "Option::is_none")]
13350    pub interval_description: Option<String>,
13351    /// Payment schedule for the mandate.
13352    #[serde(skip_serializing_if = "Option::is_none")]
13353    pub payment_schedule:
13354        Option<UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
13355    /// Transaction type of the mandate.
13356    #[serde(skip_serializing_if = "Option::is_none")]
13357    pub transaction_type:
13358        Option<UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
13359}
13360impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
13361    pub fn new() -> Self {
13362        Self {
13363            custom_mandate_url: None,
13364            interval_description: None,
13365            payment_schedule: None,
13366            transaction_type: None,
13367        }
13368    }
13369}
13370impl Default for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
13371    fn default() -> Self {
13372        Self::new()
13373    }
13374}
13375/// Payment schedule for the mandate.
13376#[derive(Copy, Clone, Eq, PartialEq)]
13377pub enum UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
13378    Combined,
13379    Interval,
13380    Sporadic,
13381}
13382impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
13383    pub fn as_str(self) -> &'static str {
13384        use UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
13385        match self {
13386            Combined => "combined",
13387            Interval => "interval",
13388            Sporadic => "sporadic",
13389        }
13390    }
13391}
13392
13393impl std::str::FromStr
13394    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
13395{
13396    type Err = stripe_types::StripeParseError;
13397    fn from_str(s: &str) -> Result<Self, Self::Err> {
13398        use UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
13399        match s {
13400            "combined" => Ok(Combined),
13401            "interval" => Ok(Interval),
13402            "sporadic" => Ok(Sporadic),
13403            _ => Err(stripe_types::StripeParseError),
13404        }
13405    }
13406}
13407impl std::fmt::Display
13408    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
13409{
13410    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13411        f.write_str(self.as_str())
13412    }
13413}
13414
13415impl std::fmt::Debug
13416    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
13417{
13418    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13419        f.write_str(self.as_str())
13420    }
13421}
13422impl serde::Serialize
13423    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
13424{
13425    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13426    where
13427        S: serde::Serializer,
13428    {
13429        serializer.serialize_str(self.as_str())
13430    }
13431}
13432#[cfg(feature = "deserialize")]
13433impl<'de> serde::Deserialize<'de>
13434    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
13435{
13436    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13437        use std::str::FromStr;
13438        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13439        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"))
13440    }
13441}
13442/// Transaction type of the mandate.
13443#[derive(Copy, Clone, Eq, PartialEq)]
13444pub enum UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
13445    Business,
13446    Personal,
13447}
13448impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
13449    pub fn as_str(self) -> &'static str {
13450        use UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
13451        match self {
13452            Business => "business",
13453            Personal => "personal",
13454        }
13455    }
13456}
13457
13458impl std::str::FromStr
13459    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
13460{
13461    type Err = stripe_types::StripeParseError;
13462    fn from_str(s: &str) -> Result<Self, Self::Err> {
13463        use UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
13464        match s {
13465            "business" => Ok(Business),
13466            "personal" => Ok(Personal),
13467            _ => Err(stripe_types::StripeParseError),
13468        }
13469    }
13470}
13471impl std::fmt::Display
13472    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
13473{
13474    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13475        f.write_str(self.as_str())
13476    }
13477}
13478
13479impl std::fmt::Debug
13480    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
13481{
13482    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13483        f.write_str(self.as_str())
13484    }
13485}
13486impl serde::Serialize
13487    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
13488{
13489    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13490    where
13491        S: serde::Serializer,
13492    {
13493        serializer.serialize_str(self.as_str())
13494    }
13495}
13496#[cfg(feature = "deserialize")]
13497impl<'de> serde::Deserialize<'de>
13498    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
13499{
13500    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13501        use std::str::FromStr;
13502        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13503        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"))
13504    }
13505}
13506/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
13507///
13508/// 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.
13509/// 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.
13510///
13511/// 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.
13512///
13513/// 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).
13514///
13515/// 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`.
13516#[derive(Copy, Clone, Eq, PartialEq)]
13517pub enum UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
13518    None,
13519    OffSession,
13520    OnSession,
13521}
13522impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
13523    pub fn as_str(self) -> &'static str {
13524        use UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*;
13525        match self {
13526            None => "none",
13527            OffSession => "off_session",
13528            OnSession => "on_session",
13529        }
13530    }
13531}
13532
13533impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
13534    type Err = stripe_types::StripeParseError;
13535    fn from_str(s: &str) -> Result<Self, Self::Err> {
13536        use UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*;
13537        match s {
13538            "none" => Ok(None),
13539            "off_session" => Ok(OffSession),
13540            "on_session" => Ok(OnSession),
13541            _ => Err(stripe_types::StripeParseError),
13542        }
13543    }
13544}
13545impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
13546    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13547        f.write_str(self.as_str())
13548    }
13549}
13550
13551impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
13552    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13553        f.write_str(self.as_str())
13554    }
13555}
13556impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
13557    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13558    where
13559        S: serde::Serializer,
13560    {
13561        serializer.serialize_str(self.as_str())
13562    }
13563}
13564#[cfg(feature = "deserialize")]
13565impl<'de> serde::Deserialize<'de>
13566    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage
13567{
13568    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13569        use std::str::FromStr;
13570        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13571        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage"))
13572    }
13573}
13574/// Bank account verification method.
13575#[derive(Copy, Clone, Eq, PartialEq)]
13576pub enum UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
13577    Automatic,
13578    Instant,
13579    Microdeposits,
13580}
13581impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
13582    pub fn as_str(self) -> &'static str {
13583        use UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
13584        match self {
13585            Automatic => "automatic",
13586            Instant => "instant",
13587            Microdeposits => "microdeposits",
13588        }
13589    }
13590}
13591
13592impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
13593    type Err = stripe_types::StripeParseError;
13594    fn from_str(s: &str) -> Result<Self, Self::Err> {
13595        use UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
13596        match s {
13597            "automatic" => Ok(Automatic),
13598            "instant" => Ok(Instant),
13599            "microdeposits" => Ok(Microdeposits),
13600            _ => Err(stripe_types::StripeParseError),
13601        }
13602    }
13603}
13604impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
13605    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13606        f.write_str(self.as_str())
13607    }
13608}
13609
13610impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
13611    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13612        f.write_str(self.as_str())
13613    }
13614}
13615impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
13616    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13617    where
13618        S: serde::Serializer,
13619    {
13620        serializer.serialize_str(self.as_str())
13621    }
13622}
13623#[cfg(feature = "deserialize")]
13624impl<'de> serde::Deserialize<'de>
13625    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod
13626{
13627    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13628        use std::str::FromStr;
13629        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13630        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod"))
13631    }
13632}
13633/// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options.
13634#[derive(Clone, Debug, serde::Serialize)]
13635pub struct UpdatePaymentIntentPaymentMethodOptionsAffirm {
13636    /// Controls when the funds are captured from the customer's account.
13637    ///
13638    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
13639    ///
13640    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
13641    #[serde(skip_serializing_if = "Option::is_none")]
13642    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod>,
13643    /// Preferred language of the Affirm authorization page that the customer is redirected to.
13644    #[serde(skip_serializing_if = "Option::is_none")]
13645    pub preferred_locale: Option<String>,
13646    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
13647    ///
13648    /// 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.
13649    /// 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.
13650    ///
13651    /// 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.
13652    ///
13653    /// 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).
13654    ///
13655    /// 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`.
13656    #[serde(skip_serializing_if = "Option::is_none")]
13657    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage>,
13658}
13659impl UpdatePaymentIntentPaymentMethodOptionsAffirm {
13660    pub fn new() -> Self {
13661        Self { capture_method: None, preferred_locale: None, setup_future_usage: None }
13662    }
13663}
13664impl Default for UpdatePaymentIntentPaymentMethodOptionsAffirm {
13665    fn default() -> Self {
13666        Self::new()
13667    }
13668}
13669/// Controls when the funds are captured from the customer's account.
13670///
13671/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
13672///
13673/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
13674#[derive(Copy, Clone, Eq, PartialEq)]
13675pub enum UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
13676    Manual,
13677}
13678impl UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
13679    pub fn as_str(self) -> &'static str {
13680        use UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*;
13681        match self {
13682            Manual => "manual",
13683        }
13684    }
13685}
13686
13687impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
13688    type Err = stripe_types::StripeParseError;
13689    fn from_str(s: &str) -> Result<Self, Self::Err> {
13690        use UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*;
13691        match s {
13692            "manual" => Ok(Manual),
13693            _ => Err(stripe_types::StripeParseError),
13694        }
13695    }
13696}
13697impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
13698    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13699        f.write_str(self.as_str())
13700    }
13701}
13702
13703impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
13704    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13705        f.write_str(self.as_str())
13706    }
13707}
13708impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
13709    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13710    where
13711        S: serde::Serializer,
13712    {
13713        serializer.serialize_str(self.as_str())
13714    }
13715}
13716#[cfg(feature = "deserialize")]
13717impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
13718    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13719        use std::str::FromStr;
13720        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13721        Self::from_str(&s).map_err(|_| {
13722            serde::de::Error::custom(
13723                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod",
13724            )
13725        })
13726    }
13727}
13728/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
13729///
13730/// 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.
13731/// 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.
13732///
13733/// 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.
13734///
13735/// 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).
13736///
13737/// 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`.
13738#[derive(Copy, Clone, Eq, PartialEq)]
13739pub enum UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
13740    None,
13741}
13742impl UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
13743    pub fn as_str(self) -> &'static str {
13744        use UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*;
13745        match self {
13746            None => "none",
13747        }
13748    }
13749}
13750
13751impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
13752    type Err = stripe_types::StripeParseError;
13753    fn from_str(s: &str) -> Result<Self, Self::Err> {
13754        use UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*;
13755        match s {
13756            "none" => Ok(None),
13757            _ => Err(stripe_types::StripeParseError),
13758        }
13759    }
13760}
13761impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
13762    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13763        f.write_str(self.as_str())
13764    }
13765}
13766
13767impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
13768    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13769        f.write_str(self.as_str())
13770    }
13771}
13772impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
13773    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13774    where
13775        S: serde::Serializer,
13776    {
13777        serializer.serialize_str(self.as_str())
13778    }
13779}
13780#[cfg(feature = "deserialize")]
13781impl<'de> serde::Deserialize<'de>
13782    for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage
13783{
13784    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13785        use std::str::FromStr;
13786        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13787        Self::from_str(&s).map_err(|_| {
13788            serde::de::Error::custom(
13789                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage",
13790            )
13791        })
13792    }
13793}
13794/// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options.
13795#[derive(Clone, Debug, serde::Serialize)]
13796pub struct UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpay {
13797    /// Controls when the funds are captured from the customer's account.
13798    ///
13799    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
13800    ///
13801    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
13802    #[serde(skip_serializing_if = "Option::is_none")]
13803    pub capture_method:
13804        Option<UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod>,
13805    /// An internal identifier or reference that this payment corresponds to.
13806    /// You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes.
13807    /// This field differs from the statement descriptor and item name.
13808    #[serde(skip_serializing_if = "Option::is_none")]
13809    pub reference: Option<String>,
13810    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
13811    ///
13812    /// 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.
13813    /// 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.
13814    ///
13815    /// 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.
13816    ///
13817    /// 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).
13818    ///
13819    /// 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`.
13820    #[serde(skip_serializing_if = "Option::is_none")]
13821    pub setup_future_usage:
13822        Option<UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage>,
13823}
13824impl UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpay {
13825    pub fn new() -> Self {
13826        Self { capture_method: None, reference: None, setup_future_usage: None }
13827    }
13828}
13829impl Default for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpay {
13830    fn default() -> Self {
13831        Self::new()
13832    }
13833}
13834/// Controls when the funds are captured from the customer's account.
13835///
13836/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
13837///
13838/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
13839#[derive(Copy, Clone, Eq, PartialEq)]
13840pub enum UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
13841    Manual,
13842}
13843impl UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
13844    pub fn as_str(self) -> &'static str {
13845        use UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*;
13846        match self {
13847            Manual => "manual",
13848        }
13849    }
13850}
13851
13852impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
13853    type Err = stripe_types::StripeParseError;
13854    fn from_str(s: &str) -> Result<Self, Self::Err> {
13855        use UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*;
13856        match s {
13857            "manual" => Ok(Manual),
13858            _ => Err(stripe_types::StripeParseError),
13859        }
13860    }
13861}
13862impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
13863    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13864        f.write_str(self.as_str())
13865    }
13866}
13867
13868impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
13869    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13870        f.write_str(self.as_str())
13871    }
13872}
13873impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
13874    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13875    where
13876        S: serde::Serializer,
13877    {
13878        serializer.serialize_str(self.as_str())
13879    }
13880}
13881#[cfg(feature = "deserialize")]
13882impl<'de> serde::Deserialize<'de>
13883    for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod
13884{
13885    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13886        use std::str::FromStr;
13887        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13888        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod"))
13889    }
13890}
13891/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
13892///
13893/// 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.
13894/// 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.
13895///
13896/// 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.
13897///
13898/// 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).
13899///
13900/// 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`.
13901#[derive(Copy, Clone, Eq, PartialEq)]
13902pub enum UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
13903    None,
13904}
13905impl UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
13906    pub fn as_str(self) -> &'static str {
13907        use UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*;
13908        match self {
13909            None => "none",
13910        }
13911    }
13912}
13913
13914impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
13915    type Err = stripe_types::StripeParseError;
13916    fn from_str(s: &str) -> Result<Self, Self::Err> {
13917        use UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*;
13918        match s {
13919            "none" => Ok(None),
13920            _ => Err(stripe_types::StripeParseError),
13921        }
13922    }
13923}
13924impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
13925    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13926        f.write_str(self.as_str())
13927    }
13928}
13929
13930impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
13931    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13932        f.write_str(self.as_str())
13933    }
13934}
13935impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
13936    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13937    where
13938        S: serde::Serializer,
13939    {
13940        serializer.serialize_str(self.as_str())
13941    }
13942}
13943#[cfg(feature = "deserialize")]
13944impl<'de> serde::Deserialize<'de>
13945    for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage
13946{
13947    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13948        use std::str::FromStr;
13949        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13950        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage"))
13951    }
13952}
13953/// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options.
13954#[derive(Copy, Clone, Debug, serde::Serialize)]
13955pub struct UpdatePaymentIntentPaymentMethodOptionsAlipay {
13956    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
13957    ///
13958    /// 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.
13959    /// 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.
13960    ///
13961    /// 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.
13962    ///
13963    /// 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).
13964    ///
13965    /// 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`.
13966    #[serde(skip_serializing_if = "Option::is_none")]
13967    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage>,
13968}
13969impl UpdatePaymentIntentPaymentMethodOptionsAlipay {
13970    pub fn new() -> Self {
13971        Self { setup_future_usage: None }
13972    }
13973}
13974impl Default for UpdatePaymentIntentPaymentMethodOptionsAlipay {
13975    fn default() -> Self {
13976        Self::new()
13977    }
13978}
13979/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
13980///
13981/// 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.
13982/// 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.
13983///
13984/// 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.
13985///
13986/// 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).
13987///
13988/// 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`.
13989#[derive(Copy, Clone, Eq, PartialEq)]
13990pub enum UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
13991    None,
13992    OffSession,
13993}
13994impl UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
13995    pub fn as_str(self) -> &'static str {
13996        use UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*;
13997        match self {
13998            None => "none",
13999            OffSession => "off_session",
14000        }
14001    }
14002}
14003
14004impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
14005    type Err = stripe_types::StripeParseError;
14006    fn from_str(s: &str) -> Result<Self, Self::Err> {
14007        use UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*;
14008        match s {
14009            "none" => Ok(None),
14010            "off_session" => Ok(OffSession),
14011            _ => Err(stripe_types::StripeParseError),
14012        }
14013    }
14014}
14015impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
14016    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14017        f.write_str(self.as_str())
14018    }
14019}
14020
14021impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
14022    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14023        f.write_str(self.as_str())
14024    }
14025}
14026impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
14027    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14028    where
14029        S: serde::Serializer,
14030    {
14031        serializer.serialize_str(self.as_str())
14032    }
14033}
14034#[cfg(feature = "deserialize")]
14035impl<'de> serde::Deserialize<'de>
14036    for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage
14037{
14038    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14039        use std::str::FromStr;
14040        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14041        Self::from_str(&s).map_err(|_| {
14042            serde::de::Error::custom(
14043                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage",
14044            )
14045        })
14046    }
14047}
14048/// If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options.
14049#[derive(Copy, Clone, Debug, serde::Serialize)]
14050pub struct UpdatePaymentIntentPaymentMethodOptionsAlma {
14051    /// Controls when the funds are captured from the customer's account.
14052    ///
14053    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
14054    ///
14055    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
14056    #[serde(skip_serializing_if = "Option::is_none")]
14057    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod>,
14058}
14059impl UpdatePaymentIntentPaymentMethodOptionsAlma {
14060    pub fn new() -> Self {
14061        Self { capture_method: None }
14062    }
14063}
14064impl Default for UpdatePaymentIntentPaymentMethodOptionsAlma {
14065    fn default() -> Self {
14066        Self::new()
14067    }
14068}
14069/// Controls when the funds are captured from the customer's account.
14070///
14071/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
14072///
14073/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
14074#[derive(Copy, Clone, Eq, PartialEq)]
14075pub enum UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
14076    Manual,
14077}
14078impl UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
14079    pub fn as_str(self) -> &'static str {
14080        use UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod::*;
14081        match self {
14082            Manual => "manual",
14083        }
14084    }
14085}
14086
14087impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
14088    type Err = stripe_types::StripeParseError;
14089    fn from_str(s: &str) -> Result<Self, Self::Err> {
14090        use UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod::*;
14091        match s {
14092            "manual" => Ok(Manual),
14093            _ => Err(stripe_types::StripeParseError),
14094        }
14095    }
14096}
14097impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
14098    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14099        f.write_str(self.as_str())
14100    }
14101}
14102
14103impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
14104    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14105        f.write_str(self.as_str())
14106    }
14107}
14108impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
14109    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14110    where
14111        S: serde::Serializer,
14112    {
14113        serializer.serialize_str(self.as_str())
14114    }
14115}
14116#[cfg(feature = "deserialize")]
14117impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
14118    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14119        use std::str::FromStr;
14120        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14121        Self::from_str(&s).map_err(|_| {
14122            serde::de::Error::custom(
14123                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod",
14124            )
14125        })
14126    }
14127}
14128/// If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options.
14129#[derive(Copy, Clone, Debug, serde::Serialize)]
14130pub struct UpdatePaymentIntentPaymentMethodOptionsAmazonPay {
14131    /// Controls when the funds are captured from the customer's account.
14132    ///
14133    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
14134    ///
14135    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
14136    #[serde(skip_serializing_if = "Option::is_none")]
14137    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod>,
14138    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14139    ///
14140    /// 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.
14141    /// 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.
14142    ///
14143    /// 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.
14144    ///
14145    /// 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).
14146    #[serde(skip_serializing_if = "Option::is_none")]
14147    pub setup_future_usage:
14148        Option<UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage>,
14149}
14150impl UpdatePaymentIntentPaymentMethodOptionsAmazonPay {
14151    pub fn new() -> Self {
14152        Self { capture_method: None, setup_future_usage: None }
14153    }
14154}
14155impl Default for UpdatePaymentIntentPaymentMethodOptionsAmazonPay {
14156    fn default() -> Self {
14157        Self::new()
14158    }
14159}
14160/// Controls when the funds are captured from the customer's account.
14161///
14162/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
14163///
14164/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
14165#[derive(Copy, Clone, Eq, PartialEq)]
14166pub enum UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
14167    Manual,
14168}
14169impl UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
14170    pub fn as_str(self) -> &'static str {
14171        use UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod::*;
14172        match self {
14173            Manual => "manual",
14174        }
14175    }
14176}
14177
14178impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
14179    type Err = stripe_types::StripeParseError;
14180    fn from_str(s: &str) -> Result<Self, Self::Err> {
14181        use UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod::*;
14182        match s {
14183            "manual" => Ok(Manual),
14184            _ => Err(stripe_types::StripeParseError),
14185        }
14186    }
14187}
14188impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
14189    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14190        f.write_str(self.as_str())
14191    }
14192}
14193
14194impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
14195    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14196        f.write_str(self.as_str())
14197    }
14198}
14199impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
14200    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14201    where
14202        S: serde::Serializer,
14203    {
14204        serializer.serialize_str(self.as_str())
14205    }
14206}
14207#[cfg(feature = "deserialize")]
14208impl<'de> serde::Deserialize<'de>
14209    for UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod
14210{
14211    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14212        use std::str::FromStr;
14213        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14214        Self::from_str(&s).map_err(|_| {
14215            serde::de::Error::custom(
14216                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod",
14217            )
14218        })
14219    }
14220}
14221/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14222///
14223/// 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.
14224/// 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.
14225///
14226/// 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.
14227///
14228/// 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).
14229#[derive(Copy, Clone, Eq, PartialEq)]
14230pub enum UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
14231    None,
14232    OffSession,
14233}
14234impl UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
14235    pub fn as_str(self) -> &'static str {
14236        use UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage::*;
14237        match self {
14238            None => "none",
14239            OffSession => "off_session",
14240        }
14241    }
14242}
14243
14244impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
14245    type Err = stripe_types::StripeParseError;
14246    fn from_str(s: &str) -> Result<Self, Self::Err> {
14247        use UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage::*;
14248        match s {
14249            "none" => Ok(None),
14250            "off_session" => Ok(OffSession),
14251            _ => Err(stripe_types::StripeParseError),
14252        }
14253    }
14254}
14255impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
14256    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14257        f.write_str(self.as_str())
14258    }
14259}
14260
14261impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
14262    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14263        f.write_str(self.as_str())
14264    }
14265}
14266impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
14267    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14268    where
14269        S: serde::Serializer,
14270    {
14271        serializer.serialize_str(self.as_str())
14272    }
14273}
14274#[cfg(feature = "deserialize")]
14275impl<'de> serde::Deserialize<'de>
14276    for UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage
14277{
14278    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14279        use std::str::FromStr;
14280        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14281        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage"))
14282    }
14283}
14284/// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options.
14285#[derive(Clone, Debug, serde::Serialize)]
14286pub struct UpdatePaymentIntentPaymentMethodOptionsAuBecsDebit {
14287    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14288    ///
14289    /// 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.
14290    /// 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.
14291    ///
14292    /// 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.
14293    ///
14294    /// 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).
14295    ///
14296    /// 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`.
14297    #[serde(skip_serializing_if = "Option::is_none")]
14298    pub setup_future_usage:
14299        Option<UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage>,
14300    /// Controls when Stripe will attempt to debit the funds from the customer's account.
14301    /// The date must be a string in YYYY-MM-DD format.
14302    /// The date must be in the future and between 3 and 15 calendar days from now.
14303    #[serde(skip_serializing_if = "Option::is_none")]
14304    pub target_date: Option<String>,
14305}
14306impl UpdatePaymentIntentPaymentMethodOptionsAuBecsDebit {
14307    pub fn new() -> Self {
14308        Self { setup_future_usage: None, target_date: None }
14309    }
14310}
14311impl Default for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebit {
14312    fn default() -> Self {
14313        Self::new()
14314    }
14315}
14316/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14317///
14318/// 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.
14319/// 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.
14320///
14321/// 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.
14322///
14323/// 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).
14324///
14325/// 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`.
14326#[derive(Copy, Clone, Eq, PartialEq)]
14327pub enum UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
14328    None,
14329    OffSession,
14330    OnSession,
14331}
14332impl UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
14333    pub fn as_str(self) -> &'static str {
14334        use UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*;
14335        match self {
14336            None => "none",
14337            OffSession => "off_session",
14338            OnSession => "on_session",
14339        }
14340    }
14341}
14342
14343impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
14344    type Err = stripe_types::StripeParseError;
14345    fn from_str(s: &str) -> Result<Self, Self::Err> {
14346        use UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*;
14347        match s {
14348            "none" => Ok(None),
14349            "off_session" => Ok(OffSession),
14350            "on_session" => Ok(OnSession),
14351            _ => Err(stripe_types::StripeParseError),
14352        }
14353    }
14354}
14355impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
14356    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14357        f.write_str(self.as_str())
14358    }
14359}
14360
14361impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
14362    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14363        f.write_str(self.as_str())
14364    }
14365}
14366impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
14367    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14368    where
14369        S: serde::Serializer,
14370    {
14371        serializer.serialize_str(self.as_str())
14372    }
14373}
14374#[cfg(feature = "deserialize")]
14375impl<'de> serde::Deserialize<'de>
14376    for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage
14377{
14378    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14379        use std::str::FromStr;
14380        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14381        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage"))
14382    }
14383}
14384/// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options.
14385#[derive(Clone, Debug, serde::Serialize)]
14386pub struct UpdatePaymentIntentPaymentMethodOptionsBacsDebit {
14387    /// Additional fields for Mandate creation
14388    #[serde(skip_serializing_if = "Option::is_none")]
14389    pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
14390    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14391    ///
14392    /// 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.
14393    /// 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.
14394    ///
14395    /// 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.
14396    ///
14397    /// 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).
14398    ///
14399    /// 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`.
14400    #[serde(skip_serializing_if = "Option::is_none")]
14401    pub setup_future_usage:
14402        Option<UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage>,
14403    /// Controls when Stripe will attempt to debit the funds from the customer's account.
14404    /// The date must be a string in YYYY-MM-DD format.
14405    /// The date must be in the future and between 3 and 15 calendar days from now.
14406    #[serde(skip_serializing_if = "Option::is_none")]
14407    pub target_date: Option<String>,
14408}
14409impl UpdatePaymentIntentPaymentMethodOptionsBacsDebit {
14410    pub fn new() -> Self {
14411        Self { mandate_options: None, setup_future_usage: None, target_date: None }
14412    }
14413}
14414impl Default for UpdatePaymentIntentPaymentMethodOptionsBacsDebit {
14415    fn default() -> Self {
14416        Self::new()
14417    }
14418}
14419/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14420///
14421/// 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.
14422/// 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.
14423///
14424/// 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.
14425///
14426/// 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).
14427///
14428/// 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`.
14429#[derive(Copy, Clone, Eq, PartialEq)]
14430pub enum UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
14431    None,
14432    OffSession,
14433    OnSession,
14434}
14435impl UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
14436    pub fn as_str(self) -> &'static str {
14437        use UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*;
14438        match self {
14439            None => "none",
14440            OffSession => "off_session",
14441            OnSession => "on_session",
14442        }
14443    }
14444}
14445
14446impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
14447    type Err = stripe_types::StripeParseError;
14448    fn from_str(s: &str) -> Result<Self, Self::Err> {
14449        use UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*;
14450        match s {
14451            "none" => Ok(None),
14452            "off_session" => Ok(OffSession),
14453            "on_session" => Ok(OnSession),
14454            _ => Err(stripe_types::StripeParseError),
14455        }
14456    }
14457}
14458impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
14459    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14460        f.write_str(self.as_str())
14461    }
14462}
14463
14464impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
14465    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14466        f.write_str(self.as_str())
14467    }
14468}
14469impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
14470    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14471    where
14472        S: serde::Serializer,
14473    {
14474        serializer.serialize_str(self.as_str())
14475    }
14476}
14477#[cfg(feature = "deserialize")]
14478impl<'de> serde::Deserialize<'de>
14479    for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage
14480{
14481    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14482        use std::str::FromStr;
14483        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14484        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage"))
14485    }
14486}
14487/// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options.
14488#[derive(Copy, Clone, Debug, serde::Serialize)]
14489pub struct UpdatePaymentIntentPaymentMethodOptionsBancontact {
14490    /// Preferred language of the Bancontact authorization page that the customer is redirected to.
14491    #[serde(skip_serializing_if = "Option::is_none")]
14492    pub preferred_language:
14493        Option<UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage>,
14494    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14495    ///
14496    /// 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.
14497    /// 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.
14498    ///
14499    /// 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.
14500    ///
14501    /// 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).
14502    ///
14503    /// 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`.
14504    #[serde(skip_serializing_if = "Option::is_none")]
14505    pub setup_future_usage:
14506        Option<UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage>,
14507}
14508impl UpdatePaymentIntentPaymentMethodOptionsBancontact {
14509    pub fn new() -> Self {
14510        Self { preferred_language: None, setup_future_usage: None }
14511    }
14512}
14513impl Default for UpdatePaymentIntentPaymentMethodOptionsBancontact {
14514    fn default() -> Self {
14515        Self::new()
14516    }
14517}
14518/// Preferred language of the Bancontact authorization page that the customer is redirected to.
14519#[derive(Copy, Clone, Eq, PartialEq)]
14520pub enum UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
14521    De,
14522    En,
14523    Fr,
14524    Nl,
14525}
14526impl UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
14527    pub fn as_str(self) -> &'static str {
14528        use UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*;
14529        match self {
14530            De => "de",
14531            En => "en",
14532            Fr => "fr",
14533            Nl => "nl",
14534        }
14535    }
14536}
14537
14538impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
14539    type Err = stripe_types::StripeParseError;
14540    fn from_str(s: &str) -> Result<Self, Self::Err> {
14541        use UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*;
14542        match s {
14543            "de" => Ok(De),
14544            "en" => Ok(En),
14545            "fr" => Ok(Fr),
14546            "nl" => Ok(Nl),
14547            _ => Err(stripe_types::StripeParseError),
14548        }
14549    }
14550}
14551impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
14552    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14553        f.write_str(self.as_str())
14554    }
14555}
14556
14557impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
14558    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14559        f.write_str(self.as_str())
14560    }
14561}
14562impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
14563    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14564    where
14565        S: serde::Serializer,
14566    {
14567        serializer.serialize_str(self.as_str())
14568    }
14569}
14570#[cfg(feature = "deserialize")]
14571impl<'de> serde::Deserialize<'de>
14572    for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage
14573{
14574    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14575        use std::str::FromStr;
14576        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14577        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage"))
14578    }
14579}
14580/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14581///
14582/// 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.
14583/// 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.
14584///
14585/// 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.
14586///
14587/// 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).
14588///
14589/// 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`.
14590#[derive(Copy, Clone, Eq, PartialEq)]
14591pub enum UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
14592    None,
14593    OffSession,
14594}
14595impl UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
14596    pub fn as_str(self) -> &'static str {
14597        use UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*;
14598        match self {
14599            None => "none",
14600            OffSession => "off_session",
14601        }
14602    }
14603}
14604
14605impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
14606    type Err = stripe_types::StripeParseError;
14607    fn from_str(s: &str) -> Result<Self, Self::Err> {
14608        use UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*;
14609        match s {
14610            "none" => Ok(None),
14611            "off_session" => Ok(OffSession),
14612            _ => Err(stripe_types::StripeParseError),
14613        }
14614    }
14615}
14616impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
14617    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14618        f.write_str(self.as_str())
14619    }
14620}
14621
14622impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
14623    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14624        f.write_str(self.as_str())
14625    }
14626}
14627impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
14628    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14629    where
14630        S: serde::Serializer,
14631    {
14632        serializer.serialize_str(self.as_str())
14633    }
14634}
14635#[cfg(feature = "deserialize")]
14636impl<'de> serde::Deserialize<'de>
14637    for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage
14638{
14639    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14640        use std::str::FromStr;
14641        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14642        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage"))
14643    }
14644}
14645/// If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options.
14646#[derive(Copy, Clone, Debug, serde::Serialize)]
14647pub struct UpdatePaymentIntentPaymentMethodOptionsBillie {
14648    /// Controls when the funds are captured from the customer's account.
14649    ///
14650    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
14651    ///
14652    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
14653    #[serde(skip_serializing_if = "Option::is_none")]
14654    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod>,
14655}
14656impl UpdatePaymentIntentPaymentMethodOptionsBillie {
14657    pub fn new() -> Self {
14658        Self { capture_method: None }
14659    }
14660}
14661impl Default for UpdatePaymentIntentPaymentMethodOptionsBillie {
14662    fn default() -> Self {
14663        Self::new()
14664    }
14665}
14666/// Controls when the funds are captured from the customer's account.
14667///
14668/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
14669///
14670/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
14671#[derive(Copy, Clone, Eq, PartialEq)]
14672pub enum UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
14673    Manual,
14674}
14675impl UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
14676    pub fn as_str(self) -> &'static str {
14677        use UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod::*;
14678        match self {
14679            Manual => "manual",
14680        }
14681    }
14682}
14683
14684impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
14685    type Err = stripe_types::StripeParseError;
14686    fn from_str(s: &str) -> Result<Self, Self::Err> {
14687        use UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod::*;
14688        match s {
14689            "manual" => Ok(Manual),
14690            _ => Err(stripe_types::StripeParseError),
14691        }
14692    }
14693}
14694impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
14695    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14696        f.write_str(self.as_str())
14697    }
14698}
14699
14700impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
14701    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14702        f.write_str(self.as_str())
14703    }
14704}
14705impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
14706    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14707    where
14708        S: serde::Serializer,
14709    {
14710        serializer.serialize_str(self.as_str())
14711    }
14712}
14713#[cfg(feature = "deserialize")]
14714impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
14715    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14716        use std::str::FromStr;
14717        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14718        Self::from_str(&s).map_err(|_| {
14719            serde::de::Error::custom(
14720                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod",
14721            )
14722        })
14723    }
14724}
14725/// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options.
14726#[derive(Clone, Debug, serde::Serialize)]
14727pub struct UpdatePaymentIntentPaymentMethodOptionsBlik {
14728    /// The 6-digit BLIK code that a customer has generated using their banking application.
14729    /// Can only be set on confirmation.
14730    #[serde(skip_serializing_if = "Option::is_none")]
14731    pub code: Option<String>,
14732    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14733    ///
14734    /// 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.
14735    /// 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.
14736    ///
14737    /// 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.
14738    ///
14739    /// 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).
14740    ///
14741    /// 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`.
14742    #[serde(skip_serializing_if = "Option::is_none")]
14743    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage>,
14744}
14745impl UpdatePaymentIntentPaymentMethodOptionsBlik {
14746    pub fn new() -> Self {
14747        Self { code: None, setup_future_usage: None }
14748    }
14749}
14750impl Default for UpdatePaymentIntentPaymentMethodOptionsBlik {
14751    fn default() -> Self {
14752        Self::new()
14753    }
14754}
14755/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14756///
14757/// 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.
14758/// 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.
14759///
14760/// 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.
14761///
14762/// 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).
14763///
14764/// 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`.
14765#[derive(Copy, Clone, Eq, PartialEq)]
14766pub enum UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
14767    None,
14768}
14769impl UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
14770    pub fn as_str(self) -> &'static str {
14771        use UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::*;
14772        match self {
14773            None => "none",
14774        }
14775    }
14776}
14777
14778impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
14779    type Err = stripe_types::StripeParseError;
14780    fn from_str(s: &str) -> Result<Self, Self::Err> {
14781        use UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::*;
14782        match s {
14783            "none" => Ok(None),
14784            _ => Err(stripe_types::StripeParseError),
14785        }
14786    }
14787}
14788impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
14789    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14790        f.write_str(self.as_str())
14791    }
14792}
14793
14794impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
14795    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14796        f.write_str(self.as_str())
14797    }
14798}
14799impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
14800    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14801    where
14802        S: serde::Serializer,
14803    {
14804        serializer.serialize_str(self.as_str())
14805    }
14806}
14807#[cfg(feature = "deserialize")]
14808impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
14809    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14810        use std::str::FromStr;
14811        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14812        Self::from_str(&s).map_err(|_| {
14813            serde::de::Error::custom(
14814                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage",
14815            )
14816        })
14817    }
14818}
14819/// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options.
14820#[derive(Copy, Clone, Debug, serde::Serialize)]
14821pub struct UpdatePaymentIntentPaymentMethodOptionsBoleto {
14822    /// The number of calendar days before a Boleto voucher expires.
14823    /// 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.
14824    #[serde(skip_serializing_if = "Option::is_none")]
14825    pub expires_after_days: Option<u32>,
14826    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14827    ///
14828    /// 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.
14829    /// 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.
14830    ///
14831    /// 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.
14832    ///
14833    /// 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).
14834    ///
14835    /// 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`.
14836    #[serde(skip_serializing_if = "Option::is_none")]
14837    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage>,
14838}
14839impl UpdatePaymentIntentPaymentMethodOptionsBoleto {
14840    pub fn new() -> Self {
14841        Self { expires_after_days: None, setup_future_usage: None }
14842    }
14843}
14844impl Default for UpdatePaymentIntentPaymentMethodOptionsBoleto {
14845    fn default() -> Self {
14846        Self::new()
14847    }
14848}
14849/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14850///
14851/// 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.
14852/// 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.
14853///
14854/// 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.
14855///
14856/// 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).
14857///
14858/// 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`.
14859#[derive(Copy, Clone, Eq, PartialEq)]
14860pub enum UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
14861    None,
14862    OffSession,
14863    OnSession,
14864}
14865impl UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
14866    pub fn as_str(self) -> &'static str {
14867        use UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*;
14868        match self {
14869            None => "none",
14870            OffSession => "off_session",
14871            OnSession => "on_session",
14872        }
14873    }
14874}
14875
14876impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
14877    type Err = stripe_types::StripeParseError;
14878    fn from_str(s: &str) -> Result<Self, Self::Err> {
14879        use UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*;
14880        match s {
14881            "none" => Ok(None),
14882            "off_session" => Ok(OffSession),
14883            "on_session" => Ok(OnSession),
14884            _ => Err(stripe_types::StripeParseError),
14885        }
14886    }
14887}
14888impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
14889    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14890        f.write_str(self.as_str())
14891    }
14892}
14893
14894impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
14895    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14896        f.write_str(self.as_str())
14897    }
14898}
14899impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
14900    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14901    where
14902        S: serde::Serializer,
14903    {
14904        serializer.serialize_str(self.as_str())
14905    }
14906}
14907#[cfg(feature = "deserialize")]
14908impl<'de> serde::Deserialize<'de>
14909    for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage
14910{
14911    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14912        use std::str::FromStr;
14913        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14914        Self::from_str(&s).map_err(|_| {
14915            serde::de::Error::custom(
14916                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage",
14917            )
14918        })
14919    }
14920}
14921/// Configuration for any card payments attempted on this PaymentIntent.
14922#[derive(Clone, Debug, serde::Serialize)]
14923pub struct UpdatePaymentIntentPaymentMethodOptionsCard {
14924    /// Controls when the funds are captured from the customer's account.
14925    ///
14926    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
14927    ///
14928    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
14929    #[serde(skip_serializing_if = "Option::is_none")]
14930    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod>,
14931    /// A single-use `cvc_update` Token that represents a card CVC value.
14932    /// When provided, the CVC value will be verified during the card payment attempt.
14933    /// This parameter can only be provided during confirmation.
14934    #[serde(skip_serializing_if = "Option::is_none")]
14935    pub cvc_token: Option<String>,
14936    /// Installment configuration for payments attempted on this PaymentIntent.
14937    ///
14938    /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
14939    #[serde(skip_serializing_if = "Option::is_none")]
14940    pub installments: Option<UpdatePaymentIntentPaymentMethodOptionsCardInstallments>,
14941    /// Configuration options for setting up an eMandate for cards issued in India.
14942    #[serde(skip_serializing_if = "Option::is_none")]
14943    pub mandate_options: Option<UpdatePaymentIntentPaymentMethodOptionsCardMandateOptions>,
14944    /// When specified, this parameter indicates that a transaction will be marked
14945    /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This
14946    /// parameter can only be provided during confirmation.
14947    #[serde(skip_serializing_if = "Option::is_none")]
14948    pub moto: Option<bool>,
14949    /// Selected network to process this PaymentIntent on.
14950    /// Depends on the available networks of the card attached to the PaymentIntent.
14951    /// Can be only set confirm-time.
14952    #[serde(skip_serializing_if = "Option::is_none")]
14953    pub network: Option<UpdatePaymentIntentPaymentMethodOptionsCardNetwork>,
14954    /// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent.
14955    #[serde(skip_serializing_if = "Option::is_none")]
14956    pub request_extended_authorization:
14957        Option<UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization>,
14958    /// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent.
14959    #[serde(skip_serializing_if = "Option::is_none")]
14960    pub request_incremental_authorization:
14961        Option<UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization>,
14962    /// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent.
14963    #[serde(skip_serializing_if = "Option::is_none")]
14964    pub request_multicapture:
14965        Option<UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture>,
14966    /// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent.
14967    #[serde(skip_serializing_if = "Option::is_none")]
14968    pub request_overcapture: Option<UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture>,
14969    /// 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://stripe.com/docs/strong-customer-authentication).
14970    /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
14971    /// If not provided, this value defaults to `automatic`.
14972    /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
14973    #[serde(skip_serializing_if = "Option::is_none")]
14974    pub request_three_d_secure:
14975        Option<UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure>,
14976    /// When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e.
14977    /// using the cvc_token parameter).
14978    #[serde(skip_serializing_if = "Option::is_none")]
14979    pub require_cvc_recollection: Option<bool>,
14980    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14981    ///
14982    /// 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.
14983    /// 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.
14984    ///
14985    /// 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.
14986    ///
14987    /// 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).
14988    ///
14989    /// 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`.
14990    #[serde(skip_serializing_if = "Option::is_none")]
14991    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage>,
14992    /// Provides information about a card payment that customers see on their statements.
14993    /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor.
14994    /// Maximum 22 characters.
14995    /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters.
14996    #[serde(skip_serializing_if = "Option::is_none")]
14997    pub statement_descriptor_suffix_kana: Option<String>,
14998    /// Provides information about a card payment that customers see on their statements.
14999    /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor.
15000    /// Maximum 17 characters.
15001    /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters.
15002    #[serde(skip_serializing_if = "Option::is_none")]
15003    pub statement_descriptor_suffix_kanji: Option<String>,
15004    /// If 3D Secure authentication was performed with a third-party provider,
15005    /// the authentication details to use for this payment.
15006    #[serde(skip_serializing_if = "Option::is_none")]
15007    pub three_d_secure: Option<UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecure>,
15008}
15009impl UpdatePaymentIntentPaymentMethodOptionsCard {
15010    pub fn new() -> Self {
15011        Self {
15012            capture_method: None,
15013            cvc_token: None,
15014            installments: None,
15015            mandate_options: None,
15016            moto: None,
15017            network: None,
15018            request_extended_authorization: None,
15019            request_incremental_authorization: None,
15020            request_multicapture: None,
15021            request_overcapture: None,
15022            request_three_d_secure: None,
15023            require_cvc_recollection: None,
15024            setup_future_usage: None,
15025            statement_descriptor_suffix_kana: None,
15026            statement_descriptor_suffix_kanji: None,
15027            three_d_secure: None,
15028        }
15029    }
15030}
15031impl Default for UpdatePaymentIntentPaymentMethodOptionsCard {
15032    fn default() -> Self {
15033        Self::new()
15034    }
15035}
15036/// Controls when the funds are captured from the customer's account.
15037///
15038/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
15039///
15040/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
15041#[derive(Copy, Clone, Eq, PartialEq)]
15042pub enum UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
15043    Manual,
15044}
15045impl UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
15046    pub fn as_str(self) -> &'static str {
15047        use UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod::*;
15048        match self {
15049            Manual => "manual",
15050        }
15051    }
15052}
15053
15054impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
15055    type Err = stripe_types::StripeParseError;
15056    fn from_str(s: &str) -> Result<Self, Self::Err> {
15057        use UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod::*;
15058        match s {
15059            "manual" => Ok(Manual),
15060            _ => Err(stripe_types::StripeParseError),
15061        }
15062    }
15063}
15064impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
15065    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15066        f.write_str(self.as_str())
15067    }
15068}
15069
15070impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
15071    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15072        f.write_str(self.as_str())
15073    }
15074}
15075impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
15076    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15077    where
15078        S: serde::Serializer,
15079    {
15080        serializer.serialize_str(self.as_str())
15081    }
15082}
15083#[cfg(feature = "deserialize")]
15084impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
15085    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15086        use std::str::FromStr;
15087        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15088        Self::from_str(&s).map_err(|_| {
15089            serde::de::Error::custom(
15090                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod",
15091            )
15092        })
15093    }
15094}
15095/// Installment configuration for payments attempted on this PaymentIntent.
15096///
15097/// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
15098#[derive(Copy, Clone, Debug, serde::Serialize)]
15099pub struct UpdatePaymentIntentPaymentMethodOptionsCardInstallments {
15100    /// Setting to true enables installments for this PaymentIntent.
15101    /// This will cause the response to contain a list of available installment plans.
15102    /// Setting to false will prevent any selected plan from applying to a charge.
15103    #[serde(skip_serializing_if = "Option::is_none")]
15104    pub enabled: Option<bool>,
15105    /// The selected installment plan to use for this payment attempt.
15106    /// This parameter can only be provided during confirmation.
15107    #[serde(skip_serializing_if = "Option::is_none")]
15108    pub plan: Option<UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan>,
15109}
15110impl UpdatePaymentIntentPaymentMethodOptionsCardInstallments {
15111    pub fn new() -> Self {
15112        Self { enabled: None, plan: None }
15113    }
15114}
15115impl Default for UpdatePaymentIntentPaymentMethodOptionsCardInstallments {
15116    fn default() -> Self {
15117        Self::new()
15118    }
15119}
15120/// The selected installment plan to use for this payment attempt.
15121/// This parameter can only be provided during confirmation.
15122#[derive(Copy, Clone, Debug, serde::Serialize)]
15123pub struct UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan {
15124    /// For `fixed_count` installment plans, this is required.
15125    /// It represents the number of installment payments your customer will make to their credit card.
15126    #[serde(skip_serializing_if = "Option::is_none")]
15127    pub count: Option<u64>,
15128    /// For `fixed_count` installment plans, this is required.
15129    /// It represents the interval between installment payments your customer will make to their credit card.
15130    /// One of `month`.
15131    #[serde(skip_serializing_if = "Option::is_none")]
15132    pub interval: Option<UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval>,
15133    /// Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
15134    #[serde(rename = "type")]
15135    pub type_: UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType,
15136}
15137impl UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan {
15138    pub fn new(
15139        type_: impl Into<UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType>,
15140    ) -> Self {
15141        Self { count: None, interval: None, type_: type_.into() }
15142    }
15143}
15144/// For `fixed_count` installment plans, this is required.
15145/// It represents the interval between installment payments your customer will make to their credit card.
15146/// One of `month`.
15147#[derive(Copy, Clone, Eq, PartialEq)]
15148pub enum UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
15149    Month,
15150}
15151impl UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
15152    pub fn as_str(self) -> &'static str {
15153        use UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*;
15154        match self {
15155            Month => "month",
15156        }
15157    }
15158}
15159
15160impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
15161    type Err = stripe_types::StripeParseError;
15162    fn from_str(s: &str) -> Result<Self, Self::Err> {
15163        use UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*;
15164        match s {
15165            "month" => Ok(Month),
15166            _ => Err(stripe_types::StripeParseError),
15167        }
15168    }
15169}
15170impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
15171    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15172        f.write_str(self.as_str())
15173    }
15174}
15175
15176impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
15177    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15178        f.write_str(self.as_str())
15179    }
15180}
15181impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
15182    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15183    where
15184        S: serde::Serializer,
15185    {
15186        serializer.serialize_str(self.as_str())
15187    }
15188}
15189#[cfg(feature = "deserialize")]
15190impl<'de> serde::Deserialize<'de>
15191    for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval
15192{
15193    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15194        use std::str::FromStr;
15195        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15196        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval"))
15197    }
15198}
15199/// Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
15200#[derive(Copy, Clone, Eq, PartialEq)]
15201pub enum UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
15202    Bonus,
15203    FixedCount,
15204    Revolving,
15205}
15206impl UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
15207    pub fn as_str(self) -> &'static str {
15208        use UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*;
15209        match self {
15210            Bonus => "bonus",
15211            FixedCount => "fixed_count",
15212            Revolving => "revolving",
15213        }
15214    }
15215}
15216
15217impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
15218    type Err = stripe_types::StripeParseError;
15219    fn from_str(s: &str) -> Result<Self, Self::Err> {
15220        use UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*;
15221        match s {
15222            "bonus" => Ok(Bonus),
15223            "fixed_count" => Ok(FixedCount),
15224            "revolving" => Ok(Revolving),
15225            _ => Err(stripe_types::StripeParseError),
15226        }
15227    }
15228}
15229impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
15230    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15231        f.write_str(self.as_str())
15232    }
15233}
15234
15235impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
15236    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15237        f.write_str(self.as_str())
15238    }
15239}
15240impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
15241    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15242    where
15243        S: serde::Serializer,
15244    {
15245        serializer.serialize_str(self.as_str())
15246    }
15247}
15248#[cfg(feature = "deserialize")]
15249impl<'de> serde::Deserialize<'de>
15250    for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType
15251{
15252    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15253        use std::str::FromStr;
15254        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15255        Self::from_str(&s).map_err(|_| {
15256            serde::de::Error::custom(
15257                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType",
15258            )
15259        })
15260    }
15261}
15262/// Configuration options for setting up an eMandate for cards issued in India.
15263#[derive(Clone, Debug, serde::Serialize)]
15264pub struct UpdatePaymentIntentPaymentMethodOptionsCardMandateOptions {
15265    /// Amount to be charged for future payments.
15266    pub amount: i64,
15267    /// One of `fixed` or `maximum`.
15268    /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
15269    /// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
15270    pub amount_type: UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType,
15271    /// A description of the mandate or subscription that is meant to be displayed to the customer.
15272    #[serde(skip_serializing_if = "Option::is_none")]
15273    pub description: Option<String>,
15274    /// End date of the mandate or subscription.
15275    /// If not provided, the mandate will be active until canceled.
15276    /// If provided, end date should be after start date.
15277    #[serde(skip_serializing_if = "Option::is_none")]
15278    pub end_date: Option<stripe_types::Timestamp>,
15279    /// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
15280    pub interval: UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval,
15281    /// The number of intervals between payments.
15282    /// For example, `interval=month` and `interval_count=3` indicates one payment every three months.
15283    /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).
15284    /// This parameter is optional when `interval=sporadic`.
15285    #[serde(skip_serializing_if = "Option::is_none")]
15286    pub interval_count: Option<u64>,
15287    /// Unique identifier for the mandate or subscription.
15288    pub reference: String,
15289    /// Start date of the mandate or subscription. Start date should not be lesser than yesterday.
15290    pub start_date: stripe_types::Timestamp,
15291    /// Specifies the type of mandates supported. Possible values are `india`.
15292    #[serde(skip_serializing_if = "Option::is_none")]
15293    pub supported_types:
15294        Option<Vec<UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
15295}
15296impl UpdatePaymentIntentPaymentMethodOptionsCardMandateOptions {
15297    pub fn new(
15298        amount: impl Into<i64>,
15299        amount_type: impl Into<UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
15300        interval: impl Into<UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval>,
15301        reference: impl Into<String>,
15302        start_date: impl Into<stripe_types::Timestamp>,
15303    ) -> Self {
15304        Self {
15305            amount: amount.into(),
15306            amount_type: amount_type.into(),
15307            description: None,
15308            end_date: None,
15309            interval: interval.into(),
15310            interval_count: None,
15311            reference: reference.into(),
15312            start_date: start_date.into(),
15313            supported_types: None,
15314        }
15315    }
15316}
15317/// One of `fixed` or `maximum`.
15318/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
15319/// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
15320#[derive(Copy, Clone, Eq, PartialEq)]
15321pub enum UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
15322    Fixed,
15323    Maximum,
15324}
15325impl UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
15326    pub fn as_str(self) -> &'static str {
15327        use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
15328        match self {
15329            Fixed => "fixed",
15330            Maximum => "maximum",
15331        }
15332    }
15333}
15334
15335impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
15336    type Err = stripe_types::StripeParseError;
15337    fn from_str(s: &str) -> Result<Self, Self::Err> {
15338        use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
15339        match s {
15340            "fixed" => Ok(Fixed),
15341            "maximum" => Ok(Maximum),
15342            _ => Err(stripe_types::StripeParseError),
15343        }
15344    }
15345}
15346impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
15347    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15348        f.write_str(self.as_str())
15349    }
15350}
15351
15352impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
15353    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15354        f.write_str(self.as_str())
15355    }
15356}
15357impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
15358    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15359    where
15360        S: serde::Serializer,
15361    {
15362        serializer.serialize_str(self.as_str())
15363    }
15364}
15365#[cfg(feature = "deserialize")]
15366impl<'de> serde::Deserialize<'de>
15367    for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType
15368{
15369    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15370        use std::str::FromStr;
15371        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15372        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType"))
15373    }
15374}
15375/// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
15376#[derive(Copy, Clone, Eq, PartialEq)]
15377pub enum UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
15378    Day,
15379    Month,
15380    Sporadic,
15381    Week,
15382    Year,
15383}
15384impl UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
15385    pub fn as_str(self) -> &'static str {
15386        use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
15387        match self {
15388            Day => "day",
15389            Month => "month",
15390            Sporadic => "sporadic",
15391            Week => "week",
15392            Year => "year",
15393        }
15394    }
15395}
15396
15397impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
15398    type Err = stripe_types::StripeParseError;
15399    fn from_str(s: &str) -> Result<Self, Self::Err> {
15400        use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
15401        match s {
15402            "day" => Ok(Day),
15403            "month" => Ok(Month),
15404            "sporadic" => Ok(Sporadic),
15405            "week" => Ok(Week),
15406            "year" => Ok(Year),
15407            _ => Err(stripe_types::StripeParseError),
15408        }
15409    }
15410}
15411impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
15412    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15413        f.write_str(self.as_str())
15414    }
15415}
15416
15417impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
15418    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15419        f.write_str(self.as_str())
15420    }
15421}
15422impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
15423    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15424    where
15425        S: serde::Serializer,
15426    {
15427        serializer.serialize_str(self.as_str())
15428    }
15429}
15430#[cfg(feature = "deserialize")]
15431impl<'de> serde::Deserialize<'de>
15432    for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval
15433{
15434    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15435        use std::str::FromStr;
15436        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15437        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval"))
15438    }
15439}
15440/// Specifies the type of mandates supported. Possible values are `india`.
15441#[derive(Copy, Clone, Eq, PartialEq)]
15442pub enum UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
15443    India,
15444}
15445impl UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
15446    pub fn as_str(self) -> &'static str {
15447        use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
15448        match self {
15449            India => "india",
15450        }
15451    }
15452}
15453
15454impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
15455    type Err = stripe_types::StripeParseError;
15456    fn from_str(s: &str) -> Result<Self, Self::Err> {
15457        use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
15458        match s {
15459            "india" => Ok(India),
15460            _ => Err(stripe_types::StripeParseError),
15461        }
15462    }
15463}
15464impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
15465    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15466        f.write_str(self.as_str())
15467    }
15468}
15469
15470impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
15471    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15472        f.write_str(self.as_str())
15473    }
15474}
15475impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
15476    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15477    where
15478        S: serde::Serializer,
15479    {
15480        serializer.serialize_str(self.as_str())
15481    }
15482}
15483#[cfg(feature = "deserialize")]
15484impl<'de> serde::Deserialize<'de>
15485    for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
15486{
15487    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15488        use std::str::FromStr;
15489        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15490        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"))
15491    }
15492}
15493/// Selected network to process this PaymentIntent on.
15494/// Depends on the available networks of the card attached to the PaymentIntent.
15495/// Can be only set confirm-time.
15496#[derive(Copy, Clone, Eq, PartialEq)]
15497pub enum UpdatePaymentIntentPaymentMethodOptionsCardNetwork {
15498    Amex,
15499    CartesBancaires,
15500    Diners,
15501    Discover,
15502    EftposAu,
15503    Girocard,
15504    Interac,
15505    Jcb,
15506    Link,
15507    Mastercard,
15508    Unionpay,
15509    Unknown,
15510    Visa,
15511}
15512impl UpdatePaymentIntentPaymentMethodOptionsCardNetwork {
15513    pub fn as_str(self) -> &'static str {
15514        use UpdatePaymentIntentPaymentMethodOptionsCardNetwork::*;
15515        match self {
15516            Amex => "amex",
15517            CartesBancaires => "cartes_bancaires",
15518            Diners => "diners",
15519            Discover => "discover",
15520            EftposAu => "eftpos_au",
15521            Girocard => "girocard",
15522            Interac => "interac",
15523            Jcb => "jcb",
15524            Link => "link",
15525            Mastercard => "mastercard",
15526            Unionpay => "unionpay",
15527            Unknown => "unknown",
15528            Visa => "visa",
15529        }
15530    }
15531}
15532
15533impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardNetwork {
15534    type Err = stripe_types::StripeParseError;
15535    fn from_str(s: &str) -> Result<Self, Self::Err> {
15536        use UpdatePaymentIntentPaymentMethodOptionsCardNetwork::*;
15537        match s {
15538            "amex" => Ok(Amex),
15539            "cartes_bancaires" => Ok(CartesBancaires),
15540            "diners" => Ok(Diners),
15541            "discover" => Ok(Discover),
15542            "eftpos_au" => Ok(EftposAu),
15543            "girocard" => Ok(Girocard),
15544            "interac" => Ok(Interac),
15545            "jcb" => Ok(Jcb),
15546            "link" => Ok(Link),
15547            "mastercard" => Ok(Mastercard),
15548            "unionpay" => Ok(Unionpay),
15549            "unknown" => Ok(Unknown),
15550            "visa" => Ok(Visa),
15551            _ => Err(stripe_types::StripeParseError),
15552        }
15553    }
15554}
15555impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardNetwork {
15556    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15557        f.write_str(self.as_str())
15558    }
15559}
15560
15561impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardNetwork {
15562    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15563        f.write_str(self.as_str())
15564    }
15565}
15566impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardNetwork {
15567    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15568    where
15569        S: serde::Serializer,
15570    {
15571        serializer.serialize_str(self.as_str())
15572    }
15573}
15574#[cfg(feature = "deserialize")]
15575impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsCardNetwork {
15576    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15577        use std::str::FromStr;
15578        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15579        Self::from_str(&s).map_err(|_| {
15580            serde::de::Error::custom(
15581                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardNetwork",
15582            )
15583        })
15584    }
15585}
15586/// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent.
15587#[derive(Copy, Clone, Eq, PartialEq)]
15588pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
15589    IfAvailable,
15590    Never,
15591}
15592impl UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
15593    pub fn as_str(self) -> &'static str {
15594        use UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*;
15595        match self {
15596            IfAvailable => "if_available",
15597            Never => "never",
15598        }
15599    }
15600}
15601
15602impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
15603    type Err = stripe_types::StripeParseError;
15604    fn from_str(s: &str) -> Result<Self, Self::Err> {
15605        use UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*;
15606        match s {
15607            "if_available" => Ok(IfAvailable),
15608            "never" => Ok(Never),
15609            _ => Err(stripe_types::StripeParseError),
15610        }
15611    }
15612}
15613impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
15614    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15615        f.write_str(self.as_str())
15616    }
15617}
15618
15619impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
15620    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15621        f.write_str(self.as_str())
15622    }
15623}
15624impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
15625    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15626    where
15627        S: serde::Serializer,
15628    {
15629        serializer.serialize_str(self.as_str())
15630    }
15631}
15632#[cfg(feature = "deserialize")]
15633impl<'de> serde::Deserialize<'de>
15634    for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization
15635{
15636    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15637        use std::str::FromStr;
15638        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15639        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization"))
15640    }
15641}
15642/// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent.
15643#[derive(Copy, Clone, Eq, PartialEq)]
15644pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization {
15645    IfAvailable,
15646    Never,
15647}
15648impl UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization {
15649    pub fn as_str(self) -> &'static str {
15650        use UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*;
15651        match self {
15652            IfAvailable => "if_available",
15653            Never => "never",
15654        }
15655    }
15656}
15657
15658impl std::str::FromStr
15659    for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
15660{
15661    type Err = stripe_types::StripeParseError;
15662    fn from_str(s: &str) -> Result<Self, Self::Err> {
15663        use UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*;
15664        match s {
15665            "if_available" => Ok(IfAvailable),
15666            "never" => Ok(Never),
15667            _ => Err(stripe_types::StripeParseError),
15668        }
15669    }
15670}
15671impl std::fmt::Display
15672    for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
15673{
15674    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15675        f.write_str(self.as_str())
15676    }
15677}
15678
15679impl std::fmt::Debug
15680    for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
15681{
15682    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15683        f.write_str(self.as_str())
15684    }
15685}
15686impl serde::Serialize
15687    for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
15688{
15689    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15690    where
15691        S: serde::Serializer,
15692    {
15693        serializer.serialize_str(self.as_str())
15694    }
15695}
15696#[cfg(feature = "deserialize")]
15697impl<'de> serde::Deserialize<'de>
15698    for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
15699{
15700    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15701        use std::str::FromStr;
15702        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15703        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization"))
15704    }
15705}
15706/// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent.
15707#[derive(Copy, Clone, Eq, PartialEq)]
15708pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
15709    IfAvailable,
15710    Never,
15711}
15712impl UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
15713    pub fn as_str(self) -> &'static str {
15714        use UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture::*;
15715        match self {
15716            IfAvailable => "if_available",
15717            Never => "never",
15718        }
15719    }
15720}
15721
15722impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
15723    type Err = stripe_types::StripeParseError;
15724    fn from_str(s: &str) -> Result<Self, Self::Err> {
15725        use UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture::*;
15726        match s {
15727            "if_available" => Ok(IfAvailable),
15728            "never" => Ok(Never),
15729            _ => Err(stripe_types::StripeParseError),
15730        }
15731    }
15732}
15733impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
15734    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15735        f.write_str(self.as_str())
15736    }
15737}
15738
15739impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
15740    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15741        f.write_str(self.as_str())
15742    }
15743}
15744impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
15745    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15746    where
15747        S: serde::Serializer,
15748    {
15749        serializer.serialize_str(self.as_str())
15750    }
15751}
15752#[cfg(feature = "deserialize")]
15753impl<'de> serde::Deserialize<'de>
15754    for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture
15755{
15756    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15757        use std::str::FromStr;
15758        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15759        Self::from_str(&s).map_err(|_| {
15760            serde::de::Error::custom(
15761                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture",
15762            )
15763        })
15764    }
15765}
15766/// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent.
15767#[derive(Copy, Clone, Eq, PartialEq)]
15768pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
15769    IfAvailable,
15770    Never,
15771}
15772impl UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
15773    pub fn as_str(self) -> &'static str {
15774        use UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture::*;
15775        match self {
15776            IfAvailable => "if_available",
15777            Never => "never",
15778        }
15779    }
15780}
15781
15782impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
15783    type Err = stripe_types::StripeParseError;
15784    fn from_str(s: &str) -> Result<Self, Self::Err> {
15785        use UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture::*;
15786        match s {
15787            "if_available" => Ok(IfAvailable),
15788            "never" => Ok(Never),
15789            _ => Err(stripe_types::StripeParseError),
15790        }
15791    }
15792}
15793impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
15794    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15795        f.write_str(self.as_str())
15796    }
15797}
15798
15799impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
15800    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15801        f.write_str(self.as_str())
15802    }
15803}
15804impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
15805    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15806    where
15807        S: serde::Serializer,
15808    {
15809        serializer.serialize_str(self.as_str())
15810    }
15811}
15812#[cfg(feature = "deserialize")]
15813impl<'de> serde::Deserialize<'de>
15814    for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture
15815{
15816    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15817        use std::str::FromStr;
15818        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15819        Self::from_str(&s).map_err(|_| {
15820            serde::de::Error::custom(
15821                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture",
15822            )
15823        })
15824    }
15825}
15826/// 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://stripe.com/docs/strong-customer-authentication).
15827/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
15828/// If not provided, this value defaults to `automatic`.
15829/// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
15830#[derive(Copy, Clone, Eq, PartialEq)]
15831pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
15832    Any,
15833    Automatic,
15834    Challenge,
15835}
15836impl UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
15837    pub fn as_str(self) -> &'static str {
15838        use UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
15839        match self {
15840            Any => "any",
15841            Automatic => "automatic",
15842            Challenge => "challenge",
15843        }
15844    }
15845}
15846
15847impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
15848    type Err = stripe_types::StripeParseError;
15849    fn from_str(s: &str) -> Result<Self, Self::Err> {
15850        use UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
15851        match s {
15852            "any" => Ok(Any),
15853            "automatic" => Ok(Automatic),
15854            "challenge" => Ok(Challenge),
15855            _ => Err(stripe_types::StripeParseError),
15856        }
15857    }
15858}
15859impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
15860    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15861        f.write_str(self.as_str())
15862    }
15863}
15864
15865impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
15866    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15867        f.write_str(self.as_str())
15868    }
15869}
15870impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
15871    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15872    where
15873        S: serde::Serializer,
15874    {
15875        serializer.serialize_str(self.as_str())
15876    }
15877}
15878#[cfg(feature = "deserialize")]
15879impl<'de> serde::Deserialize<'de>
15880    for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure
15881{
15882    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15883        use std::str::FromStr;
15884        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15885        Self::from_str(&s).map_err(|_| {
15886            serde::de::Error::custom(
15887                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure",
15888            )
15889        })
15890    }
15891}
15892/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
15893///
15894/// 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.
15895/// 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.
15896///
15897/// 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.
15898///
15899/// 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).
15900///
15901/// 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`.
15902#[derive(Copy, Clone, Eq, PartialEq)]
15903pub enum UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
15904    None,
15905    OffSession,
15906    OnSession,
15907}
15908impl UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
15909    pub fn as_str(self) -> &'static str {
15910        use UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*;
15911        match self {
15912            None => "none",
15913            OffSession => "off_session",
15914            OnSession => "on_session",
15915        }
15916    }
15917}
15918
15919impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
15920    type Err = stripe_types::StripeParseError;
15921    fn from_str(s: &str) -> Result<Self, Self::Err> {
15922        use UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*;
15923        match s {
15924            "none" => Ok(None),
15925            "off_session" => Ok(OffSession),
15926            "on_session" => Ok(OnSession),
15927            _ => Err(stripe_types::StripeParseError),
15928        }
15929    }
15930}
15931impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
15932    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15933        f.write_str(self.as_str())
15934    }
15935}
15936
15937impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
15938    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15939        f.write_str(self.as_str())
15940    }
15941}
15942impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
15943    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15944    where
15945        S: serde::Serializer,
15946    {
15947        serializer.serialize_str(self.as_str())
15948    }
15949}
15950#[cfg(feature = "deserialize")]
15951impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
15952    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15953        use std::str::FromStr;
15954        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15955        Self::from_str(&s).map_err(|_| {
15956            serde::de::Error::custom(
15957                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage",
15958            )
15959        })
15960    }
15961}
15962/// If 3D Secure authentication was performed with a third-party provider,
15963/// the authentication details to use for this payment.
15964#[derive(Clone, Debug, serde::Serialize)]
15965pub struct UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecure {
15966    /// The `transStatus` returned from the card Issuer’s ACS in the ARes.
15967    #[serde(skip_serializing_if = "Option::is_none")]
15968    pub ares_trans_status:
15969        Option<UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
15970    /// The cryptogram, also known as the "authentication value" (AAV, CAVV or
15971    /// AEVV). This value is 20 bytes, base64-encoded into a 28-character string.
15972    /// (Most 3D Secure providers will return the base64-encoded version, which
15973    /// is what you should specify here.)
15974    pub cryptogram: String,
15975    /// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
15976    /// provider and indicates what degree of authentication was performed.
15977    #[serde(skip_serializing_if = "Option::is_none")]
15978    pub electronic_commerce_indicator:
15979        Option<UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
15980    /// The exemption requested via 3DS and accepted by the issuer at authentication time.
15981    #[serde(skip_serializing_if = "Option::is_none")]
15982    pub exemption_indicator:
15983        Option<UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator>,
15984    /// Network specific 3DS fields. Network specific arguments require an
15985    /// explicit card brand choice. The parameter `payment_method_options.card.network``
15986    /// must be populated accordingly
15987    #[serde(skip_serializing_if = "Option::is_none")]
15988    pub network_options:
15989        Option<UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
15990    /// The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the
15991    /// AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99.
15992    #[serde(skip_serializing_if = "Option::is_none")]
15993    pub requestor_challenge_indicator: Option<String>,
15994    /// For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server
15995    /// Transaction ID (dsTransID).
15996    pub transaction_id: String,
15997    /// The version of 3D Secure that was performed.
15998    pub version: UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion,
15999}
16000impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecure {
16001    pub fn new(
16002        cryptogram: impl Into<String>,
16003        transaction_id: impl Into<String>,
16004        version: impl Into<UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion>,
16005    ) -> Self {
16006        Self {
16007            ares_trans_status: None,
16008            cryptogram: cryptogram.into(),
16009            electronic_commerce_indicator: None,
16010            exemption_indicator: None,
16011            network_options: None,
16012            requestor_challenge_indicator: None,
16013            transaction_id: transaction_id.into(),
16014            version: version.into(),
16015        }
16016    }
16017}
16018/// The `transStatus` returned from the card Issuer’s ACS in the ARes.
16019#[derive(Copy, Clone, Eq, PartialEq)]
16020pub enum UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
16021    A,
16022    C,
16023    I,
16024    N,
16025    R,
16026    U,
16027    Y,
16028}
16029impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
16030    pub fn as_str(self) -> &'static str {
16031        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
16032        match self {
16033            A => "A",
16034            C => "C",
16035            I => "I",
16036            N => "N",
16037            R => "R",
16038            U => "U",
16039            Y => "Y",
16040        }
16041    }
16042}
16043
16044impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
16045    type Err = stripe_types::StripeParseError;
16046    fn from_str(s: &str) -> Result<Self, Self::Err> {
16047        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
16048        match s {
16049            "A" => Ok(A),
16050            "C" => Ok(C),
16051            "I" => Ok(I),
16052            "N" => Ok(N),
16053            "R" => Ok(R),
16054            "U" => Ok(U),
16055            "Y" => Ok(Y),
16056            _ => Err(stripe_types::StripeParseError),
16057        }
16058    }
16059}
16060impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
16061    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16062        f.write_str(self.as_str())
16063    }
16064}
16065
16066impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
16067    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16068        f.write_str(self.as_str())
16069    }
16070}
16071impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
16072    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16073    where
16074        S: serde::Serializer,
16075    {
16076        serializer.serialize_str(self.as_str())
16077    }
16078}
16079#[cfg(feature = "deserialize")]
16080impl<'de> serde::Deserialize<'de>
16081    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
16082{
16083    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16084        use std::str::FromStr;
16085        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16086        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"))
16087    }
16088}
16089/// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
16090/// provider and indicates what degree of authentication was performed.
16091#[derive(Copy, Clone, Eq, PartialEq)]
16092pub enum UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
16093    V01,
16094    V02,
16095    V05,
16096    V06,
16097    V07,
16098}
16099impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
16100    pub fn as_str(self) -> &'static str {
16101        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
16102        match self {
16103            V01 => "01",
16104            V02 => "02",
16105            V05 => "05",
16106            V06 => "06",
16107            V07 => "07",
16108        }
16109    }
16110}
16111
16112impl std::str::FromStr
16113    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
16114{
16115    type Err = stripe_types::StripeParseError;
16116    fn from_str(s: &str) -> Result<Self, Self::Err> {
16117        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
16118        match s {
16119            "01" => Ok(V01),
16120            "02" => Ok(V02),
16121            "05" => Ok(V05),
16122            "06" => Ok(V06),
16123            "07" => Ok(V07),
16124            _ => Err(stripe_types::StripeParseError),
16125        }
16126    }
16127}
16128impl std::fmt::Display
16129    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
16130{
16131    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16132        f.write_str(self.as_str())
16133    }
16134}
16135
16136impl std::fmt::Debug
16137    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
16138{
16139    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16140        f.write_str(self.as_str())
16141    }
16142}
16143impl serde::Serialize
16144    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
16145{
16146    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16147    where
16148        S: serde::Serializer,
16149    {
16150        serializer.serialize_str(self.as_str())
16151    }
16152}
16153#[cfg(feature = "deserialize")]
16154impl<'de> serde::Deserialize<'de>
16155    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
16156{
16157    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16158        use std::str::FromStr;
16159        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16160        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"))
16161    }
16162}
16163/// The exemption requested via 3DS and accepted by the issuer at authentication time.
16164#[derive(Copy, Clone, Eq, PartialEq)]
16165pub enum UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator {
16166    LowRisk,
16167    None,
16168}
16169impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator {
16170    pub fn as_str(self) -> &'static str {
16171        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::*;
16172        match self {
16173            LowRisk => "low_risk",
16174            None => "none",
16175        }
16176    }
16177}
16178
16179impl std::str::FromStr
16180    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
16181{
16182    type Err = stripe_types::StripeParseError;
16183    fn from_str(s: &str) -> Result<Self, Self::Err> {
16184        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::*;
16185        match s {
16186            "low_risk" => Ok(LowRisk),
16187            "none" => Ok(None),
16188            _ => Err(stripe_types::StripeParseError),
16189        }
16190    }
16191}
16192impl std::fmt::Display
16193    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
16194{
16195    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16196        f.write_str(self.as_str())
16197    }
16198}
16199
16200impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator {
16201    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16202        f.write_str(self.as_str())
16203    }
16204}
16205impl serde::Serialize
16206    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
16207{
16208    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16209    where
16210        S: serde::Serializer,
16211    {
16212        serializer.serialize_str(self.as_str())
16213    }
16214}
16215#[cfg(feature = "deserialize")]
16216impl<'de> serde::Deserialize<'de>
16217    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
16218{
16219    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16220        use std::str::FromStr;
16221        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16222        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator"))
16223    }
16224}
16225/// Network specific 3DS fields. Network specific arguments require an
16226/// explicit card brand choice. The parameter `payment_method_options.card.network``
16227/// must be populated accordingly
16228#[derive(Clone, Debug, serde::Serialize)]
16229pub struct UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
16230    /// Cartes Bancaires-specific 3DS fields.
16231    #[serde(skip_serializing_if = "Option::is_none")]
16232    pub cartes_bancaires: Option<
16233        UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires,
16234    >,
16235}
16236impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
16237    pub fn new() -> Self {
16238        Self { cartes_bancaires: None }
16239    }
16240}
16241impl Default for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
16242    fn default() -> Self {
16243        Self::new()
16244    }
16245}
16246/// Cartes Bancaires-specific 3DS fields.
16247#[derive(Clone, Debug, serde::Serialize)]
16248pub struct UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
16249    /// The cryptogram calculation algorithm used by the card Issuer's ACS
16250    /// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
16251    /// messageExtension: CB-AVALGO
16252pub cb_avalgo: UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
16253    /// The exemption indicator returned from Cartes Bancaires in the ARes.
16254    /// message extension: CB-EXEMPTION; string (4 characters)
16255    /// This is a 3 byte bitmap (low significant byte first and most significant
16256    /// bit first) that has been Base64 encoded
16257#[serde(skip_serializing_if = "Option::is_none")]
16258pub cb_exemption: Option<String>,
16259    /// The risk score returned from Cartes Bancaires in the ARes.
16260    /// message extension: CB-SCORE; numeric value 0-99
16261#[serde(skip_serializing_if = "Option::is_none")]
16262pub cb_score: Option<i64>,
16263
16264}
16265impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
16266    pub fn new(
16267        cb_avalgo: impl Into<UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
16268    ) -> Self {
16269        Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
16270    }
16271}
16272/// The cryptogram calculation algorithm used by the card Issuer's ACS
16273/// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
16274/// messageExtension: CB-AVALGO
16275#[derive(Copy, Clone, Eq, PartialEq)]
16276pub enum UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
16277{
16278    V0,
16279    V1,
16280    V2,
16281    V3,
16282    V4,
16283    A,
16284}
16285impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
16286    pub fn as_str(self) -> &'static str {
16287        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
16288        match self {
16289            V0 => "0",
16290            V1 => "1",
16291            V2 => "2",
16292            V3 => "3",
16293            V4 => "4",
16294            A => "A",
16295        }
16296    }
16297}
16298
16299impl std::str::FromStr
16300    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
16301{
16302    type Err = stripe_types::StripeParseError;
16303    fn from_str(s: &str) -> Result<Self, Self::Err> {
16304        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
16305        match s {
16306            "0" => Ok(V0),
16307            "1" => Ok(V1),
16308            "2" => Ok(V2),
16309            "3" => Ok(V3),
16310            "4" => Ok(V4),
16311            "A" => Ok(A),
16312            _ => Err(stripe_types::StripeParseError),
16313        }
16314    }
16315}
16316impl std::fmt::Display
16317    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
16318{
16319    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16320        f.write_str(self.as_str())
16321    }
16322}
16323
16324impl std::fmt::Debug
16325    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
16326{
16327    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16328        f.write_str(self.as_str())
16329    }
16330}
16331impl serde::Serialize
16332    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
16333{
16334    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16335    where
16336        S: serde::Serializer,
16337    {
16338        serializer.serialize_str(self.as_str())
16339    }
16340}
16341#[cfg(feature = "deserialize")]
16342impl<'de> serde::Deserialize<'de>
16343    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
16344{
16345    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16346        use std::str::FromStr;
16347        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16348        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"))
16349    }
16350}
16351/// The version of 3D Secure that was performed.
16352#[derive(Copy, Clone, Eq, PartialEq)]
16353pub enum UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
16354    V1_0_2,
16355    V2_1_0,
16356    V2_2_0,
16357}
16358impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
16359    pub fn as_str(self) -> &'static str {
16360        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
16361        match self {
16362            V1_0_2 => "1.0.2",
16363            V2_1_0 => "2.1.0",
16364            V2_2_0 => "2.2.0",
16365        }
16366    }
16367}
16368
16369impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
16370    type Err = stripe_types::StripeParseError;
16371    fn from_str(s: &str) -> Result<Self, Self::Err> {
16372        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
16373        match s {
16374            "1.0.2" => Ok(V1_0_2),
16375            "2.1.0" => Ok(V2_1_0),
16376            "2.2.0" => Ok(V2_2_0),
16377            _ => Err(stripe_types::StripeParseError),
16378        }
16379    }
16380}
16381impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
16382    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16383        f.write_str(self.as_str())
16384    }
16385}
16386
16387impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
16388    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16389        f.write_str(self.as_str())
16390    }
16391}
16392impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
16393    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16394    where
16395        S: serde::Serializer,
16396    {
16397        serializer.serialize_str(self.as_str())
16398    }
16399}
16400#[cfg(feature = "deserialize")]
16401impl<'de> serde::Deserialize<'de>
16402    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion
16403{
16404    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16405        use std::str::FromStr;
16406        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16407        Self::from_str(&s).map_err(|_| {
16408            serde::de::Error::custom(
16409                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion",
16410            )
16411        })
16412    }
16413}
16414/// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
16415#[derive(Copy, Clone, Debug, serde::Serialize)]
16416pub struct UpdatePaymentIntentPaymentMethodOptionsCardPresent {
16417    /// Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity).
16418    #[serde(skip_serializing_if = "Option::is_none")]
16419    pub request_extended_authorization: Option<bool>,
16420    /// Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible.
16421    /// Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support.
16422    #[serde(skip_serializing_if = "Option::is_none")]
16423    pub request_incremental_authorization_support: Option<bool>,
16424    /// Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes.
16425    #[serde(skip_serializing_if = "Option::is_none")]
16426    pub routing: Option<UpdatePaymentIntentPaymentMethodOptionsCardPresentRouting>,
16427}
16428impl UpdatePaymentIntentPaymentMethodOptionsCardPresent {
16429    pub fn new() -> Self {
16430        Self {
16431            request_extended_authorization: None,
16432            request_incremental_authorization_support: None,
16433            routing: None,
16434        }
16435    }
16436}
16437impl Default for UpdatePaymentIntentPaymentMethodOptionsCardPresent {
16438    fn default() -> Self {
16439        Self::new()
16440    }
16441}
16442/// Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes.
16443#[derive(Copy, Clone, Debug, serde::Serialize)]
16444pub struct UpdatePaymentIntentPaymentMethodOptionsCardPresentRouting {
16445    /// Routing requested priority
16446    #[serde(skip_serializing_if = "Option::is_none")]
16447    pub requested_priority:
16448        Option<UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority>,
16449}
16450impl UpdatePaymentIntentPaymentMethodOptionsCardPresentRouting {
16451    pub fn new() -> Self {
16452        Self { requested_priority: None }
16453    }
16454}
16455impl Default for UpdatePaymentIntentPaymentMethodOptionsCardPresentRouting {
16456    fn default() -> Self {
16457        Self::new()
16458    }
16459}
16460/// Routing requested priority
16461#[derive(Copy, Clone, Eq, PartialEq)]
16462pub enum UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority {
16463    Domestic,
16464    International,
16465}
16466impl UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority {
16467    pub fn as_str(self) -> &'static str {
16468        use UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority::*;
16469        match self {
16470            Domestic => "domestic",
16471            International => "international",
16472        }
16473    }
16474}
16475
16476impl std::str::FromStr
16477    for UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
16478{
16479    type Err = stripe_types::StripeParseError;
16480    fn from_str(s: &str) -> Result<Self, Self::Err> {
16481        use UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority::*;
16482        match s {
16483            "domestic" => Ok(Domestic),
16484            "international" => Ok(International),
16485            _ => Err(stripe_types::StripeParseError),
16486        }
16487    }
16488}
16489impl std::fmt::Display
16490    for UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
16491{
16492    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16493        f.write_str(self.as_str())
16494    }
16495}
16496
16497impl std::fmt::Debug
16498    for UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
16499{
16500    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16501        f.write_str(self.as_str())
16502    }
16503}
16504impl serde::Serialize
16505    for UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
16506{
16507    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16508    where
16509        S: serde::Serializer,
16510    {
16511        serializer.serialize_str(self.as_str())
16512    }
16513}
16514#[cfg(feature = "deserialize")]
16515impl<'de> serde::Deserialize<'de>
16516    for UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
16517{
16518    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16519        use std::str::FromStr;
16520        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16521        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority"))
16522    }
16523}
16524/// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options.
16525#[derive(Copy, Clone, Debug, serde::Serialize)]
16526pub struct UpdatePaymentIntentPaymentMethodOptionsCashapp {
16527    /// Controls when the funds are captured from the customer's account.
16528    ///
16529    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
16530    ///
16531    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
16532    #[serde(skip_serializing_if = "Option::is_none")]
16533    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod>,
16534    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
16535    ///
16536    /// 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.
16537    /// 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.
16538    ///
16539    /// 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.
16540    ///
16541    /// 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).
16542    ///
16543    /// 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`.
16544    #[serde(skip_serializing_if = "Option::is_none")]
16545    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage>,
16546}
16547impl UpdatePaymentIntentPaymentMethodOptionsCashapp {
16548    pub fn new() -> Self {
16549        Self { capture_method: None, setup_future_usage: None }
16550    }
16551}
16552impl Default for UpdatePaymentIntentPaymentMethodOptionsCashapp {
16553    fn default() -> Self {
16554        Self::new()
16555    }
16556}
16557/// Controls when the funds are captured from the customer's account.
16558///
16559/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
16560///
16561/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
16562#[derive(Copy, Clone, Eq, PartialEq)]
16563pub enum UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
16564    Manual,
16565}
16566impl UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
16567    pub fn as_str(self) -> &'static str {
16568        use UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod::*;
16569        match self {
16570            Manual => "manual",
16571        }
16572    }
16573}
16574
16575impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
16576    type Err = stripe_types::StripeParseError;
16577    fn from_str(s: &str) -> Result<Self, Self::Err> {
16578        use UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod::*;
16579        match s {
16580            "manual" => Ok(Manual),
16581            _ => Err(stripe_types::StripeParseError),
16582        }
16583    }
16584}
16585impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
16586    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16587        f.write_str(self.as_str())
16588    }
16589}
16590
16591impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
16592    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16593        f.write_str(self.as_str())
16594    }
16595}
16596impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
16597    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16598    where
16599        S: serde::Serializer,
16600    {
16601        serializer.serialize_str(self.as_str())
16602    }
16603}
16604#[cfg(feature = "deserialize")]
16605impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
16606    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16607        use std::str::FromStr;
16608        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16609        Self::from_str(&s).map_err(|_| {
16610            serde::de::Error::custom(
16611                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod",
16612            )
16613        })
16614    }
16615}
16616/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
16617///
16618/// 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.
16619/// 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.
16620///
16621/// 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.
16622///
16623/// 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).
16624///
16625/// 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`.
16626#[derive(Copy, Clone, Eq, PartialEq)]
16627pub enum UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
16628    None,
16629    OffSession,
16630    OnSession,
16631}
16632impl UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
16633    pub fn as_str(self) -> &'static str {
16634        use UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*;
16635        match self {
16636            None => "none",
16637            OffSession => "off_session",
16638            OnSession => "on_session",
16639        }
16640    }
16641}
16642
16643impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
16644    type Err = stripe_types::StripeParseError;
16645    fn from_str(s: &str) -> Result<Self, Self::Err> {
16646        use UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*;
16647        match s {
16648            "none" => Ok(None),
16649            "off_session" => Ok(OffSession),
16650            "on_session" => Ok(OnSession),
16651            _ => Err(stripe_types::StripeParseError),
16652        }
16653    }
16654}
16655impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
16656    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16657        f.write_str(self.as_str())
16658    }
16659}
16660
16661impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
16662    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16663        f.write_str(self.as_str())
16664    }
16665}
16666impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
16667    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16668    where
16669        S: serde::Serializer,
16670    {
16671        serializer.serialize_str(self.as_str())
16672    }
16673}
16674#[cfg(feature = "deserialize")]
16675impl<'de> serde::Deserialize<'de>
16676    for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage
16677{
16678    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16679        use std::str::FromStr;
16680        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16681        Self::from_str(&s).map_err(|_| {
16682            serde::de::Error::custom(
16683                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage",
16684            )
16685        })
16686    }
16687}
16688/// If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options.
16689#[derive(Copy, Clone, Debug, serde::Serialize)]
16690pub struct UpdatePaymentIntentPaymentMethodOptionsCrypto {
16691    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
16692    ///
16693    /// 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.
16694    /// 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.
16695    ///
16696    /// 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.
16697    ///
16698    /// 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).
16699    ///
16700    /// 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`.
16701    #[serde(skip_serializing_if = "Option::is_none")]
16702    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage>,
16703}
16704impl UpdatePaymentIntentPaymentMethodOptionsCrypto {
16705    pub fn new() -> Self {
16706        Self { setup_future_usage: None }
16707    }
16708}
16709impl Default for UpdatePaymentIntentPaymentMethodOptionsCrypto {
16710    fn default() -> Self {
16711        Self::new()
16712    }
16713}
16714/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
16715///
16716/// 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.
16717/// 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.
16718///
16719/// 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.
16720///
16721/// 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).
16722///
16723/// 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`.
16724#[derive(Copy, Clone, Eq, PartialEq)]
16725pub enum UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
16726    None,
16727}
16728impl UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
16729    pub fn as_str(self) -> &'static str {
16730        use UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage::*;
16731        match self {
16732            None => "none",
16733        }
16734    }
16735}
16736
16737impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
16738    type Err = stripe_types::StripeParseError;
16739    fn from_str(s: &str) -> Result<Self, Self::Err> {
16740        use UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage::*;
16741        match s {
16742            "none" => Ok(None),
16743            _ => Err(stripe_types::StripeParseError),
16744        }
16745    }
16746}
16747impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
16748    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16749        f.write_str(self.as_str())
16750    }
16751}
16752
16753impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
16754    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16755        f.write_str(self.as_str())
16756    }
16757}
16758impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
16759    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16760    where
16761        S: serde::Serializer,
16762    {
16763        serializer.serialize_str(self.as_str())
16764    }
16765}
16766#[cfg(feature = "deserialize")]
16767impl<'de> serde::Deserialize<'de>
16768    for UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage
16769{
16770    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16771        use std::str::FromStr;
16772        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16773        Self::from_str(&s).map_err(|_| {
16774            serde::de::Error::custom(
16775                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage",
16776            )
16777        })
16778    }
16779}
16780/// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options.
16781#[derive(Clone, Debug, serde::Serialize)]
16782pub struct UpdatePaymentIntentPaymentMethodOptionsCustomerBalance {
16783    /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
16784    #[serde(skip_serializing_if = "Option::is_none")]
16785    pub bank_transfer: Option<UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer>,
16786    /// The funding method type to be used when there are not enough funds in the customer balance.
16787    /// Permitted values include: `bank_transfer`.
16788    #[serde(skip_serializing_if = "Option::is_none")]
16789    pub funding_type: Option<UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType>,
16790    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
16791    ///
16792    /// 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.
16793    /// 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.
16794    ///
16795    /// 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.
16796    ///
16797    /// 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).
16798    ///
16799    /// 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`.
16800    #[serde(skip_serializing_if = "Option::is_none")]
16801    pub setup_future_usage:
16802        Option<UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage>,
16803}
16804impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalance {
16805    pub fn new() -> Self {
16806        Self { bank_transfer: None, funding_type: None, setup_future_usage: None }
16807    }
16808}
16809impl Default for UpdatePaymentIntentPaymentMethodOptionsCustomerBalance {
16810    fn default() -> Self {
16811        Self::new()
16812    }
16813}
16814/// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
16815#[derive(Clone, Debug, serde::Serialize)]
16816pub struct UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer {
16817    /// Configuration for the eu_bank_transfer funding type.
16818    #[serde(skip_serializing_if = "Option::is_none")]
16819    pub eu_bank_transfer: Option<EuBankTransferParams>,
16820    /// List of address types that should be returned in the financial_addresses response.
16821    /// If not specified, all valid types will be returned.
16822    ///
16823    /// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`.
16824    #[serde(skip_serializing_if = "Option::is_none")]
16825    pub requested_address_types: Option<
16826        Vec<
16827            UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes,
16828        >,
16829    >,
16830    /// The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`.
16831    #[serde(rename = "type")]
16832    pub type_: UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType,
16833}
16834impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer {
16835    pub fn new(
16836        type_: impl Into<UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType>,
16837    ) -> Self {
16838        Self { eu_bank_transfer: None, requested_address_types: None, type_: type_.into() }
16839    }
16840}
16841/// List of address types that should be returned in the financial_addresses response.
16842/// If not specified, all valid types will be returned.
16843///
16844/// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`.
16845#[derive(Copy, Clone, Eq, PartialEq)]
16846pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
16847    Aba,
16848    Iban,
16849    Sepa,
16850    SortCode,
16851    Spei,
16852    Swift,
16853    Zengin,
16854}
16855impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
16856    pub fn as_str(self) -> &'static str {
16857        use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*;
16858        match self {
16859            Aba => "aba",
16860            Iban => "iban",
16861            Sepa => "sepa",
16862            SortCode => "sort_code",
16863            Spei => "spei",
16864            Swift => "swift",
16865            Zengin => "zengin",
16866        }
16867    }
16868}
16869
16870impl std::str::FromStr
16871    for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
16872{
16873    type Err = stripe_types::StripeParseError;
16874    fn from_str(s: &str) -> Result<Self, Self::Err> {
16875        use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*;
16876        match s {
16877            "aba" => Ok(Aba),
16878            "iban" => Ok(Iban),
16879            "sepa" => Ok(Sepa),
16880            "sort_code" => Ok(SortCode),
16881            "spei" => Ok(Spei),
16882            "swift" => Ok(Swift),
16883            "zengin" => Ok(Zengin),
16884            _ => Err(stripe_types::StripeParseError),
16885        }
16886    }
16887}
16888impl std::fmt::Display
16889    for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
16890{
16891    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16892        f.write_str(self.as_str())
16893    }
16894}
16895
16896impl std::fmt::Debug
16897    for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
16898{
16899    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16900        f.write_str(self.as_str())
16901    }
16902}
16903impl serde::Serialize
16904    for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
16905{
16906    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16907    where
16908        S: serde::Serializer,
16909    {
16910        serializer.serialize_str(self.as_str())
16911    }
16912}
16913#[cfg(feature = "deserialize")]
16914impl<'de> serde::Deserialize<'de>
16915    for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
16916{
16917    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16918        use std::str::FromStr;
16919        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16920        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes"))
16921    }
16922}
16923/// The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`.
16924#[derive(Copy, Clone, Eq, PartialEq)]
16925pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
16926    EuBankTransfer,
16927    GbBankTransfer,
16928    JpBankTransfer,
16929    MxBankTransfer,
16930    UsBankTransfer,
16931}
16932impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
16933    pub fn as_str(self) -> &'static str {
16934        use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*;
16935        match self {
16936            EuBankTransfer => "eu_bank_transfer",
16937            GbBankTransfer => "gb_bank_transfer",
16938            JpBankTransfer => "jp_bank_transfer",
16939            MxBankTransfer => "mx_bank_transfer",
16940            UsBankTransfer => "us_bank_transfer",
16941        }
16942    }
16943}
16944
16945impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
16946    type Err = stripe_types::StripeParseError;
16947    fn from_str(s: &str) -> Result<Self, Self::Err> {
16948        use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*;
16949        match s {
16950            "eu_bank_transfer" => Ok(EuBankTransfer),
16951            "gb_bank_transfer" => Ok(GbBankTransfer),
16952            "jp_bank_transfer" => Ok(JpBankTransfer),
16953            "mx_bank_transfer" => Ok(MxBankTransfer),
16954            "us_bank_transfer" => Ok(UsBankTransfer),
16955            _ => Err(stripe_types::StripeParseError),
16956        }
16957    }
16958}
16959impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
16960    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16961        f.write_str(self.as_str())
16962    }
16963}
16964
16965impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
16966    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16967        f.write_str(self.as_str())
16968    }
16969}
16970impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
16971    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16972    where
16973        S: serde::Serializer,
16974    {
16975        serializer.serialize_str(self.as_str())
16976    }
16977}
16978#[cfg(feature = "deserialize")]
16979impl<'de> serde::Deserialize<'de>
16980    for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType
16981{
16982    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16983        use std::str::FromStr;
16984        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16985        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType"))
16986    }
16987}
16988/// The funding method type to be used when there are not enough funds in the customer balance.
16989/// Permitted values include: `bank_transfer`.
16990#[derive(Copy, Clone, Eq, PartialEq)]
16991pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
16992    BankTransfer,
16993}
16994impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
16995    pub fn as_str(self) -> &'static str {
16996        use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*;
16997        match self {
16998            BankTransfer => "bank_transfer",
16999        }
17000    }
17001}
17002
17003impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
17004    type Err = stripe_types::StripeParseError;
17005    fn from_str(s: &str) -> Result<Self, Self::Err> {
17006        use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*;
17007        match s {
17008            "bank_transfer" => Ok(BankTransfer),
17009            _ => Err(stripe_types::StripeParseError),
17010        }
17011    }
17012}
17013impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
17014    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17015        f.write_str(self.as_str())
17016    }
17017}
17018
17019impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
17020    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17021        f.write_str(self.as_str())
17022    }
17023}
17024impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
17025    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17026    where
17027        S: serde::Serializer,
17028    {
17029        serializer.serialize_str(self.as_str())
17030    }
17031}
17032#[cfg(feature = "deserialize")]
17033impl<'de> serde::Deserialize<'de>
17034    for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType
17035{
17036    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17037        use std::str::FromStr;
17038        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17039        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType"))
17040    }
17041}
17042/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17043///
17044/// 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.
17045/// 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.
17046///
17047/// 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.
17048///
17049/// 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).
17050///
17051/// 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`.
17052#[derive(Copy, Clone, Eq, PartialEq)]
17053pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
17054    None,
17055}
17056impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
17057    pub fn as_str(self) -> &'static str {
17058        use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*;
17059        match self {
17060            None => "none",
17061        }
17062    }
17063}
17064
17065impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
17066    type Err = stripe_types::StripeParseError;
17067    fn from_str(s: &str) -> Result<Self, Self::Err> {
17068        use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*;
17069        match s {
17070            "none" => Ok(None),
17071            _ => Err(stripe_types::StripeParseError),
17072        }
17073    }
17074}
17075impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
17076    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17077        f.write_str(self.as_str())
17078    }
17079}
17080
17081impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
17082    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17083        f.write_str(self.as_str())
17084    }
17085}
17086impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
17087    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17088    where
17089        S: serde::Serializer,
17090    {
17091        serializer.serialize_str(self.as_str())
17092    }
17093}
17094#[cfg(feature = "deserialize")]
17095impl<'de> serde::Deserialize<'de>
17096    for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage
17097{
17098    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17099        use std::str::FromStr;
17100        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17101        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage"))
17102    }
17103}
17104/// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
17105#[derive(Copy, Clone, Debug, serde::Serialize)]
17106pub struct UpdatePaymentIntentPaymentMethodOptionsEps {
17107    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17108    ///
17109    /// 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.
17110    /// 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.
17111    ///
17112    /// 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.
17113    ///
17114    /// 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).
17115    ///
17116    /// 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`.
17117    #[serde(skip_serializing_if = "Option::is_none")]
17118    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage>,
17119}
17120impl UpdatePaymentIntentPaymentMethodOptionsEps {
17121    pub fn new() -> Self {
17122        Self { setup_future_usage: None }
17123    }
17124}
17125impl Default for UpdatePaymentIntentPaymentMethodOptionsEps {
17126    fn default() -> Self {
17127        Self::new()
17128    }
17129}
17130/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17131///
17132/// 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.
17133/// 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.
17134///
17135/// 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.
17136///
17137/// 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).
17138///
17139/// 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`.
17140#[derive(Copy, Clone, Eq, PartialEq)]
17141pub enum UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
17142    None,
17143}
17144impl UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
17145    pub fn as_str(self) -> &'static str {
17146        use UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*;
17147        match self {
17148            None => "none",
17149        }
17150    }
17151}
17152
17153impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
17154    type Err = stripe_types::StripeParseError;
17155    fn from_str(s: &str) -> Result<Self, Self::Err> {
17156        use UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*;
17157        match s {
17158            "none" => Ok(None),
17159            _ => Err(stripe_types::StripeParseError),
17160        }
17161    }
17162}
17163impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
17164    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17165        f.write_str(self.as_str())
17166    }
17167}
17168
17169impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
17170    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17171        f.write_str(self.as_str())
17172    }
17173}
17174impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
17175    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17176    where
17177        S: serde::Serializer,
17178    {
17179        serializer.serialize_str(self.as_str())
17180    }
17181}
17182#[cfg(feature = "deserialize")]
17183impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
17184    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17185        use std::str::FromStr;
17186        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17187        Self::from_str(&s).map_err(|_| {
17188            serde::de::Error::custom(
17189                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage",
17190            )
17191        })
17192    }
17193}
17194/// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options.
17195#[derive(Copy, Clone, Debug, serde::Serialize)]
17196pub struct UpdatePaymentIntentPaymentMethodOptionsFpx {
17197    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17198    ///
17199    /// 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.
17200    /// 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.
17201    ///
17202    /// 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.
17203    ///
17204    /// 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).
17205    ///
17206    /// 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`.
17207    #[serde(skip_serializing_if = "Option::is_none")]
17208    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage>,
17209}
17210impl UpdatePaymentIntentPaymentMethodOptionsFpx {
17211    pub fn new() -> Self {
17212        Self { setup_future_usage: None }
17213    }
17214}
17215impl Default for UpdatePaymentIntentPaymentMethodOptionsFpx {
17216    fn default() -> Self {
17217        Self::new()
17218    }
17219}
17220/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17221///
17222/// 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.
17223/// 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.
17224///
17225/// 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.
17226///
17227/// 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).
17228///
17229/// 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`.
17230#[derive(Copy, Clone, Eq, PartialEq)]
17231pub enum UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
17232    None,
17233}
17234impl UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
17235    pub fn as_str(self) -> &'static str {
17236        use UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*;
17237        match self {
17238            None => "none",
17239        }
17240    }
17241}
17242
17243impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
17244    type Err = stripe_types::StripeParseError;
17245    fn from_str(s: &str) -> Result<Self, Self::Err> {
17246        use UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*;
17247        match s {
17248            "none" => Ok(None),
17249            _ => Err(stripe_types::StripeParseError),
17250        }
17251    }
17252}
17253impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
17254    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17255        f.write_str(self.as_str())
17256    }
17257}
17258
17259impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
17260    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17261        f.write_str(self.as_str())
17262    }
17263}
17264impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
17265    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17266    where
17267        S: serde::Serializer,
17268    {
17269        serializer.serialize_str(self.as_str())
17270    }
17271}
17272#[cfg(feature = "deserialize")]
17273impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
17274    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17275        use std::str::FromStr;
17276        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17277        Self::from_str(&s).map_err(|_| {
17278            serde::de::Error::custom(
17279                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage",
17280            )
17281        })
17282    }
17283}
17284/// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options.
17285#[derive(Copy, Clone, Debug, serde::Serialize)]
17286pub struct UpdatePaymentIntentPaymentMethodOptionsGiropay {
17287    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17288    ///
17289    /// 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.
17290    /// 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.
17291    ///
17292    /// 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.
17293    ///
17294    /// 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).
17295    ///
17296    /// 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`.
17297    #[serde(skip_serializing_if = "Option::is_none")]
17298    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage>,
17299}
17300impl UpdatePaymentIntentPaymentMethodOptionsGiropay {
17301    pub fn new() -> Self {
17302        Self { setup_future_usage: None }
17303    }
17304}
17305impl Default for UpdatePaymentIntentPaymentMethodOptionsGiropay {
17306    fn default() -> Self {
17307        Self::new()
17308    }
17309}
17310/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17311///
17312/// 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.
17313/// 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.
17314///
17315/// 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.
17316///
17317/// 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).
17318///
17319/// 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`.
17320#[derive(Copy, Clone, Eq, PartialEq)]
17321pub enum UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
17322    None,
17323}
17324impl UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
17325    pub fn as_str(self) -> &'static str {
17326        use UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*;
17327        match self {
17328            None => "none",
17329        }
17330    }
17331}
17332
17333impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
17334    type Err = stripe_types::StripeParseError;
17335    fn from_str(s: &str) -> Result<Self, Self::Err> {
17336        use UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*;
17337        match s {
17338            "none" => Ok(None),
17339            _ => Err(stripe_types::StripeParseError),
17340        }
17341    }
17342}
17343impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
17344    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17345        f.write_str(self.as_str())
17346    }
17347}
17348
17349impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
17350    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17351        f.write_str(self.as_str())
17352    }
17353}
17354impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
17355    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17356    where
17357        S: serde::Serializer,
17358    {
17359        serializer.serialize_str(self.as_str())
17360    }
17361}
17362#[cfg(feature = "deserialize")]
17363impl<'de> serde::Deserialize<'de>
17364    for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage
17365{
17366    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17367        use std::str::FromStr;
17368        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17369        Self::from_str(&s).map_err(|_| {
17370            serde::de::Error::custom(
17371                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage",
17372            )
17373        })
17374    }
17375}
17376/// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options.
17377#[derive(Copy, Clone, Debug, serde::Serialize)]
17378pub struct UpdatePaymentIntentPaymentMethodOptionsGrabpay {
17379    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17380    ///
17381    /// 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.
17382    /// 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.
17383    ///
17384    /// 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.
17385    ///
17386    /// 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).
17387    ///
17388    /// 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`.
17389    #[serde(skip_serializing_if = "Option::is_none")]
17390    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage>,
17391}
17392impl UpdatePaymentIntentPaymentMethodOptionsGrabpay {
17393    pub fn new() -> Self {
17394        Self { setup_future_usage: None }
17395    }
17396}
17397impl Default for UpdatePaymentIntentPaymentMethodOptionsGrabpay {
17398    fn default() -> Self {
17399        Self::new()
17400    }
17401}
17402/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17403///
17404/// 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.
17405/// 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.
17406///
17407/// 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.
17408///
17409/// 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).
17410///
17411/// 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`.
17412#[derive(Copy, Clone, Eq, PartialEq)]
17413pub enum UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
17414    None,
17415}
17416impl UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
17417    pub fn as_str(self) -> &'static str {
17418        use UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*;
17419        match self {
17420            None => "none",
17421        }
17422    }
17423}
17424
17425impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
17426    type Err = stripe_types::StripeParseError;
17427    fn from_str(s: &str) -> Result<Self, Self::Err> {
17428        use UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*;
17429        match s {
17430            "none" => Ok(None),
17431            _ => Err(stripe_types::StripeParseError),
17432        }
17433    }
17434}
17435impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
17436    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17437        f.write_str(self.as_str())
17438    }
17439}
17440
17441impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
17442    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17443        f.write_str(self.as_str())
17444    }
17445}
17446impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
17447    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17448    where
17449        S: serde::Serializer,
17450    {
17451        serializer.serialize_str(self.as_str())
17452    }
17453}
17454#[cfg(feature = "deserialize")]
17455impl<'de> serde::Deserialize<'de>
17456    for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage
17457{
17458    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17459        use std::str::FromStr;
17460        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17461        Self::from_str(&s).map_err(|_| {
17462            serde::de::Error::custom(
17463                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage",
17464            )
17465        })
17466    }
17467}
17468/// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options.
17469#[derive(Copy, Clone, Debug, serde::Serialize)]
17470pub struct UpdatePaymentIntentPaymentMethodOptionsIdeal {
17471    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17472    ///
17473    /// 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.
17474    /// 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.
17475    ///
17476    /// 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.
17477    ///
17478    /// 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).
17479    ///
17480    /// 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`.
17481    #[serde(skip_serializing_if = "Option::is_none")]
17482    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage>,
17483}
17484impl UpdatePaymentIntentPaymentMethodOptionsIdeal {
17485    pub fn new() -> Self {
17486        Self { setup_future_usage: None }
17487    }
17488}
17489impl Default for UpdatePaymentIntentPaymentMethodOptionsIdeal {
17490    fn default() -> Self {
17491        Self::new()
17492    }
17493}
17494/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17495///
17496/// 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.
17497/// 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.
17498///
17499/// 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.
17500///
17501/// 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).
17502///
17503/// 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`.
17504#[derive(Copy, Clone, Eq, PartialEq)]
17505pub enum UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
17506    None,
17507    OffSession,
17508}
17509impl UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
17510    pub fn as_str(self) -> &'static str {
17511        use UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*;
17512        match self {
17513            None => "none",
17514            OffSession => "off_session",
17515        }
17516    }
17517}
17518
17519impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
17520    type Err = stripe_types::StripeParseError;
17521    fn from_str(s: &str) -> Result<Self, Self::Err> {
17522        use UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*;
17523        match s {
17524            "none" => Ok(None),
17525            "off_session" => Ok(OffSession),
17526            _ => Err(stripe_types::StripeParseError),
17527        }
17528    }
17529}
17530impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
17531    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17532        f.write_str(self.as_str())
17533    }
17534}
17535
17536impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
17537    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17538        f.write_str(self.as_str())
17539    }
17540}
17541impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
17542    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17543    where
17544        S: serde::Serializer,
17545    {
17546        serializer.serialize_str(self.as_str())
17547    }
17548}
17549#[cfg(feature = "deserialize")]
17550impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
17551    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17552        use std::str::FromStr;
17553        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17554        Self::from_str(&s).map_err(|_| {
17555            serde::de::Error::custom(
17556                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage",
17557            )
17558        })
17559    }
17560}
17561/// If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options.
17562#[derive(Copy, Clone, Debug, serde::Serialize)]
17563pub struct UpdatePaymentIntentPaymentMethodOptionsKakaoPay {
17564    /// Controls when the funds are captured from the customer's account.
17565    ///
17566    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
17567    ///
17568    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
17569    #[serde(skip_serializing_if = "Option::is_none")]
17570    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod>,
17571    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17572    ///
17573    /// 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.
17574    /// 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.
17575    ///
17576    /// 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.
17577    ///
17578    /// 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).
17579    #[serde(skip_serializing_if = "Option::is_none")]
17580    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage>,
17581}
17582impl UpdatePaymentIntentPaymentMethodOptionsKakaoPay {
17583    pub fn new() -> Self {
17584        Self { capture_method: None, setup_future_usage: None }
17585    }
17586}
17587impl Default for UpdatePaymentIntentPaymentMethodOptionsKakaoPay {
17588    fn default() -> Self {
17589        Self::new()
17590    }
17591}
17592/// Controls when the funds are captured from the customer's account.
17593///
17594/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
17595///
17596/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
17597#[derive(Copy, Clone, Eq, PartialEq)]
17598pub enum UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
17599    Manual,
17600}
17601impl UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
17602    pub fn as_str(self) -> &'static str {
17603        use UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod::*;
17604        match self {
17605            Manual => "manual",
17606        }
17607    }
17608}
17609
17610impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
17611    type Err = stripe_types::StripeParseError;
17612    fn from_str(s: &str) -> Result<Self, Self::Err> {
17613        use UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod::*;
17614        match s {
17615            "manual" => Ok(Manual),
17616            _ => Err(stripe_types::StripeParseError),
17617        }
17618    }
17619}
17620impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
17621    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17622        f.write_str(self.as_str())
17623    }
17624}
17625
17626impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
17627    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17628        f.write_str(self.as_str())
17629    }
17630}
17631impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
17632    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17633    where
17634        S: serde::Serializer,
17635    {
17636        serializer.serialize_str(self.as_str())
17637    }
17638}
17639#[cfg(feature = "deserialize")]
17640impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
17641    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17642        use std::str::FromStr;
17643        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17644        Self::from_str(&s).map_err(|_| {
17645            serde::de::Error::custom(
17646                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod",
17647            )
17648        })
17649    }
17650}
17651/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17652///
17653/// 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.
17654/// 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.
17655///
17656/// 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.
17657///
17658/// 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).
17659#[derive(Copy, Clone, Eq, PartialEq)]
17660pub enum UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
17661    None,
17662    OffSession,
17663}
17664impl UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
17665    pub fn as_str(self) -> &'static str {
17666        use UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage::*;
17667        match self {
17668            None => "none",
17669            OffSession => "off_session",
17670        }
17671    }
17672}
17673
17674impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
17675    type Err = stripe_types::StripeParseError;
17676    fn from_str(s: &str) -> Result<Self, Self::Err> {
17677        use UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage::*;
17678        match s {
17679            "none" => Ok(None),
17680            "off_session" => Ok(OffSession),
17681            _ => Err(stripe_types::StripeParseError),
17682        }
17683    }
17684}
17685impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
17686    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17687        f.write_str(self.as_str())
17688    }
17689}
17690
17691impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
17692    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17693        f.write_str(self.as_str())
17694    }
17695}
17696impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
17697    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17698    where
17699        S: serde::Serializer,
17700    {
17701        serializer.serialize_str(self.as_str())
17702    }
17703}
17704#[cfg(feature = "deserialize")]
17705impl<'de> serde::Deserialize<'de>
17706    for UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage
17707{
17708    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17709        use std::str::FromStr;
17710        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17711        Self::from_str(&s).map_err(|_| {
17712            serde::de::Error::custom(
17713                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage",
17714            )
17715        })
17716    }
17717}
17718/// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options.
17719#[derive(Clone, Debug, serde::Serialize)]
17720pub struct UpdatePaymentIntentPaymentMethodOptionsKlarna {
17721    /// Controls when the funds are captured from the customer's account.
17722    ///
17723    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
17724    ///
17725    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
17726    #[serde(skip_serializing_if = "Option::is_none")]
17727    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod>,
17728    /// On-demand details if setting up or charging an on-demand payment.
17729    #[serde(skip_serializing_if = "Option::is_none")]
17730    pub on_demand: Option<UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemand>,
17731    /// Preferred language of the Klarna authorization page that the customer is redirected to
17732    #[serde(skip_serializing_if = "Option::is_none")]
17733    pub preferred_locale: Option<UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale>,
17734    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17735    ///
17736    /// 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.
17737    /// 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.
17738    ///
17739    /// 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.
17740    ///
17741    /// 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).
17742    ///
17743    /// 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`.
17744    #[serde(skip_serializing_if = "Option::is_none")]
17745    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage>,
17746    /// Subscription details if setting up or charging a subscription.
17747    #[serde(skip_serializing_if = "Option::is_none")]
17748    pub subscriptions: Option<Vec<UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptions>>,
17749}
17750impl UpdatePaymentIntentPaymentMethodOptionsKlarna {
17751    pub fn new() -> Self {
17752        Self {
17753            capture_method: None,
17754            on_demand: None,
17755            preferred_locale: None,
17756            setup_future_usage: None,
17757            subscriptions: None,
17758        }
17759    }
17760}
17761impl Default for UpdatePaymentIntentPaymentMethodOptionsKlarna {
17762    fn default() -> Self {
17763        Self::new()
17764    }
17765}
17766/// Controls when the funds are captured from the customer's account.
17767///
17768/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
17769///
17770/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
17771#[derive(Copy, Clone, Eq, PartialEq)]
17772pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
17773    Manual,
17774}
17775impl UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
17776    pub fn as_str(self) -> &'static str {
17777        use UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*;
17778        match self {
17779            Manual => "manual",
17780        }
17781    }
17782}
17783
17784impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
17785    type Err = stripe_types::StripeParseError;
17786    fn from_str(s: &str) -> Result<Self, Self::Err> {
17787        use UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*;
17788        match s {
17789            "manual" => Ok(Manual),
17790            _ => Err(stripe_types::StripeParseError),
17791        }
17792    }
17793}
17794impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
17795    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17796        f.write_str(self.as_str())
17797    }
17798}
17799
17800impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
17801    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17802        f.write_str(self.as_str())
17803    }
17804}
17805impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
17806    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17807    where
17808        S: serde::Serializer,
17809    {
17810        serializer.serialize_str(self.as_str())
17811    }
17812}
17813#[cfg(feature = "deserialize")]
17814impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
17815    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17816        use std::str::FromStr;
17817        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17818        Self::from_str(&s).map_err(|_| {
17819            serde::de::Error::custom(
17820                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod",
17821            )
17822        })
17823    }
17824}
17825/// On-demand details if setting up or charging an on-demand payment.
17826#[derive(Copy, Clone, Debug, serde::Serialize)]
17827pub struct UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemand {
17828    /// Your average amount value.
17829    /// You can use a value across your customer base, or segment based on customer type, country, etc.
17830    #[serde(skip_serializing_if = "Option::is_none")]
17831    pub average_amount: Option<i64>,
17832    /// The maximum value you may charge a customer per purchase.
17833    /// You can use a value across your customer base, or segment based on customer type, country, etc.
17834    #[serde(skip_serializing_if = "Option::is_none")]
17835    pub maximum_amount: Option<i64>,
17836    /// The lowest or minimum value you may charge a customer per purchase.
17837    /// You can use a value across your customer base, or segment based on customer type, country, etc.
17838    #[serde(skip_serializing_if = "Option::is_none")]
17839    pub minimum_amount: Option<i64>,
17840    /// Interval at which the customer is making purchases
17841    #[serde(skip_serializing_if = "Option::is_none")]
17842    pub purchase_interval:
17843        Option<UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
17844    /// The number of `purchase_interval` between charges
17845    #[serde(skip_serializing_if = "Option::is_none")]
17846    pub purchase_interval_count: Option<u64>,
17847}
17848impl UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemand {
17849    pub fn new() -> Self {
17850        Self {
17851            average_amount: None,
17852            maximum_amount: None,
17853            minimum_amount: None,
17854            purchase_interval: None,
17855            purchase_interval_count: None,
17856        }
17857    }
17858}
17859impl Default for UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemand {
17860    fn default() -> Self {
17861        Self::new()
17862    }
17863}
17864/// Interval at which the customer is making purchases
17865#[derive(Copy, Clone, Eq, PartialEq)]
17866pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
17867    Day,
17868    Month,
17869    Week,
17870    Year,
17871}
17872impl UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
17873    pub fn as_str(self) -> &'static str {
17874        use UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
17875        match self {
17876            Day => "day",
17877            Month => "month",
17878            Week => "week",
17879            Year => "year",
17880        }
17881    }
17882}
17883
17884impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
17885    type Err = stripe_types::StripeParseError;
17886    fn from_str(s: &str) -> Result<Self, Self::Err> {
17887        use UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
17888        match s {
17889            "day" => Ok(Day),
17890            "month" => Ok(Month),
17891            "week" => Ok(Week),
17892            "year" => Ok(Year),
17893            _ => Err(stripe_types::StripeParseError),
17894        }
17895    }
17896}
17897impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
17898    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17899        f.write_str(self.as_str())
17900    }
17901}
17902
17903impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
17904    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17905        f.write_str(self.as_str())
17906    }
17907}
17908impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
17909    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17910    where
17911        S: serde::Serializer,
17912    {
17913        serializer.serialize_str(self.as_str())
17914    }
17915}
17916#[cfg(feature = "deserialize")]
17917impl<'de> serde::Deserialize<'de>
17918    for UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
17919{
17920    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17921        use std::str::FromStr;
17922        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17923        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"))
17924    }
17925}
17926/// Preferred language of the Klarna authorization page that the customer is redirected to
17927#[derive(Clone, Eq, PartialEq)]
17928#[non_exhaustive]
17929pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
17930    CsMinusCz,
17931    DaMinusDk,
17932    DeMinusAt,
17933    DeMinusCh,
17934    DeMinusDe,
17935    ElMinusGr,
17936    EnMinusAt,
17937    EnMinusAu,
17938    EnMinusBe,
17939    EnMinusCa,
17940    EnMinusCh,
17941    EnMinusCz,
17942    EnMinusDe,
17943    EnMinusDk,
17944    EnMinusEs,
17945    EnMinusFi,
17946    EnMinusFr,
17947    EnMinusGb,
17948    EnMinusGr,
17949    EnMinusIe,
17950    EnMinusIt,
17951    EnMinusNl,
17952    EnMinusNo,
17953    EnMinusNz,
17954    EnMinusPl,
17955    EnMinusPt,
17956    EnMinusRo,
17957    EnMinusSe,
17958    EnMinusUs,
17959    EsMinusEs,
17960    EsMinusUs,
17961    FiMinusFi,
17962    FrMinusBe,
17963    FrMinusCa,
17964    FrMinusCh,
17965    FrMinusFr,
17966    ItMinusCh,
17967    ItMinusIt,
17968    NbMinusNo,
17969    NlMinusBe,
17970    NlMinusNl,
17971    PlMinusPl,
17972    PtMinusPt,
17973    RoMinusRo,
17974    SvMinusFi,
17975    SvMinusSe,
17976    /// An unrecognized value from Stripe. Should not be used as a request parameter.
17977    Unknown(String),
17978}
17979impl UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
17980    pub fn as_str(&self) -> &str {
17981        use UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
17982        match self {
17983            CsMinusCz => "cs-CZ",
17984            DaMinusDk => "da-DK",
17985            DeMinusAt => "de-AT",
17986            DeMinusCh => "de-CH",
17987            DeMinusDe => "de-DE",
17988            ElMinusGr => "el-GR",
17989            EnMinusAt => "en-AT",
17990            EnMinusAu => "en-AU",
17991            EnMinusBe => "en-BE",
17992            EnMinusCa => "en-CA",
17993            EnMinusCh => "en-CH",
17994            EnMinusCz => "en-CZ",
17995            EnMinusDe => "en-DE",
17996            EnMinusDk => "en-DK",
17997            EnMinusEs => "en-ES",
17998            EnMinusFi => "en-FI",
17999            EnMinusFr => "en-FR",
18000            EnMinusGb => "en-GB",
18001            EnMinusGr => "en-GR",
18002            EnMinusIe => "en-IE",
18003            EnMinusIt => "en-IT",
18004            EnMinusNl => "en-NL",
18005            EnMinusNo => "en-NO",
18006            EnMinusNz => "en-NZ",
18007            EnMinusPl => "en-PL",
18008            EnMinusPt => "en-PT",
18009            EnMinusRo => "en-RO",
18010            EnMinusSe => "en-SE",
18011            EnMinusUs => "en-US",
18012            EsMinusEs => "es-ES",
18013            EsMinusUs => "es-US",
18014            FiMinusFi => "fi-FI",
18015            FrMinusBe => "fr-BE",
18016            FrMinusCa => "fr-CA",
18017            FrMinusCh => "fr-CH",
18018            FrMinusFr => "fr-FR",
18019            ItMinusCh => "it-CH",
18020            ItMinusIt => "it-IT",
18021            NbMinusNo => "nb-NO",
18022            NlMinusBe => "nl-BE",
18023            NlMinusNl => "nl-NL",
18024            PlMinusPl => "pl-PL",
18025            PtMinusPt => "pt-PT",
18026            RoMinusRo => "ro-RO",
18027            SvMinusFi => "sv-FI",
18028            SvMinusSe => "sv-SE",
18029            Unknown(v) => v,
18030        }
18031    }
18032}
18033
18034impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
18035    type Err = std::convert::Infallible;
18036    fn from_str(s: &str) -> Result<Self, Self::Err> {
18037        use UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
18038        match s {
18039            "cs-CZ" => Ok(CsMinusCz),
18040            "da-DK" => Ok(DaMinusDk),
18041            "de-AT" => Ok(DeMinusAt),
18042            "de-CH" => Ok(DeMinusCh),
18043            "de-DE" => Ok(DeMinusDe),
18044            "el-GR" => Ok(ElMinusGr),
18045            "en-AT" => Ok(EnMinusAt),
18046            "en-AU" => Ok(EnMinusAu),
18047            "en-BE" => Ok(EnMinusBe),
18048            "en-CA" => Ok(EnMinusCa),
18049            "en-CH" => Ok(EnMinusCh),
18050            "en-CZ" => Ok(EnMinusCz),
18051            "en-DE" => Ok(EnMinusDe),
18052            "en-DK" => Ok(EnMinusDk),
18053            "en-ES" => Ok(EnMinusEs),
18054            "en-FI" => Ok(EnMinusFi),
18055            "en-FR" => Ok(EnMinusFr),
18056            "en-GB" => Ok(EnMinusGb),
18057            "en-GR" => Ok(EnMinusGr),
18058            "en-IE" => Ok(EnMinusIe),
18059            "en-IT" => Ok(EnMinusIt),
18060            "en-NL" => Ok(EnMinusNl),
18061            "en-NO" => Ok(EnMinusNo),
18062            "en-NZ" => Ok(EnMinusNz),
18063            "en-PL" => Ok(EnMinusPl),
18064            "en-PT" => Ok(EnMinusPt),
18065            "en-RO" => Ok(EnMinusRo),
18066            "en-SE" => Ok(EnMinusSe),
18067            "en-US" => Ok(EnMinusUs),
18068            "es-ES" => Ok(EsMinusEs),
18069            "es-US" => Ok(EsMinusUs),
18070            "fi-FI" => Ok(FiMinusFi),
18071            "fr-BE" => Ok(FrMinusBe),
18072            "fr-CA" => Ok(FrMinusCa),
18073            "fr-CH" => Ok(FrMinusCh),
18074            "fr-FR" => Ok(FrMinusFr),
18075            "it-CH" => Ok(ItMinusCh),
18076            "it-IT" => Ok(ItMinusIt),
18077            "nb-NO" => Ok(NbMinusNo),
18078            "nl-BE" => Ok(NlMinusBe),
18079            "nl-NL" => Ok(NlMinusNl),
18080            "pl-PL" => Ok(PlMinusPl),
18081            "pt-PT" => Ok(PtMinusPt),
18082            "ro-RO" => Ok(RoMinusRo),
18083            "sv-FI" => Ok(SvMinusFi),
18084            "sv-SE" => Ok(SvMinusSe),
18085            v => Ok(Unknown(v.to_owned())),
18086        }
18087    }
18088}
18089impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
18090    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18091        f.write_str(self.as_str())
18092    }
18093}
18094
18095impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
18096    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18097        f.write_str(self.as_str())
18098    }
18099}
18100impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
18101    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18102    where
18103        S: serde::Serializer,
18104    {
18105        serializer.serialize_str(self.as_str())
18106    }
18107}
18108#[cfg(feature = "deserialize")]
18109impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
18110    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18111        use std::str::FromStr;
18112        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18113        Ok(Self::from_str(&s).unwrap())
18114    }
18115}
18116/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18117///
18118/// 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.
18119/// 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.
18120///
18121/// 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.
18122///
18123/// 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).
18124///
18125/// 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`.
18126#[derive(Copy, Clone, Eq, PartialEq)]
18127pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
18128    None,
18129    OffSession,
18130    OnSession,
18131}
18132impl UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
18133    pub fn as_str(self) -> &'static str {
18134        use UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*;
18135        match self {
18136            None => "none",
18137            OffSession => "off_session",
18138            OnSession => "on_session",
18139        }
18140    }
18141}
18142
18143impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
18144    type Err = stripe_types::StripeParseError;
18145    fn from_str(s: &str) -> Result<Self, Self::Err> {
18146        use UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*;
18147        match s {
18148            "none" => Ok(None),
18149            "off_session" => Ok(OffSession),
18150            "on_session" => Ok(OnSession),
18151            _ => Err(stripe_types::StripeParseError),
18152        }
18153    }
18154}
18155impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
18156    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18157        f.write_str(self.as_str())
18158    }
18159}
18160
18161impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
18162    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18163        f.write_str(self.as_str())
18164    }
18165}
18166impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
18167    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18168    where
18169        S: serde::Serializer,
18170    {
18171        serializer.serialize_str(self.as_str())
18172    }
18173}
18174#[cfg(feature = "deserialize")]
18175impl<'de> serde::Deserialize<'de>
18176    for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage
18177{
18178    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18179        use std::str::FromStr;
18180        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18181        Self::from_str(&s).map_err(|_| {
18182            serde::de::Error::custom(
18183                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage",
18184            )
18185        })
18186    }
18187}
18188/// Subscription details if setting up or charging a subscription.
18189#[derive(Clone, Debug, serde::Serialize)]
18190pub struct UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptions {
18191    /// Unit of time between subscription charges.
18192    pub interval: UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
18193    /// The number of intervals (specified in the `interval` attribute) between subscription charges.
18194    /// For example, `interval=month` and `interval_count=3` charges every 3 months.
18195    #[serde(skip_serializing_if = "Option::is_none")]
18196    pub interval_count: Option<u64>,
18197    /// Name for subscription.
18198    #[serde(skip_serializing_if = "Option::is_none")]
18199    pub name: Option<String>,
18200    /// Describes the upcoming charge for this subscription.
18201    #[serde(skip_serializing_if = "Option::is_none")]
18202    pub next_billing: Option<SubscriptionNextBillingParam>,
18203    /// A non-customer-facing reference to correlate subscription charges in the Klarna app.
18204    /// Use a value that persists across subscription charges.
18205    pub reference: String,
18206}
18207impl UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptions {
18208    pub fn new(
18209        interval: impl Into<UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
18210        reference: impl Into<String>,
18211    ) -> Self {
18212        Self {
18213            interval: interval.into(),
18214            interval_count: None,
18215            name: None,
18216            next_billing: None,
18217            reference: reference.into(),
18218        }
18219    }
18220}
18221/// Unit of time between subscription charges.
18222#[derive(Copy, Clone, Eq, PartialEq)]
18223pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
18224    Day,
18225    Month,
18226    Week,
18227    Year,
18228}
18229impl UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
18230    pub fn as_str(self) -> &'static str {
18231        use UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
18232        match self {
18233            Day => "day",
18234            Month => "month",
18235            Week => "week",
18236            Year => "year",
18237        }
18238    }
18239}
18240
18241impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
18242    type Err = stripe_types::StripeParseError;
18243    fn from_str(s: &str) -> Result<Self, Self::Err> {
18244        use UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
18245        match s {
18246            "day" => Ok(Day),
18247            "month" => Ok(Month),
18248            "week" => Ok(Week),
18249            "year" => Ok(Year),
18250            _ => Err(stripe_types::StripeParseError),
18251        }
18252    }
18253}
18254impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
18255    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18256        f.write_str(self.as_str())
18257    }
18258}
18259
18260impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
18261    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18262        f.write_str(self.as_str())
18263    }
18264}
18265impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
18266    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18267    where
18268        S: serde::Serializer,
18269    {
18270        serializer.serialize_str(self.as_str())
18271    }
18272}
18273#[cfg(feature = "deserialize")]
18274impl<'de> serde::Deserialize<'de>
18275    for UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
18276{
18277    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18278        use std::str::FromStr;
18279        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18280        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"))
18281    }
18282}
18283/// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options.
18284#[derive(Clone, Debug, serde::Serialize)]
18285pub struct UpdatePaymentIntentPaymentMethodOptionsKonbini {
18286    /// An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores.
18287    /// Must not consist of only zeroes and could be rejected in case of insufficient uniqueness.
18288    /// We recommend to use the customer's phone number.
18289    #[serde(skip_serializing_if = "Option::is_none")]
18290    pub confirmation_number: Option<String>,
18291    /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire.
18292    /// 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.
18293    /// Defaults to 3 days.
18294    #[serde(skip_serializing_if = "Option::is_none")]
18295    pub expires_after_days: Option<u32>,
18296    /// The timestamp at which the Konbini payment instructions will expire.
18297    /// Only one of `expires_after_days` or `expires_at` may be set.
18298    #[serde(skip_serializing_if = "Option::is_none")]
18299    pub expires_at: Option<stripe_types::Timestamp>,
18300    /// A product descriptor of up to 22 characters, which will appear to customers at the convenience store.
18301    #[serde(skip_serializing_if = "Option::is_none")]
18302    pub product_description: Option<String>,
18303    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18304    ///
18305    /// 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.
18306    /// 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.
18307    ///
18308    /// 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.
18309    ///
18310    /// 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).
18311    ///
18312    /// 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`.
18313    #[serde(skip_serializing_if = "Option::is_none")]
18314    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage>,
18315}
18316impl UpdatePaymentIntentPaymentMethodOptionsKonbini {
18317    pub fn new() -> Self {
18318        Self {
18319            confirmation_number: None,
18320            expires_after_days: None,
18321            expires_at: None,
18322            product_description: None,
18323            setup_future_usage: None,
18324        }
18325    }
18326}
18327impl Default for UpdatePaymentIntentPaymentMethodOptionsKonbini {
18328    fn default() -> Self {
18329        Self::new()
18330    }
18331}
18332/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18333///
18334/// 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.
18335/// 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.
18336///
18337/// 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.
18338///
18339/// 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).
18340///
18341/// 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`.
18342#[derive(Copy, Clone, Eq, PartialEq)]
18343pub enum UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
18344    None,
18345}
18346impl UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
18347    pub fn as_str(self) -> &'static str {
18348        use UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*;
18349        match self {
18350            None => "none",
18351        }
18352    }
18353}
18354
18355impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
18356    type Err = stripe_types::StripeParseError;
18357    fn from_str(s: &str) -> Result<Self, Self::Err> {
18358        use UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*;
18359        match s {
18360            "none" => Ok(None),
18361            _ => Err(stripe_types::StripeParseError),
18362        }
18363    }
18364}
18365impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
18366    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18367        f.write_str(self.as_str())
18368    }
18369}
18370
18371impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
18372    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18373        f.write_str(self.as_str())
18374    }
18375}
18376impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
18377    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18378    where
18379        S: serde::Serializer,
18380    {
18381        serializer.serialize_str(self.as_str())
18382    }
18383}
18384#[cfg(feature = "deserialize")]
18385impl<'de> serde::Deserialize<'de>
18386    for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage
18387{
18388    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18389        use std::str::FromStr;
18390        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18391        Self::from_str(&s).map_err(|_| {
18392            serde::de::Error::custom(
18393                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage",
18394            )
18395        })
18396    }
18397}
18398/// If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options.
18399#[derive(Copy, Clone, Debug, serde::Serialize)]
18400pub struct UpdatePaymentIntentPaymentMethodOptionsKrCard {
18401    /// Controls when the funds are captured from the customer's account.
18402    ///
18403    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
18404    ///
18405    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
18406    #[serde(skip_serializing_if = "Option::is_none")]
18407    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod>,
18408    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18409    ///
18410    /// 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.
18411    /// 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.
18412    ///
18413    /// 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.
18414    ///
18415    /// 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).
18416    #[serde(skip_serializing_if = "Option::is_none")]
18417    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage>,
18418}
18419impl UpdatePaymentIntentPaymentMethodOptionsKrCard {
18420    pub fn new() -> Self {
18421        Self { capture_method: None, setup_future_usage: None }
18422    }
18423}
18424impl Default for UpdatePaymentIntentPaymentMethodOptionsKrCard {
18425    fn default() -> Self {
18426        Self::new()
18427    }
18428}
18429/// Controls when the funds are captured from the customer's account.
18430///
18431/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
18432///
18433/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
18434#[derive(Copy, Clone, Eq, PartialEq)]
18435pub enum UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
18436    Manual,
18437}
18438impl UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
18439    pub fn as_str(self) -> &'static str {
18440        use UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod::*;
18441        match self {
18442            Manual => "manual",
18443        }
18444    }
18445}
18446
18447impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
18448    type Err = stripe_types::StripeParseError;
18449    fn from_str(s: &str) -> Result<Self, Self::Err> {
18450        use UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod::*;
18451        match s {
18452            "manual" => Ok(Manual),
18453            _ => Err(stripe_types::StripeParseError),
18454        }
18455    }
18456}
18457impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
18458    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18459        f.write_str(self.as_str())
18460    }
18461}
18462
18463impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
18464    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18465        f.write_str(self.as_str())
18466    }
18467}
18468impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
18469    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18470    where
18471        S: serde::Serializer,
18472    {
18473        serializer.serialize_str(self.as_str())
18474    }
18475}
18476#[cfg(feature = "deserialize")]
18477impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
18478    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18479        use std::str::FromStr;
18480        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18481        Self::from_str(&s).map_err(|_| {
18482            serde::de::Error::custom(
18483                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod",
18484            )
18485        })
18486    }
18487}
18488/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18489///
18490/// 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.
18491/// 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.
18492///
18493/// 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.
18494///
18495/// 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).
18496#[derive(Copy, Clone, Eq, PartialEq)]
18497pub enum UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
18498    None,
18499    OffSession,
18500}
18501impl UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
18502    pub fn as_str(self) -> &'static str {
18503        use UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage::*;
18504        match self {
18505            None => "none",
18506            OffSession => "off_session",
18507        }
18508    }
18509}
18510
18511impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
18512    type Err = stripe_types::StripeParseError;
18513    fn from_str(s: &str) -> Result<Self, Self::Err> {
18514        use UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage::*;
18515        match s {
18516            "none" => Ok(None),
18517            "off_session" => Ok(OffSession),
18518            _ => Err(stripe_types::StripeParseError),
18519        }
18520    }
18521}
18522impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
18523    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18524        f.write_str(self.as_str())
18525    }
18526}
18527
18528impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
18529    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18530        f.write_str(self.as_str())
18531    }
18532}
18533impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
18534    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18535    where
18536        S: serde::Serializer,
18537    {
18538        serializer.serialize_str(self.as_str())
18539    }
18540}
18541#[cfg(feature = "deserialize")]
18542impl<'de> serde::Deserialize<'de>
18543    for UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage
18544{
18545    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18546        use std::str::FromStr;
18547        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18548        Self::from_str(&s).map_err(|_| {
18549            serde::de::Error::custom(
18550                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage",
18551            )
18552        })
18553    }
18554}
18555/// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
18556#[derive(Clone, Debug, serde::Serialize)]
18557pub struct UpdatePaymentIntentPaymentMethodOptionsLink {
18558    /// Controls when the funds are captured from the customer's account.
18559    ///
18560    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
18561    ///
18562    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
18563    #[serde(skip_serializing_if = "Option::is_none")]
18564    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod>,
18565    /// \[Deprecated\] This is a legacy parameter that no longer has any function.
18566    #[serde(skip_serializing_if = "Option::is_none")]
18567    pub persistent_token: Option<String>,
18568    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18569    ///
18570    /// 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.
18571    /// 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.
18572    ///
18573    /// 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.
18574    ///
18575    /// 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).
18576    ///
18577    /// 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`.
18578    #[serde(skip_serializing_if = "Option::is_none")]
18579    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage>,
18580}
18581impl UpdatePaymentIntentPaymentMethodOptionsLink {
18582    pub fn new() -> Self {
18583        Self { capture_method: None, persistent_token: None, setup_future_usage: None }
18584    }
18585}
18586impl Default for UpdatePaymentIntentPaymentMethodOptionsLink {
18587    fn default() -> Self {
18588        Self::new()
18589    }
18590}
18591/// Controls when the funds are captured from the customer's account.
18592///
18593/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
18594///
18595/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
18596#[derive(Copy, Clone, Eq, PartialEq)]
18597pub enum UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
18598    Manual,
18599}
18600impl UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
18601    pub fn as_str(self) -> &'static str {
18602        use UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod::*;
18603        match self {
18604            Manual => "manual",
18605        }
18606    }
18607}
18608
18609impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
18610    type Err = stripe_types::StripeParseError;
18611    fn from_str(s: &str) -> Result<Self, Self::Err> {
18612        use UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod::*;
18613        match s {
18614            "manual" => Ok(Manual),
18615            _ => Err(stripe_types::StripeParseError),
18616        }
18617    }
18618}
18619impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
18620    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18621        f.write_str(self.as_str())
18622    }
18623}
18624
18625impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
18626    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18627        f.write_str(self.as_str())
18628    }
18629}
18630impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
18631    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18632    where
18633        S: serde::Serializer,
18634    {
18635        serializer.serialize_str(self.as_str())
18636    }
18637}
18638#[cfg(feature = "deserialize")]
18639impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
18640    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18641        use std::str::FromStr;
18642        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18643        Self::from_str(&s).map_err(|_| {
18644            serde::de::Error::custom(
18645                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod",
18646            )
18647        })
18648    }
18649}
18650/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18651///
18652/// 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.
18653/// 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.
18654///
18655/// 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.
18656///
18657/// 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).
18658///
18659/// 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`.
18660#[derive(Copy, Clone, Eq, PartialEq)]
18661pub enum UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
18662    None,
18663    OffSession,
18664}
18665impl UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
18666    pub fn as_str(self) -> &'static str {
18667        use UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*;
18668        match self {
18669            None => "none",
18670            OffSession => "off_session",
18671        }
18672    }
18673}
18674
18675impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
18676    type Err = stripe_types::StripeParseError;
18677    fn from_str(s: &str) -> Result<Self, Self::Err> {
18678        use UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*;
18679        match s {
18680            "none" => Ok(None),
18681            "off_session" => Ok(OffSession),
18682            _ => Err(stripe_types::StripeParseError),
18683        }
18684    }
18685}
18686impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
18687    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18688        f.write_str(self.as_str())
18689    }
18690}
18691
18692impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
18693    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18694        f.write_str(self.as_str())
18695    }
18696}
18697impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
18698    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18699    where
18700        S: serde::Serializer,
18701    {
18702        serializer.serialize_str(self.as_str())
18703    }
18704}
18705#[cfg(feature = "deserialize")]
18706impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
18707    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18708        use std::str::FromStr;
18709        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18710        Self::from_str(&s).map_err(|_| {
18711            serde::de::Error::custom(
18712                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage",
18713            )
18714        })
18715    }
18716}
18717/// If this is a `mb_way` PaymentMethod, this sub-hash contains details about the MB WAY payment method options.
18718#[derive(Copy, Clone, Debug, serde::Serialize)]
18719pub struct UpdatePaymentIntentPaymentMethodOptionsMbWay {
18720    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18721    ///
18722    /// 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.
18723    /// 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.
18724    ///
18725    /// 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.
18726    ///
18727    /// 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).
18728    ///
18729    /// 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`.
18730    #[serde(skip_serializing_if = "Option::is_none")]
18731    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage>,
18732}
18733impl UpdatePaymentIntentPaymentMethodOptionsMbWay {
18734    pub fn new() -> Self {
18735        Self { setup_future_usage: None }
18736    }
18737}
18738impl Default for UpdatePaymentIntentPaymentMethodOptionsMbWay {
18739    fn default() -> Self {
18740        Self::new()
18741    }
18742}
18743/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18744///
18745/// 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.
18746/// 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.
18747///
18748/// 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.
18749///
18750/// 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).
18751///
18752/// 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`.
18753#[derive(Copy, Clone, Eq, PartialEq)]
18754pub enum UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
18755    None,
18756}
18757impl UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
18758    pub fn as_str(self) -> &'static str {
18759        use UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage::*;
18760        match self {
18761            None => "none",
18762        }
18763    }
18764}
18765
18766impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
18767    type Err = stripe_types::StripeParseError;
18768    fn from_str(s: &str) -> Result<Self, Self::Err> {
18769        use UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage::*;
18770        match s {
18771            "none" => Ok(None),
18772            _ => Err(stripe_types::StripeParseError),
18773        }
18774    }
18775}
18776impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
18777    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18778        f.write_str(self.as_str())
18779    }
18780}
18781
18782impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
18783    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18784        f.write_str(self.as_str())
18785    }
18786}
18787impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
18788    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18789    where
18790        S: serde::Serializer,
18791    {
18792        serializer.serialize_str(self.as_str())
18793    }
18794}
18795#[cfg(feature = "deserialize")]
18796impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
18797    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18798        use std::str::FromStr;
18799        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18800        Self::from_str(&s).map_err(|_| {
18801            serde::de::Error::custom(
18802                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage",
18803            )
18804        })
18805    }
18806}
18807/// If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options.
18808#[derive(Copy, Clone, Debug, serde::Serialize)]
18809pub struct UpdatePaymentIntentPaymentMethodOptionsMobilepay {
18810    /// Controls when the funds are captured from the customer's account.
18811    ///
18812    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
18813    ///
18814    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
18815    #[serde(skip_serializing_if = "Option::is_none")]
18816    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod>,
18817    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18818    ///
18819    /// 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.
18820    /// 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.
18821    ///
18822    /// 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.
18823    ///
18824    /// 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).
18825    ///
18826    /// 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`.
18827    #[serde(skip_serializing_if = "Option::is_none")]
18828    pub setup_future_usage:
18829        Option<UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage>,
18830}
18831impl UpdatePaymentIntentPaymentMethodOptionsMobilepay {
18832    pub fn new() -> Self {
18833        Self { capture_method: None, setup_future_usage: None }
18834    }
18835}
18836impl Default for UpdatePaymentIntentPaymentMethodOptionsMobilepay {
18837    fn default() -> Self {
18838        Self::new()
18839    }
18840}
18841/// Controls when the funds are captured from the customer's account.
18842///
18843/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
18844///
18845/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
18846#[derive(Copy, Clone, Eq, PartialEq)]
18847pub enum UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
18848    Manual,
18849}
18850impl UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
18851    pub fn as_str(self) -> &'static str {
18852        use UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod::*;
18853        match self {
18854            Manual => "manual",
18855        }
18856    }
18857}
18858
18859impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
18860    type Err = stripe_types::StripeParseError;
18861    fn from_str(s: &str) -> Result<Self, Self::Err> {
18862        use UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod::*;
18863        match s {
18864            "manual" => Ok(Manual),
18865            _ => Err(stripe_types::StripeParseError),
18866        }
18867    }
18868}
18869impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
18870    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18871        f.write_str(self.as_str())
18872    }
18873}
18874
18875impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
18876    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18877        f.write_str(self.as_str())
18878    }
18879}
18880impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
18881    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18882    where
18883        S: serde::Serializer,
18884    {
18885        serializer.serialize_str(self.as_str())
18886    }
18887}
18888#[cfg(feature = "deserialize")]
18889impl<'de> serde::Deserialize<'de>
18890    for UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod
18891{
18892    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18893        use std::str::FromStr;
18894        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18895        Self::from_str(&s).map_err(|_| {
18896            serde::de::Error::custom(
18897                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod",
18898            )
18899        })
18900    }
18901}
18902/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18903///
18904/// 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.
18905/// 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.
18906///
18907/// 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.
18908///
18909/// 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).
18910///
18911/// 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`.
18912#[derive(Copy, Clone, Eq, PartialEq)]
18913pub enum UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
18914    None,
18915}
18916impl UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
18917    pub fn as_str(self) -> &'static str {
18918        use UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage::*;
18919        match self {
18920            None => "none",
18921        }
18922    }
18923}
18924
18925impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
18926    type Err = stripe_types::StripeParseError;
18927    fn from_str(s: &str) -> Result<Self, Self::Err> {
18928        use UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage::*;
18929        match s {
18930            "none" => Ok(None),
18931            _ => Err(stripe_types::StripeParseError),
18932        }
18933    }
18934}
18935impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
18936    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18937        f.write_str(self.as_str())
18938    }
18939}
18940
18941impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
18942    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18943        f.write_str(self.as_str())
18944    }
18945}
18946impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
18947    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18948    where
18949        S: serde::Serializer,
18950    {
18951        serializer.serialize_str(self.as_str())
18952    }
18953}
18954#[cfg(feature = "deserialize")]
18955impl<'de> serde::Deserialize<'de>
18956    for UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage
18957{
18958    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18959        use std::str::FromStr;
18960        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18961        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage"))
18962    }
18963}
18964/// If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options.
18965#[derive(Copy, Clone, Debug, serde::Serialize)]
18966pub struct UpdatePaymentIntentPaymentMethodOptionsMultibanco {
18967    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18968    ///
18969    /// 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.
18970    /// 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.
18971    ///
18972    /// 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.
18973    ///
18974    /// 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).
18975    ///
18976    /// 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`.
18977    #[serde(skip_serializing_if = "Option::is_none")]
18978    pub setup_future_usage:
18979        Option<UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage>,
18980}
18981impl UpdatePaymentIntentPaymentMethodOptionsMultibanco {
18982    pub fn new() -> Self {
18983        Self { setup_future_usage: None }
18984    }
18985}
18986impl Default for UpdatePaymentIntentPaymentMethodOptionsMultibanco {
18987    fn default() -> Self {
18988        Self::new()
18989    }
18990}
18991/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18992///
18993/// 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.
18994/// 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.
18995///
18996/// 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.
18997///
18998/// 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).
18999///
19000/// 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`.
19001#[derive(Copy, Clone, Eq, PartialEq)]
19002pub enum UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
19003    None,
19004}
19005impl UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
19006    pub fn as_str(self) -> &'static str {
19007        use UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage::*;
19008        match self {
19009            None => "none",
19010        }
19011    }
19012}
19013
19014impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
19015    type Err = stripe_types::StripeParseError;
19016    fn from_str(s: &str) -> Result<Self, Self::Err> {
19017        use UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage::*;
19018        match s {
19019            "none" => Ok(None),
19020            _ => Err(stripe_types::StripeParseError),
19021        }
19022    }
19023}
19024impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
19025    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19026        f.write_str(self.as_str())
19027    }
19028}
19029
19030impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
19031    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19032        f.write_str(self.as_str())
19033    }
19034}
19035impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
19036    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19037    where
19038        S: serde::Serializer,
19039    {
19040        serializer.serialize_str(self.as_str())
19041    }
19042}
19043#[cfg(feature = "deserialize")]
19044impl<'de> serde::Deserialize<'de>
19045    for UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage
19046{
19047    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19048        use std::str::FromStr;
19049        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19050        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage"))
19051    }
19052}
19053/// If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options.
19054#[derive(Copy, Clone, Debug, serde::Serialize)]
19055pub struct UpdatePaymentIntentPaymentMethodOptionsNaverPay {
19056    /// Controls when the funds are captured from the customer's account.
19057    ///
19058    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
19059    ///
19060    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
19061    #[serde(skip_serializing_if = "Option::is_none")]
19062    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod>,
19063    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19064    ///
19065    /// 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.
19066    /// 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.
19067    ///
19068    /// 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.
19069    ///
19070    /// 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).
19071    #[serde(skip_serializing_if = "Option::is_none")]
19072    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage>,
19073}
19074impl UpdatePaymentIntentPaymentMethodOptionsNaverPay {
19075    pub fn new() -> Self {
19076        Self { capture_method: None, setup_future_usage: None }
19077    }
19078}
19079impl Default for UpdatePaymentIntentPaymentMethodOptionsNaverPay {
19080    fn default() -> Self {
19081        Self::new()
19082    }
19083}
19084/// Controls when the funds are captured from the customer's account.
19085///
19086/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
19087///
19088/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
19089#[derive(Copy, Clone, Eq, PartialEq)]
19090pub enum UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
19091    Manual,
19092}
19093impl UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
19094    pub fn as_str(self) -> &'static str {
19095        use UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod::*;
19096        match self {
19097            Manual => "manual",
19098        }
19099    }
19100}
19101
19102impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
19103    type Err = stripe_types::StripeParseError;
19104    fn from_str(s: &str) -> Result<Self, Self::Err> {
19105        use UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod::*;
19106        match s {
19107            "manual" => Ok(Manual),
19108            _ => Err(stripe_types::StripeParseError),
19109        }
19110    }
19111}
19112impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
19113    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19114        f.write_str(self.as_str())
19115    }
19116}
19117
19118impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
19119    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19120        f.write_str(self.as_str())
19121    }
19122}
19123impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
19124    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19125    where
19126        S: serde::Serializer,
19127    {
19128        serializer.serialize_str(self.as_str())
19129    }
19130}
19131#[cfg(feature = "deserialize")]
19132impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
19133    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19134        use std::str::FromStr;
19135        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19136        Self::from_str(&s).map_err(|_| {
19137            serde::de::Error::custom(
19138                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod",
19139            )
19140        })
19141    }
19142}
19143/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19144///
19145/// 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.
19146/// 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.
19147///
19148/// 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.
19149///
19150/// 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).
19151#[derive(Copy, Clone, Eq, PartialEq)]
19152pub enum UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
19153    None,
19154    OffSession,
19155}
19156impl UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
19157    pub fn as_str(self) -> &'static str {
19158        use UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage::*;
19159        match self {
19160            None => "none",
19161            OffSession => "off_session",
19162        }
19163    }
19164}
19165
19166impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
19167    type Err = stripe_types::StripeParseError;
19168    fn from_str(s: &str) -> Result<Self, Self::Err> {
19169        use UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage::*;
19170        match s {
19171            "none" => Ok(None),
19172            "off_session" => Ok(OffSession),
19173            _ => Err(stripe_types::StripeParseError),
19174        }
19175    }
19176}
19177impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
19178    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19179        f.write_str(self.as_str())
19180    }
19181}
19182
19183impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
19184    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19185        f.write_str(self.as_str())
19186    }
19187}
19188impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
19189    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19190    where
19191        S: serde::Serializer,
19192    {
19193        serializer.serialize_str(self.as_str())
19194    }
19195}
19196#[cfg(feature = "deserialize")]
19197impl<'de> serde::Deserialize<'de>
19198    for UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage
19199{
19200    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19201        use std::str::FromStr;
19202        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19203        Self::from_str(&s).map_err(|_| {
19204            serde::de::Error::custom(
19205                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage",
19206            )
19207        })
19208    }
19209}
19210/// If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options.
19211#[derive(Clone, Debug, serde::Serialize)]
19212pub struct UpdatePaymentIntentPaymentMethodOptionsNzBankAccount {
19213    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19214    ///
19215    /// 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.
19216    /// 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.
19217    ///
19218    /// 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.
19219    ///
19220    /// 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).
19221    ///
19222    /// 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`.
19223    #[serde(skip_serializing_if = "Option::is_none")]
19224    pub setup_future_usage:
19225        Option<UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage>,
19226    /// Controls when Stripe will attempt to debit the funds from the customer's account.
19227    /// The date must be a string in YYYY-MM-DD format.
19228    /// The date must be in the future and between 3 and 15 calendar days from now.
19229    #[serde(skip_serializing_if = "Option::is_none")]
19230    pub target_date: Option<String>,
19231}
19232impl UpdatePaymentIntentPaymentMethodOptionsNzBankAccount {
19233    pub fn new() -> Self {
19234        Self { setup_future_usage: None, target_date: None }
19235    }
19236}
19237impl Default for UpdatePaymentIntentPaymentMethodOptionsNzBankAccount {
19238    fn default() -> Self {
19239        Self::new()
19240    }
19241}
19242/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19243///
19244/// 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.
19245/// 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.
19246///
19247/// 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.
19248///
19249/// 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).
19250///
19251/// 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`.
19252#[derive(Copy, Clone, Eq, PartialEq)]
19253pub enum UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
19254    None,
19255    OffSession,
19256    OnSession,
19257}
19258impl UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
19259    pub fn as_str(self) -> &'static str {
19260        use UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage::*;
19261        match self {
19262            None => "none",
19263            OffSession => "off_session",
19264            OnSession => "on_session",
19265        }
19266    }
19267}
19268
19269impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
19270    type Err = stripe_types::StripeParseError;
19271    fn from_str(s: &str) -> Result<Self, Self::Err> {
19272        use UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage::*;
19273        match s {
19274            "none" => Ok(None),
19275            "off_session" => Ok(OffSession),
19276            "on_session" => Ok(OnSession),
19277            _ => Err(stripe_types::StripeParseError),
19278        }
19279    }
19280}
19281impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
19282    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19283        f.write_str(self.as_str())
19284    }
19285}
19286
19287impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
19288    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19289        f.write_str(self.as_str())
19290    }
19291}
19292impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
19293    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19294    where
19295        S: serde::Serializer,
19296    {
19297        serializer.serialize_str(self.as_str())
19298    }
19299}
19300#[cfg(feature = "deserialize")]
19301impl<'de> serde::Deserialize<'de>
19302    for UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage
19303{
19304    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19305        use std::str::FromStr;
19306        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19307        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage"))
19308    }
19309}
19310/// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options.
19311#[derive(Copy, Clone, Debug, serde::Serialize)]
19312pub struct UpdatePaymentIntentPaymentMethodOptionsOxxo {
19313    /// The number of calendar days before an OXXO voucher expires.
19314    /// 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.
19315    #[serde(skip_serializing_if = "Option::is_none")]
19316    pub expires_after_days: Option<u32>,
19317    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19318    ///
19319    /// 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.
19320    /// 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.
19321    ///
19322    /// 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.
19323    ///
19324    /// 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).
19325    ///
19326    /// 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`.
19327    #[serde(skip_serializing_if = "Option::is_none")]
19328    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage>,
19329}
19330impl UpdatePaymentIntentPaymentMethodOptionsOxxo {
19331    pub fn new() -> Self {
19332        Self { expires_after_days: None, setup_future_usage: None }
19333    }
19334}
19335impl Default for UpdatePaymentIntentPaymentMethodOptionsOxxo {
19336    fn default() -> Self {
19337        Self::new()
19338    }
19339}
19340/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19341///
19342/// 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.
19343/// 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.
19344///
19345/// 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.
19346///
19347/// 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).
19348///
19349/// 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`.
19350#[derive(Copy, Clone, Eq, PartialEq)]
19351pub enum UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
19352    None,
19353}
19354impl UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
19355    pub fn as_str(self) -> &'static str {
19356        use UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*;
19357        match self {
19358            None => "none",
19359        }
19360    }
19361}
19362
19363impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
19364    type Err = stripe_types::StripeParseError;
19365    fn from_str(s: &str) -> Result<Self, Self::Err> {
19366        use UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*;
19367        match s {
19368            "none" => Ok(None),
19369            _ => Err(stripe_types::StripeParseError),
19370        }
19371    }
19372}
19373impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
19374    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19375        f.write_str(self.as_str())
19376    }
19377}
19378
19379impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
19380    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19381        f.write_str(self.as_str())
19382    }
19383}
19384impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
19385    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19386    where
19387        S: serde::Serializer,
19388    {
19389        serializer.serialize_str(self.as_str())
19390    }
19391}
19392#[cfg(feature = "deserialize")]
19393impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
19394    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19395        use std::str::FromStr;
19396        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19397        Self::from_str(&s).map_err(|_| {
19398            serde::de::Error::custom(
19399                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage",
19400            )
19401        })
19402    }
19403}
19404/// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options.
19405#[derive(Copy, Clone, Debug, serde::Serialize)]
19406pub struct UpdatePaymentIntentPaymentMethodOptionsP24 {
19407    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19408    ///
19409    /// 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.
19410    /// 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.
19411    ///
19412    /// 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.
19413    ///
19414    /// 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).
19415    ///
19416    /// 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`.
19417    #[serde(skip_serializing_if = "Option::is_none")]
19418    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage>,
19419    /// Confirm that the payer has accepted the P24 terms and conditions.
19420    #[serde(skip_serializing_if = "Option::is_none")]
19421    pub tos_shown_and_accepted: Option<bool>,
19422}
19423impl UpdatePaymentIntentPaymentMethodOptionsP24 {
19424    pub fn new() -> Self {
19425        Self { setup_future_usage: None, tos_shown_and_accepted: None }
19426    }
19427}
19428impl Default for UpdatePaymentIntentPaymentMethodOptionsP24 {
19429    fn default() -> Self {
19430        Self::new()
19431    }
19432}
19433/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19434///
19435/// 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.
19436/// 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.
19437///
19438/// 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.
19439///
19440/// 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).
19441///
19442/// 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`.
19443#[derive(Copy, Clone, Eq, PartialEq)]
19444pub enum UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
19445    None,
19446}
19447impl UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
19448    pub fn as_str(self) -> &'static str {
19449        use UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*;
19450        match self {
19451            None => "none",
19452        }
19453    }
19454}
19455
19456impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
19457    type Err = stripe_types::StripeParseError;
19458    fn from_str(s: &str) -> Result<Self, Self::Err> {
19459        use UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*;
19460        match s {
19461            "none" => Ok(None),
19462            _ => Err(stripe_types::StripeParseError),
19463        }
19464    }
19465}
19466impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
19467    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19468        f.write_str(self.as_str())
19469    }
19470}
19471
19472impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
19473    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19474        f.write_str(self.as_str())
19475    }
19476}
19477impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
19478    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19479    where
19480        S: serde::Serializer,
19481    {
19482        serializer.serialize_str(self.as_str())
19483    }
19484}
19485#[cfg(feature = "deserialize")]
19486impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
19487    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19488        use std::str::FromStr;
19489        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19490        Self::from_str(&s).map_err(|_| {
19491            serde::de::Error::custom(
19492                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage",
19493            )
19494        })
19495    }
19496}
19497/// If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options.
19498#[derive(Copy, Clone, Debug, serde::Serialize)]
19499pub struct UpdatePaymentIntentPaymentMethodOptionsPayco {
19500    /// Controls when the funds are captured from the customer's account.
19501    ///
19502    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
19503    ///
19504    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
19505    #[serde(skip_serializing_if = "Option::is_none")]
19506    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod>,
19507}
19508impl UpdatePaymentIntentPaymentMethodOptionsPayco {
19509    pub fn new() -> Self {
19510        Self { capture_method: None }
19511    }
19512}
19513impl Default for UpdatePaymentIntentPaymentMethodOptionsPayco {
19514    fn default() -> Self {
19515        Self::new()
19516    }
19517}
19518/// Controls when the funds are captured from the customer's account.
19519///
19520/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
19521///
19522/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
19523#[derive(Copy, Clone, Eq, PartialEq)]
19524pub enum UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
19525    Manual,
19526}
19527impl UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
19528    pub fn as_str(self) -> &'static str {
19529        use UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod::*;
19530        match self {
19531            Manual => "manual",
19532        }
19533    }
19534}
19535
19536impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
19537    type Err = stripe_types::StripeParseError;
19538    fn from_str(s: &str) -> Result<Self, Self::Err> {
19539        use UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod::*;
19540        match s {
19541            "manual" => Ok(Manual),
19542            _ => Err(stripe_types::StripeParseError),
19543        }
19544    }
19545}
19546impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
19547    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19548        f.write_str(self.as_str())
19549    }
19550}
19551
19552impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
19553    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19554        f.write_str(self.as_str())
19555    }
19556}
19557impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
19558    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19559    where
19560        S: serde::Serializer,
19561    {
19562        serializer.serialize_str(self.as_str())
19563    }
19564}
19565#[cfg(feature = "deserialize")]
19566impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
19567    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19568        use std::str::FromStr;
19569        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19570        Self::from_str(&s).map_err(|_| {
19571            serde::de::Error::custom(
19572                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod",
19573            )
19574        })
19575    }
19576}
19577/// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options.
19578#[derive(Copy, Clone, Debug, serde::Serialize)]
19579pub struct UpdatePaymentIntentPaymentMethodOptionsPaynow {
19580    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19581    ///
19582    /// 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.
19583    /// 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.
19584    ///
19585    /// 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.
19586    ///
19587    /// 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).
19588    ///
19589    /// 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`.
19590    #[serde(skip_serializing_if = "Option::is_none")]
19591    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage>,
19592}
19593impl UpdatePaymentIntentPaymentMethodOptionsPaynow {
19594    pub fn new() -> Self {
19595        Self { setup_future_usage: None }
19596    }
19597}
19598impl Default for UpdatePaymentIntentPaymentMethodOptionsPaynow {
19599    fn default() -> Self {
19600        Self::new()
19601    }
19602}
19603/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19604///
19605/// 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.
19606/// 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.
19607///
19608/// 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.
19609///
19610/// 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).
19611///
19612/// 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`.
19613#[derive(Copy, Clone, Eq, PartialEq)]
19614pub enum UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
19615    None,
19616}
19617impl UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
19618    pub fn as_str(self) -> &'static str {
19619        use UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*;
19620        match self {
19621            None => "none",
19622        }
19623    }
19624}
19625
19626impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
19627    type Err = stripe_types::StripeParseError;
19628    fn from_str(s: &str) -> Result<Self, Self::Err> {
19629        use UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*;
19630        match s {
19631            "none" => Ok(None),
19632            _ => Err(stripe_types::StripeParseError),
19633        }
19634    }
19635}
19636impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
19637    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19638        f.write_str(self.as_str())
19639    }
19640}
19641
19642impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
19643    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19644        f.write_str(self.as_str())
19645    }
19646}
19647impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
19648    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19649    where
19650        S: serde::Serializer,
19651    {
19652        serializer.serialize_str(self.as_str())
19653    }
19654}
19655#[cfg(feature = "deserialize")]
19656impl<'de> serde::Deserialize<'de>
19657    for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage
19658{
19659    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19660        use std::str::FromStr;
19661        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19662        Self::from_str(&s).map_err(|_| {
19663            serde::de::Error::custom(
19664                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage",
19665            )
19666        })
19667    }
19668}
19669/// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
19670#[derive(Clone, Debug, serde::Serialize)]
19671pub struct UpdatePaymentIntentPaymentMethodOptionsPaypal {
19672    /// Controls when the funds will be captured from the customer's account.
19673    #[serde(skip_serializing_if = "Option::is_none")]
19674    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod>,
19675    /// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to.
19676    #[serde(skip_serializing_if = "Option::is_none")]
19677    pub preferred_locale: Option<UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale>,
19678    /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID.
19679    /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID.
19680    #[serde(skip_serializing_if = "Option::is_none")]
19681    pub reference: Option<String>,
19682    /// The risk correlation ID for an on-session payment using a saved PayPal payment method.
19683    #[serde(skip_serializing_if = "Option::is_none")]
19684    pub risk_correlation_id: Option<String>,
19685    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19686    ///
19687    /// 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.
19688    /// 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.
19689    ///
19690    /// 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.
19691    ///
19692    /// 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).
19693    ///
19694    /// 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`.
19695    #[serde(skip_serializing_if = "Option::is_none")]
19696    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage>,
19697}
19698impl UpdatePaymentIntentPaymentMethodOptionsPaypal {
19699    pub fn new() -> Self {
19700        Self {
19701            capture_method: None,
19702            preferred_locale: None,
19703            reference: None,
19704            risk_correlation_id: None,
19705            setup_future_usage: None,
19706        }
19707    }
19708}
19709impl Default for UpdatePaymentIntentPaymentMethodOptionsPaypal {
19710    fn default() -> Self {
19711        Self::new()
19712    }
19713}
19714/// Controls when the funds will be captured from the customer's account.
19715#[derive(Copy, Clone, Eq, PartialEq)]
19716pub enum UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
19717    Manual,
19718}
19719impl UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
19720    pub fn as_str(self) -> &'static str {
19721        use UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*;
19722        match self {
19723            Manual => "manual",
19724        }
19725    }
19726}
19727
19728impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
19729    type Err = stripe_types::StripeParseError;
19730    fn from_str(s: &str) -> Result<Self, Self::Err> {
19731        use UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*;
19732        match s {
19733            "manual" => Ok(Manual),
19734            _ => Err(stripe_types::StripeParseError),
19735        }
19736    }
19737}
19738impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
19739    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19740        f.write_str(self.as_str())
19741    }
19742}
19743
19744impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
19745    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19746        f.write_str(self.as_str())
19747    }
19748}
19749impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
19750    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19751    where
19752        S: serde::Serializer,
19753    {
19754        serializer.serialize_str(self.as_str())
19755    }
19756}
19757#[cfg(feature = "deserialize")]
19758impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
19759    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19760        use std::str::FromStr;
19761        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19762        Self::from_str(&s).map_err(|_| {
19763            serde::de::Error::custom(
19764                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod",
19765            )
19766        })
19767    }
19768}
19769/// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to.
19770#[derive(Clone, Eq, PartialEq)]
19771#[non_exhaustive]
19772pub enum UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
19773    CsMinusCz,
19774    DaMinusDk,
19775    DeMinusAt,
19776    DeMinusDe,
19777    DeMinusLu,
19778    ElMinusGr,
19779    EnMinusGb,
19780    EnMinusUs,
19781    EsMinusEs,
19782    FiMinusFi,
19783    FrMinusBe,
19784    FrMinusFr,
19785    FrMinusLu,
19786    HuMinusHu,
19787    ItMinusIt,
19788    NlMinusBe,
19789    NlMinusNl,
19790    PlMinusPl,
19791    PtMinusPt,
19792    SkMinusSk,
19793    SvMinusSe,
19794    /// An unrecognized value from Stripe. Should not be used as a request parameter.
19795    Unknown(String),
19796}
19797impl UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
19798    pub fn as_str(&self) -> &str {
19799        use UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*;
19800        match self {
19801            CsMinusCz => "cs-CZ",
19802            DaMinusDk => "da-DK",
19803            DeMinusAt => "de-AT",
19804            DeMinusDe => "de-DE",
19805            DeMinusLu => "de-LU",
19806            ElMinusGr => "el-GR",
19807            EnMinusGb => "en-GB",
19808            EnMinusUs => "en-US",
19809            EsMinusEs => "es-ES",
19810            FiMinusFi => "fi-FI",
19811            FrMinusBe => "fr-BE",
19812            FrMinusFr => "fr-FR",
19813            FrMinusLu => "fr-LU",
19814            HuMinusHu => "hu-HU",
19815            ItMinusIt => "it-IT",
19816            NlMinusBe => "nl-BE",
19817            NlMinusNl => "nl-NL",
19818            PlMinusPl => "pl-PL",
19819            PtMinusPt => "pt-PT",
19820            SkMinusSk => "sk-SK",
19821            SvMinusSe => "sv-SE",
19822            Unknown(v) => v,
19823        }
19824    }
19825}
19826
19827impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
19828    type Err = std::convert::Infallible;
19829    fn from_str(s: &str) -> Result<Self, Self::Err> {
19830        use UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*;
19831        match s {
19832            "cs-CZ" => Ok(CsMinusCz),
19833            "da-DK" => Ok(DaMinusDk),
19834            "de-AT" => Ok(DeMinusAt),
19835            "de-DE" => Ok(DeMinusDe),
19836            "de-LU" => Ok(DeMinusLu),
19837            "el-GR" => Ok(ElMinusGr),
19838            "en-GB" => Ok(EnMinusGb),
19839            "en-US" => Ok(EnMinusUs),
19840            "es-ES" => Ok(EsMinusEs),
19841            "fi-FI" => Ok(FiMinusFi),
19842            "fr-BE" => Ok(FrMinusBe),
19843            "fr-FR" => Ok(FrMinusFr),
19844            "fr-LU" => Ok(FrMinusLu),
19845            "hu-HU" => Ok(HuMinusHu),
19846            "it-IT" => Ok(ItMinusIt),
19847            "nl-BE" => Ok(NlMinusBe),
19848            "nl-NL" => Ok(NlMinusNl),
19849            "pl-PL" => Ok(PlMinusPl),
19850            "pt-PT" => Ok(PtMinusPt),
19851            "sk-SK" => Ok(SkMinusSk),
19852            "sv-SE" => Ok(SvMinusSe),
19853            v => Ok(Unknown(v.to_owned())),
19854        }
19855    }
19856}
19857impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
19858    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19859        f.write_str(self.as_str())
19860    }
19861}
19862
19863impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
19864    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19865        f.write_str(self.as_str())
19866    }
19867}
19868impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
19869    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19870    where
19871        S: serde::Serializer,
19872    {
19873        serializer.serialize_str(self.as_str())
19874    }
19875}
19876#[cfg(feature = "deserialize")]
19877impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
19878    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19879        use std::str::FromStr;
19880        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19881        Ok(Self::from_str(&s).unwrap())
19882    }
19883}
19884/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19885///
19886/// 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.
19887/// 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.
19888///
19889/// 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.
19890///
19891/// 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).
19892///
19893/// 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`.
19894#[derive(Copy, Clone, Eq, PartialEq)]
19895pub enum UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
19896    None,
19897    OffSession,
19898}
19899impl UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
19900    pub fn as_str(self) -> &'static str {
19901        use UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*;
19902        match self {
19903            None => "none",
19904            OffSession => "off_session",
19905        }
19906    }
19907}
19908
19909impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
19910    type Err = stripe_types::StripeParseError;
19911    fn from_str(s: &str) -> Result<Self, Self::Err> {
19912        use UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*;
19913        match s {
19914            "none" => Ok(None),
19915            "off_session" => Ok(OffSession),
19916            _ => Err(stripe_types::StripeParseError),
19917        }
19918    }
19919}
19920impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
19921    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19922        f.write_str(self.as_str())
19923    }
19924}
19925
19926impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
19927    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19928        f.write_str(self.as_str())
19929    }
19930}
19931impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
19932    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19933    where
19934        S: serde::Serializer,
19935    {
19936        serializer.serialize_str(self.as_str())
19937    }
19938}
19939#[cfg(feature = "deserialize")]
19940impl<'de> serde::Deserialize<'de>
19941    for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage
19942{
19943    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19944        use std::str::FromStr;
19945        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19946        Self::from_str(&s).map_err(|_| {
19947            serde::de::Error::custom(
19948                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage",
19949            )
19950        })
19951    }
19952}
19953/// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options.
19954#[derive(Copy, Clone, Debug, serde::Serialize)]
19955pub struct UpdatePaymentIntentPaymentMethodOptionsPix {
19956    /// Determines if the amount includes the IOF tax. Defaults to `never`.
19957    #[serde(skip_serializing_if = "Option::is_none")]
19958    pub amount_includes_iof: Option<UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof>,
19959    /// The number of seconds (between 10 and 1209600) after which Pix payment will expire.
19960    /// Defaults to 86400 seconds.
19961    #[serde(skip_serializing_if = "Option::is_none")]
19962    pub expires_after_seconds: Option<i64>,
19963    /// The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future).
19964    /// Defaults to 1 day in the future.
19965    #[serde(skip_serializing_if = "Option::is_none")]
19966    pub expires_at: Option<stripe_types::Timestamp>,
19967    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19968    ///
19969    /// 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.
19970    /// 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.
19971    ///
19972    /// 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.
19973    ///
19974    /// 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).
19975    ///
19976    /// 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`.
19977    #[serde(skip_serializing_if = "Option::is_none")]
19978    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage>,
19979}
19980impl UpdatePaymentIntentPaymentMethodOptionsPix {
19981    pub fn new() -> Self {
19982        Self {
19983            amount_includes_iof: None,
19984            expires_after_seconds: None,
19985            expires_at: None,
19986            setup_future_usage: None,
19987        }
19988    }
19989}
19990impl Default for UpdatePaymentIntentPaymentMethodOptionsPix {
19991    fn default() -> Self {
19992        Self::new()
19993    }
19994}
19995/// Determines if the amount includes the IOF tax. Defaults to `never`.
19996#[derive(Copy, Clone, Eq, PartialEq)]
19997pub enum UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
19998    Always,
19999    Never,
20000}
20001impl UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
20002    pub fn as_str(self) -> &'static str {
20003        use UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof::*;
20004        match self {
20005            Always => "always",
20006            Never => "never",
20007        }
20008    }
20009}
20010
20011impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
20012    type Err = stripe_types::StripeParseError;
20013    fn from_str(s: &str) -> Result<Self, Self::Err> {
20014        use UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof::*;
20015        match s {
20016            "always" => Ok(Always),
20017            "never" => Ok(Never),
20018            _ => Err(stripe_types::StripeParseError),
20019        }
20020    }
20021}
20022impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
20023    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20024        f.write_str(self.as_str())
20025    }
20026}
20027
20028impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
20029    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20030        f.write_str(self.as_str())
20031    }
20032}
20033impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
20034    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20035    where
20036        S: serde::Serializer,
20037    {
20038        serializer.serialize_str(self.as_str())
20039    }
20040}
20041#[cfg(feature = "deserialize")]
20042impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
20043    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20044        use std::str::FromStr;
20045        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20046        Self::from_str(&s).map_err(|_| {
20047            serde::de::Error::custom(
20048                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof",
20049            )
20050        })
20051    }
20052}
20053/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20054///
20055/// 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.
20056/// 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.
20057///
20058/// 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.
20059///
20060/// 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).
20061///
20062/// 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`.
20063#[derive(Copy, Clone, Eq, PartialEq)]
20064pub enum UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
20065    None,
20066}
20067impl UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
20068    pub fn as_str(self) -> &'static str {
20069        use UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*;
20070        match self {
20071            None => "none",
20072        }
20073    }
20074}
20075
20076impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
20077    type Err = stripe_types::StripeParseError;
20078    fn from_str(s: &str) -> Result<Self, Self::Err> {
20079        use UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*;
20080        match s {
20081            "none" => Ok(None),
20082            _ => Err(stripe_types::StripeParseError),
20083        }
20084    }
20085}
20086impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
20087    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20088        f.write_str(self.as_str())
20089    }
20090}
20091
20092impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
20093    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20094        f.write_str(self.as_str())
20095    }
20096}
20097impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
20098    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20099    where
20100        S: serde::Serializer,
20101    {
20102        serializer.serialize_str(self.as_str())
20103    }
20104}
20105#[cfg(feature = "deserialize")]
20106impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
20107    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20108        use std::str::FromStr;
20109        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20110        Self::from_str(&s).map_err(|_| {
20111            serde::de::Error::custom(
20112                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage",
20113            )
20114        })
20115    }
20116}
20117/// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options.
20118#[derive(Copy, Clone, Debug, serde::Serialize)]
20119pub struct UpdatePaymentIntentPaymentMethodOptionsPromptpay {
20120    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20121    ///
20122    /// 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.
20123    /// 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.
20124    ///
20125    /// 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.
20126    ///
20127    /// 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).
20128    ///
20129    /// 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`.
20130    #[serde(skip_serializing_if = "Option::is_none")]
20131    pub setup_future_usage:
20132        Option<UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage>,
20133}
20134impl UpdatePaymentIntentPaymentMethodOptionsPromptpay {
20135    pub fn new() -> Self {
20136        Self { setup_future_usage: None }
20137    }
20138}
20139impl Default for UpdatePaymentIntentPaymentMethodOptionsPromptpay {
20140    fn default() -> Self {
20141        Self::new()
20142    }
20143}
20144/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20145///
20146/// 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.
20147/// 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.
20148///
20149/// 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.
20150///
20151/// 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).
20152///
20153/// 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`.
20154#[derive(Copy, Clone, Eq, PartialEq)]
20155pub enum UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
20156    None,
20157}
20158impl UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
20159    pub fn as_str(self) -> &'static str {
20160        use UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*;
20161        match self {
20162            None => "none",
20163        }
20164    }
20165}
20166
20167impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
20168    type Err = stripe_types::StripeParseError;
20169    fn from_str(s: &str) -> Result<Self, Self::Err> {
20170        use UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*;
20171        match s {
20172            "none" => Ok(None),
20173            _ => Err(stripe_types::StripeParseError),
20174        }
20175    }
20176}
20177impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
20178    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20179        f.write_str(self.as_str())
20180    }
20181}
20182
20183impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
20184    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20185        f.write_str(self.as_str())
20186    }
20187}
20188impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
20189    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20190    where
20191        S: serde::Serializer,
20192    {
20193        serializer.serialize_str(self.as_str())
20194    }
20195}
20196#[cfg(feature = "deserialize")]
20197impl<'de> serde::Deserialize<'de>
20198    for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage
20199{
20200    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20201        use std::str::FromStr;
20202        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20203        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage"))
20204    }
20205}
20206/// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options.
20207#[derive(Copy, Clone, Debug, serde::Serialize)]
20208pub struct UpdatePaymentIntentPaymentMethodOptionsRevolutPay {
20209    /// Controls when the funds are captured from the customer's account.
20210    ///
20211    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
20212    ///
20213    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
20214    #[serde(skip_serializing_if = "Option::is_none")]
20215    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod>,
20216    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20217    ///
20218    /// 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.
20219    /// 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.
20220    ///
20221    /// 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.
20222    ///
20223    /// 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).
20224    #[serde(skip_serializing_if = "Option::is_none")]
20225    pub setup_future_usage:
20226        Option<UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage>,
20227}
20228impl UpdatePaymentIntentPaymentMethodOptionsRevolutPay {
20229    pub fn new() -> Self {
20230        Self { capture_method: None, setup_future_usage: None }
20231    }
20232}
20233impl Default for UpdatePaymentIntentPaymentMethodOptionsRevolutPay {
20234    fn default() -> Self {
20235        Self::new()
20236    }
20237}
20238/// Controls when the funds are captured from the customer's account.
20239///
20240/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
20241///
20242/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
20243#[derive(Copy, Clone, Eq, PartialEq)]
20244pub enum UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
20245    Manual,
20246}
20247impl UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
20248    pub fn as_str(self) -> &'static str {
20249        use UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod::*;
20250        match self {
20251            Manual => "manual",
20252        }
20253    }
20254}
20255
20256impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
20257    type Err = stripe_types::StripeParseError;
20258    fn from_str(s: &str) -> Result<Self, Self::Err> {
20259        use UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod::*;
20260        match s {
20261            "manual" => Ok(Manual),
20262            _ => Err(stripe_types::StripeParseError),
20263        }
20264    }
20265}
20266impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
20267    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20268        f.write_str(self.as_str())
20269    }
20270}
20271
20272impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
20273    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20274        f.write_str(self.as_str())
20275    }
20276}
20277impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
20278    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20279    where
20280        S: serde::Serializer,
20281    {
20282        serializer.serialize_str(self.as_str())
20283    }
20284}
20285#[cfg(feature = "deserialize")]
20286impl<'de> serde::Deserialize<'de>
20287    for UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod
20288{
20289    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20290        use std::str::FromStr;
20291        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20292        Self::from_str(&s).map_err(|_| {
20293            serde::de::Error::custom(
20294                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod",
20295            )
20296        })
20297    }
20298}
20299/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20300///
20301/// 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.
20302/// 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.
20303///
20304/// 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.
20305///
20306/// 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).
20307#[derive(Copy, Clone, Eq, PartialEq)]
20308pub enum UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
20309    None,
20310    OffSession,
20311}
20312impl UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
20313    pub fn as_str(self) -> &'static str {
20314        use UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*;
20315        match self {
20316            None => "none",
20317            OffSession => "off_session",
20318        }
20319    }
20320}
20321
20322impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
20323    type Err = stripe_types::StripeParseError;
20324    fn from_str(s: &str) -> Result<Self, Self::Err> {
20325        use UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*;
20326        match s {
20327            "none" => Ok(None),
20328            "off_session" => Ok(OffSession),
20329            _ => Err(stripe_types::StripeParseError),
20330        }
20331    }
20332}
20333impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
20334    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20335        f.write_str(self.as_str())
20336    }
20337}
20338
20339impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
20340    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20341        f.write_str(self.as_str())
20342    }
20343}
20344impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
20345    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20346    where
20347        S: serde::Serializer,
20348    {
20349        serializer.serialize_str(self.as_str())
20350    }
20351}
20352#[cfg(feature = "deserialize")]
20353impl<'de> serde::Deserialize<'de>
20354    for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage
20355{
20356    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20357        use std::str::FromStr;
20358        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20359        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage"))
20360    }
20361}
20362/// If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options.
20363#[derive(Copy, Clone, Debug, serde::Serialize)]
20364pub struct UpdatePaymentIntentPaymentMethodOptionsSamsungPay {
20365    /// Controls when the funds are captured from the customer's account.
20366    ///
20367    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
20368    ///
20369    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
20370    #[serde(skip_serializing_if = "Option::is_none")]
20371    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod>,
20372}
20373impl UpdatePaymentIntentPaymentMethodOptionsSamsungPay {
20374    pub fn new() -> Self {
20375        Self { capture_method: None }
20376    }
20377}
20378impl Default for UpdatePaymentIntentPaymentMethodOptionsSamsungPay {
20379    fn default() -> Self {
20380        Self::new()
20381    }
20382}
20383/// Controls when the funds are captured from the customer's account.
20384///
20385/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
20386///
20387/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
20388#[derive(Copy, Clone, Eq, PartialEq)]
20389pub enum UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
20390    Manual,
20391}
20392impl UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
20393    pub fn as_str(self) -> &'static str {
20394        use UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod::*;
20395        match self {
20396            Manual => "manual",
20397        }
20398    }
20399}
20400
20401impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
20402    type Err = stripe_types::StripeParseError;
20403    fn from_str(s: &str) -> Result<Self, Self::Err> {
20404        use UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod::*;
20405        match s {
20406            "manual" => Ok(Manual),
20407            _ => Err(stripe_types::StripeParseError),
20408        }
20409    }
20410}
20411impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
20412    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20413        f.write_str(self.as_str())
20414    }
20415}
20416
20417impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
20418    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20419        f.write_str(self.as_str())
20420    }
20421}
20422impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
20423    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20424    where
20425        S: serde::Serializer,
20426    {
20427        serializer.serialize_str(self.as_str())
20428    }
20429}
20430#[cfg(feature = "deserialize")]
20431impl<'de> serde::Deserialize<'de>
20432    for UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod
20433{
20434    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20435        use std::str::FromStr;
20436        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20437        Self::from_str(&s).map_err(|_| {
20438            serde::de::Error::custom(
20439                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod",
20440            )
20441        })
20442    }
20443}
20444/// If this is a `satispay` PaymentMethod, this sub-hash contains details about the Satispay payment method options.
20445#[derive(Copy, Clone, Debug, serde::Serialize)]
20446pub struct UpdatePaymentIntentPaymentMethodOptionsSatispay {
20447    /// Controls when the funds are captured from the customer's account.
20448    ///
20449    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
20450    ///
20451    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
20452    #[serde(skip_serializing_if = "Option::is_none")]
20453    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod>,
20454}
20455impl UpdatePaymentIntentPaymentMethodOptionsSatispay {
20456    pub fn new() -> Self {
20457        Self { capture_method: None }
20458    }
20459}
20460impl Default for UpdatePaymentIntentPaymentMethodOptionsSatispay {
20461    fn default() -> Self {
20462        Self::new()
20463    }
20464}
20465/// Controls when the funds are captured from the customer's account.
20466///
20467/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
20468///
20469/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
20470#[derive(Copy, Clone, Eq, PartialEq)]
20471pub enum UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
20472    Manual,
20473}
20474impl UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
20475    pub fn as_str(self) -> &'static str {
20476        use UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod::*;
20477        match self {
20478            Manual => "manual",
20479        }
20480    }
20481}
20482
20483impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
20484    type Err = stripe_types::StripeParseError;
20485    fn from_str(s: &str) -> Result<Self, Self::Err> {
20486        use UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod::*;
20487        match s {
20488            "manual" => Ok(Manual),
20489            _ => Err(stripe_types::StripeParseError),
20490        }
20491    }
20492}
20493impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
20494    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20495        f.write_str(self.as_str())
20496    }
20497}
20498
20499impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
20500    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20501        f.write_str(self.as_str())
20502    }
20503}
20504impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
20505    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20506    where
20507        S: serde::Serializer,
20508    {
20509        serializer.serialize_str(self.as_str())
20510    }
20511}
20512#[cfg(feature = "deserialize")]
20513impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
20514    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20515        use std::str::FromStr;
20516        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20517        Self::from_str(&s).map_err(|_| {
20518            serde::de::Error::custom(
20519                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod",
20520            )
20521        })
20522    }
20523}
20524/// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options.
20525#[derive(Clone, Debug, serde::Serialize)]
20526pub struct UpdatePaymentIntentPaymentMethodOptionsSepaDebit {
20527    /// Additional fields for Mandate creation
20528    #[serde(skip_serializing_if = "Option::is_none")]
20529    pub mandate_options: Option<UpdatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions>,
20530    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20531    ///
20532    /// 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.
20533    /// 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.
20534    ///
20535    /// 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.
20536    ///
20537    /// 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).
20538    ///
20539    /// 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`.
20540    #[serde(skip_serializing_if = "Option::is_none")]
20541    pub setup_future_usage:
20542        Option<UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage>,
20543    /// Controls when Stripe will attempt to debit the funds from the customer's account.
20544    /// The date must be a string in YYYY-MM-DD format.
20545    /// The date must be in the future and between 3 and 15 calendar days from now.
20546    #[serde(skip_serializing_if = "Option::is_none")]
20547    pub target_date: Option<String>,
20548}
20549impl UpdatePaymentIntentPaymentMethodOptionsSepaDebit {
20550    pub fn new() -> Self {
20551        Self { mandate_options: None, setup_future_usage: None, target_date: None }
20552    }
20553}
20554impl Default for UpdatePaymentIntentPaymentMethodOptionsSepaDebit {
20555    fn default() -> Self {
20556        Self::new()
20557    }
20558}
20559/// Additional fields for Mandate creation
20560#[derive(Clone, Debug, serde::Serialize)]
20561pub struct UpdatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
20562    /// Prefix used to generate the Mandate reference.
20563    /// Must be at most 12 characters long.
20564    /// Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'.
20565    /// Cannot begin with 'STRIPE'.
20566    #[serde(skip_serializing_if = "Option::is_none")]
20567    pub reference_prefix: Option<String>,
20568}
20569impl UpdatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
20570    pub fn new() -> Self {
20571        Self { reference_prefix: None }
20572    }
20573}
20574impl Default for UpdatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
20575    fn default() -> Self {
20576        Self::new()
20577    }
20578}
20579/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20580///
20581/// 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.
20582/// 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.
20583///
20584/// 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.
20585///
20586/// 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).
20587///
20588/// 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`.
20589#[derive(Copy, Clone, Eq, PartialEq)]
20590pub enum UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
20591    None,
20592    OffSession,
20593    OnSession,
20594}
20595impl UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
20596    pub fn as_str(self) -> &'static str {
20597        use UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*;
20598        match self {
20599            None => "none",
20600            OffSession => "off_session",
20601            OnSession => "on_session",
20602        }
20603    }
20604}
20605
20606impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
20607    type Err = stripe_types::StripeParseError;
20608    fn from_str(s: &str) -> Result<Self, Self::Err> {
20609        use UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*;
20610        match s {
20611            "none" => Ok(None),
20612            "off_session" => Ok(OffSession),
20613            "on_session" => Ok(OnSession),
20614            _ => Err(stripe_types::StripeParseError),
20615        }
20616    }
20617}
20618impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
20619    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20620        f.write_str(self.as_str())
20621    }
20622}
20623
20624impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
20625    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20626        f.write_str(self.as_str())
20627    }
20628}
20629impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
20630    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20631    where
20632        S: serde::Serializer,
20633    {
20634        serializer.serialize_str(self.as_str())
20635    }
20636}
20637#[cfg(feature = "deserialize")]
20638impl<'de> serde::Deserialize<'de>
20639    for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage
20640{
20641    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20642        use std::str::FromStr;
20643        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20644        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage"))
20645    }
20646}
20647/// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options.
20648#[derive(Copy, Clone, Debug, serde::Serialize)]
20649pub struct UpdatePaymentIntentPaymentMethodOptionsSofort {
20650    /// Language shown to the payer on redirect.
20651    #[serde(skip_serializing_if = "Option::is_none")]
20652    pub preferred_language: Option<UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage>,
20653    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20654    ///
20655    /// 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.
20656    /// 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.
20657    ///
20658    /// 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.
20659    ///
20660    /// 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).
20661    ///
20662    /// 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`.
20663    #[serde(skip_serializing_if = "Option::is_none")]
20664    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage>,
20665}
20666impl UpdatePaymentIntentPaymentMethodOptionsSofort {
20667    pub fn new() -> Self {
20668        Self { preferred_language: None, setup_future_usage: None }
20669    }
20670}
20671impl Default for UpdatePaymentIntentPaymentMethodOptionsSofort {
20672    fn default() -> Self {
20673        Self::new()
20674    }
20675}
20676/// Language shown to the payer on redirect.
20677#[derive(Copy, Clone, Eq, PartialEq)]
20678pub enum UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
20679    De,
20680    En,
20681    Es,
20682    Fr,
20683    It,
20684    Nl,
20685    Pl,
20686}
20687impl UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
20688    pub fn as_str(self) -> &'static str {
20689        use UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*;
20690        match self {
20691            De => "de",
20692            En => "en",
20693            Es => "es",
20694            Fr => "fr",
20695            It => "it",
20696            Nl => "nl",
20697            Pl => "pl",
20698        }
20699    }
20700}
20701
20702impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
20703    type Err = stripe_types::StripeParseError;
20704    fn from_str(s: &str) -> Result<Self, Self::Err> {
20705        use UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*;
20706        match s {
20707            "de" => Ok(De),
20708            "en" => Ok(En),
20709            "es" => Ok(Es),
20710            "fr" => Ok(Fr),
20711            "it" => Ok(It),
20712            "nl" => Ok(Nl),
20713            "pl" => Ok(Pl),
20714            _ => Err(stripe_types::StripeParseError),
20715        }
20716    }
20717}
20718impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
20719    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20720        f.write_str(self.as_str())
20721    }
20722}
20723
20724impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
20725    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20726        f.write_str(self.as_str())
20727    }
20728}
20729impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
20730    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20731    where
20732        S: serde::Serializer,
20733    {
20734        serializer.serialize_str(self.as_str())
20735    }
20736}
20737#[cfg(feature = "deserialize")]
20738impl<'de> serde::Deserialize<'de>
20739    for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage
20740{
20741    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20742        use std::str::FromStr;
20743        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20744        Self::from_str(&s).map_err(|_| {
20745            serde::de::Error::custom(
20746                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage",
20747            )
20748        })
20749    }
20750}
20751/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20752///
20753/// 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.
20754/// 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.
20755///
20756/// 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.
20757///
20758/// 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).
20759///
20760/// 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`.
20761#[derive(Copy, Clone, Eq, PartialEq)]
20762pub enum UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
20763    None,
20764    OffSession,
20765}
20766impl UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
20767    pub fn as_str(self) -> &'static str {
20768        use UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*;
20769        match self {
20770            None => "none",
20771            OffSession => "off_session",
20772        }
20773    }
20774}
20775
20776impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
20777    type Err = stripe_types::StripeParseError;
20778    fn from_str(s: &str) -> Result<Self, Self::Err> {
20779        use UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*;
20780        match s {
20781            "none" => Ok(None),
20782            "off_session" => Ok(OffSession),
20783            _ => Err(stripe_types::StripeParseError),
20784        }
20785    }
20786}
20787impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
20788    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20789        f.write_str(self.as_str())
20790    }
20791}
20792
20793impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
20794    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20795        f.write_str(self.as_str())
20796    }
20797}
20798impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
20799    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20800    where
20801        S: serde::Serializer,
20802    {
20803        serializer.serialize_str(self.as_str())
20804    }
20805}
20806#[cfg(feature = "deserialize")]
20807impl<'de> serde::Deserialize<'de>
20808    for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage
20809{
20810    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20811        use std::str::FromStr;
20812        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20813        Self::from_str(&s).map_err(|_| {
20814            serde::de::Error::custom(
20815                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage",
20816            )
20817        })
20818    }
20819}
20820/// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options.
20821#[derive(Clone, Debug, serde::Serialize)]
20822pub struct UpdatePaymentIntentPaymentMethodOptionsSwish {
20823    /// A reference for this payment to be displayed in the Swish app.
20824    #[serde(skip_serializing_if = "Option::is_none")]
20825    pub reference: Option<String>,
20826    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20827    ///
20828    /// 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.
20829    /// 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.
20830    ///
20831    /// 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.
20832    ///
20833    /// 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).
20834    ///
20835    /// 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`.
20836    #[serde(skip_serializing_if = "Option::is_none")]
20837    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage>,
20838}
20839impl UpdatePaymentIntentPaymentMethodOptionsSwish {
20840    pub fn new() -> Self {
20841        Self { reference: None, setup_future_usage: None }
20842    }
20843}
20844impl Default for UpdatePaymentIntentPaymentMethodOptionsSwish {
20845    fn default() -> Self {
20846        Self::new()
20847    }
20848}
20849/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20850///
20851/// 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.
20852/// 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.
20853///
20854/// 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.
20855///
20856/// 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).
20857///
20858/// 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`.
20859#[derive(Copy, Clone, Eq, PartialEq)]
20860pub enum UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
20861    None,
20862}
20863impl UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
20864    pub fn as_str(self) -> &'static str {
20865        use UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::*;
20866        match self {
20867            None => "none",
20868        }
20869    }
20870}
20871
20872impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
20873    type Err = stripe_types::StripeParseError;
20874    fn from_str(s: &str) -> Result<Self, Self::Err> {
20875        use UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::*;
20876        match s {
20877            "none" => Ok(None),
20878            _ => Err(stripe_types::StripeParseError),
20879        }
20880    }
20881}
20882impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
20883    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20884        f.write_str(self.as_str())
20885    }
20886}
20887
20888impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
20889    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20890        f.write_str(self.as_str())
20891    }
20892}
20893impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
20894    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20895    where
20896        S: serde::Serializer,
20897    {
20898        serializer.serialize_str(self.as_str())
20899    }
20900}
20901#[cfg(feature = "deserialize")]
20902impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
20903    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20904        use std::str::FromStr;
20905        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20906        Self::from_str(&s).map_err(|_| {
20907            serde::de::Error::custom(
20908                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage",
20909            )
20910        })
20911    }
20912}
20913/// If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options.
20914#[derive(Copy, Clone, Debug, serde::Serialize)]
20915pub struct UpdatePaymentIntentPaymentMethodOptionsTwint {
20916    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20917    ///
20918    /// 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.
20919    /// 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.
20920    ///
20921    /// 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.
20922    ///
20923    /// 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).
20924    ///
20925    /// 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`.
20926    #[serde(skip_serializing_if = "Option::is_none")]
20927    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage>,
20928}
20929impl UpdatePaymentIntentPaymentMethodOptionsTwint {
20930    pub fn new() -> Self {
20931        Self { setup_future_usage: None }
20932    }
20933}
20934impl Default for UpdatePaymentIntentPaymentMethodOptionsTwint {
20935    fn default() -> Self {
20936        Self::new()
20937    }
20938}
20939/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20940///
20941/// 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.
20942/// 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.
20943///
20944/// 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.
20945///
20946/// 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).
20947///
20948/// 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`.
20949#[derive(Copy, Clone, Eq, PartialEq)]
20950pub enum UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
20951    None,
20952}
20953impl UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
20954    pub fn as_str(self) -> &'static str {
20955        use UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage::*;
20956        match self {
20957            None => "none",
20958        }
20959    }
20960}
20961
20962impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
20963    type Err = stripe_types::StripeParseError;
20964    fn from_str(s: &str) -> Result<Self, Self::Err> {
20965        use UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage::*;
20966        match s {
20967            "none" => Ok(None),
20968            _ => Err(stripe_types::StripeParseError),
20969        }
20970    }
20971}
20972impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
20973    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20974        f.write_str(self.as_str())
20975    }
20976}
20977
20978impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
20979    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20980        f.write_str(self.as_str())
20981    }
20982}
20983impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
20984    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20985    where
20986        S: serde::Serializer,
20987    {
20988        serializer.serialize_str(self.as_str())
20989    }
20990}
20991#[cfg(feature = "deserialize")]
20992impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
20993    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20994        use std::str::FromStr;
20995        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20996        Self::from_str(&s).map_err(|_| {
20997            serde::de::Error::custom(
20998                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage",
20999            )
21000        })
21001    }
21002}
21003/// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options.
21004#[derive(Clone, Debug, serde::Serialize)]
21005pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccount {
21006    /// Additional fields for Financial Connections Session creation
21007    #[serde(skip_serializing_if = "Option::is_none")]
21008    pub financial_connections:
21009        Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
21010    /// Additional fields for Mandate creation
21011    #[serde(skip_serializing_if = "Option::is_none")]
21012    pub mandate_options: Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
21013    /// Additional fields for network related functions
21014    #[serde(skip_serializing_if = "Option::is_none")]
21015    pub networks: Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks>,
21016    /// Preferred transaction settlement speed
21017    #[serde(skip_serializing_if = "Option::is_none")]
21018    pub preferred_settlement_speed:
21019        Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed>,
21020    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21021    ///
21022    /// 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.
21023    /// 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.
21024    ///
21025    /// 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.
21026    ///
21027    /// 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).
21028    ///
21029    /// 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`.
21030    #[serde(skip_serializing_if = "Option::is_none")]
21031    pub setup_future_usage:
21032        Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage>,
21033    /// Controls when Stripe will attempt to debit the funds from the customer's account.
21034    /// The date must be a string in YYYY-MM-DD format.
21035    /// The date must be in the future and between 3 and 15 calendar days from now.
21036    #[serde(skip_serializing_if = "Option::is_none")]
21037    pub target_date: Option<String>,
21038    /// Bank account verification method.
21039    #[serde(skip_serializing_if = "Option::is_none")]
21040    pub verification_method:
21041        Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
21042}
21043impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccount {
21044    pub fn new() -> Self {
21045        Self {
21046            financial_connections: None,
21047            mandate_options: None,
21048            networks: None,
21049            preferred_settlement_speed: None,
21050            setup_future_usage: None,
21051            target_date: None,
21052            verification_method: None,
21053        }
21054    }
21055}
21056impl Default for UpdatePaymentIntentPaymentMethodOptionsUsBankAccount {
21057    fn default() -> Self {
21058        Self::new()
21059    }
21060}
21061/// Additional fields for Financial Connections Session creation
21062#[derive(Clone, Debug, serde::Serialize)]
21063pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
21064    /// Provide filters for the linked accounts that the customer can select for the payment method.
21065    #[serde(skip_serializing_if = "Option::is_none")]
21066    pub filters:
21067        Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
21068    /// The list of permissions to request.
21069    /// If this parameter is passed, the `payment_method` permission must be included.
21070    /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
21071    #[serde(skip_serializing_if = "Option::is_none")]
21072    pub permissions: Option<
21073        Vec<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
21074    >,
21075    /// List of data features that you would like to retrieve upon account creation.
21076    #[serde(skip_serializing_if = "Option::is_none")]
21077    pub prefetch: Option<
21078        Vec<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>,
21079    >,
21080    /// For webview integrations only.
21081    /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.
21082    #[serde(skip_serializing_if = "Option::is_none")]
21083    pub return_url: Option<String>,
21084}
21085impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
21086    pub fn new() -> Self {
21087        Self { filters: None, permissions: None, prefetch: None, return_url: None }
21088    }
21089}
21090impl Default for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
21091    fn default() -> Self {
21092        Self::new()
21093    }
21094}
21095/// Provide filters for the linked accounts that the customer can select for the payment method.
21096#[derive(Clone, Debug, serde::Serialize)]
21097pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
21098        /// The account subcategories to use to filter for selectable accounts.
21099    /// Valid subcategories are `checking` and `savings`.
21100#[serde(skip_serializing_if = "Option::is_none")]
21101pub account_subcategories: Option<Vec<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
21102
21103}
21104impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
21105    pub fn new() -> Self {
21106        Self { account_subcategories: None }
21107    }
21108}
21109impl Default for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
21110    fn default() -> Self {
21111        Self::new()
21112    }
21113}
21114/// The account subcategories to use to filter for selectable accounts.
21115/// Valid subcategories are `checking` and `savings`.
21116#[derive(Copy, Clone, Eq, PartialEq)]
21117pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
21118{
21119    Checking,
21120    Savings,
21121}
21122impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
21123    pub fn as_str(self) -> &'static str {
21124        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
21125        match self {
21126Checking => "checking",
21127Savings => "savings",
21128
21129        }
21130    }
21131}
21132
21133impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
21134    type Err = stripe_types::StripeParseError;
21135    fn from_str(s: &str) -> Result<Self, Self::Err> {
21136        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
21137        match s {
21138    "checking" => Ok(Checking),
21139"savings" => Ok(Savings),
21140_ => Err(stripe_types::StripeParseError)
21141
21142        }
21143    }
21144}
21145impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
21146    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21147        f.write_str(self.as_str())
21148    }
21149}
21150
21151impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
21152    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21153        f.write_str(self.as_str())
21154    }
21155}
21156impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
21157    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
21158        serializer.serialize_str(self.as_str())
21159    }
21160}
21161#[cfg(feature = "deserialize")]
21162impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
21163    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21164        use std::str::FromStr;
21165        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21166        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"))
21167    }
21168}
21169/// The list of permissions to request.
21170/// If this parameter is passed, the `payment_method` permission must be included.
21171/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
21172#[derive(Copy, Clone, Eq, PartialEq)]
21173pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
21174    Balances,
21175    Ownership,
21176    PaymentMethod,
21177    Transactions,
21178}
21179impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
21180    pub fn as_str(self) -> &'static str {
21181        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
21182        match self {
21183            Balances => "balances",
21184            Ownership => "ownership",
21185            PaymentMethod => "payment_method",
21186            Transactions => "transactions",
21187        }
21188    }
21189}
21190
21191impl std::str::FromStr
21192    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
21193{
21194    type Err = stripe_types::StripeParseError;
21195    fn from_str(s: &str) -> Result<Self, Self::Err> {
21196        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
21197        match s {
21198            "balances" => Ok(Balances),
21199            "ownership" => Ok(Ownership),
21200            "payment_method" => Ok(PaymentMethod),
21201            "transactions" => Ok(Transactions),
21202            _ => Err(stripe_types::StripeParseError),
21203        }
21204    }
21205}
21206impl std::fmt::Display
21207    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
21208{
21209    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21210        f.write_str(self.as_str())
21211    }
21212}
21213
21214impl std::fmt::Debug
21215    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
21216{
21217    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21218        f.write_str(self.as_str())
21219    }
21220}
21221impl serde::Serialize
21222    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
21223{
21224    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21225    where
21226        S: serde::Serializer,
21227    {
21228        serializer.serialize_str(self.as_str())
21229    }
21230}
21231#[cfg(feature = "deserialize")]
21232impl<'de> serde::Deserialize<'de>
21233    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
21234{
21235    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21236        use std::str::FromStr;
21237        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21238        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"))
21239    }
21240}
21241/// List of data features that you would like to retrieve upon account creation.
21242#[derive(Copy, Clone, Eq, PartialEq)]
21243pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
21244    Balances,
21245    Ownership,
21246    Transactions,
21247}
21248impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
21249    pub fn as_str(self) -> &'static str {
21250        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
21251        match self {
21252            Balances => "balances",
21253            Ownership => "ownership",
21254            Transactions => "transactions",
21255        }
21256    }
21257}
21258
21259impl std::str::FromStr
21260    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
21261{
21262    type Err = stripe_types::StripeParseError;
21263    fn from_str(s: &str) -> Result<Self, Self::Err> {
21264        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
21265        match s {
21266            "balances" => Ok(Balances),
21267            "ownership" => Ok(Ownership),
21268            "transactions" => Ok(Transactions),
21269            _ => Err(stripe_types::StripeParseError),
21270        }
21271    }
21272}
21273impl std::fmt::Display
21274    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
21275{
21276    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21277        f.write_str(self.as_str())
21278    }
21279}
21280
21281impl std::fmt::Debug
21282    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
21283{
21284    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21285        f.write_str(self.as_str())
21286    }
21287}
21288impl serde::Serialize
21289    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
21290{
21291    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21292    where
21293        S: serde::Serializer,
21294    {
21295        serializer.serialize_str(self.as_str())
21296    }
21297}
21298#[cfg(feature = "deserialize")]
21299impl<'de> serde::Deserialize<'de>
21300    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
21301{
21302    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21303        use std::str::FromStr;
21304        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21305        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"))
21306    }
21307}
21308/// Additional fields for Mandate creation
21309#[derive(Copy, Clone, Debug, serde::Serialize)]
21310pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
21311    /// The method used to collect offline mandate customer acceptance.
21312    #[serde(skip_serializing_if = "Option::is_none")]
21313    pub collection_method:
21314        Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
21315}
21316impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
21317    pub fn new() -> Self {
21318        Self { collection_method: None }
21319    }
21320}
21321impl Default for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
21322    fn default() -> Self {
21323        Self::new()
21324    }
21325}
21326/// The method used to collect offline mandate customer acceptance.
21327#[derive(Copy, Clone, Eq, PartialEq)]
21328pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
21329    Paper,
21330}
21331impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
21332    pub fn as_str(self) -> &'static str {
21333        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
21334        match self {
21335            Paper => "paper",
21336        }
21337    }
21338}
21339
21340impl std::str::FromStr
21341    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
21342{
21343    type Err = stripe_types::StripeParseError;
21344    fn from_str(s: &str) -> Result<Self, Self::Err> {
21345        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
21346        match s {
21347            "paper" => Ok(Paper),
21348            _ => Err(stripe_types::StripeParseError),
21349        }
21350    }
21351}
21352impl std::fmt::Display
21353    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
21354{
21355    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21356        f.write_str(self.as_str())
21357    }
21358}
21359
21360impl std::fmt::Debug
21361    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
21362{
21363    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21364        f.write_str(self.as_str())
21365    }
21366}
21367impl serde::Serialize
21368    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
21369{
21370    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21371    where
21372        S: serde::Serializer,
21373    {
21374        serializer.serialize_str(self.as_str())
21375    }
21376}
21377#[cfg(feature = "deserialize")]
21378impl<'de> serde::Deserialize<'de>
21379    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
21380{
21381    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21382        use std::str::FromStr;
21383        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21384        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"))
21385    }
21386}
21387/// Additional fields for network related functions
21388#[derive(Clone, Debug, serde::Serialize)]
21389pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
21390    /// Triggers validations to run across the selected networks
21391    #[serde(skip_serializing_if = "Option::is_none")]
21392    pub requested:
21393        Option<Vec<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
21394}
21395impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
21396    pub fn new() -> Self {
21397        Self { requested: None }
21398    }
21399}
21400impl Default for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
21401    fn default() -> Self {
21402        Self::new()
21403    }
21404}
21405/// Triggers validations to run across the selected networks
21406#[derive(Copy, Clone, Eq, PartialEq)]
21407pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
21408    Ach,
21409    UsDomesticWire,
21410}
21411impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
21412    pub fn as_str(self) -> &'static str {
21413        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
21414        match self {
21415            Ach => "ach",
21416            UsDomesticWire => "us_domestic_wire",
21417        }
21418    }
21419}
21420
21421impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
21422    type Err = stripe_types::StripeParseError;
21423    fn from_str(s: &str) -> Result<Self, Self::Err> {
21424        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
21425        match s {
21426            "ach" => Ok(Ach),
21427            "us_domestic_wire" => Ok(UsDomesticWire),
21428            _ => Err(stripe_types::StripeParseError),
21429        }
21430    }
21431}
21432impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
21433    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21434        f.write_str(self.as_str())
21435    }
21436}
21437
21438impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
21439    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21440        f.write_str(self.as_str())
21441    }
21442}
21443impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
21444    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21445    where
21446        S: serde::Serializer,
21447    {
21448        serializer.serialize_str(self.as_str())
21449    }
21450}
21451#[cfg(feature = "deserialize")]
21452impl<'de> serde::Deserialize<'de>
21453    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested
21454{
21455    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21456        use std::str::FromStr;
21457        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21458        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested"))
21459    }
21460}
21461/// Preferred transaction settlement speed
21462#[derive(Copy, Clone, Eq, PartialEq)]
21463pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed {
21464    Fastest,
21465    Standard,
21466}
21467impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed {
21468    pub fn as_str(self) -> &'static str {
21469        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*;
21470        match self {
21471            Fastest => "fastest",
21472            Standard => "standard",
21473        }
21474    }
21475}
21476
21477impl std::str::FromStr
21478    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
21479{
21480    type Err = stripe_types::StripeParseError;
21481    fn from_str(s: &str) -> Result<Self, Self::Err> {
21482        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*;
21483        match s {
21484            "fastest" => Ok(Fastest),
21485            "standard" => Ok(Standard),
21486            _ => Err(stripe_types::StripeParseError),
21487        }
21488    }
21489}
21490impl std::fmt::Display
21491    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
21492{
21493    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21494        f.write_str(self.as_str())
21495    }
21496}
21497
21498impl std::fmt::Debug
21499    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
21500{
21501    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21502        f.write_str(self.as_str())
21503    }
21504}
21505impl serde::Serialize
21506    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
21507{
21508    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21509    where
21510        S: serde::Serializer,
21511    {
21512        serializer.serialize_str(self.as_str())
21513    }
21514}
21515#[cfg(feature = "deserialize")]
21516impl<'de> serde::Deserialize<'de>
21517    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
21518{
21519    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21520        use std::str::FromStr;
21521        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21522        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed"))
21523    }
21524}
21525/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21526///
21527/// 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.
21528/// 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.
21529///
21530/// 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.
21531///
21532/// 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).
21533///
21534/// 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`.
21535#[derive(Copy, Clone, Eq, PartialEq)]
21536pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
21537    None,
21538    OffSession,
21539    OnSession,
21540}
21541impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
21542    pub fn as_str(self) -> &'static str {
21543        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*;
21544        match self {
21545            None => "none",
21546            OffSession => "off_session",
21547            OnSession => "on_session",
21548        }
21549    }
21550}
21551
21552impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
21553    type Err = stripe_types::StripeParseError;
21554    fn from_str(s: &str) -> Result<Self, Self::Err> {
21555        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*;
21556        match s {
21557            "none" => Ok(None),
21558            "off_session" => Ok(OffSession),
21559            "on_session" => Ok(OnSession),
21560            _ => Err(stripe_types::StripeParseError),
21561        }
21562    }
21563}
21564impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
21565    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21566        f.write_str(self.as_str())
21567    }
21568}
21569
21570impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
21571    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21572        f.write_str(self.as_str())
21573    }
21574}
21575impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
21576    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21577    where
21578        S: serde::Serializer,
21579    {
21580        serializer.serialize_str(self.as_str())
21581    }
21582}
21583#[cfg(feature = "deserialize")]
21584impl<'de> serde::Deserialize<'de>
21585    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage
21586{
21587    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21588        use std::str::FromStr;
21589        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21590        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage"))
21591    }
21592}
21593/// Bank account verification method.
21594#[derive(Copy, Clone, Eq, PartialEq)]
21595pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
21596    Automatic,
21597    Instant,
21598    Microdeposits,
21599}
21600impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
21601    pub fn as_str(self) -> &'static str {
21602        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
21603        match self {
21604            Automatic => "automatic",
21605            Instant => "instant",
21606            Microdeposits => "microdeposits",
21607        }
21608    }
21609}
21610
21611impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
21612    type Err = stripe_types::StripeParseError;
21613    fn from_str(s: &str) -> Result<Self, Self::Err> {
21614        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
21615        match s {
21616            "automatic" => Ok(Automatic),
21617            "instant" => Ok(Instant),
21618            "microdeposits" => Ok(Microdeposits),
21619            _ => Err(stripe_types::StripeParseError),
21620        }
21621    }
21622}
21623impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
21624    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21625        f.write_str(self.as_str())
21626    }
21627}
21628
21629impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
21630    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21631        f.write_str(self.as_str())
21632    }
21633}
21634impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
21635    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21636    where
21637        S: serde::Serializer,
21638    {
21639        serializer.serialize_str(self.as_str())
21640    }
21641}
21642#[cfg(feature = "deserialize")]
21643impl<'de> serde::Deserialize<'de>
21644    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod
21645{
21646    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21647        use std::str::FromStr;
21648        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21649        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod"))
21650    }
21651}
21652/// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options.
21653#[derive(Clone, Debug, serde::Serialize)]
21654pub struct UpdatePaymentIntentPaymentMethodOptionsWechatPay {
21655    /// The app ID registered with WeChat Pay. Only required when client is ios or android.
21656    #[serde(skip_serializing_if = "Option::is_none")]
21657    pub app_id: Option<String>,
21658    /// The client type that the end customer will pay from
21659    #[serde(skip_serializing_if = "Option::is_none")]
21660    pub client: Option<UpdatePaymentIntentPaymentMethodOptionsWechatPayClient>,
21661    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21662    ///
21663    /// 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.
21664    /// 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.
21665    ///
21666    /// 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.
21667    ///
21668    /// 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).
21669    ///
21670    /// 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`.
21671    #[serde(skip_serializing_if = "Option::is_none")]
21672    pub setup_future_usage:
21673        Option<UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage>,
21674}
21675impl UpdatePaymentIntentPaymentMethodOptionsWechatPay {
21676    pub fn new() -> Self {
21677        Self { app_id: None, client: None, setup_future_usage: None }
21678    }
21679}
21680impl Default for UpdatePaymentIntentPaymentMethodOptionsWechatPay {
21681    fn default() -> Self {
21682        Self::new()
21683    }
21684}
21685/// The client type that the end customer will pay from
21686#[derive(Copy, Clone, Eq, PartialEq)]
21687pub enum UpdatePaymentIntentPaymentMethodOptionsWechatPayClient {
21688    Android,
21689    Ios,
21690    Web,
21691}
21692impl UpdatePaymentIntentPaymentMethodOptionsWechatPayClient {
21693    pub fn as_str(self) -> &'static str {
21694        use UpdatePaymentIntentPaymentMethodOptionsWechatPayClient::*;
21695        match self {
21696            Android => "android",
21697            Ios => "ios",
21698            Web => "web",
21699        }
21700    }
21701}
21702
21703impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient {
21704    type Err = stripe_types::StripeParseError;
21705    fn from_str(s: &str) -> Result<Self, Self::Err> {
21706        use UpdatePaymentIntentPaymentMethodOptionsWechatPayClient::*;
21707        match s {
21708            "android" => Ok(Android),
21709            "ios" => Ok(Ios),
21710            "web" => Ok(Web),
21711            _ => Err(stripe_types::StripeParseError),
21712        }
21713    }
21714}
21715impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient {
21716    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21717        f.write_str(self.as_str())
21718    }
21719}
21720
21721impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient {
21722    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21723        f.write_str(self.as_str())
21724    }
21725}
21726impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient {
21727    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21728    where
21729        S: serde::Serializer,
21730    {
21731        serializer.serialize_str(self.as_str())
21732    }
21733}
21734#[cfg(feature = "deserialize")]
21735impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient {
21736    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21737        use std::str::FromStr;
21738        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21739        Self::from_str(&s).map_err(|_| {
21740            serde::de::Error::custom(
21741                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient",
21742            )
21743        })
21744    }
21745}
21746/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21747///
21748/// 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.
21749/// 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.
21750///
21751/// 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.
21752///
21753/// 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).
21754///
21755/// 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`.
21756#[derive(Copy, Clone, Eq, PartialEq)]
21757pub enum UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
21758    None,
21759}
21760impl UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
21761    pub fn as_str(self) -> &'static str {
21762        use UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*;
21763        match self {
21764            None => "none",
21765        }
21766    }
21767}
21768
21769impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
21770    type Err = stripe_types::StripeParseError;
21771    fn from_str(s: &str) -> Result<Self, Self::Err> {
21772        use UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*;
21773        match s {
21774            "none" => Ok(None),
21775            _ => Err(stripe_types::StripeParseError),
21776        }
21777    }
21778}
21779impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
21780    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21781        f.write_str(self.as_str())
21782    }
21783}
21784
21785impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
21786    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21787        f.write_str(self.as_str())
21788    }
21789}
21790impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
21791    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21792    where
21793        S: serde::Serializer,
21794    {
21795        serializer.serialize_str(self.as_str())
21796    }
21797}
21798#[cfg(feature = "deserialize")]
21799impl<'de> serde::Deserialize<'de>
21800    for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage
21801{
21802    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21803        use std::str::FromStr;
21804        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21805        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage"))
21806    }
21807}
21808/// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options.
21809#[derive(Copy, Clone, Debug, serde::Serialize)]
21810pub struct UpdatePaymentIntentPaymentMethodOptionsZip {
21811    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21812    ///
21813    /// 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.
21814    /// 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.
21815    ///
21816    /// 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.
21817    ///
21818    /// 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).
21819    ///
21820    /// 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`.
21821    #[serde(skip_serializing_if = "Option::is_none")]
21822    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage>,
21823}
21824impl UpdatePaymentIntentPaymentMethodOptionsZip {
21825    pub fn new() -> Self {
21826        Self { setup_future_usage: None }
21827    }
21828}
21829impl Default for UpdatePaymentIntentPaymentMethodOptionsZip {
21830    fn default() -> Self {
21831        Self::new()
21832    }
21833}
21834/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21835///
21836/// 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.
21837/// 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.
21838///
21839/// 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.
21840///
21841/// 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).
21842///
21843/// 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`.
21844#[derive(Copy, Clone, Eq, PartialEq)]
21845pub enum UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
21846    None,
21847}
21848impl UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
21849    pub fn as_str(self) -> &'static str {
21850        use UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*;
21851        match self {
21852            None => "none",
21853        }
21854    }
21855}
21856
21857impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
21858    type Err = stripe_types::StripeParseError;
21859    fn from_str(s: &str) -> Result<Self, Self::Err> {
21860        use UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*;
21861        match s {
21862            "none" => Ok(None),
21863            _ => Err(stripe_types::StripeParseError),
21864        }
21865    }
21866}
21867impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
21868    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21869        f.write_str(self.as_str())
21870    }
21871}
21872
21873impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
21874    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21875        f.write_str(self.as_str())
21876    }
21877}
21878impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
21879    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21880    where
21881        S: serde::Serializer,
21882    {
21883        serializer.serialize_str(self.as_str())
21884    }
21885}
21886#[cfg(feature = "deserialize")]
21887impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
21888    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21889        use std::str::FromStr;
21890        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21891        Self::from_str(&s).map_err(|_| {
21892            serde::de::Error::custom(
21893                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage",
21894            )
21895        })
21896    }
21897}
21898/// Shipping information for this PaymentIntent.
21899#[derive(Clone, Debug, serde::Serialize)]
21900pub struct UpdatePaymentIntentShipping {
21901    /// Shipping address.
21902    pub address: UpdatePaymentIntentShippingAddress,
21903    /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
21904    #[serde(skip_serializing_if = "Option::is_none")]
21905    pub carrier: Option<String>,
21906    /// Recipient name.
21907    pub name: String,
21908    /// Recipient phone (including extension).
21909    #[serde(skip_serializing_if = "Option::is_none")]
21910    pub phone: Option<String>,
21911    /// The tracking number for a physical product, obtained from the delivery service.
21912    /// If multiple tracking numbers were generated for this purchase, please separate them with commas.
21913    #[serde(skip_serializing_if = "Option::is_none")]
21914    pub tracking_number: Option<String>,
21915}
21916impl UpdatePaymentIntentShipping {
21917    pub fn new(
21918        address: impl Into<UpdatePaymentIntentShippingAddress>,
21919        name: impl Into<String>,
21920    ) -> Self {
21921        Self {
21922            address: address.into(),
21923            carrier: None,
21924            name: name.into(),
21925            phone: None,
21926            tracking_number: None,
21927        }
21928    }
21929}
21930/// Shipping address.
21931#[derive(Clone, Debug, serde::Serialize)]
21932pub struct UpdatePaymentIntentShippingAddress {
21933    /// City, district, suburb, town, or village.
21934    #[serde(skip_serializing_if = "Option::is_none")]
21935    pub city: Option<String>,
21936    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
21937    #[serde(skip_serializing_if = "Option::is_none")]
21938    pub country: Option<String>,
21939    /// Address line 1, such as the street, PO Box, or company name.
21940    #[serde(skip_serializing_if = "Option::is_none")]
21941    pub line1: Option<String>,
21942    /// Address line 2, such as the apartment, suite, unit, or building.
21943    #[serde(skip_serializing_if = "Option::is_none")]
21944    pub line2: Option<String>,
21945    /// ZIP or postal code.
21946    #[serde(skip_serializing_if = "Option::is_none")]
21947    pub postal_code: Option<String>,
21948    /// State, county, province, or region.
21949    #[serde(skip_serializing_if = "Option::is_none")]
21950    pub state: Option<String>,
21951}
21952impl UpdatePaymentIntentShippingAddress {
21953    pub fn new() -> Self {
21954        Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
21955    }
21956}
21957impl Default for UpdatePaymentIntentShippingAddress {
21958    fn default() -> Self {
21959        Self::new()
21960    }
21961}
21962/// Use this parameter to automatically create a Transfer when the payment succeeds.
21963/// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
21964#[derive(Copy, Clone, Debug, serde::Serialize)]
21965pub struct UpdatePaymentIntentTransferData {
21966    /// The amount that will be transferred automatically when a charge succeeds.
21967    #[serde(skip_serializing_if = "Option::is_none")]
21968    pub amount: Option<i64>,
21969}
21970impl UpdatePaymentIntentTransferData {
21971    pub fn new() -> Self {
21972        Self { amount: None }
21973    }
21974}
21975impl Default for UpdatePaymentIntentTransferData {
21976    fn default() -> Self {
21977        Self::new()
21978    }
21979}
21980/// Updates properties on a PaymentIntent object without confirming.
21981///
21982/// Depending on which properties you update, you might need to confirm the
21983/// PaymentIntent again. For example, updating the `payment_method`
21984/// always requires you to confirm the PaymentIntent again. If you prefer to
21985/// update and confirm at the same time, we recommend updating properties through
21986/// the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) instead.
21987#[derive(Clone, Debug, serde::Serialize)]
21988pub struct UpdatePaymentIntent {
21989    inner: UpdatePaymentIntentBuilder,
21990    intent: stripe_shared::PaymentIntentId,
21991}
21992impl UpdatePaymentIntent {
21993    /// Construct a new `UpdatePaymentIntent`.
21994    pub fn new(intent: impl Into<stripe_shared::PaymentIntentId>) -> Self {
21995        Self { intent: intent.into(), inner: UpdatePaymentIntentBuilder::new() }
21996    }
21997    /// Amount intended to be collected by this PaymentIntent.
21998    /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency).
21999    /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts).
22000    /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
22001    pub fn amount(mut self, amount: impl Into<i64>) -> Self {
22002        self.inner.amount = Some(amount.into());
22003        self
22004    }
22005    /// 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.
22006    /// The amount of the application fee collected will be capped at the total amount captured.
22007    /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
22008    pub fn application_fee_amount(mut self, application_fee_amount: impl Into<i64>) -> Self {
22009        self.inner.application_fee_amount = Some(application_fee_amount.into());
22010        self
22011    }
22012    /// Controls when the funds will be captured from the customer's account.
22013    pub fn capture_method(
22014        mut self,
22015        capture_method: impl Into<stripe_shared::PaymentIntentCaptureMethod>,
22016    ) -> Self {
22017        self.inner.capture_method = Some(capture_method.into());
22018        self
22019    }
22020    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
22021    /// Must be a [supported currency](https://stripe.com/docs/currencies).
22022    pub fn currency(mut self, currency: impl Into<stripe_types::Currency>) -> Self {
22023        self.inner.currency = Some(currency.into());
22024        self
22025    }
22026    /// ID of the Customer this PaymentIntent belongs to, if one exists.
22027    ///
22028    /// Payment methods attached to other Customers cannot be used with this PaymentIntent.
22029    ///
22030    /// If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete.
22031    /// If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead.
22032    pub fn customer(mut self, customer: impl Into<String>) -> Self {
22033        self.inner.customer = Some(customer.into());
22034        self
22035    }
22036    /// An arbitrary string attached to the object. Often useful for displaying to users.
22037    pub fn description(mut self, description: impl Into<String>) -> Self {
22038        self.inner.description = Some(description.into());
22039        self
22040    }
22041    /// The list of payment method types to exclude from use with this payment.
22042    pub fn excluded_payment_method_types(
22043        mut self,
22044        excluded_payment_method_types: impl Into<
22045            Vec<stripe_shared::PaymentIntentExcludedPaymentMethodTypes>,
22046        >,
22047    ) -> Self {
22048        self.inner.excluded_payment_method_types = Some(excluded_payment_method_types.into());
22049        self
22050    }
22051    /// Specifies which fields in the response should be expanded.
22052    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
22053        self.inner.expand = Some(expand.into());
22054        self
22055    }
22056    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
22057    /// This can be useful for storing additional information about the object in a structured format.
22058    /// Individual keys can be unset by posting an empty value to them.
22059    /// All keys can be unset by posting an empty value to `metadata`.
22060    pub fn metadata(
22061        mut self,
22062        metadata: impl Into<std::collections::HashMap<String, String>>,
22063    ) -> Self {
22064        self.inner.metadata = Some(metadata.into());
22065        self
22066    }
22067    /// ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent.
22068    /// To unset this field to null, pass in an empty string.
22069    pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
22070        self.inner.payment_method = Some(payment_method.into());
22071        self
22072    }
22073    /// The ID of the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) to use with this PaymentIntent.
22074    pub fn payment_method_configuration(
22075        mut self,
22076        payment_method_configuration: impl Into<String>,
22077    ) -> Self {
22078        self.inner.payment_method_configuration = Some(payment_method_configuration.into());
22079        self
22080    }
22081    /// If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear
22082    /// in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method).
22083    /// property on the PaymentIntent.
22084    pub fn payment_method_data(
22085        mut self,
22086        payment_method_data: impl Into<UpdatePaymentIntentPaymentMethodData>,
22087    ) -> Self {
22088        self.inner.payment_method_data = Some(payment_method_data.into());
22089        self
22090    }
22091    /// Payment-method-specific configuration for this PaymentIntent.
22092    pub fn payment_method_options(
22093        mut self,
22094        payment_method_options: impl Into<UpdatePaymentIntentPaymentMethodOptions>,
22095    ) -> Self {
22096        self.inner.payment_method_options = Some(payment_method_options.into());
22097        self
22098    }
22099    /// The list of payment method types (for example, card) that this PaymentIntent can use.
22100    /// Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods).
22101    /// A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type).
22102    pub fn payment_method_types(mut self, payment_method_types: impl Into<Vec<String>>) -> Self {
22103        self.inner.payment_method_types = Some(payment_method_types.into());
22104        self
22105    }
22106    /// Email address that the receipt for the resulting payment will be sent to.
22107    /// 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).
22108    pub fn receipt_email(mut self, receipt_email: impl Into<String>) -> Self {
22109        self.inner.receipt_email = Some(receipt_email.into());
22110        self
22111    }
22112    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
22113    ///
22114    /// 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.
22115    /// 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.
22116    ///
22117    /// 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.
22118    ///
22119    /// 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).
22120    ///
22121    /// 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`.
22122    pub fn setup_future_usage(
22123        mut self,
22124        setup_future_usage: impl Into<stripe_shared::PaymentIntentSetupFutureUsage>,
22125    ) -> Self {
22126        self.inner.setup_future_usage = Some(setup_future_usage.into());
22127        self
22128    }
22129    /// Shipping information for this PaymentIntent.
22130    pub fn shipping(mut self, shipping: impl Into<UpdatePaymentIntentShipping>) -> Self {
22131        self.inner.shipping = Some(shipping.into());
22132        self
22133    }
22134    /// Text that appears on the customer's statement as the statement descriptor for a non-card charge.
22135    /// This value overrides the account's default statement descriptor.
22136    /// For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors).
22137    ///
22138    /// Setting this value for a card charge returns an error.
22139    /// For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead.
22140    pub fn statement_descriptor(mut self, statement_descriptor: impl Into<String>) -> Self {
22141        self.inner.statement_descriptor = Some(statement_descriptor.into());
22142        self
22143    }
22144    /// Provides information about a card charge.
22145    /// 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.
22146    pub fn statement_descriptor_suffix(
22147        mut self,
22148        statement_descriptor_suffix: impl Into<String>,
22149    ) -> Self {
22150        self.inner.statement_descriptor_suffix = Some(statement_descriptor_suffix.into());
22151        self
22152    }
22153    /// Use this parameter to automatically create a Transfer when the payment succeeds.
22154    /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
22155    pub fn transfer_data(
22156        mut self,
22157        transfer_data: impl Into<UpdatePaymentIntentTransferData>,
22158    ) -> Self {
22159        self.inner.transfer_data = Some(transfer_data.into());
22160        self
22161    }
22162    /// A string that identifies the resulting payment as part of a group.
22163    /// You can only provide `transfer_group` if it hasn't been set.
22164    /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
22165    pub fn transfer_group(mut self, transfer_group: impl Into<String>) -> Self {
22166        self.inner.transfer_group = Some(transfer_group.into());
22167        self
22168    }
22169}
22170impl UpdatePaymentIntent {
22171    /// Send the request and return the deserialized response.
22172    pub async fn send<C: StripeClient>(
22173        &self,
22174        client: &C,
22175    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
22176        self.customize().send(client).await
22177    }
22178
22179    /// Send the request and return the deserialized response, blocking until completion.
22180    pub fn send_blocking<C: StripeBlockingClient>(
22181        &self,
22182        client: &C,
22183    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
22184        self.customize().send_blocking(client)
22185    }
22186}
22187
22188impl StripeRequest for UpdatePaymentIntent {
22189    type Output = stripe_shared::PaymentIntent;
22190
22191    fn build(&self) -> RequestBuilder {
22192        let intent = &self.intent;
22193        RequestBuilder::new(StripeMethod::Post, format!("/payment_intents/{intent}"))
22194            .form(&self.inner)
22195    }
22196}
22197#[derive(Clone, Debug, serde::Serialize)]
22198struct ApplyCustomerBalancePaymentIntentBuilder {
22199    #[serde(skip_serializing_if = "Option::is_none")]
22200    amount: Option<i64>,
22201    #[serde(skip_serializing_if = "Option::is_none")]
22202    currency: Option<stripe_types::Currency>,
22203    #[serde(skip_serializing_if = "Option::is_none")]
22204    expand: Option<Vec<String>>,
22205}
22206impl ApplyCustomerBalancePaymentIntentBuilder {
22207    fn new() -> Self {
22208        Self { amount: None, currency: None, expand: None }
22209    }
22210}
22211/// Manually reconcile the remaining amount for a `customer_balance` PaymentIntent.
22212#[derive(Clone, Debug, serde::Serialize)]
22213pub struct ApplyCustomerBalancePaymentIntent {
22214    inner: ApplyCustomerBalancePaymentIntentBuilder,
22215    intent: stripe_shared::PaymentIntentId,
22216}
22217impl ApplyCustomerBalancePaymentIntent {
22218    /// Construct a new `ApplyCustomerBalancePaymentIntent`.
22219    pub fn new(intent: impl Into<stripe_shared::PaymentIntentId>) -> Self {
22220        Self { intent: intent.into(), inner: ApplyCustomerBalancePaymentIntentBuilder::new() }
22221    }
22222    /// Amount that you intend to apply to this PaymentIntent from the customer’s cash balance.
22223    /// If the PaymentIntent was created by an Invoice, the full amount of the PaymentIntent is applied regardless of this parameter.
22224    ///
22225    /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (for example, 100 cents to charge 1 USD or 100 to charge 100 JPY, a zero-decimal currency).
22226    /// The maximum amount is the amount of the PaymentIntent.
22227    ///
22228    /// When you omit the amount, it defaults to the remaining amount requested on the PaymentIntent.
22229    pub fn amount(mut self, amount: impl Into<i64>) -> Self {
22230        self.inner.amount = Some(amount.into());
22231        self
22232    }
22233    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
22234    /// Must be a [supported currency](https://stripe.com/docs/currencies).
22235    pub fn currency(mut self, currency: impl Into<stripe_types::Currency>) -> Self {
22236        self.inner.currency = Some(currency.into());
22237        self
22238    }
22239    /// Specifies which fields in the response should be expanded.
22240    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
22241        self.inner.expand = Some(expand.into());
22242        self
22243    }
22244}
22245impl ApplyCustomerBalancePaymentIntent {
22246    /// Send the request and return the deserialized response.
22247    pub async fn send<C: StripeClient>(
22248        &self,
22249        client: &C,
22250    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
22251        self.customize().send(client).await
22252    }
22253
22254    /// Send the request and return the deserialized response, blocking until completion.
22255    pub fn send_blocking<C: StripeBlockingClient>(
22256        &self,
22257        client: &C,
22258    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
22259        self.customize().send_blocking(client)
22260    }
22261}
22262
22263impl StripeRequest for ApplyCustomerBalancePaymentIntent {
22264    type Output = stripe_shared::PaymentIntent;
22265
22266    fn build(&self) -> RequestBuilder {
22267        let intent = &self.intent;
22268        RequestBuilder::new(
22269            StripeMethod::Post,
22270            format!("/payment_intents/{intent}/apply_customer_balance"),
22271        )
22272        .form(&self.inner)
22273    }
22274}
22275#[derive(Clone, Debug, serde::Serialize)]
22276struct CancelPaymentIntentBuilder {
22277    #[serde(skip_serializing_if = "Option::is_none")]
22278    cancellation_reason: Option<CancelPaymentIntentCancellationReason>,
22279    #[serde(skip_serializing_if = "Option::is_none")]
22280    expand: Option<Vec<String>>,
22281}
22282impl CancelPaymentIntentBuilder {
22283    fn new() -> Self {
22284        Self { cancellation_reason: None, expand: None }
22285    }
22286}
22287/// Reason for canceling this PaymentIntent.
22288/// Possible values are: `duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`.
22289#[derive(Copy, Clone, Eq, PartialEq)]
22290pub enum CancelPaymentIntentCancellationReason {
22291    Abandoned,
22292    Duplicate,
22293    Fraudulent,
22294    RequestedByCustomer,
22295}
22296impl CancelPaymentIntentCancellationReason {
22297    pub fn as_str(self) -> &'static str {
22298        use CancelPaymentIntentCancellationReason::*;
22299        match self {
22300            Abandoned => "abandoned",
22301            Duplicate => "duplicate",
22302            Fraudulent => "fraudulent",
22303            RequestedByCustomer => "requested_by_customer",
22304        }
22305    }
22306}
22307
22308impl std::str::FromStr for CancelPaymentIntentCancellationReason {
22309    type Err = stripe_types::StripeParseError;
22310    fn from_str(s: &str) -> Result<Self, Self::Err> {
22311        use CancelPaymentIntentCancellationReason::*;
22312        match s {
22313            "abandoned" => Ok(Abandoned),
22314            "duplicate" => Ok(Duplicate),
22315            "fraudulent" => Ok(Fraudulent),
22316            "requested_by_customer" => Ok(RequestedByCustomer),
22317            _ => Err(stripe_types::StripeParseError),
22318        }
22319    }
22320}
22321impl std::fmt::Display for CancelPaymentIntentCancellationReason {
22322    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22323        f.write_str(self.as_str())
22324    }
22325}
22326
22327impl std::fmt::Debug for CancelPaymentIntentCancellationReason {
22328    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22329        f.write_str(self.as_str())
22330    }
22331}
22332impl serde::Serialize for CancelPaymentIntentCancellationReason {
22333    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
22334    where
22335        S: serde::Serializer,
22336    {
22337        serializer.serialize_str(self.as_str())
22338    }
22339}
22340#[cfg(feature = "deserialize")]
22341impl<'de> serde::Deserialize<'de> for CancelPaymentIntentCancellationReason {
22342    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
22343        use std::str::FromStr;
22344        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
22345        Self::from_str(&s).map_err(|_| {
22346            serde::de::Error::custom("Unknown value for CancelPaymentIntentCancellationReason")
22347        })
22348    }
22349}
22350/// You can cancel a PaymentIntent object when it’s in one of these statuses: `requires_payment_method`, `requires_capture`, `requires_confirmation`, `requires_action` or, [in rare cases](https://stripe.com/docs/payments/intents), `processing`.
22351///
22352///
22353/// After it’s canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error.
22354/// For PaymentIntents with a `status` of `requires_capture`, the remaining `amount_capturable` is automatically refunded.
22355///
22356///
22357/// You can’t cancel the PaymentIntent for a Checkout Session.
22358/// [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead.
22359#[derive(Clone, Debug, serde::Serialize)]
22360pub struct CancelPaymentIntent {
22361    inner: CancelPaymentIntentBuilder,
22362    intent: stripe_shared::PaymentIntentId,
22363}
22364impl CancelPaymentIntent {
22365    /// Construct a new `CancelPaymentIntent`.
22366    pub fn new(intent: impl Into<stripe_shared::PaymentIntentId>) -> Self {
22367        Self { intent: intent.into(), inner: CancelPaymentIntentBuilder::new() }
22368    }
22369    /// Reason for canceling this PaymentIntent.
22370    /// Possible values are: `duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`.
22371    pub fn cancellation_reason(
22372        mut self,
22373        cancellation_reason: impl Into<CancelPaymentIntentCancellationReason>,
22374    ) -> Self {
22375        self.inner.cancellation_reason = Some(cancellation_reason.into());
22376        self
22377    }
22378    /// Specifies which fields in the response should be expanded.
22379    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
22380        self.inner.expand = Some(expand.into());
22381        self
22382    }
22383}
22384impl CancelPaymentIntent {
22385    /// Send the request and return the deserialized response.
22386    pub async fn send<C: StripeClient>(
22387        &self,
22388        client: &C,
22389    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
22390        self.customize().send(client).await
22391    }
22392
22393    /// Send the request and return the deserialized response, blocking until completion.
22394    pub fn send_blocking<C: StripeBlockingClient>(
22395        &self,
22396        client: &C,
22397    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
22398        self.customize().send_blocking(client)
22399    }
22400}
22401
22402impl StripeRequest for CancelPaymentIntent {
22403    type Output = stripe_shared::PaymentIntent;
22404
22405    fn build(&self) -> RequestBuilder {
22406        let intent = &self.intent;
22407        RequestBuilder::new(StripeMethod::Post, format!("/payment_intents/{intent}/cancel"))
22408            .form(&self.inner)
22409    }
22410}
22411#[derive(Clone, Debug, serde::Serialize)]
22412struct CapturePaymentIntentBuilder {
22413    #[serde(skip_serializing_if = "Option::is_none")]
22414    amount_to_capture: Option<i64>,
22415    #[serde(skip_serializing_if = "Option::is_none")]
22416    application_fee_amount: Option<i64>,
22417    #[serde(skip_serializing_if = "Option::is_none")]
22418    expand: Option<Vec<String>>,
22419    #[serde(skip_serializing_if = "Option::is_none")]
22420    final_capture: Option<bool>,
22421    #[serde(skip_serializing_if = "Option::is_none")]
22422    metadata: Option<std::collections::HashMap<String, String>>,
22423    #[serde(skip_serializing_if = "Option::is_none")]
22424    statement_descriptor: Option<String>,
22425    #[serde(skip_serializing_if = "Option::is_none")]
22426    statement_descriptor_suffix: Option<String>,
22427    #[serde(skip_serializing_if = "Option::is_none")]
22428    transfer_data: Option<CapturePaymentIntentTransferData>,
22429}
22430impl CapturePaymentIntentBuilder {
22431    fn new() -> Self {
22432        Self {
22433            amount_to_capture: None,
22434            application_fee_amount: None,
22435            expand: None,
22436            final_capture: None,
22437            metadata: None,
22438            statement_descriptor: None,
22439            statement_descriptor_suffix: None,
22440            transfer_data: None,
22441        }
22442    }
22443}
22444/// The parameters that you can use to automatically create a transfer after the payment
22445/// is captured.
22446/// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
22447#[derive(Copy, Clone, Debug, serde::Serialize)]
22448pub struct CapturePaymentIntentTransferData {
22449    /// The amount that will be transferred automatically when a charge succeeds.
22450    #[serde(skip_serializing_if = "Option::is_none")]
22451    pub amount: Option<i64>,
22452}
22453impl CapturePaymentIntentTransferData {
22454    pub fn new() -> Self {
22455        Self { amount: None }
22456    }
22457}
22458impl Default for CapturePaymentIntentTransferData {
22459    fn default() -> Self {
22460        Self::new()
22461    }
22462}
22463/// Capture the funds of an existing uncaptured PaymentIntent when its status is `requires_capture`.
22464///
22465/// Uncaptured PaymentIntents are cancelled a set number of days (7 by default) after their creation.
22466///
22467/// Learn more about [separate authorization and capture](https://stripe.com/docs/payments/capture-later).
22468#[derive(Clone, Debug, serde::Serialize)]
22469pub struct CapturePaymentIntent {
22470    inner: CapturePaymentIntentBuilder,
22471    intent: stripe_shared::PaymentIntentId,
22472}
22473impl CapturePaymentIntent {
22474    /// Construct a new `CapturePaymentIntent`.
22475    pub fn new(intent: impl Into<stripe_shared::PaymentIntentId>) -> Self {
22476        Self { intent: intent.into(), inner: CapturePaymentIntentBuilder::new() }
22477    }
22478    /// The amount to capture from the PaymentIntent, which must be less than or equal to the original amount.
22479    /// Defaults to the full `amount_capturable` if it's not provided.
22480    pub fn amount_to_capture(mut self, amount_to_capture: impl Into<i64>) -> Self {
22481        self.inner.amount_to_capture = Some(amount_to_capture.into());
22482        self
22483    }
22484    /// 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.
22485    /// The amount of the application fee collected will be capped at the total amount captured.
22486    /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
22487    pub fn application_fee_amount(mut self, application_fee_amount: impl Into<i64>) -> Self {
22488        self.inner.application_fee_amount = Some(application_fee_amount.into());
22489        self
22490    }
22491    /// Specifies which fields in the response should be expanded.
22492    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
22493        self.inner.expand = Some(expand.into());
22494        self
22495    }
22496    /// Defaults to `true`.
22497    /// When capturing a PaymentIntent, setting `final_capture` to `false` notifies Stripe to not release the remaining uncaptured funds to make sure that they're captured in future requests.
22498    /// You can only use this setting when [multicapture](https://stripe.com/docs/payments/multicapture) is available for PaymentIntents.
22499    pub fn final_capture(mut self, final_capture: impl Into<bool>) -> Self {
22500        self.inner.final_capture = Some(final_capture.into());
22501        self
22502    }
22503    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
22504    /// This can be useful for storing additional information about the object in a structured format.
22505    /// Individual keys can be unset by posting an empty value to them.
22506    /// All keys can be unset by posting an empty value to `metadata`.
22507    pub fn metadata(
22508        mut self,
22509        metadata: impl Into<std::collections::HashMap<String, String>>,
22510    ) -> Self {
22511        self.inner.metadata = Some(metadata.into());
22512        self
22513    }
22514    /// Text that appears on the customer's statement as the statement descriptor for a non-card charge.
22515    /// This value overrides the account's default statement descriptor.
22516    /// For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors).
22517    ///
22518    /// Setting this value for a card charge returns an error.
22519    /// For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead.
22520    pub fn statement_descriptor(mut self, statement_descriptor: impl Into<String>) -> Self {
22521        self.inner.statement_descriptor = Some(statement_descriptor.into());
22522        self
22523    }
22524    /// Provides information about a card charge.
22525    /// 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.
22526    pub fn statement_descriptor_suffix(
22527        mut self,
22528        statement_descriptor_suffix: impl Into<String>,
22529    ) -> Self {
22530        self.inner.statement_descriptor_suffix = Some(statement_descriptor_suffix.into());
22531        self
22532    }
22533    /// The parameters that you can use to automatically create a transfer after the payment
22534    /// is captured.
22535    /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
22536    pub fn transfer_data(
22537        mut self,
22538        transfer_data: impl Into<CapturePaymentIntentTransferData>,
22539    ) -> Self {
22540        self.inner.transfer_data = Some(transfer_data.into());
22541        self
22542    }
22543}
22544impl CapturePaymentIntent {
22545    /// Send the request and return the deserialized response.
22546    pub async fn send<C: StripeClient>(
22547        &self,
22548        client: &C,
22549    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
22550        self.customize().send(client).await
22551    }
22552
22553    /// Send the request and return the deserialized response, blocking until completion.
22554    pub fn send_blocking<C: StripeBlockingClient>(
22555        &self,
22556        client: &C,
22557    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
22558        self.customize().send_blocking(client)
22559    }
22560}
22561
22562impl StripeRequest for CapturePaymentIntent {
22563    type Output = stripe_shared::PaymentIntent;
22564
22565    fn build(&self) -> RequestBuilder {
22566        let intent = &self.intent;
22567        RequestBuilder::new(StripeMethod::Post, format!("/payment_intents/{intent}/capture"))
22568            .form(&self.inner)
22569    }
22570}
22571#[derive(Clone, Debug, serde::Serialize)]
22572struct ConfirmPaymentIntentBuilder {
22573    #[serde(skip_serializing_if = "Option::is_none")]
22574    capture_method: Option<stripe_shared::PaymentIntentCaptureMethod>,
22575    #[serde(skip_serializing_if = "Option::is_none")]
22576    confirmation_token: Option<String>,
22577    #[serde(skip_serializing_if = "Option::is_none")]
22578    error_on_requires_action: Option<bool>,
22579    #[serde(skip_serializing_if = "Option::is_none")]
22580    excluded_payment_method_types:
22581        Option<Vec<stripe_shared::PaymentIntentExcludedPaymentMethodTypes>>,
22582    #[serde(skip_serializing_if = "Option::is_none")]
22583    expand: Option<Vec<String>>,
22584    #[serde(skip_serializing_if = "Option::is_none")]
22585    mandate: Option<String>,
22586    #[serde(skip_serializing_if = "Option::is_none")]
22587    mandate_data: Option<ConfirmPaymentIntentMandateData>,
22588    #[serde(skip_serializing_if = "Option::is_none")]
22589    off_session: Option<ConfirmPaymentIntentOffSession>,
22590    #[serde(skip_serializing_if = "Option::is_none")]
22591    payment_method: Option<String>,
22592    #[serde(skip_serializing_if = "Option::is_none")]
22593    payment_method_data: Option<ConfirmPaymentIntentPaymentMethodData>,
22594    #[serde(skip_serializing_if = "Option::is_none")]
22595    payment_method_options: Option<ConfirmPaymentIntentPaymentMethodOptions>,
22596    #[serde(skip_serializing_if = "Option::is_none")]
22597    payment_method_types: Option<Vec<String>>,
22598    #[serde(skip_serializing_if = "Option::is_none")]
22599    radar_options: Option<RadarOptionsWithHiddenOptions>,
22600    #[serde(skip_serializing_if = "Option::is_none")]
22601    receipt_email: Option<String>,
22602    #[serde(skip_serializing_if = "Option::is_none")]
22603    return_url: Option<String>,
22604    #[serde(skip_serializing_if = "Option::is_none")]
22605    setup_future_usage: Option<stripe_shared::PaymentIntentSetupFutureUsage>,
22606    #[serde(skip_serializing_if = "Option::is_none")]
22607    shipping: Option<ConfirmPaymentIntentShipping>,
22608    #[serde(skip_serializing_if = "Option::is_none")]
22609    use_stripe_sdk: Option<bool>,
22610}
22611impl ConfirmPaymentIntentBuilder {
22612    fn new() -> Self {
22613        Self {
22614            capture_method: None,
22615            confirmation_token: None,
22616            error_on_requires_action: None,
22617            excluded_payment_method_types: None,
22618            expand: None,
22619            mandate: None,
22620            mandate_data: None,
22621            off_session: None,
22622            payment_method: None,
22623            payment_method_data: None,
22624            payment_method_options: None,
22625            payment_method_types: None,
22626            radar_options: None,
22627            receipt_email: None,
22628            return_url: None,
22629            setup_future_usage: None,
22630            shipping: None,
22631            use_stripe_sdk: None,
22632        }
22633    }
22634}
22635#[derive(Clone, Debug, serde::Serialize)]
22636#[serde(rename_all = "snake_case")]
22637pub enum ConfirmPaymentIntentMandateData {
22638    #[serde(untagged)]
22639    SecretKeyParam(ConfirmPaymentIntentSecretKeyParam),
22640    #[serde(untagged)]
22641    ClientKeyParam(ConfirmPaymentIntentClientKeyParam),
22642}
22643#[derive(Clone, Debug, serde::Serialize)]
22644pub struct ConfirmPaymentIntentSecretKeyParam {
22645    /// This hash contains details about the customer acceptance of the Mandate.
22646    pub customer_acceptance: ConfirmPaymentIntentSecretKeyParamCustomerAcceptance,
22647}
22648impl ConfirmPaymentIntentSecretKeyParam {
22649    pub fn new(
22650        customer_acceptance: impl Into<ConfirmPaymentIntentSecretKeyParamCustomerAcceptance>,
22651    ) -> Self {
22652        Self { customer_acceptance: customer_acceptance.into() }
22653    }
22654}
22655/// This hash contains details about the customer acceptance of the Mandate.
22656#[derive(Clone, Debug, serde::Serialize)]
22657pub struct ConfirmPaymentIntentSecretKeyParamCustomerAcceptance {
22658    /// The time at which the customer accepted the Mandate.
22659    #[serde(skip_serializing_if = "Option::is_none")]
22660    pub accepted_at: Option<stripe_types::Timestamp>,
22661    /// If this is a Mandate accepted offline, this hash contains details about the offline acceptance.
22662    #[serde(skip_serializing_if = "Option::is_none")]
22663    #[serde(with = "stripe_types::with_serde_json_opt")]
22664    pub offline: Option<miniserde::json::Value>,
22665    /// If this is a Mandate accepted online, this hash contains details about the online acceptance.
22666    #[serde(skip_serializing_if = "Option::is_none")]
22667    pub online: Option<OnlineParam>,
22668    /// The type of customer acceptance information included with the Mandate.
22669    /// One of `online` or `offline`.
22670    #[serde(rename = "type")]
22671    pub type_: ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType,
22672}
22673impl ConfirmPaymentIntentSecretKeyParamCustomerAcceptance {
22674    pub fn new(type_: impl Into<ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType>) -> Self {
22675        Self { accepted_at: None, offline: None, online: None, type_: type_.into() }
22676    }
22677}
22678/// The type of customer acceptance information included with the Mandate.
22679/// One of `online` or `offline`.
22680#[derive(Copy, Clone, Eq, PartialEq)]
22681pub enum ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType {
22682    Offline,
22683    Online,
22684}
22685impl ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType {
22686    pub fn as_str(self) -> &'static str {
22687        use ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType::*;
22688        match self {
22689            Offline => "offline",
22690            Online => "online",
22691        }
22692    }
22693}
22694
22695impl std::str::FromStr for ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType {
22696    type Err = stripe_types::StripeParseError;
22697    fn from_str(s: &str) -> Result<Self, Self::Err> {
22698        use ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType::*;
22699        match s {
22700            "offline" => Ok(Offline),
22701            "online" => Ok(Online),
22702            _ => Err(stripe_types::StripeParseError),
22703        }
22704    }
22705}
22706impl std::fmt::Display for ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType {
22707    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22708        f.write_str(self.as_str())
22709    }
22710}
22711
22712impl std::fmt::Debug for ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType {
22713    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22714        f.write_str(self.as_str())
22715    }
22716}
22717impl serde::Serialize for ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType {
22718    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
22719    where
22720        S: serde::Serializer,
22721    {
22722        serializer.serialize_str(self.as_str())
22723    }
22724}
22725#[cfg(feature = "deserialize")]
22726impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType {
22727    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
22728        use std::str::FromStr;
22729        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
22730        Self::from_str(&s).map_err(|_| {
22731            serde::de::Error::custom(
22732                "Unknown value for ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType",
22733            )
22734        })
22735    }
22736}
22737#[derive(Clone, Debug, serde::Serialize)]
22738pub struct ConfirmPaymentIntentClientKeyParam {
22739    /// This hash contains details about the customer acceptance of the Mandate.
22740    pub customer_acceptance: ConfirmPaymentIntentClientKeyParamCustomerAcceptance,
22741}
22742impl ConfirmPaymentIntentClientKeyParam {
22743    pub fn new(
22744        customer_acceptance: impl Into<ConfirmPaymentIntentClientKeyParamCustomerAcceptance>,
22745    ) -> Self {
22746        Self { customer_acceptance: customer_acceptance.into() }
22747    }
22748}
22749/// This hash contains details about the customer acceptance of the Mandate.
22750#[derive(Clone, Debug, serde::Serialize)]
22751pub struct ConfirmPaymentIntentClientKeyParamCustomerAcceptance {
22752    /// If this is a Mandate accepted online, this hash contains details about the online acceptance.
22753    pub online: ConfirmPaymentIntentClientKeyParamCustomerAcceptanceOnline,
22754    /// The type of customer acceptance information included with the Mandate.
22755    #[serde(rename = "type")]
22756    pub type_: ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType,
22757}
22758impl ConfirmPaymentIntentClientKeyParamCustomerAcceptance {
22759    pub fn new(
22760        online: impl Into<ConfirmPaymentIntentClientKeyParamCustomerAcceptanceOnline>,
22761        type_: impl Into<ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType>,
22762    ) -> Self {
22763        Self { online: online.into(), type_: type_.into() }
22764    }
22765}
22766/// If this is a Mandate accepted online, this hash contains details about the online acceptance.
22767#[derive(Clone, Debug, serde::Serialize)]
22768pub struct ConfirmPaymentIntentClientKeyParamCustomerAcceptanceOnline {
22769    /// The IP address from which the Mandate was accepted by the customer.
22770    #[serde(skip_serializing_if = "Option::is_none")]
22771    pub ip_address: Option<String>,
22772    /// The user agent of the browser from which the Mandate was accepted by the customer.
22773    #[serde(skip_serializing_if = "Option::is_none")]
22774    pub user_agent: Option<String>,
22775}
22776impl ConfirmPaymentIntentClientKeyParamCustomerAcceptanceOnline {
22777    pub fn new() -> Self {
22778        Self { ip_address: None, user_agent: None }
22779    }
22780}
22781impl Default for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceOnline {
22782    fn default() -> Self {
22783        Self::new()
22784    }
22785}
22786/// The type of customer acceptance information included with the Mandate.
22787#[derive(Copy, Clone, Eq, PartialEq)]
22788pub enum ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType {
22789    Online,
22790}
22791impl ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType {
22792    pub fn as_str(self) -> &'static str {
22793        use ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType::*;
22794        match self {
22795            Online => "online",
22796        }
22797    }
22798}
22799
22800impl std::str::FromStr for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType {
22801    type Err = stripe_types::StripeParseError;
22802    fn from_str(s: &str) -> Result<Self, Self::Err> {
22803        use ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType::*;
22804        match s {
22805            "online" => Ok(Online),
22806            _ => Err(stripe_types::StripeParseError),
22807        }
22808    }
22809}
22810impl std::fmt::Display for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType {
22811    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22812        f.write_str(self.as_str())
22813    }
22814}
22815
22816impl std::fmt::Debug for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType {
22817    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22818        f.write_str(self.as_str())
22819    }
22820}
22821impl serde::Serialize for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType {
22822    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
22823    where
22824        S: serde::Serializer,
22825    {
22826        serializer.serialize_str(self.as_str())
22827    }
22828}
22829#[cfg(feature = "deserialize")]
22830impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType {
22831    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
22832        use std::str::FromStr;
22833        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
22834        Self::from_str(&s).map_err(|_| {
22835            serde::de::Error::custom(
22836                "Unknown value for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType",
22837            )
22838        })
22839    }
22840}
22841/// Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate.
22842/// Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards).
22843#[derive(Copy, Clone, Debug, serde::Serialize)]
22844#[serde(rename_all = "snake_case")]
22845pub enum ConfirmPaymentIntentOffSession {
22846    OneOff,
22847    Recurring,
22848    #[serde(untagged)]
22849    Bool(bool),
22850}
22851/// If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear
22852/// in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method).
22853/// property on the PaymentIntent.
22854#[derive(Clone, Debug, serde::Serialize)]
22855pub struct ConfirmPaymentIntentPaymentMethodData {
22856    /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
22857    #[serde(skip_serializing_if = "Option::is_none")]
22858    pub acss_debit: Option<PaymentMethodParam>,
22859    /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
22860    #[serde(skip_serializing_if = "Option::is_none")]
22861    #[serde(with = "stripe_types::with_serde_json_opt")]
22862    pub affirm: Option<miniserde::json::Value>,
22863    /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
22864    #[serde(skip_serializing_if = "Option::is_none")]
22865    #[serde(with = "stripe_types::with_serde_json_opt")]
22866    pub afterpay_clearpay: Option<miniserde::json::Value>,
22867    /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
22868    #[serde(skip_serializing_if = "Option::is_none")]
22869    #[serde(with = "stripe_types::with_serde_json_opt")]
22870    pub alipay: Option<miniserde::json::Value>,
22871    /// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
22872    /// Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow.
22873    /// The field defaults to `unspecified`.
22874    #[serde(skip_serializing_if = "Option::is_none")]
22875    pub allow_redisplay: Option<ConfirmPaymentIntentPaymentMethodDataAllowRedisplay>,
22876    /// If this is a Alma PaymentMethod, this hash contains details about the Alma payment method.
22877    #[serde(skip_serializing_if = "Option::is_none")]
22878    #[serde(with = "stripe_types::with_serde_json_opt")]
22879    pub alma: Option<miniserde::json::Value>,
22880    /// If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method.
22881    #[serde(skip_serializing_if = "Option::is_none")]
22882    #[serde(with = "stripe_types::with_serde_json_opt")]
22883    pub amazon_pay: Option<miniserde::json::Value>,
22884    /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
22885    #[serde(skip_serializing_if = "Option::is_none")]
22886    pub au_becs_debit: Option<ConfirmPaymentIntentPaymentMethodDataAuBecsDebit>,
22887    /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
22888    #[serde(skip_serializing_if = "Option::is_none")]
22889    pub bacs_debit: Option<ConfirmPaymentIntentPaymentMethodDataBacsDebit>,
22890    /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
22891    #[serde(skip_serializing_if = "Option::is_none")]
22892    #[serde(with = "stripe_types::with_serde_json_opt")]
22893    pub bancontact: Option<miniserde::json::Value>,
22894    /// If this is a `billie` PaymentMethod, this hash contains details about the Billie payment method.
22895    #[serde(skip_serializing_if = "Option::is_none")]
22896    #[serde(with = "stripe_types::with_serde_json_opt")]
22897    pub billie: Option<miniserde::json::Value>,
22898    /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
22899    #[serde(skip_serializing_if = "Option::is_none")]
22900    pub billing_details: Option<ConfirmPaymentIntentPaymentMethodDataBillingDetails>,
22901    /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
22902    #[serde(skip_serializing_if = "Option::is_none")]
22903    #[serde(with = "stripe_types::with_serde_json_opt")]
22904    pub blik: Option<miniserde::json::Value>,
22905    /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
22906    #[serde(skip_serializing_if = "Option::is_none")]
22907    pub boleto: Option<ConfirmPaymentIntentPaymentMethodDataBoleto>,
22908    /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
22909    #[serde(skip_serializing_if = "Option::is_none")]
22910    #[serde(with = "stripe_types::with_serde_json_opt")]
22911    pub cashapp: Option<miniserde::json::Value>,
22912    /// If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method.
22913    #[serde(skip_serializing_if = "Option::is_none")]
22914    #[serde(with = "stripe_types::with_serde_json_opt")]
22915    pub crypto: Option<miniserde::json::Value>,
22916    /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
22917    #[serde(skip_serializing_if = "Option::is_none")]
22918    #[serde(with = "stripe_types::with_serde_json_opt")]
22919    pub customer_balance: Option<miniserde::json::Value>,
22920    /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
22921    #[serde(skip_serializing_if = "Option::is_none")]
22922    pub eps: Option<ConfirmPaymentIntentPaymentMethodDataEps>,
22923    /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
22924    #[serde(skip_serializing_if = "Option::is_none")]
22925    pub fpx: Option<ConfirmPaymentIntentPaymentMethodDataFpx>,
22926    /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
22927    #[serde(skip_serializing_if = "Option::is_none")]
22928    #[serde(with = "stripe_types::with_serde_json_opt")]
22929    pub giropay: Option<miniserde::json::Value>,
22930    /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
22931    #[serde(skip_serializing_if = "Option::is_none")]
22932    #[serde(with = "stripe_types::with_serde_json_opt")]
22933    pub grabpay: Option<miniserde::json::Value>,
22934    /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
22935    #[serde(skip_serializing_if = "Option::is_none")]
22936    pub ideal: Option<ConfirmPaymentIntentPaymentMethodDataIdeal>,
22937    /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
22938    #[serde(skip_serializing_if = "Option::is_none")]
22939    #[serde(with = "stripe_types::with_serde_json_opt")]
22940    pub interac_present: Option<miniserde::json::Value>,
22941    /// If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method.
22942    #[serde(skip_serializing_if = "Option::is_none")]
22943    #[serde(with = "stripe_types::with_serde_json_opt")]
22944    pub kakao_pay: Option<miniserde::json::Value>,
22945    /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
22946    #[serde(skip_serializing_if = "Option::is_none")]
22947    pub klarna: Option<ConfirmPaymentIntentPaymentMethodDataKlarna>,
22948    /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
22949    #[serde(skip_serializing_if = "Option::is_none")]
22950    #[serde(with = "stripe_types::with_serde_json_opt")]
22951    pub konbini: Option<miniserde::json::Value>,
22952    /// If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method.
22953    #[serde(skip_serializing_if = "Option::is_none")]
22954    #[serde(with = "stripe_types::with_serde_json_opt")]
22955    pub kr_card: Option<miniserde::json::Value>,
22956    /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
22957    #[serde(skip_serializing_if = "Option::is_none")]
22958    #[serde(with = "stripe_types::with_serde_json_opt")]
22959    pub link: Option<miniserde::json::Value>,
22960    /// If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method.
22961    #[serde(skip_serializing_if = "Option::is_none")]
22962    #[serde(with = "stripe_types::with_serde_json_opt")]
22963    pub mb_way: Option<miniserde::json::Value>,
22964    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
22965    /// This can be useful for storing additional information about the object in a structured format.
22966    /// Individual keys can be unset by posting an empty value to them.
22967    /// All keys can be unset by posting an empty value to `metadata`.
22968    #[serde(skip_serializing_if = "Option::is_none")]
22969    pub metadata: Option<std::collections::HashMap<String, String>>,
22970    /// If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
22971    #[serde(skip_serializing_if = "Option::is_none")]
22972    #[serde(with = "stripe_types::with_serde_json_opt")]
22973    pub mobilepay: Option<miniserde::json::Value>,
22974    /// If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method.
22975    #[serde(skip_serializing_if = "Option::is_none")]
22976    #[serde(with = "stripe_types::with_serde_json_opt")]
22977    pub multibanco: Option<miniserde::json::Value>,
22978    /// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
22979    #[serde(skip_serializing_if = "Option::is_none")]
22980    pub naver_pay: Option<ConfirmPaymentIntentPaymentMethodDataNaverPay>,
22981    /// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
22982    #[serde(skip_serializing_if = "Option::is_none")]
22983    pub nz_bank_account: Option<ConfirmPaymentIntentPaymentMethodDataNzBankAccount>,
22984    /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
22985    #[serde(skip_serializing_if = "Option::is_none")]
22986    #[serde(with = "stripe_types::with_serde_json_opt")]
22987    pub oxxo: Option<miniserde::json::Value>,
22988    /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
22989    #[serde(skip_serializing_if = "Option::is_none")]
22990    pub p24: Option<ConfirmPaymentIntentPaymentMethodDataP24>,
22991    /// If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method.
22992    #[serde(skip_serializing_if = "Option::is_none")]
22993    #[serde(with = "stripe_types::with_serde_json_opt")]
22994    pub pay_by_bank: Option<miniserde::json::Value>,
22995    /// If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method.
22996    #[serde(skip_serializing_if = "Option::is_none")]
22997    #[serde(with = "stripe_types::with_serde_json_opt")]
22998    pub payco: Option<miniserde::json::Value>,
22999    /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
23000    #[serde(skip_serializing_if = "Option::is_none")]
23001    #[serde(with = "stripe_types::with_serde_json_opt")]
23002    pub paynow: Option<miniserde::json::Value>,
23003    /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
23004    #[serde(skip_serializing_if = "Option::is_none")]
23005    #[serde(with = "stripe_types::with_serde_json_opt")]
23006    pub paypal: Option<miniserde::json::Value>,
23007    /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
23008    #[serde(skip_serializing_if = "Option::is_none")]
23009    #[serde(with = "stripe_types::with_serde_json_opt")]
23010    pub pix: Option<miniserde::json::Value>,
23011    /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
23012    #[serde(skip_serializing_if = "Option::is_none")]
23013    #[serde(with = "stripe_types::with_serde_json_opt")]
23014    pub promptpay: Option<miniserde::json::Value>,
23015    /// Options to configure Radar.
23016    /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
23017    #[serde(skip_serializing_if = "Option::is_none")]
23018    pub radar_options: Option<RadarOptionsWithHiddenOptions>,
23019    /// If this is a `revolut_pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
23020    #[serde(skip_serializing_if = "Option::is_none")]
23021    #[serde(with = "stripe_types::with_serde_json_opt")]
23022    pub revolut_pay: Option<miniserde::json::Value>,
23023    /// If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method.
23024    #[serde(skip_serializing_if = "Option::is_none")]
23025    #[serde(with = "stripe_types::with_serde_json_opt")]
23026    pub samsung_pay: Option<miniserde::json::Value>,
23027    /// If this is a `satispay` PaymentMethod, this hash contains details about the Satispay payment method.
23028    #[serde(skip_serializing_if = "Option::is_none")]
23029    #[serde(with = "stripe_types::with_serde_json_opt")]
23030    pub satispay: Option<miniserde::json::Value>,
23031    /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
23032    #[serde(skip_serializing_if = "Option::is_none")]
23033    pub sepa_debit: Option<ConfirmPaymentIntentPaymentMethodDataSepaDebit>,
23034    /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
23035    #[serde(skip_serializing_if = "Option::is_none")]
23036    pub sofort: Option<ConfirmPaymentIntentPaymentMethodDataSofort>,
23037    /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
23038    #[serde(skip_serializing_if = "Option::is_none")]
23039    #[serde(with = "stripe_types::with_serde_json_opt")]
23040    pub swish: Option<miniserde::json::Value>,
23041    /// If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method.
23042    #[serde(skip_serializing_if = "Option::is_none")]
23043    #[serde(with = "stripe_types::with_serde_json_opt")]
23044    pub twint: Option<miniserde::json::Value>,
23045    /// The type of the PaymentMethod.
23046    /// An additional hash is included on the PaymentMethod with a name matching this value.
23047    /// It contains additional information specific to the PaymentMethod type.
23048    #[serde(rename = "type")]
23049    pub type_: ConfirmPaymentIntentPaymentMethodDataType,
23050    /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
23051    #[serde(skip_serializing_if = "Option::is_none")]
23052    pub us_bank_account: Option<ConfirmPaymentIntentPaymentMethodDataUsBankAccount>,
23053    /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
23054    #[serde(skip_serializing_if = "Option::is_none")]
23055    #[serde(with = "stripe_types::with_serde_json_opt")]
23056    pub wechat_pay: Option<miniserde::json::Value>,
23057    /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
23058    #[serde(skip_serializing_if = "Option::is_none")]
23059    #[serde(with = "stripe_types::with_serde_json_opt")]
23060    pub zip: Option<miniserde::json::Value>,
23061}
23062impl ConfirmPaymentIntentPaymentMethodData {
23063    pub fn new(type_: impl Into<ConfirmPaymentIntentPaymentMethodDataType>) -> Self {
23064        Self {
23065            acss_debit: None,
23066            affirm: None,
23067            afterpay_clearpay: None,
23068            alipay: None,
23069            allow_redisplay: None,
23070            alma: None,
23071            amazon_pay: None,
23072            au_becs_debit: None,
23073            bacs_debit: None,
23074            bancontact: None,
23075            billie: None,
23076            billing_details: None,
23077            blik: None,
23078            boleto: None,
23079            cashapp: None,
23080            crypto: None,
23081            customer_balance: None,
23082            eps: None,
23083            fpx: None,
23084            giropay: None,
23085            grabpay: None,
23086            ideal: None,
23087            interac_present: None,
23088            kakao_pay: None,
23089            klarna: None,
23090            konbini: None,
23091            kr_card: None,
23092            link: None,
23093            mb_way: None,
23094            metadata: None,
23095            mobilepay: None,
23096            multibanco: None,
23097            naver_pay: None,
23098            nz_bank_account: None,
23099            oxxo: None,
23100            p24: None,
23101            pay_by_bank: None,
23102            payco: None,
23103            paynow: None,
23104            paypal: None,
23105            pix: None,
23106            promptpay: None,
23107            radar_options: None,
23108            revolut_pay: None,
23109            samsung_pay: None,
23110            satispay: None,
23111            sepa_debit: None,
23112            sofort: None,
23113            swish: None,
23114            twint: None,
23115            type_: type_.into(),
23116            us_bank_account: None,
23117            wechat_pay: None,
23118            zip: None,
23119        }
23120    }
23121}
23122/// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
23123/// Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow.
23124/// The field defaults to `unspecified`.
23125#[derive(Copy, Clone, Eq, PartialEq)]
23126pub enum ConfirmPaymentIntentPaymentMethodDataAllowRedisplay {
23127    Always,
23128    Limited,
23129    Unspecified,
23130}
23131impl ConfirmPaymentIntentPaymentMethodDataAllowRedisplay {
23132    pub fn as_str(self) -> &'static str {
23133        use ConfirmPaymentIntentPaymentMethodDataAllowRedisplay::*;
23134        match self {
23135            Always => "always",
23136            Limited => "limited",
23137            Unspecified => "unspecified",
23138        }
23139    }
23140}
23141
23142impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataAllowRedisplay {
23143    type Err = stripe_types::StripeParseError;
23144    fn from_str(s: &str) -> Result<Self, Self::Err> {
23145        use ConfirmPaymentIntentPaymentMethodDataAllowRedisplay::*;
23146        match s {
23147            "always" => Ok(Always),
23148            "limited" => Ok(Limited),
23149            "unspecified" => Ok(Unspecified),
23150            _ => Err(stripe_types::StripeParseError),
23151        }
23152    }
23153}
23154impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataAllowRedisplay {
23155    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23156        f.write_str(self.as_str())
23157    }
23158}
23159
23160impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataAllowRedisplay {
23161    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23162        f.write_str(self.as_str())
23163    }
23164}
23165impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataAllowRedisplay {
23166    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
23167    where
23168        S: serde::Serializer,
23169    {
23170        serializer.serialize_str(self.as_str())
23171    }
23172}
23173#[cfg(feature = "deserialize")]
23174impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataAllowRedisplay {
23175    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
23176        use std::str::FromStr;
23177        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
23178        Self::from_str(&s).map_err(|_| {
23179            serde::de::Error::custom(
23180                "Unknown value for ConfirmPaymentIntentPaymentMethodDataAllowRedisplay",
23181            )
23182        })
23183    }
23184}
23185/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
23186#[derive(Clone, Debug, serde::Serialize)]
23187pub struct ConfirmPaymentIntentPaymentMethodDataAuBecsDebit {
23188    /// The account number for the bank account.
23189    pub account_number: String,
23190    /// Bank-State-Branch number of the bank account.
23191    pub bsb_number: String,
23192}
23193impl ConfirmPaymentIntentPaymentMethodDataAuBecsDebit {
23194    pub fn new(account_number: impl Into<String>, bsb_number: impl Into<String>) -> Self {
23195        Self { account_number: account_number.into(), bsb_number: bsb_number.into() }
23196    }
23197}
23198/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
23199#[derive(Clone, Debug, serde::Serialize)]
23200pub struct ConfirmPaymentIntentPaymentMethodDataBacsDebit {
23201    /// Account number of the bank account that the funds will be debited from.
23202    #[serde(skip_serializing_if = "Option::is_none")]
23203    pub account_number: Option<String>,
23204    /// Sort code of the bank account. (e.g., `10-20-30`)
23205    #[serde(skip_serializing_if = "Option::is_none")]
23206    pub sort_code: Option<String>,
23207}
23208impl ConfirmPaymentIntentPaymentMethodDataBacsDebit {
23209    pub fn new() -> Self {
23210        Self { account_number: None, sort_code: None }
23211    }
23212}
23213impl Default for ConfirmPaymentIntentPaymentMethodDataBacsDebit {
23214    fn default() -> Self {
23215        Self::new()
23216    }
23217}
23218/// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
23219#[derive(Clone, Debug, serde::Serialize)]
23220pub struct ConfirmPaymentIntentPaymentMethodDataBillingDetails {
23221    /// Billing address.
23222    #[serde(skip_serializing_if = "Option::is_none")]
23223    pub address: Option<ConfirmPaymentIntentPaymentMethodDataBillingDetailsAddress>,
23224    /// Email address.
23225    #[serde(skip_serializing_if = "Option::is_none")]
23226    pub email: Option<String>,
23227    /// Full name.
23228    #[serde(skip_serializing_if = "Option::is_none")]
23229    pub name: Option<String>,
23230    /// Billing phone number (including extension).
23231    #[serde(skip_serializing_if = "Option::is_none")]
23232    pub phone: Option<String>,
23233    /// Taxpayer identification number.
23234    /// Used only for transactions between LATAM buyers and non-LATAM sellers.
23235    #[serde(skip_serializing_if = "Option::is_none")]
23236    pub tax_id: Option<String>,
23237}
23238impl ConfirmPaymentIntentPaymentMethodDataBillingDetails {
23239    pub fn new() -> Self {
23240        Self { address: None, email: None, name: None, phone: None, tax_id: None }
23241    }
23242}
23243impl Default for ConfirmPaymentIntentPaymentMethodDataBillingDetails {
23244    fn default() -> Self {
23245        Self::new()
23246    }
23247}
23248/// Billing address.
23249#[derive(Clone, Debug, serde::Serialize)]
23250pub struct ConfirmPaymentIntentPaymentMethodDataBillingDetailsAddress {
23251    /// City, district, suburb, town, or village.
23252    #[serde(skip_serializing_if = "Option::is_none")]
23253    pub city: Option<String>,
23254    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
23255    #[serde(skip_serializing_if = "Option::is_none")]
23256    pub country: Option<String>,
23257    /// Address line 1, such as the street, PO Box, or company name.
23258    #[serde(skip_serializing_if = "Option::is_none")]
23259    pub line1: Option<String>,
23260    /// Address line 2, such as the apartment, suite, unit, or building.
23261    #[serde(skip_serializing_if = "Option::is_none")]
23262    pub line2: Option<String>,
23263    /// ZIP or postal code.
23264    #[serde(skip_serializing_if = "Option::is_none")]
23265    pub postal_code: Option<String>,
23266    /// State, county, province, or region.
23267    #[serde(skip_serializing_if = "Option::is_none")]
23268    pub state: Option<String>,
23269}
23270impl ConfirmPaymentIntentPaymentMethodDataBillingDetailsAddress {
23271    pub fn new() -> Self {
23272        Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
23273    }
23274}
23275impl Default for ConfirmPaymentIntentPaymentMethodDataBillingDetailsAddress {
23276    fn default() -> Self {
23277        Self::new()
23278    }
23279}
23280/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
23281#[derive(Clone, Debug, serde::Serialize)]
23282pub struct ConfirmPaymentIntentPaymentMethodDataBoleto {
23283    /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)
23284    pub tax_id: String,
23285}
23286impl ConfirmPaymentIntentPaymentMethodDataBoleto {
23287    pub fn new(tax_id: impl Into<String>) -> Self {
23288        Self { tax_id: tax_id.into() }
23289    }
23290}
23291/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
23292#[derive(Clone, Debug, serde::Serialize)]
23293pub struct ConfirmPaymentIntentPaymentMethodDataEps {
23294    /// The customer's bank.
23295    #[serde(skip_serializing_if = "Option::is_none")]
23296    pub bank: Option<ConfirmPaymentIntentPaymentMethodDataEpsBank>,
23297}
23298impl ConfirmPaymentIntentPaymentMethodDataEps {
23299    pub fn new() -> Self {
23300        Self { bank: None }
23301    }
23302}
23303impl Default for ConfirmPaymentIntentPaymentMethodDataEps {
23304    fn default() -> Self {
23305        Self::new()
23306    }
23307}
23308/// The customer's bank.
23309#[derive(Clone, Eq, PartialEq)]
23310#[non_exhaustive]
23311pub enum ConfirmPaymentIntentPaymentMethodDataEpsBank {
23312    ArzteUndApothekerBank,
23313    AustrianAnadiBankAg,
23314    BankAustria,
23315    BankhausCarlSpangler,
23316    BankhausSchelhammerUndSchatteraAg,
23317    BawagPskAg,
23318    BksBankAg,
23319    BrullKallmusBankAg,
23320    BtvVierLanderBank,
23321    CapitalBankGraweGruppeAg,
23322    DeutscheBankAg,
23323    Dolomitenbank,
23324    EasybankAg,
23325    ErsteBankUndSparkassen,
23326    HypoAlpeadriabankInternationalAg,
23327    HypoBankBurgenlandAktiengesellschaft,
23328    HypoNoeLbFurNiederosterreichUWien,
23329    HypoOberosterreichSalzburgSteiermark,
23330    HypoTirolBankAg,
23331    HypoVorarlbergBankAg,
23332    MarchfelderBank,
23333    OberbankAg,
23334    RaiffeisenBankengruppeOsterreich,
23335    SchoellerbankAg,
23336    SpardaBankWien,
23337    VolksbankGruppe,
23338    VolkskreditbankAg,
23339    VrBankBraunau,
23340    /// An unrecognized value from Stripe. Should not be used as a request parameter.
23341    Unknown(String),
23342}
23343impl ConfirmPaymentIntentPaymentMethodDataEpsBank {
23344    pub fn as_str(&self) -> &str {
23345        use ConfirmPaymentIntentPaymentMethodDataEpsBank::*;
23346        match self {
23347            ArzteUndApothekerBank => "arzte_und_apotheker_bank",
23348            AustrianAnadiBankAg => "austrian_anadi_bank_ag",
23349            BankAustria => "bank_austria",
23350            BankhausCarlSpangler => "bankhaus_carl_spangler",
23351            BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag",
23352            BawagPskAg => "bawag_psk_ag",
23353            BksBankAg => "bks_bank_ag",
23354            BrullKallmusBankAg => "brull_kallmus_bank_ag",
23355            BtvVierLanderBank => "btv_vier_lander_bank",
23356            CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
23357            DeutscheBankAg => "deutsche_bank_ag",
23358            Dolomitenbank => "dolomitenbank",
23359            EasybankAg => "easybank_ag",
23360            ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
23361            HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag",
23362            HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft",
23363            HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien",
23364            HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark",
23365            HypoTirolBankAg => "hypo_tirol_bank_ag",
23366            HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
23367            MarchfelderBank => "marchfelder_bank",
23368            OberbankAg => "oberbank_ag",
23369            RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich",
23370            SchoellerbankAg => "schoellerbank_ag",
23371            SpardaBankWien => "sparda_bank_wien",
23372            VolksbankGruppe => "volksbank_gruppe",
23373            VolkskreditbankAg => "volkskreditbank_ag",
23374            VrBankBraunau => "vr_bank_braunau",
23375            Unknown(v) => v,
23376        }
23377    }
23378}
23379
23380impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataEpsBank {
23381    type Err = std::convert::Infallible;
23382    fn from_str(s: &str) -> Result<Self, Self::Err> {
23383        use ConfirmPaymentIntentPaymentMethodDataEpsBank::*;
23384        match s {
23385            "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank),
23386            "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg),
23387            "bank_austria" => Ok(BankAustria),
23388            "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler),
23389            "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg),
23390            "bawag_psk_ag" => Ok(BawagPskAg),
23391            "bks_bank_ag" => Ok(BksBankAg),
23392            "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg),
23393            "btv_vier_lander_bank" => Ok(BtvVierLanderBank),
23394            "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg),
23395            "deutsche_bank_ag" => Ok(DeutscheBankAg),
23396            "dolomitenbank" => Ok(Dolomitenbank),
23397            "easybank_ag" => Ok(EasybankAg),
23398            "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen),
23399            "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg),
23400            "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft),
23401            "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien),
23402            "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark),
23403            "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg),
23404            "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg),
23405            "marchfelder_bank" => Ok(MarchfelderBank),
23406            "oberbank_ag" => Ok(OberbankAg),
23407            "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich),
23408            "schoellerbank_ag" => Ok(SchoellerbankAg),
23409            "sparda_bank_wien" => Ok(SpardaBankWien),
23410            "volksbank_gruppe" => Ok(VolksbankGruppe),
23411            "volkskreditbank_ag" => Ok(VolkskreditbankAg),
23412            "vr_bank_braunau" => Ok(VrBankBraunau),
23413            v => Ok(Unknown(v.to_owned())),
23414        }
23415    }
23416}
23417impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataEpsBank {
23418    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23419        f.write_str(self.as_str())
23420    }
23421}
23422
23423impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataEpsBank {
23424    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23425        f.write_str(self.as_str())
23426    }
23427}
23428impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataEpsBank {
23429    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
23430    where
23431        S: serde::Serializer,
23432    {
23433        serializer.serialize_str(self.as_str())
23434    }
23435}
23436#[cfg(feature = "deserialize")]
23437impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataEpsBank {
23438    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
23439        use std::str::FromStr;
23440        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
23441        Ok(Self::from_str(&s).unwrap())
23442    }
23443}
23444/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
23445#[derive(Clone, Debug, serde::Serialize)]
23446pub struct ConfirmPaymentIntentPaymentMethodDataFpx {
23447    /// Account holder type for FPX transaction
23448    #[serde(skip_serializing_if = "Option::is_none")]
23449    pub account_holder_type: Option<ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType>,
23450    /// The customer's bank.
23451    pub bank: ConfirmPaymentIntentPaymentMethodDataFpxBank,
23452}
23453impl ConfirmPaymentIntentPaymentMethodDataFpx {
23454    pub fn new(bank: impl Into<ConfirmPaymentIntentPaymentMethodDataFpxBank>) -> Self {
23455        Self { account_holder_type: None, bank: bank.into() }
23456    }
23457}
23458/// Account holder type for FPX transaction
23459#[derive(Copy, Clone, Eq, PartialEq)]
23460pub enum ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType {
23461    Company,
23462    Individual,
23463}
23464impl ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType {
23465    pub fn as_str(self) -> &'static str {
23466        use ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType::*;
23467        match self {
23468            Company => "company",
23469            Individual => "individual",
23470        }
23471    }
23472}
23473
23474impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType {
23475    type Err = stripe_types::StripeParseError;
23476    fn from_str(s: &str) -> Result<Self, Self::Err> {
23477        use ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType::*;
23478        match s {
23479            "company" => Ok(Company),
23480            "individual" => Ok(Individual),
23481            _ => Err(stripe_types::StripeParseError),
23482        }
23483    }
23484}
23485impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType {
23486    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23487        f.write_str(self.as_str())
23488    }
23489}
23490
23491impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType {
23492    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23493        f.write_str(self.as_str())
23494    }
23495}
23496impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType {
23497    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
23498    where
23499        S: serde::Serializer,
23500    {
23501        serializer.serialize_str(self.as_str())
23502    }
23503}
23504#[cfg(feature = "deserialize")]
23505impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType {
23506    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
23507        use std::str::FromStr;
23508        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
23509        Self::from_str(&s).map_err(|_| {
23510            serde::de::Error::custom(
23511                "Unknown value for ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType",
23512            )
23513        })
23514    }
23515}
23516/// The customer's bank.
23517#[derive(Clone, Eq, PartialEq)]
23518#[non_exhaustive]
23519pub enum ConfirmPaymentIntentPaymentMethodDataFpxBank {
23520    AffinBank,
23521    Agrobank,
23522    AllianceBank,
23523    Ambank,
23524    BankIslam,
23525    BankMuamalat,
23526    BankOfChina,
23527    BankRakyat,
23528    Bsn,
23529    Cimb,
23530    DeutscheBank,
23531    HongLeongBank,
23532    Hsbc,
23533    Kfh,
23534    Maybank2e,
23535    Maybank2u,
23536    Ocbc,
23537    PbEnterprise,
23538    PublicBank,
23539    Rhb,
23540    StandardChartered,
23541    Uob,
23542    /// An unrecognized value from Stripe. Should not be used as a request parameter.
23543    Unknown(String),
23544}
23545impl ConfirmPaymentIntentPaymentMethodDataFpxBank {
23546    pub fn as_str(&self) -> &str {
23547        use ConfirmPaymentIntentPaymentMethodDataFpxBank::*;
23548        match self {
23549            AffinBank => "affin_bank",
23550            Agrobank => "agrobank",
23551            AllianceBank => "alliance_bank",
23552            Ambank => "ambank",
23553            BankIslam => "bank_islam",
23554            BankMuamalat => "bank_muamalat",
23555            BankOfChina => "bank_of_china",
23556            BankRakyat => "bank_rakyat",
23557            Bsn => "bsn",
23558            Cimb => "cimb",
23559            DeutscheBank => "deutsche_bank",
23560            HongLeongBank => "hong_leong_bank",
23561            Hsbc => "hsbc",
23562            Kfh => "kfh",
23563            Maybank2e => "maybank2e",
23564            Maybank2u => "maybank2u",
23565            Ocbc => "ocbc",
23566            PbEnterprise => "pb_enterprise",
23567            PublicBank => "public_bank",
23568            Rhb => "rhb",
23569            StandardChartered => "standard_chartered",
23570            Uob => "uob",
23571            Unknown(v) => v,
23572        }
23573    }
23574}
23575
23576impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataFpxBank {
23577    type Err = std::convert::Infallible;
23578    fn from_str(s: &str) -> Result<Self, Self::Err> {
23579        use ConfirmPaymentIntentPaymentMethodDataFpxBank::*;
23580        match s {
23581            "affin_bank" => Ok(AffinBank),
23582            "agrobank" => Ok(Agrobank),
23583            "alliance_bank" => Ok(AllianceBank),
23584            "ambank" => Ok(Ambank),
23585            "bank_islam" => Ok(BankIslam),
23586            "bank_muamalat" => Ok(BankMuamalat),
23587            "bank_of_china" => Ok(BankOfChina),
23588            "bank_rakyat" => Ok(BankRakyat),
23589            "bsn" => Ok(Bsn),
23590            "cimb" => Ok(Cimb),
23591            "deutsche_bank" => Ok(DeutscheBank),
23592            "hong_leong_bank" => Ok(HongLeongBank),
23593            "hsbc" => Ok(Hsbc),
23594            "kfh" => Ok(Kfh),
23595            "maybank2e" => Ok(Maybank2e),
23596            "maybank2u" => Ok(Maybank2u),
23597            "ocbc" => Ok(Ocbc),
23598            "pb_enterprise" => Ok(PbEnterprise),
23599            "public_bank" => Ok(PublicBank),
23600            "rhb" => Ok(Rhb),
23601            "standard_chartered" => Ok(StandardChartered),
23602            "uob" => Ok(Uob),
23603            v => Ok(Unknown(v.to_owned())),
23604        }
23605    }
23606}
23607impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataFpxBank {
23608    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23609        f.write_str(self.as_str())
23610    }
23611}
23612
23613impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataFpxBank {
23614    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23615        f.write_str(self.as_str())
23616    }
23617}
23618impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataFpxBank {
23619    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
23620    where
23621        S: serde::Serializer,
23622    {
23623        serializer.serialize_str(self.as_str())
23624    }
23625}
23626#[cfg(feature = "deserialize")]
23627impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataFpxBank {
23628    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
23629        use std::str::FromStr;
23630        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
23631        Ok(Self::from_str(&s).unwrap())
23632    }
23633}
23634/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
23635#[derive(Clone, Debug, serde::Serialize)]
23636pub struct ConfirmPaymentIntentPaymentMethodDataIdeal {
23637    /// The customer's bank.
23638    /// Only use this parameter for existing customers.
23639    /// Don't use it for new customers.
23640    #[serde(skip_serializing_if = "Option::is_none")]
23641    pub bank: Option<ConfirmPaymentIntentPaymentMethodDataIdealBank>,
23642}
23643impl ConfirmPaymentIntentPaymentMethodDataIdeal {
23644    pub fn new() -> Self {
23645        Self { bank: None }
23646    }
23647}
23648impl Default for ConfirmPaymentIntentPaymentMethodDataIdeal {
23649    fn default() -> Self {
23650        Self::new()
23651    }
23652}
23653/// The customer's bank.
23654/// Only use this parameter for existing customers.
23655/// Don't use it for new customers.
23656#[derive(Clone, Eq, PartialEq)]
23657#[non_exhaustive]
23658pub enum ConfirmPaymentIntentPaymentMethodDataIdealBank {
23659    AbnAmro,
23660    AsnBank,
23661    Bunq,
23662    Buut,
23663    Handelsbanken,
23664    Ing,
23665    Knab,
23666    Moneyou,
23667    N26,
23668    Nn,
23669    Rabobank,
23670    Regiobank,
23671    Revolut,
23672    SnsBank,
23673    TriodosBank,
23674    VanLanschot,
23675    Yoursafe,
23676    /// An unrecognized value from Stripe. Should not be used as a request parameter.
23677    Unknown(String),
23678}
23679impl ConfirmPaymentIntentPaymentMethodDataIdealBank {
23680    pub fn as_str(&self) -> &str {
23681        use ConfirmPaymentIntentPaymentMethodDataIdealBank::*;
23682        match self {
23683            AbnAmro => "abn_amro",
23684            AsnBank => "asn_bank",
23685            Bunq => "bunq",
23686            Buut => "buut",
23687            Handelsbanken => "handelsbanken",
23688            Ing => "ing",
23689            Knab => "knab",
23690            Moneyou => "moneyou",
23691            N26 => "n26",
23692            Nn => "nn",
23693            Rabobank => "rabobank",
23694            Regiobank => "regiobank",
23695            Revolut => "revolut",
23696            SnsBank => "sns_bank",
23697            TriodosBank => "triodos_bank",
23698            VanLanschot => "van_lanschot",
23699            Yoursafe => "yoursafe",
23700            Unknown(v) => v,
23701        }
23702    }
23703}
23704
23705impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataIdealBank {
23706    type Err = std::convert::Infallible;
23707    fn from_str(s: &str) -> Result<Self, Self::Err> {
23708        use ConfirmPaymentIntentPaymentMethodDataIdealBank::*;
23709        match s {
23710            "abn_amro" => Ok(AbnAmro),
23711            "asn_bank" => Ok(AsnBank),
23712            "bunq" => Ok(Bunq),
23713            "buut" => Ok(Buut),
23714            "handelsbanken" => Ok(Handelsbanken),
23715            "ing" => Ok(Ing),
23716            "knab" => Ok(Knab),
23717            "moneyou" => Ok(Moneyou),
23718            "n26" => Ok(N26),
23719            "nn" => Ok(Nn),
23720            "rabobank" => Ok(Rabobank),
23721            "regiobank" => Ok(Regiobank),
23722            "revolut" => Ok(Revolut),
23723            "sns_bank" => Ok(SnsBank),
23724            "triodos_bank" => Ok(TriodosBank),
23725            "van_lanschot" => Ok(VanLanschot),
23726            "yoursafe" => Ok(Yoursafe),
23727            v => Ok(Unknown(v.to_owned())),
23728        }
23729    }
23730}
23731impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataIdealBank {
23732    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23733        f.write_str(self.as_str())
23734    }
23735}
23736
23737impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataIdealBank {
23738    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23739        f.write_str(self.as_str())
23740    }
23741}
23742impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataIdealBank {
23743    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
23744    where
23745        S: serde::Serializer,
23746    {
23747        serializer.serialize_str(self.as_str())
23748    }
23749}
23750#[cfg(feature = "deserialize")]
23751impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataIdealBank {
23752    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
23753        use std::str::FromStr;
23754        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
23755        Ok(Self::from_str(&s).unwrap())
23756    }
23757}
23758/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
23759#[derive(Copy, Clone, Debug, serde::Serialize)]
23760pub struct ConfirmPaymentIntentPaymentMethodDataKlarna {
23761    /// Customer's date of birth
23762    #[serde(skip_serializing_if = "Option::is_none")]
23763    pub dob: Option<DateOfBirth>,
23764}
23765impl ConfirmPaymentIntentPaymentMethodDataKlarna {
23766    pub fn new() -> Self {
23767        Self { dob: None }
23768    }
23769}
23770impl Default for ConfirmPaymentIntentPaymentMethodDataKlarna {
23771    fn default() -> Self {
23772        Self::new()
23773    }
23774}
23775/// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
23776#[derive(Copy, Clone, Debug, serde::Serialize)]
23777pub struct ConfirmPaymentIntentPaymentMethodDataNaverPay {
23778    /// Whether to use Naver Pay points or a card to fund this transaction.
23779    /// If not provided, this defaults to `card`.
23780    #[serde(skip_serializing_if = "Option::is_none")]
23781    pub funding: Option<ConfirmPaymentIntentPaymentMethodDataNaverPayFunding>,
23782}
23783impl ConfirmPaymentIntentPaymentMethodDataNaverPay {
23784    pub fn new() -> Self {
23785        Self { funding: None }
23786    }
23787}
23788impl Default for ConfirmPaymentIntentPaymentMethodDataNaverPay {
23789    fn default() -> Self {
23790        Self::new()
23791    }
23792}
23793/// Whether to use Naver Pay points or a card to fund this transaction.
23794/// If not provided, this defaults to `card`.
23795#[derive(Copy, Clone, Eq, PartialEq)]
23796pub enum ConfirmPaymentIntentPaymentMethodDataNaverPayFunding {
23797    Card,
23798    Points,
23799}
23800impl ConfirmPaymentIntentPaymentMethodDataNaverPayFunding {
23801    pub fn as_str(self) -> &'static str {
23802        use ConfirmPaymentIntentPaymentMethodDataNaverPayFunding::*;
23803        match self {
23804            Card => "card",
23805            Points => "points",
23806        }
23807    }
23808}
23809
23810impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataNaverPayFunding {
23811    type Err = stripe_types::StripeParseError;
23812    fn from_str(s: &str) -> Result<Self, Self::Err> {
23813        use ConfirmPaymentIntentPaymentMethodDataNaverPayFunding::*;
23814        match s {
23815            "card" => Ok(Card),
23816            "points" => Ok(Points),
23817            _ => Err(stripe_types::StripeParseError),
23818        }
23819    }
23820}
23821impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataNaverPayFunding {
23822    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23823        f.write_str(self.as_str())
23824    }
23825}
23826
23827impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataNaverPayFunding {
23828    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23829        f.write_str(self.as_str())
23830    }
23831}
23832impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataNaverPayFunding {
23833    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
23834    where
23835        S: serde::Serializer,
23836    {
23837        serializer.serialize_str(self.as_str())
23838    }
23839}
23840#[cfg(feature = "deserialize")]
23841impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataNaverPayFunding {
23842    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
23843        use std::str::FromStr;
23844        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
23845        Self::from_str(&s).map_err(|_| {
23846            serde::de::Error::custom(
23847                "Unknown value for ConfirmPaymentIntentPaymentMethodDataNaverPayFunding",
23848            )
23849        })
23850    }
23851}
23852/// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
23853#[derive(Clone, Debug, serde::Serialize)]
23854pub struct ConfirmPaymentIntentPaymentMethodDataNzBankAccount {
23855    /// The name on the bank account.
23856    /// Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod’s billing details.
23857    #[serde(skip_serializing_if = "Option::is_none")]
23858    pub account_holder_name: Option<String>,
23859    /// The account number for the bank account.
23860    pub account_number: String,
23861    /// The numeric code for the bank account's bank.
23862    pub bank_code: String,
23863    /// The numeric code for the bank account's bank branch.
23864    pub branch_code: String,
23865    #[serde(skip_serializing_if = "Option::is_none")]
23866    pub reference: Option<String>,
23867    /// The suffix of the bank account number.
23868    pub suffix: String,
23869}
23870impl ConfirmPaymentIntentPaymentMethodDataNzBankAccount {
23871    pub fn new(
23872        account_number: impl Into<String>,
23873        bank_code: impl Into<String>,
23874        branch_code: impl Into<String>,
23875        suffix: impl Into<String>,
23876    ) -> Self {
23877        Self {
23878            account_holder_name: None,
23879            account_number: account_number.into(),
23880            bank_code: bank_code.into(),
23881            branch_code: branch_code.into(),
23882            reference: None,
23883            suffix: suffix.into(),
23884        }
23885    }
23886}
23887/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
23888#[derive(Clone, Debug, serde::Serialize)]
23889pub struct ConfirmPaymentIntentPaymentMethodDataP24 {
23890    /// The customer's bank.
23891    #[serde(skip_serializing_if = "Option::is_none")]
23892    pub bank: Option<ConfirmPaymentIntentPaymentMethodDataP24Bank>,
23893}
23894impl ConfirmPaymentIntentPaymentMethodDataP24 {
23895    pub fn new() -> Self {
23896        Self { bank: None }
23897    }
23898}
23899impl Default for ConfirmPaymentIntentPaymentMethodDataP24 {
23900    fn default() -> Self {
23901        Self::new()
23902    }
23903}
23904/// The customer's bank.
23905#[derive(Clone, Eq, PartialEq)]
23906#[non_exhaustive]
23907pub enum ConfirmPaymentIntentPaymentMethodDataP24Bank {
23908    AliorBank,
23909    BankMillennium,
23910    BankNowyBfgSa,
23911    BankPekaoSa,
23912    BankiSpbdzielcze,
23913    Blik,
23914    BnpParibas,
23915    Boz,
23916    CitiHandlowy,
23917    CreditAgricole,
23918    Envelobank,
23919    EtransferPocztowy24,
23920    GetinBank,
23921    Ideabank,
23922    Ing,
23923    Inteligo,
23924    MbankMtransfer,
23925    NestPrzelew,
23926    NoblePay,
23927    PbacZIpko,
23928    PlusBank,
23929    SantanderPrzelew24,
23930    TmobileUsbugiBankowe,
23931    ToyotaBank,
23932    Velobank,
23933    VolkswagenBank,
23934    /// An unrecognized value from Stripe. Should not be used as a request parameter.
23935    Unknown(String),
23936}
23937impl ConfirmPaymentIntentPaymentMethodDataP24Bank {
23938    pub fn as_str(&self) -> &str {
23939        use ConfirmPaymentIntentPaymentMethodDataP24Bank::*;
23940        match self {
23941            AliorBank => "alior_bank",
23942            BankMillennium => "bank_millennium",
23943            BankNowyBfgSa => "bank_nowy_bfg_sa",
23944            BankPekaoSa => "bank_pekao_sa",
23945            BankiSpbdzielcze => "banki_spbdzielcze",
23946            Blik => "blik",
23947            BnpParibas => "bnp_paribas",
23948            Boz => "boz",
23949            CitiHandlowy => "citi_handlowy",
23950            CreditAgricole => "credit_agricole",
23951            Envelobank => "envelobank",
23952            EtransferPocztowy24 => "etransfer_pocztowy24",
23953            GetinBank => "getin_bank",
23954            Ideabank => "ideabank",
23955            Ing => "ing",
23956            Inteligo => "inteligo",
23957            MbankMtransfer => "mbank_mtransfer",
23958            NestPrzelew => "nest_przelew",
23959            NoblePay => "noble_pay",
23960            PbacZIpko => "pbac_z_ipko",
23961            PlusBank => "plus_bank",
23962            SantanderPrzelew24 => "santander_przelew24",
23963            TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
23964            ToyotaBank => "toyota_bank",
23965            Velobank => "velobank",
23966            VolkswagenBank => "volkswagen_bank",
23967            Unknown(v) => v,
23968        }
23969    }
23970}
23971
23972impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataP24Bank {
23973    type Err = std::convert::Infallible;
23974    fn from_str(s: &str) -> Result<Self, Self::Err> {
23975        use ConfirmPaymentIntentPaymentMethodDataP24Bank::*;
23976        match s {
23977            "alior_bank" => Ok(AliorBank),
23978            "bank_millennium" => Ok(BankMillennium),
23979            "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa),
23980            "bank_pekao_sa" => Ok(BankPekaoSa),
23981            "banki_spbdzielcze" => Ok(BankiSpbdzielcze),
23982            "blik" => Ok(Blik),
23983            "bnp_paribas" => Ok(BnpParibas),
23984            "boz" => Ok(Boz),
23985            "citi_handlowy" => Ok(CitiHandlowy),
23986            "credit_agricole" => Ok(CreditAgricole),
23987            "envelobank" => Ok(Envelobank),
23988            "etransfer_pocztowy24" => Ok(EtransferPocztowy24),
23989            "getin_bank" => Ok(GetinBank),
23990            "ideabank" => Ok(Ideabank),
23991            "ing" => Ok(Ing),
23992            "inteligo" => Ok(Inteligo),
23993            "mbank_mtransfer" => Ok(MbankMtransfer),
23994            "nest_przelew" => Ok(NestPrzelew),
23995            "noble_pay" => Ok(NoblePay),
23996            "pbac_z_ipko" => Ok(PbacZIpko),
23997            "plus_bank" => Ok(PlusBank),
23998            "santander_przelew24" => Ok(SantanderPrzelew24),
23999            "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe),
24000            "toyota_bank" => Ok(ToyotaBank),
24001            "velobank" => Ok(Velobank),
24002            "volkswagen_bank" => Ok(VolkswagenBank),
24003            v => Ok(Unknown(v.to_owned())),
24004        }
24005    }
24006}
24007impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataP24Bank {
24008    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24009        f.write_str(self.as_str())
24010    }
24011}
24012
24013impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataP24Bank {
24014    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24015        f.write_str(self.as_str())
24016    }
24017}
24018impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataP24Bank {
24019    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
24020    where
24021        S: serde::Serializer,
24022    {
24023        serializer.serialize_str(self.as_str())
24024    }
24025}
24026#[cfg(feature = "deserialize")]
24027impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataP24Bank {
24028    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
24029        use std::str::FromStr;
24030        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
24031        Ok(Self::from_str(&s).unwrap())
24032    }
24033}
24034/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
24035#[derive(Clone, Debug, serde::Serialize)]
24036pub struct ConfirmPaymentIntentPaymentMethodDataSepaDebit {
24037    /// IBAN of the bank account.
24038    pub iban: String,
24039}
24040impl ConfirmPaymentIntentPaymentMethodDataSepaDebit {
24041    pub fn new(iban: impl Into<String>) -> Self {
24042        Self { iban: iban.into() }
24043    }
24044}
24045/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
24046#[derive(Copy, Clone, Debug, serde::Serialize)]
24047pub struct ConfirmPaymentIntentPaymentMethodDataSofort {
24048    /// Two-letter ISO code representing the country the bank account is located in.
24049    pub country: ConfirmPaymentIntentPaymentMethodDataSofortCountry,
24050}
24051impl ConfirmPaymentIntentPaymentMethodDataSofort {
24052    pub fn new(country: impl Into<ConfirmPaymentIntentPaymentMethodDataSofortCountry>) -> Self {
24053        Self { country: country.into() }
24054    }
24055}
24056/// Two-letter ISO code representing the country the bank account is located in.
24057#[derive(Copy, Clone, Eq, PartialEq)]
24058pub enum ConfirmPaymentIntentPaymentMethodDataSofortCountry {
24059    At,
24060    Be,
24061    De,
24062    Es,
24063    It,
24064    Nl,
24065}
24066impl ConfirmPaymentIntentPaymentMethodDataSofortCountry {
24067    pub fn as_str(self) -> &'static str {
24068        use ConfirmPaymentIntentPaymentMethodDataSofortCountry::*;
24069        match self {
24070            At => "AT",
24071            Be => "BE",
24072            De => "DE",
24073            Es => "ES",
24074            It => "IT",
24075            Nl => "NL",
24076        }
24077    }
24078}
24079
24080impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataSofortCountry {
24081    type Err = stripe_types::StripeParseError;
24082    fn from_str(s: &str) -> Result<Self, Self::Err> {
24083        use ConfirmPaymentIntentPaymentMethodDataSofortCountry::*;
24084        match s {
24085            "AT" => Ok(At),
24086            "BE" => Ok(Be),
24087            "DE" => Ok(De),
24088            "ES" => Ok(Es),
24089            "IT" => Ok(It),
24090            "NL" => Ok(Nl),
24091            _ => Err(stripe_types::StripeParseError),
24092        }
24093    }
24094}
24095impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataSofortCountry {
24096    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24097        f.write_str(self.as_str())
24098    }
24099}
24100
24101impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataSofortCountry {
24102    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24103        f.write_str(self.as_str())
24104    }
24105}
24106impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataSofortCountry {
24107    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
24108    where
24109        S: serde::Serializer,
24110    {
24111        serializer.serialize_str(self.as_str())
24112    }
24113}
24114#[cfg(feature = "deserialize")]
24115impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataSofortCountry {
24116    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
24117        use std::str::FromStr;
24118        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
24119        Self::from_str(&s).map_err(|_| {
24120            serde::de::Error::custom(
24121                "Unknown value for ConfirmPaymentIntentPaymentMethodDataSofortCountry",
24122            )
24123        })
24124    }
24125}
24126/// The type of the PaymentMethod.
24127/// An additional hash is included on the PaymentMethod with a name matching this value.
24128/// It contains additional information specific to the PaymentMethod type.
24129#[derive(Clone, Eq, PartialEq)]
24130#[non_exhaustive]
24131pub enum ConfirmPaymentIntentPaymentMethodDataType {
24132    AcssDebit,
24133    Affirm,
24134    AfterpayClearpay,
24135    Alipay,
24136    Alma,
24137    AmazonPay,
24138    AuBecsDebit,
24139    BacsDebit,
24140    Bancontact,
24141    Billie,
24142    Blik,
24143    Boleto,
24144    Cashapp,
24145    Crypto,
24146    CustomerBalance,
24147    Eps,
24148    Fpx,
24149    Giropay,
24150    Grabpay,
24151    Ideal,
24152    KakaoPay,
24153    Klarna,
24154    Konbini,
24155    KrCard,
24156    Link,
24157    MbWay,
24158    Mobilepay,
24159    Multibanco,
24160    NaverPay,
24161    NzBankAccount,
24162    Oxxo,
24163    P24,
24164    PayByBank,
24165    Payco,
24166    Paynow,
24167    Paypal,
24168    Pix,
24169    Promptpay,
24170    RevolutPay,
24171    SamsungPay,
24172    Satispay,
24173    SepaDebit,
24174    Sofort,
24175    Swish,
24176    Twint,
24177    UsBankAccount,
24178    WechatPay,
24179    Zip,
24180    /// An unrecognized value from Stripe. Should not be used as a request parameter.
24181    Unknown(String),
24182}
24183impl ConfirmPaymentIntentPaymentMethodDataType {
24184    pub fn as_str(&self) -> &str {
24185        use ConfirmPaymentIntentPaymentMethodDataType::*;
24186        match self {
24187            AcssDebit => "acss_debit",
24188            Affirm => "affirm",
24189            AfterpayClearpay => "afterpay_clearpay",
24190            Alipay => "alipay",
24191            Alma => "alma",
24192            AmazonPay => "amazon_pay",
24193            AuBecsDebit => "au_becs_debit",
24194            BacsDebit => "bacs_debit",
24195            Bancontact => "bancontact",
24196            Billie => "billie",
24197            Blik => "blik",
24198            Boleto => "boleto",
24199            Cashapp => "cashapp",
24200            Crypto => "crypto",
24201            CustomerBalance => "customer_balance",
24202            Eps => "eps",
24203            Fpx => "fpx",
24204            Giropay => "giropay",
24205            Grabpay => "grabpay",
24206            Ideal => "ideal",
24207            KakaoPay => "kakao_pay",
24208            Klarna => "klarna",
24209            Konbini => "konbini",
24210            KrCard => "kr_card",
24211            Link => "link",
24212            MbWay => "mb_way",
24213            Mobilepay => "mobilepay",
24214            Multibanco => "multibanco",
24215            NaverPay => "naver_pay",
24216            NzBankAccount => "nz_bank_account",
24217            Oxxo => "oxxo",
24218            P24 => "p24",
24219            PayByBank => "pay_by_bank",
24220            Payco => "payco",
24221            Paynow => "paynow",
24222            Paypal => "paypal",
24223            Pix => "pix",
24224            Promptpay => "promptpay",
24225            RevolutPay => "revolut_pay",
24226            SamsungPay => "samsung_pay",
24227            Satispay => "satispay",
24228            SepaDebit => "sepa_debit",
24229            Sofort => "sofort",
24230            Swish => "swish",
24231            Twint => "twint",
24232            UsBankAccount => "us_bank_account",
24233            WechatPay => "wechat_pay",
24234            Zip => "zip",
24235            Unknown(v) => v,
24236        }
24237    }
24238}
24239
24240impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataType {
24241    type Err = std::convert::Infallible;
24242    fn from_str(s: &str) -> Result<Self, Self::Err> {
24243        use ConfirmPaymentIntentPaymentMethodDataType::*;
24244        match s {
24245            "acss_debit" => Ok(AcssDebit),
24246            "affirm" => Ok(Affirm),
24247            "afterpay_clearpay" => Ok(AfterpayClearpay),
24248            "alipay" => Ok(Alipay),
24249            "alma" => Ok(Alma),
24250            "amazon_pay" => Ok(AmazonPay),
24251            "au_becs_debit" => Ok(AuBecsDebit),
24252            "bacs_debit" => Ok(BacsDebit),
24253            "bancontact" => Ok(Bancontact),
24254            "billie" => Ok(Billie),
24255            "blik" => Ok(Blik),
24256            "boleto" => Ok(Boleto),
24257            "cashapp" => Ok(Cashapp),
24258            "crypto" => Ok(Crypto),
24259            "customer_balance" => Ok(CustomerBalance),
24260            "eps" => Ok(Eps),
24261            "fpx" => Ok(Fpx),
24262            "giropay" => Ok(Giropay),
24263            "grabpay" => Ok(Grabpay),
24264            "ideal" => Ok(Ideal),
24265            "kakao_pay" => Ok(KakaoPay),
24266            "klarna" => Ok(Klarna),
24267            "konbini" => Ok(Konbini),
24268            "kr_card" => Ok(KrCard),
24269            "link" => Ok(Link),
24270            "mb_way" => Ok(MbWay),
24271            "mobilepay" => Ok(Mobilepay),
24272            "multibanco" => Ok(Multibanco),
24273            "naver_pay" => Ok(NaverPay),
24274            "nz_bank_account" => Ok(NzBankAccount),
24275            "oxxo" => Ok(Oxxo),
24276            "p24" => Ok(P24),
24277            "pay_by_bank" => Ok(PayByBank),
24278            "payco" => Ok(Payco),
24279            "paynow" => Ok(Paynow),
24280            "paypal" => Ok(Paypal),
24281            "pix" => Ok(Pix),
24282            "promptpay" => Ok(Promptpay),
24283            "revolut_pay" => Ok(RevolutPay),
24284            "samsung_pay" => Ok(SamsungPay),
24285            "satispay" => Ok(Satispay),
24286            "sepa_debit" => Ok(SepaDebit),
24287            "sofort" => Ok(Sofort),
24288            "swish" => Ok(Swish),
24289            "twint" => Ok(Twint),
24290            "us_bank_account" => Ok(UsBankAccount),
24291            "wechat_pay" => Ok(WechatPay),
24292            "zip" => Ok(Zip),
24293            v => Ok(Unknown(v.to_owned())),
24294        }
24295    }
24296}
24297impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataType {
24298    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24299        f.write_str(self.as_str())
24300    }
24301}
24302
24303impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataType {
24304    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24305        f.write_str(self.as_str())
24306    }
24307}
24308impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataType {
24309    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
24310    where
24311        S: serde::Serializer,
24312    {
24313        serializer.serialize_str(self.as_str())
24314    }
24315}
24316#[cfg(feature = "deserialize")]
24317impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataType {
24318    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
24319        use std::str::FromStr;
24320        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
24321        Ok(Self::from_str(&s).unwrap())
24322    }
24323}
24324/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
24325#[derive(Clone, Debug, serde::Serialize)]
24326pub struct ConfirmPaymentIntentPaymentMethodDataUsBankAccount {
24327    /// Account holder type: individual or company.
24328    #[serde(skip_serializing_if = "Option::is_none")]
24329    pub account_holder_type:
24330        Option<ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType>,
24331    /// Account number of the bank account.
24332    #[serde(skip_serializing_if = "Option::is_none")]
24333    pub account_number: Option<String>,
24334    /// Account type: checkings or savings. Defaults to checking if omitted.
24335    #[serde(skip_serializing_if = "Option::is_none")]
24336    pub account_type: Option<ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType>,
24337    /// The ID of a Financial Connections Account to use as a payment method.
24338    #[serde(skip_serializing_if = "Option::is_none")]
24339    pub financial_connections_account: Option<String>,
24340    /// Routing number of the bank account.
24341    #[serde(skip_serializing_if = "Option::is_none")]
24342    pub routing_number: Option<String>,
24343}
24344impl ConfirmPaymentIntentPaymentMethodDataUsBankAccount {
24345    pub fn new() -> Self {
24346        Self {
24347            account_holder_type: None,
24348            account_number: None,
24349            account_type: None,
24350            financial_connections_account: None,
24351            routing_number: None,
24352        }
24353    }
24354}
24355impl Default for ConfirmPaymentIntentPaymentMethodDataUsBankAccount {
24356    fn default() -> Self {
24357        Self::new()
24358    }
24359}
24360/// Account holder type: individual or company.
24361#[derive(Copy, Clone, Eq, PartialEq)]
24362pub enum ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
24363    Company,
24364    Individual,
24365}
24366impl ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
24367    pub fn as_str(self) -> &'static str {
24368        use ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
24369        match self {
24370            Company => "company",
24371            Individual => "individual",
24372        }
24373    }
24374}
24375
24376impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
24377    type Err = stripe_types::StripeParseError;
24378    fn from_str(s: &str) -> Result<Self, Self::Err> {
24379        use ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
24380        match s {
24381            "company" => Ok(Company),
24382            "individual" => Ok(Individual),
24383            _ => Err(stripe_types::StripeParseError),
24384        }
24385    }
24386}
24387impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
24388    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24389        f.write_str(self.as_str())
24390    }
24391}
24392
24393impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
24394    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24395        f.write_str(self.as_str())
24396    }
24397}
24398impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
24399    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
24400    where
24401        S: serde::Serializer,
24402    {
24403        serializer.serialize_str(self.as_str())
24404    }
24405}
24406#[cfg(feature = "deserialize")]
24407impl<'de> serde::Deserialize<'de>
24408    for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType
24409{
24410    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
24411        use std::str::FromStr;
24412        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
24413        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType"))
24414    }
24415}
24416/// Account type: checkings or savings. Defaults to checking if omitted.
24417#[derive(Copy, Clone, Eq, PartialEq)]
24418pub enum ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType {
24419    Checking,
24420    Savings,
24421}
24422impl ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType {
24423    pub fn as_str(self) -> &'static str {
24424        use ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType::*;
24425        match self {
24426            Checking => "checking",
24427            Savings => "savings",
24428        }
24429    }
24430}
24431
24432impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType {
24433    type Err = stripe_types::StripeParseError;
24434    fn from_str(s: &str) -> Result<Self, Self::Err> {
24435        use ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType::*;
24436        match s {
24437            "checking" => Ok(Checking),
24438            "savings" => Ok(Savings),
24439            _ => Err(stripe_types::StripeParseError),
24440        }
24441    }
24442}
24443impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType {
24444    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24445        f.write_str(self.as_str())
24446    }
24447}
24448
24449impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType {
24450    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24451        f.write_str(self.as_str())
24452    }
24453}
24454impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType {
24455    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
24456    where
24457        S: serde::Serializer,
24458    {
24459        serializer.serialize_str(self.as_str())
24460    }
24461}
24462#[cfg(feature = "deserialize")]
24463impl<'de> serde::Deserialize<'de>
24464    for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType
24465{
24466    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
24467        use std::str::FromStr;
24468        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
24469        Self::from_str(&s).map_err(|_| {
24470            serde::de::Error::custom(
24471                "Unknown value for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType",
24472            )
24473        })
24474    }
24475}
24476/// Payment method-specific configuration for this PaymentIntent.
24477#[derive(Clone, Debug, serde::Serialize)]
24478pub struct ConfirmPaymentIntentPaymentMethodOptions {
24479    /// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options.
24480    #[serde(skip_serializing_if = "Option::is_none")]
24481    pub acss_debit: Option<ConfirmPaymentIntentPaymentMethodOptionsAcssDebit>,
24482    /// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options.
24483    #[serde(skip_serializing_if = "Option::is_none")]
24484    pub affirm: Option<ConfirmPaymentIntentPaymentMethodOptionsAffirm>,
24485    /// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options.
24486    #[serde(skip_serializing_if = "Option::is_none")]
24487    pub afterpay_clearpay: Option<ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpay>,
24488    /// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options.
24489    #[serde(skip_serializing_if = "Option::is_none")]
24490    pub alipay: Option<ConfirmPaymentIntentPaymentMethodOptionsAlipay>,
24491    /// If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options.
24492    #[serde(skip_serializing_if = "Option::is_none")]
24493    pub alma: Option<ConfirmPaymentIntentPaymentMethodOptionsAlma>,
24494    /// If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options.
24495    #[serde(skip_serializing_if = "Option::is_none")]
24496    pub amazon_pay: Option<ConfirmPaymentIntentPaymentMethodOptionsAmazonPay>,
24497    /// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options.
24498    #[serde(skip_serializing_if = "Option::is_none")]
24499    pub au_becs_debit: Option<ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebit>,
24500    /// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options.
24501    #[serde(skip_serializing_if = "Option::is_none")]
24502    pub bacs_debit: Option<ConfirmPaymentIntentPaymentMethodOptionsBacsDebit>,
24503    /// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options.
24504    #[serde(skip_serializing_if = "Option::is_none")]
24505    pub bancontact: Option<ConfirmPaymentIntentPaymentMethodOptionsBancontact>,
24506    /// If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options.
24507    #[serde(skip_serializing_if = "Option::is_none")]
24508    pub billie: Option<ConfirmPaymentIntentPaymentMethodOptionsBillie>,
24509    /// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options.
24510    #[serde(skip_serializing_if = "Option::is_none")]
24511    pub blik: Option<ConfirmPaymentIntentPaymentMethodOptionsBlik>,
24512    /// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options.
24513    #[serde(skip_serializing_if = "Option::is_none")]
24514    pub boleto: Option<ConfirmPaymentIntentPaymentMethodOptionsBoleto>,
24515    /// Configuration for any card payments attempted on this PaymentIntent.
24516    #[serde(skip_serializing_if = "Option::is_none")]
24517    pub card: Option<ConfirmPaymentIntentPaymentMethodOptionsCard>,
24518    /// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
24519    #[serde(skip_serializing_if = "Option::is_none")]
24520    pub card_present: Option<ConfirmPaymentIntentPaymentMethodOptionsCardPresent>,
24521    /// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options.
24522    #[serde(skip_serializing_if = "Option::is_none")]
24523    pub cashapp: Option<ConfirmPaymentIntentPaymentMethodOptionsCashapp>,
24524    /// If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options.
24525    #[serde(skip_serializing_if = "Option::is_none")]
24526    pub crypto: Option<ConfirmPaymentIntentPaymentMethodOptionsCrypto>,
24527    /// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options.
24528    #[serde(skip_serializing_if = "Option::is_none")]
24529    pub customer_balance: Option<ConfirmPaymentIntentPaymentMethodOptionsCustomerBalance>,
24530    /// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
24531    #[serde(skip_serializing_if = "Option::is_none")]
24532    pub eps: Option<ConfirmPaymentIntentPaymentMethodOptionsEps>,
24533    /// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options.
24534    #[serde(skip_serializing_if = "Option::is_none")]
24535    pub fpx: Option<ConfirmPaymentIntentPaymentMethodOptionsFpx>,
24536    /// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options.
24537    #[serde(skip_serializing_if = "Option::is_none")]
24538    pub giropay: Option<ConfirmPaymentIntentPaymentMethodOptionsGiropay>,
24539    /// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options.
24540    #[serde(skip_serializing_if = "Option::is_none")]
24541    pub grabpay: Option<ConfirmPaymentIntentPaymentMethodOptionsGrabpay>,
24542    /// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options.
24543    #[serde(skip_serializing_if = "Option::is_none")]
24544    pub ideal: Option<ConfirmPaymentIntentPaymentMethodOptionsIdeal>,
24545    /// If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
24546    #[serde(skip_serializing_if = "Option::is_none")]
24547    #[serde(with = "stripe_types::with_serde_json_opt")]
24548    pub interac_present: Option<miniserde::json::Value>,
24549    /// If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options.
24550    #[serde(skip_serializing_if = "Option::is_none")]
24551    pub kakao_pay: Option<ConfirmPaymentIntentPaymentMethodOptionsKakaoPay>,
24552    /// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options.
24553    #[serde(skip_serializing_if = "Option::is_none")]
24554    pub klarna: Option<ConfirmPaymentIntentPaymentMethodOptionsKlarna>,
24555    /// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options.
24556    #[serde(skip_serializing_if = "Option::is_none")]
24557    pub konbini: Option<ConfirmPaymentIntentPaymentMethodOptionsKonbini>,
24558    /// If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options.
24559    #[serde(skip_serializing_if = "Option::is_none")]
24560    pub kr_card: Option<ConfirmPaymentIntentPaymentMethodOptionsKrCard>,
24561    /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
24562    #[serde(skip_serializing_if = "Option::is_none")]
24563    pub link: Option<ConfirmPaymentIntentPaymentMethodOptionsLink>,
24564    /// If this is a `mb_way` PaymentMethod, this sub-hash contains details about the MB WAY payment method options.
24565    #[serde(skip_serializing_if = "Option::is_none")]
24566    pub mb_way: Option<ConfirmPaymentIntentPaymentMethodOptionsMbWay>,
24567    /// If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options.
24568    #[serde(skip_serializing_if = "Option::is_none")]
24569    pub mobilepay: Option<ConfirmPaymentIntentPaymentMethodOptionsMobilepay>,
24570    /// If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options.
24571    #[serde(skip_serializing_if = "Option::is_none")]
24572    pub multibanco: Option<ConfirmPaymentIntentPaymentMethodOptionsMultibanco>,
24573    /// If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options.
24574    #[serde(skip_serializing_if = "Option::is_none")]
24575    pub naver_pay: Option<ConfirmPaymentIntentPaymentMethodOptionsNaverPay>,
24576    /// If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options.
24577    #[serde(skip_serializing_if = "Option::is_none")]
24578    pub nz_bank_account: Option<ConfirmPaymentIntentPaymentMethodOptionsNzBankAccount>,
24579    /// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options.
24580    #[serde(skip_serializing_if = "Option::is_none")]
24581    pub oxxo: Option<ConfirmPaymentIntentPaymentMethodOptionsOxxo>,
24582    /// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options.
24583    #[serde(skip_serializing_if = "Option::is_none")]
24584    pub p24: Option<ConfirmPaymentIntentPaymentMethodOptionsP24>,
24585    /// If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options.
24586    #[serde(skip_serializing_if = "Option::is_none")]
24587    #[serde(with = "stripe_types::with_serde_json_opt")]
24588    pub pay_by_bank: Option<miniserde::json::Value>,
24589    /// If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options.
24590    #[serde(skip_serializing_if = "Option::is_none")]
24591    pub payco: Option<ConfirmPaymentIntentPaymentMethodOptionsPayco>,
24592    /// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options.
24593    #[serde(skip_serializing_if = "Option::is_none")]
24594    pub paynow: Option<ConfirmPaymentIntentPaymentMethodOptionsPaynow>,
24595    /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
24596    #[serde(skip_serializing_if = "Option::is_none")]
24597    pub paypal: Option<ConfirmPaymentIntentPaymentMethodOptionsPaypal>,
24598    /// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options.
24599    #[serde(skip_serializing_if = "Option::is_none")]
24600    pub pix: Option<ConfirmPaymentIntentPaymentMethodOptionsPix>,
24601    /// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options.
24602    #[serde(skip_serializing_if = "Option::is_none")]
24603    pub promptpay: Option<ConfirmPaymentIntentPaymentMethodOptionsPromptpay>,
24604    /// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options.
24605    #[serde(skip_serializing_if = "Option::is_none")]
24606    pub revolut_pay: Option<ConfirmPaymentIntentPaymentMethodOptionsRevolutPay>,
24607    /// If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options.
24608    #[serde(skip_serializing_if = "Option::is_none")]
24609    pub samsung_pay: Option<ConfirmPaymentIntentPaymentMethodOptionsSamsungPay>,
24610    /// If this is a `satispay` PaymentMethod, this sub-hash contains details about the Satispay payment method options.
24611    #[serde(skip_serializing_if = "Option::is_none")]
24612    pub satispay: Option<ConfirmPaymentIntentPaymentMethodOptionsSatispay>,
24613    /// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options.
24614    #[serde(skip_serializing_if = "Option::is_none")]
24615    pub sepa_debit: Option<ConfirmPaymentIntentPaymentMethodOptionsSepaDebit>,
24616    /// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options.
24617    #[serde(skip_serializing_if = "Option::is_none")]
24618    pub sofort: Option<ConfirmPaymentIntentPaymentMethodOptionsSofort>,
24619    /// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options.
24620    #[serde(skip_serializing_if = "Option::is_none")]
24621    pub swish: Option<ConfirmPaymentIntentPaymentMethodOptionsSwish>,
24622    /// If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options.
24623    #[serde(skip_serializing_if = "Option::is_none")]
24624    pub twint: Option<ConfirmPaymentIntentPaymentMethodOptionsTwint>,
24625    /// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options.
24626    #[serde(skip_serializing_if = "Option::is_none")]
24627    pub us_bank_account: Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccount>,
24628    /// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options.
24629    #[serde(skip_serializing_if = "Option::is_none")]
24630    pub wechat_pay: Option<ConfirmPaymentIntentPaymentMethodOptionsWechatPay>,
24631    /// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options.
24632    #[serde(skip_serializing_if = "Option::is_none")]
24633    pub zip: Option<ConfirmPaymentIntentPaymentMethodOptionsZip>,
24634}
24635impl ConfirmPaymentIntentPaymentMethodOptions {
24636    pub fn new() -> Self {
24637        Self {
24638            acss_debit: None,
24639            affirm: None,
24640            afterpay_clearpay: None,
24641            alipay: None,
24642            alma: None,
24643            amazon_pay: None,
24644            au_becs_debit: None,
24645            bacs_debit: None,
24646            bancontact: None,
24647            billie: None,
24648            blik: None,
24649            boleto: None,
24650            card: None,
24651            card_present: None,
24652            cashapp: None,
24653            crypto: None,
24654            customer_balance: None,
24655            eps: None,
24656            fpx: None,
24657            giropay: None,
24658            grabpay: None,
24659            ideal: None,
24660            interac_present: None,
24661            kakao_pay: None,
24662            klarna: None,
24663            konbini: None,
24664            kr_card: None,
24665            link: None,
24666            mb_way: None,
24667            mobilepay: None,
24668            multibanco: None,
24669            naver_pay: None,
24670            nz_bank_account: None,
24671            oxxo: None,
24672            p24: None,
24673            pay_by_bank: None,
24674            payco: None,
24675            paynow: None,
24676            paypal: None,
24677            pix: None,
24678            promptpay: None,
24679            revolut_pay: None,
24680            samsung_pay: None,
24681            satispay: None,
24682            sepa_debit: None,
24683            sofort: None,
24684            swish: None,
24685            twint: None,
24686            us_bank_account: None,
24687            wechat_pay: None,
24688            zip: None,
24689        }
24690    }
24691}
24692impl Default for ConfirmPaymentIntentPaymentMethodOptions {
24693    fn default() -> Self {
24694        Self::new()
24695    }
24696}
24697/// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options.
24698#[derive(Clone, Debug, serde::Serialize)]
24699pub struct ConfirmPaymentIntentPaymentMethodOptionsAcssDebit {
24700    /// Additional fields for Mandate creation
24701    #[serde(skip_serializing_if = "Option::is_none")]
24702    pub mandate_options: Option<ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptions>,
24703    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
24704    ///
24705    /// 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.
24706    /// 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.
24707    ///
24708    /// 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.
24709    ///
24710    /// 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).
24711    ///
24712    /// 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`.
24713    #[serde(skip_serializing_if = "Option::is_none")]
24714    pub setup_future_usage:
24715        Option<ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage>,
24716    /// Controls when Stripe will attempt to debit the funds from the customer's account.
24717    /// The date must be a string in YYYY-MM-DD format.
24718    /// The date must be in the future and between 3 and 15 calendar days from now.
24719    #[serde(skip_serializing_if = "Option::is_none")]
24720    pub target_date: Option<String>,
24721    /// Bank account verification method.
24722    #[serde(skip_serializing_if = "Option::is_none")]
24723    pub verification_method:
24724        Option<ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
24725}
24726impl ConfirmPaymentIntentPaymentMethodOptionsAcssDebit {
24727    pub fn new() -> Self {
24728        Self {
24729            mandate_options: None,
24730            setup_future_usage: None,
24731            target_date: None,
24732            verification_method: None,
24733        }
24734    }
24735}
24736impl Default for ConfirmPaymentIntentPaymentMethodOptionsAcssDebit {
24737    fn default() -> Self {
24738        Self::new()
24739    }
24740}
24741/// Additional fields for Mandate creation
24742#[derive(Clone, Debug, serde::Serialize)]
24743pub struct ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
24744    /// A URL for custom mandate text to render during confirmation step.
24745    /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,.
24746    /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent.
24747    #[serde(skip_serializing_if = "Option::is_none")]
24748    pub custom_mandate_url: Option<String>,
24749    /// Description of the mandate interval.
24750    /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'.
24751    #[serde(skip_serializing_if = "Option::is_none")]
24752    pub interval_description: Option<String>,
24753    /// Payment schedule for the mandate.
24754    #[serde(skip_serializing_if = "Option::is_none")]
24755    pub payment_schedule:
24756        Option<ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
24757    /// Transaction type of the mandate.
24758    #[serde(skip_serializing_if = "Option::is_none")]
24759    pub transaction_type:
24760        Option<ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
24761}
24762impl ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
24763    pub fn new() -> Self {
24764        Self {
24765            custom_mandate_url: None,
24766            interval_description: None,
24767            payment_schedule: None,
24768            transaction_type: None,
24769        }
24770    }
24771}
24772impl Default for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
24773    fn default() -> Self {
24774        Self::new()
24775    }
24776}
24777/// Payment schedule for the mandate.
24778#[derive(Copy, Clone, Eq, PartialEq)]
24779pub enum ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
24780    Combined,
24781    Interval,
24782    Sporadic,
24783}
24784impl ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
24785    pub fn as_str(self) -> &'static str {
24786        use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
24787        match self {
24788            Combined => "combined",
24789            Interval => "interval",
24790            Sporadic => "sporadic",
24791        }
24792    }
24793}
24794
24795impl std::str::FromStr
24796    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
24797{
24798    type Err = stripe_types::StripeParseError;
24799    fn from_str(s: &str) -> Result<Self, Self::Err> {
24800        use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
24801        match s {
24802            "combined" => Ok(Combined),
24803            "interval" => Ok(Interval),
24804            "sporadic" => Ok(Sporadic),
24805            _ => Err(stripe_types::StripeParseError),
24806        }
24807    }
24808}
24809impl std::fmt::Display
24810    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
24811{
24812    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24813        f.write_str(self.as_str())
24814    }
24815}
24816
24817impl std::fmt::Debug
24818    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
24819{
24820    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24821        f.write_str(self.as_str())
24822    }
24823}
24824impl serde::Serialize
24825    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
24826{
24827    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
24828    where
24829        S: serde::Serializer,
24830    {
24831        serializer.serialize_str(self.as_str())
24832    }
24833}
24834#[cfg(feature = "deserialize")]
24835impl<'de> serde::Deserialize<'de>
24836    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
24837{
24838    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
24839        use std::str::FromStr;
24840        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
24841        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"))
24842    }
24843}
24844/// Transaction type of the mandate.
24845#[derive(Copy, Clone, Eq, PartialEq)]
24846pub enum ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
24847    Business,
24848    Personal,
24849}
24850impl ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
24851    pub fn as_str(self) -> &'static str {
24852        use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
24853        match self {
24854            Business => "business",
24855            Personal => "personal",
24856        }
24857    }
24858}
24859
24860impl std::str::FromStr
24861    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
24862{
24863    type Err = stripe_types::StripeParseError;
24864    fn from_str(s: &str) -> Result<Self, Self::Err> {
24865        use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
24866        match s {
24867            "business" => Ok(Business),
24868            "personal" => Ok(Personal),
24869            _ => Err(stripe_types::StripeParseError),
24870        }
24871    }
24872}
24873impl std::fmt::Display
24874    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
24875{
24876    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24877        f.write_str(self.as_str())
24878    }
24879}
24880
24881impl std::fmt::Debug
24882    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
24883{
24884    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24885        f.write_str(self.as_str())
24886    }
24887}
24888impl serde::Serialize
24889    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
24890{
24891    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
24892    where
24893        S: serde::Serializer,
24894    {
24895        serializer.serialize_str(self.as_str())
24896    }
24897}
24898#[cfg(feature = "deserialize")]
24899impl<'de> serde::Deserialize<'de>
24900    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
24901{
24902    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
24903        use std::str::FromStr;
24904        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
24905        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"))
24906    }
24907}
24908/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
24909///
24910/// 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.
24911/// 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.
24912///
24913/// 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.
24914///
24915/// 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).
24916///
24917/// 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`.
24918#[derive(Copy, Clone, Eq, PartialEq)]
24919pub enum ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
24920    None,
24921    OffSession,
24922    OnSession,
24923}
24924impl ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
24925    pub fn as_str(self) -> &'static str {
24926        use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*;
24927        match self {
24928            None => "none",
24929            OffSession => "off_session",
24930            OnSession => "on_session",
24931        }
24932    }
24933}
24934
24935impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
24936    type Err = stripe_types::StripeParseError;
24937    fn from_str(s: &str) -> Result<Self, Self::Err> {
24938        use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*;
24939        match s {
24940            "none" => Ok(None),
24941            "off_session" => Ok(OffSession),
24942            "on_session" => Ok(OnSession),
24943            _ => Err(stripe_types::StripeParseError),
24944        }
24945    }
24946}
24947impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
24948    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24949        f.write_str(self.as_str())
24950    }
24951}
24952
24953impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
24954    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24955        f.write_str(self.as_str())
24956    }
24957}
24958impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
24959    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
24960    where
24961        S: serde::Serializer,
24962    {
24963        serializer.serialize_str(self.as_str())
24964    }
24965}
24966#[cfg(feature = "deserialize")]
24967impl<'de> serde::Deserialize<'de>
24968    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage
24969{
24970    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
24971        use std::str::FromStr;
24972        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
24973        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage"))
24974    }
24975}
24976/// Bank account verification method.
24977#[derive(Copy, Clone, Eq, PartialEq)]
24978pub enum ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
24979    Automatic,
24980    Instant,
24981    Microdeposits,
24982}
24983impl ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
24984    pub fn as_str(self) -> &'static str {
24985        use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
24986        match self {
24987            Automatic => "automatic",
24988            Instant => "instant",
24989            Microdeposits => "microdeposits",
24990        }
24991    }
24992}
24993
24994impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
24995    type Err = stripe_types::StripeParseError;
24996    fn from_str(s: &str) -> Result<Self, Self::Err> {
24997        use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
24998        match s {
24999            "automatic" => Ok(Automatic),
25000            "instant" => Ok(Instant),
25001            "microdeposits" => Ok(Microdeposits),
25002            _ => Err(stripe_types::StripeParseError),
25003        }
25004    }
25005}
25006impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
25007    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25008        f.write_str(self.as_str())
25009    }
25010}
25011
25012impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
25013    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25014        f.write_str(self.as_str())
25015    }
25016}
25017impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
25018    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
25019    where
25020        S: serde::Serializer,
25021    {
25022        serializer.serialize_str(self.as_str())
25023    }
25024}
25025#[cfg(feature = "deserialize")]
25026impl<'de> serde::Deserialize<'de>
25027    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod
25028{
25029    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
25030        use std::str::FromStr;
25031        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
25032        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod"))
25033    }
25034}
25035/// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options.
25036#[derive(Clone, Debug, serde::Serialize)]
25037pub struct ConfirmPaymentIntentPaymentMethodOptionsAffirm {
25038    /// Controls when the funds are captured from the customer's account.
25039    ///
25040    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
25041    ///
25042    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
25043    #[serde(skip_serializing_if = "Option::is_none")]
25044    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod>,
25045    /// Preferred language of the Affirm authorization page that the customer is redirected to.
25046    #[serde(skip_serializing_if = "Option::is_none")]
25047    pub preferred_locale: Option<String>,
25048    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
25049    ///
25050    /// 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.
25051    /// 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.
25052    ///
25053    /// 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.
25054    ///
25055    /// 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).
25056    ///
25057    /// 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`.
25058    #[serde(skip_serializing_if = "Option::is_none")]
25059    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage>,
25060}
25061impl ConfirmPaymentIntentPaymentMethodOptionsAffirm {
25062    pub fn new() -> Self {
25063        Self { capture_method: None, preferred_locale: None, setup_future_usage: None }
25064    }
25065}
25066impl Default for ConfirmPaymentIntentPaymentMethodOptionsAffirm {
25067    fn default() -> Self {
25068        Self::new()
25069    }
25070}
25071/// Controls when the funds are captured from the customer's account.
25072///
25073/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
25074///
25075/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
25076#[derive(Copy, Clone, Eq, PartialEq)]
25077pub enum ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
25078    Manual,
25079}
25080impl ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
25081    pub fn as_str(self) -> &'static str {
25082        use ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*;
25083        match self {
25084            Manual => "manual",
25085        }
25086    }
25087}
25088
25089impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
25090    type Err = stripe_types::StripeParseError;
25091    fn from_str(s: &str) -> Result<Self, Self::Err> {
25092        use ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*;
25093        match s {
25094            "manual" => Ok(Manual),
25095            _ => Err(stripe_types::StripeParseError),
25096        }
25097    }
25098}
25099impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
25100    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25101        f.write_str(self.as_str())
25102    }
25103}
25104
25105impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
25106    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25107        f.write_str(self.as_str())
25108    }
25109}
25110impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
25111    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
25112    where
25113        S: serde::Serializer,
25114    {
25115        serializer.serialize_str(self.as_str())
25116    }
25117}
25118#[cfg(feature = "deserialize")]
25119impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
25120    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
25121        use std::str::FromStr;
25122        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
25123        Self::from_str(&s).map_err(|_| {
25124            serde::de::Error::custom(
25125                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod",
25126            )
25127        })
25128    }
25129}
25130/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
25131///
25132/// 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.
25133/// 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.
25134///
25135/// 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.
25136///
25137/// 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).
25138///
25139/// 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`.
25140#[derive(Copy, Clone, Eq, PartialEq)]
25141pub enum ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
25142    None,
25143}
25144impl ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
25145    pub fn as_str(self) -> &'static str {
25146        use ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*;
25147        match self {
25148            None => "none",
25149        }
25150    }
25151}
25152
25153impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
25154    type Err = stripe_types::StripeParseError;
25155    fn from_str(s: &str) -> Result<Self, Self::Err> {
25156        use ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*;
25157        match s {
25158            "none" => Ok(None),
25159            _ => Err(stripe_types::StripeParseError),
25160        }
25161    }
25162}
25163impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
25164    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25165        f.write_str(self.as_str())
25166    }
25167}
25168
25169impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
25170    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25171        f.write_str(self.as_str())
25172    }
25173}
25174impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
25175    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
25176    where
25177        S: serde::Serializer,
25178    {
25179        serializer.serialize_str(self.as_str())
25180    }
25181}
25182#[cfg(feature = "deserialize")]
25183impl<'de> serde::Deserialize<'de>
25184    for ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage
25185{
25186    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
25187        use std::str::FromStr;
25188        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
25189        Self::from_str(&s).map_err(|_| {
25190            serde::de::Error::custom(
25191                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage",
25192            )
25193        })
25194    }
25195}
25196/// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options.
25197#[derive(Clone, Debug, serde::Serialize)]
25198pub struct ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpay {
25199    /// Controls when the funds are captured from the customer's account.
25200    ///
25201    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
25202    ///
25203    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
25204    #[serde(skip_serializing_if = "Option::is_none")]
25205    pub capture_method:
25206        Option<ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod>,
25207    /// An internal identifier or reference that this payment corresponds to.
25208    /// You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes.
25209    /// This field differs from the statement descriptor and item name.
25210    #[serde(skip_serializing_if = "Option::is_none")]
25211    pub reference: Option<String>,
25212    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
25213    ///
25214    /// 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.
25215    /// 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.
25216    ///
25217    /// 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.
25218    ///
25219    /// 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).
25220    ///
25221    /// 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`.
25222    #[serde(skip_serializing_if = "Option::is_none")]
25223    pub setup_future_usage:
25224        Option<ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage>,
25225}
25226impl ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpay {
25227    pub fn new() -> Self {
25228        Self { capture_method: None, reference: None, setup_future_usage: None }
25229    }
25230}
25231impl Default for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpay {
25232    fn default() -> Self {
25233        Self::new()
25234    }
25235}
25236/// Controls when the funds are captured from the customer's account.
25237///
25238/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
25239///
25240/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
25241#[derive(Copy, Clone, Eq, PartialEq)]
25242pub enum ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
25243    Manual,
25244}
25245impl ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
25246    pub fn as_str(self) -> &'static str {
25247        use ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*;
25248        match self {
25249            Manual => "manual",
25250        }
25251    }
25252}
25253
25254impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
25255    type Err = stripe_types::StripeParseError;
25256    fn from_str(s: &str) -> Result<Self, Self::Err> {
25257        use ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*;
25258        match s {
25259            "manual" => Ok(Manual),
25260            _ => Err(stripe_types::StripeParseError),
25261        }
25262    }
25263}
25264impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
25265    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25266        f.write_str(self.as_str())
25267    }
25268}
25269
25270impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
25271    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25272        f.write_str(self.as_str())
25273    }
25274}
25275impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
25276    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
25277    where
25278        S: serde::Serializer,
25279    {
25280        serializer.serialize_str(self.as_str())
25281    }
25282}
25283#[cfg(feature = "deserialize")]
25284impl<'de> serde::Deserialize<'de>
25285    for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod
25286{
25287    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
25288        use std::str::FromStr;
25289        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
25290        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod"))
25291    }
25292}
25293/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
25294///
25295/// 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.
25296/// 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.
25297///
25298/// 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.
25299///
25300/// 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).
25301///
25302/// 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`.
25303#[derive(Copy, Clone, Eq, PartialEq)]
25304pub enum ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
25305    None,
25306}
25307impl ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
25308    pub fn as_str(self) -> &'static str {
25309        use ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*;
25310        match self {
25311            None => "none",
25312        }
25313    }
25314}
25315
25316impl std::str::FromStr
25317    for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage
25318{
25319    type Err = stripe_types::StripeParseError;
25320    fn from_str(s: &str) -> Result<Self, Self::Err> {
25321        use ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*;
25322        match s {
25323            "none" => Ok(None),
25324            _ => Err(stripe_types::StripeParseError),
25325        }
25326    }
25327}
25328impl std::fmt::Display
25329    for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage
25330{
25331    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25332        f.write_str(self.as_str())
25333    }
25334}
25335
25336impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
25337    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25338        f.write_str(self.as_str())
25339    }
25340}
25341impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
25342    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
25343    where
25344        S: serde::Serializer,
25345    {
25346        serializer.serialize_str(self.as_str())
25347    }
25348}
25349#[cfg(feature = "deserialize")]
25350impl<'de> serde::Deserialize<'de>
25351    for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage
25352{
25353    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
25354        use std::str::FromStr;
25355        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
25356        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage"))
25357    }
25358}
25359/// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options.
25360#[derive(Copy, Clone, Debug, serde::Serialize)]
25361pub struct ConfirmPaymentIntentPaymentMethodOptionsAlipay {
25362    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
25363    ///
25364    /// 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.
25365    /// 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.
25366    ///
25367    /// 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.
25368    ///
25369    /// 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).
25370    ///
25371    /// 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`.
25372    #[serde(skip_serializing_if = "Option::is_none")]
25373    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage>,
25374}
25375impl ConfirmPaymentIntentPaymentMethodOptionsAlipay {
25376    pub fn new() -> Self {
25377        Self { setup_future_usage: None }
25378    }
25379}
25380impl Default for ConfirmPaymentIntentPaymentMethodOptionsAlipay {
25381    fn default() -> Self {
25382        Self::new()
25383    }
25384}
25385/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
25386///
25387/// 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.
25388/// 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.
25389///
25390/// 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.
25391///
25392/// 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).
25393///
25394/// 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`.
25395#[derive(Copy, Clone, Eq, PartialEq)]
25396pub enum ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
25397    None,
25398    OffSession,
25399}
25400impl ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
25401    pub fn as_str(self) -> &'static str {
25402        use ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*;
25403        match self {
25404            None => "none",
25405            OffSession => "off_session",
25406        }
25407    }
25408}
25409
25410impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
25411    type Err = stripe_types::StripeParseError;
25412    fn from_str(s: &str) -> Result<Self, Self::Err> {
25413        use ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*;
25414        match s {
25415            "none" => Ok(None),
25416            "off_session" => Ok(OffSession),
25417            _ => Err(stripe_types::StripeParseError),
25418        }
25419    }
25420}
25421impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
25422    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25423        f.write_str(self.as_str())
25424    }
25425}
25426
25427impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
25428    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25429        f.write_str(self.as_str())
25430    }
25431}
25432impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
25433    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
25434    where
25435        S: serde::Serializer,
25436    {
25437        serializer.serialize_str(self.as_str())
25438    }
25439}
25440#[cfg(feature = "deserialize")]
25441impl<'de> serde::Deserialize<'de>
25442    for ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage
25443{
25444    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
25445        use std::str::FromStr;
25446        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
25447        Self::from_str(&s).map_err(|_| {
25448            serde::de::Error::custom(
25449                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage",
25450            )
25451        })
25452    }
25453}
25454/// If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options.
25455#[derive(Copy, Clone, Debug, serde::Serialize)]
25456pub struct ConfirmPaymentIntentPaymentMethodOptionsAlma {
25457    /// Controls when the funds are captured from the customer's account.
25458    ///
25459    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
25460    ///
25461    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
25462    #[serde(skip_serializing_if = "Option::is_none")]
25463    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod>,
25464}
25465impl ConfirmPaymentIntentPaymentMethodOptionsAlma {
25466    pub fn new() -> Self {
25467        Self { capture_method: None }
25468    }
25469}
25470impl Default for ConfirmPaymentIntentPaymentMethodOptionsAlma {
25471    fn default() -> Self {
25472        Self::new()
25473    }
25474}
25475/// Controls when the funds are captured from the customer's account.
25476///
25477/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
25478///
25479/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
25480#[derive(Copy, Clone, Eq, PartialEq)]
25481pub enum ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
25482    Manual,
25483}
25484impl ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
25485    pub fn as_str(self) -> &'static str {
25486        use ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod::*;
25487        match self {
25488            Manual => "manual",
25489        }
25490    }
25491}
25492
25493impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
25494    type Err = stripe_types::StripeParseError;
25495    fn from_str(s: &str) -> Result<Self, Self::Err> {
25496        use ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod::*;
25497        match s {
25498            "manual" => Ok(Manual),
25499            _ => Err(stripe_types::StripeParseError),
25500        }
25501    }
25502}
25503impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
25504    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25505        f.write_str(self.as_str())
25506    }
25507}
25508
25509impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
25510    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25511        f.write_str(self.as_str())
25512    }
25513}
25514impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
25515    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
25516    where
25517        S: serde::Serializer,
25518    {
25519        serializer.serialize_str(self.as_str())
25520    }
25521}
25522#[cfg(feature = "deserialize")]
25523impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
25524    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
25525        use std::str::FromStr;
25526        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
25527        Self::from_str(&s).map_err(|_| {
25528            serde::de::Error::custom(
25529                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod",
25530            )
25531        })
25532    }
25533}
25534/// If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options.
25535#[derive(Copy, Clone, Debug, serde::Serialize)]
25536pub struct ConfirmPaymentIntentPaymentMethodOptionsAmazonPay {
25537    /// Controls when the funds are captured from the customer's account.
25538    ///
25539    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
25540    ///
25541    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
25542    #[serde(skip_serializing_if = "Option::is_none")]
25543    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod>,
25544    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
25545    ///
25546    /// 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.
25547    /// 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.
25548    ///
25549    /// 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.
25550    ///
25551    /// 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).
25552    #[serde(skip_serializing_if = "Option::is_none")]
25553    pub setup_future_usage:
25554        Option<ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage>,
25555}
25556impl ConfirmPaymentIntentPaymentMethodOptionsAmazonPay {
25557    pub fn new() -> Self {
25558        Self { capture_method: None, setup_future_usage: None }
25559    }
25560}
25561impl Default for ConfirmPaymentIntentPaymentMethodOptionsAmazonPay {
25562    fn default() -> Self {
25563        Self::new()
25564    }
25565}
25566/// Controls when the funds are captured from the customer's account.
25567///
25568/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
25569///
25570/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
25571#[derive(Copy, Clone, Eq, PartialEq)]
25572pub enum ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
25573    Manual,
25574}
25575impl ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
25576    pub fn as_str(self) -> &'static str {
25577        use ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod::*;
25578        match self {
25579            Manual => "manual",
25580        }
25581    }
25582}
25583
25584impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
25585    type Err = stripe_types::StripeParseError;
25586    fn from_str(s: &str) -> Result<Self, Self::Err> {
25587        use ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod::*;
25588        match s {
25589            "manual" => Ok(Manual),
25590            _ => Err(stripe_types::StripeParseError),
25591        }
25592    }
25593}
25594impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
25595    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25596        f.write_str(self.as_str())
25597    }
25598}
25599
25600impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
25601    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25602        f.write_str(self.as_str())
25603    }
25604}
25605impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
25606    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
25607    where
25608        S: serde::Serializer,
25609    {
25610        serializer.serialize_str(self.as_str())
25611    }
25612}
25613#[cfg(feature = "deserialize")]
25614impl<'de> serde::Deserialize<'de>
25615    for ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod
25616{
25617    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
25618        use std::str::FromStr;
25619        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
25620        Self::from_str(&s).map_err(|_| {
25621            serde::de::Error::custom(
25622                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod",
25623            )
25624        })
25625    }
25626}
25627/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
25628///
25629/// 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.
25630/// 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.
25631///
25632/// 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.
25633///
25634/// 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).
25635#[derive(Copy, Clone, Eq, PartialEq)]
25636pub enum ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
25637    None,
25638    OffSession,
25639}
25640impl ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
25641    pub fn as_str(self) -> &'static str {
25642        use ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage::*;
25643        match self {
25644            None => "none",
25645            OffSession => "off_session",
25646        }
25647    }
25648}
25649
25650impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
25651    type Err = stripe_types::StripeParseError;
25652    fn from_str(s: &str) -> Result<Self, Self::Err> {
25653        use ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage::*;
25654        match s {
25655            "none" => Ok(None),
25656            "off_session" => Ok(OffSession),
25657            _ => Err(stripe_types::StripeParseError),
25658        }
25659    }
25660}
25661impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
25662    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25663        f.write_str(self.as_str())
25664    }
25665}
25666
25667impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
25668    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25669        f.write_str(self.as_str())
25670    }
25671}
25672impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
25673    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
25674    where
25675        S: serde::Serializer,
25676    {
25677        serializer.serialize_str(self.as_str())
25678    }
25679}
25680#[cfg(feature = "deserialize")]
25681impl<'de> serde::Deserialize<'de>
25682    for ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage
25683{
25684    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
25685        use std::str::FromStr;
25686        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
25687        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage"))
25688    }
25689}
25690/// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options.
25691#[derive(Clone, Debug, serde::Serialize)]
25692pub struct ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebit {
25693    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
25694    ///
25695    /// 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.
25696    /// 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.
25697    ///
25698    /// 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.
25699    ///
25700    /// 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).
25701    ///
25702    /// 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`.
25703    #[serde(skip_serializing_if = "Option::is_none")]
25704    pub setup_future_usage:
25705        Option<ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage>,
25706    /// Controls when Stripe will attempt to debit the funds from the customer's account.
25707    /// The date must be a string in YYYY-MM-DD format.
25708    /// The date must be in the future and between 3 and 15 calendar days from now.
25709    #[serde(skip_serializing_if = "Option::is_none")]
25710    pub target_date: Option<String>,
25711}
25712impl ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebit {
25713    pub fn new() -> Self {
25714        Self { setup_future_usage: None, target_date: None }
25715    }
25716}
25717impl Default for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebit {
25718    fn default() -> Self {
25719        Self::new()
25720    }
25721}
25722/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
25723///
25724/// 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.
25725/// 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.
25726///
25727/// 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.
25728///
25729/// 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).
25730///
25731/// 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`.
25732#[derive(Copy, Clone, Eq, PartialEq)]
25733pub enum ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
25734    None,
25735    OffSession,
25736    OnSession,
25737}
25738impl ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
25739    pub fn as_str(self) -> &'static str {
25740        use ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*;
25741        match self {
25742            None => "none",
25743            OffSession => "off_session",
25744            OnSession => "on_session",
25745        }
25746    }
25747}
25748
25749impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
25750    type Err = stripe_types::StripeParseError;
25751    fn from_str(s: &str) -> Result<Self, Self::Err> {
25752        use ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*;
25753        match s {
25754            "none" => Ok(None),
25755            "off_session" => Ok(OffSession),
25756            "on_session" => Ok(OnSession),
25757            _ => Err(stripe_types::StripeParseError),
25758        }
25759    }
25760}
25761impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
25762    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25763        f.write_str(self.as_str())
25764    }
25765}
25766
25767impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
25768    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25769        f.write_str(self.as_str())
25770    }
25771}
25772impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
25773    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
25774    where
25775        S: serde::Serializer,
25776    {
25777        serializer.serialize_str(self.as_str())
25778    }
25779}
25780#[cfg(feature = "deserialize")]
25781impl<'de> serde::Deserialize<'de>
25782    for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage
25783{
25784    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
25785        use std::str::FromStr;
25786        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
25787        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage"))
25788    }
25789}
25790/// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options.
25791#[derive(Clone, Debug, serde::Serialize)]
25792pub struct ConfirmPaymentIntentPaymentMethodOptionsBacsDebit {
25793    /// Additional fields for Mandate creation
25794    #[serde(skip_serializing_if = "Option::is_none")]
25795    pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
25796    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
25797    ///
25798    /// 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.
25799    /// 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.
25800    ///
25801    /// 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.
25802    ///
25803    /// 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).
25804    ///
25805    /// 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`.
25806    #[serde(skip_serializing_if = "Option::is_none")]
25807    pub setup_future_usage:
25808        Option<ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage>,
25809    /// Controls when Stripe will attempt to debit the funds from the customer's account.
25810    /// The date must be a string in YYYY-MM-DD format.
25811    /// The date must be in the future and between 3 and 15 calendar days from now.
25812    #[serde(skip_serializing_if = "Option::is_none")]
25813    pub target_date: Option<String>,
25814}
25815impl ConfirmPaymentIntentPaymentMethodOptionsBacsDebit {
25816    pub fn new() -> Self {
25817        Self { mandate_options: None, setup_future_usage: None, target_date: None }
25818    }
25819}
25820impl Default for ConfirmPaymentIntentPaymentMethodOptionsBacsDebit {
25821    fn default() -> Self {
25822        Self::new()
25823    }
25824}
25825/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
25826///
25827/// 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.
25828/// 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.
25829///
25830/// 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.
25831///
25832/// 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).
25833///
25834/// 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`.
25835#[derive(Copy, Clone, Eq, PartialEq)]
25836pub enum ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
25837    None,
25838    OffSession,
25839    OnSession,
25840}
25841impl ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
25842    pub fn as_str(self) -> &'static str {
25843        use ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*;
25844        match self {
25845            None => "none",
25846            OffSession => "off_session",
25847            OnSession => "on_session",
25848        }
25849    }
25850}
25851
25852impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
25853    type Err = stripe_types::StripeParseError;
25854    fn from_str(s: &str) -> Result<Self, Self::Err> {
25855        use ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*;
25856        match s {
25857            "none" => Ok(None),
25858            "off_session" => Ok(OffSession),
25859            "on_session" => Ok(OnSession),
25860            _ => Err(stripe_types::StripeParseError),
25861        }
25862    }
25863}
25864impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
25865    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25866        f.write_str(self.as_str())
25867    }
25868}
25869
25870impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
25871    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25872        f.write_str(self.as_str())
25873    }
25874}
25875impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
25876    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
25877    where
25878        S: serde::Serializer,
25879    {
25880        serializer.serialize_str(self.as_str())
25881    }
25882}
25883#[cfg(feature = "deserialize")]
25884impl<'de> serde::Deserialize<'de>
25885    for ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage
25886{
25887    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
25888        use std::str::FromStr;
25889        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
25890        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage"))
25891    }
25892}
25893/// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options.
25894#[derive(Copy, Clone, Debug, serde::Serialize)]
25895pub struct ConfirmPaymentIntentPaymentMethodOptionsBancontact {
25896    /// Preferred language of the Bancontact authorization page that the customer is redirected to.
25897    #[serde(skip_serializing_if = "Option::is_none")]
25898    pub preferred_language:
25899        Option<ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage>,
25900    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
25901    ///
25902    /// 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.
25903    /// 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.
25904    ///
25905    /// 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.
25906    ///
25907    /// 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).
25908    ///
25909    /// 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`.
25910    #[serde(skip_serializing_if = "Option::is_none")]
25911    pub setup_future_usage:
25912        Option<ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage>,
25913}
25914impl ConfirmPaymentIntentPaymentMethodOptionsBancontact {
25915    pub fn new() -> Self {
25916        Self { preferred_language: None, setup_future_usage: None }
25917    }
25918}
25919impl Default for ConfirmPaymentIntentPaymentMethodOptionsBancontact {
25920    fn default() -> Self {
25921        Self::new()
25922    }
25923}
25924/// Preferred language of the Bancontact authorization page that the customer is redirected to.
25925#[derive(Copy, Clone, Eq, PartialEq)]
25926pub enum ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
25927    De,
25928    En,
25929    Fr,
25930    Nl,
25931}
25932impl ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
25933    pub fn as_str(self) -> &'static str {
25934        use ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*;
25935        match self {
25936            De => "de",
25937            En => "en",
25938            Fr => "fr",
25939            Nl => "nl",
25940        }
25941    }
25942}
25943
25944impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
25945    type Err = stripe_types::StripeParseError;
25946    fn from_str(s: &str) -> Result<Self, Self::Err> {
25947        use ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*;
25948        match s {
25949            "de" => Ok(De),
25950            "en" => Ok(En),
25951            "fr" => Ok(Fr),
25952            "nl" => Ok(Nl),
25953            _ => Err(stripe_types::StripeParseError),
25954        }
25955    }
25956}
25957impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
25958    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25959        f.write_str(self.as_str())
25960    }
25961}
25962
25963impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
25964    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25965        f.write_str(self.as_str())
25966    }
25967}
25968impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
25969    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
25970    where
25971        S: serde::Serializer,
25972    {
25973        serializer.serialize_str(self.as_str())
25974    }
25975}
25976#[cfg(feature = "deserialize")]
25977impl<'de> serde::Deserialize<'de>
25978    for ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage
25979{
25980    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
25981        use std::str::FromStr;
25982        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
25983        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage"))
25984    }
25985}
25986/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
25987///
25988/// 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.
25989/// 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.
25990///
25991/// 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.
25992///
25993/// 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).
25994///
25995/// 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`.
25996#[derive(Copy, Clone, Eq, PartialEq)]
25997pub enum ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
25998    None,
25999    OffSession,
26000}
26001impl ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
26002    pub fn as_str(self) -> &'static str {
26003        use ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*;
26004        match self {
26005            None => "none",
26006            OffSession => "off_session",
26007        }
26008    }
26009}
26010
26011impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
26012    type Err = stripe_types::StripeParseError;
26013    fn from_str(s: &str) -> Result<Self, Self::Err> {
26014        use ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*;
26015        match s {
26016            "none" => Ok(None),
26017            "off_session" => Ok(OffSession),
26018            _ => Err(stripe_types::StripeParseError),
26019        }
26020    }
26021}
26022impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
26023    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26024        f.write_str(self.as_str())
26025    }
26026}
26027
26028impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
26029    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26030        f.write_str(self.as_str())
26031    }
26032}
26033impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
26034    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26035    where
26036        S: serde::Serializer,
26037    {
26038        serializer.serialize_str(self.as_str())
26039    }
26040}
26041#[cfg(feature = "deserialize")]
26042impl<'de> serde::Deserialize<'de>
26043    for ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage
26044{
26045    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26046        use std::str::FromStr;
26047        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26048        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage"))
26049    }
26050}
26051/// If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options.
26052#[derive(Copy, Clone, Debug, serde::Serialize)]
26053pub struct ConfirmPaymentIntentPaymentMethodOptionsBillie {
26054    /// Controls when the funds are captured from the customer's account.
26055    ///
26056    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
26057    ///
26058    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
26059    #[serde(skip_serializing_if = "Option::is_none")]
26060    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod>,
26061}
26062impl ConfirmPaymentIntentPaymentMethodOptionsBillie {
26063    pub fn new() -> Self {
26064        Self { capture_method: None }
26065    }
26066}
26067impl Default for ConfirmPaymentIntentPaymentMethodOptionsBillie {
26068    fn default() -> Self {
26069        Self::new()
26070    }
26071}
26072/// Controls when the funds are captured from the customer's account.
26073///
26074/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
26075///
26076/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
26077#[derive(Copy, Clone, Eq, PartialEq)]
26078pub enum ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod {
26079    Manual,
26080}
26081impl ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod {
26082    pub fn as_str(self) -> &'static str {
26083        use ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod::*;
26084        match self {
26085            Manual => "manual",
26086        }
26087    }
26088}
26089
26090impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod {
26091    type Err = stripe_types::StripeParseError;
26092    fn from_str(s: &str) -> Result<Self, Self::Err> {
26093        use ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod::*;
26094        match s {
26095            "manual" => Ok(Manual),
26096            _ => Err(stripe_types::StripeParseError),
26097        }
26098    }
26099}
26100impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod {
26101    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26102        f.write_str(self.as_str())
26103    }
26104}
26105
26106impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod {
26107    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26108        f.write_str(self.as_str())
26109    }
26110}
26111impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod {
26112    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26113    where
26114        S: serde::Serializer,
26115    {
26116        serializer.serialize_str(self.as_str())
26117    }
26118}
26119#[cfg(feature = "deserialize")]
26120impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod {
26121    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26122        use std::str::FromStr;
26123        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26124        Self::from_str(&s).map_err(|_| {
26125            serde::de::Error::custom(
26126                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod",
26127            )
26128        })
26129    }
26130}
26131/// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options.
26132#[derive(Clone, Debug, serde::Serialize)]
26133pub struct ConfirmPaymentIntentPaymentMethodOptionsBlik {
26134    /// The 6-digit BLIK code that a customer has generated using their banking application.
26135    /// Can only be set on confirmation.
26136    #[serde(skip_serializing_if = "Option::is_none")]
26137    pub code: Option<String>,
26138    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
26139    ///
26140    /// 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.
26141    /// 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.
26142    ///
26143    /// 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.
26144    ///
26145    /// 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).
26146    ///
26147    /// 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`.
26148    #[serde(skip_serializing_if = "Option::is_none")]
26149    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage>,
26150}
26151impl ConfirmPaymentIntentPaymentMethodOptionsBlik {
26152    pub fn new() -> Self {
26153        Self { code: None, setup_future_usage: None }
26154    }
26155}
26156impl Default for ConfirmPaymentIntentPaymentMethodOptionsBlik {
26157    fn default() -> Self {
26158        Self::new()
26159    }
26160}
26161/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
26162///
26163/// 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.
26164/// 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.
26165///
26166/// 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.
26167///
26168/// 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).
26169///
26170/// 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`.
26171#[derive(Copy, Clone, Eq, PartialEq)]
26172pub enum ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
26173    None,
26174}
26175impl ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
26176    pub fn as_str(self) -> &'static str {
26177        use ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::*;
26178        match self {
26179            None => "none",
26180        }
26181    }
26182}
26183
26184impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
26185    type Err = stripe_types::StripeParseError;
26186    fn from_str(s: &str) -> Result<Self, Self::Err> {
26187        use ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::*;
26188        match s {
26189            "none" => Ok(None),
26190            _ => Err(stripe_types::StripeParseError),
26191        }
26192    }
26193}
26194impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
26195    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26196        f.write_str(self.as_str())
26197    }
26198}
26199
26200impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
26201    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26202        f.write_str(self.as_str())
26203    }
26204}
26205impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
26206    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26207    where
26208        S: serde::Serializer,
26209    {
26210        serializer.serialize_str(self.as_str())
26211    }
26212}
26213#[cfg(feature = "deserialize")]
26214impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
26215    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26216        use std::str::FromStr;
26217        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26218        Self::from_str(&s).map_err(|_| {
26219            serde::de::Error::custom(
26220                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage",
26221            )
26222        })
26223    }
26224}
26225/// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options.
26226#[derive(Copy, Clone, Debug, serde::Serialize)]
26227pub struct ConfirmPaymentIntentPaymentMethodOptionsBoleto {
26228    /// The number of calendar days before a Boleto voucher expires.
26229    /// 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.
26230    #[serde(skip_serializing_if = "Option::is_none")]
26231    pub expires_after_days: Option<u32>,
26232    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
26233    ///
26234    /// 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.
26235    /// 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.
26236    ///
26237    /// 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.
26238    ///
26239    /// 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).
26240    ///
26241    /// 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`.
26242    #[serde(skip_serializing_if = "Option::is_none")]
26243    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage>,
26244}
26245impl ConfirmPaymentIntentPaymentMethodOptionsBoleto {
26246    pub fn new() -> Self {
26247        Self { expires_after_days: None, setup_future_usage: None }
26248    }
26249}
26250impl Default for ConfirmPaymentIntentPaymentMethodOptionsBoleto {
26251    fn default() -> Self {
26252        Self::new()
26253    }
26254}
26255/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
26256///
26257/// 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.
26258/// 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.
26259///
26260/// 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.
26261///
26262/// 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).
26263///
26264/// 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`.
26265#[derive(Copy, Clone, Eq, PartialEq)]
26266pub enum ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
26267    None,
26268    OffSession,
26269    OnSession,
26270}
26271impl ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
26272    pub fn as_str(self) -> &'static str {
26273        use ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*;
26274        match self {
26275            None => "none",
26276            OffSession => "off_session",
26277            OnSession => "on_session",
26278        }
26279    }
26280}
26281
26282impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
26283    type Err = stripe_types::StripeParseError;
26284    fn from_str(s: &str) -> Result<Self, Self::Err> {
26285        use ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*;
26286        match s {
26287            "none" => Ok(None),
26288            "off_session" => Ok(OffSession),
26289            "on_session" => Ok(OnSession),
26290            _ => Err(stripe_types::StripeParseError),
26291        }
26292    }
26293}
26294impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
26295    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26296        f.write_str(self.as_str())
26297    }
26298}
26299
26300impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
26301    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26302        f.write_str(self.as_str())
26303    }
26304}
26305impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
26306    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26307    where
26308        S: serde::Serializer,
26309    {
26310        serializer.serialize_str(self.as_str())
26311    }
26312}
26313#[cfg(feature = "deserialize")]
26314impl<'de> serde::Deserialize<'de>
26315    for ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage
26316{
26317    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26318        use std::str::FromStr;
26319        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26320        Self::from_str(&s).map_err(|_| {
26321            serde::de::Error::custom(
26322                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage",
26323            )
26324        })
26325    }
26326}
26327/// Configuration for any card payments attempted on this PaymentIntent.
26328#[derive(Clone, Debug, serde::Serialize)]
26329pub struct ConfirmPaymentIntentPaymentMethodOptionsCard {
26330    /// Controls when the funds are captured from the customer's account.
26331    ///
26332    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
26333    ///
26334    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
26335    #[serde(skip_serializing_if = "Option::is_none")]
26336    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod>,
26337    /// A single-use `cvc_update` Token that represents a card CVC value.
26338    /// When provided, the CVC value will be verified during the card payment attempt.
26339    /// This parameter can only be provided during confirmation.
26340    #[serde(skip_serializing_if = "Option::is_none")]
26341    pub cvc_token: Option<String>,
26342    /// Installment configuration for payments attempted on this PaymentIntent.
26343    ///
26344    /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
26345    #[serde(skip_serializing_if = "Option::is_none")]
26346    pub installments: Option<ConfirmPaymentIntentPaymentMethodOptionsCardInstallments>,
26347    /// Configuration options for setting up an eMandate for cards issued in India.
26348    #[serde(skip_serializing_if = "Option::is_none")]
26349    pub mandate_options: Option<ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptions>,
26350    /// When specified, this parameter indicates that a transaction will be marked
26351    /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This
26352    /// parameter can only be provided during confirmation.
26353    #[serde(skip_serializing_if = "Option::is_none")]
26354    pub moto: Option<bool>,
26355    /// Selected network to process this PaymentIntent on.
26356    /// Depends on the available networks of the card attached to the PaymentIntent.
26357    /// Can be only set confirm-time.
26358    #[serde(skip_serializing_if = "Option::is_none")]
26359    pub network: Option<ConfirmPaymentIntentPaymentMethodOptionsCardNetwork>,
26360    /// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent.
26361    #[serde(skip_serializing_if = "Option::is_none")]
26362    pub request_extended_authorization:
26363        Option<ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization>,
26364    /// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent.
26365    #[serde(skip_serializing_if = "Option::is_none")]
26366    pub request_incremental_authorization:
26367        Option<ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization>,
26368    /// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent.
26369    #[serde(skip_serializing_if = "Option::is_none")]
26370    pub request_multicapture:
26371        Option<ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture>,
26372    /// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent.
26373    #[serde(skip_serializing_if = "Option::is_none")]
26374    pub request_overcapture: Option<ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture>,
26375    /// 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://stripe.com/docs/strong-customer-authentication).
26376    /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
26377    /// If not provided, this value defaults to `automatic`.
26378    /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
26379    #[serde(skip_serializing_if = "Option::is_none")]
26380    pub request_three_d_secure:
26381        Option<ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure>,
26382    /// When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e.
26383    /// using the cvc_token parameter).
26384    #[serde(skip_serializing_if = "Option::is_none")]
26385    pub require_cvc_recollection: Option<bool>,
26386    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
26387    ///
26388    /// 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.
26389    /// 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.
26390    ///
26391    /// 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.
26392    ///
26393    /// 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).
26394    ///
26395    /// 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`.
26396    #[serde(skip_serializing_if = "Option::is_none")]
26397    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage>,
26398    /// Provides information about a card payment that customers see on their statements.
26399    /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor.
26400    /// Maximum 22 characters.
26401    /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters.
26402    #[serde(skip_serializing_if = "Option::is_none")]
26403    pub statement_descriptor_suffix_kana: Option<String>,
26404    /// Provides information about a card payment that customers see on their statements.
26405    /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor.
26406    /// Maximum 17 characters.
26407    /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters.
26408    #[serde(skip_serializing_if = "Option::is_none")]
26409    pub statement_descriptor_suffix_kanji: Option<String>,
26410    /// If 3D Secure authentication was performed with a third-party provider,
26411    /// the authentication details to use for this payment.
26412    #[serde(skip_serializing_if = "Option::is_none")]
26413    pub three_d_secure: Option<ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecure>,
26414}
26415impl ConfirmPaymentIntentPaymentMethodOptionsCard {
26416    pub fn new() -> Self {
26417        Self {
26418            capture_method: None,
26419            cvc_token: None,
26420            installments: None,
26421            mandate_options: None,
26422            moto: None,
26423            network: None,
26424            request_extended_authorization: None,
26425            request_incremental_authorization: None,
26426            request_multicapture: None,
26427            request_overcapture: None,
26428            request_three_d_secure: None,
26429            require_cvc_recollection: None,
26430            setup_future_usage: None,
26431            statement_descriptor_suffix_kana: None,
26432            statement_descriptor_suffix_kanji: None,
26433            three_d_secure: None,
26434        }
26435    }
26436}
26437impl Default for ConfirmPaymentIntentPaymentMethodOptionsCard {
26438    fn default() -> Self {
26439        Self::new()
26440    }
26441}
26442/// Controls when the funds are captured from the customer's account.
26443///
26444/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
26445///
26446/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
26447#[derive(Copy, Clone, Eq, PartialEq)]
26448pub enum ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod {
26449    Manual,
26450}
26451impl ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod {
26452    pub fn as_str(self) -> &'static str {
26453        use ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod::*;
26454        match self {
26455            Manual => "manual",
26456        }
26457    }
26458}
26459
26460impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod {
26461    type Err = stripe_types::StripeParseError;
26462    fn from_str(s: &str) -> Result<Self, Self::Err> {
26463        use ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod::*;
26464        match s {
26465            "manual" => Ok(Manual),
26466            _ => Err(stripe_types::StripeParseError),
26467        }
26468    }
26469}
26470impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod {
26471    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26472        f.write_str(self.as_str())
26473    }
26474}
26475
26476impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod {
26477    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26478        f.write_str(self.as_str())
26479    }
26480}
26481impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod {
26482    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26483    where
26484        S: serde::Serializer,
26485    {
26486        serializer.serialize_str(self.as_str())
26487    }
26488}
26489#[cfg(feature = "deserialize")]
26490impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod {
26491    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26492        use std::str::FromStr;
26493        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26494        Self::from_str(&s).map_err(|_| {
26495            serde::de::Error::custom(
26496                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod",
26497            )
26498        })
26499    }
26500}
26501/// Installment configuration for payments attempted on this PaymentIntent.
26502///
26503/// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
26504#[derive(Copy, Clone, Debug, serde::Serialize)]
26505pub struct ConfirmPaymentIntentPaymentMethodOptionsCardInstallments {
26506    /// Setting to true enables installments for this PaymentIntent.
26507    /// This will cause the response to contain a list of available installment plans.
26508    /// Setting to false will prevent any selected plan from applying to a charge.
26509    #[serde(skip_serializing_if = "Option::is_none")]
26510    pub enabled: Option<bool>,
26511    /// The selected installment plan to use for this payment attempt.
26512    /// This parameter can only be provided during confirmation.
26513    #[serde(skip_serializing_if = "Option::is_none")]
26514    pub plan: Option<ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlan>,
26515}
26516impl ConfirmPaymentIntentPaymentMethodOptionsCardInstallments {
26517    pub fn new() -> Self {
26518        Self { enabled: None, plan: None }
26519    }
26520}
26521impl Default for ConfirmPaymentIntentPaymentMethodOptionsCardInstallments {
26522    fn default() -> Self {
26523        Self::new()
26524    }
26525}
26526/// The selected installment plan to use for this payment attempt.
26527/// This parameter can only be provided during confirmation.
26528#[derive(Copy, Clone, Debug, serde::Serialize)]
26529pub struct ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlan {
26530    /// For `fixed_count` installment plans, this is required.
26531    /// It represents the number of installment payments your customer will make to their credit card.
26532    #[serde(skip_serializing_if = "Option::is_none")]
26533    pub count: Option<u64>,
26534    /// For `fixed_count` installment plans, this is required.
26535    /// It represents the interval between installment payments your customer will make to their credit card.
26536    /// One of `month`.
26537    #[serde(skip_serializing_if = "Option::is_none")]
26538    pub interval: Option<ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval>,
26539    /// Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
26540    #[serde(rename = "type")]
26541    pub type_: ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType,
26542}
26543impl ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlan {
26544    pub fn new(
26545        type_: impl Into<ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType>,
26546    ) -> Self {
26547        Self { count: None, interval: None, type_: type_.into() }
26548    }
26549}
26550/// For `fixed_count` installment plans, this is required.
26551/// It represents the interval between installment payments your customer will make to their credit card.
26552/// One of `month`.
26553#[derive(Copy, Clone, Eq, PartialEq)]
26554pub enum ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
26555    Month,
26556}
26557impl ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
26558    pub fn as_str(self) -> &'static str {
26559        use ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*;
26560        match self {
26561            Month => "month",
26562        }
26563    }
26564}
26565
26566impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
26567    type Err = stripe_types::StripeParseError;
26568    fn from_str(s: &str) -> Result<Self, Self::Err> {
26569        use ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*;
26570        match s {
26571            "month" => Ok(Month),
26572            _ => Err(stripe_types::StripeParseError),
26573        }
26574    }
26575}
26576impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
26577    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26578        f.write_str(self.as_str())
26579    }
26580}
26581
26582impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
26583    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26584        f.write_str(self.as_str())
26585    }
26586}
26587impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
26588    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26589    where
26590        S: serde::Serializer,
26591    {
26592        serializer.serialize_str(self.as_str())
26593    }
26594}
26595#[cfg(feature = "deserialize")]
26596impl<'de> serde::Deserialize<'de>
26597    for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval
26598{
26599    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26600        use std::str::FromStr;
26601        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26602        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval"))
26603    }
26604}
26605/// Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
26606#[derive(Copy, Clone, Eq, PartialEq)]
26607pub enum ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
26608    Bonus,
26609    FixedCount,
26610    Revolving,
26611}
26612impl ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
26613    pub fn as_str(self) -> &'static str {
26614        use ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*;
26615        match self {
26616            Bonus => "bonus",
26617            FixedCount => "fixed_count",
26618            Revolving => "revolving",
26619        }
26620    }
26621}
26622
26623impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
26624    type Err = stripe_types::StripeParseError;
26625    fn from_str(s: &str) -> Result<Self, Self::Err> {
26626        use ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*;
26627        match s {
26628            "bonus" => Ok(Bonus),
26629            "fixed_count" => Ok(FixedCount),
26630            "revolving" => Ok(Revolving),
26631            _ => Err(stripe_types::StripeParseError),
26632        }
26633    }
26634}
26635impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
26636    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26637        f.write_str(self.as_str())
26638    }
26639}
26640
26641impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
26642    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26643        f.write_str(self.as_str())
26644    }
26645}
26646impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
26647    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26648    where
26649        S: serde::Serializer,
26650    {
26651        serializer.serialize_str(self.as_str())
26652    }
26653}
26654#[cfg(feature = "deserialize")]
26655impl<'de> serde::Deserialize<'de>
26656    for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType
26657{
26658    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26659        use std::str::FromStr;
26660        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26661        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType"))
26662    }
26663}
26664/// Configuration options for setting up an eMandate for cards issued in India.
26665#[derive(Clone, Debug, serde::Serialize)]
26666pub struct ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptions {
26667    /// Amount to be charged for future payments.
26668    pub amount: i64,
26669    /// One of `fixed` or `maximum`.
26670    /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
26671    /// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
26672    pub amount_type: ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType,
26673    /// A description of the mandate or subscription that is meant to be displayed to the customer.
26674    #[serde(skip_serializing_if = "Option::is_none")]
26675    pub description: Option<String>,
26676    /// End date of the mandate or subscription.
26677    /// If not provided, the mandate will be active until canceled.
26678    /// If provided, end date should be after start date.
26679    #[serde(skip_serializing_if = "Option::is_none")]
26680    pub end_date: Option<stripe_types::Timestamp>,
26681    /// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
26682    pub interval: ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval,
26683    /// The number of intervals between payments.
26684    /// For example, `interval=month` and `interval_count=3` indicates one payment every three months.
26685    /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).
26686    /// This parameter is optional when `interval=sporadic`.
26687    #[serde(skip_serializing_if = "Option::is_none")]
26688    pub interval_count: Option<u64>,
26689    /// Unique identifier for the mandate or subscription.
26690    pub reference: String,
26691    /// Start date of the mandate or subscription. Start date should not be lesser than yesterday.
26692    pub start_date: stripe_types::Timestamp,
26693    /// Specifies the type of mandates supported. Possible values are `india`.
26694    #[serde(skip_serializing_if = "Option::is_none")]
26695    pub supported_types:
26696        Option<Vec<ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
26697}
26698impl ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptions {
26699    pub fn new(
26700        amount: impl Into<i64>,
26701        amount_type: impl Into<ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
26702        interval: impl Into<ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval>,
26703        reference: impl Into<String>,
26704        start_date: impl Into<stripe_types::Timestamp>,
26705    ) -> Self {
26706        Self {
26707            amount: amount.into(),
26708            amount_type: amount_type.into(),
26709            description: None,
26710            end_date: None,
26711            interval: interval.into(),
26712            interval_count: None,
26713            reference: reference.into(),
26714            start_date: start_date.into(),
26715            supported_types: None,
26716        }
26717    }
26718}
26719/// One of `fixed` or `maximum`.
26720/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
26721/// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
26722#[derive(Copy, Clone, Eq, PartialEq)]
26723pub enum ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
26724    Fixed,
26725    Maximum,
26726}
26727impl ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
26728    pub fn as_str(self) -> &'static str {
26729        use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
26730        match self {
26731            Fixed => "fixed",
26732            Maximum => "maximum",
26733        }
26734    }
26735}
26736
26737impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
26738    type Err = stripe_types::StripeParseError;
26739    fn from_str(s: &str) -> Result<Self, Self::Err> {
26740        use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
26741        match s {
26742            "fixed" => Ok(Fixed),
26743            "maximum" => Ok(Maximum),
26744            _ => Err(stripe_types::StripeParseError),
26745        }
26746    }
26747}
26748impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
26749    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26750        f.write_str(self.as_str())
26751    }
26752}
26753
26754impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
26755    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26756        f.write_str(self.as_str())
26757    }
26758}
26759impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
26760    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26761    where
26762        S: serde::Serializer,
26763    {
26764        serializer.serialize_str(self.as_str())
26765    }
26766}
26767#[cfg(feature = "deserialize")]
26768impl<'de> serde::Deserialize<'de>
26769    for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType
26770{
26771    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26772        use std::str::FromStr;
26773        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26774        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType"))
26775    }
26776}
26777/// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
26778#[derive(Copy, Clone, Eq, PartialEq)]
26779pub enum ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
26780    Day,
26781    Month,
26782    Sporadic,
26783    Week,
26784    Year,
26785}
26786impl ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
26787    pub fn as_str(self) -> &'static str {
26788        use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
26789        match self {
26790            Day => "day",
26791            Month => "month",
26792            Sporadic => "sporadic",
26793            Week => "week",
26794            Year => "year",
26795        }
26796    }
26797}
26798
26799impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
26800    type Err = stripe_types::StripeParseError;
26801    fn from_str(s: &str) -> Result<Self, Self::Err> {
26802        use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
26803        match s {
26804            "day" => Ok(Day),
26805            "month" => Ok(Month),
26806            "sporadic" => Ok(Sporadic),
26807            "week" => Ok(Week),
26808            "year" => Ok(Year),
26809            _ => Err(stripe_types::StripeParseError),
26810        }
26811    }
26812}
26813impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
26814    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26815        f.write_str(self.as_str())
26816    }
26817}
26818
26819impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
26820    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26821        f.write_str(self.as_str())
26822    }
26823}
26824impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
26825    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26826    where
26827        S: serde::Serializer,
26828    {
26829        serializer.serialize_str(self.as_str())
26830    }
26831}
26832#[cfg(feature = "deserialize")]
26833impl<'de> serde::Deserialize<'de>
26834    for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval
26835{
26836    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26837        use std::str::FromStr;
26838        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26839        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval"))
26840    }
26841}
26842/// Specifies the type of mandates supported. Possible values are `india`.
26843#[derive(Copy, Clone, Eq, PartialEq)]
26844pub enum ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
26845    India,
26846}
26847impl ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
26848    pub fn as_str(self) -> &'static str {
26849        use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
26850        match self {
26851            India => "india",
26852        }
26853    }
26854}
26855
26856impl std::str::FromStr
26857    for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
26858{
26859    type Err = stripe_types::StripeParseError;
26860    fn from_str(s: &str) -> Result<Self, Self::Err> {
26861        use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
26862        match s {
26863            "india" => Ok(India),
26864            _ => Err(stripe_types::StripeParseError),
26865        }
26866    }
26867}
26868impl std::fmt::Display
26869    for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
26870{
26871    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26872        f.write_str(self.as_str())
26873    }
26874}
26875
26876impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
26877    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26878        f.write_str(self.as_str())
26879    }
26880}
26881impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
26882    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26883    where
26884        S: serde::Serializer,
26885    {
26886        serializer.serialize_str(self.as_str())
26887    }
26888}
26889#[cfg(feature = "deserialize")]
26890impl<'de> serde::Deserialize<'de>
26891    for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
26892{
26893    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26894        use std::str::FromStr;
26895        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26896        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"))
26897    }
26898}
26899/// Selected network to process this PaymentIntent on.
26900/// Depends on the available networks of the card attached to the PaymentIntent.
26901/// Can be only set confirm-time.
26902#[derive(Copy, Clone, Eq, PartialEq)]
26903pub enum ConfirmPaymentIntentPaymentMethodOptionsCardNetwork {
26904    Amex,
26905    CartesBancaires,
26906    Diners,
26907    Discover,
26908    EftposAu,
26909    Girocard,
26910    Interac,
26911    Jcb,
26912    Link,
26913    Mastercard,
26914    Unionpay,
26915    Unknown,
26916    Visa,
26917}
26918impl ConfirmPaymentIntentPaymentMethodOptionsCardNetwork {
26919    pub fn as_str(self) -> &'static str {
26920        use ConfirmPaymentIntentPaymentMethodOptionsCardNetwork::*;
26921        match self {
26922            Amex => "amex",
26923            CartesBancaires => "cartes_bancaires",
26924            Diners => "diners",
26925            Discover => "discover",
26926            EftposAu => "eftpos_au",
26927            Girocard => "girocard",
26928            Interac => "interac",
26929            Jcb => "jcb",
26930            Link => "link",
26931            Mastercard => "mastercard",
26932            Unionpay => "unionpay",
26933            Unknown => "unknown",
26934            Visa => "visa",
26935        }
26936    }
26937}
26938
26939impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardNetwork {
26940    type Err = stripe_types::StripeParseError;
26941    fn from_str(s: &str) -> Result<Self, Self::Err> {
26942        use ConfirmPaymentIntentPaymentMethodOptionsCardNetwork::*;
26943        match s {
26944            "amex" => Ok(Amex),
26945            "cartes_bancaires" => Ok(CartesBancaires),
26946            "diners" => Ok(Diners),
26947            "discover" => Ok(Discover),
26948            "eftpos_au" => Ok(EftposAu),
26949            "girocard" => Ok(Girocard),
26950            "interac" => Ok(Interac),
26951            "jcb" => Ok(Jcb),
26952            "link" => Ok(Link),
26953            "mastercard" => Ok(Mastercard),
26954            "unionpay" => Ok(Unionpay),
26955            "unknown" => Ok(Unknown),
26956            "visa" => Ok(Visa),
26957            _ => Err(stripe_types::StripeParseError),
26958        }
26959    }
26960}
26961impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardNetwork {
26962    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26963        f.write_str(self.as_str())
26964    }
26965}
26966
26967impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardNetwork {
26968    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26969        f.write_str(self.as_str())
26970    }
26971}
26972impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardNetwork {
26973    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26974    where
26975        S: serde::Serializer,
26976    {
26977        serializer.serialize_str(self.as_str())
26978    }
26979}
26980#[cfg(feature = "deserialize")]
26981impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsCardNetwork {
26982    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26983        use std::str::FromStr;
26984        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26985        Self::from_str(&s).map_err(|_| {
26986            serde::de::Error::custom(
26987                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardNetwork",
26988            )
26989        })
26990    }
26991}
26992/// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent.
26993#[derive(Copy, Clone, Eq, PartialEq)]
26994pub enum ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
26995    IfAvailable,
26996    Never,
26997}
26998impl ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
26999    pub fn as_str(self) -> &'static str {
27000        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*;
27001        match self {
27002            IfAvailable => "if_available",
27003            Never => "never",
27004        }
27005    }
27006}
27007
27008impl std::str::FromStr
27009    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization
27010{
27011    type Err = stripe_types::StripeParseError;
27012    fn from_str(s: &str) -> Result<Self, Self::Err> {
27013        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*;
27014        match s {
27015            "if_available" => Ok(IfAvailable),
27016            "never" => Ok(Never),
27017            _ => Err(stripe_types::StripeParseError),
27018        }
27019    }
27020}
27021impl std::fmt::Display
27022    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization
27023{
27024    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27025        f.write_str(self.as_str())
27026    }
27027}
27028
27029impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
27030    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27031        f.write_str(self.as_str())
27032    }
27033}
27034impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
27035    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27036    where
27037        S: serde::Serializer,
27038    {
27039        serializer.serialize_str(self.as_str())
27040    }
27041}
27042#[cfg(feature = "deserialize")]
27043impl<'de> serde::Deserialize<'de>
27044    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization
27045{
27046    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27047        use std::str::FromStr;
27048        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27049        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization"))
27050    }
27051}
27052/// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent.
27053#[derive(Copy, Clone, Eq, PartialEq)]
27054pub enum ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization {
27055    IfAvailable,
27056    Never,
27057}
27058impl ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization {
27059    pub fn as_str(self) -> &'static str {
27060        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*;
27061        match self {
27062            IfAvailable => "if_available",
27063            Never => "never",
27064        }
27065    }
27066}
27067
27068impl std::str::FromStr
27069    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
27070{
27071    type Err = stripe_types::StripeParseError;
27072    fn from_str(s: &str) -> Result<Self, Self::Err> {
27073        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*;
27074        match s {
27075            "if_available" => Ok(IfAvailable),
27076            "never" => Ok(Never),
27077            _ => Err(stripe_types::StripeParseError),
27078        }
27079    }
27080}
27081impl std::fmt::Display
27082    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
27083{
27084    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27085        f.write_str(self.as_str())
27086    }
27087}
27088
27089impl std::fmt::Debug
27090    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
27091{
27092    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27093        f.write_str(self.as_str())
27094    }
27095}
27096impl serde::Serialize
27097    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
27098{
27099    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27100    where
27101        S: serde::Serializer,
27102    {
27103        serializer.serialize_str(self.as_str())
27104    }
27105}
27106#[cfg(feature = "deserialize")]
27107impl<'de> serde::Deserialize<'de>
27108    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
27109{
27110    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27111        use std::str::FromStr;
27112        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27113        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization"))
27114    }
27115}
27116/// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent.
27117#[derive(Copy, Clone, Eq, PartialEq)]
27118pub enum ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture {
27119    IfAvailable,
27120    Never,
27121}
27122impl ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture {
27123    pub fn as_str(self) -> &'static str {
27124        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture::*;
27125        match self {
27126            IfAvailable => "if_available",
27127            Never => "never",
27128        }
27129    }
27130}
27131
27132impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture {
27133    type Err = stripe_types::StripeParseError;
27134    fn from_str(s: &str) -> Result<Self, Self::Err> {
27135        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture::*;
27136        match s {
27137            "if_available" => Ok(IfAvailable),
27138            "never" => Ok(Never),
27139            _ => Err(stripe_types::StripeParseError),
27140        }
27141    }
27142}
27143impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture {
27144    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27145        f.write_str(self.as_str())
27146    }
27147}
27148
27149impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture {
27150    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27151        f.write_str(self.as_str())
27152    }
27153}
27154impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture {
27155    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27156    where
27157        S: serde::Serializer,
27158    {
27159        serializer.serialize_str(self.as_str())
27160    }
27161}
27162#[cfg(feature = "deserialize")]
27163impl<'de> serde::Deserialize<'de>
27164    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture
27165{
27166    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27167        use std::str::FromStr;
27168        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27169        Self::from_str(&s).map_err(|_| {
27170            serde::de::Error::custom(
27171                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture",
27172            )
27173        })
27174    }
27175}
27176/// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent.
27177#[derive(Copy, Clone, Eq, PartialEq)]
27178pub enum ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture {
27179    IfAvailable,
27180    Never,
27181}
27182impl ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture {
27183    pub fn as_str(self) -> &'static str {
27184        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture::*;
27185        match self {
27186            IfAvailable => "if_available",
27187            Never => "never",
27188        }
27189    }
27190}
27191
27192impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture {
27193    type Err = stripe_types::StripeParseError;
27194    fn from_str(s: &str) -> Result<Self, Self::Err> {
27195        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture::*;
27196        match s {
27197            "if_available" => Ok(IfAvailable),
27198            "never" => Ok(Never),
27199            _ => Err(stripe_types::StripeParseError),
27200        }
27201    }
27202}
27203impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture {
27204    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27205        f.write_str(self.as_str())
27206    }
27207}
27208
27209impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture {
27210    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27211        f.write_str(self.as_str())
27212    }
27213}
27214impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture {
27215    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27216    where
27217        S: serde::Serializer,
27218    {
27219        serializer.serialize_str(self.as_str())
27220    }
27221}
27222#[cfg(feature = "deserialize")]
27223impl<'de> serde::Deserialize<'de>
27224    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture
27225{
27226    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27227        use std::str::FromStr;
27228        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27229        Self::from_str(&s).map_err(|_| {
27230            serde::de::Error::custom(
27231                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture",
27232            )
27233        })
27234    }
27235}
27236/// 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://stripe.com/docs/strong-customer-authentication).
27237/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
27238/// If not provided, this value defaults to `automatic`.
27239/// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
27240#[derive(Copy, Clone, Eq, PartialEq)]
27241pub enum ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
27242    Any,
27243    Automatic,
27244    Challenge,
27245}
27246impl ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
27247    pub fn as_str(self) -> &'static str {
27248        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
27249        match self {
27250            Any => "any",
27251            Automatic => "automatic",
27252            Challenge => "challenge",
27253        }
27254    }
27255}
27256
27257impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
27258    type Err = stripe_types::StripeParseError;
27259    fn from_str(s: &str) -> Result<Self, Self::Err> {
27260        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
27261        match s {
27262            "any" => Ok(Any),
27263            "automatic" => Ok(Automatic),
27264            "challenge" => Ok(Challenge),
27265            _ => Err(stripe_types::StripeParseError),
27266        }
27267    }
27268}
27269impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
27270    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27271        f.write_str(self.as_str())
27272    }
27273}
27274
27275impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
27276    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27277        f.write_str(self.as_str())
27278    }
27279}
27280impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
27281    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27282    where
27283        S: serde::Serializer,
27284    {
27285        serializer.serialize_str(self.as_str())
27286    }
27287}
27288#[cfg(feature = "deserialize")]
27289impl<'de> serde::Deserialize<'de>
27290    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure
27291{
27292    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27293        use std::str::FromStr;
27294        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27295        Self::from_str(&s).map_err(|_| {
27296            serde::de::Error::custom(
27297                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure",
27298            )
27299        })
27300    }
27301}
27302/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
27303///
27304/// 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.
27305/// 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.
27306///
27307/// 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.
27308///
27309/// 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).
27310///
27311/// 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`.
27312#[derive(Copy, Clone, Eq, PartialEq)]
27313pub enum ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
27314    None,
27315    OffSession,
27316    OnSession,
27317}
27318impl ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
27319    pub fn as_str(self) -> &'static str {
27320        use ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*;
27321        match self {
27322            None => "none",
27323            OffSession => "off_session",
27324            OnSession => "on_session",
27325        }
27326    }
27327}
27328
27329impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
27330    type Err = stripe_types::StripeParseError;
27331    fn from_str(s: &str) -> Result<Self, Self::Err> {
27332        use ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*;
27333        match s {
27334            "none" => Ok(None),
27335            "off_session" => Ok(OffSession),
27336            "on_session" => Ok(OnSession),
27337            _ => Err(stripe_types::StripeParseError),
27338        }
27339    }
27340}
27341impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
27342    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27343        f.write_str(self.as_str())
27344    }
27345}
27346
27347impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
27348    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27349        f.write_str(self.as_str())
27350    }
27351}
27352impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
27353    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27354    where
27355        S: serde::Serializer,
27356    {
27357        serializer.serialize_str(self.as_str())
27358    }
27359}
27360#[cfg(feature = "deserialize")]
27361impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
27362    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27363        use std::str::FromStr;
27364        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27365        Self::from_str(&s).map_err(|_| {
27366            serde::de::Error::custom(
27367                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage",
27368            )
27369        })
27370    }
27371}
27372/// If 3D Secure authentication was performed with a third-party provider,
27373/// the authentication details to use for this payment.
27374#[derive(Clone, Debug, serde::Serialize)]
27375pub struct ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecure {
27376    /// The `transStatus` returned from the card Issuer’s ACS in the ARes.
27377    #[serde(skip_serializing_if = "Option::is_none")]
27378    pub ares_trans_status:
27379        Option<ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
27380    /// The cryptogram, also known as the "authentication value" (AAV, CAVV or
27381    /// AEVV). This value is 20 bytes, base64-encoded into a 28-character string.
27382    /// (Most 3D Secure providers will return the base64-encoded version, which
27383    /// is what you should specify here.)
27384    pub cryptogram: String,
27385    /// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
27386    /// provider and indicates what degree of authentication was performed.
27387    #[serde(skip_serializing_if = "Option::is_none")]
27388    pub electronic_commerce_indicator:
27389        Option<ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
27390    /// The exemption requested via 3DS and accepted by the issuer at authentication time.
27391    #[serde(skip_serializing_if = "Option::is_none")]
27392    pub exemption_indicator:
27393        Option<ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator>,
27394    /// Network specific 3DS fields. Network specific arguments require an
27395    /// explicit card brand choice. The parameter `payment_method_options.card.network``
27396    /// must be populated accordingly
27397    #[serde(skip_serializing_if = "Option::is_none")]
27398    pub network_options:
27399        Option<ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
27400    /// The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the
27401    /// AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99.
27402    #[serde(skip_serializing_if = "Option::is_none")]
27403    pub requestor_challenge_indicator: Option<String>,
27404    /// For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server
27405    /// Transaction ID (dsTransID).
27406    pub transaction_id: String,
27407    /// The version of 3D Secure that was performed.
27408    pub version: ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion,
27409}
27410impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecure {
27411    pub fn new(
27412        cryptogram: impl Into<String>,
27413        transaction_id: impl Into<String>,
27414        version: impl Into<ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion>,
27415    ) -> Self {
27416        Self {
27417            ares_trans_status: None,
27418            cryptogram: cryptogram.into(),
27419            electronic_commerce_indicator: None,
27420            exemption_indicator: None,
27421            network_options: None,
27422            requestor_challenge_indicator: None,
27423            transaction_id: transaction_id.into(),
27424            version: version.into(),
27425        }
27426    }
27427}
27428/// The `transStatus` returned from the card Issuer’s ACS in the ARes.
27429#[derive(Copy, Clone, Eq, PartialEq)]
27430pub enum ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
27431    A,
27432    C,
27433    I,
27434    N,
27435    R,
27436    U,
27437    Y,
27438}
27439impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
27440    pub fn as_str(self) -> &'static str {
27441        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
27442        match self {
27443            A => "A",
27444            C => "C",
27445            I => "I",
27446            N => "N",
27447            R => "R",
27448            U => "U",
27449            Y => "Y",
27450        }
27451    }
27452}
27453
27454impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
27455    type Err = stripe_types::StripeParseError;
27456    fn from_str(s: &str) -> Result<Self, Self::Err> {
27457        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
27458        match s {
27459            "A" => Ok(A),
27460            "C" => Ok(C),
27461            "I" => Ok(I),
27462            "N" => Ok(N),
27463            "R" => Ok(R),
27464            "U" => Ok(U),
27465            "Y" => Ok(Y),
27466            _ => Err(stripe_types::StripeParseError),
27467        }
27468    }
27469}
27470impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
27471    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27472        f.write_str(self.as_str())
27473    }
27474}
27475
27476impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
27477    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27478        f.write_str(self.as_str())
27479    }
27480}
27481impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
27482    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27483    where
27484        S: serde::Serializer,
27485    {
27486        serializer.serialize_str(self.as_str())
27487    }
27488}
27489#[cfg(feature = "deserialize")]
27490impl<'de> serde::Deserialize<'de>
27491    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
27492{
27493    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27494        use std::str::FromStr;
27495        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27496        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"))
27497    }
27498}
27499/// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
27500/// provider and indicates what degree of authentication was performed.
27501#[derive(Copy, Clone, Eq, PartialEq)]
27502pub enum ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
27503    V01,
27504    V02,
27505    V05,
27506    V06,
27507    V07,
27508}
27509impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
27510    pub fn as_str(self) -> &'static str {
27511        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
27512        match self {
27513            V01 => "01",
27514            V02 => "02",
27515            V05 => "05",
27516            V06 => "06",
27517            V07 => "07",
27518        }
27519    }
27520}
27521
27522impl std::str::FromStr
27523    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
27524{
27525    type Err = stripe_types::StripeParseError;
27526    fn from_str(s: &str) -> Result<Self, Self::Err> {
27527        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
27528        match s {
27529            "01" => Ok(V01),
27530            "02" => Ok(V02),
27531            "05" => Ok(V05),
27532            "06" => Ok(V06),
27533            "07" => Ok(V07),
27534            _ => Err(stripe_types::StripeParseError),
27535        }
27536    }
27537}
27538impl std::fmt::Display
27539    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
27540{
27541    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27542        f.write_str(self.as_str())
27543    }
27544}
27545
27546impl std::fmt::Debug
27547    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
27548{
27549    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27550        f.write_str(self.as_str())
27551    }
27552}
27553impl serde::Serialize
27554    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
27555{
27556    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27557    where
27558        S: serde::Serializer,
27559    {
27560        serializer.serialize_str(self.as_str())
27561    }
27562}
27563#[cfg(feature = "deserialize")]
27564impl<'de> serde::Deserialize<'de>
27565    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
27566{
27567    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27568        use std::str::FromStr;
27569        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27570        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"))
27571    }
27572}
27573/// The exemption requested via 3DS and accepted by the issuer at authentication time.
27574#[derive(Copy, Clone, Eq, PartialEq)]
27575pub enum ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator {
27576    LowRisk,
27577    None,
27578}
27579impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator {
27580    pub fn as_str(self) -> &'static str {
27581        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::*;
27582        match self {
27583            LowRisk => "low_risk",
27584            None => "none",
27585        }
27586    }
27587}
27588
27589impl std::str::FromStr
27590    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
27591{
27592    type Err = stripe_types::StripeParseError;
27593    fn from_str(s: &str) -> Result<Self, Self::Err> {
27594        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::*;
27595        match s {
27596            "low_risk" => Ok(LowRisk),
27597            "none" => Ok(None),
27598            _ => Err(stripe_types::StripeParseError),
27599        }
27600    }
27601}
27602impl std::fmt::Display
27603    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
27604{
27605    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27606        f.write_str(self.as_str())
27607    }
27608}
27609
27610impl std::fmt::Debug
27611    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
27612{
27613    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27614        f.write_str(self.as_str())
27615    }
27616}
27617impl serde::Serialize
27618    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
27619{
27620    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27621    where
27622        S: serde::Serializer,
27623    {
27624        serializer.serialize_str(self.as_str())
27625    }
27626}
27627#[cfg(feature = "deserialize")]
27628impl<'de> serde::Deserialize<'de>
27629    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
27630{
27631    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27632        use std::str::FromStr;
27633        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27634        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator"))
27635    }
27636}
27637/// Network specific 3DS fields. Network specific arguments require an
27638/// explicit card brand choice. The parameter `payment_method_options.card.network``
27639/// must be populated accordingly
27640#[derive(Clone, Debug, serde::Serialize)]
27641pub struct ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
27642    /// Cartes Bancaires-specific 3DS fields.
27643    #[serde(skip_serializing_if = "Option::is_none")]
27644    pub cartes_bancaires: Option<
27645        ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires,
27646    >,
27647}
27648impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
27649    pub fn new() -> Self {
27650        Self { cartes_bancaires: None }
27651    }
27652}
27653impl Default for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
27654    fn default() -> Self {
27655        Self::new()
27656    }
27657}
27658/// Cartes Bancaires-specific 3DS fields.
27659#[derive(Clone, Debug, serde::Serialize)]
27660pub struct ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
27661    /// The cryptogram calculation algorithm used by the card Issuer's ACS
27662    /// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
27663    /// messageExtension: CB-AVALGO
27664pub cb_avalgo: ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
27665    /// The exemption indicator returned from Cartes Bancaires in the ARes.
27666    /// message extension: CB-EXEMPTION; string (4 characters)
27667    /// This is a 3 byte bitmap (low significant byte first and most significant
27668    /// bit first) that has been Base64 encoded
27669#[serde(skip_serializing_if = "Option::is_none")]
27670pub cb_exemption: Option<String>,
27671    /// The risk score returned from Cartes Bancaires in the ARes.
27672    /// message extension: CB-SCORE; numeric value 0-99
27673#[serde(skip_serializing_if = "Option::is_none")]
27674pub cb_score: Option<i64>,
27675
27676}
27677impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
27678    pub fn new(
27679        cb_avalgo: impl Into<ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
27680    ) -> Self {
27681        Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
27682    }
27683}
27684/// The cryptogram calculation algorithm used by the card Issuer's ACS
27685/// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
27686/// messageExtension: CB-AVALGO
27687#[derive(Copy, Clone, Eq, PartialEq)]
27688pub enum ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
27689{
27690    V0,
27691    V1,
27692    V2,
27693    V3,
27694    V4,
27695    A,
27696}
27697impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
27698    pub fn as_str(self) -> &'static str {
27699        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
27700        match self {
27701            V0 => "0",
27702            V1 => "1",
27703            V2 => "2",
27704            V3 => "3",
27705            V4 => "4",
27706            A => "A",
27707        }
27708    }
27709}
27710
27711impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
27712    type Err = stripe_types::StripeParseError;
27713    fn from_str(s: &str) -> Result<Self, Self::Err> {
27714        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
27715        match s {
27716    "0" => Ok(V0),
27717"1" => Ok(V1),
27718"2" => Ok(V2),
27719"3" => Ok(V3),
27720"4" => Ok(V4),
27721"A" => Ok(A),
27722_ => Err(stripe_types::StripeParseError)
27723
27724        }
27725    }
27726}
27727impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
27728    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27729        f.write_str(self.as_str())
27730    }
27731}
27732
27733impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
27734    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27735        f.write_str(self.as_str())
27736    }
27737}
27738impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
27739    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
27740        serializer.serialize_str(self.as_str())
27741    }
27742}
27743#[cfg(feature = "deserialize")]
27744impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
27745    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27746        use std::str::FromStr;
27747        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27748        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"))
27749    }
27750}
27751/// The version of 3D Secure that was performed.
27752#[derive(Copy, Clone, Eq, PartialEq)]
27753pub enum ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
27754    V1_0_2,
27755    V2_1_0,
27756    V2_2_0,
27757}
27758impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
27759    pub fn as_str(self) -> &'static str {
27760        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
27761        match self {
27762            V1_0_2 => "1.0.2",
27763            V2_1_0 => "2.1.0",
27764            V2_2_0 => "2.2.0",
27765        }
27766    }
27767}
27768
27769impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
27770    type Err = stripe_types::StripeParseError;
27771    fn from_str(s: &str) -> Result<Self, Self::Err> {
27772        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
27773        match s {
27774            "1.0.2" => Ok(V1_0_2),
27775            "2.1.0" => Ok(V2_1_0),
27776            "2.2.0" => Ok(V2_2_0),
27777            _ => Err(stripe_types::StripeParseError),
27778        }
27779    }
27780}
27781impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
27782    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27783        f.write_str(self.as_str())
27784    }
27785}
27786
27787impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
27788    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27789        f.write_str(self.as_str())
27790    }
27791}
27792impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
27793    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27794    where
27795        S: serde::Serializer,
27796    {
27797        serializer.serialize_str(self.as_str())
27798    }
27799}
27800#[cfg(feature = "deserialize")]
27801impl<'de> serde::Deserialize<'de>
27802    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion
27803{
27804    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27805        use std::str::FromStr;
27806        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27807        Self::from_str(&s).map_err(|_| {
27808            serde::de::Error::custom(
27809                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion",
27810            )
27811        })
27812    }
27813}
27814/// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
27815#[derive(Copy, Clone, Debug, serde::Serialize)]
27816pub struct ConfirmPaymentIntentPaymentMethodOptionsCardPresent {
27817    /// Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity).
27818    #[serde(skip_serializing_if = "Option::is_none")]
27819    pub request_extended_authorization: Option<bool>,
27820    /// Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible.
27821    /// Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support.
27822    #[serde(skip_serializing_if = "Option::is_none")]
27823    pub request_incremental_authorization_support: Option<bool>,
27824    /// Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes.
27825    #[serde(skip_serializing_if = "Option::is_none")]
27826    pub routing: Option<ConfirmPaymentIntentPaymentMethodOptionsCardPresentRouting>,
27827}
27828impl ConfirmPaymentIntentPaymentMethodOptionsCardPresent {
27829    pub fn new() -> Self {
27830        Self {
27831            request_extended_authorization: None,
27832            request_incremental_authorization_support: None,
27833            routing: None,
27834        }
27835    }
27836}
27837impl Default for ConfirmPaymentIntentPaymentMethodOptionsCardPresent {
27838    fn default() -> Self {
27839        Self::new()
27840    }
27841}
27842/// Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes.
27843#[derive(Copy, Clone, Debug, serde::Serialize)]
27844pub struct ConfirmPaymentIntentPaymentMethodOptionsCardPresentRouting {
27845    /// Routing requested priority
27846    #[serde(skip_serializing_if = "Option::is_none")]
27847    pub requested_priority:
27848        Option<ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority>,
27849}
27850impl ConfirmPaymentIntentPaymentMethodOptionsCardPresentRouting {
27851    pub fn new() -> Self {
27852        Self { requested_priority: None }
27853    }
27854}
27855impl Default for ConfirmPaymentIntentPaymentMethodOptionsCardPresentRouting {
27856    fn default() -> Self {
27857        Self::new()
27858    }
27859}
27860/// Routing requested priority
27861#[derive(Copy, Clone, Eq, PartialEq)]
27862pub enum ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority {
27863    Domestic,
27864    International,
27865}
27866impl ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority {
27867    pub fn as_str(self) -> &'static str {
27868        use ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority::*;
27869        match self {
27870            Domestic => "domestic",
27871            International => "international",
27872        }
27873    }
27874}
27875
27876impl std::str::FromStr
27877    for ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
27878{
27879    type Err = stripe_types::StripeParseError;
27880    fn from_str(s: &str) -> Result<Self, Self::Err> {
27881        use ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority::*;
27882        match s {
27883            "domestic" => Ok(Domestic),
27884            "international" => Ok(International),
27885            _ => Err(stripe_types::StripeParseError),
27886        }
27887    }
27888}
27889impl std::fmt::Display
27890    for ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
27891{
27892    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27893        f.write_str(self.as_str())
27894    }
27895}
27896
27897impl std::fmt::Debug
27898    for ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
27899{
27900    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27901        f.write_str(self.as_str())
27902    }
27903}
27904impl serde::Serialize
27905    for ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
27906{
27907    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27908    where
27909        S: serde::Serializer,
27910    {
27911        serializer.serialize_str(self.as_str())
27912    }
27913}
27914#[cfg(feature = "deserialize")]
27915impl<'de> serde::Deserialize<'de>
27916    for ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
27917{
27918    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27919        use std::str::FromStr;
27920        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27921        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority"))
27922    }
27923}
27924/// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options.
27925#[derive(Copy, Clone, Debug, serde::Serialize)]
27926pub struct ConfirmPaymentIntentPaymentMethodOptionsCashapp {
27927    /// Controls when the funds are captured from the customer's account.
27928    ///
27929    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
27930    ///
27931    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
27932    #[serde(skip_serializing_if = "Option::is_none")]
27933    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod>,
27934    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
27935    ///
27936    /// 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.
27937    /// 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.
27938    ///
27939    /// 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.
27940    ///
27941    /// 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).
27942    ///
27943    /// 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`.
27944    #[serde(skip_serializing_if = "Option::is_none")]
27945    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage>,
27946}
27947impl ConfirmPaymentIntentPaymentMethodOptionsCashapp {
27948    pub fn new() -> Self {
27949        Self { capture_method: None, setup_future_usage: None }
27950    }
27951}
27952impl Default for ConfirmPaymentIntentPaymentMethodOptionsCashapp {
27953    fn default() -> Self {
27954        Self::new()
27955    }
27956}
27957/// Controls when the funds are captured from the customer's account.
27958///
27959/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
27960///
27961/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
27962#[derive(Copy, Clone, Eq, PartialEq)]
27963pub enum ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod {
27964    Manual,
27965}
27966impl ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod {
27967    pub fn as_str(self) -> &'static str {
27968        use ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod::*;
27969        match self {
27970            Manual => "manual",
27971        }
27972    }
27973}
27974
27975impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod {
27976    type Err = stripe_types::StripeParseError;
27977    fn from_str(s: &str) -> Result<Self, Self::Err> {
27978        use ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod::*;
27979        match s {
27980            "manual" => Ok(Manual),
27981            _ => Err(stripe_types::StripeParseError),
27982        }
27983    }
27984}
27985impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod {
27986    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27987        f.write_str(self.as_str())
27988    }
27989}
27990
27991impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod {
27992    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27993        f.write_str(self.as_str())
27994    }
27995}
27996impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod {
27997    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27998    where
27999        S: serde::Serializer,
28000    {
28001        serializer.serialize_str(self.as_str())
28002    }
28003}
28004#[cfg(feature = "deserialize")]
28005impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod {
28006    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28007        use std::str::FromStr;
28008        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28009        Self::from_str(&s).map_err(|_| {
28010            serde::de::Error::custom(
28011                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod",
28012            )
28013        })
28014    }
28015}
28016/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
28017///
28018/// 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.
28019/// 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.
28020///
28021/// 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.
28022///
28023/// 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).
28024///
28025/// 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`.
28026#[derive(Copy, Clone, Eq, PartialEq)]
28027pub enum ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
28028    None,
28029    OffSession,
28030    OnSession,
28031}
28032impl ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
28033    pub fn as_str(self) -> &'static str {
28034        use ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*;
28035        match self {
28036            None => "none",
28037            OffSession => "off_session",
28038            OnSession => "on_session",
28039        }
28040    }
28041}
28042
28043impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
28044    type Err = stripe_types::StripeParseError;
28045    fn from_str(s: &str) -> Result<Self, Self::Err> {
28046        use ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*;
28047        match s {
28048            "none" => Ok(None),
28049            "off_session" => Ok(OffSession),
28050            "on_session" => Ok(OnSession),
28051            _ => Err(stripe_types::StripeParseError),
28052        }
28053    }
28054}
28055impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
28056    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28057        f.write_str(self.as_str())
28058    }
28059}
28060
28061impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
28062    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28063        f.write_str(self.as_str())
28064    }
28065}
28066impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
28067    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28068    where
28069        S: serde::Serializer,
28070    {
28071        serializer.serialize_str(self.as_str())
28072    }
28073}
28074#[cfg(feature = "deserialize")]
28075impl<'de> serde::Deserialize<'de>
28076    for ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage
28077{
28078    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28079        use std::str::FromStr;
28080        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28081        Self::from_str(&s).map_err(|_| {
28082            serde::de::Error::custom(
28083                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage",
28084            )
28085        })
28086    }
28087}
28088/// If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options.
28089#[derive(Copy, Clone, Debug, serde::Serialize)]
28090pub struct ConfirmPaymentIntentPaymentMethodOptionsCrypto {
28091    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
28092    ///
28093    /// 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.
28094    /// 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.
28095    ///
28096    /// 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.
28097    ///
28098    /// 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).
28099    ///
28100    /// 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`.
28101    #[serde(skip_serializing_if = "Option::is_none")]
28102    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage>,
28103}
28104impl ConfirmPaymentIntentPaymentMethodOptionsCrypto {
28105    pub fn new() -> Self {
28106        Self { setup_future_usage: None }
28107    }
28108}
28109impl Default for ConfirmPaymentIntentPaymentMethodOptionsCrypto {
28110    fn default() -> Self {
28111        Self::new()
28112    }
28113}
28114/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
28115///
28116/// 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.
28117/// 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.
28118///
28119/// 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.
28120///
28121/// 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).
28122///
28123/// 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`.
28124#[derive(Copy, Clone, Eq, PartialEq)]
28125pub enum ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
28126    None,
28127}
28128impl ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
28129    pub fn as_str(self) -> &'static str {
28130        use ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage::*;
28131        match self {
28132            None => "none",
28133        }
28134    }
28135}
28136
28137impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
28138    type Err = stripe_types::StripeParseError;
28139    fn from_str(s: &str) -> Result<Self, Self::Err> {
28140        use ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage::*;
28141        match s {
28142            "none" => Ok(None),
28143            _ => Err(stripe_types::StripeParseError),
28144        }
28145    }
28146}
28147impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
28148    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28149        f.write_str(self.as_str())
28150    }
28151}
28152
28153impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
28154    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28155        f.write_str(self.as_str())
28156    }
28157}
28158impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
28159    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28160    where
28161        S: serde::Serializer,
28162    {
28163        serializer.serialize_str(self.as_str())
28164    }
28165}
28166#[cfg(feature = "deserialize")]
28167impl<'de> serde::Deserialize<'de>
28168    for ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage
28169{
28170    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28171        use std::str::FromStr;
28172        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28173        Self::from_str(&s).map_err(|_| {
28174            serde::de::Error::custom(
28175                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage",
28176            )
28177        })
28178    }
28179}
28180/// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options.
28181#[derive(Clone, Debug, serde::Serialize)]
28182pub struct ConfirmPaymentIntentPaymentMethodOptionsCustomerBalance {
28183    /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
28184    #[serde(skip_serializing_if = "Option::is_none")]
28185    pub bank_transfer: Option<ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer>,
28186    /// The funding method type to be used when there are not enough funds in the customer balance.
28187    /// Permitted values include: `bank_transfer`.
28188    #[serde(skip_serializing_if = "Option::is_none")]
28189    pub funding_type: Option<ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType>,
28190    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
28191    ///
28192    /// 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.
28193    /// 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.
28194    ///
28195    /// 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.
28196    ///
28197    /// 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).
28198    ///
28199    /// 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`.
28200    #[serde(skip_serializing_if = "Option::is_none")]
28201    pub setup_future_usage:
28202        Option<ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage>,
28203}
28204impl ConfirmPaymentIntentPaymentMethodOptionsCustomerBalance {
28205    pub fn new() -> Self {
28206        Self { bank_transfer: None, funding_type: None, setup_future_usage: None }
28207    }
28208}
28209impl Default for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalance {
28210    fn default() -> Self {
28211        Self::new()
28212    }
28213}
28214/// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
28215#[derive(Clone, Debug, serde::Serialize)]
28216pub struct ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer {
28217    /// Configuration for the eu_bank_transfer funding type.
28218#[serde(skip_serializing_if = "Option::is_none")]
28219pub eu_bank_transfer: Option<EuBankTransferParams>,
28220        /// List of address types that should be returned in the financial_addresses response.
28221    /// If not specified, all valid types will be returned.
28222    ///
28223    /// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`.
28224#[serde(skip_serializing_if = "Option::is_none")]
28225pub requested_address_types: Option<Vec<ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes>>,
28226        /// The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`.
28227#[serde(rename = "type")]
28228pub type_: ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType,
28229
28230}
28231impl ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer {
28232    pub fn new(
28233        type_: impl Into<ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType>,
28234    ) -> Self {
28235        Self { eu_bank_transfer: None, requested_address_types: None, type_: type_.into() }
28236    }
28237}
28238/// List of address types that should be returned in the financial_addresses response.
28239/// If not specified, all valid types will be returned.
28240///
28241/// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`.
28242#[derive(Copy, Clone, Eq, PartialEq)]
28243pub enum ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
28244    Aba,
28245    Iban,
28246    Sepa,
28247    SortCode,
28248    Spei,
28249    Swift,
28250    Zengin,
28251}
28252impl ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
28253    pub fn as_str(self) -> &'static str {
28254        use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*;
28255        match self {
28256            Aba => "aba",
28257            Iban => "iban",
28258            Sepa => "sepa",
28259            SortCode => "sort_code",
28260            Spei => "spei",
28261            Swift => "swift",
28262            Zengin => "zengin",
28263        }
28264    }
28265}
28266
28267impl std::str::FromStr
28268    for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
28269{
28270    type Err = stripe_types::StripeParseError;
28271    fn from_str(s: &str) -> Result<Self, Self::Err> {
28272        use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*;
28273        match s {
28274            "aba" => Ok(Aba),
28275            "iban" => Ok(Iban),
28276            "sepa" => Ok(Sepa),
28277            "sort_code" => Ok(SortCode),
28278            "spei" => Ok(Spei),
28279            "swift" => Ok(Swift),
28280            "zengin" => Ok(Zengin),
28281            _ => Err(stripe_types::StripeParseError),
28282        }
28283    }
28284}
28285impl std::fmt::Display
28286    for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
28287{
28288    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28289        f.write_str(self.as_str())
28290    }
28291}
28292
28293impl std::fmt::Debug
28294    for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
28295{
28296    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28297        f.write_str(self.as_str())
28298    }
28299}
28300impl serde::Serialize
28301    for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
28302{
28303    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28304    where
28305        S: serde::Serializer,
28306    {
28307        serializer.serialize_str(self.as_str())
28308    }
28309}
28310#[cfg(feature = "deserialize")]
28311impl<'de> serde::Deserialize<'de>
28312    for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
28313{
28314    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28315        use std::str::FromStr;
28316        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28317        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes"))
28318    }
28319}
28320/// The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`.
28321#[derive(Copy, Clone, Eq, PartialEq)]
28322pub enum ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
28323    EuBankTransfer,
28324    GbBankTransfer,
28325    JpBankTransfer,
28326    MxBankTransfer,
28327    UsBankTransfer,
28328}
28329impl ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
28330    pub fn as_str(self) -> &'static str {
28331        use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*;
28332        match self {
28333            EuBankTransfer => "eu_bank_transfer",
28334            GbBankTransfer => "gb_bank_transfer",
28335            JpBankTransfer => "jp_bank_transfer",
28336            MxBankTransfer => "mx_bank_transfer",
28337            UsBankTransfer => "us_bank_transfer",
28338        }
28339    }
28340}
28341
28342impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
28343    type Err = stripe_types::StripeParseError;
28344    fn from_str(s: &str) -> Result<Self, Self::Err> {
28345        use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*;
28346        match s {
28347            "eu_bank_transfer" => Ok(EuBankTransfer),
28348            "gb_bank_transfer" => Ok(GbBankTransfer),
28349            "jp_bank_transfer" => Ok(JpBankTransfer),
28350            "mx_bank_transfer" => Ok(MxBankTransfer),
28351            "us_bank_transfer" => Ok(UsBankTransfer),
28352            _ => Err(stripe_types::StripeParseError),
28353        }
28354    }
28355}
28356impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
28357    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28358        f.write_str(self.as_str())
28359    }
28360}
28361
28362impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
28363    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28364        f.write_str(self.as_str())
28365    }
28366}
28367impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
28368    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28369    where
28370        S: serde::Serializer,
28371    {
28372        serializer.serialize_str(self.as_str())
28373    }
28374}
28375#[cfg(feature = "deserialize")]
28376impl<'de> serde::Deserialize<'de>
28377    for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType
28378{
28379    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28380        use std::str::FromStr;
28381        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28382        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType"))
28383    }
28384}
28385/// The funding method type to be used when there are not enough funds in the customer balance.
28386/// Permitted values include: `bank_transfer`.
28387#[derive(Copy, Clone, Eq, PartialEq)]
28388pub enum ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
28389    BankTransfer,
28390}
28391impl ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
28392    pub fn as_str(self) -> &'static str {
28393        use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*;
28394        match self {
28395            BankTransfer => "bank_transfer",
28396        }
28397    }
28398}
28399
28400impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
28401    type Err = stripe_types::StripeParseError;
28402    fn from_str(s: &str) -> Result<Self, Self::Err> {
28403        use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*;
28404        match s {
28405            "bank_transfer" => Ok(BankTransfer),
28406            _ => Err(stripe_types::StripeParseError),
28407        }
28408    }
28409}
28410impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
28411    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28412        f.write_str(self.as_str())
28413    }
28414}
28415
28416impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
28417    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28418        f.write_str(self.as_str())
28419    }
28420}
28421impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
28422    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28423    where
28424        S: serde::Serializer,
28425    {
28426        serializer.serialize_str(self.as_str())
28427    }
28428}
28429#[cfg(feature = "deserialize")]
28430impl<'de> serde::Deserialize<'de>
28431    for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType
28432{
28433    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28434        use std::str::FromStr;
28435        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28436        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType"))
28437    }
28438}
28439/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
28440///
28441/// 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.
28442/// 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.
28443///
28444/// 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.
28445///
28446/// 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).
28447///
28448/// 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`.
28449#[derive(Copy, Clone, Eq, PartialEq)]
28450pub enum ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
28451    None,
28452}
28453impl ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
28454    pub fn as_str(self) -> &'static str {
28455        use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*;
28456        match self {
28457            None => "none",
28458        }
28459    }
28460}
28461
28462impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
28463    type Err = stripe_types::StripeParseError;
28464    fn from_str(s: &str) -> Result<Self, Self::Err> {
28465        use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*;
28466        match s {
28467            "none" => Ok(None),
28468            _ => Err(stripe_types::StripeParseError),
28469        }
28470    }
28471}
28472impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
28473    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28474        f.write_str(self.as_str())
28475    }
28476}
28477
28478impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
28479    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28480        f.write_str(self.as_str())
28481    }
28482}
28483impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
28484    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28485    where
28486        S: serde::Serializer,
28487    {
28488        serializer.serialize_str(self.as_str())
28489    }
28490}
28491#[cfg(feature = "deserialize")]
28492impl<'de> serde::Deserialize<'de>
28493    for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage
28494{
28495    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28496        use std::str::FromStr;
28497        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28498        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage"))
28499    }
28500}
28501/// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
28502#[derive(Copy, Clone, Debug, serde::Serialize)]
28503pub struct ConfirmPaymentIntentPaymentMethodOptionsEps {
28504    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
28505    ///
28506    /// 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.
28507    /// 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.
28508    ///
28509    /// 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.
28510    ///
28511    /// 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).
28512    ///
28513    /// 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`.
28514    #[serde(skip_serializing_if = "Option::is_none")]
28515    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage>,
28516}
28517impl ConfirmPaymentIntentPaymentMethodOptionsEps {
28518    pub fn new() -> Self {
28519        Self { setup_future_usage: None }
28520    }
28521}
28522impl Default for ConfirmPaymentIntentPaymentMethodOptionsEps {
28523    fn default() -> Self {
28524        Self::new()
28525    }
28526}
28527/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
28528///
28529/// 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.
28530/// 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.
28531///
28532/// 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.
28533///
28534/// 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).
28535///
28536/// 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`.
28537#[derive(Copy, Clone, Eq, PartialEq)]
28538pub enum ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
28539    None,
28540}
28541impl ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
28542    pub fn as_str(self) -> &'static str {
28543        use ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*;
28544        match self {
28545            None => "none",
28546        }
28547    }
28548}
28549
28550impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
28551    type Err = stripe_types::StripeParseError;
28552    fn from_str(s: &str) -> Result<Self, Self::Err> {
28553        use ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*;
28554        match s {
28555            "none" => Ok(None),
28556            _ => Err(stripe_types::StripeParseError),
28557        }
28558    }
28559}
28560impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
28561    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28562        f.write_str(self.as_str())
28563    }
28564}
28565
28566impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
28567    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28568        f.write_str(self.as_str())
28569    }
28570}
28571impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
28572    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28573    where
28574        S: serde::Serializer,
28575    {
28576        serializer.serialize_str(self.as_str())
28577    }
28578}
28579#[cfg(feature = "deserialize")]
28580impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
28581    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28582        use std::str::FromStr;
28583        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28584        Self::from_str(&s).map_err(|_| {
28585            serde::de::Error::custom(
28586                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage",
28587            )
28588        })
28589    }
28590}
28591/// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options.
28592#[derive(Copy, Clone, Debug, serde::Serialize)]
28593pub struct ConfirmPaymentIntentPaymentMethodOptionsFpx {
28594    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
28595    ///
28596    /// 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.
28597    /// 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.
28598    ///
28599    /// 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.
28600    ///
28601    /// 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).
28602    ///
28603    /// 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`.
28604    #[serde(skip_serializing_if = "Option::is_none")]
28605    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage>,
28606}
28607impl ConfirmPaymentIntentPaymentMethodOptionsFpx {
28608    pub fn new() -> Self {
28609        Self { setup_future_usage: None }
28610    }
28611}
28612impl Default for ConfirmPaymentIntentPaymentMethodOptionsFpx {
28613    fn default() -> Self {
28614        Self::new()
28615    }
28616}
28617/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
28618///
28619/// 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.
28620/// 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.
28621///
28622/// 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.
28623///
28624/// 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).
28625///
28626/// 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`.
28627#[derive(Copy, Clone, Eq, PartialEq)]
28628pub enum ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
28629    None,
28630}
28631impl ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
28632    pub fn as_str(self) -> &'static str {
28633        use ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*;
28634        match self {
28635            None => "none",
28636        }
28637    }
28638}
28639
28640impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
28641    type Err = stripe_types::StripeParseError;
28642    fn from_str(s: &str) -> Result<Self, Self::Err> {
28643        use ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*;
28644        match s {
28645            "none" => Ok(None),
28646            _ => Err(stripe_types::StripeParseError),
28647        }
28648    }
28649}
28650impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
28651    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28652        f.write_str(self.as_str())
28653    }
28654}
28655
28656impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
28657    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28658        f.write_str(self.as_str())
28659    }
28660}
28661impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
28662    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28663    where
28664        S: serde::Serializer,
28665    {
28666        serializer.serialize_str(self.as_str())
28667    }
28668}
28669#[cfg(feature = "deserialize")]
28670impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
28671    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28672        use std::str::FromStr;
28673        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28674        Self::from_str(&s).map_err(|_| {
28675            serde::de::Error::custom(
28676                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage",
28677            )
28678        })
28679    }
28680}
28681/// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options.
28682#[derive(Copy, Clone, Debug, serde::Serialize)]
28683pub struct ConfirmPaymentIntentPaymentMethodOptionsGiropay {
28684    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
28685    ///
28686    /// 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.
28687    /// 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.
28688    ///
28689    /// 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.
28690    ///
28691    /// 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).
28692    ///
28693    /// 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`.
28694    #[serde(skip_serializing_if = "Option::is_none")]
28695    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage>,
28696}
28697impl ConfirmPaymentIntentPaymentMethodOptionsGiropay {
28698    pub fn new() -> Self {
28699        Self { setup_future_usage: None }
28700    }
28701}
28702impl Default for ConfirmPaymentIntentPaymentMethodOptionsGiropay {
28703    fn default() -> Self {
28704        Self::new()
28705    }
28706}
28707/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
28708///
28709/// 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.
28710/// 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.
28711///
28712/// 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.
28713///
28714/// 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).
28715///
28716/// 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`.
28717#[derive(Copy, Clone, Eq, PartialEq)]
28718pub enum ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
28719    None,
28720}
28721impl ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
28722    pub fn as_str(self) -> &'static str {
28723        use ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*;
28724        match self {
28725            None => "none",
28726        }
28727    }
28728}
28729
28730impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
28731    type Err = stripe_types::StripeParseError;
28732    fn from_str(s: &str) -> Result<Self, Self::Err> {
28733        use ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*;
28734        match s {
28735            "none" => Ok(None),
28736            _ => Err(stripe_types::StripeParseError),
28737        }
28738    }
28739}
28740impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
28741    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28742        f.write_str(self.as_str())
28743    }
28744}
28745
28746impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
28747    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28748        f.write_str(self.as_str())
28749    }
28750}
28751impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
28752    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28753    where
28754        S: serde::Serializer,
28755    {
28756        serializer.serialize_str(self.as_str())
28757    }
28758}
28759#[cfg(feature = "deserialize")]
28760impl<'de> serde::Deserialize<'de>
28761    for ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage
28762{
28763    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28764        use std::str::FromStr;
28765        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28766        Self::from_str(&s).map_err(|_| {
28767            serde::de::Error::custom(
28768                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage",
28769            )
28770        })
28771    }
28772}
28773/// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options.
28774#[derive(Copy, Clone, Debug, serde::Serialize)]
28775pub struct ConfirmPaymentIntentPaymentMethodOptionsGrabpay {
28776    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
28777    ///
28778    /// 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.
28779    /// 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.
28780    ///
28781    /// 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.
28782    ///
28783    /// 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).
28784    ///
28785    /// 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`.
28786    #[serde(skip_serializing_if = "Option::is_none")]
28787    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage>,
28788}
28789impl ConfirmPaymentIntentPaymentMethodOptionsGrabpay {
28790    pub fn new() -> Self {
28791        Self { setup_future_usage: None }
28792    }
28793}
28794impl Default for ConfirmPaymentIntentPaymentMethodOptionsGrabpay {
28795    fn default() -> Self {
28796        Self::new()
28797    }
28798}
28799/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
28800///
28801/// 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.
28802/// 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.
28803///
28804/// 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.
28805///
28806/// 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).
28807///
28808/// 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`.
28809#[derive(Copy, Clone, Eq, PartialEq)]
28810pub enum ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
28811    None,
28812}
28813impl ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
28814    pub fn as_str(self) -> &'static str {
28815        use ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*;
28816        match self {
28817            None => "none",
28818        }
28819    }
28820}
28821
28822impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
28823    type Err = stripe_types::StripeParseError;
28824    fn from_str(s: &str) -> Result<Self, Self::Err> {
28825        use ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*;
28826        match s {
28827            "none" => Ok(None),
28828            _ => Err(stripe_types::StripeParseError),
28829        }
28830    }
28831}
28832impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
28833    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28834        f.write_str(self.as_str())
28835    }
28836}
28837
28838impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
28839    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28840        f.write_str(self.as_str())
28841    }
28842}
28843impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
28844    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28845    where
28846        S: serde::Serializer,
28847    {
28848        serializer.serialize_str(self.as_str())
28849    }
28850}
28851#[cfg(feature = "deserialize")]
28852impl<'de> serde::Deserialize<'de>
28853    for ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage
28854{
28855    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28856        use std::str::FromStr;
28857        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28858        Self::from_str(&s).map_err(|_| {
28859            serde::de::Error::custom(
28860                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage",
28861            )
28862        })
28863    }
28864}
28865/// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options.
28866#[derive(Copy, Clone, Debug, serde::Serialize)]
28867pub struct ConfirmPaymentIntentPaymentMethodOptionsIdeal {
28868    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
28869    ///
28870    /// 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.
28871    /// 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.
28872    ///
28873    /// 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.
28874    ///
28875    /// 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).
28876    ///
28877    /// 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`.
28878    #[serde(skip_serializing_if = "Option::is_none")]
28879    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage>,
28880}
28881impl ConfirmPaymentIntentPaymentMethodOptionsIdeal {
28882    pub fn new() -> Self {
28883        Self { setup_future_usage: None }
28884    }
28885}
28886impl Default for ConfirmPaymentIntentPaymentMethodOptionsIdeal {
28887    fn default() -> Self {
28888        Self::new()
28889    }
28890}
28891/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
28892///
28893/// 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.
28894/// 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.
28895///
28896/// 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.
28897///
28898/// 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).
28899///
28900/// 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`.
28901#[derive(Copy, Clone, Eq, PartialEq)]
28902pub enum ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
28903    None,
28904    OffSession,
28905}
28906impl ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
28907    pub fn as_str(self) -> &'static str {
28908        use ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*;
28909        match self {
28910            None => "none",
28911            OffSession => "off_session",
28912        }
28913    }
28914}
28915
28916impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
28917    type Err = stripe_types::StripeParseError;
28918    fn from_str(s: &str) -> Result<Self, Self::Err> {
28919        use ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*;
28920        match s {
28921            "none" => Ok(None),
28922            "off_session" => Ok(OffSession),
28923            _ => Err(stripe_types::StripeParseError),
28924        }
28925    }
28926}
28927impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
28928    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28929        f.write_str(self.as_str())
28930    }
28931}
28932
28933impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
28934    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28935        f.write_str(self.as_str())
28936    }
28937}
28938impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
28939    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28940    where
28941        S: serde::Serializer,
28942    {
28943        serializer.serialize_str(self.as_str())
28944    }
28945}
28946#[cfg(feature = "deserialize")]
28947impl<'de> serde::Deserialize<'de>
28948    for ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage
28949{
28950    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28951        use std::str::FromStr;
28952        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28953        Self::from_str(&s).map_err(|_| {
28954            serde::de::Error::custom(
28955                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage",
28956            )
28957        })
28958    }
28959}
28960/// If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options.
28961#[derive(Copy, Clone, Debug, serde::Serialize)]
28962pub struct ConfirmPaymentIntentPaymentMethodOptionsKakaoPay {
28963    /// Controls when the funds are captured from the customer's account.
28964    ///
28965    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
28966    ///
28967    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
28968    #[serde(skip_serializing_if = "Option::is_none")]
28969    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod>,
28970    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
28971    ///
28972    /// 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.
28973    /// 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.
28974    ///
28975    /// 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.
28976    ///
28977    /// 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).
28978    #[serde(skip_serializing_if = "Option::is_none")]
28979    pub setup_future_usage:
28980        Option<ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage>,
28981}
28982impl ConfirmPaymentIntentPaymentMethodOptionsKakaoPay {
28983    pub fn new() -> Self {
28984        Self { capture_method: None, setup_future_usage: None }
28985    }
28986}
28987impl Default for ConfirmPaymentIntentPaymentMethodOptionsKakaoPay {
28988    fn default() -> Self {
28989        Self::new()
28990    }
28991}
28992/// Controls when the funds are captured from the customer's account.
28993///
28994/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
28995///
28996/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
28997#[derive(Copy, Clone, Eq, PartialEq)]
28998pub enum ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
28999    Manual,
29000}
29001impl ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
29002    pub fn as_str(self) -> &'static str {
29003        use ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod::*;
29004        match self {
29005            Manual => "manual",
29006        }
29007    }
29008}
29009
29010impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
29011    type Err = stripe_types::StripeParseError;
29012    fn from_str(s: &str) -> Result<Self, Self::Err> {
29013        use ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod::*;
29014        match s {
29015            "manual" => Ok(Manual),
29016            _ => Err(stripe_types::StripeParseError),
29017        }
29018    }
29019}
29020impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
29021    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29022        f.write_str(self.as_str())
29023    }
29024}
29025
29026impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
29027    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29028        f.write_str(self.as_str())
29029    }
29030}
29031impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
29032    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29033    where
29034        S: serde::Serializer,
29035    {
29036        serializer.serialize_str(self.as_str())
29037    }
29038}
29039#[cfg(feature = "deserialize")]
29040impl<'de> serde::Deserialize<'de>
29041    for ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod
29042{
29043    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29044        use std::str::FromStr;
29045        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29046        Self::from_str(&s).map_err(|_| {
29047            serde::de::Error::custom(
29048                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod",
29049            )
29050        })
29051    }
29052}
29053/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29054///
29055/// 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.
29056/// 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.
29057///
29058/// 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.
29059///
29060/// 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).
29061#[derive(Copy, Clone, Eq, PartialEq)]
29062pub enum ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
29063    None,
29064    OffSession,
29065}
29066impl ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
29067    pub fn as_str(self) -> &'static str {
29068        use ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage::*;
29069        match self {
29070            None => "none",
29071            OffSession => "off_session",
29072        }
29073    }
29074}
29075
29076impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
29077    type Err = stripe_types::StripeParseError;
29078    fn from_str(s: &str) -> Result<Self, Self::Err> {
29079        use ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage::*;
29080        match s {
29081            "none" => Ok(None),
29082            "off_session" => Ok(OffSession),
29083            _ => Err(stripe_types::StripeParseError),
29084        }
29085    }
29086}
29087impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
29088    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29089        f.write_str(self.as_str())
29090    }
29091}
29092
29093impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
29094    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29095        f.write_str(self.as_str())
29096    }
29097}
29098impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
29099    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29100    where
29101        S: serde::Serializer,
29102    {
29103        serializer.serialize_str(self.as_str())
29104    }
29105}
29106#[cfg(feature = "deserialize")]
29107impl<'de> serde::Deserialize<'de>
29108    for ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage
29109{
29110    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29111        use std::str::FromStr;
29112        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29113        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage"))
29114    }
29115}
29116/// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options.
29117#[derive(Clone, Debug, serde::Serialize)]
29118pub struct ConfirmPaymentIntentPaymentMethodOptionsKlarna {
29119    /// Controls when the funds are captured from the customer's account.
29120    ///
29121    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
29122    ///
29123    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
29124    #[serde(skip_serializing_if = "Option::is_none")]
29125    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod>,
29126    /// On-demand details if setting up or charging an on-demand payment.
29127    #[serde(skip_serializing_if = "Option::is_none")]
29128    pub on_demand: Option<ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemand>,
29129    /// Preferred language of the Klarna authorization page that the customer is redirected to
29130    #[serde(skip_serializing_if = "Option::is_none")]
29131    pub preferred_locale: Option<ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale>,
29132    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29133    ///
29134    /// 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.
29135    /// 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.
29136    ///
29137    /// 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.
29138    ///
29139    /// 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).
29140    ///
29141    /// 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`.
29142    #[serde(skip_serializing_if = "Option::is_none")]
29143    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage>,
29144    /// Subscription details if setting up or charging a subscription.
29145    #[serde(skip_serializing_if = "Option::is_none")]
29146    pub subscriptions: Option<Vec<ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptions>>,
29147}
29148impl ConfirmPaymentIntentPaymentMethodOptionsKlarna {
29149    pub fn new() -> Self {
29150        Self {
29151            capture_method: None,
29152            on_demand: None,
29153            preferred_locale: None,
29154            setup_future_usage: None,
29155            subscriptions: None,
29156        }
29157    }
29158}
29159impl Default for ConfirmPaymentIntentPaymentMethodOptionsKlarna {
29160    fn default() -> Self {
29161        Self::new()
29162    }
29163}
29164/// Controls when the funds are captured from the customer's account.
29165///
29166/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
29167///
29168/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
29169#[derive(Copy, Clone, Eq, PartialEq)]
29170pub enum ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
29171    Manual,
29172}
29173impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
29174    pub fn as_str(self) -> &'static str {
29175        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*;
29176        match self {
29177            Manual => "manual",
29178        }
29179    }
29180}
29181
29182impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
29183    type Err = stripe_types::StripeParseError;
29184    fn from_str(s: &str) -> Result<Self, Self::Err> {
29185        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*;
29186        match s {
29187            "manual" => Ok(Manual),
29188            _ => Err(stripe_types::StripeParseError),
29189        }
29190    }
29191}
29192impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
29193    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29194        f.write_str(self.as_str())
29195    }
29196}
29197
29198impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
29199    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29200        f.write_str(self.as_str())
29201    }
29202}
29203impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
29204    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29205    where
29206        S: serde::Serializer,
29207    {
29208        serializer.serialize_str(self.as_str())
29209    }
29210}
29211#[cfg(feature = "deserialize")]
29212impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
29213    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29214        use std::str::FromStr;
29215        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29216        Self::from_str(&s).map_err(|_| {
29217            serde::de::Error::custom(
29218                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod",
29219            )
29220        })
29221    }
29222}
29223/// On-demand details if setting up or charging an on-demand payment.
29224#[derive(Copy, Clone, Debug, serde::Serialize)]
29225pub struct ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemand {
29226    /// Your average amount value.
29227    /// You can use a value across your customer base, or segment based on customer type, country, etc.
29228    #[serde(skip_serializing_if = "Option::is_none")]
29229    pub average_amount: Option<i64>,
29230    /// The maximum value you may charge a customer per purchase.
29231    /// You can use a value across your customer base, or segment based on customer type, country, etc.
29232    #[serde(skip_serializing_if = "Option::is_none")]
29233    pub maximum_amount: Option<i64>,
29234    /// The lowest or minimum value you may charge a customer per purchase.
29235    /// You can use a value across your customer base, or segment based on customer type, country, etc.
29236    #[serde(skip_serializing_if = "Option::is_none")]
29237    pub minimum_amount: Option<i64>,
29238    /// Interval at which the customer is making purchases
29239    #[serde(skip_serializing_if = "Option::is_none")]
29240    pub purchase_interval:
29241        Option<ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
29242    /// The number of `purchase_interval` between charges
29243    #[serde(skip_serializing_if = "Option::is_none")]
29244    pub purchase_interval_count: Option<u64>,
29245}
29246impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemand {
29247    pub fn new() -> Self {
29248        Self {
29249            average_amount: None,
29250            maximum_amount: None,
29251            minimum_amount: None,
29252            purchase_interval: None,
29253            purchase_interval_count: None,
29254        }
29255    }
29256}
29257impl Default for ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemand {
29258    fn default() -> Self {
29259        Self::new()
29260    }
29261}
29262/// Interval at which the customer is making purchases
29263#[derive(Copy, Clone, Eq, PartialEq)]
29264pub enum ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
29265    Day,
29266    Month,
29267    Week,
29268    Year,
29269}
29270impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
29271    pub fn as_str(self) -> &'static str {
29272        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
29273        match self {
29274            Day => "day",
29275            Month => "month",
29276            Week => "week",
29277            Year => "year",
29278        }
29279    }
29280}
29281
29282impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
29283    type Err = stripe_types::StripeParseError;
29284    fn from_str(s: &str) -> Result<Self, Self::Err> {
29285        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
29286        match s {
29287            "day" => Ok(Day),
29288            "month" => Ok(Month),
29289            "week" => Ok(Week),
29290            "year" => Ok(Year),
29291            _ => Err(stripe_types::StripeParseError),
29292        }
29293    }
29294}
29295impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
29296    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29297        f.write_str(self.as_str())
29298    }
29299}
29300
29301impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
29302    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29303        f.write_str(self.as_str())
29304    }
29305}
29306impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
29307    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29308    where
29309        S: serde::Serializer,
29310    {
29311        serializer.serialize_str(self.as_str())
29312    }
29313}
29314#[cfg(feature = "deserialize")]
29315impl<'de> serde::Deserialize<'de>
29316    for ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
29317{
29318    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29319        use std::str::FromStr;
29320        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29321        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"))
29322    }
29323}
29324/// Preferred language of the Klarna authorization page that the customer is redirected to
29325#[derive(Clone, Eq, PartialEq)]
29326#[non_exhaustive]
29327pub enum ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
29328    CsMinusCz,
29329    DaMinusDk,
29330    DeMinusAt,
29331    DeMinusCh,
29332    DeMinusDe,
29333    ElMinusGr,
29334    EnMinusAt,
29335    EnMinusAu,
29336    EnMinusBe,
29337    EnMinusCa,
29338    EnMinusCh,
29339    EnMinusCz,
29340    EnMinusDe,
29341    EnMinusDk,
29342    EnMinusEs,
29343    EnMinusFi,
29344    EnMinusFr,
29345    EnMinusGb,
29346    EnMinusGr,
29347    EnMinusIe,
29348    EnMinusIt,
29349    EnMinusNl,
29350    EnMinusNo,
29351    EnMinusNz,
29352    EnMinusPl,
29353    EnMinusPt,
29354    EnMinusRo,
29355    EnMinusSe,
29356    EnMinusUs,
29357    EsMinusEs,
29358    EsMinusUs,
29359    FiMinusFi,
29360    FrMinusBe,
29361    FrMinusCa,
29362    FrMinusCh,
29363    FrMinusFr,
29364    ItMinusCh,
29365    ItMinusIt,
29366    NbMinusNo,
29367    NlMinusBe,
29368    NlMinusNl,
29369    PlMinusPl,
29370    PtMinusPt,
29371    RoMinusRo,
29372    SvMinusFi,
29373    SvMinusSe,
29374    /// An unrecognized value from Stripe. Should not be used as a request parameter.
29375    Unknown(String),
29376}
29377impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
29378    pub fn as_str(&self) -> &str {
29379        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
29380        match self {
29381            CsMinusCz => "cs-CZ",
29382            DaMinusDk => "da-DK",
29383            DeMinusAt => "de-AT",
29384            DeMinusCh => "de-CH",
29385            DeMinusDe => "de-DE",
29386            ElMinusGr => "el-GR",
29387            EnMinusAt => "en-AT",
29388            EnMinusAu => "en-AU",
29389            EnMinusBe => "en-BE",
29390            EnMinusCa => "en-CA",
29391            EnMinusCh => "en-CH",
29392            EnMinusCz => "en-CZ",
29393            EnMinusDe => "en-DE",
29394            EnMinusDk => "en-DK",
29395            EnMinusEs => "en-ES",
29396            EnMinusFi => "en-FI",
29397            EnMinusFr => "en-FR",
29398            EnMinusGb => "en-GB",
29399            EnMinusGr => "en-GR",
29400            EnMinusIe => "en-IE",
29401            EnMinusIt => "en-IT",
29402            EnMinusNl => "en-NL",
29403            EnMinusNo => "en-NO",
29404            EnMinusNz => "en-NZ",
29405            EnMinusPl => "en-PL",
29406            EnMinusPt => "en-PT",
29407            EnMinusRo => "en-RO",
29408            EnMinusSe => "en-SE",
29409            EnMinusUs => "en-US",
29410            EsMinusEs => "es-ES",
29411            EsMinusUs => "es-US",
29412            FiMinusFi => "fi-FI",
29413            FrMinusBe => "fr-BE",
29414            FrMinusCa => "fr-CA",
29415            FrMinusCh => "fr-CH",
29416            FrMinusFr => "fr-FR",
29417            ItMinusCh => "it-CH",
29418            ItMinusIt => "it-IT",
29419            NbMinusNo => "nb-NO",
29420            NlMinusBe => "nl-BE",
29421            NlMinusNl => "nl-NL",
29422            PlMinusPl => "pl-PL",
29423            PtMinusPt => "pt-PT",
29424            RoMinusRo => "ro-RO",
29425            SvMinusFi => "sv-FI",
29426            SvMinusSe => "sv-SE",
29427            Unknown(v) => v,
29428        }
29429    }
29430}
29431
29432impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
29433    type Err = std::convert::Infallible;
29434    fn from_str(s: &str) -> Result<Self, Self::Err> {
29435        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
29436        match s {
29437            "cs-CZ" => Ok(CsMinusCz),
29438            "da-DK" => Ok(DaMinusDk),
29439            "de-AT" => Ok(DeMinusAt),
29440            "de-CH" => Ok(DeMinusCh),
29441            "de-DE" => Ok(DeMinusDe),
29442            "el-GR" => Ok(ElMinusGr),
29443            "en-AT" => Ok(EnMinusAt),
29444            "en-AU" => Ok(EnMinusAu),
29445            "en-BE" => Ok(EnMinusBe),
29446            "en-CA" => Ok(EnMinusCa),
29447            "en-CH" => Ok(EnMinusCh),
29448            "en-CZ" => Ok(EnMinusCz),
29449            "en-DE" => Ok(EnMinusDe),
29450            "en-DK" => Ok(EnMinusDk),
29451            "en-ES" => Ok(EnMinusEs),
29452            "en-FI" => Ok(EnMinusFi),
29453            "en-FR" => Ok(EnMinusFr),
29454            "en-GB" => Ok(EnMinusGb),
29455            "en-GR" => Ok(EnMinusGr),
29456            "en-IE" => Ok(EnMinusIe),
29457            "en-IT" => Ok(EnMinusIt),
29458            "en-NL" => Ok(EnMinusNl),
29459            "en-NO" => Ok(EnMinusNo),
29460            "en-NZ" => Ok(EnMinusNz),
29461            "en-PL" => Ok(EnMinusPl),
29462            "en-PT" => Ok(EnMinusPt),
29463            "en-RO" => Ok(EnMinusRo),
29464            "en-SE" => Ok(EnMinusSe),
29465            "en-US" => Ok(EnMinusUs),
29466            "es-ES" => Ok(EsMinusEs),
29467            "es-US" => Ok(EsMinusUs),
29468            "fi-FI" => Ok(FiMinusFi),
29469            "fr-BE" => Ok(FrMinusBe),
29470            "fr-CA" => Ok(FrMinusCa),
29471            "fr-CH" => Ok(FrMinusCh),
29472            "fr-FR" => Ok(FrMinusFr),
29473            "it-CH" => Ok(ItMinusCh),
29474            "it-IT" => Ok(ItMinusIt),
29475            "nb-NO" => Ok(NbMinusNo),
29476            "nl-BE" => Ok(NlMinusBe),
29477            "nl-NL" => Ok(NlMinusNl),
29478            "pl-PL" => Ok(PlMinusPl),
29479            "pt-PT" => Ok(PtMinusPt),
29480            "ro-RO" => Ok(RoMinusRo),
29481            "sv-FI" => Ok(SvMinusFi),
29482            "sv-SE" => Ok(SvMinusSe),
29483            v => Ok(Unknown(v.to_owned())),
29484        }
29485    }
29486}
29487impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
29488    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29489        f.write_str(self.as_str())
29490    }
29491}
29492
29493impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
29494    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29495        f.write_str(self.as_str())
29496    }
29497}
29498impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
29499    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29500    where
29501        S: serde::Serializer,
29502    {
29503        serializer.serialize_str(self.as_str())
29504    }
29505}
29506#[cfg(feature = "deserialize")]
29507impl<'de> serde::Deserialize<'de>
29508    for ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale
29509{
29510    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29511        use std::str::FromStr;
29512        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29513        Ok(Self::from_str(&s).unwrap())
29514    }
29515}
29516/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29517///
29518/// 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.
29519/// 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.
29520///
29521/// 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.
29522///
29523/// 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).
29524///
29525/// 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`.
29526#[derive(Copy, Clone, Eq, PartialEq)]
29527pub enum ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
29528    None,
29529    OffSession,
29530    OnSession,
29531}
29532impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
29533    pub fn as_str(self) -> &'static str {
29534        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*;
29535        match self {
29536            None => "none",
29537            OffSession => "off_session",
29538            OnSession => "on_session",
29539        }
29540    }
29541}
29542
29543impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
29544    type Err = stripe_types::StripeParseError;
29545    fn from_str(s: &str) -> Result<Self, Self::Err> {
29546        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*;
29547        match s {
29548            "none" => Ok(None),
29549            "off_session" => Ok(OffSession),
29550            "on_session" => Ok(OnSession),
29551            _ => Err(stripe_types::StripeParseError),
29552        }
29553    }
29554}
29555impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
29556    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29557        f.write_str(self.as_str())
29558    }
29559}
29560
29561impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
29562    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29563        f.write_str(self.as_str())
29564    }
29565}
29566impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
29567    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29568    where
29569        S: serde::Serializer,
29570    {
29571        serializer.serialize_str(self.as_str())
29572    }
29573}
29574#[cfg(feature = "deserialize")]
29575impl<'de> serde::Deserialize<'de>
29576    for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage
29577{
29578    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29579        use std::str::FromStr;
29580        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29581        Self::from_str(&s).map_err(|_| {
29582            serde::de::Error::custom(
29583                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage",
29584            )
29585        })
29586    }
29587}
29588/// Subscription details if setting up or charging a subscription.
29589#[derive(Clone, Debug, serde::Serialize)]
29590pub struct ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptions {
29591    /// Unit of time between subscription charges.
29592    pub interval: ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
29593    /// The number of intervals (specified in the `interval` attribute) between subscription charges.
29594    /// For example, `interval=month` and `interval_count=3` charges every 3 months.
29595    #[serde(skip_serializing_if = "Option::is_none")]
29596    pub interval_count: Option<u64>,
29597    /// Name for subscription.
29598    #[serde(skip_serializing_if = "Option::is_none")]
29599    pub name: Option<String>,
29600    /// Describes the upcoming charge for this subscription.
29601    #[serde(skip_serializing_if = "Option::is_none")]
29602    pub next_billing: Option<SubscriptionNextBillingParam>,
29603    /// A non-customer-facing reference to correlate subscription charges in the Klarna app.
29604    /// Use a value that persists across subscription charges.
29605    pub reference: String,
29606}
29607impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptions {
29608    pub fn new(
29609        interval: impl Into<ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
29610        reference: impl Into<String>,
29611    ) -> Self {
29612        Self {
29613            interval: interval.into(),
29614            interval_count: None,
29615            name: None,
29616            next_billing: None,
29617            reference: reference.into(),
29618        }
29619    }
29620}
29621/// Unit of time between subscription charges.
29622#[derive(Copy, Clone, Eq, PartialEq)]
29623pub enum ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
29624    Day,
29625    Month,
29626    Week,
29627    Year,
29628}
29629impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
29630    pub fn as_str(self) -> &'static str {
29631        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
29632        match self {
29633            Day => "day",
29634            Month => "month",
29635            Week => "week",
29636            Year => "year",
29637        }
29638    }
29639}
29640
29641impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
29642    type Err = stripe_types::StripeParseError;
29643    fn from_str(s: &str) -> Result<Self, Self::Err> {
29644        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
29645        match s {
29646            "day" => Ok(Day),
29647            "month" => Ok(Month),
29648            "week" => Ok(Week),
29649            "year" => Ok(Year),
29650            _ => Err(stripe_types::StripeParseError),
29651        }
29652    }
29653}
29654impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
29655    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29656        f.write_str(self.as_str())
29657    }
29658}
29659
29660impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
29661    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29662        f.write_str(self.as_str())
29663    }
29664}
29665impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
29666    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29667    where
29668        S: serde::Serializer,
29669    {
29670        serializer.serialize_str(self.as_str())
29671    }
29672}
29673#[cfg(feature = "deserialize")]
29674impl<'de> serde::Deserialize<'de>
29675    for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
29676{
29677    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29678        use std::str::FromStr;
29679        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29680        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"))
29681    }
29682}
29683/// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options.
29684#[derive(Clone, Debug, serde::Serialize)]
29685pub struct ConfirmPaymentIntentPaymentMethodOptionsKonbini {
29686    /// An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores.
29687    /// Must not consist of only zeroes and could be rejected in case of insufficient uniqueness.
29688    /// We recommend to use the customer's phone number.
29689    #[serde(skip_serializing_if = "Option::is_none")]
29690    pub confirmation_number: Option<String>,
29691    /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire.
29692    /// 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.
29693    /// Defaults to 3 days.
29694    #[serde(skip_serializing_if = "Option::is_none")]
29695    pub expires_after_days: Option<u32>,
29696    /// The timestamp at which the Konbini payment instructions will expire.
29697    /// Only one of `expires_after_days` or `expires_at` may be set.
29698    #[serde(skip_serializing_if = "Option::is_none")]
29699    pub expires_at: Option<stripe_types::Timestamp>,
29700    /// A product descriptor of up to 22 characters, which will appear to customers at the convenience store.
29701    #[serde(skip_serializing_if = "Option::is_none")]
29702    pub product_description: Option<String>,
29703    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29704    ///
29705    /// 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.
29706    /// 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.
29707    ///
29708    /// 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.
29709    ///
29710    /// 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).
29711    ///
29712    /// 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`.
29713    #[serde(skip_serializing_if = "Option::is_none")]
29714    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage>,
29715}
29716impl ConfirmPaymentIntentPaymentMethodOptionsKonbini {
29717    pub fn new() -> Self {
29718        Self {
29719            confirmation_number: None,
29720            expires_after_days: None,
29721            expires_at: None,
29722            product_description: None,
29723            setup_future_usage: None,
29724        }
29725    }
29726}
29727impl Default for ConfirmPaymentIntentPaymentMethodOptionsKonbini {
29728    fn default() -> Self {
29729        Self::new()
29730    }
29731}
29732/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29733///
29734/// 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.
29735/// 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.
29736///
29737/// 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.
29738///
29739/// 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).
29740///
29741/// 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`.
29742#[derive(Copy, Clone, Eq, PartialEq)]
29743pub enum ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
29744    None,
29745}
29746impl ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
29747    pub fn as_str(self) -> &'static str {
29748        use ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*;
29749        match self {
29750            None => "none",
29751        }
29752    }
29753}
29754
29755impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
29756    type Err = stripe_types::StripeParseError;
29757    fn from_str(s: &str) -> Result<Self, Self::Err> {
29758        use ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*;
29759        match s {
29760            "none" => Ok(None),
29761            _ => Err(stripe_types::StripeParseError),
29762        }
29763    }
29764}
29765impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
29766    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29767        f.write_str(self.as_str())
29768    }
29769}
29770
29771impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
29772    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29773        f.write_str(self.as_str())
29774    }
29775}
29776impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
29777    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29778    where
29779        S: serde::Serializer,
29780    {
29781        serializer.serialize_str(self.as_str())
29782    }
29783}
29784#[cfg(feature = "deserialize")]
29785impl<'de> serde::Deserialize<'de>
29786    for ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage
29787{
29788    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29789        use std::str::FromStr;
29790        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29791        Self::from_str(&s).map_err(|_| {
29792            serde::de::Error::custom(
29793                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage",
29794            )
29795        })
29796    }
29797}
29798/// If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options.
29799#[derive(Copy, Clone, Debug, serde::Serialize)]
29800pub struct ConfirmPaymentIntentPaymentMethodOptionsKrCard {
29801    /// Controls when the funds are captured from the customer's account.
29802    ///
29803    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
29804    ///
29805    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
29806    #[serde(skip_serializing_if = "Option::is_none")]
29807    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod>,
29808    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29809    ///
29810    /// 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.
29811    /// 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.
29812    ///
29813    /// 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.
29814    ///
29815    /// 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).
29816    #[serde(skip_serializing_if = "Option::is_none")]
29817    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage>,
29818}
29819impl ConfirmPaymentIntentPaymentMethodOptionsKrCard {
29820    pub fn new() -> Self {
29821        Self { capture_method: None, setup_future_usage: None }
29822    }
29823}
29824impl Default for ConfirmPaymentIntentPaymentMethodOptionsKrCard {
29825    fn default() -> Self {
29826        Self::new()
29827    }
29828}
29829/// Controls when the funds are captured from the customer's account.
29830///
29831/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
29832///
29833/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
29834#[derive(Copy, Clone, Eq, PartialEq)]
29835pub enum ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
29836    Manual,
29837}
29838impl ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
29839    pub fn as_str(self) -> &'static str {
29840        use ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod::*;
29841        match self {
29842            Manual => "manual",
29843        }
29844    }
29845}
29846
29847impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
29848    type Err = stripe_types::StripeParseError;
29849    fn from_str(s: &str) -> Result<Self, Self::Err> {
29850        use ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod::*;
29851        match s {
29852            "manual" => Ok(Manual),
29853            _ => Err(stripe_types::StripeParseError),
29854        }
29855    }
29856}
29857impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
29858    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29859        f.write_str(self.as_str())
29860    }
29861}
29862
29863impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
29864    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29865        f.write_str(self.as_str())
29866    }
29867}
29868impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
29869    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29870    where
29871        S: serde::Serializer,
29872    {
29873        serializer.serialize_str(self.as_str())
29874    }
29875}
29876#[cfg(feature = "deserialize")]
29877impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
29878    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29879        use std::str::FromStr;
29880        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29881        Self::from_str(&s).map_err(|_| {
29882            serde::de::Error::custom(
29883                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod",
29884            )
29885        })
29886    }
29887}
29888/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29889///
29890/// 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.
29891/// 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.
29892///
29893/// 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.
29894///
29895/// 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).
29896#[derive(Copy, Clone, Eq, PartialEq)]
29897pub enum ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
29898    None,
29899    OffSession,
29900}
29901impl ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
29902    pub fn as_str(self) -> &'static str {
29903        use ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage::*;
29904        match self {
29905            None => "none",
29906            OffSession => "off_session",
29907        }
29908    }
29909}
29910
29911impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
29912    type Err = stripe_types::StripeParseError;
29913    fn from_str(s: &str) -> Result<Self, Self::Err> {
29914        use ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage::*;
29915        match s {
29916            "none" => Ok(None),
29917            "off_session" => Ok(OffSession),
29918            _ => Err(stripe_types::StripeParseError),
29919        }
29920    }
29921}
29922impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
29923    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29924        f.write_str(self.as_str())
29925    }
29926}
29927
29928impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
29929    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29930        f.write_str(self.as_str())
29931    }
29932}
29933impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
29934    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29935    where
29936        S: serde::Serializer,
29937    {
29938        serializer.serialize_str(self.as_str())
29939    }
29940}
29941#[cfg(feature = "deserialize")]
29942impl<'de> serde::Deserialize<'de>
29943    for ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage
29944{
29945    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29946        use std::str::FromStr;
29947        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29948        Self::from_str(&s).map_err(|_| {
29949            serde::de::Error::custom(
29950                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage",
29951            )
29952        })
29953    }
29954}
29955/// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
29956#[derive(Clone, Debug, serde::Serialize)]
29957pub struct ConfirmPaymentIntentPaymentMethodOptionsLink {
29958    /// Controls when the funds are captured from the customer's account.
29959    ///
29960    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
29961    ///
29962    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
29963    #[serde(skip_serializing_if = "Option::is_none")]
29964    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod>,
29965    /// \[Deprecated\] This is a legacy parameter that no longer has any function.
29966    #[serde(skip_serializing_if = "Option::is_none")]
29967    pub persistent_token: Option<String>,
29968    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29969    ///
29970    /// 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.
29971    /// 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.
29972    ///
29973    /// 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.
29974    ///
29975    /// 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).
29976    ///
29977    /// 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`.
29978    #[serde(skip_serializing_if = "Option::is_none")]
29979    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage>,
29980}
29981impl ConfirmPaymentIntentPaymentMethodOptionsLink {
29982    pub fn new() -> Self {
29983        Self { capture_method: None, persistent_token: None, setup_future_usage: None }
29984    }
29985}
29986impl Default for ConfirmPaymentIntentPaymentMethodOptionsLink {
29987    fn default() -> Self {
29988        Self::new()
29989    }
29990}
29991/// Controls when the funds are captured from the customer's account.
29992///
29993/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
29994///
29995/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
29996#[derive(Copy, Clone, Eq, PartialEq)]
29997pub enum ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod {
29998    Manual,
29999}
30000impl ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod {
30001    pub fn as_str(self) -> &'static str {
30002        use ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod::*;
30003        match self {
30004            Manual => "manual",
30005        }
30006    }
30007}
30008
30009impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod {
30010    type Err = stripe_types::StripeParseError;
30011    fn from_str(s: &str) -> Result<Self, Self::Err> {
30012        use ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod::*;
30013        match s {
30014            "manual" => Ok(Manual),
30015            _ => Err(stripe_types::StripeParseError),
30016        }
30017    }
30018}
30019impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod {
30020    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30021        f.write_str(self.as_str())
30022    }
30023}
30024
30025impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod {
30026    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30027        f.write_str(self.as_str())
30028    }
30029}
30030impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod {
30031    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30032    where
30033        S: serde::Serializer,
30034    {
30035        serializer.serialize_str(self.as_str())
30036    }
30037}
30038#[cfg(feature = "deserialize")]
30039impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod {
30040    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30041        use std::str::FromStr;
30042        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30043        Self::from_str(&s).map_err(|_| {
30044            serde::de::Error::custom(
30045                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod",
30046            )
30047        })
30048    }
30049}
30050/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30051///
30052/// 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.
30053/// 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.
30054///
30055/// 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.
30056///
30057/// 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).
30058///
30059/// 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`.
30060#[derive(Copy, Clone, Eq, PartialEq)]
30061pub enum ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
30062    None,
30063    OffSession,
30064}
30065impl ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
30066    pub fn as_str(self) -> &'static str {
30067        use ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*;
30068        match self {
30069            None => "none",
30070            OffSession => "off_session",
30071        }
30072    }
30073}
30074
30075impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
30076    type Err = stripe_types::StripeParseError;
30077    fn from_str(s: &str) -> Result<Self, Self::Err> {
30078        use ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*;
30079        match s {
30080            "none" => Ok(None),
30081            "off_session" => Ok(OffSession),
30082            _ => Err(stripe_types::StripeParseError),
30083        }
30084    }
30085}
30086impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
30087    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30088        f.write_str(self.as_str())
30089    }
30090}
30091
30092impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
30093    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30094        f.write_str(self.as_str())
30095    }
30096}
30097impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
30098    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30099    where
30100        S: serde::Serializer,
30101    {
30102        serializer.serialize_str(self.as_str())
30103    }
30104}
30105#[cfg(feature = "deserialize")]
30106impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
30107    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30108        use std::str::FromStr;
30109        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30110        Self::from_str(&s).map_err(|_| {
30111            serde::de::Error::custom(
30112                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage",
30113            )
30114        })
30115    }
30116}
30117/// If this is a `mb_way` PaymentMethod, this sub-hash contains details about the MB WAY payment method options.
30118#[derive(Copy, Clone, Debug, serde::Serialize)]
30119pub struct ConfirmPaymentIntentPaymentMethodOptionsMbWay {
30120    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30121    ///
30122    /// 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.
30123    /// 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.
30124    ///
30125    /// 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.
30126    ///
30127    /// 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).
30128    ///
30129    /// 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`.
30130    #[serde(skip_serializing_if = "Option::is_none")]
30131    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage>,
30132}
30133impl ConfirmPaymentIntentPaymentMethodOptionsMbWay {
30134    pub fn new() -> Self {
30135        Self { setup_future_usage: None }
30136    }
30137}
30138impl Default for ConfirmPaymentIntentPaymentMethodOptionsMbWay {
30139    fn default() -> Self {
30140        Self::new()
30141    }
30142}
30143/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30144///
30145/// 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.
30146/// 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.
30147///
30148/// 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.
30149///
30150/// 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).
30151///
30152/// 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`.
30153#[derive(Copy, Clone, Eq, PartialEq)]
30154pub enum ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
30155    None,
30156}
30157impl ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
30158    pub fn as_str(self) -> &'static str {
30159        use ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage::*;
30160        match self {
30161            None => "none",
30162        }
30163    }
30164}
30165
30166impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
30167    type Err = stripe_types::StripeParseError;
30168    fn from_str(s: &str) -> Result<Self, Self::Err> {
30169        use ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage::*;
30170        match s {
30171            "none" => Ok(None),
30172            _ => Err(stripe_types::StripeParseError),
30173        }
30174    }
30175}
30176impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
30177    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30178        f.write_str(self.as_str())
30179    }
30180}
30181
30182impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
30183    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30184        f.write_str(self.as_str())
30185    }
30186}
30187impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
30188    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30189    where
30190        S: serde::Serializer,
30191    {
30192        serializer.serialize_str(self.as_str())
30193    }
30194}
30195#[cfg(feature = "deserialize")]
30196impl<'de> serde::Deserialize<'de>
30197    for ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage
30198{
30199    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30200        use std::str::FromStr;
30201        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30202        Self::from_str(&s).map_err(|_| {
30203            serde::de::Error::custom(
30204                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage",
30205            )
30206        })
30207    }
30208}
30209/// If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options.
30210#[derive(Copy, Clone, Debug, serde::Serialize)]
30211pub struct ConfirmPaymentIntentPaymentMethodOptionsMobilepay {
30212    /// Controls when the funds are captured from the customer's account.
30213    ///
30214    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
30215    ///
30216    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
30217    #[serde(skip_serializing_if = "Option::is_none")]
30218    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod>,
30219    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30220    ///
30221    /// 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.
30222    /// 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.
30223    ///
30224    /// 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.
30225    ///
30226    /// 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).
30227    ///
30228    /// 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`.
30229    #[serde(skip_serializing_if = "Option::is_none")]
30230    pub setup_future_usage:
30231        Option<ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage>,
30232}
30233impl ConfirmPaymentIntentPaymentMethodOptionsMobilepay {
30234    pub fn new() -> Self {
30235        Self { capture_method: None, setup_future_usage: None }
30236    }
30237}
30238impl Default for ConfirmPaymentIntentPaymentMethodOptionsMobilepay {
30239    fn default() -> Self {
30240        Self::new()
30241    }
30242}
30243/// Controls when the funds are captured from the customer's account.
30244///
30245/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
30246///
30247/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
30248#[derive(Copy, Clone, Eq, PartialEq)]
30249pub enum ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
30250    Manual,
30251}
30252impl ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
30253    pub fn as_str(self) -> &'static str {
30254        use ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod::*;
30255        match self {
30256            Manual => "manual",
30257        }
30258    }
30259}
30260
30261impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
30262    type Err = stripe_types::StripeParseError;
30263    fn from_str(s: &str) -> Result<Self, Self::Err> {
30264        use ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod::*;
30265        match s {
30266            "manual" => Ok(Manual),
30267            _ => Err(stripe_types::StripeParseError),
30268        }
30269    }
30270}
30271impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
30272    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30273        f.write_str(self.as_str())
30274    }
30275}
30276
30277impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
30278    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30279        f.write_str(self.as_str())
30280    }
30281}
30282impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
30283    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30284    where
30285        S: serde::Serializer,
30286    {
30287        serializer.serialize_str(self.as_str())
30288    }
30289}
30290#[cfg(feature = "deserialize")]
30291impl<'de> serde::Deserialize<'de>
30292    for ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod
30293{
30294    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30295        use std::str::FromStr;
30296        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30297        Self::from_str(&s).map_err(|_| {
30298            serde::de::Error::custom(
30299                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod",
30300            )
30301        })
30302    }
30303}
30304/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30305///
30306/// 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.
30307/// 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.
30308///
30309/// 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.
30310///
30311/// 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).
30312///
30313/// 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`.
30314#[derive(Copy, Clone, Eq, PartialEq)]
30315pub enum ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
30316    None,
30317}
30318impl ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
30319    pub fn as_str(self) -> &'static str {
30320        use ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage::*;
30321        match self {
30322            None => "none",
30323        }
30324    }
30325}
30326
30327impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
30328    type Err = stripe_types::StripeParseError;
30329    fn from_str(s: &str) -> Result<Self, Self::Err> {
30330        use ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage::*;
30331        match s {
30332            "none" => Ok(None),
30333            _ => Err(stripe_types::StripeParseError),
30334        }
30335    }
30336}
30337impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
30338    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30339        f.write_str(self.as_str())
30340    }
30341}
30342
30343impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
30344    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30345        f.write_str(self.as_str())
30346    }
30347}
30348impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
30349    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30350    where
30351        S: serde::Serializer,
30352    {
30353        serializer.serialize_str(self.as_str())
30354    }
30355}
30356#[cfg(feature = "deserialize")]
30357impl<'de> serde::Deserialize<'de>
30358    for ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage
30359{
30360    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30361        use std::str::FromStr;
30362        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30363        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage"))
30364    }
30365}
30366/// If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options.
30367#[derive(Copy, Clone, Debug, serde::Serialize)]
30368pub struct ConfirmPaymentIntentPaymentMethodOptionsMultibanco {
30369    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30370    ///
30371    /// 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.
30372    /// 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.
30373    ///
30374    /// 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.
30375    ///
30376    /// 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).
30377    ///
30378    /// 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`.
30379    #[serde(skip_serializing_if = "Option::is_none")]
30380    pub setup_future_usage:
30381        Option<ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage>,
30382}
30383impl ConfirmPaymentIntentPaymentMethodOptionsMultibanco {
30384    pub fn new() -> Self {
30385        Self { setup_future_usage: None }
30386    }
30387}
30388impl Default for ConfirmPaymentIntentPaymentMethodOptionsMultibanco {
30389    fn default() -> Self {
30390        Self::new()
30391    }
30392}
30393/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30394///
30395/// 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.
30396/// 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.
30397///
30398/// 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.
30399///
30400/// 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).
30401///
30402/// 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`.
30403#[derive(Copy, Clone, Eq, PartialEq)]
30404pub enum ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
30405    None,
30406}
30407impl ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
30408    pub fn as_str(self) -> &'static str {
30409        use ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage::*;
30410        match self {
30411            None => "none",
30412        }
30413    }
30414}
30415
30416impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
30417    type Err = stripe_types::StripeParseError;
30418    fn from_str(s: &str) -> Result<Self, Self::Err> {
30419        use ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage::*;
30420        match s {
30421            "none" => Ok(None),
30422            _ => Err(stripe_types::StripeParseError),
30423        }
30424    }
30425}
30426impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
30427    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30428        f.write_str(self.as_str())
30429    }
30430}
30431
30432impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
30433    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30434        f.write_str(self.as_str())
30435    }
30436}
30437impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
30438    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30439    where
30440        S: serde::Serializer,
30441    {
30442        serializer.serialize_str(self.as_str())
30443    }
30444}
30445#[cfg(feature = "deserialize")]
30446impl<'de> serde::Deserialize<'de>
30447    for ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage
30448{
30449    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30450        use std::str::FromStr;
30451        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30452        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage"))
30453    }
30454}
30455/// If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options.
30456#[derive(Copy, Clone, Debug, serde::Serialize)]
30457pub struct ConfirmPaymentIntentPaymentMethodOptionsNaverPay {
30458    /// Controls when the funds are captured from the customer's account.
30459    ///
30460    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
30461    ///
30462    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
30463    #[serde(skip_serializing_if = "Option::is_none")]
30464    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod>,
30465    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30466    ///
30467    /// 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.
30468    /// 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.
30469    ///
30470    /// 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.
30471    ///
30472    /// 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).
30473    #[serde(skip_serializing_if = "Option::is_none")]
30474    pub setup_future_usage:
30475        Option<ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage>,
30476}
30477impl ConfirmPaymentIntentPaymentMethodOptionsNaverPay {
30478    pub fn new() -> Self {
30479        Self { capture_method: None, setup_future_usage: None }
30480    }
30481}
30482impl Default for ConfirmPaymentIntentPaymentMethodOptionsNaverPay {
30483    fn default() -> Self {
30484        Self::new()
30485    }
30486}
30487/// Controls when the funds are captured from the customer's account.
30488///
30489/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
30490///
30491/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
30492#[derive(Copy, Clone, Eq, PartialEq)]
30493pub enum ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
30494    Manual,
30495}
30496impl ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
30497    pub fn as_str(self) -> &'static str {
30498        use ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod::*;
30499        match self {
30500            Manual => "manual",
30501        }
30502    }
30503}
30504
30505impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
30506    type Err = stripe_types::StripeParseError;
30507    fn from_str(s: &str) -> Result<Self, Self::Err> {
30508        use ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod::*;
30509        match s {
30510            "manual" => Ok(Manual),
30511            _ => Err(stripe_types::StripeParseError),
30512        }
30513    }
30514}
30515impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
30516    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30517        f.write_str(self.as_str())
30518    }
30519}
30520
30521impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
30522    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30523        f.write_str(self.as_str())
30524    }
30525}
30526impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
30527    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30528    where
30529        S: serde::Serializer,
30530    {
30531        serializer.serialize_str(self.as_str())
30532    }
30533}
30534#[cfg(feature = "deserialize")]
30535impl<'de> serde::Deserialize<'de>
30536    for ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod
30537{
30538    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30539        use std::str::FromStr;
30540        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30541        Self::from_str(&s).map_err(|_| {
30542            serde::de::Error::custom(
30543                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod",
30544            )
30545        })
30546    }
30547}
30548/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30549///
30550/// 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.
30551/// 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.
30552///
30553/// 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.
30554///
30555/// 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).
30556#[derive(Copy, Clone, Eq, PartialEq)]
30557pub enum ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
30558    None,
30559    OffSession,
30560}
30561impl ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
30562    pub fn as_str(self) -> &'static str {
30563        use ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage::*;
30564        match self {
30565            None => "none",
30566            OffSession => "off_session",
30567        }
30568    }
30569}
30570
30571impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
30572    type Err = stripe_types::StripeParseError;
30573    fn from_str(s: &str) -> Result<Self, Self::Err> {
30574        use ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage::*;
30575        match s {
30576            "none" => Ok(None),
30577            "off_session" => Ok(OffSession),
30578            _ => Err(stripe_types::StripeParseError),
30579        }
30580    }
30581}
30582impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
30583    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30584        f.write_str(self.as_str())
30585    }
30586}
30587
30588impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
30589    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30590        f.write_str(self.as_str())
30591    }
30592}
30593impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
30594    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30595    where
30596        S: serde::Serializer,
30597    {
30598        serializer.serialize_str(self.as_str())
30599    }
30600}
30601#[cfg(feature = "deserialize")]
30602impl<'de> serde::Deserialize<'de>
30603    for ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage
30604{
30605    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30606        use std::str::FromStr;
30607        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30608        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage"))
30609    }
30610}
30611/// If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options.
30612#[derive(Clone, Debug, serde::Serialize)]
30613pub struct ConfirmPaymentIntentPaymentMethodOptionsNzBankAccount {
30614    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30615    ///
30616    /// 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.
30617    /// 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.
30618    ///
30619    /// 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.
30620    ///
30621    /// 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).
30622    ///
30623    /// 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`.
30624    #[serde(skip_serializing_if = "Option::is_none")]
30625    pub setup_future_usage:
30626        Option<ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage>,
30627    /// Controls when Stripe will attempt to debit the funds from the customer's account.
30628    /// The date must be a string in YYYY-MM-DD format.
30629    /// The date must be in the future and between 3 and 15 calendar days from now.
30630    #[serde(skip_serializing_if = "Option::is_none")]
30631    pub target_date: Option<String>,
30632}
30633impl ConfirmPaymentIntentPaymentMethodOptionsNzBankAccount {
30634    pub fn new() -> Self {
30635        Self { setup_future_usage: None, target_date: None }
30636    }
30637}
30638impl Default for ConfirmPaymentIntentPaymentMethodOptionsNzBankAccount {
30639    fn default() -> Self {
30640        Self::new()
30641    }
30642}
30643/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30644///
30645/// 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.
30646/// 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.
30647///
30648/// 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.
30649///
30650/// 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).
30651///
30652/// 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`.
30653#[derive(Copy, Clone, Eq, PartialEq)]
30654pub enum ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
30655    None,
30656    OffSession,
30657    OnSession,
30658}
30659impl ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
30660    pub fn as_str(self) -> &'static str {
30661        use ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage::*;
30662        match self {
30663            None => "none",
30664            OffSession => "off_session",
30665            OnSession => "on_session",
30666        }
30667    }
30668}
30669
30670impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
30671    type Err = stripe_types::StripeParseError;
30672    fn from_str(s: &str) -> Result<Self, Self::Err> {
30673        use ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage::*;
30674        match s {
30675            "none" => Ok(None),
30676            "off_session" => Ok(OffSession),
30677            "on_session" => Ok(OnSession),
30678            _ => Err(stripe_types::StripeParseError),
30679        }
30680    }
30681}
30682impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
30683    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30684        f.write_str(self.as_str())
30685    }
30686}
30687
30688impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
30689    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30690        f.write_str(self.as_str())
30691    }
30692}
30693impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
30694    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30695    where
30696        S: serde::Serializer,
30697    {
30698        serializer.serialize_str(self.as_str())
30699    }
30700}
30701#[cfg(feature = "deserialize")]
30702impl<'de> serde::Deserialize<'de>
30703    for ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage
30704{
30705    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30706        use std::str::FromStr;
30707        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30708        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage"))
30709    }
30710}
30711/// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options.
30712#[derive(Copy, Clone, Debug, serde::Serialize)]
30713pub struct ConfirmPaymentIntentPaymentMethodOptionsOxxo {
30714    /// The number of calendar days before an OXXO voucher expires.
30715    /// 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.
30716    #[serde(skip_serializing_if = "Option::is_none")]
30717    pub expires_after_days: Option<u32>,
30718    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30719    ///
30720    /// 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.
30721    /// 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.
30722    ///
30723    /// 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.
30724    ///
30725    /// 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).
30726    ///
30727    /// 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`.
30728    #[serde(skip_serializing_if = "Option::is_none")]
30729    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage>,
30730}
30731impl ConfirmPaymentIntentPaymentMethodOptionsOxxo {
30732    pub fn new() -> Self {
30733        Self { expires_after_days: None, setup_future_usage: None }
30734    }
30735}
30736impl Default for ConfirmPaymentIntentPaymentMethodOptionsOxxo {
30737    fn default() -> Self {
30738        Self::new()
30739    }
30740}
30741/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30742///
30743/// 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.
30744/// 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.
30745///
30746/// 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.
30747///
30748/// 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).
30749///
30750/// 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`.
30751#[derive(Copy, Clone, Eq, PartialEq)]
30752pub enum ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
30753    None,
30754}
30755impl ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
30756    pub fn as_str(self) -> &'static str {
30757        use ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*;
30758        match self {
30759            None => "none",
30760        }
30761    }
30762}
30763
30764impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
30765    type Err = stripe_types::StripeParseError;
30766    fn from_str(s: &str) -> Result<Self, Self::Err> {
30767        use ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*;
30768        match s {
30769            "none" => Ok(None),
30770            _ => Err(stripe_types::StripeParseError),
30771        }
30772    }
30773}
30774impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
30775    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30776        f.write_str(self.as_str())
30777    }
30778}
30779
30780impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
30781    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30782        f.write_str(self.as_str())
30783    }
30784}
30785impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
30786    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30787    where
30788        S: serde::Serializer,
30789    {
30790        serializer.serialize_str(self.as_str())
30791    }
30792}
30793#[cfg(feature = "deserialize")]
30794impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
30795    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30796        use std::str::FromStr;
30797        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30798        Self::from_str(&s).map_err(|_| {
30799            serde::de::Error::custom(
30800                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage",
30801            )
30802        })
30803    }
30804}
30805/// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options.
30806#[derive(Copy, Clone, Debug, serde::Serialize)]
30807pub struct ConfirmPaymentIntentPaymentMethodOptionsP24 {
30808    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30809    ///
30810    /// 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.
30811    /// 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.
30812    ///
30813    /// 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.
30814    ///
30815    /// 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).
30816    ///
30817    /// 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`.
30818    #[serde(skip_serializing_if = "Option::is_none")]
30819    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage>,
30820    /// Confirm that the payer has accepted the P24 terms and conditions.
30821    #[serde(skip_serializing_if = "Option::is_none")]
30822    pub tos_shown_and_accepted: Option<bool>,
30823}
30824impl ConfirmPaymentIntentPaymentMethodOptionsP24 {
30825    pub fn new() -> Self {
30826        Self { setup_future_usage: None, tos_shown_and_accepted: None }
30827    }
30828}
30829impl Default for ConfirmPaymentIntentPaymentMethodOptionsP24 {
30830    fn default() -> Self {
30831        Self::new()
30832    }
30833}
30834/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30835///
30836/// 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.
30837/// 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.
30838///
30839/// 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.
30840///
30841/// 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).
30842///
30843/// 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`.
30844#[derive(Copy, Clone, Eq, PartialEq)]
30845pub enum ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
30846    None,
30847}
30848impl ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
30849    pub fn as_str(self) -> &'static str {
30850        use ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*;
30851        match self {
30852            None => "none",
30853        }
30854    }
30855}
30856
30857impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
30858    type Err = stripe_types::StripeParseError;
30859    fn from_str(s: &str) -> Result<Self, Self::Err> {
30860        use ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*;
30861        match s {
30862            "none" => Ok(None),
30863            _ => Err(stripe_types::StripeParseError),
30864        }
30865    }
30866}
30867impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
30868    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30869        f.write_str(self.as_str())
30870    }
30871}
30872
30873impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
30874    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30875        f.write_str(self.as_str())
30876    }
30877}
30878impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
30879    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30880    where
30881        S: serde::Serializer,
30882    {
30883        serializer.serialize_str(self.as_str())
30884    }
30885}
30886#[cfg(feature = "deserialize")]
30887impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
30888    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30889        use std::str::FromStr;
30890        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30891        Self::from_str(&s).map_err(|_| {
30892            serde::de::Error::custom(
30893                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage",
30894            )
30895        })
30896    }
30897}
30898/// If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options.
30899#[derive(Copy, Clone, Debug, serde::Serialize)]
30900pub struct ConfirmPaymentIntentPaymentMethodOptionsPayco {
30901    /// Controls when the funds are captured from the customer's account.
30902    ///
30903    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
30904    ///
30905    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
30906    #[serde(skip_serializing_if = "Option::is_none")]
30907    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod>,
30908}
30909impl ConfirmPaymentIntentPaymentMethodOptionsPayco {
30910    pub fn new() -> Self {
30911        Self { capture_method: None }
30912    }
30913}
30914impl Default for ConfirmPaymentIntentPaymentMethodOptionsPayco {
30915    fn default() -> Self {
30916        Self::new()
30917    }
30918}
30919/// Controls when the funds are captured from the customer's account.
30920///
30921/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
30922///
30923/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
30924#[derive(Copy, Clone, Eq, PartialEq)]
30925pub enum ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
30926    Manual,
30927}
30928impl ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
30929    pub fn as_str(self) -> &'static str {
30930        use ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod::*;
30931        match self {
30932            Manual => "manual",
30933        }
30934    }
30935}
30936
30937impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
30938    type Err = stripe_types::StripeParseError;
30939    fn from_str(s: &str) -> Result<Self, Self::Err> {
30940        use ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod::*;
30941        match s {
30942            "manual" => Ok(Manual),
30943            _ => Err(stripe_types::StripeParseError),
30944        }
30945    }
30946}
30947impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
30948    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30949        f.write_str(self.as_str())
30950    }
30951}
30952
30953impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
30954    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30955        f.write_str(self.as_str())
30956    }
30957}
30958impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
30959    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30960    where
30961        S: serde::Serializer,
30962    {
30963        serializer.serialize_str(self.as_str())
30964    }
30965}
30966#[cfg(feature = "deserialize")]
30967impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
30968    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30969        use std::str::FromStr;
30970        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30971        Self::from_str(&s).map_err(|_| {
30972            serde::de::Error::custom(
30973                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod",
30974            )
30975        })
30976    }
30977}
30978/// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options.
30979#[derive(Copy, Clone, Debug, serde::Serialize)]
30980pub struct ConfirmPaymentIntentPaymentMethodOptionsPaynow {
30981    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30982    ///
30983    /// 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.
30984    /// 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.
30985    ///
30986    /// 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.
30987    ///
30988    /// 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).
30989    ///
30990    /// 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`.
30991    #[serde(skip_serializing_if = "Option::is_none")]
30992    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage>,
30993}
30994impl ConfirmPaymentIntentPaymentMethodOptionsPaynow {
30995    pub fn new() -> Self {
30996        Self { setup_future_usage: None }
30997    }
30998}
30999impl Default for ConfirmPaymentIntentPaymentMethodOptionsPaynow {
31000    fn default() -> Self {
31001        Self::new()
31002    }
31003}
31004/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31005///
31006/// 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.
31007/// 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.
31008///
31009/// 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.
31010///
31011/// 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).
31012///
31013/// 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`.
31014#[derive(Copy, Clone, Eq, PartialEq)]
31015pub enum ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
31016    None,
31017}
31018impl ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
31019    pub fn as_str(self) -> &'static str {
31020        use ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*;
31021        match self {
31022            None => "none",
31023        }
31024    }
31025}
31026
31027impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
31028    type Err = stripe_types::StripeParseError;
31029    fn from_str(s: &str) -> Result<Self, Self::Err> {
31030        use ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*;
31031        match s {
31032            "none" => Ok(None),
31033            _ => Err(stripe_types::StripeParseError),
31034        }
31035    }
31036}
31037impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
31038    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31039        f.write_str(self.as_str())
31040    }
31041}
31042
31043impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
31044    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31045        f.write_str(self.as_str())
31046    }
31047}
31048impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
31049    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31050    where
31051        S: serde::Serializer,
31052    {
31053        serializer.serialize_str(self.as_str())
31054    }
31055}
31056#[cfg(feature = "deserialize")]
31057impl<'de> serde::Deserialize<'de>
31058    for ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage
31059{
31060    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31061        use std::str::FromStr;
31062        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31063        Self::from_str(&s).map_err(|_| {
31064            serde::de::Error::custom(
31065                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage",
31066            )
31067        })
31068    }
31069}
31070/// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
31071#[derive(Clone, Debug, serde::Serialize)]
31072pub struct ConfirmPaymentIntentPaymentMethodOptionsPaypal {
31073    /// Controls when the funds will be captured from the customer's account.
31074    #[serde(skip_serializing_if = "Option::is_none")]
31075    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod>,
31076    /// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to.
31077    #[serde(skip_serializing_if = "Option::is_none")]
31078    pub preferred_locale: Option<ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale>,
31079    /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID.
31080    /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID.
31081    #[serde(skip_serializing_if = "Option::is_none")]
31082    pub reference: Option<String>,
31083    /// The risk correlation ID for an on-session payment using a saved PayPal payment method.
31084    #[serde(skip_serializing_if = "Option::is_none")]
31085    pub risk_correlation_id: Option<String>,
31086    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31087    ///
31088    /// 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.
31089    /// 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.
31090    ///
31091    /// 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.
31092    ///
31093    /// 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).
31094    ///
31095    /// 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`.
31096    #[serde(skip_serializing_if = "Option::is_none")]
31097    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage>,
31098}
31099impl ConfirmPaymentIntentPaymentMethodOptionsPaypal {
31100    pub fn new() -> Self {
31101        Self {
31102            capture_method: None,
31103            preferred_locale: None,
31104            reference: None,
31105            risk_correlation_id: None,
31106            setup_future_usage: None,
31107        }
31108    }
31109}
31110impl Default for ConfirmPaymentIntentPaymentMethodOptionsPaypal {
31111    fn default() -> Self {
31112        Self::new()
31113    }
31114}
31115/// Controls when the funds will be captured from the customer's account.
31116#[derive(Copy, Clone, Eq, PartialEq)]
31117pub enum ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
31118    Manual,
31119}
31120impl ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
31121    pub fn as_str(self) -> &'static str {
31122        use ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*;
31123        match self {
31124            Manual => "manual",
31125        }
31126    }
31127}
31128
31129impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
31130    type Err = stripe_types::StripeParseError;
31131    fn from_str(s: &str) -> Result<Self, Self::Err> {
31132        use ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*;
31133        match s {
31134            "manual" => Ok(Manual),
31135            _ => Err(stripe_types::StripeParseError),
31136        }
31137    }
31138}
31139impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
31140    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31141        f.write_str(self.as_str())
31142    }
31143}
31144
31145impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
31146    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31147        f.write_str(self.as_str())
31148    }
31149}
31150impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
31151    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31152    where
31153        S: serde::Serializer,
31154    {
31155        serializer.serialize_str(self.as_str())
31156    }
31157}
31158#[cfg(feature = "deserialize")]
31159impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
31160    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31161        use std::str::FromStr;
31162        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31163        Self::from_str(&s).map_err(|_| {
31164            serde::de::Error::custom(
31165                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod",
31166            )
31167        })
31168    }
31169}
31170/// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to.
31171#[derive(Clone, Eq, PartialEq)]
31172#[non_exhaustive]
31173pub enum ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
31174    CsMinusCz,
31175    DaMinusDk,
31176    DeMinusAt,
31177    DeMinusDe,
31178    DeMinusLu,
31179    ElMinusGr,
31180    EnMinusGb,
31181    EnMinusUs,
31182    EsMinusEs,
31183    FiMinusFi,
31184    FrMinusBe,
31185    FrMinusFr,
31186    FrMinusLu,
31187    HuMinusHu,
31188    ItMinusIt,
31189    NlMinusBe,
31190    NlMinusNl,
31191    PlMinusPl,
31192    PtMinusPt,
31193    SkMinusSk,
31194    SvMinusSe,
31195    /// An unrecognized value from Stripe. Should not be used as a request parameter.
31196    Unknown(String),
31197}
31198impl ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
31199    pub fn as_str(&self) -> &str {
31200        use ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*;
31201        match self {
31202            CsMinusCz => "cs-CZ",
31203            DaMinusDk => "da-DK",
31204            DeMinusAt => "de-AT",
31205            DeMinusDe => "de-DE",
31206            DeMinusLu => "de-LU",
31207            ElMinusGr => "el-GR",
31208            EnMinusGb => "en-GB",
31209            EnMinusUs => "en-US",
31210            EsMinusEs => "es-ES",
31211            FiMinusFi => "fi-FI",
31212            FrMinusBe => "fr-BE",
31213            FrMinusFr => "fr-FR",
31214            FrMinusLu => "fr-LU",
31215            HuMinusHu => "hu-HU",
31216            ItMinusIt => "it-IT",
31217            NlMinusBe => "nl-BE",
31218            NlMinusNl => "nl-NL",
31219            PlMinusPl => "pl-PL",
31220            PtMinusPt => "pt-PT",
31221            SkMinusSk => "sk-SK",
31222            SvMinusSe => "sv-SE",
31223            Unknown(v) => v,
31224        }
31225    }
31226}
31227
31228impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
31229    type Err = std::convert::Infallible;
31230    fn from_str(s: &str) -> Result<Self, Self::Err> {
31231        use ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*;
31232        match s {
31233            "cs-CZ" => Ok(CsMinusCz),
31234            "da-DK" => Ok(DaMinusDk),
31235            "de-AT" => Ok(DeMinusAt),
31236            "de-DE" => Ok(DeMinusDe),
31237            "de-LU" => Ok(DeMinusLu),
31238            "el-GR" => Ok(ElMinusGr),
31239            "en-GB" => Ok(EnMinusGb),
31240            "en-US" => Ok(EnMinusUs),
31241            "es-ES" => Ok(EsMinusEs),
31242            "fi-FI" => Ok(FiMinusFi),
31243            "fr-BE" => Ok(FrMinusBe),
31244            "fr-FR" => Ok(FrMinusFr),
31245            "fr-LU" => Ok(FrMinusLu),
31246            "hu-HU" => Ok(HuMinusHu),
31247            "it-IT" => Ok(ItMinusIt),
31248            "nl-BE" => Ok(NlMinusBe),
31249            "nl-NL" => Ok(NlMinusNl),
31250            "pl-PL" => Ok(PlMinusPl),
31251            "pt-PT" => Ok(PtMinusPt),
31252            "sk-SK" => Ok(SkMinusSk),
31253            "sv-SE" => Ok(SvMinusSe),
31254            v => Ok(Unknown(v.to_owned())),
31255        }
31256    }
31257}
31258impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
31259    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31260        f.write_str(self.as_str())
31261    }
31262}
31263
31264impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
31265    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31266        f.write_str(self.as_str())
31267    }
31268}
31269impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
31270    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31271    where
31272        S: serde::Serializer,
31273    {
31274        serializer.serialize_str(self.as_str())
31275    }
31276}
31277#[cfg(feature = "deserialize")]
31278impl<'de> serde::Deserialize<'de>
31279    for ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale
31280{
31281    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31282        use std::str::FromStr;
31283        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31284        Ok(Self::from_str(&s).unwrap())
31285    }
31286}
31287/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31288///
31289/// 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.
31290/// 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.
31291///
31292/// 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.
31293///
31294/// 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).
31295///
31296/// 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`.
31297#[derive(Copy, Clone, Eq, PartialEq)]
31298pub enum ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
31299    None,
31300    OffSession,
31301}
31302impl ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
31303    pub fn as_str(self) -> &'static str {
31304        use ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*;
31305        match self {
31306            None => "none",
31307            OffSession => "off_session",
31308        }
31309    }
31310}
31311
31312impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
31313    type Err = stripe_types::StripeParseError;
31314    fn from_str(s: &str) -> Result<Self, Self::Err> {
31315        use ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*;
31316        match s {
31317            "none" => Ok(None),
31318            "off_session" => Ok(OffSession),
31319            _ => Err(stripe_types::StripeParseError),
31320        }
31321    }
31322}
31323impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
31324    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31325        f.write_str(self.as_str())
31326    }
31327}
31328
31329impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
31330    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31331        f.write_str(self.as_str())
31332    }
31333}
31334impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
31335    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31336    where
31337        S: serde::Serializer,
31338    {
31339        serializer.serialize_str(self.as_str())
31340    }
31341}
31342#[cfg(feature = "deserialize")]
31343impl<'de> serde::Deserialize<'de>
31344    for ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage
31345{
31346    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31347        use std::str::FromStr;
31348        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31349        Self::from_str(&s).map_err(|_| {
31350            serde::de::Error::custom(
31351                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage",
31352            )
31353        })
31354    }
31355}
31356/// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options.
31357#[derive(Copy, Clone, Debug, serde::Serialize)]
31358pub struct ConfirmPaymentIntentPaymentMethodOptionsPix {
31359    /// Determines if the amount includes the IOF tax. Defaults to `never`.
31360    #[serde(skip_serializing_if = "Option::is_none")]
31361    pub amount_includes_iof: Option<ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof>,
31362    /// The number of seconds (between 10 and 1209600) after which Pix payment will expire.
31363    /// Defaults to 86400 seconds.
31364    #[serde(skip_serializing_if = "Option::is_none")]
31365    pub expires_after_seconds: Option<i64>,
31366    /// The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future).
31367    /// Defaults to 1 day in the future.
31368    #[serde(skip_serializing_if = "Option::is_none")]
31369    pub expires_at: Option<stripe_types::Timestamp>,
31370    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31371    ///
31372    /// 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.
31373    /// 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.
31374    ///
31375    /// 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.
31376    ///
31377    /// 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).
31378    ///
31379    /// 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`.
31380    #[serde(skip_serializing_if = "Option::is_none")]
31381    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage>,
31382}
31383impl ConfirmPaymentIntentPaymentMethodOptionsPix {
31384    pub fn new() -> Self {
31385        Self {
31386            amount_includes_iof: None,
31387            expires_after_seconds: None,
31388            expires_at: None,
31389            setup_future_usage: None,
31390        }
31391    }
31392}
31393impl Default for ConfirmPaymentIntentPaymentMethodOptionsPix {
31394    fn default() -> Self {
31395        Self::new()
31396    }
31397}
31398/// Determines if the amount includes the IOF tax. Defaults to `never`.
31399#[derive(Copy, Clone, Eq, PartialEq)]
31400pub enum ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
31401    Always,
31402    Never,
31403}
31404impl ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
31405    pub fn as_str(self) -> &'static str {
31406        use ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof::*;
31407        match self {
31408            Always => "always",
31409            Never => "never",
31410        }
31411    }
31412}
31413
31414impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
31415    type Err = stripe_types::StripeParseError;
31416    fn from_str(s: &str) -> Result<Self, Self::Err> {
31417        use ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof::*;
31418        match s {
31419            "always" => Ok(Always),
31420            "never" => Ok(Never),
31421            _ => Err(stripe_types::StripeParseError),
31422        }
31423    }
31424}
31425impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
31426    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31427        f.write_str(self.as_str())
31428    }
31429}
31430
31431impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
31432    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31433        f.write_str(self.as_str())
31434    }
31435}
31436impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
31437    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31438    where
31439        S: serde::Serializer,
31440    {
31441        serializer.serialize_str(self.as_str())
31442    }
31443}
31444#[cfg(feature = "deserialize")]
31445impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
31446    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31447        use std::str::FromStr;
31448        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31449        Self::from_str(&s).map_err(|_| {
31450            serde::de::Error::custom(
31451                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof",
31452            )
31453        })
31454    }
31455}
31456/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31457///
31458/// 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.
31459/// 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.
31460///
31461/// 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.
31462///
31463/// 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).
31464///
31465/// 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`.
31466#[derive(Copy, Clone, Eq, PartialEq)]
31467pub enum ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
31468    None,
31469}
31470impl ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
31471    pub fn as_str(self) -> &'static str {
31472        use ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*;
31473        match self {
31474            None => "none",
31475        }
31476    }
31477}
31478
31479impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
31480    type Err = stripe_types::StripeParseError;
31481    fn from_str(s: &str) -> Result<Self, Self::Err> {
31482        use ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*;
31483        match s {
31484            "none" => Ok(None),
31485            _ => Err(stripe_types::StripeParseError),
31486        }
31487    }
31488}
31489impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
31490    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31491        f.write_str(self.as_str())
31492    }
31493}
31494
31495impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
31496    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31497        f.write_str(self.as_str())
31498    }
31499}
31500impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
31501    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31502    where
31503        S: serde::Serializer,
31504    {
31505        serializer.serialize_str(self.as_str())
31506    }
31507}
31508#[cfg(feature = "deserialize")]
31509impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
31510    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31511        use std::str::FromStr;
31512        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31513        Self::from_str(&s).map_err(|_| {
31514            serde::de::Error::custom(
31515                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage",
31516            )
31517        })
31518    }
31519}
31520/// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options.
31521#[derive(Copy, Clone, Debug, serde::Serialize)]
31522pub struct ConfirmPaymentIntentPaymentMethodOptionsPromptpay {
31523    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31524    ///
31525    /// 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.
31526    /// 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.
31527    ///
31528    /// 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.
31529    ///
31530    /// 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).
31531    ///
31532    /// 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`.
31533    #[serde(skip_serializing_if = "Option::is_none")]
31534    pub setup_future_usage:
31535        Option<ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage>,
31536}
31537impl ConfirmPaymentIntentPaymentMethodOptionsPromptpay {
31538    pub fn new() -> Self {
31539        Self { setup_future_usage: None }
31540    }
31541}
31542impl Default for ConfirmPaymentIntentPaymentMethodOptionsPromptpay {
31543    fn default() -> Self {
31544        Self::new()
31545    }
31546}
31547/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31548///
31549/// 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.
31550/// 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.
31551///
31552/// 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.
31553///
31554/// 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).
31555///
31556/// 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`.
31557#[derive(Copy, Clone, Eq, PartialEq)]
31558pub enum ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
31559    None,
31560}
31561impl ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
31562    pub fn as_str(self) -> &'static str {
31563        use ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*;
31564        match self {
31565            None => "none",
31566        }
31567    }
31568}
31569
31570impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
31571    type Err = stripe_types::StripeParseError;
31572    fn from_str(s: &str) -> Result<Self, Self::Err> {
31573        use ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*;
31574        match s {
31575            "none" => Ok(None),
31576            _ => Err(stripe_types::StripeParseError),
31577        }
31578    }
31579}
31580impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
31581    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31582        f.write_str(self.as_str())
31583    }
31584}
31585
31586impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
31587    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31588        f.write_str(self.as_str())
31589    }
31590}
31591impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
31592    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31593    where
31594        S: serde::Serializer,
31595    {
31596        serializer.serialize_str(self.as_str())
31597    }
31598}
31599#[cfg(feature = "deserialize")]
31600impl<'de> serde::Deserialize<'de>
31601    for ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage
31602{
31603    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31604        use std::str::FromStr;
31605        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31606        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage"))
31607    }
31608}
31609/// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options.
31610#[derive(Copy, Clone, Debug, serde::Serialize)]
31611pub struct ConfirmPaymentIntentPaymentMethodOptionsRevolutPay {
31612    /// Controls when the funds are captured from the customer's account.
31613    ///
31614    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
31615    ///
31616    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
31617    #[serde(skip_serializing_if = "Option::is_none")]
31618    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod>,
31619    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31620    ///
31621    /// 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.
31622    /// 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.
31623    ///
31624    /// 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.
31625    ///
31626    /// 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).
31627    #[serde(skip_serializing_if = "Option::is_none")]
31628    pub setup_future_usage:
31629        Option<ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage>,
31630}
31631impl ConfirmPaymentIntentPaymentMethodOptionsRevolutPay {
31632    pub fn new() -> Self {
31633        Self { capture_method: None, setup_future_usage: None }
31634    }
31635}
31636impl Default for ConfirmPaymentIntentPaymentMethodOptionsRevolutPay {
31637    fn default() -> Self {
31638        Self::new()
31639    }
31640}
31641/// Controls when the funds are captured from the customer's account.
31642///
31643/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
31644///
31645/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
31646#[derive(Copy, Clone, Eq, PartialEq)]
31647pub enum ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
31648    Manual,
31649}
31650impl ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
31651    pub fn as_str(self) -> &'static str {
31652        use ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod::*;
31653        match self {
31654            Manual => "manual",
31655        }
31656    }
31657}
31658
31659impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
31660    type Err = stripe_types::StripeParseError;
31661    fn from_str(s: &str) -> Result<Self, Self::Err> {
31662        use ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod::*;
31663        match s {
31664            "manual" => Ok(Manual),
31665            _ => Err(stripe_types::StripeParseError),
31666        }
31667    }
31668}
31669impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
31670    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31671        f.write_str(self.as_str())
31672    }
31673}
31674
31675impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
31676    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31677        f.write_str(self.as_str())
31678    }
31679}
31680impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
31681    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31682    where
31683        S: serde::Serializer,
31684    {
31685        serializer.serialize_str(self.as_str())
31686    }
31687}
31688#[cfg(feature = "deserialize")]
31689impl<'de> serde::Deserialize<'de>
31690    for ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod
31691{
31692    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31693        use std::str::FromStr;
31694        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31695        Self::from_str(&s).map_err(|_| {
31696            serde::de::Error::custom(
31697                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod",
31698            )
31699        })
31700    }
31701}
31702/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31703///
31704/// 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.
31705/// 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.
31706///
31707/// 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.
31708///
31709/// 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).
31710#[derive(Copy, Clone, Eq, PartialEq)]
31711pub enum ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
31712    None,
31713    OffSession,
31714}
31715impl ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
31716    pub fn as_str(self) -> &'static str {
31717        use ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*;
31718        match self {
31719            None => "none",
31720            OffSession => "off_session",
31721        }
31722    }
31723}
31724
31725impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
31726    type Err = stripe_types::StripeParseError;
31727    fn from_str(s: &str) -> Result<Self, Self::Err> {
31728        use ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*;
31729        match s {
31730            "none" => Ok(None),
31731            "off_session" => Ok(OffSession),
31732            _ => Err(stripe_types::StripeParseError),
31733        }
31734    }
31735}
31736impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
31737    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31738        f.write_str(self.as_str())
31739    }
31740}
31741
31742impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
31743    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31744        f.write_str(self.as_str())
31745    }
31746}
31747impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
31748    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31749    where
31750        S: serde::Serializer,
31751    {
31752        serializer.serialize_str(self.as_str())
31753    }
31754}
31755#[cfg(feature = "deserialize")]
31756impl<'de> serde::Deserialize<'de>
31757    for ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage
31758{
31759    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31760        use std::str::FromStr;
31761        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31762        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage"))
31763    }
31764}
31765/// If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options.
31766#[derive(Copy, Clone, Debug, serde::Serialize)]
31767pub struct ConfirmPaymentIntentPaymentMethodOptionsSamsungPay {
31768    /// Controls when the funds are captured from the customer's account.
31769    ///
31770    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
31771    ///
31772    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
31773    #[serde(skip_serializing_if = "Option::is_none")]
31774    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod>,
31775}
31776impl ConfirmPaymentIntentPaymentMethodOptionsSamsungPay {
31777    pub fn new() -> Self {
31778        Self { capture_method: None }
31779    }
31780}
31781impl Default for ConfirmPaymentIntentPaymentMethodOptionsSamsungPay {
31782    fn default() -> Self {
31783        Self::new()
31784    }
31785}
31786/// Controls when the funds are captured from the customer's account.
31787///
31788/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
31789///
31790/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
31791#[derive(Copy, Clone, Eq, PartialEq)]
31792pub enum ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
31793    Manual,
31794}
31795impl ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
31796    pub fn as_str(self) -> &'static str {
31797        use ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod::*;
31798        match self {
31799            Manual => "manual",
31800        }
31801    }
31802}
31803
31804impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
31805    type Err = stripe_types::StripeParseError;
31806    fn from_str(s: &str) -> Result<Self, Self::Err> {
31807        use ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod::*;
31808        match s {
31809            "manual" => Ok(Manual),
31810            _ => Err(stripe_types::StripeParseError),
31811        }
31812    }
31813}
31814impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
31815    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31816        f.write_str(self.as_str())
31817    }
31818}
31819
31820impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
31821    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31822        f.write_str(self.as_str())
31823    }
31824}
31825impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
31826    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31827    where
31828        S: serde::Serializer,
31829    {
31830        serializer.serialize_str(self.as_str())
31831    }
31832}
31833#[cfg(feature = "deserialize")]
31834impl<'de> serde::Deserialize<'de>
31835    for ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod
31836{
31837    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31838        use std::str::FromStr;
31839        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31840        Self::from_str(&s).map_err(|_| {
31841            serde::de::Error::custom(
31842                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod",
31843            )
31844        })
31845    }
31846}
31847/// If this is a `satispay` PaymentMethod, this sub-hash contains details about the Satispay payment method options.
31848#[derive(Copy, Clone, Debug, serde::Serialize)]
31849pub struct ConfirmPaymentIntentPaymentMethodOptionsSatispay {
31850    /// Controls when the funds are captured from the customer's account.
31851    ///
31852    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
31853    ///
31854    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
31855    #[serde(skip_serializing_if = "Option::is_none")]
31856    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod>,
31857}
31858impl ConfirmPaymentIntentPaymentMethodOptionsSatispay {
31859    pub fn new() -> Self {
31860        Self { capture_method: None }
31861    }
31862}
31863impl Default for ConfirmPaymentIntentPaymentMethodOptionsSatispay {
31864    fn default() -> Self {
31865        Self::new()
31866    }
31867}
31868/// Controls when the funds are captured from the customer's account.
31869///
31870/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
31871///
31872/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
31873#[derive(Copy, Clone, Eq, PartialEq)]
31874pub enum ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
31875    Manual,
31876}
31877impl ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
31878    pub fn as_str(self) -> &'static str {
31879        use ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod::*;
31880        match self {
31881            Manual => "manual",
31882        }
31883    }
31884}
31885
31886impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
31887    type Err = stripe_types::StripeParseError;
31888    fn from_str(s: &str) -> Result<Self, Self::Err> {
31889        use ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod::*;
31890        match s {
31891            "manual" => Ok(Manual),
31892            _ => Err(stripe_types::StripeParseError),
31893        }
31894    }
31895}
31896impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
31897    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31898        f.write_str(self.as_str())
31899    }
31900}
31901
31902impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
31903    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31904        f.write_str(self.as_str())
31905    }
31906}
31907impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
31908    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31909    where
31910        S: serde::Serializer,
31911    {
31912        serializer.serialize_str(self.as_str())
31913    }
31914}
31915#[cfg(feature = "deserialize")]
31916impl<'de> serde::Deserialize<'de>
31917    for ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod
31918{
31919    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31920        use std::str::FromStr;
31921        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31922        Self::from_str(&s).map_err(|_| {
31923            serde::de::Error::custom(
31924                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod",
31925            )
31926        })
31927    }
31928}
31929/// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options.
31930#[derive(Clone, Debug, serde::Serialize)]
31931pub struct ConfirmPaymentIntentPaymentMethodOptionsSepaDebit {
31932    /// Additional fields for Mandate creation
31933    #[serde(skip_serializing_if = "Option::is_none")]
31934    pub mandate_options: Option<ConfirmPaymentIntentPaymentMethodOptionsSepaDebitMandateOptions>,
31935    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31936    ///
31937    /// 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.
31938    /// 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.
31939    ///
31940    /// 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.
31941    ///
31942    /// 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).
31943    ///
31944    /// 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`.
31945    #[serde(skip_serializing_if = "Option::is_none")]
31946    pub setup_future_usage:
31947        Option<ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage>,
31948    /// Controls when Stripe will attempt to debit the funds from the customer's account.
31949    /// The date must be a string in YYYY-MM-DD format.
31950    /// The date must be in the future and between 3 and 15 calendar days from now.
31951    #[serde(skip_serializing_if = "Option::is_none")]
31952    pub target_date: Option<String>,
31953}
31954impl ConfirmPaymentIntentPaymentMethodOptionsSepaDebit {
31955    pub fn new() -> Self {
31956        Self { mandate_options: None, setup_future_usage: None, target_date: None }
31957    }
31958}
31959impl Default for ConfirmPaymentIntentPaymentMethodOptionsSepaDebit {
31960    fn default() -> Self {
31961        Self::new()
31962    }
31963}
31964/// Additional fields for Mandate creation
31965#[derive(Clone, Debug, serde::Serialize)]
31966pub struct ConfirmPaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
31967    /// Prefix used to generate the Mandate reference.
31968    /// Must be at most 12 characters long.
31969    /// Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'.
31970    /// Cannot begin with 'STRIPE'.
31971    #[serde(skip_serializing_if = "Option::is_none")]
31972    pub reference_prefix: Option<String>,
31973}
31974impl ConfirmPaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
31975    pub fn new() -> Self {
31976        Self { reference_prefix: None }
31977    }
31978}
31979impl Default for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
31980    fn default() -> Self {
31981        Self::new()
31982    }
31983}
31984/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31985///
31986/// 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.
31987/// 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.
31988///
31989/// 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.
31990///
31991/// 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).
31992///
31993/// 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`.
31994#[derive(Copy, Clone, Eq, PartialEq)]
31995pub enum ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
31996    None,
31997    OffSession,
31998    OnSession,
31999}
32000impl ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
32001    pub fn as_str(self) -> &'static str {
32002        use ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*;
32003        match self {
32004            None => "none",
32005            OffSession => "off_session",
32006            OnSession => "on_session",
32007        }
32008    }
32009}
32010
32011impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
32012    type Err = stripe_types::StripeParseError;
32013    fn from_str(s: &str) -> Result<Self, Self::Err> {
32014        use ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*;
32015        match s {
32016            "none" => Ok(None),
32017            "off_session" => Ok(OffSession),
32018            "on_session" => Ok(OnSession),
32019            _ => Err(stripe_types::StripeParseError),
32020        }
32021    }
32022}
32023impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
32024    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32025        f.write_str(self.as_str())
32026    }
32027}
32028
32029impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
32030    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32031        f.write_str(self.as_str())
32032    }
32033}
32034impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
32035    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32036    where
32037        S: serde::Serializer,
32038    {
32039        serializer.serialize_str(self.as_str())
32040    }
32041}
32042#[cfg(feature = "deserialize")]
32043impl<'de> serde::Deserialize<'de>
32044    for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage
32045{
32046    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32047        use std::str::FromStr;
32048        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32049        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage"))
32050    }
32051}
32052/// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options.
32053#[derive(Copy, Clone, Debug, serde::Serialize)]
32054pub struct ConfirmPaymentIntentPaymentMethodOptionsSofort {
32055    /// Language shown to the payer on redirect.
32056    #[serde(skip_serializing_if = "Option::is_none")]
32057    pub preferred_language: Option<ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage>,
32058    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32059    ///
32060    /// 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.
32061    /// 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.
32062    ///
32063    /// 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.
32064    ///
32065    /// 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).
32066    ///
32067    /// 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`.
32068    #[serde(skip_serializing_if = "Option::is_none")]
32069    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage>,
32070}
32071impl ConfirmPaymentIntentPaymentMethodOptionsSofort {
32072    pub fn new() -> Self {
32073        Self { preferred_language: None, setup_future_usage: None }
32074    }
32075}
32076impl Default for ConfirmPaymentIntentPaymentMethodOptionsSofort {
32077    fn default() -> Self {
32078        Self::new()
32079    }
32080}
32081/// Language shown to the payer on redirect.
32082#[derive(Copy, Clone, Eq, PartialEq)]
32083pub enum ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
32084    De,
32085    En,
32086    Es,
32087    Fr,
32088    It,
32089    Nl,
32090    Pl,
32091}
32092impl ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
32093    pub fn as_str(self) -> &'static str {
32094        use ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*;
32095        match self {
32096            De => "de",
32097            En => "en",
32098            Es => "es",
32099            Fr => "fr",
32100            It => "it",
32101            Nl => "nl",
32102            Pl => "pl",
32103        }
32104    }
32105}
32106
32107impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
32108    type Err = stripe_types::StripeParseError;
32109    fn from_str(s: &str) -> Result<Self, Self::Err> {
32110        use ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*;
32111        match s {
32112            "de" => Ok(De),
32113            "en" => Ok(En),
32114            "es" => Ok(Es),
32115            "fr" => Ok(Fr),
32116            "it" => Ok(It),
32117            "nl" => Ok(Nl),
32118            "pl" => Ok(Pl),
32119            _ => Err(stripe_types::StripeParseError),
32120        }
32121    }
32122}
32123impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
32124    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32125        f.write_str(self.as_str())
32126    }
32127}
32128
32129impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
32130    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32131        f.write_str(self.as_str())
32132    }
32133}
32134impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
32135    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32136    where
32137        S: serde::Serializer,
32138    {
32139        serializer.serialize_str(self.as_str())
32140    }
32141}
32142#[cfg(feature = "deserialize")]
32143impl<'de> serde::Deserialize<'de>
32144    for ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage
32145{
32146    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32147        use std::str::FromStr;
32148        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32149        Self::from_str(&s).map_err(|_| {
32150            serde::de::Error::custom(
32151                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage",
32152            )
32153        })
32154    }
32155}
32156/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32157///
32158/// 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.
32159/// 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.
32160///
32161/// 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.
32162///
32163/// 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).
32164///
32165/// 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`.
32166#[derive(Copy, Clone, Eq, PartialEq)]
32167pub enum ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
32168    None,
32169    OffSession,
32170}
32171impl ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
32172    pub fn as_str(self) -> &'static str {
32173        use ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*;
32174        match self {
32175            None => "none",
32176            OffSession => "off_session",
32177        }
32178    }
32179}
32180
32181impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
32182    type Err = stripe_types::StripeParseError;
32183    fn from_str(s: &str) -> Result<Self, Self::Err> {
32184        use ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*;
32185        match s {
32186            "none" => Ok(None),
32187            "off_session" => Ok(OffSession),
32188            _ => Err(stripe_types::StripeParseError),
32189        }
32190    }
32191}
32192impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
32193    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32194        f.write_str(self.as_str())
32195    }
32196}
32197
32198impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
32199    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32200        f.write_str(self.as_str())
32201    }
32202}
32203impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
32204    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32205    where
32206        S: serde::Serializer,
32207    {
32208        serializer.serialize_str(self.as_str())
32209    }
32210}
32211#[cfg(feature = "deserialize")]
32212impl<'de> serde::Deserialize<'de>
32213    for ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage
32214{
32215    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32216        use std::str::FromStr;
32217        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32218        Self::from_str(&s).map_err(|_| {
32219            serde::de::Error::custom(
32220                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage",
32221            )
32222        })
32223    }
32224}
32225/// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options.
32226#[derive(Clone, Debug, serde::Serialize)]
32227pub struct ConfirmPaymentIntentPaymentMethodOptionsSwish {
32228    /// A reference for this payment to be displayed in the Swish app.
32229    #[serde(skip_serializing_if = "Option::is_none")]
32230    pub reference: Option<String>,
32231    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32232    ///
32233    /// 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.
32234    /// 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.
32235    ///
32236    /// 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.
32237    ///
32238    /// 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).
32239    ///
32240    /// 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`.
32241    #[serde(skip_serializing_if = "Option::is_none")]
32242    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage>,
32243}
32244impl ConfirmPaymentIntentPaymentMethodOptionsSwish {
32245    pub fn new() -> Self {
32246        Self { reference: None, setup_future_usage: None }
32247    }
32248}
32249impl Default for ConfirmPaymentIntentPaymentMethodOptionsSwish {
32250    fn default() -> Self {
32251        Self::new()
32252    }
32253}
32254/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32255///
32256/// 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.
32257/// 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.
32258///
32259/// 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.
32260///
32261/// 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).
32262///
32263/// 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`.
32264#[derive(Copy, Clone, Eq, PartialEq)]
32265pub enum ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
32266    None,
32267}
32268impl ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
32269    pub fn as_str(self) -> &'static str {
32270        use ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::*;
32271        match self {
32272            None => "none",
32273        }
32274    }
32275}
32276
32277impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
32278    type Err = stripe_types::StripeParseError;
32279    fn from_str(s: &str) -> Result<Self, Self::Err> {
32280        use ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::*;
32281        match s {
32282            "none" => Ok(None),
32283            _ => Err(stripe_types::StripeParseError),
32284        }
32285    }
32286}
32287impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
32288    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32289        f.write_str(self.as_str())
32290    }
32291}
32292
32293impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
32294    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32295        f.write_str(self.as_str())
32296    }
32297}
32298impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
32299    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32300    where
32301        S: serde::Serializer,
32302    {
32303        serializer.serialize_str(self.as_str())
32304    }
32305}
32306#[cfg(feature = "deserialize")]
32307impl<'de> serde::Deserialize<'de>
32308    for ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage
32309{
32310    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32311        use std::str::FromStr;
32312        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32313        Self::from_str(&s).map_err(|_| {
32314            serde::de::Error::custom(
32315                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage",
32316            )
32317        })
32318    }
32319}
32320/// If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options.
32321#[derive(Copy, Clone, Debug, serde::Serialize)]
32322pub struct ConfirmPaymentIntentPaymentMethodOptionsTwint {
32323    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32324    ///
32325    /// 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.
32326    /// 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.
32327    ///
32328    /// 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.
32329    ///
32330    /// 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).
32331    ///
32332    /// 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`.
32333    #[serde(skip_serializing_if = "Option::is_none")]
32334    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage>,
32335}
32336impl ConfirmPaymentIntentPaymentMethodOptionsTwint {
32337    pub fn new() -> Self {
32338        Self { setup_future_usage: None }
32339    }
32340}
32341impl Default for ConfirmPaymentIntentPaymentMethodOptionsTwint {
32342    fn default() -> Self {
32343        Self::new()
32344    }
32345}
32346/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32347///
32348/// 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.
32349/// 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.
32350///
32351/// 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.
32352///
32353/// 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).
32354///
32355/// 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`.
32356#[derive(Copy, Clone, Eq, PartialEq)]
32357pub enum ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
32358    None,
32359}
32360impl ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
32361    pub fn as_str(self) -> &'static str {
32362        use ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage::*;
32363        match self {
32364            None => "none",
32365        }
32366    }
32367}
32368
32369impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
32370    type Err = stripe_types::StripeParseError;
32371    fn from_str(s: &str) -> Result<Self, Self::Err> {
32372        use ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage::*;
32373        match s {
32374            "none" => Ok(None),
32375            _ => Err(stripe_types::StripeParseError),
32376        }
32377    }
32378}
32379impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
32380    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32381        f.write_str(self.as_str())
32382    }
32383}
32384
32385impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
32386    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32387        f.write_str(self.as_str())
32388    }
32389}
32390impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
32391    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32392    where
32393        S: serde::Serializer,
32394    {
32395        serializer.serialize_str(self.as_str())
32396    }
32397}
32398#[cfg(feature = "deserialize")]
32399impl<'de> serde::Deserialize<'de>
32400    for ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage
32401{
32402    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32403        use std::str::FromStr;
32404        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32405        Self::from_str(&s).map_err(|_| {
32406            serde::de::Error::custom(
32407                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage",
32408            )
32409        })
32410    }
32411}
32412/// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options.
32413#[derive(Clone, Debug, serde::Serialize)]
32414pub struct ConfirmPaymentIntentPaymentMethodOptionsUsBankAccount {
32415    /// Additional fields for Financial Connections Session creation
32416    #[serde(skip_serializing_if = "Option::is_none")]
32417    pub financial_connections:
32418        Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
32419    /// Additional fields for Mandate creation
32420    #[serde(skip_serializing_if = "Option::is_none")]
32421    pub mandate_options:
32422        Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
32423    /// Additional fields for network related functions
32424    #[serde(skip_serializing_if = "Option::is_none")]
32425    pub networks: Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworks>,
32426    /// Preferred transaction settlement speed
32427    #[serde(skip_serializing_if = "Option::is_none")]
32428    pub preferred_settlement_speed:
32429        Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed>,
32430    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32431    ///
32432    /// 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.
32433    /// 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.
32434    ///
32435    /// 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.
32436    ///
32437    /// 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).
32438    ///
32439    /// 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`.
32440    #[serde(skip_serializing_if = "Option::is_none")]
32441    pub setup_future_usage:
32442        Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage>,
32443    /// Controls when Stripe will attempt to debit the funds from the customer's account.
32444    /// The date must be a string in YYYY-MM-DD format.
32445    /// The date must be in the future and between 3 and 15 calendar days from now.
32446    #[serde(skip_serializing_if = "Option::is_none")]
32447    pub target_date: Option<String>,
32448    /// Bank account verification method.
32449    #[serde(skip_serializing_if = "Option::is_none")]
32450    pub verification_method:
32451        Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
32452}
32453impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccount {
32454    pub fn new() -> Self {
32455        Self {
32456            financial_connections: None,
32457            mandate_options: None,
32458            networks: None,
32459            preferred_settlement_speed: None,
32460            setup_future_usage: None,
32461            target_date: None,
32462            verification_method: None,
32463        }
32464    }
32465}
32466impl Default for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccount {
32467    fn default() -> Self {
32468        Self::new()
32469    }
32470}
32471/// Additional fields for Financial Connections Session creation
32472#[derive(Clone, Debug, serde::Serialize)]
32473pub struct ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
32474    /// Provide filters for the linked accounts that the customer can select for the payment method.
32475    #[serde(skip_serializing_if = "Option::is_none")]
32476    pub filters:
32477        Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
32478    /// The list of permissions to request.
32479    /// If this parameter is passed, the `payment_method` permission must be included.
32480    /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
32481    #[serde(skip_serializing_if = "Option::is_none")]
32482    pub permissions: Option<
32483        Vec<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
32484    >,
32485    /// List of data features that you would like to retrieve upon account creation.
32486    #[serde(skip_serializing_if = "Option::is_none")]
32487    pub prefetch: Option<
32488        Vec<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>,
32489    >,
32490    /// For webview integrations only.
32491    /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.
32492    #[serde(skip_serializing_if = "Option::is_none")]
32493    pub return_url: Option<String>,
32494}
32495impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
32496    pub fn new() -> Self {
32497        Self { filters: None, permissions: None, prefetch: None, return_url: None }
32498    }
32499}
32500impl Default for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
32501    fn default() -> Self {
32502        Self::new()
32503    }
32504}
32505/// Provide filters for the linked accounts that the customer can select for the payment method.
32506#[derive(Clone, Debug, serde::Serialize)]
32507pub struct ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
32508        /// The account subcategories to use to filter for selectable accounts.
32509    /// Valid subcategories are `checking` and `savings`.
32510#[serde(skip_serializing_if = "Option::is_none")]
32511pub account_subcategories: Option<Vec<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
32512
32513}
32514impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
32515    pub fn new() -> Self {
32516        Self { account_subcategories: None }
32517    }
32518}
32519impl Default for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
32520    fn default() -> Self {
32521        Self::new()
32522    }
32523}
32524/// The account subcategories to use to filter for selectable accounts.
32525/// Valid subcategories are `checking` and `savings`.
32526#[derive(Copy, Clone, Eq, PartialEq)]
32527pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
32528{
32529    Checking,
32530    Savings,
32531}
32532impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
32533    pub fn as_str(self) -> &'static str {
32534        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
32535        match self {
32536Checking => "checking",
32537Savings => "savings",
32538
32539        }
32540    }
32541}
32542
32543impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
32544    type Err = stripe_types::StripeParseError;
32545    fn from_str(s: &str) -> Result<Self, Self::Err> {
32546        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
32547        match s {
32548    "checking" => Ok(Checking),
32549"savings" => Ok(Savings),
32550_ => Err(stripe_types::StripeParseError)
32551
32552        }
32553    }
32554}
32555impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
32556    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32557        f.write_str(self.as_str())
32558    }
32559}
32560
32561impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
32562    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32563        f.write_str(self.as_str())
32564    }
32565}
32566impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
32567    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
32568        serializer.serialize_str(self.as_str())
32569    }
32570}
32571#[cfg(feature = "deserialize")]
32572impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
32573    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32574        use std::str::FromStr;
32575        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32576        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"))
32577    }
32578}
32579/// The list of permissions to request.
32580/// If this parameter is passed, the `payment_method` permission must be included.
32581/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
32582#[derive(Copy, Clone, Eq, PartialEq)]
32583pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
32584    Balances,
32585    Ownership,
32586    PaymentMethod,
32587    Transactions,
32588}
32589impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
32590    pub fn as_str(self) -> &'static str {
32591        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
32592        match self {
32593            Balances => "balances",
32594            Ownership => "ownership",
32595            PaymentMethod => "payment_method",
32596            Transactions => "transactions",
32597        }
32598    }
32599}
32600
32601impl std::str::FromStr
32602    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
32603{
32604    type Err = stripe_types::StripeParseError;
32605    fn from_str(s: &str) -> Result<Self, Self::Err> {
32606        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
32607        match s {
32608            "balances" => Ok(Balances),
32609            "ownership" => Ok(Ownership),
32610            "payment_method" => Ok(PaymentMethod),
32611            "transactions" => Ok(Transactions),
32612            _ => Err(stripe_types::StripeParseError),
32613        }
32614    }
32615}
32616impl std::fmt::Display
32617    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
32618{
32619    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32620        f.write_str(self.as_str())
32621    }
32622}
32623
32624impl std::fmt::Debug
32625    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
32626{
32627    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32628        f.write_str(self.as_str())
32629    }
32630}
32631impl serde::Serialize
32632    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
32633{
32634    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32635    where
32636        S: serde::Serializer,
32637    {
32638        serializer.serialize_str(self.as_str())
32639    }
32640}
32641#[cfg(feature = "deserialize")]
32642impl<'de> serde::Deserialize<'de>
32643    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
32644{
32645    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32646        use std::str::FromStr;
32647        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32648        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"))
32649    }
32650}
32651/// List of data features that you would like to retrieve upon account creation.
32652#[derive(Copy, Clone, Eq, PartialEq)]
32653pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
32654    Balances,
32655    Ownership,
32656    Transactions,
32657}
32658impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
32659    pub fn as_str(self) -> &'static str {
32660        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
32661        match self {
32662            Balances => "balances",
32663            Ownership => "ownership",
32664            Transactions => "transactions",
32665        }
32666    }
32667}
32668
32669impl std::str::FromStr
32670    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
32671{
32672    type Err = stripe_types::StripeParseError;
32673    fn from_str(s: &str) -> Result<Self, Self::Err> {
32674        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
32675        match s {
32676            "balances" => Ok(Balances),
32677            "ownership" => Ok(Ownership),
32678            "transactions" => Ok(Transactions),
32679            _ => Err(stripe_types::StripeParseError),
32680        }
32681    }
32682}
32683impl std::fmt::Display
32684    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
32685{
32686    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32687        f.write_str(self.as_str())
32688    }
32689}
32690
32691impl std::fmt::Debug
32692    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
32693{
32694    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32695        f.write_str(self.as_str())
32696    }
32697}
32698impl serde::Serialize
32699    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
32700{
32701    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32702    where
32703        S: serde::Serializer,
32704    {
32705        serializer.serialize_str(self.as_str())
32706    }
32707}
32708#[cfg(feature = "deserialize")]
32709impl<'de> serde::Deserialize<'de>
32710    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
32711{
32712    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32713        use std::str::FromStr;
32714        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32715        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"))
32716    }
32717}
32718/// Additional fields for Mandate creation
32719#[derive(Copy, Clone, Debug, serde::Serialize)]
32720pub struct ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
32721    /// The method used to collect offline mandate customer acceptance.
32722    #[serde(skip_serializing_if = "Option::is_none")]
32723    pub collection_method:
32724        Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
32725}
32726impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
32727    pub fn new() -> Self {
32728        Self { collection_method: None }
32729    }
32730}
32731impl Default for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
32732    fn default() -> Self {
32733        Self::new()
32734    }
32735}
32736/// The method used to collect offline mandate customer acceptance.
32737#[derive(Copy, Clone, Eq, PartialEq)]
32738pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
32739    Paper,
32740}
32741impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
32742    pub fn as_str(self) -> &'static str {
32743        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
32744        match self {
32745            Paper => "paper",
32746        }
32747    }
32748}
32749
32750impl std::str::FromStr
32751    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
32752{
32753    type Err = stripe_types::StripeParseError;
32754    fn from_str(s: &str) -> Result<Self, Self::Err> {
32755        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
32756        match s {
32757            "paper" => Ok(Paper),
32758            _ => Err(stripe_types::StripeParseError),
32759        }
32760    }
32761}
32762impl std::fmt::Display
32763    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
32764{
32765    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32766        f.write_str(self.as_str())
32767    }
32768}
32769
32770impl std::fmt::Debug
32771    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
32772{
32773    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32774        f.write_str(self.as_str())
32775    }
32776}
32777impl serde::Serialize
32778    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
32779{
32780    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32781    where
32782        S: serde::Serializer,
32783    {
32784        serializer.serialize_str(self.as_str())
32785    }
32786}
32787#[cfg(feature = "deserialize")]
32788impl<'de> serde::Deserialize<'de>
32789    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
32790{
32791    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32792        use std::str::FromStr;
32793        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32794        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"))
32795    }
32796}
32797/// Additional fields for network related functions
32798#[derive(Clone, Debug, serde::Serialize)]
32799pub struct ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
32800    /// Triggers validations to run across the selected networks
32801    #[serde(skip_serializing_if = "Option::is_none")]
32802    pub requested:
32803        Option<Vec<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
32804}
32805impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
32806    pub fn new() -> Self {
32807        Self { requested: None }
32808    }
32809}
32810impl Default for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
32811    fn default() -> Self {
32812        Self::new()
32813    }
32814}
32815/// Triggers validations to run across the selected networks
32816#[derive(Copy, Clone, Eq, PartialEq)]
32817pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
32818    Ach,
32819    UsDomesticWire,
32820}
32821impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
32822    pub fn as_str(self) -> &'static str {
32823        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
32824        match self {
32825            Ach => "ach",
32826            UsDomesticWire => "us_domestic_wire",
32827        }
32828    }
32829}
32830
32831impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
32832    type Err = stripe_types::StripeParseError;
32833    fn from_str(s: &str) -> Result<Self, Self::Err> {
32834        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
32835        match s {
32836            "ach" => Ok(Ach),
32837            "us_domestic_wire" => Ok(UsDomesticWire),
32838            _ => Err(stripe_types::StripeParseError),
32839        }
32840    }
32841}
32842impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
32843    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32844        f.write_str(self.as_str())
32845    }
32846}
32847
32848impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
32849    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32850        f.write_str(self.as_str())
32851    }
32852}
32853impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
32854    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32855    where
32856        S: serde::Serializer,
32857    {
32858        serializer.serialize_str(self.as_str())
32859    }
32860}
32861#[cfg(feature = "deserialize")]
32862impl<'de> serde::Deserialize<'de>
32863    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested
32864{
32865    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32866        use std::str::FromStr;
32867        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32868        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested"))
32869    }
32870}
32871/// Preferred transaction settlement speed
32872#[derive(Copy, Clone, Eq, PartialEq)]
32873pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed {
32874    Fastest,
32875    Standard,
32876}
32877impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed {
32878    pub fn as_str(self) -> &'static str {
32879        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*;
32880        match self {
32881            Fastest => "fastest",
32882            Standard => "standard",
32883        }
32884    }
32885}
32886
32887impl std::str::FromStr
32888    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
32889{
32890    type Err = stripe_types::StripeParseError;
32891    fn from_str(s: &str) -> Result<Self, Self::Err> {
32892        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*;
32893        match s {
32894            "fastest" => Ok(Fastest),
32895            "standard" => Ok(Standard),
32896            _ => Err(stripe_types::StripeParseError),
32897        }
32898    }
32899}
32900impl std::fmt::Display
32901    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
32902{
32903    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32904        f.write_str(self.as_str())
32905    }
32906}
32907
32908impl std::fmt::Debug
32909    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
32910{
32911    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32912        f.write_str(self.as_str())
32913    }
32914}
32915impl serde::Serialize
32916    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
32917{
32918    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32919    where
32920        S: serde::Serializer,
32921    {
32922        serializer.serialize_str(self.as_str())
32923    }
32924}
32925#[cfg(feature = "deserialize")]
32926impl<'de> serde::Deserialize<'de>
32927    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
32928{
32929    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32930        use std::str::FromStr;
32931        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32932        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed"))
32933    }
32934}
32935/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32936///
32937/// 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.
32938/// 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.
32939///
32940/// 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.
32941///
32942/// 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).
32943///
32944/// 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`.
32945#[derive(Copy, Clone, Eq, PartialEq)]
32946pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
32947    None,
32948    OffSession,
32949    OnSession,
32950}
32951impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
32952    pub fn as_str(self) -> &'static str {
32953        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*;
32954        match self {
32955            None => "none",
32956            OffSession => "off_session",
32957            OnSession => "on_session",
32958        }
32959    }
32960}
32961
32962impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
32963    type Err = stripe_types::StripeParseError;
32964    fn from_str(s: &str) -> Result<Self, Self::Err> {
32965        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*;
32966        match s {
32967            "none" => Ok(None),
32968            "off_session" => Ok(OffSession),
32969            "on_session" => Ok(OnSession),
32970            _ => Err(stripe_types::StripeParseError),
32971        }
32972    }
32973}
32974impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
32975    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32976        f.write_str(self.as_str())
32977    }
32978}
32979
32980impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
32981    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32982        f.write_str(self.as_str())
32983    }
32984}
32985impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
32986    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32987    where
32988        S: serde::Serializer,
32989    {
32990        serializer.serialize_str(self.as_str())
32991    }
32992}
32993#[cfg(feature = "deserialize")]
32994impl<'de> serde::Deserialize<'de>
32995    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage
32996{
32997    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32998        use std::str::FromStr;
32999        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33000        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage"))
33001    }
33002}
33003/// Bank account verification method.
33004#[derive(Copy, Clone, Eq, PartialEq)]
33005pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
33006    Automatic,
33007    Instant,
33008    Microdeposits,
33009}
33010impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
33011    pub fn as_str(self) -> &'static str {
33012        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
33013        match self {
33014            Automatic => "automatic",
33015            Instant => "instant",
33016            Microdeposits => "microdeposits",
33017        }
33018    }
33019}
33020
33021impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
33022    type Err = stripe_types::StripeParseError;
33023    fn from_str(s: &str) -> Result<Self, Self::Err> {
33024        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
33025        match s {
33026            "automatic" => Ok(Automatic),
33027            "instant" => Ok(Instant),
33028            "microdeposits" => Ok(Microdeposits),
33029            _ => Err(stripe_types::StripeParseError),
33030        }
33031    }
33032}
33033impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
33034    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33035        f.write_str(self.as_str())
33036    }
33037}
33038
33039impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
33040    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33041        f.write_str(self.as_str())
33042    }
33043}
33044impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
33045    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33046    where
33047        S: serde::Serializer,
33048    {
33049        serializer.serialize_str(self.as_str())
33050    }
33051}
33052#[cfg(feature = "deserialize")]
33053impl<'de> serde::Deserialize<'de>
33054    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod
33055{
33056    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33057        use std::str::FromStr;
33058        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33059        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod"))
33060    }
33061}
33062/// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options.
33063#[derive(Clone, Debug, serde::Serialize)]
33064pub struct ConfirmPaymentIntentPaymentMethodOptionsWechatPay {
33065    /// The app ID registered with WeChat Pay. Only required when client is ios or android.
33066    #[serde(skip_serializing_if = "Option::is_none")]
33067    pub app_id: Option<String>,
33068    /// The client type that the end customer will pay from
33069    #[serde(skip_serializing_if = "Option::is_none")]
33070    pub client: Option<ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient>,
33071    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
33072    ///
33073    /// 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.
33074    /// 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.
33075    ///
33076    /// 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.
33077    ///
33078    /// 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).
33079    ///
33080    /// 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`.
33081    #[serde(skip_serializing_if = "Option::is_none")]
33082    pub setup_future_usage:
33083        Option<ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage>,
33084}
33085impl ConfirmPaymentIntentPaymentMethodOptionsWechatPay {
33086    pub fn new() -> Self {
33087        Self { app_id: None, client: None, setup_future_usage: None }
33088    }
33089}
33090impl Default for ConfirmPaymentIntentPaymentMethodOptionsWechatPay {
33091    fn default() -> Self {
33092        Self::new()
33093    }
33094}
33095/// The client type that the end customer will pay from
33096#[derive(Copy, Clone, Eq, PartialEq)]
33097pub enum ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient {
33098    Android,
33099    Ios,
33100    Web,
33101}
33102impl ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient {
33103    pub fn as_str(self) -> &'static str {
33104        use ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient::*;
33105        match self {
33106            Android => "android",
33107            Ios => "ios",
33108            Web => "web",
33109        }
33110    }
33111}
33112
33113impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient {
33114    type Err = stripe_types::StripeParseError;
33115    fn from_str(s: &str) -> Result<Self, Self::Err> {
33116        use ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient::*;
33117        match s {
33118            "android" => Ok(Android),
33119            "ios" => Ok(Ios),
33120            "web" => Ok(Web),
33121            _ => Err(stripe_types::StripeParseError),
33122        }
33123    }
33124}
33125impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient {
33126    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33127        f.write_str(self.as_str())
33128    }
33129}
33130
33131impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient {
33132    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33133        f.write_str(self.as_str())
33134    }
33135}
33136impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient {
33137    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33138    where
33139        S: serde::Serializer,
33140    {
33141        serializer.serialize_str(self.as_str())
33142    }
33143}
33144#[cfg(feature = "deserialize")]
33145impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient {
33146    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33147        use std::str::FromStr;
33148        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33149        Self::from_str(&s).map_err(|_| {
33150            serde::de::Error::custom(
33151                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient",
33152            )
33153        })
33154    }
33155}
33156/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
33157///
33158/// 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.
33159/// 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.
33160///
33161/// 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.
33162///
33163/// 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).
33164///
33165/// 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`.
33166#[derive(Copy, Clone, Eq, PartialEq)]
33167pub enum ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
33168    None,
33169}
33170impl ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
33171    pub fn as_str(self) -> &'static str {
33172        use ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*;
33173        match self {
33174            None => "none",
33175        }
33176    }
33177}
33178
33179impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
33180    type Err = stripe_types::StripeParseError;
33181    fn from_str(s: &str) -> Result<Self, Self::Err> {
33182        use ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*;
33183        match s {
33184            "none" => Ok(None),
33185            _ => Err(stripe_types::StripeParseError),
33186        }
33187    }
33188}
33189impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
33190    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33191        f.write_str(self.as_str())
33192    }
33193}
33194
33195impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
33196    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33197        f.write_str(self.as_str())
33198    }
33199}
33200impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
33201    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33202    where
33203        S: serde::Serializer,
33204    {
33205        serializer.serialize_str(self.as_str())
33206    }
33207}
33208#[cfg(feature = "deserialize")]
33209impl<'de> serde::Deserialize<'de>
33210    for ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage
33211{
33212    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33213        use std::str::FromStr;
33214        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33215        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage"))
33216    }
33217}
33218/// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options.
33219#[derive(Copy, Clone, Debug, serde::Serialize)]
33220pub struct ConfirmPaymentIntentPaymentMethodOptionsZip {
33221    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
33222    ///
33223    /// 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.
33224    /// 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.
33225    ///
33226    /// 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.
33227    ///
33228    /// 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).
33229    ///
33230    /// 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`.
33231    #[serde(skip_serializing_if = "Option::is_none")]
33232    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage>,
33233}
33234impl ConfirmPaymentIntentPaymentMethodOptionsZip {
33235    pub fn new() -> Self {
33236        Self { setup_future_usage: None }
33237    }
33238}
33239impl Default for ConfirmPaymentIntentPaymentMethodOptionsZip {
33240    fn default() -> Self {
33241        Self::new()
33242    }
33243}
33244/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
33245///
33246/// 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.
33247/// 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.
33248///
33249/// 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.
33250///
33251/// 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).
33252///
33253/// 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`.
33254#[derive(Copy, Clone, Eq, PartialEq)]
33255pub enum ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
33256    None,
33257}
33258impl ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
33259    pub fn as_str(self) -> &'static str {
33260        use ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*;
33261        match self {
33262            None => "none",
33263        }
33264    }
33265}
33266
33267impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
33268    type Err = stripe_types::StripeParseError;
33269    fn from_str(s: &str) -> Result<Self, Self::Err> {
33270        use ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*;
33271        match s {
33272            "none" => Ok(None),
33273            _ => Err(stripe_types::StripeParseError),
33274        }
33275    }
33276}
33277impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
33278    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33279        f.write_str(self.as_str())
33280    }
33281}
33282
33283impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
33284    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33285        f.write_str(self.as_str())
33286    }
33287}
33288impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
33289    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33290    where
33291        S: serde::Serializer,
33292    {
33293        serializer.serialize_str(self.as_str())
33294    }
33295}
33296#[cfg(feature = "deserialize")]
33297impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
33298    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33299        use std::str::FromStr;
33300        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33301        Self::from_str(&s).map_err(|_| {
33302            serde::de::Error::custom(
33303                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage",
33304            )
33305        })
33306    }
33307}
33308/// Shipping information for this PaymentIntent.
33309#[derive(Clone, Debug, serde::Serialize)]
33310pub struct ConfirmPaymentIntentShipping {
33311    /// Shipping address.
33312    pub address: ConfirmPaymentIntentShippingAddress,
33313    /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
33314    #[serde(skip_serializing_if = "Option::is_none")]
33315    pub carrier: Option<String>,
33316    /// Recipient name.
33317    pub name: String,
33318    /// Recipient phone (including extension).
33319    #[serde(skip_serializing_if = "Option::is_none")]
33320    pub phone: Option<String>,
33321    /// The tracking number for a physical product, obtained from the delivery service.
33322    /// If multiple tracking numbers were generated for this purchase, please separate them with commas.
33323    #[serde(skip_serializing_if = "Option::is_none")]
33324    pub tracking_number: Option<String>,
33325}
33326impl ConfirmPaymentIntentShipping {
33327    pub fn new(
33328        address: impl Into<ConfirmPaymentIntentShippingAddress>,
33329        name: impl Into<String>,
33330    ) -> Self {
33331        Self {
33332            address: address.into(),
33333            carrier: None,
33334            name: name.into(),
33335            phone: None,
33336            tracking_number: None,
33337        }
33338    }
33339}
33340/// Shipping address.
33341#[derive(Clone, Debug, serde::Serialize)]
33342pub struct ConfirmPaymentIntentShippingAddress {
33343    /// City, district, suburb, town, or village.
33344    #[serde(skip_serializing_if = "Option::is_none")]
33345    pub city: Option<String>,
33346    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
33347    #[serde(skip_serializing_if = "Option::is_none")]
33348    pub country: Option<String>,
33349    /// Address line 1, such as the street, PO Box, or company name.
33350    #[serde(skip_serializing_if = "Option::is_none")]
33351    pub line1: Option<String>,
33352    /// Address line 2, such as the apartment, suite, unit, or building.
33353    #[serde(skip_serializing_if = "Option::is_none")]
33354    pub line2: Option<String>,
33355    /// ZIP or postal code.
33356    #[serde(skip_serializing_if = "Option::is_none")]
33357    pub postal_code: Option<String>,
33358    /// State, county, province, or region.
33359    #[serde(skip_serializing_if = "Option::is_none")]
33360    pub state: Option<String>,
33361}
33362impl ConfirmPaymentIntentShippingAddress {
33363    pub fn new() -> Self {
33364        Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
33365    }
33366}
33367impl Default for ConfirmPaymentIntentShippingAddress {
33368    fn default() -> Self {
33369        Self::new()
33370    }
33371}
33372/// Confirm that your customer intends to pay with current or provided
33373/// payment method. Upon confirmation, the PaymentIntent will attempt to initiate
33374/// a payment.
33375///
33376/// If the selected payment method requires additional authentication steps, the
33377/// PaymentIntent will transition to the `requires_action` status and
33378/// suggest additional actions via `next_action`. If payment fails,
33379/// the PaymentIntent transitions to the `requires_payment_method` status or the
33380/// `canceled` status if the confirmation limit is reached. If
33381/// payment succeeds, the PaymentIntent will transition to the `succeeded`
33382/// status (or `requires_capture`, if `capture_method` is set to `manual`).
33383///
33384/// If the `confirmation_method` is `automatic`, payment may be attempted
33385/// using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment)
33386/// and the PaymentIntent’s [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret).
33387/// After `next_action`s are handled by the client, no additional
33388/// confirmation is required to complete the payment.
33389///
33390/// If the `confirmation_method` is `manual`, all payment attempts must be
33391/// initiated using a secret key.
33392///
33393/// If any actions are required for the payment, the PaymentIntent will
33394/// return to the `requires_confirmation` state
33395/// after those actions are completed. Your server needs to then
33396/// explicitly re-confirm the PaymentIntent to initiate the next payment
33397/// attempt.
33398///
33399/// There is a variable upper limit on how many times a PaymentIntent can be confirmed.
33400/// After this limit is reached, any further calls to this endpoint will
33401/// transition the PaymentIntent to the `canceled` state.
33402#[derive(Clone, Debug, serde::Serialize)]
33403pub struct ConfirmPaymentIntent {
33404    inner: ConfirmPaymentIntentBuilder,
33405    intent: stripe_shared::PaymentIntentId,
33406}
33407impl ConfirmPaymentIntent {
33408    /// Construct a new `ConfirmPaymentIntent`.
33409    pub fn new(intent: impl Into<stripe_shared::PaymentIntentId>) -> Self {
33410        Self { intent: intent.into(), inner: ConfirmPaymentIntentBuilder::new() }
33411    }
33412    /// Controls when the funds will be captured from the customer's account.
33413    pub fn capture_method(
33414        mut self,
33415        capture_method: impl Into<stripe_shared::PaymentIntentCaptureMethod>,
33416    ) -> Self {
33417        self.inner.capture_method = Some(capture_method.into());
33418        self
33419    }
33420    /// ID of the ConfirmationToken used to confirm this PaymentIntent.
33421    ///
33422    /// If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence.
33423    pub fn confirmation_token(mut self, confirmation_token: impl Into<String>) -> Self {
33424        self.inner.confirmation_token = Some(confirmation_token.into());
33425        self
33426    }
33427    /// Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`.
33428    /// This parameter is intended for simpler integrations that do not handle customer actions, like [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication).
33429    pub fn error_on_requires_action(mut self, error_on_requires_action: impl Into<bool>) -> Self {
33430        self.inner.error_on_requires_action = Some(error_on_requires_action.into());
33431        self
33432    }
33433    /// The list of payment method types to exclude from use with this payment.
33434    pub fn excluded_payment_method_types(
33435        mut self,
33436        excluded_payment_method_types: impl Into<
33437            Vec<stripe_shared::PaymentIntentExcludedPaymentMethodTypes>,
33438        >,
33439    ) -> Self {
33440        self.inner.excluded_payment_method_types = Some(excluded_payment_method_types.into());
33441        self
33442    }
33443    /// Specifies which fields in the response should be expanded.
33444    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
33445        self.inner.expand = Some(expand.into());
33446        self
33447    }
33448    /// ID of the mandate that's used for this payment.
33449    pub fn mandate(mut self, mandate: impl Into<String>) -> Self {
33450        self.inner.mandate = Some(mandate.into());
33451        self
33452    }
33453    pub fn mandate_data(
33454        mut self,
33455        mandate_data: impl Into<ConfirmPaymentIntentMandateData>,
33456    ) -> Self {
33457        self.inner.mandate_data = Some(mandate_data.into());
33458        self
33459    }
33460    /// Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate.
33461    /// Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards).
33462    pub fn off_session(mut self, off_session: impl Into<ConfirmPaymentIntentOffSession>) -> Self {
33463        self.inner.off_session = Some(off_session.into());
33464        self
33465    }
33466    /// ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent.
33467    /// If the payment method is attached to a Customer, it must match the [customer](https://stripe.com/docs/api#create_payment_intent-customer) that is set on this PaymentIntent.
33468    pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
33469        self.inner.payment_method = Some(payment_method.into());
33470        self
33471    }
33472    /// If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear
33473    /// in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method).
33474    /// property on the PaymentIntent.
33475    pub fn payment_method_data(
33476        mut self,
33477        payment_method_data: impl Into<ConfirmPaymentIntentPaymentMethodData>,
33478    ) -> Self {
33479        self.inner.payment_method_data = Some(payment_method_data.into());
33480        self
33481    }
33482    /// Payment method-specific configuration for this PaymentIntent.
33483    pub fn payment_method_options(
33484        mut self,
33485        payment_method_options: impl Into<ConfirmPaymentIntentPaymentMethodOptions>,
33486    ) -> Self {
33487        self.inner.payment_method_options = Some(payment_method_options.into());
33488        self
33489    }
33490    /// The list of payment method types (for example, a card) that this PaymentIntent can use.
33491    /// Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods).
33492    /// A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type).
33493    pub fn payment_method_types(mut self, payment_method_types: impl Into<Vec<String>>) -> Self {
33494        self.inner.payment_method_types = Some(payment_method_types.into());
33495        self
33496    }
33497    /// Options to configure Radar.
33498    /// Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session).
33499    pub fn radar_options(
33500        mut self,
33501        radar_options: impl Into<RadarOptionsWithHiddenOptions>,
33502    ) -> Self {
33503        self.inner.radar_options = Some(radar_options.into());
33504        self
33505    }
33506    /// Email address that the receipt for the resulting payment will be sent to.
33507    /// 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).
33508    pub fn receipt_email(mut self, receipt_email: impl Into<String>) -> Self {
33509        self.inner.receipt_email = Some(receipt_email.into());
33510        self
33511    }
33512    /// The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site.
33513    /// If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme.
33514    /// This parameter is only used for cards and other redirect-based payment methods.
33515    pub fn return_url(mut self, return_url: impl Into<String>) -> Self {
33516        self.inner.return_url = Some(return_url.into());
33517        self
33518    }
33519    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
33520    ///
33521    /// 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.
33522    /// 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.
33523    ///
33524    /// 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.
33525    ///
33526    /// 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).
33527    ///
33528    /// 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`.
33529    pub fn setup_future_usage(
33530        mut self,
33531        setup_future_usage: impl Into<stripe_shared::PaymentIntentSetupFutureUsage>,
33532    ) -> Self {
33533        self.inner.setup_future_usage = Some(setup_future_usage.into());
33534        self
33535    }
33536    /// Shipping information for this PaymentIntent.
33537    pub fn shipping(mut self, shipping: impl Into<ConfirmPaymentIntentShipping>) -> Self {
33538        self.inner.shipping = Some(shipping.into());
33539        self
33540    }
33541    /// Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions.
33542    pub fn use_stripe_sdk(mut self, use_stripe_sdk: impl Into<bool>) -> Self {
33543        self.inner.use_stripe_sdk = Some(use_stripe_sdk.into());
33544        self
33545    }
33546}
33547impl ConfirmPaymentIntent {
33548    /// Send the request and return the deserialized response.
33549    pub async fn send<C: StripeClient>(
33550        &self,
33551        client: &C,
33552    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
33553        self.customize().send(client).await
33554    }
33555
33556    /// Send the request and return the deserialized response, blocking until completion.
33557    pub fn send_blocking<C: StripeBlockingClient>(
33558        &self,
33559        client: &C,
33560    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
33561        self.customize().send_blocking(client)
33562    }
33563}
33564
33565impl StripeRequest for ConfirmPaymentIntent {
33566    type Output = stripe_shared::PaymentIntent;
33567
33568    fn build(&self) -> RequestBuilder {
33569        let intent = &self.intent;
33570        RequestBuilder::new(StripeMethod::Post, format!("/payment_intents/{intent}/confirm"))
33571            .form(&self.inner)
33572    }
33573}
33574#[derive(Clone, Debug, serde::Serialize)]
33575struct IncrementAuthorizationPaymentIntentBuilder {
33576    amount: i64,
33577    #[serde(skip_serializing_if = "Option::is_none")]
33578    application_fee_amount: Option<i64>,
33579    #[serde(skip_serializing_if = "Option::is_none")]
33580    description: Option<String>,
33581    #[serde(skip_serializing_if = "Option::is_none")]
33582    expand: Option<Vec<String>>,
33583    #[serde(skip_serializing_if = "Option::is_none")]
33584    metadata: Option<std::collections::HashMap<String, String>>,
33585    #[serde(skip_serializing_if = "Option::is_none")]
33586    statement_descriptor: Option<String>,
33587    #[serde(skip_serializing_if = "Option::is_none")]
33588    transfer_data: Option<IncrementAuthorizationPaymentIntentTransferData>,
33589}
33590impl IncrementAuthorizationPaymentIntentBuilder {
33591    fn new(amount: impl Into<i64>) -> Self {
33592        Self {
33593            amount: amount.into(),
33594            application_fee_amount: None,
33595            description: None,
33596            expand: None,
33597            metadata: None,
33598            statement_descriptor: None,
33599            transfer_data: None,
33600        }
33601    }
33602}
33603/// The parameters used to automatically create a transfer after the payment is captured.
33604/// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
33605#[derive(Copy, Clone, Debug, serde::Serialize)]
33606pub struct IncrementAuthorizationPaymentIntentTransferData {
33607    /// The amount that will be transferred automatically when a charge succeeds.
33608    #[serde(skip_serializing_if = "Option::is_none")]
33609    pub amount: Option<i64>,
33610}
33611impl IncrementAuthorizationPaymentIntentTransferData {
33612    pub fn new() -> Self {
33613        Self { amount: None }
33614    }
33615}
33616impl Default for IncrementAuthorizationPaymentIntentTransferData {
33617    fn default() -> Self {
33618        Self::new()
33619    }
33620}
33621/// Perform an incremental authorization on an eligible
33622/// [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the
33623/// PaymentIntent’s status must be `requires_capture` and
33624/// [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported).
33625/// must be `true`.
33626///
33627/// Incremental authorizations attempt to increase the authorized amount on
33628/// your customer’s card to the new, higher `amount` provided. Similar to the
33629/// initial authorization, incremental authorizations can be declined. A
33630/// single PaymentIntent can call this endpoint multiple times to further
33631/// increase the authorized amount.
33632///
33633/// If the incremental authorization succeeds, the PaymentIntent object
33634/// returns with the updated
33635/// [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount).
33636/// If the incremental authorization fails, a
33637/// [card_declined](https://stripe.com/docs/error-codes#card-declined) error returns, and no other
33638/// fields on the PaymentIntent or Charge update. The PaymentIntent
33639/// object remains capturable for the previously authorized amount.
33640///
33641/// Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines.
33642/// After it’s captured, a PaymentIntent can no longer be incremented.
33643///
33644/// Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations).
33645#[derive(Clone, Debug, serde::Serialize)]
33646pub struct IncrementAuthorizationPaymentIntent {
33647    inner: IncrementAuthorizationPaymentIntentBuilder,
33648    intent: stripe_shared::PaymentIntentId,
33649}
33650impl IncrementAuthorizationPaymentIntent {
33651    /// Construct a new `IncrementAuthorizationPaymentIntent`.
33652    pub fn new(intent: impl Into<stripe_shared::PaymentIntentId>, amount: impl Into<i64>) -> Self {
33653        Self {
33654            intent: intent.into(),
33655            inner: IncrementAuthorizationPaymentIntentBuilder::new(amount.into()),
33656        }
33657    }
33658    /// 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.
33659    /// The amount of the application fee collected will be capped at the total amount captured.
33660    /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
33661    pub fn application_fee_amount(mut self, application_fee_amount: impl Into<i64>) -> Self {
33662        self.inner.application_fee_amount = Some(application_fee_amount.into());
33663        self
33664    }
33665    /// An arbitrary string attached to the object. Often useful for displaying to users.
33666    pub fn description(mut self, description: impl Into<String>) -> Self {
33667        self.inner.description = Some(description.into());
33668        self
33669    }
33670    /// Specifies which fields in the response should be expanded.
33671    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
33672        self.inner.expand = Some(expand.into());
33673        self
33674    }
33675    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
33676    /// This can be useful for storing additional information about the object in a structured format.
33677    /// Individual keys can be unset by posting an empty value to them.
33678    /// All keys can be unset by posting an empty value to `metadata`.
33679    pub fn metadata(
33680        mut self,
33681        metadata: impl Into<std::collections::HashMap<String, String>>,
33682    ) -> Self {
33683        self.inner.metadata = Some(metadata.into());
33684        self
33685    }
33686    /// Text that appears on the customer's statement as the statement descriptor for a non-card or card charge.
33687    /// This value overrides the account's default statement descriptor.
33688    /// For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors).
33689    pub fn statement_descriptor(mut self, statement_descriptor: impl Into<String>) -> Self {
33690        self.inner.statement_descriptor = Some(statement_descriptor.into());
33691        self
33692    }
33693    /// The parameters used to automatically create a transfer after the payment is captured.
33694    /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
33695    pub fn transfer_data(
33696        mut self,
33697        transfer_data: impl Into<IncrementAuthorizationPaymentIntentTransferData>,
33698    ) -> Self {
33699        self.inner.transfer_data = Some(transfer_data.into());
33700        self
33701    }
33702}
33703impl IncrementAuthorizationPaymentIntent {
33704    /// Send the request and return the deserialized response.
33705    pub async fn send<C: StripeClient>(
33706        &self,
33707        client: &C,
33708    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
33709        self.customize().send(client).await
33710    }
33711
33712    /// Send the request and return the deserialized response, blocking until completion.
33713    pub fn send_blocking<C: StripeBlockingClient>(
33714        &self,
33715        client: &C,
33716    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
33717        self.customize().send_blocking(client)
33718    }
33719}
33720
33721impl StripeRequest for IncrementAuthorizationPaymentIntent {
33722    type Output = stripe_shared::PaymentIntent;
33723
33724    fn build(&self) -> RequestBuilder {
33725        let intent = &self.intent;
33726        RequestBuilder::new(
33727            StripeMethod::Post,
33728            format!("/payment_intents/{intent}/increment_authorization"),
33729        )
33730        .form(&self.inner)
33731    }
33732}
33733#[derive(Clone, Debug, serde::Serialize)]
33734struct VerifyMicrodepositsPaymentIntentBuilder {
33735    #[serde(skip_serializing_if = "Option::is_none")]
33736    amounts: Option<Vec<i64>>,
33737    #[serde(skip_serializing_if = "Option::is_none")]
33738    descriptor_code: Option<String>,
33739    #[serde(skip_serializing_if = "Option::is_none")]
33740    expand: Option<Vec<String>>,
33741}
33742impl VerifyMicrodepositsPaymentIntentBuilder {
33743    fn new() -> Self {
33744        Self { amounts: None, descriptor_code: None, expand: None }
33745    }
33746}
33747/// Verifies microdeposits on a PaymentIntent object.
33748#[derive(Clone, Debug, serde::Serialize)]
33749pub struct VerifyMicrodepositsPaymentIntent {
33750    inner: VerifyMicrodepositsPaymentIntentBuilder,
33751    intent: stripe_shared::PaymentIntentId,
33752}
33753impl VerifyMicrodepositsPaymentIntent {
33754    /// Construct a new `VerifyMicrodepositsPaymentIntent`.
33755    pub fn new(intent: impl Into<stripe_shared::PaymentIntentId>) -> Self {
33756        Self { intent: intent.into(), inner: VerifyMicrodepositsPaymentIntentBuilder::new() }
33757    }
33758    /// Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account.
33759    pub fn amounts(mut self, amounts: impl Into<Vec<i64>>) -> Self {
33760        self.inner.amounts = Some(amounts.into());
33761        self
33762    }
33763    /// A six-character code starting with SM present in the microdeposit sent to the bank account.
33764    pub fn descriptor_code(mut self, descriptor_code: impl Into<String>) -> Self {
33765        self.inner.descriptor_code = Some(descriptor_code.into());
33766        self
33767    }
33768    /// Specifies which fields in the response should be expanded.
33769    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
33770        self.inner.expand = Some(expand.into());
33771        self
33772    }
33773}
33774impl VerifyMicrodepositsPaymentIntent {
33775    /// Send the request and return the deserialized response.
33776    pub async fn send<C: StripeClient>(
33777        &self,
33778        client: &C,
33779    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
33780        self.customize().send(client).await
33781    }
33782
33783    /// Send the request and return the deserialized response, blocking until completion.
33784    pub fn send_blocking<C: StripeBlockingClient>(
33785        &self,
33786        client: &C,
33787    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
33788        self.customize().send_blocking(client)
33789    }
33790}
33791
33792impl StripeRequest for VerifyMicrodepositsPaymentIntent {
33793    type Output = stripe_shared::PaymentIntent;
33794
33795    fn build(&self) -> RequestBuilder {
33796        let intent = &self.intent;
33797        RequestBuilder::new(
33798            StripeMethod::Post,
33799            format!("/payment_intents/{intent}/verify_microdeposits"),
33800        )
33801        .form(&self.inner)
33802    }
33803}
33804
33805#[derive(Clone, Debug, serde::Serialize)]
33806pub struct OnlineParam {
33807    /// The IP address from which the Mandate was accepted by the customer.
33808    pub ip_address: String,
33809    /// The user agent of the browser from which the Mandate was accepted by the customer.
33810    pub user_agent: String,
33811}
33812impl OnlineParam {
33813    pub fn new(ip_address: impl Into<String>, user_agent: impl Into<String>) -> Self {
33814        Self { ip_address: ip_address.into(), user_agent: user_agent.into() }
33815    }
33816}
33817#[derive(Clone, Debug, serde::Serialize)]
33818pub struct PaymentMethodParam {
33819    /// Customer's bank account number.
33820    pub account_number: String,
33821    /// Institution number of the customer's bank.
33822    pub institution_number: String,
33823    /// Transit number of the customer's bank.
33824    pub transit_number: String,
33825}
33826impl PaymentMethodParam {
33827    pub fn new(
33828        account_number: impl Into<String>,
33829        institution_number: impl Into<String>,
33830        transit_number: impl Into<String>,
33831    ) -> Self {
33832        Self {
33833            account_number: account_number.into(),
33834            institution_number: institution_number.into(),
33835            transit_number: transit_number.into(),
33836        }
33837    }
33838}
33839#[derive(Copy, Clone, Debug, serde::Serialize)]
33840pub struct DateOfBirth {
33841    /// The day of birth, between 1 and 31.
33842    pub day: i64,
33843    /// The month of birth, between 1 and 12.
33844    pub month: i64,
33845    /// The four-digit year of birth.
33846    pub year: i64,
33847}
33848impl DateOfBirth {
33849    pub fn new(day: impl Into<i64>, month: impl Into<i64>, year: impl Into<i64>) -> Self {
33850        Self { day: day.into(), month: month.into(), year: year.into() }
33851    }
33852}
33853#[derive(Clone, Debug, serde::Serialize)]
33854pub struct RadarOptionsWithHiddenOptions {
33855    /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments.
33856    #[serde(skip_serializing_if = "Option::is_none")]
33857    pub session: Option<String>,
33858}
33859impl RadarOptionsWithHiddenOptions {
33860    pub fn new() -> Self {
33861        Self { session: None }
33862    }
33863}
33864impl Default for RadarOptionsWithHiddenOptions {
33865    fn default() -> Self {
33866        Self::new()
33867    }
33868}
33869#[derive(Clone, Debug, serde::Serialize)]
33870pub struct PaymentMethodOptionsMandateOptionsParam {
33871    /// Prefix used to generate the Mandate reference.
33872    /// Must be at most 12 characters long.
33873    /// Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'.
33874    /// Cannot begin with 'DDIC' or 'STRIPE'.
33875    #[serde(skip_serializing_if = "Option::is_none")]
33876    pub reference_prefix: Option<String>,
33877}
33878impl PaymentMethodOptionsMandateOptionsParam {
33879    pub fn new() -> Self {
33880        Self { reference_prefix: None }
33881    }
33882}
33883impl Default for PaymentMethodOptionsMandateOptionsParam {
33884    fn default() -> Self {
33885        Self::new()
33886    }
33887}
33888#[derive(Clone, Debug, serde::Serialize)]
33889pub struct EuBankTransferParams {
33890    /// The desired country code of the bank account information.
33891    /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`.
33892    pub country: String,
33893}
33894impl EuBankTransferParams {
33895    pub fn new(country: impl Into<String>) -> Self {
33896        Self { country: country.into() }
33897    }
33898}
33899#[derive(Clone, Debug, serde::Serialize)]
33900pub struct SubscriptionNextBillingParam {
33901    /// The amount of the next charge for the subscription.
33902    pub amount: i64,
33903    /// The date of the next charge for the subscription in YYYY-MM-DD format.
33904    pub date: String,
33905}
33906impl SubscriptionNextBillingParam {
33907    pub fn new(amount: impl Into<i64>, date: impl Into<String>) -> Self {
33908        Self { amount: amount.into(), date: date.into() }
33909    }
33910}