stripe_core/setup_intent/
requests.rs

1use stripe_client_core::{
2    RequestBuilder, StripeBlockingClient, StripeClient, StripeMethod, StripeRequest,
3};
4
5#[derive(Clone, Debug, serde::Serialize)]
6struct ListSetupIntentBuilder {
7    #[serde(skip_serializing_if = "Option::is_none")]
8    attach_to_self: Option<bool>,
9    #[serde(skip_serializing_if = "Option::is_none")]
10    created: Option<stripe_types::RangeQueryTs>,
11    #[serde(skip_serializing_if = "Option::is_none")]
12    customer: Option<String>,
13    #[serde(skip_serializing_if = "Option::is_none")]
14    customer_account: Option<String>,
15    #[serde(skip_serializing_if = "Option::is_none")]
16    ending_before: Option<String>,
17    #[serde(skip_serializing_if = "Option::is_none")]
18    expand: Option<Vec<String>>,
19    #[serde(skip_serializing_if = "Option::is_none")]
20    limit: Option<i64>,
21    #[serde(skip_serializing_if = "Option::is_none")]
22    payment_method: Option<String>,
23    #[serde(skip_serializing_if = "Option::is_none")]
24    starting_after: Option<String>,
25}
26impl ListSetupIntentBuilder {
27    fn new() -> Self {
28        Self {
29            attach_to_self: None,
30            created: None,
31            customer: None,
32            customer_account: None,
33            ending_before: None,
34            expand: None,
35            limit: None,
36            payment_method: None,
37            starting_after: None,
38        }
39    }
40}
41/// Returns a list of SetupIntents.
42#[derive(Clone, Debug, serde::Serialize)]
43pub struct ListSetupIntent {
44    inner: ListSetupIntentBuilder,
45}
46impl ListSetupIntent {
47    /// Construct a new `ListSetupIntent`.
48    pub fn new() -> Self {
49        Self { inner: ListSetupIntentBuilder::new() }
50    }
51    /// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.
52    ///
53    /// It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers.
54    /// It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.
55    pub fn attach_to_self(mut self, attach_to_self: impl Into<bool>) -> Self {
56        self.inner.attach_to_self = Some(attach_to_self.into());
57        self
58    }
59    /// A filter on the list, based on the object `created` field.
60    /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options.
61    pub fn created(mut self, created: impl Into<stripe_types::RangeQueryTs>) -> Self {
62        self.inner.created = Some(created.into());
63        self
64    }
65    /// Only return SetupIntents for the customer specified by this customer ID.
66    pub fn customer(mut self, customer: impl Into<String>) -> Self {
67        self.inner.customer = Some(customer.into());
68        self
69    }
70    /// Only return SetupIntents for the account specified by this customer ID.
71    pub fn customer_account(mut self, customer_account: impl Into<String>) -> Self {
72        self.inner.customer_account = Some(customer_account.into());
73        self
74    }
75    /// A cursor for use in pagination.
76    /// `ending_before` is an object ID that defines your place in the list.
77    /// 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.
78    pub fn ending_before(mut self, ending_before: impl Into<String>) -> Self {
79        self.inner.ending_before = Some(ending_before.into());
80        self
81    }
82    /// Specifies which fields in the response should be expanded.
83    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
84        self.inner.expand = Some(expand.into());
85        self
86    }
87    /// A limit on the number of objects to be returned.
88    /// Limit can range between 1 and 100, and the default is 10.
89    pub fn limit(mut self, limit: impl Into<i64>) -> Self {
90        self.inner.limit = Some(limit.into());
91        self
92    }
93    /// Only return SetupIntents that associate with the specified payment method.
94    pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
95        self.inner.payment_method = Some(payment_method.into());
96        self
97    }
98    /// A cursor for use in pagination.
99    /// `starting_after` is an object ID that defines your place in the list.
100    /// 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.
101    pub fn starting_after(mut self, starting_after: impl Into<String>) -> Self {
102        self.inner.starting_after = Some(starting_after.into());
103        self
104    }
105}
106impl Default for ListSetupIntent {
107    fn default() -> Self {
108        Self::new()
109    }
110}
111impl ListSetupIntent {
112    /// Send the request and return the deserialized response.
113    pub async fn send<C: StripeClient>(
114        &self,
115        client: &C,
116    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
117        self.customize().send(client).await
118    }
119
120    /// Send the request and return the deserialized response, blocking until completion.
121    pub fn send_blocking<C: StripeBlockingClient>(
122        &self,
123        client: &C,
124    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
125        self.customize().send_blocking(client)
126    }
127
128    pub fn paginate(
129        &self,
130    ) -> stripe_client_core::ListPaginator<stripe_types::List<stripe_shared::SetupIntent>> {
131        stripe_client_core::ListPaginator::new_list("/setup_intents", &self.inner)
132    }
133}
134
135impl StripeRequest for ListSetupIntent {
136    type Output = stripe_types::List<stripe_shared::SetupIntent>;
137
138    fn build(&self) -> RequestBuilder {
139        RequestBuilder::new(StripeMethod::Get, "/setup_intents").query(&self.inner)
140    }
141}
142#[derive(Clone, Debug, serde::Serialize)]
143struct RetrieveSetupIntentBuilder {
144    #[serde(skip_serializing_if = "Option::is_none")]
145    client_secret: Option<String>,
146    #[serde(skip_serializing_if = "Option::is_none")]
147    expand: Option<Vec<String>>,
148}
149impl RetrieveSetupIntentBuilder {
150    fn new() -> Self {
151        Self { client_secret: None, expand: None }
152    }
153}
154/// Retrieves the details of a SetupIntent that has previously been created.
155///
156/// Client-side retrieval using a publishable key is allowed when the `client_secret` is provided in the query string.
157///
158///
159/// When retrieved with a publishable key, only a subset of properties will be returned.
160/// Please refer to the [SetupIntent](https://stripe.com/docs/api#setup_intent_object) object reference for more details.
161#[derive(Clone, Debug, serde::Serialize)]
162pub struct RetrieveSetupIntent {
163    inner: RetrieveSetupIntentBuilder,
164    intent: stripe_shared::SetupIntentId,
165}
166impl RetrieveSetupIntent {
167    /// Construct a new `RetrieveSetupIntent`.
168    pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
169        Self { intent: intent.into(), inner: RetrieveSetupIntentBuilder::new() }
170    }
171    /// The client secret of the SetupIntent.
172    /// We require this string if you use a publishable key to retrieve the SetupIntent.
173    pub fn client_secret(mut self, client_secret: impl Into<String>) -> Self {
174        self.inner.client_secret = Some(client_secret.into());
175        self
176    }
177    /// Specifies which fields in the response should be expanded.
178    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
179        self.inner.expand = Some(expand.into());
180        self
181    }
182}
183impl RetrieveSetupIntent {
184    /// Send the request and return the deserialized response.
185    pub async fn send<C: StripeClient>(
186        &self,
187        client: &C,
188    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
189        self.customize().send(client).await
190    }
191
192    /// Send the request and return the deserialized response, blocking until completion.
193    pub fn send_blocking<C: StripeBlockingClient>(
194        &self,
195        client: &C,
196    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
197        self.customize().send_blocking(client)
198    }
199}
200
201impl StripeRequest for RetrieveSetupIntent {
202    type Output = stripe_shared::SetupIntent;
203
204    fn build(&self) -> RequestBuilder {
205        let intent = &self.intent;
206        RequestBuilder::new(StripeMethod::Get, format!("/setup_intents/{intent}"))
207            .query(&self.inner)
208    }
209}
210#[derive(Clone, Debug, serde::Serialize)]
211struct CreateSetupIntentBuilder {
212    #[serde(skip_serializing_if = "Option::is_none")]
213    attach_to_self: Option<bool>,
214    #[serde(skip_serializing_if = "Option::is_none")]
215    automatic_payment_methods: Option<CreateSetupIntentAutomaticPaymentMethods>,
216    #[serde(skip_serializing_if = "Option::is_none")]
217    confirm: Option<bool>,
218    #[serde(skip_serializing_if = "Option::is_none")]
219    confirmation_token: Option<String>,
220    #[serde(skip_serializing_if = "Option::is_none")]
221    customer: Option<String>,
222    #[serde(skip_serializing_if = "Option::is_none")]
223    customer_account: Option<String>,
224    #[serde(skip_serializing_if = "Option::is_none")]
225    description: Option<String>,
226    #[serde(skip_serializing_if = "Option::is_none")]
227    excluded_payment_method_types:
228        Option<Vec<stripe_shared::SetupIntentExcludedPaymentMethodTypes>>,
229    #[serde(skip_serializing_if = "Option::is_none")]
230    expand: Option<Vec<String>>,
231    #[serde(skip_serializing_if = "Option::is_none")]
232    flow_directions: Option<Vec<stripe_shared::SetupIntentFlowDirections>>,
233    #[serde(skip_serializing_if = "Option::is_none")]
234    mandate_data: Option<CreateSetupIntentMandateData>,
235    #[serde(skip_serializing_if = "Option::is_none")]
236    metadata: Option<std::collections::HashMap<String, String>>,
237    #[serde(skip_serializing_if = "Option::is_none")]
238    on_behalf_of: Option<String>,
239    #[serde(skip_serializing_if = "Option::is_none")]
240    payment_method: Option<String>,
241    #[serde(skip_serializing_if = "Option::is_none")]
242    payment_method_configuration: Option<String>,
243    #[serde(skip_serializing_if = "Option::is_none")]
244    payment_method_data: Option<CreateSetupIntentPaymentMethodData>,
245    #[serde(skip_serializing_if = "Option::is_none")]
246    payment_method_options: Option<CreateSetupIntentPaymentMethodOptions>,
247    #[serde(skip_serializing_if = "Option::is_none")]
248    payment_method_types: Option<Vec<String>>,
249    #[serde(skip_serializing_if = "Option::is_none")]
250    return_url: Option<String>,
251    #[serde(skip_serializing_if = "Option::is_none")]
252    single_use: Option<CreateSetupIntentSingleUse>,
253    #[serde(skip_serializing_if = "Option::is_none")]
254    usage: Option<CreateSetupIntentUsage>,
255    #[serde(skip_serializing_if = "Option::is_none")]
256    use_stripe_sdk: Option<bool>,
257}
258impl CreateSetupIntentBuilder {
259    fn new() -> Self {
260        Self {
261            attach_to_self: None,
262            automatic_payment_methods: None,
263            confirm: None,
264            confirmation_token: None,
265            customer: None,
266            customer_account: None,
267            description: None,
268            excluded_payment_method_types: None,
269            expand: None,
270            flow_directions: None,
271            mandate_data: None,
272            metadata: None,
273            on_behalf_of: None,
274            payment_method: None,
275            payment_method_configuration: None,
276            payment_method_data: None,
277            payment_method_options: None,
278            payment_method_types: None,
279            return_url: None,
280            single_use: None,
281            usage: None,
282            use_stripe_sdk: None,
283        }
284    }
285}
286/// When you enable this parameter, this SetupIntent accepts payment methods that you enable in the Dashboard and that are compatible with its other parameters.
287#[derive(Clone, Debug, serde::Serialize)]
288pub struct CreateSetupIntentAutomaticPaymentMethods {
289    /// Controls whether this SetupIntent will accept redirect-based payment methods.
290    ///
291    /// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps.
292    /// To [confirm](https://docs.stripe.com/api/setup_intents/confirm) this SetupIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the setup.
293    #[serde(skip_serializing_if = "Option::is_none")]
294    pub allow_redirects: Option<CreateSetupIntentAutomaticPaymentMethodsAllowRedirects>,
295    /// Whether this feature is enabled.
296    pub enabled: bool,
297}
298impl CreateSetupIntentAutomaticPaymentMethods {
299    pub fn new(enabled: impl Into<bool>) -> Self {
300        Self { allow_redirects: None, enabled: enabled.into() }
301    }
302}
303/// Controls whether this SetupIntent will accept redirect-based payment methods.
304///
305/// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps.
306/// To [confirm](https://docs.stripe.com/api/setup_intents/confirm) this SetupIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the setup.
307#[derive(Clone, Eq, PartialEq)]
308#[non_exhaustive]
309pub enum CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
310    Always,
311    Never,
312    /// An unrecognized value from Stripe. Should not be used as a request parameter.
313    Unknown(String),
314}
315impl CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
316    pub fn as_str(&self) -> &str {
317        use CreateSetupIntentAutomaticPaymentMethodsAllowRedirects::*;
318        match self {
319            Always => "always",
320            Never => "never",
321            Unknown(v) => v,
322        }
323    }
324}
325
326impl std::str::FromStr for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
327    type Err = std::convert::Infallible;
328    fn from_str(s: &str) -> Result<Self, Self::Err> {
329        use CreateSetupIntentAutomaticPaymentMethodsAllowRedirects::*;
330        match s {
331            "always" => Ok(Always),
332            "never" => Ok(Never),
333            v => {
334                tracing::warn!(
335                    "Unknown value '{}' for enum '{}'",
336                    v,
337                    "CreateSetupIntentAutomaticPaymentMethodsAllowRedirects"
338                );
339                Ok(Unknown(v.to_owned()))
340            }
341        }
342    }
343}
344impl std::fmt::Display for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
345    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
346        f.write_str(self.as_str())
347    }
348}
349
350impl std::fmt::Debug for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
351    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
352        f.write_str(self.as_str())
353    }
354}
355impl serde::Serialize for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
356    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
357    where
358        S: serde::Serializer,
359    {
360        serializer.serialize_str(self.as_str())
361    }
362}
363#[cfg(feature = "deserialize")]
364impl<'de> serde::Deserialize<'de> for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
365    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
366        use std::str::FromStr;
367        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
368        Ok(Self::from_str(&s).expect("infallible"))
369    }
370}
371/// This hash contains details about the mandate to create.
372/// This parameter can only be used with [`confirm=true`](https://docs.stripe.com/api/setup_intents/create#create_setup_intent-confirm).
373#[derive(Clone, Debug, serde::Serialize)]
374pub struct CreateSetupIntentMandateData {
375    /// This hash contains details about the customer acceptance of the Mandate.
376    pub customer_acceptance: CreateSetupIntentMandateDataCustomerAcceptance,
377}
378impl CreateSetupIntentMandateData {
379    pub fn new(
380        customer_acceptance: impl Into<CreateSetupIntentMandateDataCustomerAcceptance>,
381    ) -> Self {
382        Self { customer_acceptance: customer_acceptance.into() }
383    }
384}
385/// This hash contains details about the customer acceptance of the Mandate.
386#[derive(Clone, Debug, serde::Serialize)]
387pub struct CreateSetupIntentMandateDataCustomerAcceptance {
388    /// The time at which the customer accepted the Mandate.
389    #[serde(skip_serializing_if = "Option::is_none")]
390    pub accepted_at: Option<stripe_types::Timestamp>,
391    /// If this is a Mandate accepted offline, this hash contains details about the offline acceptance.
392    #[serde(skip_serializing_if = "Option::is_none")]
393    #[serde(with = "stripe_types::with_serde_json_opt")]
394    pub offline: Option<miniserde::json::Value>,
395    /// If this is a Mandate accepted online, this hash contains details about the online acceptance.
396    #[serde(skip_serializing_if = "Option::is_none")]
397    pub online: Option<OnlineParam>,
398    /// The type of customer acceptance information included with the Mandate.
399    /// One of `online` or `offline`.
400    #[serde(rename = "type")]
401    pub type_: CreateSetupIntentMandateDataCustomerAcceptanceType,
402}
403impl CreateSetupIntentMandateDataCustomerAcceptance {
404    pub fn new(type_: impl Into<CreateSetupIntentMandateDataCustomerAcceptanceType>) -> Self {
405        Self { accepted_at: None, offline: None, online: None, type_: type_.into() }
406    }
407}
408/// The type of customer acceptance information included with the Mandate.
409/// One of `online` or `offline`.
410#[derive(Clone, Eq, PartialEq)]
411#[non_exhaustive]
412pub enum CreateSetupIntentMandateDataCustomerAcceptanceType {
413    Offline,
414    Online,
415    /// An unrecognized value from Stripe. Should not be used as a request parameter.
416    Unknown(String),
417}
418impl CreateSetupIntentMandateDataCustomerAcceptanceType {
419    pub fn as_str(&self) -> &str {
420        use CreateSetupIntentMandateDataCustomerAcceptanceType::*;
421        match self {
422            Offline => "offline",
423            Online => "online",
424            Unknown(v) => v,
425        }
426    }
427}
428
429impl std::str::FromStr for CreateSetupIntentMandateDataCustomerAcceptanceType {
430    type Err = std::convert::Infallible;
431    fn from_str(s: &str) -> Result<Self, Self::Err> {
432        use CreateSetupIntentMandateDataCustomerAcceptanceType::*;
433        match s {
434            "offline" => Ok(Offline),
435            "online" => Ok(Online),
436            v => {
437                tracing::warn!(
438                    "Unknown value '{}' for enum '{}'",
439                    v,
440                    "CreateSetupIntentMandateDataCustomerAcceptanceType"
441                );
442                Ok(Unknown(v.to_owned()))
443            }
444        }
445    }
446}
447impl std::fmt::Display for CreateSetupIntentMandateDataCustomerAcceptanceType {
448    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
449        f.write_str(self.as_str())
450    }
451}
452
453impl std::fmt::Debug for CreateSetupIntentMandateDataCustomerAcceptanceType {
454    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
455        f.write_str(self.as_str())
456    }
457}
458impl serde::Serialize for CreateSetupIntentMandateDataCustomerAcceptanceType {
459    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
460    where
461        S: serde::Serializer,
462    {
463        serializer.serialize_str(self.as_str())
464    }
465}
466#[cfg(feature = "deserialize")]
467impl<'de> serde::Deserialize<'de> for CreateSetupIntentMandateDataCustomerAcceptanceType {
468    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
469        use std::str::FromStr;
470        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
471        Ok(Self::from_str(&s).expect("infallible"))
472    }
473}
474/// When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://docs.stripe.com/api/setup_intents/object#setup_intent_object-payment_method).
475/// value in the SetupIntent.
476#[derive(Clone, Debug, serde::Serialize)]
477pub struct CreateSetupIntentPaymentMethodData {
478    /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
479    #[serde(skip_serializing_if = "Option::is_none")]
480    pub acss_debit: Option<PaymentMethodParam>,
481    /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
482    #[serde(skip_serializing_if = "Option::is_none")]
483    #[serde(with = "stripe_types::with_serde_json_opt")]
484    pub affirm: Option<miniserde::json::Value>,
485    /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
486    #[serde(skip_serializing_if = "Option::is_none")]
487    #[serde(with = "stripe_types::with_serde_json_opt")]
488    pub afterpay_clearpay: Option<miniserde::json::Value>,
489    /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
490    #[serde(skip_serializing_if = "Option::is_none")]
491    #[serde(with = "stripe_types::with_serde_json_opt")]
492    pub alipay: Option<miniserde::json::Value>,
493    /// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
494    /// 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.
495    /// The field defaults to `unspecified`.
496    #[serde(skip_serializing_if = "Option::is_none")]
497    pub allow_redisplay: Option<CreateSetupIntentPaymentMethodDataAllowRedisplay>,
498    /// If this is a Alma PaymentMethod, this hash contains details about the Alma payment method.
499    #[serde(skip_serializing_if = "Option::is_none")]
500    #[serde(with = "stripe_types::with_serde_json_opt")]
501    pub alma: Option<miniserde::json::Value>,
502    /// If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method.
503    #[serde(skip_serializing_if = "Option::is_none")]
504    #[serde(with = "stripe_types::with_serde_json_opt")]
505    pub amazon_pay: Option<miniserde::json::Value>,
506    /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
507    #[serde(skip_serializing_if = "Option::is_none")]
508    pub au_becs_debit: Option<CreateSetupIntentPaymentMethodDataAuBecsDebit>,
509    /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
510    #[serde(skip_serializing_if = "Option::is_none")]
511    pub bacs_debit: Option<CreateSetupIntentPaymentMethodDataBacsDebit>,
512    /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
513    #[serde(skip_serializing_if = "Option::is_none")]
514    #[serde(with = "stripe_types::with_serde_json_opt")]
515    pub bancontact: Option<miniserde::json::Value>,
516    /// If this is a `billie` PaymentMethod, this hash contains details about the Billie payment method.
517    #[serde(skip_serializing_if = "Option::is_none")]
518    #[serde(with = "stripe_types::with_serde_json_opt")]
519    pub billie: Option<miniserde::json::Value>,
520    /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
521    #[serde(skip_serializing_if = "Option::is_none")]
522    pub billing_details: Option<BillingDetailsInnerParams>,
523    /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
524    #[serde(skip_serializing_if = "Option::is_none")]
525    #[serde(with = "stripe_types::with_serde_json_opt")]
526    pub blik: Option<miniserde::json::Value>,
527    /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
528    #[serde(skip_serializing_if = "Option::is_none")]
529    pub boleto: Option<CreateSetupIntentPaymentMethodDataBoleto>,
530    /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
531    #[serde(skip_serializing_if = "Option::is_none")]
532    #[serde(with = "stripe_types::with_serde_json_opt")]
533    pub cashapp: Option<miniserde::json::Value>,
534    /// If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method.
535    #[serde(skip_serializing_if = "Option::is_none")]
536    #[serde(with = "stripe_types::with_serde_json_opt")]
537    pub crypto: Option<miniserde::json::Value>,
538    /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
539    #[serde(skip_serializing_if = "Option::is_none")]
540    #[serde(with = "stripe_types::with_serde_json_opt")]
541    pub customer_balance: Option<miniserde::json::Value>,
542    /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
543    #[serde(skip_serializing_if = "Option::is_none")]
544    pub eps: Option<CreateSetupIntentPaymentMethodDataEps>,
545    /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
546    #[serde(skip_serializing_if = "Option::is_none")]
547    pub fpx: Option<CreateSetupIntentPaymentMethodDataFpx>,
548    /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
549    #[serde(skip_serializing_if = "Option::is_none")]
550    #[serde(with = "stripe_types::with_serde_json_opt")]
551    pub giropay: Option<miniserde::json::Value>,
552    /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
553    #[serde(skip_serializing_if = "Option::is_none")]
554    #[serde(with = "stripe_types::with_serde_json_opt")]
555    pub grabpay: Option<miniserde::json::Value>,
556    /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
557    #[serde(skip_serializing_if = "Option::is_none")]
558    pub ideal: Option<CreateSetupIntentPaymentMethodDataIdeal>,
559    /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
560    #[serde(skip_serializing_if = "Option::is_none")]
561    #[serde(with = "stripe_types::with_serde_json_opt")]
562    pub interac_present: Option<miniserde::json::Value>,
563    /// If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method.
564    #[serde(skip_serializing_if = "Option::is_none")]
565    #[serde(with = "stripe_types::with_serde_json_opt")]
566    pub kakao_pay: Option<miniserde::json::Value>,
567    /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
568    #[serde(skip_serializing_if = "Option::is_none")]
569    pub klarna: Option<CreateSetupIntentPaymentMethodDataKlarna>,
570    /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
571    #[serde(skip_serializing_if = "Option::is_none")]
572    #[serde(with = "stripe_types::with_serde_json_opt")]
573    pub konbini: Option<miniserde::json::Value>,
574    /// If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method.
575    #[serde(skip_serializing_if = "Option::is_none")]
576    #[serde(with = "stripe_types::with_serde_json_opt")]
577    pub kr_card: Option<miniserde::json::Value>,
578    /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
579    #[serde(skip_serializing_if = "Option::is_none")]
580    #[serde(with = "stripe_types::with_serde_json_opt")]
581    pub link: Option<miniserde::json::Value>,
582    /// If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method.
583    #[serde(skip_serializing_if = "Option::is_none")]
584    #[serde(with = "stripe_types::with_serde_json_opt")]
585    pub mb_way: Option<miniserde::json::Value>,
586    /// Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object.
587    /// This can be useful for storing additional information about the object in a structured format.
588    /// Individual keys can be unset by posting an empty value to them.
589    /// All keys can be unset by posting an empty value to `metadata`.
590    #[serde(skip_serializing_if = "Option::is_none")]
591    pub metadata: Option<std::collections::HashMap<String, String>>,
592    /// If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
593    #[serde(skip_serializing_if = "Option::is_none")]
594    #[serde(with = "stripe_types::with_serde_json_opt")]
595    pub mobilepay: Option<miniserde::json::Value>,
596    /// If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method.
597    #[serde(skip_serializing_if = "Option::is_none")]
598    #[serde(with = "stripe_types::with_serde_json_opt")]
599    pub multibanco: Option<miniserde::json::Value>,
600    /// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
601    #[serde(skip_serializing_if = "Option::is_none")]
602    pub naver_pay: Option<CreateSetupIntentPaymentMethodDataNaverPay>,
603    /// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
604    #[serde(skip_serializing_if = "Option::is_none")]
605    pub nz_bank_account: Option<CreateSetupIntentPaymentMethodDataNzBankAccount>,
606    /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
607    #[serde(skip_serializing_if = "Option::is_none")]
608    #[serde(with = "stripe_types::with_serde_json_opt")]
609    pub oxxo: Option<miniserde::json::Value>,
610    /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
611    #[serde(skip_serializing_if = "Option::is_none")]
612    pub p24: Option<CreateSetupIntentPaymentMethodDataP24>,
613    /// If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method.
614    #[serde(skip_serializing_if = "Option::is_none")]
615    #[serde(with = "stripe_types::with_serde_json_opt")]
616    pub pay_by_bank: Option<miniserde::json::Value>,
617    /// If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method.
618    #[serde(skip_serializing_if = "Option::is_none")]
619    #[serde(with = "stripe_types::with_serde_json_opt")]
620    pub payco: Option<miniserde::json::Value>,
621    /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
622    #[serde(skip_serializing_if = "Option::is_none")]
623    #[serde(with = "stripe_types::with_serde_json_opt")]
624    pub paynow: Option<miniserde::json::Value>,
625    /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
626    #[serde(skip_serializing_if = "Option::is_none")]
627    #[serde(with = "stripe_types::with_serde_json_opt")]
628    pub paypal: Option<miniserde::json::Value>,
629    /// If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method.
630    #[serde(skip_serializing_if = "Option::is_none")]
631    pub payto: Option<CreateSetupIntentPaymentMethodDataPayto>,
632    /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
633    #[serde(skip_serializing_if = "Option::is_none")]
634    #[serde(with = "stripe_types::with_serde_json_opt")]
635    pub pix: Option<miniserde::json::Value>,
636    /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
637    #[serde(skip_serializing_if = "Option::is_none")]
638    #[serde(with = "stripe_types::with_serde_json_opt")]
639    pub promptpay: Option<miniserde::json::Value>,
640    /// Options to configure Radar.
641    /// See [Radar Session](https://docs.stripe.com/radar/radar-session) for more information.
642    #[serde(skip_serializing_if = "Option::is_none")]
643    pub radar_options: Option<RadarOptionsWithHiddenOptions>,
644    /// If this is a `revolut_pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
645    #[serde(skip_serializing_if = "Option::is_none")]
646    #[serde(with = "stripe_types::with_serde_json_opt")]
647    pub revolut_pay: Option<miniserde::json::Value>,
648    /// If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method.
649    #[serde(skip_serializing_if = "Option::is_none")]
650    #[serde(with = "stripe_types::with_serde_json_opt")]
651    pub samsung_pay: Option<miniserde::json::Value>,
652    /// If this is a `satispay` PaymentMethod, this hash contains details about the Satispay payment method.
653    #[serde(skip_serializing_if = "Option::is_none")]
654    #[serde(with = "stripe_types::with_serde_json_opt")]
655    pub satispay: Option<miniserde::json::Value>,
656    /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
657    #[serde(skip_serializing_if = "Option::is_none")]
658    pub sepa_debit: Option<CreateSetupIntentPaymentMethodDataSepaDebit>,
659    /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
660    #[serde(skip_serializing_if = "Option::is_none")]
661    pub sofort: Option<CreateSetupIntentPaymentMethodDataSofort>,
662    /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
663    #[serde(skip_serializing_if = "Option::is_none")]
664    #[serde(with = "stripe_types::with_serde_json_opt")]
665    pub swish: Option<miniserde::json::Value>,
666    /// If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method.
667    #[serde(skip_serializing_if = "Option::is_none")]
668    #[serde(with = "stripe_types::with_serde_json_opt")]
669    pub twint: Option<miniserde::json::Value>,
670    /// The type of the PaymentMethod.
671    /// An additional hash is included on the PaymentMethod with a name matching this value.
672    /// It contains additional information specific to the PaymentMethod type.
673    #[serde(rename = "type")]
674    pub type_: CreateSetupIntentPaymentMethodDataType,
675    /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
676    #[serde(skip_serializing_if = "Option::is_none")]
677    pub us_bank_account: Option<CreateSetupIntentPaymentMethodDataUsBankAccount>,
678    /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
679    #[serde(skip_serializing_if = "Option::is_none")]
680    #[serde(with = "stripe_types::with_serde_json_opt")]
681    pub wechat_pay: Option<miniserde::json::Value>,
682    /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
683    #[serde(skip_serializing_if = "Option::is_none")]
684    #[serde(with = "stripe_types::with_serde_json_opt")]
685    pub zip: Option<miniserde::json::Value>,
686}
687impl CreateSetupIntentPaymentMethodData {
688    pub fn new(type_: impl Into<CreateSetupIntentPaymentMethodDataType>) -> Self {
689        Self {
690            acss_debit: None,
691            affirm: None,
692            afterpay_clearpay: None,
693            alipay: None,
694            allow_redisplay: None,
695            alma: None,
696            amazon_pay: None,
697            au_becs_debit: None,
698            bacs_debit: None,
699            bancontact: None,
700            billie: None,
701            billing_details: None,
702            blik: None,
703            boleto: None,
704            cashapp: None,
705            crypto: None,
706            customer_balance: None,
707            eps: None,
708            fpx: None,
709            giropay: None,
710            grabpay: None,
711            ideal: None,
712            interac_present: None,
713            kakao_pay: None,
714            klarna: None,
715            konbini: None,
716            kr_card: None,
717            link: None,
718            mb_way: None,
719            metadata: None,
720            mobilepay: None,
721            multibanco: None,
722            naver_pay: None,
723            nz_bank_account: None,
724            oxxo: None,
725            p24: None,
726            pay_by_bank: None,
727            payco: None,
728            paynow: None,
729            paypal: None,
730            payto: None,
731            pix: None,
732            promptpay: None,
733            radar_options: None,
734            revolut_pay: None,
735            samsung_pay: None,
736            satispay: None,
737            sepa_debit: None,
738            sofort: None,
739            swish: None,
740            twint: None,
741            type_: type_.into(),
742            us_bank_account: None,
743            wechat_pay: None,
744            zip: None,
745        }
746    }
747}
748/// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
749/// 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.
750/// The field defaults to `unspecified`.
751#[derive(Clone, Eq, PartialEq)]
752#[non_exhaustive]
753pub enum CreateSetupIntentPaymentMethodDataAllowRedisplay {
754    Always,
755    Limited,
756    Unspecified,
757    /// An unrecognized value from Stripe. Should not be used as a request parameter.
758    Unknown(String),
759}
760impl CreateSetupIntentPaymentMethodDataAllowRedisplay {
761    pub fn as_str(&self) -> &str {
762        use CreateSetupIntentPaymentMethodDataAllowRedisplay::*;
763        match self {
764            Always => "always",
765            Limited => "limited",
766            Unspecified => "unspecified",
767            Unknown(v) => v,
768        }
769    }
770}
771
772impl std::str::FromStr for CreateSetupIntentPaymentMethodDataAllowRedisplay {
773    type Err = std::convert::Infallible;
774    fn from_str(s: &str) -> Result<Self, Self::Err> {
775        use CreateSetupIntentPaymentMethodDataAllowRedisplay::*;
776        match s {
777            "always" => Ok(Always),
778            "limited" => Ok(Limited),
779            "unspecified" => Ok(Unspecified),
780            v => {
781                tracing::warn!(
782                    "Unknown value '{}' for enum '{}'",
783                    v,
784                    "CreateSetupIntentPaymentMethodDataAllowRedisplay"
785                );
786                Ok(Unknown(v.to_owned()))
787            }
788        }
789    }
790}
791impl std::fmt::Display for CreateSetupIntentPaymentMethodDataAllowRedisplay {
792    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
793        f.write_str(self.as_str())
794    }
795}
796
797impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataAllowRedisplay {
798    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
799        f.write_str(self.as_str())
800    }
801}
802impl serde::Serialize for CreateSetupIntentPaymentMethodDataAllowRedisplay {
803    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
804    where
805        S: serde::Serializer,
806    {
807        serializer.serialize_str(self.as_str())
808    }
809}
810#[cfg(feature = "deserialize")]
811impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataAllowRedisplay {
812    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
813        use std::str::FromStr;
814        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
815        Ok(Self::from_str(&s).expect("infallible"))
816    }
817}
818/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
819#[derive(Clone, Debug, serde::Serialize)]
820pub struct CreateSetupIntentPaymentMethodDataAuBecsDebit {
821    /// The account number for the bank account.
822    pub account_number: String,
823    /// Bank-State-Branch number of the bank account.
824    pub bsb_number: String,
825}
826impl CreateSetupIntentPaymentMethodDataAuBecsDebit {
827    pub fn new(account_number: impl Into<String>, bsb_number: impl Into<String>) -> Self {
828        Self { account_number: account_number.into(), bsb_number: bsb_number.into() }
829    }
830}
831/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
832#[derive(Clone, Debug, serde::Serialize)]
833pub struct CreateSetupIntentPaymentMethodDataBacsDebit {
834    /// Account number of the bank account that the funds will be debited from.
835    #[serde(skip_serializing_if = "Option::is_none")]
836    pub account_number: Option<String>,
837    /// Sort code of the bank account. (e.g., `10-20-30`)
838    #[serde(skip_serializing_if = "Option::is_none")]
839    pub sort_code: Option<String>,
840}
841impl CreateSetupIntentPaymentMethodDataBacsDebit {
842    pub fn new() -> Self {
843        Self { account_number: None, sort_code: None }
844    }
845}
846impl Default for CreateSetupIntentPaymentMethodDataBacsDebit {
847    fn default() -> Self {
848        Self::new()
849    }
850}
851/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
852#[derive(Clone, Debug, serde::Serialize)]
853pub struct CreateSetupIntentPaymentMethodDataBoleto {
854    /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)
855    pub tax_id: String,
856}
857impl CreateSetupIntentPaymentMethodDataBoleto {
858    pub fn new(tax_id: impl Into<String>) -> Self {
859        Self { tax_id: tax_id.into() }
860    }
861}
862/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
863#[derive(Clone, Debug, serde::Serialize)]
864pub struct CreateSetupIntentPaymentMethodDataEps {
865    /// The customer's bank.
866    #[serde(skip_serializing_if = "Option::is_none")]
867    pub bank: Option<CreateSetupIntentPaymentMethodDataEpsBank>,
868}
869impl CreateSetupIntentPaymentMethodDataEps {
870    pub fn new() -> Self {
871        Self { bank: None }
872    }
873}
874impl Default for CreateSetupIntentPaymentMethodDataEps {
875    fn default() -> Self {
876        Self::new()
877    }
878}
879/// The customer's bank.
880#[derive(Clone, Eq, PartialEq)]
881#[non_exhaustive]
882pub enum CreateSetupIntentPaymentMethodDataEpsBank {
883    ArzteUndApothekerBank,
884    AustrianAnadiBankAg,
885    BankAustria,
886    BankhausCarlSpangler,
887    BankhausSchelhammerUndSchatteraAg,
888    BawagPskAg,
889    BksBankAg,
890    BrullKallmusBankAg,
891    BtvVierLanderBank,
892    CapitalBankGraweGruppeAg,
893    DeutscheBankAg,
894    Dolomitenbank,
895    EasybankAg,
896    ErsteBankUndSparkassen,
897    HypoAlpeadriabankInternationalAg,
898    HypoBankBurgenlandAktiengesellschaft,
899    HypoNoeLbFurNiederosterreichUWien,
900    HypoOberosterreichSalzburgSteiermark,
901    HypoTirolBankAg,
902    HypoVorarlbergBankAg,
903    MarchfelderBank,
904    OberbankAg,
905    RaiffeisenBankengruppeOsterreich,
906    SchoellerbankAg,
907    SpardaBankWien,
908    VolksbankGruppe,
909    VolkskreditbankAg,
910    VrBankBraunau,
911    /// An unrecognized value from Stripe. Should not be used as a request parameter.
912    Unknown(String),
913}
914impl CreateSetupIntentPaymentMethodDataEpsBank {
915    pub fn as_str(&self) -> &str {
916        use CreateSetupIntentPaymentMethodDataEpsBank::*;
917        match self {
918            ArzteUndApothekerBank => "arzte_und_apotheker_bank",
919            AustrianAnadiBankAg => "austrian_anadi_bank_ag",
920            BankAustria => "bank_austria",
921            BankhausCarlSpangler => "bankhaus_carl_spangler",
922            BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag",
923            BawagPskAg => "bawag_psk_ag",
924            BksBankAg => "bks_bank_ag",
925            BrullKallmusBankAg => "brull_kallmus_bank_ag",
926            BtvVierLanderBank => "btv_vier_lander_bank",
927            CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
928            DeutscheBankAg => "deutsche_bank_ag",
929            Dolomitenbank => "dolomitenbank",
930            EasybankAg => "easybank_ag",
931            ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
932            HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag",
933            HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft",
934            HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien",
935            HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark",
936            HypoTirolBankAg => "hypo_tirol_bank_ag",
937            HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
938            MarchfelderBank => "marchfelder_bank",
939            OberbankAg => "oberbank_ag",
940            RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich",
941            SchoellerbankAg => "schoellerbank_ag",
942            SpardaBankWien => "sparda_bank_wien",
943            VolksbankGruppe => "volksbank_gruppe",
944            VolkskreditbankAg => "volkskreditbank_ag",
945            VrBankBraunau => "vr_bank_braunau",
946            Unknown(v) => v,
947        }
948    }
949}
950
951impl std::str::FromStr for CreateSetupIntentPaymentMethodDataEpsBank {
952    type Err = std::convert::Infallible;
953    fn from_str(s: &str) -> Result<Self, Self::Err> {
954        use CreateSetupIntentPaymentMethodDataEpsBank::*;
955        match s {
956            "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank),
957            "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg),
958            "bank_austria" => Ok(BankAustria),
959            "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler),
960            "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg),
961            "bawag_psk_ag" => Ok(BawagPskAg),
962            "bks_bank_ag" => Ok(BksBankAg),
963            "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg),
964            "btv_vier_lander_bank" => Ok(BtvVierLanderBank),
965            "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg),
966            "deutsche_bank_ag" => Ok(DeutscheBankAg),
967            "dolomitenbank" => Ok(Dolomitenbank),
968            "easybank_ag" => Ok(EasybankAg),
969            "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen),
970            "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg),
971            "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft),
972            "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien),
973            "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark),
974            "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg),
975            "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg),
976            "marchfelder_bank" => Ok(MarchfelderBank),
977            "oberbank_ag" => Ok(OberbankAg),
978            "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich),
979            "schoellerbank_ag" => Ok(SchoellerbankAg),
980            "sparda_bank_wien" => Ok(SpardaBankWien),
981            "volksbank_gruppe" => Ok(VolksbankGruppe),
982            "volkskreditbank_ag" => Ok(VolkskreditbankAg),
983            "vr_bank_braunau" => Ok(VrBankBraunau),
984            v => {
985                tracing::warn!(
986                    "Unknown value '{}' for enum '{}'",
987                    v,
988                    "CreateSetupIntentPaymentMethodDataEpsBank"
989                );
990                Ok(Unknown(v.to_owned()))
991            }
992        }
993    }
994}
995impl std::fmt::Display for CreateSetupIntentPaymentMethodDataEpsBank {
996    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
997        f.write_str(self.as_str())
998    }
999}
1000
1001impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataEpsBank {
1002    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1003        f.write_str(self.as_str())
1004    }
1005}
1006impl serde::Serialize for CreateSetupIntentPaymentMethodDataEpsBank {
1007    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1008    where
1009        S: serde::Serializer,
1010    {
1011        serializer.serialize_str(self.as_str())
1012    }
1013}
1014#[cfg(feature = "deserialize")]
1015impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataEpsBank {
1016    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1017        use std::str::FromStr;
1018        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1019        Ok(Self::from_str(&s).expect("infallible"))
1020    }
1021}
1022/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
1023#[derive(Clone, Debug, serde::Serialize)]
1024pub struct CreateSetupIntentPaymentMethodDataFpx {
1025    /// Account holder type for FPX transaction
1026    #[serde(skip_serializing_if = "Option::is_none")]
1027    pub account_holder_type: Option<CreateSetupIntentPaymentMethodDataFpxAccountHolderType>,
1028    /// The customer's bank.
1029    pub bank: CreateSetupIntentPaymentMethodDataFpxBank,
1030}
1031impl CreateSetupIntentPaymentMethodDataFpx {
1032    pub fn new(bank: impl Into<CreateSetupIntentPaymentMethodDataFpxBank>) -> Self {
1033        Self { account_holder_type: None, bank: bank.into() }
1034    }
1035}
1036/// Account holder type for FPX transaction
1037#[derive(Clone, Eq, PartialEq)]
1038#[non_exhaustive]
1039pub enum CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1040    Company,
1041    Individual,
1042    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1043    Unknown(String),
1044}
1045impl CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1046    pub fn as_str(&self) -> &str {
1047        use CreateSetupIntentPaymentMethodDataFpxAccountHolderType::*;
1048        match self {
1049            Company => "company",
1050            Individual => "individual",
1051            Unknown(v) => v,
1052        }
1053    }
1054}
1055
1056impl std::str::FromStr for CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1057    type Err = std::convert::Infallible;
1058    fn from_str(s: &str) -> Result<Self, Self::Err> {
1059        use CreateSetupIntentPaymentMethodDataFpxAccountHolderType::*;
1060        match s {
1061            "company" => Ok(Company),
1062            "individual" => Ok(Individual),
1063            v => {
1064                tracing::warn!(
1065                    "Unknown value '{}' for enum '{}'",
1066                    v,
1067                    "CreateSetupIntentPaymentMethodDataFpxAccountHolderType"
1068                );
1069                Ok(Unknown(v.to_owned()))
1070            }
1071        }
1072    }
1073}
1074impl std::fmt::Display for CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1075    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1076        f.write_str(self.as_str())
1077    }
1078}
1079
1080impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1081    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1082        f.write_str(self.as_str())
1083    }
1084}
1085impl serde::Serialize for CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1086    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1087    where
1088        S: serde::Serializer,
1089    {
1090        serializer.serialize_str(self.as_str())
1091    }
1092}
1093#[cfg(feature = "deserialize")]
1094impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1095    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1096        use std::str::FromStr;
1097        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1098        Ok(Self::from_str(&s).expect("infallible"))
1099    }
1100}
1101/// The customer's bank.
1102#[derive(Clone, Eq, PartialEq)]
1103#[non_exhaustive]
1104pub enum CreateSetupIntentPaymentMethodDataFpxBank {
1105    AffinBank,
1106    Agrobank,
1107    AllianceBank,
1108    Ambank,
1109    BankIslam,
1110    BankMuamalat,
1111    BankOfChina,
1112    BankRakyat,
1113    Bsn,
1114    Cimb,
1115    DeutscheBank,
1116    HongLeongBank,
1117    Hsbc,
1118    Kfh,
1119    Maybank2e,
1120    Maybank2u,
1121    Ocbc,
1122    PbEnterprise,
1123    PublicBank,
1124    Rhb,
1125    StandardChartered,
1126    Uob,
1127    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1128    Unknown(String),
1129}
1130impl CreateSetupIntentPaymentMethodDataFpxBank {
1131    pub fn as_str(&self) -> &str {
1132        use CreateSetupIntentPaymentMethodDataFpxBank::*;
1133        match self {
1134            AffinBank => "affin_bank",
1135            Agrobank => "agrobank",
1136            AllianceBank => "alliance_bank",
1137            Ambank => "ambank",
1138            BankIslam => "bank_islam",
1139            BankMuamalat => "bank_muamalat",
1140            BankOfChina => "bank_of_china",
1141            BankRakyat => "bank_rakyat",
1142            Bsn => "bsn",
1143            Cimb => "cimb",
1144            DeutscheBank => "deutsche_bank",
1145            HongLeongBank => "hong_leong_bank",
1146            Hsbc => "hsbc",
1147            Kfh => "kfh",
1148            Maybank2e => "maybank2e",
1149            Maybank2u => "maybank2u",
1150            Ocbc => "ocbc",
1151            PbEnterprise => "pb_enterprise",
1152            PublicBank => "public_bank",
1153            Rhb => "rhb",
1154            StandardChartered => "standard_chartered",
1155            Uob => "uob",
1156            Unknown(v) => v,
1157        }
1158    }
1159}
1160
1161impl std::str::FromStr for CreateSetupIntentPaymentMethodDataFpxBank {
1162    type Err = std::convert::Infallible;
1163    fn from_str(s: &str) -> Result<Self, Self::Err> {
1164        use CreateSetupIntentPaymentMethodDataFpxBank::*;
1165        match s {
1166            "affin_bank" => Ok(AffinBank),
1167            "agrobank" => Ok(Agrobank),
1168            "alliance_bank" => Ok(AllianceBank),
1169            "ambank" => Ok(Ambank),
1170            "bank_islam" => Ok(BankIslam),
1171            "bank_muamalat" => Ok(BankMuamalat),
1172            "bank_of_china" => Ok(BankOfChina),
1173            "bank_rakyat" => Ok(BankRakyat),
1174            "bsn" => Ok(Bsn),
1175            "cimb" => Ok(Cimb),
1176            "deutsche_bank" => Ok(DeutscheBank),
1177            "hong_leong_bank" => Ok(HongLeongBank),
1178            "hsbc" => Ok(Hsbc),
1179            "kfh" => Ok(Kfh),
1180            "maybank2e" => Ok(Maybank2e),
1181            "maybank2u" => Ok(Maybank2u),
1182            "ocbc" => Ok(Ocbc),
1183            "pb_enterprise" => Ok(PbEnterprise),
1184            "public_bank" => Ok(PublicBank),
1185            "rhb" => Ok(Rhb),
1186            "standard_chartered" => Ok(StandardChartered),
1187            "uob" => Ok(Uob),
1188            v => {
1189                tracing::warn!(
1190                    "Unknown value '{}' for enum '{}'",
1191                    v,
1192                    "CreateSetupIntentPaymentMethodDataFpxBank"
1193                );
1194                Ok(Unknown(v.to_owned()))
1195            }
1196        }
1197    }
1198}
1199impl std::fmt::Display for CreateSetupIntentPaymentMethodDataFpxBank {
1200    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1201        f.write_str(self.as_str())
1202    }
1203}
1204
1205impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataFpxBank {
1206    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1207        f.write_str(self.as_str())
1208    }
1209}
1210impl serde::Serialize for CreateSetupIntentPaymentMethodDataFpxBank {
1211    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1212    where
1213        S: serde::Serializer,
1214    {
1215        serializer.serialize_str(self.as_str())
1216    }
1217}
1218#[cfg(feature = "deserialize")]
1219impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataFpxBank {
1220    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1221        use std::str::FromStr;
1222        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1223        Ok(Self::from_str(&s).expect("infallible"))
1224    }
1225}
1226/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
1227#[derive(Clone, Debug, serde::Serialize)]
1228pub struct CreateSetupIntentPaymentMethodDataIdeal {
1229    /// The customer's bank.
1230    /// Only use this parameter for existing customers.
1231    /// Don't use it for new customers.
1232    #[serde(skip_serializing_if = "Option::is_none")]
1233    pub bank: Option<CreateSetupIntentPaymentMethodDataIdealBank>,
1234}
1235impl CreateSetupIntentPaymentMethodDataIdeal {
1236    pub fn new() -> Self {
1237        Self { bank: None }
1238    }
1239}
1240impl Default for CreateSetupIntentPaymentMethodDataIdeal {
1241    fn default() -> Self {
1242        Self::new()
1243    }
1244}
1245/// The customer's bank.
1246/// Only use this parameter for existing customers.
1247/// Don't use it for new customers.
1248#[derive(Clone, Eq, PartialEq)]
1249#[non_exhaustive]
1250pub enum CreateSetupIntentPaymentMethodDataIdealBank {
1251    AbnAmro,
1252    AsnBank,
1253    Bunq,
1254    Buut,
1255    Finom,
1256    Handelsbanken,
1257    Ing,
1258    Knab,
1259    Mollie,
1260    Moneyou,
1261    N26,
1262    Nn,
1263    Rabobank,
1264    Regiobank,
1265    Revolut,
1266    SnsBank,
1267    TriodosBank,
1268    VanLanschot,
1269    Yoursafe,
1270    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1271    Unknown(String),
1272}
1273impl CreateSetupIntentPaymentMethodDataIdealBank {
1274    pub fn as_str(&self) -> &str {
1275        use CreateSetupIntentPaymentMethodDataIdealBank::*;
1276        match self {
1277            AbnAmro => "abn_amro",
1278            AsnBank => "asn_bank",
1279            Bunq => "bunq",
1280            Buut => "buut",
1281            Finom => "finom",
1282            Handelsbanken => "handelsbanken",
1283            Ing => "ing",
1284            Knab => "knab",
1285            Mollie => "mollie",
1286            Moneyou => "moneyou",
1287            N26 => "n26",
1288            Nn => "nn",
1289            Rabobank => "rabobank",
1290            Regiobank => "regiobank",
1291            Revolut => "revolut",
1292            SnsBank => "sns_bank",
1293            TriodosBank => "triodos_bank",
1294            VanLanschot => "van_lanschot",
1295            Yoursafe => "yoursafe",
1296            Unknown(v) => v,
1297        }
1298    }
1299}
1300
1301impl std::str::FromStr for CreateSetupIntentPaymentMethodDataIdealBank {
1302    type Err = std::convert::Infallible;
1303    fn from_str(s: &str) -> Result<Self, Self::Err> {
1304        use CreateSetupIntentPaymentMethodDataIdealBank::*;
1305        match s {
1306            "abn_amro" => Ok(AbnAmro),
1307            "asn_bank" => Ok(AsnBank),
1308            "bunq" => Ok(Bunq),
1309            "buut" => Ok(Buut),
1310            "finom" => Ok(Finom),
1311            "handelsbanken" => Ok(Handelsbanken),
1312            "ing" => Ok(Ing),
1313            "knab" => Ok(Knab),
1314            "mollie" => Ok(Mollie),
1315            "moneyou" => Ok(Moneyou),
1316            "n26" => Ok(N26),
1317            "nn" => Ok(Nn),
1318            "rabobank" => Ok(Rabobank),
1319            "regiobank" => Ok(Regiobank),
1320            "revolut" => Ok(Revolut),
1321            "sns_bank" => Ok(SnsBank),
1322            "triodos_bank" => Ok(TriodosBank),
1323            "van_lanschot" => Ok(VanLanschot),
1324            "yoursafe" => Ok(Yoursafe),
1325            v => {
1326                tracing::warn!(
1327                    "Unknown value '{}' for enum '{}'",
1328                    v,
1329                    "CreateSetupIntentPaymentMethodDataIdealBank"
1330                );
1331                Ok(Unknown(v.to_owned()))
1332            }
1333        }
1334    }
1335}
1336impl std::fmt::Display for CreateSetupIntentPaymentMethodDataIdealBank {
1337    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1338        f.write_str(self.as_str())
1339    }
1340}
1341
1342impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataIdealBank {
1343    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1344        f.write_str(self.as_str())
1345    }
1346}
1347impl serde::Serialize for CreateSetupIntentPaymentMethodDataIdealBank {
1348    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1349    where
1350        S: serde::Serializer,
1351    {
1352        serializer.serialize_str(self.as_str())
1353    }
1354}
1355#[cfg(feature = "deserialize")]
1356impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataIdealBank {
1357    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1358        use std::str::FromStr;
1359        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1360        Ok(Self::from_str(&s).expect("infallible"))
1361    }
1362}
1363/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
1364#[derive(Copy, Clone, Debug, serde::Serialize)]
1365pub struct CreateSetupIntentPaymentMethodDataKlarna {
1366    /// Customer's date of birth
1367    #[serde(skip_serializing_if = "Option::is_none")]
1368    pub dob: Option<DateOfBirth>,
1369}
1370impl CreateSetupIntentPaymentMethodDataKlarna {
1371    pub fn new() -> Self {
1372        Self { dob: None }
1373    }
1374}
1375impl Default for CreateSetupIntentPaymentMethodDataKlarna {
1376    fn default() -> Self {
1377        Self::new()
1378    }
1379}
1380/// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
1381#[derive(Clone, Debug, serde::Serialize)]
1382pub struct CreateSetupIntentPaymentMethodDataNaverPay {
1383    /// Whether to use Naver Pay points or a card to fund this transaction.
1384    /// If not provided, this defaults to `card`.
1385    #[serde(skip_serializing_if = "Option::is_none")]
1386    pub funding: Option<CreateSetupIntentPaymentMethodDataNaverPayFunding>,
1387}
1388impl CreateSetupIntentPaymentMethodDataNaverPay {
1389    pub fn new() -> Self {
1390        Self { funding: None }
1391    }
1392}
1393impl Default for CreateSetupIntentPaymentMethodDataNaverPay {
1394    fn default() -> Self {
1395        Self::new()
1396    }
1397}
1398/// Whether to use Naver Pay points or a card to fund this transaction.
1399/// If not provided, this defaults to `card`.
1400#[derive(Clone, Eq, PartialEq)]
1401#[non_exhaustive]
1402pub enum CreateSetupIntentPaymentMethodDataNaverPayFunding {
1403    Card,
1404    Points,
1405    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1406    Unknown(String),
1407}
1408impl CreateSetupIntentPaymentMethodDataNaverPayFunding {
1409    pub fn as_str(&self) -> &str {
1410        use CreateSetupIntentPaymentMethodDataNaverPayFunding::*;
1411        match self {
1412            Card => "card",
1413            Points => "points",
1414            Unknown(v) => v,
1415        }
1416    }
1417}
1418
1419impl std::str::FromStr for CreateSetupIntentPaymentMethodDataNaverPayFunding {
1420    type Err = std::convert::Infallible;
1421    fn from_str(s: &str) -> Result<Self, Self::Err> {
1422        use CreateSetupIntentPaymentMethodDataNaverPayFunding::*;
1423        match s {
1424            "card" => Ok(Card),
1425            "points" => Ok(Points),
1426            v => {
1427                tracing::warn!(
1428                    "Unknown value '{}' for enum '{}'",
1429                    v,
1430                    "CreateSetupIntentPaymentMethodDataNaverPayFunding"
1431                );
1432                Ok(Unknown(v.to_owned()))
1433            }
1434        }
1435    }
1436}
1437impl std::fmt::Display for CreateSetupIntentPaymentMethodDataNaverPayFunding {
1438    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1439        f.write_str(self.as_str())
1440    }
1441}
1442
1443impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataNaverPayFunding {
1444    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1445        f.write_str(self.as_str())
1446    }
1447}
1448impl serde::Serialize for CreateSetupIntentPaymentMethodDataNaverPayFunding {
1449    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1450    where
1451        S: serde::Serializer,
1452    {
1453        serializer.serialize_str(self.as_str())
1454    }
1455}
1456#[cfg(feature = "deserialize")]
1457impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataNaverPayFunding {
1458    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1459        use std::str::FromStr;
1460        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1461        Ok(Self::from_str(&s).expect("infallible"))
1462    }
1463}
1464/// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
1465#[derive(Clone, Debug, serde::Serialize)]
1466pub struct CreateSetupIntentPaymentMethodDataNzBankAccount {
1467    /// The name on the bank account.
1468    /// Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod’s billing details.
1469    #[serde(skip_serializing_if = "Option::is_none")]
1470    pub account_holder_name: Option<String>,
1471    /// The account number for the bank account.
1472    pub account_number: String,
1473    /// The numeric code for the bank account's bank.
1474    pub bank_code: String,
1475    /// The numeric code for the bank account's bank branch.
1476    pub branch_code: String,
1477    #[serde(skip_serializing_if = "Option::is_none")]
1478    pub reference: Option<String>,
1479    /// The suffix of the bank account number.
1480    pub suffix: String,
1481}
1482impl CreateSetupIntentPaymentMethodDataNzBankAccount {
1483    pub fn new(
1484        account_number: impl Into<String>,
1485        bank_code: impl Into<String>,
1486        branch_code: impl Into<String>,
1487        suffix: impl Into<String>,
1488    ) -> Self {
1489        Self {
1490            account_holder_name: None,
1491            account_number: account_number.into(),
1492            bank_code: bank_code.into(),
1493            branch_code: branch_code.into(),
1494            reference: None,
1495            suffix: suffix.into(),
1496        }
1497    }
1498}
1499/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
1500#[derive(Clone, Debug, serde::Serialize)]
1501pub struct CreateSetupIntentPaymentMethodDataP24 {
1502    /// The customer's bank.
1503    #[serde(skip_serializing_if = "Option::is_none")]
1504    pub bank: Option<CreateSetupIntentPaymentMethodDataP24Bank>,
1505}
1506impl CreateSetupIntentPaymentMethodDataP24 {
1507    pub fn new() -> Self {
1508        Self { bank: None }
1509    }
1510}
1511impl Default for CreateSetupIntentPaymentMethodDataP24 {
1512    fn default() -> Self {
1513        Self::new()
1514    }
1515}
1516/// The customer's bank.
1517#[derive(Clone, Eq, PartialEq)]
1518#[non_exhaustive]
1519pub enum CreateSetupIntentPaymentMethodDataP24Bank {
1520    AliorBank,
1521    BankMillennium,
1522    BankNowyBfgSa,
1523    BankPekaoSa,
1524    BankiSpbdzielcze,
1525    Blik,
1526    BnpParibas,
1527    Boz,
1528    CitiHandlowy,
1529    CreditAgricole,
1530    Envelobank,
1531    EtransferPocztowy24,
1532    GetinBank,
1533    Ideabank,
1534    Ing,
1535    Inteligo,
1536    MbankMtransfer,
1537    NestPrzelew,
1538    NoblePay,
1539    PbacZIpko,
1540    PlusBank,
1541    SantanderPrzelew24,
1542    TmobileUsbugiBankowe,
1543    ToyotaBank,
1544    Velobank,
1545    VolkswagenBank,
1546    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1547    Unknown(String),
1548}
1549impl CreateSetupIntentPaymentMethodDataP24Bank {
1550    pub fn as_str(&self) -> &str {
1551        use CreateSetupIntentPaymentMethodDataP24Bank::*;
1552        match self {
1553            AliorBank => "alior_bank",
1554            BankMillennium => "bank_millennium",
1555            BankNowyBfgSa => "bank_nowy_bfg_sa",
1556            BankPekaoSa => "bank_pekao_sa",
1557            BankiSpbdzielcze => "banki_spbdzielcze",
1558            Blik => "blik",
1559            BnpParibas => "bnp_paribas",
1560            Boz => "boz",
1561            CitiHandlowy => "citi_handlowy",
1562            CreditAgricole => "credit_agricole",
1563            Envelobank => "envelobank",
1564            EtransferPocztowy24 => "etransfer_pocztowy24",
1565            GetinBank => "getin_bank",
1566            Ideabank => "ideabank",
1567            Ing => "ing",
1568            Inteligo => "inteligo",
1569            MbankMtransfer => "mbank_mtransfer",
1570            NestPrzelew => "nest_przelew",
1571            NoblePay => "noble_pay",
1572            PbacZIpko => "pbac_z_ipko",
1573            PlusBank => "plus_bank",
1574            SantanderPrzelew24 => "santander_przelew24",
1575            TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
1576            ToyotaBank => "toyota_bank",
1577            Velobank => "velobank",
1578            VolkswagenBank => "volkswagen_bank",
1579            Unknown(v) => v,
1580        }
1581    }
1582}
1583
1584impl std::str::FromStr for CreateSetupIntentPaymentMethodDataP24Bank {
1585    type Err = std::convert::Infallible;
1586    fn from_str(s: &str) -> Result<Self, Self::Err> {
1587        use CreateSetupIntentPaymentMethodDataP24Bank::*;
1588        match s {
1589            "alior_bank" => Ok(AliorBank),
1590            "bank_millennium" => Ok(BankMillennium),
1591            "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa),
1592            "bank_pekao_sa" => Ok(BankPekaoSa),
1593            "banki_spbdzielcze" => Ok(BankiSpbdzielcze),
1594            "blik" => Ok(Blik),
1595            "bnp_paribas" => Ok(BnpParibas),
1596            "boz" => Ok(Boz),
1597            "citi_handlowy" => Ok(CitiHandlowy),
1598            "credit_agricole" => Ok(CreditAgricole),
1599            "envelobank" => Ok(Envelobank),
1600            "etransfer_pocztowy24" => Ok(EtransferPocztowy24),
1601            "getin_bank" => Ok(GetinBank),
1602            "ideabank" => Ok(Ideabank),
1603            "ing" => Ok(Ing),
1604            "inteligo" => Ok(Inteligo),
1605            "mbank_mtransfer" => Ok(MbankMtransfer),
1606            "nest_przelew" => Ok(NestPrzelew),
1607            "noble_pay" => Ok(NoblePay),
1608            "pbac_z_ipko" => Ok(PbacZIpko),
1609            "plus_bank" => Ok(PlusBank),
1610            "santander_przelew24" => Ok(SantanderPrzelew24),
1611            "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe),
1612            "toyota_bank" => Ok(ToyotaBank),
1613            "velobank" => Ok(Velobank),
1614            "volkswagen_bank" => Ok(VolkswagenBank),
1615            v => {
1616                tracing::warn!(
1617                    "Unknown value '{}' for enum '{}'",
1618                    v,
1619                    "CreateSetupIntentPaymentMethodDataP24Bank"
1620                );
1621                Ok(Unknown(v.to_owned()))
1622            }
1623        }
1624    }
1625}
1626impl std::fmt::Display for CreateSetupIntentPaymentMethodDataP24Bank {
1627    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1628        f.write_str(self.as_str())
1629    }
1630}
1631
1632impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataP24Bank {
1633    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1634        f.write_str(self.as_str())
1635    }
1636}
1637impl serde::Serialize for CreateSetupIntentPaymentMethodDataP24Bank {
1638    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1639    where
1640        S: serde::Serializer,
1641    {
1642        serializer.serialize_str(self.as_str())
1643    }
1644}
1645#[cfg(feature = "deserialize")]
1646impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataP24Bank {
1647    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1648        use std::str::FromStr;
1649        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1650        Ok(Self::from_str(&s).expect("infallible"))
1651    }
1652}
1653/// If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method.
1654#[derive(Clone, Debug, serde::Serialize)]
1655pub struct CreateSetupIntentPaymentMethodDataPayto {
1656    /// The account number for the bank account.
1657    #[serde(skip_serializing_if = "Option::is_none")]
1658    pub account_number: Option<String>,
1659    /// Bank-State-Branch number of the bank account.
1660    #[serde(skip_serializing_if = "Option::is_none")]
1661    pub bsb_number: Option<String>,
1662    /// The PayID alias for the bank account.
1663    #[serde(skip_serializing_if = "Option::is_none")]
1664    pub pay_id: Option<String>,
1665}
1666impl CreateSetupIntentPaymentMethodDataPayto {
1667    pub fn new() -> Self {
1668        Self { account_number: None, bsb_number: None, pay_id: None }
1669    }
1670}
1671impl Default for CreateSetupIntentPaymentMethodDataPayto {
1672    fn default() -> Self {
1673        Self::new()
1674    }
1675}
1676/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
1677#[derive(Clone, Debug, serde::Serialize)]
1678pub struct CreateSetupIntentPaymentMethodDataSepaDebit {
1679    /// IBAN of the bank account.
1680    pub iban: String,
1681}
1682impl CreateSetupIntentPaymentMethodDataSepaDebit {
1683    pub fn new(iban: impl Into<String>) -> Self {
1684        Self { iban: iban.into() }
1685    }
1686}
1687/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
1688#[derive(Clone, Debug, serde::Serialize)]
1689pub struct CreateSetupIntentPaymentMethodDataSofort {
1690    /// Two-letter ISO code representing the country the bank account is located in.
1691    pub country: CreateSetupIntentPaymentMethodDataSofortCountry,
1692}
1693impl CreateSetupIntentPaymentMethodDataSofort {
1694    pub fn new(country: impl Into<CreateSetupIntentPaymentMethodDataSofortCountry>) -> Self {
1695        Self { country: country.into() }
1696    }
1697}
1698/// Two-letter ISO code representing the country the bank account is located in.
1699#[derive(Clone, Eq, PartialEq)]
1700#[non_exhaustive]
1701pub enum CreateSetupIntentPaymentMethodDataSofortCountry {
1702    At,
1703    Be,
1704    De,
1705    Es,
1706    It,
1707    Nl,
1708    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1709    Unknown(String),
1710}
1711impl CreateSetupIntentPaymentMethodDataSofortCountry {
1712    pub fn as_str(&self) -> &str {
1713        use CreateSetupIntentPaymentMethodDataSofortCountry::*;
1714        match self {
1715            At => "AT",
1716            Be => "BE",
1717            De => "DE",
1718            Es => "ES",
1719            It => "IT",
1720            Nl => "NL",
1721            Unknown(v) => v,
1722        }
1723    }
1724}
1725
1726impl std::str::FromStr for CreateSetupIntentPaymentMethodDataSofortCountry {
1727    type Err = std::convert::Infallible;
1728    fn from_str(s: &str) -> Result<Self, Self::Err> {
1729        use CreateSetupIntentPaymentMethodDataSofortCountry::*;
1730        match s {
1731            "AT" => Ok(At),
1732            "BE" => Ok(Be),
1733            "DE" => Ok(De),
1734            "ES" => Ok(Es),
1735            "IT" => Ok(It),
1736            "NL" => Ok(Nl),
1737            v => {
1738                tracing::warn!(
1739                    "Unknown value '{}' for enum '{}'",
1740                    v,
1741                    "CreateSetupIntentPaymentMethodDataSofortCountry"
1742                );
1743                Ok(Unknown(v.to_owned()))
1744            }
1745        }
1746    }
1747}
1748impl std::fmt::Display for CreateSetupIntentPaymentMethodDataSofortCountry {
1749    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1750        f.write_str(self.as_str())
1751    }
1752}
1753
1754impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataSofortCountry {
1755    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1756        f.write_str(self.as_str())
1757    }
1758}
1759impl serde::Serialize for CreateSetupIntentPaymentMethodDataSofortCountry {
1760    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1761    where
1762        S: serde::Serializer,
1763    {
1764        serializer.serialize_str(self.as_str())
1765    }
1766}
1767#[cfg(feature = "deserialize")]
1768impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataSofortCountry {
1769    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1770        use std::str::FromStr;
1771        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1772        Ok(Self::from_str(&s).expect("infallible"))
1773    }
1774}
1775/// The type of the PaymentMethod.
1776/// An additional hash is included on the PaymentMethod with a name matching this value.
1777/// It contains additional information specific to the PaymentMethod type.
1778#[derive(Clone, Eq, PartialEq)]
1779#[non_exhaustive]
1780pub enum CreateSetupIntentPaymentMethodDataType {
1781    AcssDebit,
1782    Affirm,
1783    AfterpayClearpay,
1784    Alipay,
1785    Alma,
1786    AmazonPay,
1787    AuBecsDebit,
1788    BacsDebit,
1789    Bancontact,
1790    Billie,
1791    Blik,
1792    Boleto,
1793    Cashapp,
1794    Crypto,
1795    CustomerBalance,
1796    Eps,
1797    Fpx,
1798    Giropay,
1799    Grabpay,
1800    Ideal,
1801    KakaoPay,
1802    Klarna,
1803    Konbini,
1804    KrCard,
1805    Link,
1806    MbWay,
1807    Mobilepay,
1808    Multibanco,
1809    NaverPay,
1810    NzBankAccount,
1811    Oxxo,
1812    P24,
1813    PayByBank,
1814    Payco,
1815    Paynow,
1816    Paypal,
1817    Payto,
1818    Pix,
1819    Promptpay,
1820    RevolutPay,
1821    SamsungPay,
1822    Satispay,
1823    SepaDebit,
1824    Sofort,
1825    Swish,
1826    Twint,
1827    UsBankAccount,
1828    WechatPay,
1829    Zip,
1830    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1831    Unknown(String),
1832}
1833impl CreateSetupIntentPaymentMethodDataType {
1834    pub fn as_str(&self) -> &str {
1835        use CreateSetupIntentPaymentMethodDataType::*;
1836        match self {
1837            AcssDebit => "acss_debit",
1838            Affirm => "affirm",
1839            AfterpayClearpay => "afterpay_clearpay",
1840            Alipay => "alipay",
1841            Alma => "alma",
1842            AmazonPay => "amazon_pay",
1843            AuBecsDebit => "au_becs_debit",
1844            BacsDebit => "bacs_debit",
1845            Bancontact => "bancontact",
1846            Billie => "billie",
1847            Blik => "blik",
1848            Boleto => "boleto",
1849            Cashapp => "cashapp",
1850            Crypto => "crypto",
1851            CustomerBalance => "customer_balance",
1852            Eps => "eps",
1853            Fpx => "fpx",
1854            Giropay => "giropay",
1855            Grabpay => "grabpay",
1856            Ideal => "ideal",
1857            KakaoPay => "kakao_pay",
1858            Klarna => "klarna",
1859            Konbini => "konbini",
1860            KrCard => "kr_card",
1861            Link => "link",
1862            MbWay => "mb_way",
1863            Mobilepay => "mobilepay",
1864            Multibanco => "multibanco",
1865            NaverPay => "naver_pay",
1866            NzBankAccount => "nz_bank_account",
1867            Oxxo => "oxxo",
1868            P24 => "p24",
1869            PayByBank => "pay_by_bank",
1870            Payco => "payco",
1871            Paynow => "paynow",
1872            Paypal => "paypal",
1873            Payto => "payto",
1874            Pix => "pix",
1875            Promptpay => "promptpay",
1876            RevolutPay => "revolut_pay",
1877            SamsungPay => "samsung_pay",
1878            Satispay => "satispay",
1879            SepaDebit => "sepa_debit",
1880            Sofort => "sofort",
1881            Swish => "swish",
1882            Twint => "twint",
1883            UsBankAccount => "us_bank_account",
1884            WechatPay => "wechat_pay",
1885            Zip => "zip",
1886            Unknown(v) => v,
1887        }
1888    }
1889}
1890
1891impl std::str::FromStr for CreateSetupIntentPaymentMethodDataType {
1892    type Err = std::convert::Infallible;
1893    fn from_str(s: &str) -> Result<Self, Self::Err> {
1894        use CreateSetupIntentPaymentMethodDataType::*;
1895        match s {
1896            "acss_debit" => Ok(AcssDebit),
1897            "affirm" => Ok(Affirm),
1898            "afterpay_clearpay" => Ok(AfterpayClearpay),
1899            "alipay" => Ok(Alipay),
1900            "alma" => Ok(Alma),
1901            "amazon_pay" => Ok(AmazonPay),
1902            "au_becs_debit" => Ok(AuBecsDebit),
1903            "bacs_debit" => Ok(BacsDebit),
1904            "bancontact" => Ok(Bancontact),
1905            "billie" => Ok(Billie),
1906            "blik" => Ok(Blik),
1907            "boleto" => Ok(Boleto),
1908            "cashapp" => Ok(Cashapp),
1909            "crypto" => Ok(Crypto),
1910            "customer_balance" => Ok(CustomerBalance),
1911            "eps" => Ok(Eps),
1912            "fpx" => Ok(Fpx),
1913            "giropay" => Ok(Giropay),
1914            "grabpay" => Ok(Grabpay),
1915            "ideal" => Ok(Ideal),
1916            "kakao_pay" => Ok(KakaoPay),
1917            "klarna" => Ok(Klarna),
1918            "konbini" => Ok(Konbini),
1919            "kr_card" => Ok(KrCard),
1920            "link" => Ok(Link),
1921            "mb_way" => Ok(MbWay),
1922            "mobilepay" => Ok(Mobilepay),
1923            "multibanco" => Ok(Multibanco),
1924            "naver_pay" => Ok(NaverPay),
1925            "nz_bank_account" => Ok(NzBankAccount),
1926            "oxxo" => Ok(Oxxo),
1927            "p24" => Ok(P24),
1928            "pay_by_bank" => Ok(PayByBank),
1929            "payco" => Ok(Payco),
1930            "paynow" => Ok(Paynow),
1931            "paypal" => Ok(Paypal),
1932            "payto" => Ok(Payto),
1933            "pix" => Ok(Pix),
1934            "promptpay" => Ok(Promptpay),
1935            "revolut_pay" => Ok(RevolutPay),
1936            "samsung_pay" => Ok(SamsungPay),
1937            "satispay" => Ok(Satispay),
1938            "sepa_debit" => Ok(SepaDebit),
1939            "sofort" => Ok(Sofort),
1940            "swish" => Ok(Swish),
1941            "twint" => Ok(Twint),
1942            "us_bank_account" => Ok(UsBankAccount),
1943            "wechat_pay" => Ok(WechatPay),
1944            "zip" => Ok(Zip),
1945            v => {
1946                tracing::warn!(
1947                    "Unknown value '{}' for enum '{}'",
1948                    v,
1949                    "CreateSetupIntentPaymentMethodDataType"
1950                );
1951                Ok(Unknown(v.to_owned()))
1952            }
1953        }
1954    }
1955}
1956impl std::fmt::Display for CreateSetupIntentPaymentMethodDataType {
1957    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1958        f.write_str(self.as_str())
1959    }
1960}
1961
1962impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataType {
1963    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1964        f.write_str(self.as_str())
1965    }
1966}
1967impl serde::Serialize for CreateSetupIntentPaymentMethodDataType {
1968    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1969    where
1970        S: serde::Serializer,
1971    {
1972        serializer.serialize_str(self.as_str())
1973    }
1974}
1975#[cfg(feature = "deserialize")]
1976impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataType {
1977    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1978        use std::str::FromStr;
1979        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1980        Ok(Self::from_str(&s).expect("infallible"))
1981    }
1982}
1983/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
1984#[derive(Clone, Debug, serde::Serialize)]
1985pub struct CreateSetupIntentPaymentMethodDataUsBankAccount {
1986    /// Account holder type: individual or company.
1987    #[serde(skip_serializing_if = "Option::is_none")]
1988    pub account_holder_type:
1989        Option<CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType>,
1990    /// Account number of the bank account.
1991    #[serde(skip_serializing_if = "Option::is_none")]
1992    pub account_number: Option<String>,
1993    /// Account type: checkings or savings. Defaults to checking if omitted.
1994    #[serde(skip_serializing_if = "Option::is_none")]
1995    pub account_type: Option<CreateSetupIntentPaymentMethodDataUsBankAccountAccountType>,
1996    /// The ID of a Financial Connections Account to use as a payment method.
1997    #[serde(skip_serializing_if = "Option::is_none")]
1998    pub financial_connections_account: Option<String>,
1999    /// Routing number of the bank account.
2000    #[serde(skip_serializing_if = "Option::is_none")]
2001    pub routing_number: Option<String>,
2002}
2003impl CreateSetupIntentPaymentMethodDataUsBankAccount {
2004    pub fn new() -> Self {
2005        Self {
2006            account_holder_type: None,
2007            account_number: None,
2008            account_type: None,
2009            financial_connections_account: None,
2010            routing_number: None,
2011        }
2012    }
2013}
2014impl Default for CreateSetupIntentPaymentMethodDataUsBankAccount {
2015    fn default() -> Self {
2016        Self::new()
2017    }
2018}
2019/// Account holder type: individual or company.
2020#[derive(Clone, Eq, PartialEq)]
2021#[non_exhaustive]
2022pub enum CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
2023    Company,
2024    Individual,
2025    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2026    Unknown(String),
2027}
2028impl CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
2029    pub fn as_str(&self) -> &str {
2030        use CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
2031        match self {
2032            Company => "company",
2033            Individual => "individual",
2034            Unknown(v) => v,
2035        }
2036    }
2037}
2038
2039impl std::str::FromStr for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
2040    type Err = std::convert::Infallible;
2041    fn from_str(s: &str) -> Result<Self, Self::Err> {
2042        use CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
2043        match s {
2044            "company" => Ok(Company),
2045            "individual" => Ok(Individual),
2046            v => {
2047                tracing::warn!(
2048                    "Unknown value '{}' for enum '{}'",
2049                    v,
2050                    "CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType"
2051                );
2052                Ok(Unknown(v.to_owned()))
2053            }
2054        }
2055    }
2056}
2057impl std::fmt::Display for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
2058    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2059        f.write_str(self.as_str())
2060    }
2061}
2062
2063impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
2064    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2065        f.write_str(self.as_str())
2066    }
2067}
2068impl serde::Serialize for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
2069    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2070    where
2071        S: serde::Serializer,
2072    {
2073        serializer.serialize_str(self.as_str())
2074    }
2075}
2076#[cfg(feature = "deserialize")]
2077impl<'de> serde::Deserialize<'de>
2078    for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType
2079{
2080    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2081        use std::str::FromStr;
2082        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2083        Ok(Self::from_str(&s).expect("infallible"))
2084    }
2085}
2086/// Account type: checkings or savings. Defaults to checking if omitted.
2087#[derive(Clone, Eq, PartialEq)]
2088#[non_exhaustive]
2089pub enum CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
2090    Checking,
2091    Savings,
2092    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2093    Unknown(String),
2094}
2095impl CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
2096    pub fn as_str(&self) -> &str {
2097        use CreateSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
2098        match self {
2099            Checking => "checking",
2100            Savings => "savings",
2101            Unknown(v) => v,
2102        }
2103    }
2104}
2105
2106impl std::str::FromStr for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
2107    type Err = std::convert::Infallible;
2108    fn from_str(s: &str) -> Result<Self, Self::Err> {
2109        use CreateSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
2110        match s {
2111            "checking" => Ok(Checking),
2112            "savings" => Ok(Savings),
2113            v => {
2114                tracing::warn!(
2115                    "Unknown value '{}' for enum '{}'",
2116                    v,
2117                    "CreateSetupIntentPaymentMethodDataUsBankAccountAccountType"
2118                );
2119                Ok(Unknown(v.to_owned()))
2120            }
2121        }
2122    }
2123}
2124impl std::fmt::Display for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
2125    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2126        f.write_str(self.as_str())
2127    }
2128}
2129
2130impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
2131    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2132        f.write_str(self.as_str())
2133    }
2134}
2135impl serde::Serialize for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
2136    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2137    where
2138        S: serde::Serializer,
2139    {
2140        serializer.serialize_str(self.as_str())
2141    }
2142}
2143#[cfg(feature = "deserialize")]
2144impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
2145    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2146        use std::str::FromStr;
2147        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2148        Ok(Self::from_str(&s).expect("infallible"))
2149    }
2150}
2151/// Payment method-specific configuration for this SetupIntent.
2152#[derive(Clone, Debug, serde::Serialize)]
2153pub struct CreateSetupIntentPaymentMethodOptions {
2154    /// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options.
2155    #[serde(skip_serializing_if = "Option::is_none")]
2156    pub acss_debit: Option<CreateSetupIntentPaymentMethodOptionsAcssDebit>,
2157    /// If this is a `amazon_pay` SetupIntent, this sub-hash contains details about the AmazonPay payment method options.
2158    #[serde(skip_serializing_if = "Option::is_none")]
2159    #[serde(with = "stripe_types::with_serde_json_opt")]
2160    pub amazon_pay: Option<miniserde::json::Value>,
2161    /// If this is a `bacs_debit` SetupIntent, this sub-hash contains details about the Bacs Debit payment method options.
2162    #[serde(skip_serializing_if = "Option::is_none")]
2163    pub bacs_debit: Option<CreateSetupIntentPaymentMethodOptionsBacsDebit>,
2164    /// Configuration for any card setup attempted on this SetupIntent.
2165    #[serde(skip_serializing_if = "Option::is_none")]
2166    pub card: Option<CreateSetupIntentPaymentMethodOptionsCard>,
2167    /// If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options.
2168    #[serde(skip_serializing_if = "Option::is_none")]
2169    #[serde(with = "stripe_types::with_serde_json_opt")]
2170    pub card_present: Option<miniserde::json::Value>,
2171    /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options.
2172    #[serde(skip_serializing_if = "Option::is_none")]
2173    pub klarna: Option<CreateSetupIntentPaymentMethodOptionsKlarna>,
2174    /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
2175    #[serde(skip_serializing_if = "Option::is_none")]
2176    pub link: Option<SetupIntentPaymentMethodOptionsParam>,
2177    /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
2178    #[serde(skip_serializing_if = "Option::is_none")]
2179    pub paypal: Option<PaymentMethodOptionsParam>,
2180    /// If this is a `payto` SetupIntent, this sub-hash contains details about the PayTo payment method options.
2181    #[serde(skip_serializing_if = "Option::is_none")]
2182    pub payto: Option<CreateSetupIntentPaymentMethodOptionsPayto>,
2183    /// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options.
2184    #[serde(skip_serializing_if = "Option::is_none")]
2185    pub sepa_debit: Option<CreateSetupIntentPaymentMethodOptionsSepaDebit>,
2186    /// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options.
2187    #[serde(skip_serializing_if = "Option::is_none")]
2188    pub us_bank_account: Option<CreateSetupIntentPaymentMethodOptionsUsBankAccount>,
2189}
2190impl CreateSetupIntentPaymentMethodOptions {
2191    pub fn new() -> Self {
2192        Self {
2193            acss_debit: None,
2194            amazon_pay: None,
2195            bacs_debit: None,
2196            card: None,
2197            card_present: None,
2198            klarna: None,
2199            link: None,
2200            paypal: None,
2201            payto: None,
2202            sepa_debit: None,
2203            us_bank_account: None,
2204        }
2205    }
2206}
2207impl Default for CreateSetupIntentPaymentMethodOptions {
2208    fn default() -> Self {
2209        Self::new()
2210    }
2211}
2212/// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options.
2213#[derive(Clone, Debug, serde::Serialize)]
2214pub struct CreateSetupIntentPaymentMethodOptionsAcssDebit {
2215    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
2216    /// Must be a [supported currency](https://stripe.com/docs/currencies).
2217    #[serde(skip_serializing_if = "Option::is_none")]
2218    pub currency: Option<CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency>,
2219    /// Additional fields for Mandate creation
2220    #[serde(skip_serializing_if = "Option::is_none")]
2221    pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions>,
2222    /// Bank account verification method.
2223    #[serde(skip_serializing_if = "Option::is_none")]
2224    pub verification_method:
2225        Option<CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
2226}
2227impl CreateSetupIntentPaymentMethodOptionsAcssDebit {
2228    pub fn new() -> Self {
2229        Self { currency: None, mandate_options: None, verification_method: None }
2230    }
2231}
2232impl Default for CreateSetupIntentPaymentMethodOptionsAcssDebit {
2233    fn default() -> Self {
2234        Self::new()
2235    }
2236}
2237/// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
2238/// Must be a [supported currency](https://stripe.com/docs/currencies).
2239#[derive(Clone, Eq, PartialEq)]
2240#[non_exhaustive]
2241pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2242    Cad,
2243    Usd,
2244    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2245    Unknown(String),
2246}
2247impl CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2248    pub fn as_str(&self) -> &str {
2249        use CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
2250        match self {
2251            Cad => "cad",
2252            Usd => "usd",
2253            Unknown(v) => v,
2254        }
2255    }
2256}
2257
2258impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2259    type Err = std::convert::Infallible;
2260    fn from_str(s: &str) -> Result<Self, Self::Err> {
2261        use CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
2262        match s {
2263            "cad" => Ok(Cad),
2264            "usd" => Ok(Usd),
2265            v => {
2266                tracing::warn!(
2267                    "Unknown value '{}' for enum '{}'",
2268                    v,
2269                    "CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency"
2270                );
2271                Ok(Unknown(v.to_owned()))
2272            }
2273        }
2274    }
2275}
2276impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2277    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2278        f.write_str(self.as_str())
2279    }
2280}
2281
2282impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2283    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2284        f.write_str(self.as_str())
2285    }
2286}
2287impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2288    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2289    where
2290        S: serde::Serializer,
2291    {
2292        serializer.serialize_str(self.as_str())
2293    }
2294}
2295#[cfg(feature = "deserialize")]
2296impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2297    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2298        use std::str::FromStr;
2299        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2300        Ok(Self::from_str(&s).expect("infallible"))
2301    }
2302}
2303/// Additional fields for Mandate creation
2304#[derive(Clone, Debug, serde::Serialize)]
2305pub struct CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
2306    /// A URL for custom mandate text to render during confirmation step.
2307    /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,.
2308    /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent.
2309    #[serde(skip_serializing_if = "Option::is_none")]
2310    pub custom_mandate_url: Option<String>,
2311    /// List of Stripe products where this mandate can be selected automatically.
2312    #[serde(skip_serializing_if = "Option::is_none")]
2313    pub default_for:
2314        Option<Vec<CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor>>,
2315    /// Description of the mandate interval.
2316    /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'.
2317    #[serde(skip_serializing_if = "Option::is_none")]
2318    pub interval_description: Option<String>,
2319    /// Payment schedule for the mandate.
2320    #[serde(skip_serializing_if = "Option::is_none")]
2321    pub payment_schedule:
2322        Option<CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
2323    /// Transaction type of the mandate.
2324    #[serde(skip_serializing_if = "Option::is_none")]
2325    pub transaction_type:
2326        Option<CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
2327}
2328impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
2329    pub fn new() -> Self {
2330        Self {
2331            custom_mandate_url: None,
2332            default_for: None,
2333            interval_description: None,
2334            payment_schedule: None,
2335            transaction_type: None,
2336        }
2337    }
2338}
2339impl Default for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
2340    fn default() -> Self {
2341        Self::new()
2342    }
2343}
2344/// List of Stripe products where this mandate can be selected automatically.
2345#[derive(Clone, Eq, PartialEq)]
2346#[non_exhaustive]
2347pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2348    Invoice,
2349    Subscription,
2350    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2351    Unknown(String),
2352}
2353impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2354    pub fn as_str(&self) -> &str {
2355        use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
2356        match self {
2357            Invoice => "invoice",
2358            Subscription => "subscription",
2359            Unknown(v) => v,
2360        }
2361    }
2362}
2363
2364impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2365    type Err = std::convert::Infallible;
2366    fn from_str(s: &str) -> Result<Self, Self::Err> {
2367        use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
2368        match s {
2369            "invoice" => Ok(Invoice),
2370            "subscription" => Ok(Subscription),
2371            v => {
2372                tracing::warn!(
2373                    "Unknown value '{}' for enum '{}'",
2374                    v,
2375                    "CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor"
2376                );
2377                Ok(Unknown(v.to_owned()))
2378            }
2379        }
2380    }
2381}
2382impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2383    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2384        f.write_str(self.as_str())
2385    }
2386}
2387
2388impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2389    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2390        f.write_str(self.as_str())
2391    }
2392}
2393impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2394    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2395    where
2396        S: serde::Serializer,
2397    {
2398        serializer.serialize_str(self.as_str())
2399    }
2400}
2401#[cfg(feature = "deserialize")]
2402impl<'de> serde::Deserialize<'de>
2403    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
2404{
2405    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2406        use std::str::FromStr;
2407        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2408        Ok(Self::from_str(&s).expect("infallible"))
2409    }
2410}
2411/// Payment schedule for the mandate.
2412#[derive(Clone, Eq, PartialEq)]
2413#[non_exhaustive]
2414pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
2415    Combined,
2416    Interval,
2417    Sporadic,
2418    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2419    Unknown(String),
2420}
2421impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
2422    pub fn as_str(&self) -> &str {
2423        use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
2424        match self {
2425            Combined => "combined",
2426            Interval => "interval",
2427            Sporadic => "sporadic",
2428            Unknown(v) => v,
2429        }
2430    }
2431}
2432
2433impl std::str::FromStr
2434    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2435{
2436    type Err = std::convert::Infallible;
2437    fn from_str(s: &str) -> Result<Self, Self::Err> {
2438        use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
2439        match s {
2440            "combined" => Ok(Combined),
2441            "interval" => Ok(Interval),
2442            "sporadic" => Ok(Sporadic),
2443            v => {
2444                tracing::warn!(
2445                    "Unknown value '{}' for enum '{}'",
2446                    v,
2447                    "CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"
2448                );
2449                Ok(Unknown(v.to_owned()))
2450            }
2451        }
2452    }
2453}
2454impl std::fmt::Display
2455    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2456{
2457    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2458        f.write_str(self.as_str())
2459    }
2460}
2461
2462impl std::fmt::Debug
2463    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2464{
2465    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2466        f.write_str(self.as_str())
2467    }
2468}
2469impl serde::Serialize
2470    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2471{
2472    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2473    where
2474        S: serde::Serializer,
2475    {
2476        serializer.serialize_str(self.as_str())
2477    }
2478}
2479#[cfg(feature = "deserialize")]
2480impl<'de> serde::Deserialize<'de>
2481    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2482{
2483    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2484        use std::str::FromStr;
2485        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2486        Ok(Self::from_str(&s).expect("infallible"))
2487    }
2488}
2489/// Transaction type of the mandate.
2490#[derive(Clone, Eq, PartialEq)]
2491#[non_exhaustive]
2492pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
2493    Business,
2494    Personal,
2495    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2496    Unknown(String),
2497}
2498impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
2499    pub fn as_str(&self) -> &str {
2500        use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
2501        match self {
2502            Business => "business",
2503            Personal => "personal",
2504            Unknown(v) => v,
2505        }
2506    }
2507}
2508
2509impl std::str::FromStr
2510    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2511{
2512    type Err = std::convert::Infallible;
2513    fn from_str(s: &str) -> Result<Self, Self::Err> {
2514        use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
2515        match s {
2516            "business" => Ok(Business),
2517            "personal" => Ok(Personal),
2518            v => {
2519                tracing::warn!(
2520                    "Unknown value '{}' for enum '{}'",
2521                    v,
2522                    "CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"
2523                );
2524                Ok(Unknown(v.to_owned()))
2525            }
2526        }
2527    }
2528}
2529impl std::fmt::Display
2530    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2531{
2532    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2533        f.write_str(self.as_str())
2534    }
2535}
2536
2537impl std::fmt::Debug
2538    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2539{
2540    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2541        f.write_str(self.as_str())
2542    }
2543}
2544impl serde::Serialize
2545    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2546{
2547    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2548    where
2549        S: serde::Serializer,
2550    {
2551        serializer.serialize_str(self.as_str())
2552    }
2553}
2554#[cfg(feature = "deserialize")]
2555impl<'de> serde::Deserialize<'de>
2556    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2557{
2558    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2559        use std::str::FromStr;
2560        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2561        Ok(Self::from_str(&s).expect("infallible"))
2562    }
2563}
2564/// Bank account verification method.
2565#[derive(Clone, Eq, PartialEq)]
2566#[non_exhaustive]
2567pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2568    Automatic,
2569    Instant,
2570    Microdeposits,
2571    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2572    Unknown(String),
2573}
2574impl CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2575    pub fn as_str(&self) -> &str {
2576        use CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
2577        match self {
2578            Automatic => "automatic",
2579            Instant => "instant",
2580            Microdeposits => "microdeposits",
2581            Unknown(v) => v,
2582        }
2583    }
2584}
2585
2586impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2587    type Err = std::convert::Infallible;
2588    fn from_str(s: &str) -> Result<Self, Self::Err> {
2589        use CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
2590        match s {
2591            "automatic" => Ok(Automatic),
2592            "instant" => Ok(Instant),
2593            "microdeposits" => Ok(Microdeposits),
2594            v => {
2595                tracing::warn!(
2596                    "Unknown value '{}' for enum '{}'",
2597                    v,
2598                    "CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod"
2599                );
2600                Ok(Unknown(v.to_owned()))
2601            }
2602        }
2603    }
2604}
2605impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2606    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2607        f.write_str(self.as_str())
2608    }
2609}
2610
2611impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2612    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2613        f.write_str(self.as_str())
2614    }
2615}
2616impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2617    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2618    where
2619        S: serde::Serializer,
2620    {
2621        serializer.serialize_str(self.as_str())
2622    }
2623}
2624#[cfg(feature = "deserialize")]
2625impl<'de> serde::Deserialize<'de>
2626    for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod
2627{
2628    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2629        use std::str::FromStr;
2630        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2631        Ok(Self::from_str(&s).expect("infallible"))
2632    }
2633}
2634/// If this is a `bacs_debit` SetupIntent, this sub-hash contains details about the Bacs Debit payment method options.
2635#[derive(Clone, Debug, serde::Serialize)]
2636pub struct CreateSetupIntentPaymentMethodOptionsBacsDebit {
2637    /// Additional fields for Mandate creation
2638    #[serde(skip_serializing_if = "Option::is_none")]
2639    pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
2640}
2641impl CreateSetupIntentPaymentMethodOptionsBacsDebit {
2642    pub fn new() -> Self {
2643        Self { mandate_options: None }
2644    }
2645}
2646impl Default for CreateSetupIntentPaymentMethodOptionsBacsDebit {
2647    fn default() -> Self {
2648        Self::new()
2649    }
2650}
2651/// Configuration for any card setup attempted on this SetupIntent.
2652#[derive(Clone, Debug, serde::Serialize)]
2653pub struct CreateSetupIntentPaymentMethodOptionsCard {
2654    /// Configuration options for setting up an eMandate for cards issued in India.
2655    #[serde(skip_serializing_if = "Option::is_none")]
2656    pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsCardMandateOptions>,
2657    /// When specified, this parameter signals that a card has been collected
2658    /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This
2659    /// parameter can only be provided during confirmation.
2660    #[serde(skip_serializing_if = "Option::is_none")]
2661    pub moto: Option<bool>,
2662    /// Selected network to process this SetupIntent on.
2663    /// Depends on the available networks of the card attached to the SetupIntent.
2664    /// Can be only set confirm-time.
2665    #[serde(skip_serializing_if = "Option::is_none")]
2666    pub network: Option<CreateSetupIntentPaymentMethodOptionsCardNetwork>,
2667    /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication).
2668    /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
2669    /// If not provided, this value defaults to `automatic`.
2670    /// Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
2671    #[serde(skip_serializing_if = "Option::is_none")]
2672    pub request_three_d_secure:
2673        Option<CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure>,
2674    /// If 3D Secure authentication was performed with a third-party provider,
2675    /// the authentication details to use for this setup.
2676    #[serde(skip_serializing_if = "Option::is_none")]
2677    pub three_d_secure: Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecure>,
2678}
2679impl CreateSetupIntentPaymentMethodOptionsCard {
2680    pub fn new() -> Self {
2681        Self {
2682            mandate_options: None,
2683            moto: None,
2684            network: None,
2685            request_three_d_secure: None,
2686            three_d_secure: None,
2687        }
2688    }
2689}
2690impl Default for CreateSetupIntentPaymentMethodOptionsCard {
2691    fn default() -> Self {
2692        Self::new()
2693    }
2694}
2695/// Configuration options for setting up an eMandate for cards issued in India.
2696#[derive(Clone, Debug, serde::Serialize)]
2697pub struct CreateSetupIntentPaymentMethodOptionsCardMandateOptions {
2698    /// Amount to be charged for future payments.
2699    pub amount: i64,
2700    /// One of `fixed` or `maximum`.
2701    /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
2702    /// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
2703    pub amount_type: CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType,
2704    /// Currency in which future payments will be charged.
2705    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
2706    /// Must be a [supported currency](https://stripe.com/docs/currencies).
2707    pub currency: stripe_types::Currency,
2708    /// A description of the mandate or subscription that is meant to be displayed to the customer.
2709    #[serde(skip_serializing_if = "Option::is_none")]
2710    pub description: Option<String>,
2711    /// End date of the mandate or subscription.
2712    /// If not provided, the mandate will be active until canceled.
2713    /// If provided, end date should be after start date.
2714    #[serde(skip_serializing_if = "Option::is_none")]
2715    pub end_date: Option<stripe_types::Timestamp>,
2716    /// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
2717    pub interval: CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval,
2718    /// The number of intervals between payments.
2719    /// For example, `interval=month` and `interval_count=3` indicates one payment every three months.
2720    /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).
2721    /// This parameter is optional when `interval=sporadic`.
2722    #[serde(skip_serializing_if = "Option::is_none")]
2723    pub interval_count: Option<u64>,
2724    /// Unique identifier for the mandate or subscription.
2725    pub reference: String,
2726    /// Start date of the mandate or subscription. Start date should not be lesser than yesterday.
2727    pub start_date: stripe_types::Timestamp,
2728    /// Specifies the type of mandates supported. Possible values are `india`.
2729    #[serde(skip_serializing_if = "Option::is_none")]
2730    pub supported_types:
2731        Option<Vec<CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
2732}
2733impl CreateSetupIntentPaymentMethodOptionsCardMandateOptions {
2734    pub fn new(
2735        amount: impl Into<i64>,
2736        amount_type: impl Into<CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
2737        currency: impl Into<stripe_types::Currency>,
2738        interval: impl Into<CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval>,
2739        reference: impl Into<String>,
2740        start_date: impl Into<stripe_types::Timestamp>,
2741    ) -> Self {
2742        Self {
2743            amount: amount.into(),
2744            amount_type: amount_type.into(),
2745            currency: currency.into(),
2746            description: None,
2747            end_date: None,
2748            interval: interval.into(),
2749            interval_count: None,
2750            reference: reference.into(),
2751            start_date: start_date.into(),
2752            supported_types: None,
2753        }
2754    }
2755}
2756/// One of `fixed` or `maximum`.
2757/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
2758/// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
2759#[derive(Clone, Eq, PartialEq)]
2760#[non_exhaustive]
2761pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
2762    Fixed,
2763    Maximum,
2764    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2765    Unknown(String),
2766}
2767impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
2768    pub fn as_str(&self) -> &str {
2769        use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
2770        match self {
2771            Fixed => "fixed",
2772            Maximum => "maximum",
2773            Unknown(v) => v,
2774        }
2775    }
2776}
2777
2778impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
2779    type Err = std::convert::Infallible;
2780    fn from_str(s: &str) -> Result<Self, Self::Err> {
2781        use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
2782        match s {
2783            "fixed" => Ok(Fixed),
2784            "maximum" => Ok(Maximum),
2785            v => {
2786                tracing::warn!(
2787                    "Unknown value '{}' for enum '{}'",
2788                    v,
2789                    "CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType"
2790                );
2791                Ok(Unknown(v.to_owned()))
2792            }
2793        }
2794    }
2795}
2796impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
2797    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2798        f.write_str(self.as_str())
2799    }
2800}
2801
2802impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
2803    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2804        f.write_str(self.as_str())
2805    }
2806}
2807impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
2808    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2809    where
2810        S: serde::Serializer,
2811    {
2812        serializer.serialize_str(self.as_str())
2813    }
2814}
2815#[cfg(feature = "deserialize")]
2816impl<'de> serde::Deserialize<'de>
2817    for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType
2818{
2819    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2820        use std::str::FromStr;
2821        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2822        Ok(Self::from_str(&s).expect("infallible"))
2823    }
2824}
2825/// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
2826#[derive(Clone, Eq, PartialEq)]
2827#[non_exhaustive]
2828pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
2829    Day,
2830    Month,
2831    Sporadic,
2832    Week,
2833    Year,
2834    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2835    Unknown(String),
2836}
2837impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
2838    pub fn as_str(&self) -> &str {
2839        use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
2840        match self {
2841            Day => "day",
2842            Month => "month",
2843            Sporadic => "sporadic",
2844            Week => "week",
2845            Year => "year",
2846            Unknown(v) => v,
2847        }
2848    }
2849}
2850
2851impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
2852    type Err = std::convert::Infallible;
2853    fn from_str(s: &str) -> Result<Self, Self::Err> {
2854        use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
2855        match s {
2856            "day" => Ok(Day),
2857            "month" => Ok(Month),
2858            "sporadic" => Ok(Sporadic),
2859            "week" => Ok(Week),
2860            "year" => Ok(Year),
2861            v => {
2862                tracing::warn!(
2863                    "Unknown value '{}' for enum '{}'",
2864                    v,
2865                    "CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval"
2866                );
2867                Ok(Unknown(v.to_owned()))
2868            }
2869        }
2870    }
2871}
2872impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
2873    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2874        f.write_str(self.as_str())
2875    }
2876}
2877
2878impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
2879    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2880        f.write_str(self.as_str())
2881    }
2882}
2883impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
2884    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2885    where
2886        S: serde::Serializer,
2887    {
2888        serializer.serialize_str(self.as_str())
2889    }
2890}
2891#[cfg(feature = "deserialize")]
2892impl<'de> serde::Deserialize<'de>
2893    for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval
2894{
2895    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2896        use std::str::FromStr;
2897        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2898        Ok(Self::from_str(&s).expect("infallible"))
2899    }
2900}
2901/// Specifies the type of mandates supported. Possible values are `india`.
2902#[derive(Clone, Eq, PartialEq)]
2903#[non_exhaustive]
2904pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
2905    India,
2906    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2907    Unknown(String),
2908}
2909impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
2910    pub fn as_str(&self) -> &str {
2911        use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
2912        match self {
2913            India => "india",
2914            Unknown(v) => v,
2915        }
2916    }
2917}
2918
2919impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
2920    type Err = std::convert::Infallible;
2921    fn from_str(s: &str) -> Result<Self, Self::Err> {
2922        use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
2923        match s {
2924            "india" => Ok(India),
2925            v => {
2926                tracing::warn!(
2927                    "Unknown value '{}' for enum '{}'",
2928                    v,
2929                    "CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"
2930                );
2931                Ok(Unknown(v.to_owned()))
2932            }
2933        }
2934    }
2935}
2936impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
2937    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2938        f.write_str(self.as_str())
2939    }
2940}
2941
2942impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
2943    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2944        f.write_str(self.as_str())
2945    }
2946}
2947impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
2948    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2949    where
2950        S: serde::Serializer,
2951    {
2952        serializer.serialize_str(self.as_str())
2953    }
2954}
2955#[cfg(feature = "deserialize")]
2956impl<'de> serde::Deserialize<'de>
2957    for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
2958{
2959    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2960        use std::str::FromStr;
2961        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2962        Ok(Self::from_str(&s).expect("infallible"))
2963    }
2964}
2965/// Selected network to process this SetupIntent on.
2966/// Depends on the available networks of the card attached to the SetupIntent.
2967/// Can be only set confirm-time.
2968#[derive(Clone, Eq, PartialEq)]
2969#[non_exhaustive]
2970pub enum CreateSetupIntentPaymentMethodOptionsCardNetwork {
2971    Amex,
2972    CartesBancaires,
2973    Diners,
2974    Discover,
2975    EftposAu,
2976    Girocard,
2977    Interac,
2978    Jcb,
2979    Link,
2980    Mastercard,
2981    Unionpay,
2982    Unknown,
2983    Visa,
2984    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2985    /// This variant is prefixed with an underscore to avoid conflicts with Stripe's 'Unknown' variant.
2986    _Unknown(String),
2987}
2988impl CreateSetupIntentPaymentMethodOptionsCardNetwork {
2989    pub fn as_str(&self) -> &str {
2990        use CreateSetupIntentPaymentMethodOptionsCardNetwork::*;
2991        match self {
2992            Amex => "amex",
2993            CartesBancaires => "cartes_bancaires",
2994            Diners => "diners",
2995            Discover => "discover",
2996            EftposAu => "eftpos_au",
2997            Girocard => "girocard",
2998            Interac => "interac",
2999            Jcb => "jcb",
3000            Link => "link",
3001            Mastercard => "mastercard",
3002            Unionpay => "unionpay",
3003            Unknown => "unknown",
3004            Visa => "visa",
3005            _Unknown(v) => v,
3006        }
3007    }
3008}
3009
3010impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardNetwork {
3011    type Err = std::convert::Infallible;
3012    fn from_str(s: &str) -> Result<Self, Self::Err> {
3013        use CreateSetupIntentPaymentMethodOptionsCardNetwork::*;
3014        match s {
3015            "amex" => Ok(Amex),
3016            "cartes_bancaires" => Ok(CartesBancaires),
3017            "diners" => Ok(Diners),
3018            "discover" => Ok(Discover),
3019            "eftpos_au" => Ok(EftposAu),
3020            "girocard" => Ok(Girocard),
3021            "interac" => Ok(Interac),
3022            "jcb" => Ok(Jcb),
3023            "link" => Ok(Link),
3024            "mastercard" => Ok(Mastercard),
3025            "unionpay" => Ok(Unionpay),
3026            "unknown" => Ok(Unknown),
3027            "visa" => Ok(Visa),
3028            v => {
3029                tracing::warn!(
3030                    "Unknown value '{}' for enum '{}'",
3031                    v,
3032                    "CreateSetupIntentPaymentMethodOptionsCardNetwork"
3033                );
3034                Ok(_Unknown(v.to_owned()))
3035            }
3036        }
3037    }
3038}
3039impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardNetwork {
3040    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3041        f.write_str(self.as_str())
3042    }
3043}
3044
3045impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardNetwork {
3046    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3047        f.write_str(self.as_str())
3048    }
3049}
3050impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardNetwork {
3051    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3052    where
3053        S: serde::Serializer,
3054    {
3055        serializer.serialize_str(self.as_str())
3056    }
3057}
3058#[cfg(feature = "deserialize")]
3059impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsCardNetwork {
3060    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3061        use std::str::FromStr;
3062        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3063        Ok(Self::from_str(&s).expect("infallible"))
3064    }
3065}
3066/// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication).
3067/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
3068/// If not provided, this value defaults to `automatic`.
3069/// Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
3070#[derive(Clone, Eq, PartialEq)]
3071#[non_exhaustive]
3072pub enum CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
3073    Any,
3074    Automatic,
3075    Challenge,
3076    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3077    Unknown(String),
3078}
3079impl CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
3080    pub fn as_str(&self) -> &str {
3081        use CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
3082        match self {
3083            Any => "any",
3084            Automatic => "automatic",
3085            Challenge => "challenge",
3086            Unknown(v) => v,
3087        }
3088    }
3089}
3090
3091impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
3092    type Err = std::convert::Infallible;
3093    fn from_str(s: &str) -> Result<Self, Self::Err> {
3094        use CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
3095        match s {
3096            "any" => Ok(Any),
3097            "automatic" => Ok(Automatic),
3098            "challenge" => Ok(Challenge),
3099            v => {
3100                tracing::warn!(
3101                    "Unknown value '{}' for enum '{}'",
3102                    v,
3103                    "CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure"
3104                );
3105                Ok(Unknown(v.to_owned()))
3106            }
3107        }
3108    }
3109}
3110impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
3111    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3112        f.write_str(self.as_str())
3113    }
3114}
3115
3116impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
3117    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3118        f.write_str(self.as_str())
3119    }
3120}
3121impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
3122    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3123    where
3124        S: serde::Serializer,
3125    {
3126        serializer.serialize_str(self.as_str())
3127    }
3128}
3129#[cfg(feature = "deserialize")]
3130impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
3131    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3132        use std::str::FromStr;
3133        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3134        Ok(Self::from_str(&s).expect("infallible"))
3135    }
3136}
3137/// If 3D Secure authentication was performed with a third-party provider,
3138/// the authentication details to use for this setup.
3139#[derive(Clone, Debug, serde::Serialize)]
3140pub struct CreateSetupIntentPaymentMethodOptionsCardThreeDSecure {
3141    /// The `transStatus` returned from the card Issuer’s ACS in the ARes.
3142    #[serde(skip_serializing_if = "Option::is_none")]
3143    pub ares_trans_status:
3144        Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
3145    /// The cryptogram, also known as the "authentication value" (AAV, CAVV or
3146    /// AEVV). This value is 20 bytes, base64-encoded into a 28-character string.
3147    /// (Most 3D Secure providers will return the base64-encoded version, which
3148    /// is what you should specify here.)
3149    #[serde(skip_serializing_if = "Option::is_none")]
3150    pub cryptogram: Option<String>,
3151    /// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
3152    /// provider and indicates what degree of authentication was performed.
3153    #[serde(skip_serializing_if = "Option::is_none")]
3154    pub electronic_commerce_indicator:
3155        Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
3156    /// Network specific 3DS fields. Network specific arguments require an
3157    /// explicit card brand choice. The parameter `payment_method_options.card.network``
3158    /// must be populated accordingly
3159    #[serde(skip_serializing_if = "Option::is_none")]
3160    pub network_options:
3161        Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
3162    /// The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the
3163    /// AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99.
3164    #[serde(skip_serializing_if = "Option::is_none")]
3165    pub requestor_challenge_indicator: Option<String>,
3166    /// For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server
3167    /// Transaction ID (dsTransID).
3168    #[serde(skip_serializing_if = "Option::is_none")]
3169    pub transaction_id: Option<String>,
3170    /// The version of 3D Secure that was performed.
3171    #[serde(skip_serializing_if = "Option::is_none")]
3172    pub version: Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion>,
3173}
3174impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecure {
3175    pub fn new() -> Self {
3176        Self {
3177            ares_trans_status: None,
3178            cryptogram: None,
3179            electronic_commerce_indicator: None,
3180            network_options: None,
3181            requestor_challenge_indicator: None,
3182            transaction_id: None,
3183            version: None,
3184        }
3185    }
3186}
3187impl Default for CreateSetupIntentPaymentMethodOptionsCardThreeDSecure {
3188    fn default() -> Self {
3189        Self::new()
3190    }
3191}
3192/// The `transStatus` returned from the card Issuer’s ACS in the ARes.
3193#[derive(Clone, Eq, PartialEq)]
3194#[non_exhaustive]
3195pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
3196    A,
3197    C,
3198    I,
3199    N,
3200    R,
3201    U,
3202    Y,
3203    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3204    Unknown(String),
3205}
3206impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
3207    pub fn as_str(&self) -> &str {
3208        use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
3209        match self {
3210            A => "A",
3211            C => "C",
3212            I => "I",
3213            N => "N",
3214            R => "R",
3215            U => "U",
3216            Y => "Y",
3217            Unknown(v) => v,
3218        }
3219    }
3220}
3221
3222impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
3223    type Err = std::convert::Infallible;
3224    fn from_str(s: &str) -> Result<Self, Self::Err> {
3225        use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
3226        match s {
3227            "A" => Ok(A),
3228            "C" => Ok(C),
3229            "I" => Ok(I),
3230            "N" => Ok(N),
3231            "R" => Ok(R),
3232            "U" => Ok(U),
3233            "Y" => Ok(Y),
3234            v => {
3235                tracing::warn!(
3236                    "Unknown value '{}' for enum '{}'",
3237                    v,
3238                    "CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"
3239                );
3240                Ok(Unknown(v.to_owned()))
3241            }
3242        }
3243    }
3244}
3245impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
3246    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3247        f.write_str(self.as_str())
3248    }
3249}
3250
3251impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
3252    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3253        f.write_str(self.as_str())
3254    }
3255}
3256impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
3257    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3258    where
3259        S: serde::Serializer,
3260    {
3261        serializer.serialize_str(self.as_str())
3262    }
3263}
3264#[cfg(feature = "deserialize")]
3265impl<'de> serde::Deserialize<'de>
3266    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
3267{
3268    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3269        use std::str::FromStr;
3270        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3271        Ok(Self::from_str(&s).expect("infallible"))
3272    }
3273}
3274/// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
3275/// provider and indicates what degree of authentication was performed.
3276#[derive(Clone, Eq, PartialEq)]
3277#[non_exhaustive]
3278pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
3279    V01,
3280    V02,
3281    V05,
3282    V06,
3283    V07,
3284    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3285    Unknown(String),
3286}
3287impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
3288    pub fn as_str(&self) -> &str {
3289        use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
3290        match self {
3291            V01 => "01",
3292            V02 => "02",
3293            V05 => "05",
3294            V06 => "06",
3295            V07 => "07",
3296            Unknown(v) => v,
3297        }
3298    }
3299}
3300
3301impl std::str::FromStr
3302    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
3303{
3304    type Err = std::convert::Infallible;
3305    fn from_str(s: &str) -> Result<Self, Self::Err> {
3306        use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
3307        match s {
3308            "01" => Ok(V01),
3309            "02" => Ok(V02),
3310            "05" => Ok(V05),
3311            "06" => Ok(V06),
3312            "07" => Ok(V07),
3313            v => {
3314                tracing::warn!(
3315                    "Unknown value '{}' for enum '{}'",
3316                    v,
3317                    "CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"
3318                );
3319                Ok(Unknown(v.to_owned()))
3320            }
3321        }
3322    }
3323}
3324impl std::fmt::Display
3325    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
3326{
3327    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3328        f.write_str(self.as_str())
3329    }
3330}
3331
3332impl std::fmt::Debug
3333    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
3334{
3335    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3336        f.write_str(self.as_str())
3337    }
3338}
3339impl serde::Serialize
3340    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
3341{
3342    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3343    where
3344        S: serde::Serializer,
3345    {
3346        serializer.serialize_str(self.as_str())
3347    }
3348}
3349#[cfg(feature = "deserialize")]
3350impl<'de> serde::Deserialize<'de>
3351    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
3352{
3353    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3354        use std::str::FromStr;
3355        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3356        Ok(Self::from_str(&s).expect("infallible"))
3357    }
3358}
3359/// Network specific 3DS fields. Network specific arguments require an
3360/// explicit card brand choice. The parameter `payment_method_options.card.network``
3361/// must be populated accordingly
3362#[derive(Clone, Debug, serde::Serialize)]
3363pub struct CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
3364    /// Cartes Bancaires-specific 3DS fields.
3365    #[serde(skip_serializing_if = "Option::is_none")]
3366    pub cartes_bancaires:
3367        Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires>,
3368}
3369impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
3370    pub fn new() -> Self {
3371        Self { cartes_bancaires: None }
3372    }
3373}
3374impl Default for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
3375    fn default() -> Self {
3376        Self::new()
3377    }
3378}
3379/// Cartes Bancaires-specific 3DS fields.
3380#[derive(Clone, Debug, serde::Serialize)]
3381pub struct CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
3382    /// The cryptogram calculation algorithm used by the card Issuer's ACS
3383    /// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
3384    /// messageExtension: CB-AVALGO
3385    pub cb_avalgo:
3386        CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
3387    /// The exemption indicator returned from Cartes Bancaires in the ARes.
3388    /// message extension: CB-EXEMPTION; string (4 characters)
3389    /// This is a 3 byte bitmap (low significant byte first and most significant
3390    /// bit first) that has been Base64 encoded
3391    #[serde(skip_serializing_if = "Option::is_none")]
3392    pub cb_exemption: Option<String>,
3393    /// The risk score returned from Cartes Bancaires in the ARes.
3394    /// message extension: CB-SCORE; numeric value 0-99
3395    #[serde(skip_serializing_if = "Option::is_none")]
3396    pub cb_score: Option<i64>,
3397}
3398impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
3399    pub fn new(
3400        cb_avalgo: impl Into<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
3401    ) -> Self {
3402        Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
3403    }
3404}
3405/// The cryptogram calculation algorithm used by the card Issuer's ACS
3406/// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
3407/// messageExtension: CB-AVALGO
3408#[derive(Clone, Eq, PartialEq)]
3409#[non_exhaustive]
3410pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
3411{
3412    V0,
3413    V1,
3414    V2,
3415    V3,
3416    V4,
3417    A,
3418    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3419    Unknown(String),
3420}
3421impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
3422    pub fn as_str(&self) -> &str {
3423        use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
3424        match self {
3425            V0 => "0",
3426            V1 => "1",
3427            V2 => "2",
3428            V3 => "3",
3429            V4 => "4",
3430            A => "A",
3431            Unknown(v) => v,
3432        }
3433    }
3434}
3435
3436impl std::str::FromStr
3437    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
3438{
3439    type Err = std::convert::Infallible;
3440    fn from_str(s: &str) -> Result<Self, Self::Err> {
3441        use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
3442        match s {
3443            "0" => Ok(V0),
3444            "1" => Ok(V1),
3445            "2" => Ok(V2),
3446            "3" => Ok(V3),
3447            "4" => Ok(V4),
3448            "A" => Ok(A),
3449            v => {
3450                tracing::warn!(
3451                    "Unknown value '{}' for enum '{}'",
3452                    v,
3453                    "CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"
3454                );
3455                Ok(Unknown(v.to_owned()))
3456            }
3457        }
3458    }
3459}
3460impl std::fmt::Display
3461    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
3462{
3463    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3464        f.write_str(self.as_str())
3465    }
3466}
3467
3468impl std::fmt::Debug
3469    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
3470{
3471    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3472        f.write_str(self.as_str())
3473    }
3474}
3475impl serde::Serialize
3476    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
3477{
3478    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3479    where
3480        S: serde::Serializer,
3481    {
3482        serializer.serialize_str(self.as_str())
3483    }
3484}
3485#[cfg(feature = "deserialize")]
3486impl<'de> serde::Deserialize<'de>
3487    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
3488{
3489    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3490        use std::str::FromStr;
3491        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3492        Ok(Self::from_str(&s).expect("infallible"))
3493    }
3494}
3495/// The version of 3D Secure that was performed.
3496#[derive(Clone, Eq, PartialEq)]
3497#[non_exhaustive]
3498pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3499    V1_0_2,
3500    V2_1_0,
3501    V2_2_0,
3502    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3503    Unknown(String),
3504}
3505impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3506    pub fn as_str(&self) -> &str {
3507        use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
3508        match self {
3509            V1_0_2 => "1.0.2",
3510            V2_1_0 => "2.1.0",
3511            V2_2_0 => "2.2.0",
3512            Unknown(v) => v,
3513        }
3514    }
3515}
3516
3517impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3518    type Err = std::convert::Infallible;
3519    fn from_str(s: &str) -> Result<Self, Self::Err> {
3520        use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
3521        match s {
3522            "1.0.2" => Ok(V1_0_2),
3523            "2.1.0" => Ok(V2_1_0),
3524            "2.2.0" => Ok(V2_2_0),
3525            v => {
3526                tracing::warn!(
3527                    "Unknown value '{}' for enum '{}'",
3528                    v,
3529                    "CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion"
3530                );
3531                Ok(Unknown(v.to_owned()))
3532            }
3533        }
3534    }
3535}
3536impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3537    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3538        f.write_str(self.as_str())
3539    }
3540}
3541
3542impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3543    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3544        f.write_str(self.as_str())
3545    }
3546}
3547impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3548    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3549    where
3550        S: serde::Serializer,
3551    {
3552        serializer.serialize_str(self.as_str())
3553    }
3554}
3555#[cfg(feature = "deserialize")]
3556impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3557    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3558        use std::str::FromStr;
3559        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3560        Ok(Self::from_str(&s).expect("infallible"))
3561    }
3562}
3563/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options.
3564#[derive(Clone, Debug, serde::Serialize)]
3565pub struct CreateSetupIntentPaymentMethodOptionsKlarna {
3566    /// The currency of the SetupIntent. Three letter ISO currency code.
3567    #[serde(skip_serializing_if = "Option::is_none")]
3568    pub currency: Option<stripe_types::Currency>,
3569    /// On-demand details if setting up a payment method for on-demand payments.
3570    #[serde(skip_serializing_if = "Option::is_none")]
3571    pub on_demand: Option<CreateSetupIntentPaymentMethodOptionsKlarnaOnDemand>,
3572    /// Preferred language of the Klarna authorization page that the customer is redirected to
3573    #[serde(skip_serializing_if = "Option::is_none")]
3574    pub preferred_locale: Option<CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale>,
3575    /// Subscription details if setting up or charging a subscription
3576    #[serde(skip_serializing_if = "Option::is_none")]
3577    pub subscriptions: Option<Vec<CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptions>>,
3578}
3579impl CreateSetupIntentPaymentMethodOptionsKlarna {
3580    pub fn new() -> Self {
3581        Self { currency: None, on_demand: None, preferred_locale: None, subscriptions: None }
3582    }
3583}
3584impl Default for CreateSetupIntentPaymentMethodOptionsKlarna {
3585    fn default() -> Self {
3586        Self::new()
3587    }
3588}
3589/// On-demand details if setting up a payment method for on-demand payments.
3590#[derive(Clone, Debug, serde::Serialize)]
3591pub struct CreateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
3592    /// Your average amount value.
3593    /// You can use a value across your customer base, or segment based on customer type, country, etc.
3594    #[serde(skip_serializing_if = "Option::is_none")]
3595    pub average_amount: Option<i64>,
3596    /// The maximum value you may charge a customer per purchase.
3597    /// You can use a value across your customer base, or segment based on customer type, country, etc.
3598    #[serde(skip_serializing_if = "Option::is_none")]
3599    pub maximum_amount: Option<i64>,
3600    /// The lowest or minimum value you may charge a customer per purchase.
3601    /// You can use a value across your customer base, or segment based on customer type, country, etc.
3602    #[serde(skip_serializing_if = "Option::is_none")]
3603    pub minimum_amount: Option<i64>,
3604    /// Interval at which the customer is making purchases
3605    #[serde(skip_serializing_if = "Option::is_none")]
3606    pub purchase_interval:
3607        Option<CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
3608    /// The number of `purchase_interval` between charges
3609    #[serde(skip_serializing_if = "Option::is_none")]
3610    pub purchase_interval_count: Option<u64>,
3611}
3612impl CreateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
3613    pub fn new() -> Self {
3614        Self {
3615            average_amount: None,
3616            maximum_amount: None,
3617            minimum_amount: None,
3618            purchase_interval: None,
3619            purchase_interval_count: None,
3620        }
3621    }
3622}
3623impl Default for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
3624    fn default() -> Self {
3625        Self::new()
3626    }
3627}
3628/// Interval at which the customer is making purchases
3629#[derive(Clone, Eq, PartialEq)]
3630#[non_exhaustive]
3631pub enum CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
3632    Day,
3633    Month,
3634    Week,
3635    Year,
3636    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3637    Unknown(String),
3638}
3639impl CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
3640    pub fn as_str(&self) -> &str {
3641        use CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
3642        match self {
3643            Day => "day",
3644            Month => "month",
3645            Week => "week",
3646            Year => "year",
3647            Unknown(v) => v,
3648        }
3649    }
3650}
3651
3652impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
3653    type Err = std::convert::Infallible;
3654    fn from_str(s: &str) -> Result<Self, Self::Err> {
3655        use CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
3656        match s {
3657            "day" => Ok(Day),
3658            "month" => Ok(Month),
3659            "week" => Ok(Week),
3660            "year" => Ok(Year),
3661            v => {
3662                tracing::warn!(
3663                    "Unknown value '{}' for enum '{}'",
3664                    v,
3665                    "CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"
3666                );
3667                Ok(Unknown(v.to_owned()))
3668            }
3669        }
3670    }
3671}
3672impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
3673    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3674        f.write_str(self.as_str())
3675    }
3676}
3677
3678impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
3679    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3680        f.write_str(self.as_str())
3681    }
3682}
3683impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
3684    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3685    where
3686        S: serde::Serializer,
3687    {
3688        serializer.serialize_str(self.as_str())
3689    }
3690}
3691#[cfg(feature = "deserialize")]
3692impl<'de> serde::Deserialize<'de>
3693    for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
3694{
3695    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3696        use std::str::FromStr;
3697        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3698        Ok(Self::from_str(&s).expect("infallible"))
3699    }
3700}
3701/// Preferred language of the Klarna authorization page that the customer is redirected to
3702#[derive(Clone, Eq, PartialEq)]
3703#[non_exhaustive]
3704pub enum CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3705    CsMinusCz,
3706    DaMinusDk,
3707    DeMinusAt,
3708    DeMinusCh,
3709    DeMinusDe,
3710    ElMinusGr,
3711    EnMinusAt,
3712    EnMinusAu,
3713    EnMinusBe,
3714    EnMinusCa,
3715    EnMinusCh,
3716    EnMinusCz,
3717    EnMinusDe,
3718    EnMinusDk,
3719    EnMinusEs,
3720    EnMinusFi,
3721    EnMinusFr,
3722    EnMinusGb,
3723    EnMinusGr,
3724    EnMinusIe,
3725    EnMinusIt,
3726    EnMinusNl,
3727    EnMinusNo,
3728    EnMinusNz,
3729    EnMinusPl,
3730    EnMinusPt,
3731    EnMinusRo,
3732    EnMinusSe,
3733    EnMinusUs,
3734    EsMinusEs,
3735    EsMinusUs,
3736    FiMinusFi,
3737    FrMinusBe,
3738    FrMinusCa,
3739    FrMinusCh,
3740    FrMinusFr,
3741    ItMinusCh,
3742    ItMinusIt,
3743    NbMinusNo,
3744    NlMinusBe,
3745    NlMinusNl,
3746    PlMinusPl,
3747    PtMinusPt,
3748    RoMinusRo,
3749    SvMinusFi,
3750    SvMinusSe,
3751    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3752    Unknown(String),
3753}
3754impl CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3755    pub fn as_str(&self) -> &str {
3756        use CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
3757        match self {
3758            CsMinusCz => "cs-CZ",
3759            DaMinusDk => "da-DK",
3760            DeMinusAt => "de-AT",
3761            DeMinusCh => "de-CH",
3762            DeMinusDe => "de-DE",
3763            ElMinusGr => "el-GR",
3764            EnMinusAt => "en-AT",
3765            EnMinusAu => "en-AU",
3766            EnMinusBe => "en-BE",
3767            EnMinusCa => "en-CA",
3768            EnMinusCh => "en-CH",
3769            EnMinusCz => "en-CZ",
3770            EnMinusDe => "en-DE",
3771            EnMinusDk => "en-DK",
3772            EnMinusEs => "en-ES",
3773            EnMinusFi => "en-FI",
3774            EnMinusFr => "en-FR",
3775            EnMinusGb => "en-GB",
3776            EnMinusGr => "en-GR",
3777            EnMinusIe => "en-IE",
3778            EnMinusIt => "en-IT",
3779            EnMinusNl => "en-NL",
3780            EnMinusNo => "en-NO",
3781            EnMinusNz => "en-NZ",
3782            EnMinusPl => "en-PL",
3783            EnMinusPt => "en-PT",
3784            EnMinusRo => "en-RO",
3785            EnMinusSe => "en-SE",
3786            EnMinusUs => "en-US",
3787            EsMinusEs => "es-ES",
3788            EsMinusUs => "es-US",
3789            FiMinusFi => "fi-FI",
3790            FrMinusBe => "fr-BE",
3791            FrMinusCa => "fr-CA",
3792            FrMinusCh => "fr-CH",
3793            FrMinusFr => "fr-FR",
3794            ItMinusCh => "it-CH",
3795            ItMinusIt => "it-IT",
3796            NbMinusNo => "nb-NO",
3797            NlMinusBe => "nl-BE",
3798            NlMinusNl => "nl-NL",
3799            PlMinusPl => "pl-PL",
3800            PtMinusPt => "pt-PT",
3801            RoMinusRo => "ro-RO",
3802            SvMinusFi => "sv-FI",
3803            SvMinusSe => "sv-SE",
3804            Unknown(v) => v,
3805        }
3806    }
3807}
3808
3809impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3810    type Err = std::convert::Infallible;
3811    fn from_str(s: &str) -> Result<Self, Self::Err> {
3812        use CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
3813        match s {
3814            "cs-CZ" => Ok(CsMinusCz),
3815            "da-DK" => Ok(DaMinusDk),
3816            "de-AT" => Ok(DeMinusAt),
3817            "de-CH" => Ok(DeMinusCh),
3818            "de-DE" => Ok(DeMinusDe),
3819            "el-GR" => Ok(ElMinusGr),
3820            "en-AT" => Ok(EnMinusAt),
3821            "en-AU" => Ok(EnMinusAu),
3822            "en-BE" => Ok(EnMinusBe),
3823            "en-CA" => Ok(EnMinusCa),
3824            "en-CH" => Ok(EnMinusCh),
3825            "en-CZ" => Ok(EnMinusCz),
3826            "en-DE" => Ok(EnMinusDe),
3827            "en-DK" => Ok(EnMinusDk),
3828            "en-ES" => Ok(EnMinusEs),
3829            "en-FI" => Ok(EnMinusFi),
3830            "en-FR" => Ok(EnMinusFr),
3831            "en-GB" => Ok(EnMinusGb),
3832            "en-GR" => Ok(EnMinusGr),
3833            "en-IE" => Ok(EnMinusIe),
3834            "en-IT" => Ok(EnMinusIt),
3835            "en-NL" => Ok(EnMinusNl),
3836            "en-NO" => Ok(EnMinusNo),
3837            "en-NZ" => Ok(EnMinusNz),
3838            "en-PL" => Ok(EnMinusPl),
3839            "en-PT" => Ok(EnMinusPt),
3840            "en-RO" => Ok(EnMinusRo),
3841            "en-SE" => Ok(EnMinusSe),
3842            "en-US" => Ok(EnMinusUs),
3843            "es-ES" => Ok(EsMinusEs),
3844            "es-US" => Ok(EsMinusUs),
3845            "fi-FI" => Ok(FiMinusFi),
3846            "fr-BE" => Ok(FrMinusBe),
3847            "fr-CA" => Ok(FrMinusCa),
3848            "fr-CH" => Ok(FrMinusCh),
3849            "fr-FR" => Ok(FrMinusFr),
3850            "it-CH" => Ok(ItMinusCh),
3851            "it-IT" => Ok(ItMinusIt),
3852            "nb-NO" => Ok(NbMinusNo),
3853            "nl-BE" => Ok(NlMinusBe),
3854            "nl-NL" => Ok(NlMinusNl),
3855            "pl-PL" => Ok(PlMinusPl),
3856            "pt-PT" => Ok(PtMinusPt),
3857            "ro-RO" => Ok(RoMinusRo),
3858            "sv-FI" => Ok(SvMinusFi),
3859            "sv-SE" => Ok(SvMinusSe),
3860            v => {
3861                tracing::warn!(
3862                    "Unknown value '{}' for enum '{}'",
3863                    v,
3864                    "CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale"
3865                );
3866                Ok(Unknown(v.to_owned()))
3867            }
3868        }
3869    }
3870}
3871impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3872    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3873        f.write_str(self.as_str())
3874    }
3875}
3876
3877impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3878    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3879        f.write_str(self.as_str())
3880    }
3881}
3882impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3883    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3884    where
3885        S: serde::Serializer,
3886    {
3887        serializer.serialize_str(self.as_str())
3888    }
3889}
3890#[cfg(feature = "deserialize")]
3891impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3892    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3893        use std::str::FromStr;
3894        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3895        Ok(Self::from_str(&s).expect("infallible"))
3896    }
3897}
3898/// Subscription details if setting up or charging a subscription
3899#[derive(Clone, Debug, serde::Serialize)]
3900pub struct CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
3901    /// Unit of time between subscription charges.
3902    pub interval: CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
3903    /// The number of intervals (specified in the `interval` attribute) between subscription charges.
3904    /// For example, `interval=month` and `interval_count=3` charges every 3 months.
3905    #[serde(skip_serializing_if = "Option::is_none")]
3906    pub interval_count: Option<u64>,
3907    /// Name for subscription.
3908    #[serde(skip_serializing_if = "Option::is_none")]
3909    pub name: Option<String>,
3910    /// Describes the upcoming charge for this subscription.
3911    pub next_billing: SubscriptionNextBillingParam,
3912    /// A non-customer-facing reference to correlate subscription charges in the Klarna app.
3913    /// Use a value that persists across subscription charges.
3914    pub reference: String,
3915}
3916impl CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
3917    pub fn new(
3918        interval: impl Into<CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
3919        next_billing: impl Into<SubscriptionNextBillingParam>,
3920        reference: impl Into<String>,
3921    ) -> Self {
3922        Self {
3923            interval: interval.into(),
3924            interval_count: None,
3925            name: None,
3926            next_billing: next_billing.into(),
3927            reference: reference.into(),
3928        }
3929    }
3930}
3931/// Unit of time between subscription charges.
3932#[derive(Clone, Eq, PartialEq)]
3933#[non_exhaustive]
3934pub enum CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
3935    Day,
3936    Month,
3937    Week,
3938    Year,
3939    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3940    Unknown(String),
3941}
3942impl CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
3943    pub fn as_str(&self) -> &str {
3944        use CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
3945        match self {
3946            Day => "day",
3947            Month => "month",
3948            Week => "week",
3949            Year => "year",
3950            Unknown(v) => v,
3951        }
3952    }
3953}
3954
3955impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
3956    type Err = std::convert::Infallible;
3957    fn from_str(s: &str) -> Result<Self, Self::Err> {
3958        use CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
3959        match s {
3960            "day" => Ok(Day),
3961            "month" => Ok(Month),
3962            "week" => Ok(Week),
3963            "year" => Ok(Year),
3964            v => {
3965                tracing::warn!(
3966                    "Unknown value '{}' for enum '{}'",
3967                    v,
3968                    "CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"
3969                );
3970                Ok(Unknown(v.to_owned()))
3971            }
3972        }
3973    }
3974}
3975impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
3976    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3977        f.write_str(self.as_str())
3978    }
3979}
3980
3981impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
3982    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3983        f.write_str(self.as_str())
3984    }
3985}
3986impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
3987    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3988    where
3989        S: serde::Serializer,
3990    {
3991        serializer.serialize_str(self.as_str())
3992    }
3993}
3994#[cfg(feature = "deserialize")]
3995impl<'de> serde::Deserialize<'de>
3996    for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
3997{
3998    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3999        use std::str::FromStr;
4000        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4001        Ok(Self::from_str(&s).expect("infallible"))
4002    }
4003}
4004/// If this is a `payto` SetupIntent, this sub-hash contains details about the PayTo payment method options.
4005#[derive(Clone, Debug, serde::Serialize)]
4006pub struct CreateSetupIntentPaymentMethodOptionsPayto {
4007    /// Additional fields for Mandate creation.
4008    #[serde(skip_serializing_if = "Option::is_none")]
4009    pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsPaytoMandateOptions>,
4010}
4011impl CreateSetupIntentPaymentMethodOptionsPayto {
4012    pub fn new() -> Self {
4013        Self { mandate_options: None }
4014    }
4015}
4016impl Default for CreateSetupIntentPaymentMethodOptionsPayto {
4017    fn default() -> Self {
4018        Self::new()
4019    }
4020}
4021/// Additional fields for Mandate creation.
4022#[derive(Clone, Debug, serde::Serialize)]
4023pub struct CreateSetupIntentPaymentMethodOptionsPaytoMandateOptions {
4024    /// Amount that will be collected. It is required when `amount_type` is `fixed`.
4025    #[serde(skip_serializing_if = "Option::is_none")]
4026    pub amount: Option<i64>,
4027    /// The type of amount that will be collected.
4028    /// The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively.
4029    /// Defaults to `maximum`.
4030    #[serde(skip_serializing_if = "Option::is_none")]
4031    pub amount_type: Option<CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType>,
4032    /// Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date.
4033    #[serde(skip_serializing_if = "Option::is_none")]
4034    pub end_date: Option<String>,
4035    /// The periodicity at which payments will be collected. Defaults to `adhoc`.
4036    #[serde(skip_serializing_if = "Option::is_none")]
4037    pub payment_schedule:
4038        Option<CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule>,
4039    /// The number of payments that will be made during a payment period.
4040    /// Defaults to 1 except for when `payment_schedule` is `adhoc`.
4041    /// In that case, it defaults to no limit.
4042    #[serde(skip_serializing_if = "Option::is_none")]
4043    pub payments_per_period: Option<i64>,
4044    /// The purpose for which payments are made. Has a default value based on your merchant category code.
4045    #[serde(skip_serializing_if = "Option::is_none")]
4046    pub purpose: Option<CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose>,
4047    /// Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to confirmation time.
4048    #[serde(skip_serializing_if = "Option::is_none")]
4049    pub start_date: Option<String>,
4050}
4051impl CreateSetupIntentPaymentMethodOptionsPaytoMandateOptions {
4052    pub fn new() -> Self {
4053        Self {
4054            amount: None,
4055            amount_type: None,
4056            end_date: None,
4057            payment_schedule: None,
4058            payments_per_period: None,
4059            purpose: None,
4060            start_date: None,
4061        }
4062    }
4063}
4064impl Default for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptions {
4065    fn default() -> Self {
4066        Self::new()
4067    }
4068}
4069/// The type of amount that will be collected.
4070/// The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively.
4071/// Defaults to `maximum`.
4072#[derive(Clone, Eq, PartialEq)]
4073#[non_exhaustive]
4074pub enum CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
4075    Fixed,
4076    Maximum,
4077    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4078    Unknown(String),
4079}
4080impl CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
4081    pub fn as_str(&self) -> &str {
4082        use CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType::*;
4083        match self {
4084            Fixed => "fixed",
4085            Maximum => "maximum",
4086            Unknown(v) => v,
4087        }
4088    }
4089}
4090
4091impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
4092    type Err = std::convert::Infallible;
4093    fn from_str(s: &str) -> Result<Self, Self::Err> {
4094        use CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType::*;
4095        match s {
4096            "fixed" => Ok(Fixed),
4097            "maximum" => Ok(Maximum),
4098            v => {
4099                tracing::warn!(
4100                    "Unknown value '{}' for enum '{}'",
4101                    v,
4102                    "CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType"
4103                );
4104                Ok(Unknown(v.to_owned()))
4105            }
4106        }
4107    }
4108}
4109impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
4110    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4111        f.write_str(self.as_str())
4112    }
4113}
4114
4115impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
4116    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4117        f.write_str(self.as_str())
4118    }
4119}
4120impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
4121    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4122    where
4123        S: serde::Serializer,
4124    {
4125        serializer.serialize_str(self.as_str())
4126    }
4127}
4128#[cfg(feature = "deserialize")]
4129impl<'de> serde::Deserialize<'de>
4130    for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType
4131{
4132    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4133        use std::str::FromStr;
4134        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4135        Ok(Self::from_str(&s).expect("infallible"))
4136    }
4137}
4138/// The periodicity at which payments will be collected. Defaults to `adhoc`.
4139#[derive(Clone, Eq, PartialEq)]
4140#[non_exhaustive]
4141pub enum CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
4142    Adhoc,
4143    Annual,
4144    Daily,
4145    Fortnightly,
4146    Monthly,
4147    Quarterly,
4148    SemiAnnual,
4149    Weekly,
4150    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4151    Unknown(String),
4152}
4153impl CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
4154    pub fn as_str(&self) -> &str {
4155        use CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule::*;
4156        match self {
4157            Adhoc => "adhoc",
4158            Annual => "annual",
4159            Daily => "daily",
4160            Fortnightly => "fortnightly",
4161            Monthly => "monthly",
4162            Quarterly => "quarterly",
4163            SemiAnnual => "semi_annual",
4164            Weekly => "weekly",
4165            Unknown(v) => v,
4166        }
4167    }
4168}
4169
4170impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
4171    type Err = std::convert::Infallible;
4172    fn from_str(s: &str) -> Result<Self, Self::Err> {
4173        use CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule::*;
4174        match s {
4175            "adhoc" => Ok(Adhoc),
4176            "annual" => Ok(Annual),
4177            "daily" => Ok(Daily),
4178            "fortnightly" => Ok(Fortnightly),
4179            "monthly" => Ok(Monthly),
4180            "quarterly" => Ok(Quarterly),
4181            "semi_annual" => Ok(SemiAnnual),
4182            "weekly" => Ok(Weekly),
4183            v => {
4184                tracing::warn!(
4185                    "Unknown value '{}' for enum '{}'",
4186                    v,
4187                    "CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule"
4188                );
4189                Ok(Unknown(v.to_owned()))
4190            }
4191        }
4192    }
4193}
4194impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
4195    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4196        f.write_str(self.as_str())
4197    }
4198}
4199
4200impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
4201    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4202        f.write_str(self.as_str())
4203    }
4204}
4205impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
4206    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4207    where
4208        S: serde::Serializer,
4209    {
4210        serializer.serialize_str(self.as_str())
4211    }
4212}
4213#[cfg(feature = "deserialize")]
4214impl<'de> serde::Deserialize<'de>
4215    for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule
4216{
4217    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4218        use std::str::FromStr;
4219        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4220        Ok(Self::from_str(&s).expect("infallible"))
4221    }
4222}
4223/// The purpose for which payments are made. Has a default value based on your merchant category code.
4224#[derive(Clone, Eq, PartialEq)]
4225#[non_exhaustive]
4226pub enum CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
4227    DependantSupport,
4228    Government,
4229    Loan,
4230    Mortgage,
4231    Other,
4232    Pension,
4233    Personal,
4234    Retail,
4235    Salary,
4236    Tax,
4237    Utility,
4238    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4239    Unknown(String),
4240}
4241impl CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
4242    pub fn as_str(&self) -> &str {
4243        use CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose::*;
4244        match self {
4245            DependantSupport => "dependant_support",
4246            Government => "government",
4247            Loan => "loan",
4248            Mortgage => "mortgage",
4249            Other => "other",
4250            Pension => "pension",
4251            Personal => "personal",
4252            Retail => "retail",
4253            Salary => "salary",
4254            Tax => "tax",
4255            Utility => "utility",
4256            Unknown(v) => v,
4257        }
4258    }
4259}
4260
4261impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
4262    type Err = std::convert::Infallible;
4263    fn from_str(s: &str) -> Result<Self, Self::Err> {
4264        use CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose::*;
4265        match s {
4266            "dependant_support" => Ok(DependantSupport),
4267            "government" => Ok(Government),
4268            "loan" => Ok(Loan),
4269            "mortgage" => Ok(Mortgage),
4270            "other" => Ok(Other),
4271            "pension" => Ok(Pension),
4272            "personal" => Ok(Personal),
4273            "retail" => Ok(Retail),
4274            "salary" => Ok(Salary),
4275            "tax" => Ok(Tax),
4276            "utility" => Ok(Utility),
4277            v => {
4278                tracing::warn!(
4279                    "Unknown value '{}' for enum '{}'",
4280                    v,
4281                    "CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose"
4282                );
4283                Ok(Unknown(v.to_owned()))
4284            }
4285        }
4286    }
4287}
4288impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
4289    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4290        f.write_str(self.as_str())
4291    }
4292}
4293
4294impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
4295    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4296        f.write_str(self.as_str())
4297    }
4298}
4299impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
4300    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4301    where
4302        S: serde::Serializer,
4303    {
4304        serializer.serialize_str(self.as_str())
4305    }
4306}
4307#[cfg(feature = "deserialize")]
4308impl<'de> serde::Deserialize<'de>
4309    for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose
4310{
4311    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4312        use std::str::FromStr;
4313        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4314        Ok(Self::from_str(&s).expect("infallible"))
4315    }
4316}
4317/// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options.
4318#[derive(Clone, Debug, serde::Serialize)]
4319pub struct CreateSetupIntentPaymentMethodOptionsSepaDebit {
4320    /// Additional fields for Mandate creation
4321    #[serde(skip_serializing_if = "Option::is_none")]
4322    pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions>,
4323}
4324impl CreateSetupIntentPaymentMethodOptionsSepaDebit {
4325    pub fn new() -> Self {
4326        Self { mandate_options: None }
4327    }
4328}
4329impl Default for CreateSetupIntentPaymentMethodOptionsSepaDebit {
4330    fn default() -> Self {
4331        Self::new()
4332    }
4333}
4334/// Additional fields for Mandate creation
4335#[derive(Clone, Debug, serde::Serialize)]
4336pub struct CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
4337    /// Prefix used to generate the Mandate reference.
4338    /// Must be at most 12 characters long.
4339    /// Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'.
4340    /// Cannot begin with 'STRIPE'.
4341    #[serde(skip_serializing_if = "Option::is_none")]
4342    pub reference_prefix: Option<String>,
4343}
4344impl CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
4345    pub fn new() -> Self {
4346        Self { reference_prefix: None }
4347    }
4348}
4349impl Default for CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
4350    fn default() -> Self {
4351        Self::new()
4352    }
4353}
4354/// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options.
4355#[derive(Clone, Debug, serde::Serialize)]
4356pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccount {
4357    /// Additional fields for Financial Connections Session creation
4358    #[serde(skip_serializing_if = "Option::is_none")]
4359    pub financial_connections:
4360        Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
4361    /// Additional fields for Mandate creation
4362    #[serde(skip_serializing_if = "Option::is_none")]
4363    pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
4364    /// Additional fields for network related functions
4365    #[serde(skip_serializing_if = "Option::is_none")]
4366    pub networks: Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks>,
4367    /// Bank account verification method.
4368    #[serde(skip_serializing_if = "Option::is_none")]
4369    pub verification_method:
4370        Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
4371}
4372impl CreateSetupIntentPaymentMethodOptionsUsBankAccount {
4373    pub fn new() -> Self {
4374        Self {
4375            financial_connections: None,
4376            mandate_options: None,
4377            networks: None,
4378            verification_method: None,
4379        }
4380    }
4381}
4382impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccount {
4383    fn default() -> Self {
4384        Self::new()
4385    }
4386}
4387/// Additional fields for Financial Connections Session creation
4388#[derive(Clone, Debug, serde::Serialize)]
4389pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
4390    /// Provide filters for the linked accounts that the customer can select for the payment method.
4391    #[serde(skip_serializing_if = "Option::is_none")]
4392    pub filters:
4393        Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
4394    /// The list of permissions to request.
4395    /// If this parameter is passed, the `payment_method` permission must be included.
4396    /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
4397    #[serde(skip_serializing_if = "Option::is_none")]
4398    pub permissions: Option<
4399        Vec<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
4400    >,
4401    /// List of data features that you would like to retrieve upon account creation.
4402    #[serde(skip_serializing_if = "Option::is_none")]
4403    pub prefetch:
4404        Option<Vec<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>>,
4405    /// For webview integrations only.
4406    /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.
4407    #[serde(skip_serializing_if = "Option::is_none")]
4408    pub return_url: Option<String>,
4409}
4410impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
4411    pub fn new() -> Self {
4412        Self { filters: None, permissions: None, prefetch: None, return_url: None }
4413    }
4414}
4415impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
4416    fn default() -> Self {
4417        Self::new()
4418    }
4419}
4420/// Provide filters for the linked accounts that the customer can select for the payment method.
4421#[derive(Clone, Debug, serde::Serialize)]
4422pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
4423        /// The account subcategories to use to filter for selectable accounts.
4424    /// Valid subcategories are `checking` and `savings`.
4425#[serde(skip_serializing_if = "Option::is_none")]
4426pub account_subcategories: Option<Vec<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
4427
4428}
4429impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
4430    pub fn new() -> Self {
4431        Self { account_subcategories: None }
4432    }
4433}
4434impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
4435    fn default() -> Self {
4436        Self::new()
4437    }
4438}
4439/// The account subcategories to use to filter for selectable accounts.
4440/// Valid subcategories are `checking` and `savings`.
4441#[derive(Clone, Eq, PartialEq)]
4442#[non_exhaustive]
4443pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
4444{
4445    Checking,
4446    Savings,
4447    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4448    Unknown(String),
4449}
4450impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
4451    pub fn as_str(&self) -> &str {
4452        use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
4453        match self {
4454Checking => "checking",
4455Savings => "savings",
4456Unknown(v) => v,
4457
4458        }
4459    }
4460}
4461
4462impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
4463    type Err = std::convert::Infallible;
4464    fn from_str(s: &str) -> Result<Self, Self::Err> {
4465        use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
4466        match s {
4467    "checking" => Ok(Checking),
4468"savings" => Ok(Savings),
4469v => { tracing::warn!("Unknown value '{}' for enum '{}'", v, "CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"); Ok(Unknown(v.to_owned())) }
4470
4471        }
4472    }
4473}
4474impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
4475    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4476        f.write_str(self.as_str())
4477    }
4478}
4479
4480impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
4481    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4482        f.write_str(self.as_str())
4483    }
4484}
4485impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
4486    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
4487        serializer.serialize_str(self.as_str())
4488    }
4489}
4490#[cfg(feature = "deserialize")]
4491impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
4492    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4493        use std::str::FromStr;
4494        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4495        Ok(Self::from_str(&s).expect("infallible"))
4496    }
4497}
4498/// The list of permissions to request.
4499/// If this parameter is passed, the `payment_method` permission must be included.
4500/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
4501#[derive(Clone, Eq, PartialEq)]
4502#[non_exhaustive]
4503pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
4504    Balances,
4505    Ownership,
4506    PaymentMethod,
4507    Transactions,
4508    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4509    Unknown(String),
4510}
4511impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
4512    pub fn as_str(&self) -> &str {
4513        use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
4514        match self {
4515            Balances => "balances",
4516            Ownership => "ownership",
4517            PaymentMethod => "payment_method",
4518            Transactions => "transactions",
4519            Unknown(v) => v,
4520        }
4521    }
4522}
4523
4524impl std::str::FromStr
4525    for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
4526{
4527    type Err = std::convert::Infallible;
4528    fn from_str(s: &str) -> Result<Self, Self::Err> {
4529        use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
4530        match s {
4531            "balances" => Ok(Balances),
4532            "ownership" => Ok(Ownership),
4533            "payment_method" => Ok(PaymentMethod),
4534            "transactions" => Ok(Transactions),
4535            v => {
4536                tracing::warn!(
4537                    "Unknown value '{}' for enum '{}'",
4538                    v,
4539                    "CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"
4540                );
4541                Ok(Unknown(v.to_owned()))
4542            }
4543        }
4544    }
4545}
4546impl std::fmt::Display
4547    for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
4548{
4549    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4550        f.write_str(self.as_str())
4551    }
4552}
4553
4554impl std::fmt::Debug
4555    for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
4556{
4557    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4558        f.write_str(self.as_str())
4559    }
4560}
4561impl serde::Serialize
4562    for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
4563{
4564    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4565    where
4566        S: serde::Serializer,
4567    {
4568        serializer.serialize_str(self.as_str())
4569    }
4570}
4571#[cfg(feature = "deserialize")]
4572impl<'de> serde::Deserialize<'de>
4573    for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
4574{
4575    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4576        use std::str::FromStr;
4577        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4578        Ok(Self::from_str(&s).expect("infallible"))
4579    }
4580}
4581/// List of data features that you would like to retrieve upon account creation.
4582#[derive(Clone, Eq, PartialEq)]
4583#[non_exhaustive]
4584pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
4585    Balances,
4586    Ownership,
4587    Transactions,
4588    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4589    Unknown(String),
4590}
4591impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
4592    pub fn as_str(&self) -> &str {
4593        use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
4594        match self {
4595            Balances => "balances",
4596            Ownership => "ownership",
4597            Transactions => "transactions",
4598            Unknown(v) => v,
4599        }
4600    }
4601}
4602
4603impl std::str::FromStr
4604    for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
4605{
4606    type Err = std::convert::Infallible;
4607    fn from_str(s: &str) -> Result<Self, Self::Err> {
4608        use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
4609        match s {
4610            "balances" => Ok(Balances),
4611            "ownership" => Ok(Ownership),
4612            "transactions" => Ok(Transactions),
4613            v => {
4614                tracing::warn!(
4615                    "Unknown value '{}' for enum '{}'",
4616                    v,
4617                    "CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"
4618                );
4619                Ok(Unknown(v.to_owned()))
4620            }
4621        }
4622    }
4623}
4624impl std::fmt::Display
4625    for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
4626{
4627    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4628        f.write_str(self.as_str())
4629    }
4630}
4631
4632impl std::fmt::Debug
4633    for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
4634{
4635    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4636        f.write_str(self.as_str())
4637    }
4638}
4639impl serde::Serialize
4640    for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
4641{
4642    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4643    where
4644        S: serde::Serializer,
4645    {
4646        serializer.serialize_str(self.as_str())
4647    }
4648}
4649#[cfg(feature = "deserialize")]
4650impl<'de> serde::Deserialize<'de>
4651    for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
4652{
4653    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4654        use std::str::FromStr;
4655        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4656        Ok(Self::from_str(&s).expect("infallible"))
4657    }
4658}
4659/// Additional fields for Mandate creation
4660#[derive(Clone, Debug, serde::Serialize)]
4661pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
4662    /// The method used to collect offline mandate customer acceptance.
4663    #[serde(skip_serializing_if = "Option::is_none")]
4664    pub collection_method:
4665        Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
4666}
4667impl CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
4668    pub fn new() -> Self {
4669        Self { collection_method: None }
4670    }
4671}
4672impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
4673    fn default() -> Self {
4674        Self::new()
4675    }
4676}
4677/// The method used to collect offline mandate customer acceptance.
4678#[derive(Clone, Eq, PartialEq)]
4679#[non_exhaustive]
4680pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
4681    Paper,
4682    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4683    Unknown(String),
4684}
4685impl CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
4686    pub fn as_str(&self) -> &str {
4687        use CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
4688        match self {
4689            Paper => "paper",
4690            Unknown(v) => v,
4691        }
4692    }
4693}
4694
4695impl std::str::FromStr
4696    for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
4697{
4698    type Err = std::convert::Infallible;
4699    fn from_str(s: &str) -> Result<Self, Self::Err> {
4700        use CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
4701        match s {
4702            "paper" => Ok(Paper),
4703            v => {
4704                tracing::warn!(
4705                    "Unknown value '{}' for enum '{}'",
4706                    v,
4707                    "CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"
4708                );
4709                Ok(Unknown(v.to_owned()))
4710            }
4711        }
4712    }
4713}
4714impl std::fmt::Display
4715    for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
4716{
4717    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4718        f.write_str(self.as_str())
4719    }
4720}
4721
4722impl std::fmt::Debug
4723    for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
4724{
4725    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4726        f.write_str(self.as_str())
4727    }
4728}
4729impl serde::Serialize
4730    for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
4731{
4732    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4733    where
4734        S: serde::Serializer,
4735    {
4736        serializer.serialize_str(self.as_str())
4737    }
4738}
4739#[cfg(feature = "deserialize")]
4740impl<'de> serde::Deserialize<'de>
4741    for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
4742{
4743    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4744        use std::str::FromStr;
4745        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4746        Ok(Self::from_str(&s).expect("infallible"))
4747    }
4748}
4749/// Additional fields for network related functions
4750#[derive(Clone, Debug, serde::Serialize)]
4751pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
4752    /// Triggers validations to run across the selected networks
4753    #[serde(skip_serializing_if = "Option::is_none")]
4754    pub requested: Option<Vec<CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
4755}
4756impl CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
4757    pub fn new() -> Self {
4758        Self { requested: None }
4759    }
4760}
4761impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
4762    fn default() -> Self {
4763        Self::new()
4764    }
4765}
4766/// Triggers validations to run across the selected networks
4767#[derive(Clone, Eq, PartialEq)]
4768#[non_exhaustive]
4769pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
4770    Ach,
4771    UsDomesticWire,
4772    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4773    Unknown(String),
4774}
4775impl CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
4776    pub fn as_str(&self) -> &str {
4777        use CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
4778        match self {
4779            Ach => "ach",
4780            UsDomesticWire => "us_domestic_wire",
4781            Unknown(v) => v,
4782        }
4783    }
4784}
4785
4786impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
4787    type Err = std::convert::Infallible;
4788    fn from_str(s: &str) -> Result<Self, Self::Err> {
4789        use CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
4790        match s {
4791            "ach" => Ok(Ach),
4792            "us_domestic_wire" => Ok(UsDomesticWire),
4793            v => {
4794                tracing::warn!(
4795                    "Unknown value '{}' for enum '{}'",
4796                    v,
4797                    "CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested"
4798                );
4799                Ok(Unknown(v.to_owned()))
4800            }
4801        }
4802    }
4803}
4804impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
4805    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4806        f.write_str(self.as_str())
4807    }
4808}
4809
4810impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
4811    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4812        f.write_str(self.as_str())
4813    }
4814}
4815impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
4816    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4817    where
4818        S: serde::Serializer,
4819    {
4820        serializer.serialize_str(self.as_str())
4821    }
4822}
4823#[cfg(feature = "deserialize")]
4824impl<'de> serde::Deserialize<'de>
4825    for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested
4826{
4827    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4828        use std::str::FromStr;
4829        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4830        Ok(Self::from_str(&s).expect("infallible"))
4831    }
4832}
4833/// Bank account verification method.
4834#[derive(Clone, Eq, PartialEq)]
4835#[non_exhaustive]
4836pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
4837    Automatic,
4838    Instant,
4839    Microdeposits,
4840    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4841    Unknown(String),
4842}
4843impl CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
4844    pub fn as_str(&self) -> &str {
4845        use CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
4846        match self {
4847            Automatic => "automatic",
4848            Instant => "instant",
4849            Microdeposits => "microdeposits",
4850            Unknown(v) => v,
4851        }
4852    }
4853}
4854
4855impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
4856    type Err = std::convert::Infallible;
4857    fn from_str(s: &str) -> Result<Self, Self::Err> {
4858        use CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
4859        match s {
4860            "automatic" => Ok(Automatic),
4861            "instant" => Ok(Instant),
4862            "microdeposits" => Ok(Microdeposits),
4863            v => {
4864                tracing::warn!(
4865                    "Unknown value '{}' for enum '{}'",
4866                    v,
4867                    "CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod"
4868                );
4869                Ok(Unknown(v.to_owned()))
4870            }
4871        }
4872    }
4873}
4874impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
4875    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4876        f.write_str(self.as_str())
4877    }
4878}
4879
4880impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
4881    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4882        f.write_str(self.as_str())
4883    }
4884}
4885impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
4886    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4887    where
4888        S: serde::Serializer,
4889    {
4890        serializer.serialize_str(self.as_str())
4891    }
4892}
4893#[cfg(feature = "deserialize")]
4894impl<'de> serde::Deserialize<'de>
4895    for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod
4896{
4897    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4898        use std::str::FromStr;
4899        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4900        Ok(Self::from_str(&s).expect("infallible"))
4901    }
4902}
4903/// If you populate this hash, this SetupIntent generates a `single_use` mandate after successful completion.
4904///
4905/// Single-use mandates are only valid for the following payment methods: `acss_debit`, `alipay`, `au_becs_debit`, `bacs_debit`, `bancontact`, `boleto`, `ideal`, `link`, `sepa_debit`, and `us_bank_account`.
4906#[derive(Clone, Debug, serde::Serialize)]
4907pub struct CreateSetupIntentSingleUse {
4908    /// Amount the customer is granting permission to collect later.
4909    /// A positive integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency).
4910    /// The minimum amount is $0.50 US or [equivalent in charge currency](https://docs.stripe.com/currencies#minimum-and-maximum-charge-amounts).
4911    /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
4912    pub amount: i64,
4913    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
4914    /// Must be a [supported currency](https://stripe.com/docs/currencies).
4915    pub currency: stripe_types::Currency,
4916}
4917impl CreateSetupIntentSingleUse {
4918    pub fn new(amount: impl Into<i64>, currency: impl Into<stripe_types::Currency>) -> Self {
4919        Self { amount: amount.into(), currency: currency.into() }
4920    }
4921}
4922/// Indicates how the payment method is intended to be used in the future.
4923/// If not provided, this value defaults to `off_session`.
4924#[derive(Clone, Eq, PartialEq)]
4925#[non_exhaustive]
4926pub enum CreateSetupIntentUsage {
4927    OffSession,
4928    OnSession,
4929    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4930    Unknown(String),
4931}
4932impl CreateSetupIntentUsage {
4933    pub fn as_str(&self) -> &str {
4934        use CreateSetupIntentUsage::*;
4935        match self {
4936            OffSession => "off_session",
4937            OnSession => "on_session",
4938            Unknown(v) => v,
4939        }
4940    }
4941}
4942
4943impl std::str::FromStr for CreateSetupIntentUsage {
4944    type Err = std::convert::Infallible;
4945    fn from_str(s: &str) -> Result<Self, Self::Err> {
4946        use CreateSetupIntentUsage::*;
4947        match s {
4948            "off_session" => Ok(OffSession),
4949            "on_session" => Ok(OnSession),
4950            v => {
4951                tracing::warn!("Unknown value '{}' for enum '{}'", v, "CreateSetupIntentUsage");
4952                Ok(Unknown(v.to_owned()))
4953            }
4954        }
4955    }
4956}
4957impl std::fmt::Display for CreateSetupIntentUsage {
4958    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4959        f.write_str(self.as_str())
4960    }
4961}
4962
4963impl std::fmt::Debug for CreateSetupIntentUsage {
4964    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4965        f.write_str(self.as_str())
4966    }
4967}
4968impl serde::Serialize for CreateSetupIntentUsage {
4969    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4970    where
4971        S: serde::Serializer,
4972    {
4973        serializer.serialize_str(self.as_str())
4974    }
4975}
4976#[cfg(feature = "deserialize")]
4977impl<'de> serde::Deserialize<'de> for CreateSetupIntentUsage {
4978    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4979        use std::str::FromStr;
4980        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4981        Ok(Self::from_str(&s).expect("infallible"))
4982    }
4983}
4984/// Creates a SetupIntent object.
4985///
4986/// After you create the SetupIntent, attach a payment method and [confirm](https://stripe.com/docs/api/setup_intents/confirm).
4987/// it to collect any required permissions to charge the payment method later.
4988#[derive(Clone, Debug, serde::Serialize)]
4989pub struct CreateSetupIntent {
4990    inner: CreateSetupIntentBuilder,
4991}
4992impl CreateSetupIntent {
4993    /// Construct a new `CreateSetupIntent`.
4994    pub fn new() -> Self {
4995        Self { inner: CreateSetupIntentBuilder::new() }
4996    }
4997    /// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.
4998    ///
4999    /// It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers.
5000    /// It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.
5001    pub fn attach_to_self(mut self, attach_to_self: impl Into<bool>) -> Self {
5002        self.inner.attach_to_self = Some(attach_to_self.into());
5003        self
5004    }
5005    /// When you enable this parameter, this SetupIntent accepts payment methods that you enable in the Dashboard and that are compatible with its other parameters.
5006    pub fn automatic_payment_methods(
5007        mut self,
5008        automatic_payment_methods: impl Into<CreateSetupIntentAutomaticPaymentMethods>,
5009    ) -> Self {
5010        self.inner.automatic_payment_methods = Some(automatic_payment_methods.into());
5011        self
5012    }
5013    /// Set to `true` to attempt to confirm this SetupIntent immediately.
5014    /// This parameter defaults to `false`.
5015    /// If a card is the attached payment method, you can provide a `return_url` in case further authentication is necessary.
5016    pub fn confirm(mut self, confirm: impl Into<bool>) -> Self {
5017        self.inner.confirm = Some(confirm.into());
5018        self
5019    }
5020    /// ID of the ConfirmationToken used to confirm this SetupIntent.
5021    ///
5022    /// 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.
5023    pub fn confirmation_token(mut self, confirmation_token: impl Into<String>) -> Self {
5024        self.inner.confirmation_token = Some(confirmation_token.into());
5025        self
5026    }
5027    /// ID of the Customer this SetupIntent belongs to, if one exists.
5028    ///
5029    /// If present, the SetupIntent's payment method will be attached to the Customer on successful setup.
5030    /// Payment methods attached to other Customers cannot be used with this SetupIntent.
5031    pub fn customer(mut self, customer: impl Into<String>) -> Self {
5032        self.inner.customer = Some(customer.into());
5033        self
5034    }
5035    /// ID of the Account this SetupIntent belongs to, if one exists.
5036    ///
5037    /// If present, the SetupIntent's payment method will be attached to the Account on successful setup.
5038    /// Payment methods attached to other Accounts cannot be used with this SetupIntent.
5039    pub fn customer_account(mut self, customer_account: impl Into<String>) -> Self {
5040        self.inner.customer_account = Some(customer_account.into());
5041        self
5042    }
5043    /// An arbitrary string attached to the object. Often useful for displaying to users.
5044    pub fn description(mut self, description: impl Into<String>) -> Self {
5045        self.inner.description = Some(description.into());
5046        self
5047    }
5048    /// The list of payment method types to exclude from use with this SetupIntent.
5049    pub fn excluded_payment_method_types(
5050        mut self,
5051        excluded_payment_method_types: impl Into<
5052            Vec<stripe_shared::SetupIntentExcludedPaymentMethodTypes>,
5053        >,
5054    ) -> Self {
5055        self.inner.excluded_payment_method_types = Some(excluded_payment_method_types.into());
5056        self
5057    }
5058    /// Specifies which fields in the response should be expanded.
5059    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
5060        self.inner.expand = Some(expand.into());
5061        self
5062    }
5063    /// Indicates the directions of money movement for which this payment method is intended to be used.
5064    ///
5065    /// Include `inbound` if you intend to use the payment method as the origin to pull funds from.
5066    /// Include `outbound` if you intend to use the payment method as the destination to send funds to.
5067    /// You can include both if you intend to use the payment method for both purposes.
5068    pub fn flow_directions(
5069        mut self,
5070        flow_directions: impl Into<Vec<stripe_shared::SetupIntentFlowDirections>>,
5071    ) -> Self {
5072        self.inner.flow_directions = Some(flow_directions.into());
5073        self
5074    }
5075    /// This hash contains details about the mandate to create.
5076    /// This parameter can only be used with [`confirm=true`](https://docs.stripe.com/api/setup_intents/create#create_setup_intent-confirm).
5077    pub fn mandate_data(mut self, mandate_data: impl Into<CreateSetupIntentMandateData>) -> Self {
5078        self.inner.mandate_data = Some(mandate_data.into());
5079        self
5080    }
5081    /// Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object.
5082    /// This can be useful for storing additional information about the object in a structured format.
5083    /// Individual keys can be unset by posting an empty value to them.
5084    /// All keys can be unset by posting an empty value to `metadata`.
5085    pub fn metadata(
5086        mut self,
5087        metadata: impl Into<std::collections::HashMap<String, String>>,
5088    ) -> Self {
5089        self.inner.metadata = Some(metadata.into());
5090        self
5091    }
5092    /// The Stripe account ID created for this SetupIntent.
5093    pub fn on_behalf_of(mut self, on_behalf_of: impl Into<String>) -> Self {
5094        self.inner.on_behalf_of = Some(on_behalf_of.into());
5095        self
5096    }
5097    /// ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent.
5098    pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
5099        self.inner.payment_method = Some(payment_method.into());
5100        self
5101    }
5102    /// The ID of the [payment method configuration](https://docs.stripe.com/api/payment_method_configurations) to use with this SetupIntent.
5103    pub fn payment_method_configuration(
5104        mut self,
5105        payment_method_configuration: impl Into<String>,
5106    ) -> Self {
5107        self.inner.payment_method_configuration = Some(payment_method_configuration.into());
5108        self
5109    }
5110    /// When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://docs.stripe.com/api/setup_intents/object#setup_intent_object-payment_method).
5111    /// value in the SetupIntent.
5112    pub fn payment_method_data(
5113        mut self,
5114        payment_method_data: impl Into<CreateSetupIntentPaymentMethodData>,
5115    ) -> Self {
5116        self.inner.payment_method_data = Some(payment_method_data.into());
5117        self
5118    }
5119    /// Payment method-specific configuration for this SetupIntent.
5120    pub fn payment_method_options(
5121        mut self,
5122        payment_method_options: impl Into<CreateSetupIntentPaymentMethodOptions>,
5123    ) -> Self {
5124        self.inner.payment_method_options = Some(payment_method_options.into());
5125        self
5126    }
5127    /// The list of payment method types (for example, card) that this SetupIntent can use.
5128    /// 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).
5129    /// A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type).
5130    pub fn payment_method_types(mut self, payment_method_types: impl Into<Vec<String>>) -> Self {
5131        self.inner.payment_method_types = Some(payment_method_types.into());
5132        self
5133    }
5134    /// The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site.
5135    /// To redirect to a mobile application, you can alternatively supply an application URI scheme.
5136    /// This parameter can only be used with [`confirm=true`](https://docs.stripe.com/api/setup_intents/create#create_setup_intent-confirm).
5137    pub fn return_url(mut self, return_url: impl Into<String>) -> Self {
5138        self.inner.return_url = Some(return_url.into());
5139        self
5140    }
5141    /// If you populate this hash, this SetupIntent generates a `single_use` mandate after successful completion.
5142    ///
5143    /// Single-use mandates are only valid for the following payment methods: `acss_debit`, `alipay`, `au_becs_debit`, `bacs_debit`, `bancontact`, `boleto`, `ideal`, `link`, `sepa_debit`, and `us_bank_account`.
5144    pub fn single_use(mut self, single_use: impl Into<CreateSetupIntentSingleUse>) -> Self {
5145        self.inner.single_use = Some(single_use.into());
5146        self
5147    }
5148    /// Indicates how the payment method is intended to be used in the future.
5149    /// If not provided, this value defaults to `off_session`.
5150    pub fn usage(mut self, usage: impl Into<CreateSetupIntentUsage>) -> Self {
5151        self.inner.usage = Some(usage.into());
5152        self
5153    }
5154    /// Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions.
5155    pub fn use_stripe_sdk(mut self, use_stripe_sdk: impl Into<bool>) -> Self {
5156        self.inner.use_stripe_sdk = Some(use_stripe_sdk.into());
5157        self
5158    }
5159}
5160impl Default for CreateSetupIntent {
5161    fn default() -> Self {
5162        Self::new()
5163    }
5164}
5165impl CreateSetupIntent {
5166    /// Send the request and return the deserialized response.
5167    pub async fn send<C: StripeClient>(
5168        &self,
5169        client: &C,
5170    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
5171        self.customize().send(client).await
5172    }
5173
5174    /// Send the request and return the deserialized response, blocking until completion.
5175    pub fn send_blocking<C: StripeBlockingClient>(
5176        &self,
5177        client: &C,
5178    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
5179        self.customize().send_blocking(client)
5180    }
5181}
5182
5183impl StripeRequest for CreateSetupIntent {
5184    type Output = stripe_shared::SetupIntent;
5185
5186    fn build(&self) -> RequestBuilder {
5187        RequestBuilder::new(StripeMethod::Post, "/setup_intents").form(&self.inner)
5188    }
5189}
5190#[derive(Clone, Debug, serde::Serialize)]
5191struct UpdateSetupIntentBuilder {
5192    #[serde(skip_serializing_if = "Option::is_none")]
5193    attach_to_self: Option<bool>,
5194    #[serde(skip_serializing_if = "Option::is_none")]
5195    customer: Option<String>,
5196    #[serde(skip_serializing_if = "Option::is_none")]
5197    customer_account: Option<String>,
5198    #[serde(skip_serializing_if = "Option::is_none")]
5199    description: Option<String>,
5200    #[serde(skip_serializing_if = "Option::is_none")]
5201    excluded_payment_method_types:
5202        Option<Vec<stripe_shared::SetupIntentExcludedPaymentMethodTypes>>,
5203    #[serde(skip_serializing_if = "Option::is_none")]
5204    expand: Option<Vec<String>>,
5205    #[serde(skip_serializing_if = "Option::is_none")]
5206    flow_directions: Option<Vec<stripe_shared::SetupIntentFlowDirections>>,
5207    #[serde(skip_serializing_if = "Option::is_none")]
5208    metadata: Option<std::collections::HashMap<String, String>>,
5209    #[serde(skip_serializing_if = "Option::is_none")]
5210    payment_method: Option<String>,
5211    #[serde(skip_serializing_if = "Option::is_none")]
5212    payment_method_configuration: Option<String>,
5213    #[serde(skip_serializing_if = "Option::is_none")]
5214    payment_method_data: Option<UpdateSetupIntentPaymentMethodData>,
5215    #[serde(skip_serializing_if = "Option::is_none")]
5216    payment_method_options: Option<UpdateSetupIntentPaymentMethodOptions>,
5217    #[serde(skip_serializing_if = "Option::is_none")]
5218    payment_method_types: Option<Vec<String>>,
5219}
5220impl UpdateSetupIntentBuilder {
5221    fn new() -> Self {
5222        Self {
5223            attach_to_self: None,
5224            customer: None,
5225            customer_account: None,
5226            description: None,
5227            excluded_payment_method_types: None,
5228            expand: None,
5229            flow_directions: None,
5230            metadata: None,
5231            payment_method: None,
5232            payment_method_configuration: None,
5233            payment_method_data: None,
5234            payment_method_options: None,
5235            payment_method_types: None,
5236        }
5237    }
5238}
5239/// When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://docs.stripe.com/api/setup_intents/object#setup_intent_object-payment_method).
5240/// value in the SetupIntent.
5241#[derive(Clone, Debug, serde::Serialize)]
5242pub struct UpdateSetupIntentPaymentMethodData {
5243    /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
5244    #[serde(skip_serializing_if = "Option::is_none")]
5245    pub acss_debit: Option<PaymentMethodParam>,
5246    /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
5247    #[serde(skip_serializing_if = "Option::is_none")]
5248    #[serde(with = "stripe_types::with_serde_json_opt")]
5249    pub affirm: Option<miniserde::json::Value>,
5250    /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
5251    #[serde(skip_serializing_if = "Option::is_none")]
5252    #[serde(with = "stripe_types::with_serde_json_opt")]
5253    pub afterpay_clearpay: Option<miniserde::json::Value>,
5254    /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
5255    #[serde(skip_serializing_if = "Option::is_none")]
5256    #[serde(with = "stripe_types::with_serde_json_opt")]
5257    pub alipay: Option<miniserde::json::Value>,
5258    /// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
5259    /// 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.
5260    /// The field defaults to `unspecified`.
5261    #[serde(skip_serializing_if = "Option::is_none")]
5262    pub allow_redisplay: Option<UpdateSetupIntentPaymentMethodDataAllowRedisplay>,
5263    /// If this is a Alma PaymentMethod, this hash contains details about the Alma payment method.
5264    #[serde(skip_serializing_if = "Option::is_none")]
5265    #[serde(with = "stripe_types::with_serde_json_opt")]
5266    pub alma: Option<miniserde::json::Value>,
5267    /// If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method.
5268    #[serde(skip_serializing_if = "Option::is_none")]
5269    #[serde(with = "stripe_types::with_serde_json_opt")]
5270    pub amazon_pay: Option<miniserde::json::Value>,
5271    /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
5272    #[serde(skip_serializing_if = "Option::is_none")]
5273    pub au_becs_debit: Option<UpdateSetupIntentPaymentMethodDataAuBecsDebit>,
5274    /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
5275    #[serde(skip_serializing_if = "Option::is_none")]
5276    pub bacs_debit: Option<UpdateSetupIntentPaymentMethodDataBacsDebit>,
5277    /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
5278    #[serde(skip_serializing_if = "Option::is_none")]
5279    #[serde(with = "stripe_types::with_serde_json_opt")]
5280    pub bancontact: Option<miniserde::json::Value>,
5281    /// If this is a `billie` PaymentMethod, this hash contains details about the Billie payment method.
5282    #[serde(skip_serializing_if = "Option::is_none")]
5283    #[serde(with = "stripe_types::with_serde_json_opt")]
5284    pub billie: Option<miniserde::json::Value>,
5285    /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
5286    #[serde(skip_serializing_if = "Option::is_none")]
5287    pub billing_details: Option<BillingDetailsInnerParams>,
5288    /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
5289    #[serde(skip_serializing_if = "Option::is_none")]
5290    #[serde(with = "stripe_types::with_serde_json_opt")]
5291    pub blik: Option<miniserde::json::Value>,
5292    /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
5293    #[serde(skip_serializing_if = "Option::is_none")]
5294    pub boleto: Option<UpdateSetupIntentPaymentMethodDataBoleto>,
5295    /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
5296    #[serde(skip_serializing_if = "Option::is_none")]
5297    #[serde(with = "stripe_types::with_serde_json_opt")]
5298    pub cashapp: Option<miniserde::json::Value>,
5299    /// If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method.
5300    #[serde(skip_serializing_if = "Option::is_none")]
5301    #[serde(with = "stripe_types::with_serde_json_opt")]
5302    pub crypto: Option<miniserde::json::Value>,
5303    /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
5304    #[serde(skip_serializing_if = "Option::is_none")]
5305    #[serde(with = "stripe_types::with_serde_json_opt")]
5306    pub customer_balance: Option<miniserde::json::Value>,
5307    /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
5308    #[serde(skip_serializing_if = "Option::is_none")]
5309    pub eps: Option<UpdateSetupIntentPaymentMethodDataEps>,
5310    /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
5311    #[serde(skip_serializing_if = "Option::is_none")]
5312    pub fpx: Option<UpdateSetupIntentPaymentMethodDataFpx>,
5313    /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
5314    #[serde(skip_serializing_if = "Option::is_none")]
5315    #[serde(with = "stripe_types::with_serde_json_opt")]
5316    pub giropay: Option<miniserde::json::Value>,
5317    /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
5318    #[serde(skip_serializing_if = "Option::is_none")]
5319    #[serde(with = "stripe_types::with_serde_json_opt")]
5320    pub grabpay: Option<miniserde::json::Value>,
5321    /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
5322    #[serde(skip_serializing_if = "Option::is_none")]
5323    pub ideal: Option<UpdateSetupIntentPaymentMethodDataIdeal>,
5324    /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
5325    #[serde(skip_serializing_if = "Option::is_none")]
5326    #[serde(with = "stripe_types::with_serde_json_opt")]
5327    pub interac_present: Option<miniserde::json::Value>,
5328    /// If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method.
5329    #[serde(skip_serializing_if = "Option::is_none")]
5330    #[serde(with = "stripe_types::with_serde_json_opt")]
5331    pub kakao_pay: Option<miniserde::json::Value>,
5332    /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
5333    #[serde(skip_serializing_if = "Option::is_none")]
5334    pub klarna: Option<UpdateSetupIntentPaymentMethodDataKlarna>,
5335    /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
5336    #[serde(skip_serializing_if = "Option::is_none")]
5337    #[serde(with = "stripe_types::with_serde_json_opt")]
5338    pub konbini: Option<miniserde::json::Value>,
5339    /// If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method.
5340    #[serde(skip_serializing_if = "Option::is_none")]
5341    #[serde(with = "stripe_types::with_serde_json_opt")]
5342    pub kr_card: Option<miniserde::json::Value>,
5343    /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
5344    #[serde(skip_serializing_if = "Option::is_none")]
5345    #[serde(with = "stripe_types::with_serde_json_opt")]
5346    pub link: Option<miniserde::json::Value>,
5347    /// If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method.
5348    #[serde(skip_serializing_if = "Option::is_none")]
5349    #[serde(with = "stripe_types::with_serde_json_opt")]
5350    pub mb_way: Option<miniserde::json::Value>,
5351    /// Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object.
5352    /// This can be useful for storing additional information about the object in a structured format.
5353    /// Individual keys can be unset by posting an empty value to them.
5354    /// All keys can be unset by posting an empty value to `metadata`.
5355    #[serde(skip_serializing_if = "Option::is_none")]
5356    pub metadata: Option<std::collections::HashMap<String, String>>,
5357    /// If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
5358    #[serde(skip_serializing_if = "Option::is_none")]
5359    #[serde(with = "stripe_types::with_serde_json_opt")]
5360    pub mobilepay: Option<miniserde::json::Value>,
5361    /// If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method.
5362    #[serde(skip_serializing_if = "Option::is_none")]
5363    #[serde(with = "stripe_types::with_serde_json_opt")]
5364    pub multibanco: Option<miniserde::json::Value>,
5365    /// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
5366    #[serde(skip_serializing_if = "Option::is_none")]
5367    pub naver_pay: Option<UpdateSetupIntentPaymentMethodDataNaverPay>,
5368    /// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
5369    #[serde(skip_serializing_if = "Option::is_none")]
5370    pub nz_bank_account: Option<UpdateSetupIntentPaymentMethodDataNzBankAccount>,
5371    /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
5372    #[serde(skip_serializing_if = "Option::is_none")]
5373    #[serde(with = "stripe_types::with_serde_json_opt")]
5374    pub oxxo: Option<miniserde::json::Value>,
5375    /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
5376    #[serde(skip_serializing_if = "Option::is_none")]
5377    pub p24: Option<UpdateSetupIntentPaymentMethodDataP24>,
5378    /// If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method.
5379    #[serde(skip_serializing_if = "Option::is_none")]
5380    #[serde(with = "stripe_types::with_serde_json_opt")]
5381    pub pay_by_bank: Option<miniserde::json::Value>,
5382    /// If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method.
5383    #[serde(skip_serializing_if = "Option::is_none")]
5384    #[serde(with = "stripe_types::with_serde_json_opt")]
5385    pub payco: Option<miniserde::json::Value>,
5386    /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
5387    #[serde(skip_serializing_if = "Option::is_none")]
5388    #[serde(with = "stripe_types::with_serde_json_opt")]
5389    pub paynow: Option<miniserde::json::Value>,
5390    /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
5391    #[serde(skip_serializing_if = "Option::is_none")]
5392    #[serde(with = "stripe_types::with_serde_json_opt")]
5393    pub paypal: Option<miniserde::json::Value>,
5394    /// If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method.
5395    #[serde(skip_serializing_if = "Option::is_none")]
5396    pub payto: Option<UpdateSetupIntentPaymentMethodDataPayto>,
5397    /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
5398    #[serde(skip_serializing_if = "Option::is_none")]
5399    #[serde(with = "stripe_types::with_serde_json_opt")]
5400    pub pix: Option<miniserde::json::Value>,
5401    /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
5402    #[serde(skip_serializing_if = "Option::is_none")]
5403    #[serde(with = "stripe_types::with_serde_json_opt")]
5404    pub promptpay: Option<miniserde::json::Value>,
5405    /// Options to configure Radar.
5406    /// See [Radar Session](https://docs.stripe.com/radar/radar-session) for more information.
5407    #[serde(skip_serializing_if = "Option::is_none")]
5408    pub radar_options: Option<RadarOptionsWithHiddenOptions>,
5409    /// If this is a `revolut_pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
5410    #[serde(skip_serializing_if = "Option::is_none")]
5411    #[serde(with = "stripe_types::with_serde_json_opt")]
5412    pub revolut_pay: Option<miniserde::json::Value>,
5413    /// If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method.
5414    #[serde(skip_serializing_if = "Option::is_none")]
5415    #[serde(with = "stripe_types::with_serde_json_opt")]
5416    pub samsung_pay: Option<miniserde::json::Value>,
5417    /// If this is a `satispay` PaymentMethod, this hash contains details about the Satispay payment method.
5418    #[serde(skip_serializing_if = "Option::is_none")]
5419    #[serde(with = "stripe_types::with_serde_json_opt")]
5420    pub satispay: Option<miniserde::json::Value>,
5421    /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
5422    #[serde(skip_serializing_if = "Option::is_none")]
5423    pub sepa_debit: Option<UpdateSetupIntentPaymentMethodDataSepaDebit>,
5424    /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
5425    #[serde(skip_serializing_if = "Option::is_none")]
5426    pub sofort: Option<UpdateSetupIntentPaymentMethodDataSofort>,
5427    /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
5428    #[serde(skip_serializing_if = "Option::is_none")]
5429    #[serde(with = "stripe_types::with_serde_json_opt")]
5430    pub swish: Option<miniserde::json::Value>,
5431    /// If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method.
5432    #[serde(skip_serializing_if = "Option::is_none")]
5433    #[serde(with = "stripe_types::with_serde_json_opt")]
5434    pub twint: Option<miniserde::json::Value>,
5435    /// The type of the PaymentMethod.
5436    /// An additional hash is included on the PaymentMethod with a name matching this value.
5437    /// It contains additional information specific to the PaymentMethod type.
5438    #[serde(rename = "type")]
5439    pub type_: UpdateSetupIntentPaymentMethodDataType,
5440    /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
5441    #[serde(skip_serializing_if = "Option::is_none")]
5442    pub us_bank_account: Option<UpdateSetupIntentPaymentMethodDataUsBankAccount>,
5443    /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
5444    #[serde(skip_serializing_if = "Option::is_none")]
5445    #[serde(with = "stripe_types::with_serde_json_opt")]
5446    pub wechat_pay: Option<miniserde::json::Value>,
5447    /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
5448    #[serde(skip_serializing_if = "Option::is_none")]
5449    #[serde(with = "stripe_types::with_serde_json_opt")]
5450    pub zip: Option<miniserde::json::Value>,
5451}
5452impl UpdateSetupIntentPaymentMethodData {
5453    pub fn new(type_: impl Into<UpdateSetupIntentPaymentMethodDataType>) -> Self {
5454        Self {
5455            acss_debit: None,
5456            affirm: None,
5457            afterpay_clearpay: None,
5458            alipay: None,
5459            allow_redisplay: None,
5460            alma: None,
5461            amazon_pay: None,
5462            au_becs_debit: None,
5463            bacs_debit: None,
5464            bancontact: None,
5465            billie: None,
5466            billing_details: None,
5467            blik: None,
5468            boleto: None,
5469            cashapp: None,
5470            crypto: None,
5471            customer_balance: None,
5472            eps: None,
5473            fpx: None,
5474            giropay: None,
5475            grabpay: None,
5476            ideal: None,
5477            interac_present: None,
5478            kakao_pay: None,
5479            klarna: None,
5480            konbini: None,
5481            kr_card: None,
5482            link: None,
5483            mb_way: None,
5484            metadata: None,
5485            mobilepay: None,
5486            multibanco: None,
5487            naver_pay: None,
5488            nz_bank_account: None,
5489            oxxo: None,
5490            p24: None,
5491            pay_by_bank: None,
5492            payco: None,
5493            paynow: None,
5494            paypal: None,
5495            payto: None,
5496            pix: None,
5497            promptpay: None,
5498            radar_options: None,
5499            revolut_pay: None,
5500            samsung_pay: None,
5501            satispay: None,
5502            sepa_debit: None,
5503            sofort: None,
5504            swish: None,
5505            twint: None,
5506            type_: type_.into(),
5507            us_bank_account: None,
5508            wechat_pay: None,
5509            zip: None,
5510        }
5511    }
5512}
5513/// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
5514/// 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.
5515/// The field defaults to `unspecified`.
5516#[derive(Clone, Eq, PartialEq)]
5517#[non_exhaustive]
5518pub enum UpdateSetupIntentPaymentMethodDataAllowRedisplay {
5519    Always,
5520    Limited,
5521    Unspecified,
5522    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5523    Unknown(String),
5524}
5525impl UpdateSetupIntentPaymentMethodDataAllowRedisplay {
5526    pub fn as_str(&self) -> &str {
5527        use UpdateSetupIntentPaymentMethodDataAllowRedisplay::*;
5528        match self {
5529            Always => "always",
5530            Limited => "limited",
5531            Unspecified => "unspecified",
5532            Unknown(v) => v,
5533        }
5534    }
5535}
5536
5537impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
5538    type Err = std::convert::Infallible;
5539    fn from_str(s: &str) -> Result<Self, Self::Err> {
5540        use UpdateSetupIntentPaymentMethodDataAllowRedisplay::*;
5541        match s {
5542            "always" => Ok(Always),
5543            "limited" => Ok(Limited),
5544            "unspecified" => Ok(Unspecified),
5545            v => {
5546                tracing::warn!(
5547                    "Unknown value '{}' for enum '{}'",
5548                    v,
5549                    "UpdateSetupIntentPaymentMethodDataAllowRedisplay"
5550                );
5551                Ok(Unknown(v.to_owned()))
5552            }
5553        }
5554    }
5555}
5556impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
5557    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5558        f.write_str(self.as_str())
5559    }
5560}
5561
5562impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
5563    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5564        f.write_str(self.as_str())
5565    }
5566}
5567impl serde::Serialize for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
5568    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5569    where
5570        S: serde::Serializer,
5571    {
5572        serializer.serialize_str(self.as_str())
5573    }
5574}
5575#[cfg(feature = "deserialize")]
5576impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
5577    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5578        use std::str::FromStr;
5579        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5580        Ok(Self::from_str(&s).expect("infallible"))
5581    }
5582}
5583/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
5584#[derive(Clone, Debug, serde::Serialize)]
5585pub struct UpdateSetupIntentPaymentMethodDataAuBecsDebit {
5586    /// The account number for the bank account.
5587    pub account_number: String,
5588    /// Bank-State-Branch number of the bank account.
5589    pub bsb_number: String,
5590}
5591impl UpdateSetupIntentPaymentMethodDataAuBecsDebit {
5592    pub fn new(account_number: impl Into<String>, bsb_number: impl Into<String>) -> Self {
5593        Self { account_number: account_number.into(), bsb_number: bsb_number.into() }
5594    }
5595}
5596/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
5597#[derive(Clone, Debug, serde::Serialize)]
5598pub struct UpdateSetupIntentPaymentMethodDataBacsDebit {
5599    /// Account number of the bank account that the funds will be debited from.
5600    #[serde(skip_serializing_if = "Option::is_none")]
5601    pub account_number: Option<String>,
5602    /// Sort code of the bank account. (e.g., `10-20-30`)
5603    #[serde(skip_serializing_if = "Option::is_none")]
5604    pub sort_code: Option<String>,
5605}
5606impl UpdateSetupIntentPaymentMethodDataBacsDebit {
5607    pub fn new() -> Self {
5608        Self { account_number: None, sort_code: None }
5609    }
5610}
5611impl Default for UpdateSetupIntentPaymentMethodDataBacsDebit {
5612    fn default() -> Self {
5613        Self::new()
5614    }
5615}
5616/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
5617#[derive(Clone, Debug, serde::Serialize)]
5618pub struct UpdateSetupIntentPaymentMethodDataBoleto {
5619    /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)
5620    pub tax_id: String,
5621}
5622impl UpdateSetupIntentPaymentMethodDataBoleto {
5623    pub fn new(tax_id: impl Into<String>) -> Self {
5624        Self { tax_id: tax_id.into() }
5625    }
5626}
5627/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
5628#[derive(Clone, Debug, serde::Serialize)]
5629pub struct UpdateSetupIntentPaymentMethodDataEps {
5630    /// The customer's bank.
5631    #[serde(skip_serializing_if = "Option::is_none")]
5632    pub bank: Option<UpdateSetupIntentPaymentMethodDataEpsBank>,
5633}
5634impl UpdateSetupIntentPaymentMethodDataEps {
5635    pub fn new() -> Self {
5636        Self { bank: None }
5637    }
5638}
5639impl Default for UpdateSetupIntentPaymentMethodDataEps {
5640    fn default() -> Self {
5641        Self::new()
5642    }
5643}
5644/// The customer's bank.
5645#[derive(Clone, Eq, PartialEq)]
5646#[non_exhaustive]
5647pub enum UpdateSetupIntentPaymentMethodDataEpsBank {
5648    ArzteUndApothekerBank,
5649    AustrianAnadiBankAg,
5650    BankAustria,
5651    BankhausCarlSpangler,
5652    BankhausSchelhammerUndSchatteraAg,
5653    BawagPskAg,
5654    BksBankAg,
5655    BrullKallmusBankAg,
5656    BtvVierLanderBank,
5657    CapitalBankGraweGruppeAg,
5658    DeutscheBankAg,
5659    Dolomitenbank,
5660    EasybankAg,
5661    ErsteBankUndSparkassen,
5662    HypoAlpeadriabankInternationalAg,
5663    HypoBankBurgenlandAktiengesellschaft,
5664    HypoNoeLbFurNiederosterreichUWien,
5665    HypoOberosterreichSalzburgSteiermark,
5666    HypoTirolBankAg,
5667    HypoVorarlbergBankAg,
5668    MarchfelderBank,
5669    OberbankAg,
5670    RaiffeisenBankengruppeOsterreich,
5671    SchoellerbankAg,
5672    SpardaBankWien,
5673    VolksbankGruppe,
5674    VolkskreditbankAg,
5675    VrBankBraunau,
5676    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5677    Unknown(String),
5678}
5679impl UpdateSetupIntentPaymentMethodDataEpsBank {
5680    pub fn as_str(&self) -> &str {
5681        use UpdateSetupIntentPaymentMethodDataEpsBank::*;
5682        match self {
5683            ArzteUndApothekerBank => "arzte_und_apotheker_bank",
5684            AustrianAnadiBankAg => "austrian_anadi_bank_ag",
5685            BankAustria => "bank_austria",
5686            BankhausCarlSpangler => "bankhaus_carl_spangler",
5687            BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag",
5688            BawagPskAg => "bawag_psk_ag",
5689            BksBankAg => "bks_bank_ag",
5690            BrullKallmusBankAg => "brull_kallmus_bank_ag",
5691            BtvVierLanderBank => "btv_vier_lander_bank",
5692            CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
5693            DeutscheBankAg => "deutsche_bank_ag",
5694            Dolomitenbank => "dolomitenbank",
5695            EasybankAg => "easybank_ag",
5696            ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
5697            HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag",
5698            HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft",
5699            HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien",
5700            HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark",
5701            HypoTirolBankAg => "hypo_tirol_bank_ag",
5702            HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
5703            MarchfelderBank => "marchfelder_bank",
5704            OberbankAg => "oberbank_ag",
5705            RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich",
5706            SchoellerbankAg => "schoellerbank_ag",
5707            SpardaBankWien => "sparda_bank_wien",
5708            VolksbankGruppe => "volksbank_gruppe",
5709            VolkskreditbankAg => "volkskreditbank_ag",
5710            VrBankBraunau => "vr_bank_braunau",
5711            Unknown(v) => v,
5712        }
5713    }
5714}
5715
5716impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataEpsBank {
5717    type Err = std::convert::Infallible;
5718    fn from_str(s: &str) -> Result<Self, Self::Err> {
5719        use UpdateSetupIntentPaymentMethodDataEpsBank::*;
5720        match s {
5721            "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank),
5722            "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg),
5723            "bank_austria" => Ok(BankAustria),
5724            "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler),
5725            "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg),
5726            "bawag_psk_ag" => Ok(BawagPskAg),
5727            "bks_bank_ag" => Ok(BksBankAg),
5728            "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg),
5729            "btv_vier_lander_bank" => Ok(BtvVierLanderBank),
5730            "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg),
5731            "deutsche_bank_ag" => Ok(DeutscheBankAg),
5732            "dolomitenbank" => Ok(Dolomitenbank),
5733            "easybank_ag" => Ok(EasybankAg),
5734            "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen),
5735            "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg),
5736            "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft),
5737            "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien),
5738            "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark),
5739            "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg),
5740            "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg),
5741            "marchfelder_bank" => Ok(MarchfelderBank),
5742            "oberbank_ag" => Ok(OberbankAg),
5743            "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich),
5744            "schoellerbank_ag" => Ok(SchoellerbankAg),
5745            "sparda_bank_wien" => Ok(SpardaBankWien),
5746            "volksbank_gruppe" => Ok(VolksbankGruppe),
5747            "volkskreditbank_ag" => Ok(VolkskreditbankAg),
5748            "vr_bank_braunau" => Ok(VrBankBraunau),
5749            v => {
5750                tracing::warn!(
5751                    "Unknown value '{}' for enum '{}'",
5752                    v,
5753                    "UpdateSetupIntentPaymentMethodDataEpsBank"
5754                );
5755                Ok(Unknown(v.to_owned()))
5756            }
5757        }
5758    }
5759}
5760impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataEpsBank {
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 UpdateSetupIntentPaymentMethodDataEpsBank {
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 UpdateSetupIntentPaymentMethodDataEpsBank {
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> for UpdateSetupIntentPaymentMethodDataEpsBank {
5781    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5782        use std::str::FromStr;
5783        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5784        Ok(Self::from_str(&s).expect("infallible"))
5785    }
5786}
5787/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
5788#[derive(Clone, Debug, serde::Serialize)]
5789pub struct UpdateSetupIntentPaymentMethodDataFpx {
5790    /// Account holder type for FPX transaction
5791    #[serde(skip_serializing_if = "Option::is_none")]
5792    pub account_holder_type: Option<UpdateSetupIntentPaymentMethodDataFpxAccountHolderType>,
5793    /// The customer's bank.
5794    pub bank: UpdateSetupIntentPaymentMethodDataFpxBank,
5795}
5796impl UpdateSetupIntentPaymentMethodDataFpx {
5797    pub fn new(bank: impl Into<UpdateSetupIntentPaymentMethodDataFpxBank>) -> Self {
5798        Self { account_holder_type: None, bank: bank.into() }
5799    }
5800}
5801/// Account holder type for FPX transaction
5802#[derive(Clone, Eq, PartialEq)]
5803#[non_exhaustive]
5804pub enum UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5805    Company,
5806    Individual,
5807    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5808    Unknown(String),
5809}
5810impl UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5811    pub fn as_str(&self) -> &str {
5812        use UpdateSetupIntentPaymentMethodDataFpxAccountHolderType::*;
5813        match self {
5814            Company => "company",
5815            Individual => "individual",
5816            Unknown(v) => v,
5817        }
5818    }
5819}
5820
5821impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5822    type Err = std::convert::Infallible;
5823    fn from_str(s: &str) -> Result<Self, Self::Err> {
5824        use UpdateSetupIntentPaymentMethodDataFpxAccountHolderType::*;
5825        match s {
5826            "company" => Ok(Company),
5827            "individual" => Ok(Individual),
5828            v => {
5829                tracing::warn!(
5830                    "Unknown value '{}' for enum '{}'",
5831                    v,
5832                    "UpdateSetupIntentPaymentMethodDataFpxAccountHolderType"
5833                );
5834                Ok(Unknown(v.to_owned()))
5835            }
5836        }
5837    }
5838}
5839impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5840    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5841        f.write_str(self.as_str())
5842    }
5843}
5844
5845impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5846    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5847        f.write_str(self.as_str())
5848    }
5849}
5850impl serde::Serialize for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5851    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5852    where
5853        S: serde::Serializer,
5854    {
5855        serializer.serialize_str(self.as_str())
5856    }
5857}
5858#[cfg(feature = "deserialize")]
5859impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5860    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5861        use std::str::FromStr;
5862        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5863        Ok(Self::from_str(&s).expect("infallible"))
5864    }
5865}
5866/// The customer's bank.
5867#[derive(Clone, Eq, PartialEq)]
5868#[non_exhaustive]
5869pub enum UpdateSetupIntentPaymentMethodDataFpxBank {
5870    AffinBank,
5871    Agrobank,
5872    AllianceBank,
5873    Ambank,
5874    BankIslam,
5875    BankMuamalat,
5876    BankOfChina,
5877    BankRakyat,
5878    Bsn,
5879    Cimb,
5880    DeutscheBank,
5881    HongLeongBank,
5882    Hsbc,
5883    Kfh,
5884    Maybank2e,
5885    Maybank2u,
5886    Ocbc,
5887    PbEnterprise,
5888    PublicBank,
5889    Rhb,
5890    StandardChartered,
5891    Uob,
5892    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5893    Unknown(String),
5894}
5895impl UpdateSetupIntentPaymentMethodDataFpxBank {
5896    pub fn as_str(&self) -> &str {
5897        use UpdateSetupIntentPaymentMethodDataFpxBank::*;
5898        match self {
5899            AffinBank => "affin_bank",
5900            Agrobank => "agrobank",
5901            AllianceBank => "alliance_bank",
5902            Ambank => "ambank",
5903            BankIslam => "bank_islam",
5904            BankMuamalat => "bank_muamalat",
5905            BankOfChina => "bank_of_china",
5906            BankRakyat => "bank_rakyat",
5907            Bsn => "bsn",
5908            Cimb => "cimb",
5909            DeutscheBank => "deutsche_bank",
5910            HongLeongBank => "hong_leong_bank",
5911            Hsbc => "hsbc",
5912            Kfh => "kfh",
5913            Maybank2e => "maybank2e",
5914            Maybank2u => "maybank2u",
5915            Ocbc => "ocbc",
5916            PbEnterprise => "pb_enterprise",
5917            PublicBank => "public_bank",
5918            Rhb => "rhb",
5919            StandardChartered => "standard_chartered",
5920            Uob => "uob",
5921            Unknown(v) => v,
5922        }
5923    }
5924}
5925
5926impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataFpxBank {
5927    type Err = std::convert::Infallible;
5928    fn from_str(s: &str) -> Result<Self, Self::Err> {
5929        use UpdateSetupIntentPaymentMethodDataFpxBank::*;
5930        match s {
5931            "affin_bank" => Ok(AffinBank),
5932            "agrobank" => Ok(Agrobank),
5933            "alliance_bank" => Ok(AllianceBank),
5934            "ambank" => Ok(Ambank),
5935            "bank_islam" => Ok(BankIslam),
5936            "bank_muamalat" => Ok(BankMuamalat),
5937            "bank_of_china" => Ok(BankOfChina),
5938            "bank_rakyat" => Ok(BankRakyat),
5939            "bsn" => Ok(Bsn),
5940            "cimb" => Ok(Cimb),
5941            "deutsche_bank" => Ok(DeutscheBank),
5942            "hong_leong_bank" => Ok(HongLeongBank),
5943            "hsbc" => Ok(Hsbc),
5944            "kfh" => Ok(Kfh),
5945            "maybank2e" => Ok(Maybank2e),
5946            "maybank2u" => Ok(Maybank2u),
5947            "ocbc" => Ok(Ocbc),
5948            "pb_enterprise" => Ok(PbEnterprise),
5949            "public_bank" => Ok(PublicBank),
5950            "rhb" => Ok(Rhb),
5951            "standard_chartered" => Ok(StandardChartered),
5952            "uob" => Ok(Uob),
5953            v => {
5954                tracing::warn!(
5955                    "Unknown value '{}' for enum '{}'",
5956                    v,
5957                    "UpdateSetupIntentPaymentMethodDataFpxBank"
5958                );
5959                Ok(Unknown(v.to_owned()))
5960            }
5961        }
5962    }
5963}
5964impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataFpxBank {
5965    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5966        f.write_str(self.as_str())
5967    }
5968}
5969
5970impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataFpxBank {
5971    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5972        f.write_str(self.as_str())
5973    }
5974}
5975impl serde::Serialize for UpdateSetupIntentPaymentMethodDataFpxBank {
5976    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5977    where
5978        S: serde::Serializer,
5979    {
5980        serializer.serialize_str(self.as_str())
5981    }
5982}
5983#[cfg(feature = "deserialize")]
5984impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataFpxBank {
5985    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5986        use std::str::FromStr;
5987        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5988        Ok(Self::from_str(&s).expect("infallible"))
5989    }
5990}
5991/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
5992#[derive(Clone, Debug, serde::Serialize)]
5993pub struct UpdateSetupIntentPaymentMethodDataIdeal {
5994    /// The customer's bank.
5995    /// Only use this parameter for existing customers.
5996    /// Don't use it for new customers.
5997    #[serde(skip_serializing_if = "Option::is_none")]
5998    pub bank: Option<UpdateSetupIntentPaymentMethodDataIdealBank>,
5999}
6000impl UpdateSetupIntentPaymentMethodDataIdeal {
6001    pub fn new() -> Self {
6002        Self { bank: None }
6003    }
6004}
6005impl Default for UpdateSetupIntentPaymentMethodDataIdeal {
6006    fn default() -> Self {
6007        Self::new()
6008    }
6009}
6010/// The customer's bank.
6011/// Only use this parameter for existing customers.
6012/// Don't use it for new customers.
6013#[derive(Clone, Eq, PartialEq)]
6014#[non_exhaustive]
6015pub enum UpdateSetupIntentPaymentMethodDataIdealBank {
6016    AbnAmro,
6017    AsnBank,
6018    Bunq,
6019    Buut,
6020    Finom,
6021    Handelsbanken,
6022    Ing,
6023    Knab,
6024    Mollie,
6025    Moneyou,
6026    N26,
6027    Nn,
6028    Rabobank,
6029    Regiobank,
6030    Revolut,
6031    SnsBank,
6032    TriodosBank,
6033    VanLanschot,
6034    Yoursafe,
6035    /// An unrecognized value from Stripe. Should not be used as a request parameter.
6036    Unknown(String),
6037}
6038impl UpdateSetupIntentPaymentMethodDataIdealBank {
6039    pub fn as_str(&self) -> &str {
6040        use UpdateSetupIntentPaymentMethodDataIdealBank::*;
6041        match self {
6042            AbnAmro => "abn_amro",
6043            AsnBank => "asn_bank",
6044            Bunq => "bunq",
6045            Buut => "buut",
6046            Finom => "finom",
6047            Handelsbanken => "handelsbanken",
6048            Ing => "ing",
6049            Knab => "knab",
6050            Mollie => "mollie",
6051            Moneyou => "moneyou",
6052            N26 => "n26",
6053            Nn => "nn",
6054            Rabobank => "rabobank",
6055            Regiobank => "regiobank",
6056            Revolut => "revolut",
6057            SnsBank => "sns_bank",
6058            TriodosBank => "triodos_bank",
6059            VanLanschot => "van_lanschot",
6060            Yoursafe => "yoursafe",
6061            Unknown(v) => v,
6062        }
6063    }
6064}
6065
6066impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataIdealBank {
6067    type Err = std::convert::Infallible;
6068    fn from_str(s: &str) -> Result<Self, Self::Err> {
6069        use UpdateSetupIntentPaymentMethodDataIdealBank::*;
6070        match s {
6071            "abn_amro" => Ok(AbnAmro),
6072            "asn_bank" => Ok(AsnBank),
6073            "bunq" => Ok(Bunq),
6074            "buut" => Ok(Buut),
6075            "finom" => Ok(Finom),
6076            "handelsbanken" => Ok(Handelsbanken),
6077            "ing" => Ok(Ing),
6078            "knab" => Ok(Knab),
6079            "mollie" => Ok(Mollie),
6080            "moneyou" => Ok(Moneyou),
6081            "n26" => Ok(N26),
6082            "nn" => Ok(Nn),
6083            "rabobank" => Ok(Rabobank),
6084            "regiobank" => Ok(Regiobank),
6085            "revolut" => Ok(Revolut),
6086            "sns_bank" => Ok(SnsBank),
6087            "triodos_bank" => Ok(TriodosBank),
6088            "van_lanschot" => Ok(VanLanschot),
6089            "yoursafe" => Ok(Yoursafe),
6090            v => {
6091                tracing::warn!(
6092                    "Unknown value '{}' for enum '{}'",
6093                    v,
6094                    "UpdateSetupIntentPaymentMethodDataIdealBank"
6095                );
6096                Ok(Unknown(v.to_owned()))
6097            }
6098        }
6099    }
6100}
6101impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataIdealBank {
6102    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6103        f.write_str(self.as_str())
6104    }
6105}
6106
6107impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataIdealBank {
6108    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6109        f.write_str(self.as_str())
6110    }
6111}
6112impl serde::Serialize for UpdateSetupIntentPaymentMethodDataIdealBank {
6113    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6114    where
6115        S: serde::Serializer,
6116    {
6117        serializer.serialize_str(self.as_str())
6118    }
6119}
6120#[cfg(feature = "deserialize")]
6121impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataIdealBank {
6122    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6123        use std::str::FromStr;
6124        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6125        Ok(Self::from_str(&s).expect("infallible"))
6126    }
6127}
6128/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
6129#[derive(Copy, Clone, Debug, serde::Serialize)]
6130pub struct UpdateSetupIntentPaymentMethodDataKlarna {
6131    /// Customer's date of birth
6132    #[serde(skip_serializing_if = "Option::is_none")]
6133    pub dob: Option<DateOfBirth>,
6134}
6135impl UpdateSetupIntentPaymentMethodDataKlarna {
6136    pub fn new() -> Self {
6137        Self { dob: None }
6138    }
6139}
6140impl Default for UpdateSetupIntentPaymentMethodDataKlarna {
6141    fn default() -> Self {
6142        Self::new()
6143    }
6144}
6145/// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
6146#[derive(Clone, Debug, serde::Serialize)]
6147pub struct UpdateSetupIntentPaymentMethodDataNaverPay {
6148    /// Whether to use Naver Pay points or a card to fund this transaction.
6149    /// If not provided, this defaults to `card`.
6150    #[serde(skip_serializing_if = "Option::is_none")]
6151    pub funding: Option<UpdateSetupIntentPaymentMethodDataNaverPayFunding>,
6152}
6153impl UpdateSetupIntentPaymentMethodDataNaverPay {
6154    pub fn new() -> Self {
6155        Self { funding: None }
6156    }
6157}
6158impl Default for UpdateSetupIntentPaymentMethodDataNaverPay {
6159    fn default() -> Self {
6160        Self::new()
6161    }
6162}
6163/// Whether to use Naver Pay points or a card to fund this transaction.
6164/// If not provided, this defaults to `card`.
6165#[derive(Clone, Eq, PartialEq)]
6166#[non_exhaustive]
6167pub enum UpdateSetupIntentPaymentMethodDataNaverPayFunding {
6168    Card,
6169    Points,
6170    /// An unrecognized value from Stripe. Should not be used as a request parameter.
6171    Unknown(String),
6172}
6173impl UpdateSetupIntentPaymentMethodDataNaverPayFunding {
6174    pub fn as_str(&self) -> &str {
6175        use UpdateSetupIntentPaymentMethodDataNaverPayFunding::*;
6176        match self {
6177            Card => "card",
6178            Points => "points",
6179            Unknown(v) => v,
6180        }
6181    }
6182}
6183
6184impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
6185    type Err = std::convert::Infallible;
6186    fn from_str(s: &str) -> Result<Self, Self::Err> {
6187        use UpdateSetupIntentPaymentMethodDataNaverPayFunding::*;
6188        match s {
6189            "card" => Ok(Card),
6190            "points" => Ok(Points),
6191            v => {
6192                tracing::warn!(
6193                    "Unknown value '{}' for enum '{}'",
6194                    v,
6195                    "UpdateSetupIntentPaymentMethodDataNaverPayFunding"
6196                );
6197                Ok(Unknown(v.to_owned()))
6198            }
6199        }
6200    }
6201}
6202impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
6203    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6204        f.write_str(self.as_str())
6205    }
6206}
6207
6208impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
6209    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6210        f.write_str(self.as_str())
6211    }
6212}
6213impl serde::Serialize for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
6214    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6215    where
6216        S: serde::Serializer,
6217    {
6218        serializer.serialize_str(self.as_str())
6219    }
6220}
6221#[cfg(feature = "deserialize")]
6222impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
6223    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6224        use std::str::FromStr;
6225        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6226        Ok(Self::from_str(&s).expect("infallible"))
6227    }
6228}
6229/// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
6230#[derive(Clone, Debug, serde::Serialize)]
6231pub struct UpdateSetupIntentPaymentMethodDataNzBankAccount {
6232    /// The name on the bank account.
6233    /// Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod’s billing details.
6234    #[serde(skip_serializing_if = "Option::is_none")]
6235    pub account_holder_name: Option<String>,
6236    /// The account number for the bank account.
6237    pub account_number: String,
6238    /// The numeric code for the bank account's bank.
6239    pub bank_code: String,
6240    /// The numeric code for the bank account's bank branch.
6241    pub branch_code: String,
6242    #[serde(skip_serializing_if = "Option::is_none")]
6243    pub reference: Option<String>,
6244    /// The suffix of the bank account number.
6245    pub suffix: String,
6246}
6247impl UpdateSetupIntentPaymentMethodDataNzBankAccount {
6248    pub fn new(
6249        account_number: impl Into<String>,
6250        bank_code: impl Into<String>,
6251        branch_code: impl Into<String>,
6252        suffix: impl Into<String>,
6253    ) -> Self {
6254        Self {
6255            account_holder_name: None,
6256            account_number: account_number.into(),
6257            bank_code: bank_code.into(),
6258            branch_code: branch_code.into(),
6259            reference: None,
6260            suffix: suffix.into(),
6261        }
6262    }
6263}
6264/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
6265#[derive(Clone, Debug, serde::Serialize)]
6266pub struct UpdateSetupIntentPaymentMethodDataP24 {
6267    /// The customer's bank.
6268    #[serde(skip_serializing_if = "Option::is_none")]
6269    pub bank: Option<UpdateSetupIntentPaymentMethodDataP24Bank>,
6270}
6271impl UpdateSetupIntentPaymentMethodDataP24 {
6272    pub fn new() -> Self {
6273        Self { bank: None }
6274    }
6275}
6276impl Default for UpdateSetupIntentPaymentMethodDataP24 {
6277    fn default() -> Self {
6278        Self::new()
6279    }
6280}
6281/// The customer's bank.
6282#[derive(Clone, Eq, PartialEq)]
6283#[non_exhaustive]
6284pub enum UpdateSetupIntentPaymentMethodDataP24Bank {
6285    AliorBank,
6286    BankMillennium,
6287    BankNowyBfgSa,
6288    BankPekaoSa,
6289    BankiSpbdzielcze,
6290    Blik,
6291    BnpParibas,
6292    Boz,
6293    CitiHandlowy,
6294    CreditAgricole,
6295    Envelobank,
6296    EtransferPocztowy24,
6297    GetinBank,
6298    Ideabank,
6299    Ing,
6300    Inteligo,
6301    MbankMtransfer,
6302    NestPrzelew,
6303    NoblePay,
6304    PbacZIpko,
6305    PlusBank,
6306    SantanderPrzelew24,
6307    TmobileUsbugiBankowe,
6308    ToyotaBank,
6309    Velobank,
6310    VolkswagenBank,
6311    /// An unrecognized value from Stripe. Should not be used as a request parameter.
6312    Unknown(String),
6313}
6314impl UpdateSetupIntentPaymentMethodDataP24Bank {
6315    pub fn as_str(&self) -> &str {
6316        use UpdateSetupIntentPaymentMethodDataP24Bank::*;
6317        match self {
6318            AliorBank => "alior_bank",
6319            BankMillennium => "bank_millennium",
6320            BankNowyBfgSa => "bank_nowy_bfg_sa",
6321            BankPekaoSa => "bank_pekao_sa",
6322            BankiSpbdzielcze => "banki_spbdzielcze",
6323            Blik => "blik",
6324            BnpParibas => "bnp_paribas",
6325            Boz => "boz",
6326            CitiHandlowy => "citi_handlowy",
6327            CreditAgricole => "credit_agricole",
6328            Envelobank => "envelobank",
6329            EtransferPocztowy24 => "etransfer_pocztowy24",
6330            GetinBank => "getin_bank",
6331            Ideabank => "ideabank",
6332            Ing => "ing",
6333            Inteligo => "inteligo",
6334            MbankMtransfer => "mbank_mtransfer",
6335            NestPrzelew => "nest_przelew",
6336            NoblePay => "noble_pay",
6337            PbacZIpko => "pbac_z_ipko",
6338            PlusBank => "plus_bank",
6339            SantanderPrzelew24 => "santander_przelew24",
6340            TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
6341            ToyotaBank => "toyota_bank",
6342            Velobank => "velobank",
6343            VolkswagenBank => "volkswagen_bank",
6344            Unknown(v) => v,
6345        }
6346    }
6347}
6348
6349impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataP24Bank {
6350    type Err = std::convert::Infallible;
6351    fn from_str(s: &str) -> Result<Self, Self::Err> {
6352        use UpdateSetupIntentPaymentMethodDataP24Bank::*;
6353        match s {
6354            "alior_bank" => Ok(AliorBank),
6355            "bank_millennium" => Ok(BankMillennium),
6356            "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa),
6357            "bank_pekao_sa" => Ok(BankPekaoSa),
6358            "banki_spbdzielcze" => Ok(BankiSpbdzielcze),
6359            "blik" => Ok(Blik),
6360            "bnp_paribas" => Ok(BnpParibas),
6361            "boz" => Ok(Boz),
6362            "citi_handlowy" => Ok(CitiHandlowy),
6363            "credit_agricole" => Ok(CreditAgricole),
6364            "envelobank" => Ok(Envelobank),
6365            "etransfer_pocztowy24" => Ok(EtransferPocztowy24),
6366            "getin_bank" => Ok(GetinBank),
6367            "ideabank" => Ok(Ideabank),
6368            "ing" => Ok(Ing),
6369            "inteligo" => Ok(Inteligo),
6370            "mbank_mtransfer" => Ok(MbankMtransfer),
6371            "nest_przelew" => Ok(NestPrzelew),
6372            "noble_pay" => Ok(NoblePay),
6373            "pbac_z_ipko" => Ok(PbacZIpko),
6374            "plus_bank" => Ok(PlusBank),
6375            "santander_przelew24" => Ok(SantanderPrzelew24),
6376            "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe),
6377            "toyota_bank" => Ok(ToyotaBank),
6378            "velobank" => Ok(Velobank),
6379            "volkswagen_bank" => Ok(VolkswagenBank),
6380            v => {
6381                tracing::warn!(
6382                    "Unknown value '{}' for enum '{}'",
6383                    v,
6384                    "UpdateSetupIntentPaymentMethodDataP24Bank"
6385                );
6386                Ok(Unknown(v.to_owned()))
6387            }
6388        }
6389    }
6390}
6391impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataP24Bank {
6392    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6393        f.write_str(self.as_str())
6394    }
6395}
6396
6397impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataP24Bank {
6398    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6399        f.write_str(self.as_str())
6400    }
6401}
6402impl serde::Serialize for UpdateSetupIntentPaymentMethodDataP24Bank {
6403    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6404    where
6405        S: serde::Serializer,
6406    {
6407        serializer.serialize_str(self.as_str())
6408    }
6409}
6410#[cfg(feature = "deserialize")]
6411impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataP24Bank {
6412    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6413        use std::str::FromStr;
6414        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6415        Ok(Self::from_str(&s).expect("infallible"))
6416    }
6417}
6418/// If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method.
6419#[derive(Clone, Debug, serde::Serialize)]
6420pub struct UpdateSetupIntentPaymentMethodDataPayto {
6421    /// The account number for the bank account.
6422    #[serde(skip_serializing_if = "Option::is_none")]
6423    pub account_number: Option<String>,
6424    /// Bank-State-Branch number of the bank account.
6425    #[serde(skip_serializing_if = "Option::is_none")]
6426    pub bsb_number: Option<String>,
6427    /// The PayID alias for the bank account.
6428    #[serde(skip_serializing_if = "Option::is_none")]
6429    pub pay_id: Option<String>,
6430}
6431impl UpdateSetupIntentPaymentMethodDataPayto {
6432    pub fn new() -> Self {
6433        Self { account_number: None, bsb_number: None, pay_id: None }
6434    }
6435}
6436impl Default for UpdateSetupIntentPaymentMethodDataPayto {
6437    fn default() -> Self {
6438        Self::new()
6439    }
6440}
6441/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
6442#[derive(Clone, Debug, serde::Serialize)]
6443pub struct UpdateSetupIntentPaymentMethodDataSepaDebit {
6444    /// IBAN of the bank account.
6445    pub iban: String,
6446}
6447impl UpdateSetupIntentPaymentMethodDataSepaDebit {
6448    pub fn new(iban: impl Into<String>) -> Self {
6449        Self { iban: iban.into() }
6450    }
6451}
6452/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
6453#[derive(Clone, Debug, serde::Serialize)]
6454pub struct UpdateSetupIntentPaymentMethodDataSofort {
6455    /// Two-letter ISO code representing the country the bank account is located in.
6456    pub country: UpdateSetupIntentPaymentMethodDataSofortCountry,
6457}
6458impl UpdateSetupIntentPaymentMethodDataSofort {
6459    pub fn new(country: impl Into<UpdateSetupIntentPaymentMethodDataSofortCountry>) -> Self {
6460        Self { country: country.into() }
6461    }
6462}
6463/// Two-letter ISO code representing the country the bank account is located in.
6464#[derive(Clone, Eq, PartialEq)]
6465#[non_exhaustive]
6466pub enum UpdateSetupIntentPaymentMethodDataSofortCountry {
6467    At,
6468    Be,
6469    De,
6470    Es,
6471    It,
6472    Nl,
6473    /// An unrecognized value from Stripe. Should not be used as a request parameter.
6474    Unknown(String),
6475}
6476impl UpdateSetupIntentPaymentMethodDataSofortCountry {
6477    pub fn as_str(&self) -> &str {
6478        use UpdateSetupIntentPaymentMethodDataSofortCountry::*;
6479        match self {
6480            At => "AT",
6481            Be => "BE",
6482            De => "DE",
6483            Es => "ES",
6484            It => "IT",
6485            Nl => "NL",
6486            Unknown(v) => v,
6487        }
6488    }
6489}
6490
6491impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataSofortCountry {
6492    type Err = std::convert::Infallible;
6493    fn from_str(s: &str) -> Result<Self, Self::Err> {
6494        use UpdateSetupIntentPaymentMethodDataSofortCountry::*;
6495        match s {
6496            "AT" => Ok(At),
6497            "BE" => Ok(Be),
6498            "DE" => Ok(De),
6499            "ES" => Ok(Es),
6500            "IT" => Ok(It),
6501            "NL" => Ok(Nl),
6502            v => {
6503                tracing::warn!(
6504                    "Unknown value '{}' for enum '{}'",
6505                    v,
6506                    "UpdateSetupIntentPaymentMethodDataSofortCountry"
6507                );
6508                Ok(Unknown(v.to_owned()))
6509            }
6510        }
6511    }
6512}
6513impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataSofortCountry {
6514    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6515        f.write_str(self.as_str())
6516    }
6517}
6518
6519impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataSofortCountry {
6520    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6521        f.write_str(self.as_str())
6522    }
6523}
6524impl serde::Serialize for UpdateSetupIntentPaymentMethodDataSofortCountry {
6525    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6526    where
6527        S: serde::Serializer,
6528    {
6529        serializer.serialize_str(self.as_str())
6530    }
6531}
6532#[cfg(feature = "deserialize")]
6533impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataSofortCountry {
6534    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6535        use std::str::FromStr;
6536        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6537        Ok(Self::from_str(&s).expect("infallible"))
6538    }
6539}
6540/// The type of the PaymentMethod.
6541/// An additional hash is included on the PaymentMethod with a name matching this value.
6542/// It contains additional information specific to the PaymentMethod type.
6543#[derive(Clone, Eq, PartialEq)]
6544#[non_exhaustive]
6545pub enum UpdateSetupIntentPaymentMethodDataType {
6546    AcssDebit,
6547    Affirm,
6548    AfterpayClearpay,
6549    Alipay,
6550    Alma,
6551    AmazonPay,
6552    AuBecsDebit,
6553    BacsDebit,
6554    Bancontact,
6555    Billie,
6556    Blik,
6557    Boleto,
6558    Cashapp,
6559    Crypto,
6560    CustomerBalance,
6561    Eps,
6562    Fpx,
6563    Giropay,
6564    Grabpay,
6565    Ideal,
6566    KakaoPay,
6567    Klarna,
6568    Konbini,
6569    KrCard,
6570    Link,
6571    MbWay,
6572    Mobilepay,
6573    Multibanco,
6574    NaverPay,
6575    NzBankAccount,
6576    Oxxo,
6577    P24,
6578    PayByBank,
6579    Payco,
6580    Paynow,
6581    Paypal,
6582    Payto,
6583    Pix,
6584    Promptpay,
6585    RevolutPay,
6586    SamsungPay,
6587    Satispay,
6588    SepaDebit,
6589    Sofort,
6590    Swish,
6591    Twint,
6592    UsBankAccount,
6593    WechatPay,
6594    Zip,
6595    /// An unrecognized value from Stripe. Should not be used as a request parameter.
6596    Unknown(String),
6597}
6598impl UpdateSetupIntentPaymentMethodDataType {
6599    pub fn as_str(&self) -> &str {
6600        use UpdateSetupIntentPaymentMethodDataType::*;
6601        match self {
6602            AcssDebit => "acss_debit",
6603            Affirm => "affirm",
6604            AfterpayClearpay => "afterpay_clearpay",
6605            Alipay => "alipay",
6606            Alma => "alma",
6607            AmazonPay => "amazon_pay",
6608            AuBecsDebit => "au_becs_debit",
6609            BacsDebit => "bacs_debit",
6610            Bancontact => "bancontact",
6611            Billie => "billie",
6612            Blik => "blik",
6613            Boleto => "boleto",
6614            Cashapp => "cashapp",
6615            Crypto => "crypto",
6616            CustomerBalance => "customer_balance",
6617            Eps => "eps",
6618            Fpx => "fpx",
6619            Giropay => "giropay",
6620            Grabpay => "grabpay",
6621            Ideal => "ideal",
6622            KakaoPay => "kakao_pay",
6623            Klarna => "klarna",
6624            Konbini => "konbini",
6625            KrCard => "kr_card",
6626            Link => "link",
6627            MbWay => "mb_way",
6628            Mobilepay => "mobilepay",
6629            Multibanco => "multibanco",
6630            NaverPay => "naver_pay",
6631            NzBankAccount => "nz_bank_account",
6632            Oxxo => "oxxo",
6633            P24 => "p24",
6634            PayByBank => "pay_by_bank",
6635            Payco => "payco",
6636            Paynow => "paynow",
6637            Paypal => "paypal",
6638            Payto => "payto",
6639            Pix => "pix",
6640            Promptpay => "promptpay",
6641            RevolutPay => "revolut_pay",
6642            SamsungPay => "samsung_pay",
6643            Satispay => "satispay",
6644            SepaDebit => "sepa_debit",
6645            Sofort => "sofort",
6646            Swish => "swish",
6647            Twint => "twint",
6648            UsBankAccount => "us_bank_account",
6649            WechatPay => "wechat_pay",
6650            Zip => "zip",
6651            Unknown(v) => v,
6652        }
6653    }
6654}
6655
6656impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataType {
6657    type Err = std::convert::Infallible;
6658    fn from_str(s: &str) -> Result<Self, Self::Err> {
6659        use UpdateSetupIntentPaymentMethodDataType::*;
6660        match s {
6661            "acss_debit" => Ok(AcssDebit),
6662            "affirm" => Ok(Affirm),
6663            "afterpay_clearpay" => Ok(AfterpayClearpay),
6664            "alipay" => Ok(Alipay),
6665            "alma" => Ok(Alma),
6666            "amazon_pay" => Ok(AmazonPay),
6667            "au_becs_debit" => Ok(AuBecsDebit),
6668            "bacs_debit" => Ok(BacsDebit),
6669            "bancontact" => Ok(Bancontact),
6670            "billie" => Ok(Billie),
6671            "blik" => Ok(Blik),
6672            "boleto" => Ok(Boleto),
6673            "cashapp" => Ok(Cashapp),
6674            "crypto" => Ok(Crypto),
6675            "customer_balance" => Ok(CustomerBalance),
6676            "eps" => Ok(Eps),
6677            "fpx" => Ok(Fpx),
6678            "giropay" => Ok(Giropay),
6679            "grabpay" => Ok(Grabpay),
6680            "ideal" => Ok(Ideal),
6681            "kakao_pay" => Ok(KakaoPay),
6682            "klarna" => Ok(Klarna),
6683            "konbini" => Ok(Konbini),
6684            "kr_card" => Ok(KrCard),
6685            "link" => Ok(Link),
6686            "mb_way" => Ok(MbWay),
6687            "mobilepay" => Ok(Mobilepay),
6688            "multibanco" => Ok(Multibanco),
6689            "naver_pay" => Ok(NaverPay),
6690            "nz_bank_account" => Ok(NzBankAccount),
6691            "oxxo" => Ok(Oxxo),
6692            "p24" => Ok(P24),
6693            "pay_by_bank" => Ok(PayByBank),
6694            "payco" => Ok(Payco),
6695            "paynow" => Ok(Paynow),
6696            "paypal" => Ok(Paypal),
6697            "payto" => Ok(Payto),
6698            "pix" => Ok(Pix),
6699            "promptpay" => Ok(Promptpay),
6700            "revolut_pay" => Ok(RevolutPay),
6701            "samsung_pay" => Ok(SamsungPay),
6702            "satispay" => Ok(Satispay),
6703            "sepa_debit" => Ok(SepaDebit),
6704            "sofort" => Ok(Sofort),
6705            "swish" => Ok(Swish),
6706            "twint" => Ok(Twint),
6707            "us_bank_account" => Ok(UsBankAccount),
6708            "wechat_pay" => Ok(WechatPay),
6709            "zip" => Ok(Zip),
6710            v => {
6711                tracing::warn!(
6712                    "Unknown value '{}' for enum '{}'",
6713                    v,
6714                    "UpdateSetupIntentPaymentMethodDataType"
6715                );
6716                Ok(Unknown(v.to_owned()))
6717            }
6718        }
6719    }
6720}
6721impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataType {
6722    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6723        f.write_str(self.as_str())
6724    }
6725}
6726
6727impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataType {
6728    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6729        f.write_str(self.as_str())
6730    }
6731}
6732impl serde::Serialize for UpdateSetupIntentPaymentMethodDataType {
6733    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6734    where
6735        S: serde::Serializer,
6736    {
6737        serializer.serialize_str(self.as_str())
6738    }
6739}
6740#[cfg(feature = "deserialize")]
6741impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataType {
6742    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6743        use std::str::FromStr;
6744        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6745        Ok(Self::from_str(&s).expect("infallible"))
6746    }
6747}
6748/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
6749#[derive(Clone, Debug, serde::Serialize)]
6750pub struct UpdateSetupIntentPaymentMethodDataUsBankAccount {
6751    /// Account holder type: individual or company.
6752    #[serde(skip_serializing_if = "Option::is_none")]
6753    pub account_holder_type:
6754        Option<UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType>,
6755    /// Account number of the bank account.
6756    #[serde(skip_serializing_if = "Option::is_none")]
6757    pub account_number: Option<String>,
6758    /// Account type: checkings or savings. Defaults to checking if omitted.
6759    #[serde(skip_serializing_if = "Option::is_none")]
6760    pub account_type: Option<UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType>,
6761    /// The ID of a Financial Connections Account to use as a payment method.
6762    #[serde(skip_serializing_if = "Option::is_none")]
6763    pub financial_connections_account: Option<String>,
6764    /// Routing number of the bank account.
6765    #[serde(skip_serializing_if = "Option::is_none")]
6766    pub routing_number: Option<String>,
6767}
6768impl UpdateSetupIntentPaymentMethodDataUsBankAccount {
6769    pub fn new() -> Self {
6770        Self {
6771            account_holder_type: None,
6772            account_number: None,
6773            account_type: None,
6774            financial_connections_account: None,
6775            routing_number: None,
6776        }
6777    }
6778}
6779impl Default for UpdateSetupIntentPaymentMethodDataUsBankAccount {
6780    fn default() -> Self {
6781        Self::new()
6782    }
6783}
6784/// Account holder type: individual or company.
6785#[derive(Clone, Eq, PartialEq)]
6786#[non_exhaustive]
6787pub enum UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
6788    Company,
6789    Individual,
6790    /// An unrecognized value from Stripe. Should not be used as a request parameter.
6791    Unknown(String),
6792}
6793impl UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
6794    pub fn as_str(&self) -> &str {
6795        use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
6796        match self {
6797            Company => "company",
6798            Individual => "individual",
6799            Unknown(v) => v,
6800        }
6801    }
6802}
6803
6804impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
6805    type Err = std::convert::Infallible;
6806    fn from_str(s: &str) -> Result<Self, Self::Err> {
6807        use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
6808        match s {
6809            "company" => Ok(Company),
6810            "individual" => Ok(Individual),
6811            v => {
6812                tracing::warn!(
6813                    "Unknown value '{}' for enum '{}'",
6814                    v,
6815                    "UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType"
6816                );
6817                Ok(Unknown(v.to_owned()))
6818            }
6819        }
6820    }
6821}
6822impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
6823    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6824        f.write_str(self.as_str())
6825    }
6826}
6827
6828impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
6829    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6830        f.write_str(self.as_str())
6831    }
6832}
6833impl serde::Serialize for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
6834    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6835    where
6836        S: serde::Serializer,
6837    {
6838        serializer.serialize_str(self.as_str())
6839    }
6840}
6841#[cfg(feature = "deserialize")]
6842impl<'de> serde::Deserialize<'de>
6843    for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType
6844{
6845    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6846        use std::str::FromStr;
6847        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6848        Ok(Self::from_str(&s).expect("infallible"))
6849    }
6850}
6851/// Account type: checkings or savings. Defaults to checking if omitted.
6852#[derive(Clone, Eq, PartialEq)]
6853#[non_exhaustive]
6854pub enum UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6855    Checking,
6856    Savings,
6857    /// An unrecognized value from Stripe. Should not be used as a request parameter.
6858    Unknown(String),
6859}
6860impl UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6861    pub fn as_str(&self) -> &str {
6862        use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
6863        match self {
6864            Checking => "checking",
6865            Savings => "savings",
6866            Unknown(v) => v,
6867        }
6868    }
6869}
6870
6871impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6872    type Err = std::convert::Infallible;
6873    fn from_str(s: &str) -> Result<Self, Self::Err> {
6874        use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
6875        match s {
6876            "checking" => Ok(Checking),
6877            "savings" => Ok(Savings),
6878            v => {
6879                tracing::warn!(
6880                    "Unknown value '{}' for enum '{}'",
6881                    v,
6882                    "UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType"
6883                );
6884                Ok(Unknown(v.to_owned()))
6885            }
6886        }
6887    }
6888}
6889impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6890    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6891        f.write_str(self.as_str())
6892    }
6893}
6894
6895impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6896    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6897        f.write_str(self.as_str())
6898    }
6899}
6900impl serde::Serialize for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6901    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6902    where
6903        S: serde::Serializer,
6904    {
6905        serializer.serialize_str(self.as_str())
6906    }
6907}
6908#[cfg(feature = "deserialize")]
6909impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6910    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6911        use std::str::FromStr;
6912        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6913        Ok(Self::from_str(&s).expect("infallible"))
6914    }
6915}
6916/// Payment method-specific configuration for this SetupIntent.
6917#[derive(Clone, Debug, serde::Serialize)]
6918pub struct UpdateSetupIntentPaymentMethodOptions {
6919    /// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options.
6920    #[serde(skip_serializing_if = "Option::is_none")]
6921    pub acss_debit: Option<UpdateSetupIntentPaymentMethodOptionsAcssDebit>,
6922    /// If this is a `amazon_pay` SetupIntent, this sub-hash contains details about the AmazonPay payment method options.
6923    #[serde(skip_serializing_if = "Option::is_none")]
6924    #[serde(with = "stripe_types::with_serde_json_opt")]
6925    pub amazon_pay: Option<miniserde::json::Value>,
6926    /// If this is a `bacs_debit` SetupIntent, this sub-hash contains details about the Bacs Debit payment method options.
6927    #[serde(skip_serializing_if = "Option::is_none")]
6928    pub bacs_debit: Option<UpdateSetupIntentPaymentMethodOptionsBacsDebit>,
6929    /// Configuration for any card setup attempted on this SetupIntent.
6930    #[serde(skip_serializing_if = "Option::is_none")]
6931    pub card: Option<UpdateSetupIntentPaymentMethodOptionsCard>,
6932    /// If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options.
6933    #[serde(skip_serializing_if = "Option::is_none")]
6934    #[serde(with = "stripe_types::with_serde_json_opt")]
6935    pub card_present: Option<miniserde::json::Value>,
6936    /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options.
6937    #[serde(skip_serializing_if = "Option::is_none")]
6938    pub klarna: Option<UpdateSetupIntentPaymentMethodOptionsKlarna>,
6939    /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
6940    #[serde(skip_serializing_if = "Option::is_none")]
6941    pub link: Option<SetupIntentPaymentMethodOptionsParam>,
6942    /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
6943    #[serde(skip_serializing_if = "Option::is_none")]
6944    pub paypal: Option<PaymentMethodOptionsParam>,
6945    /// If this is a `payto` SetupIntent, this sub-hash contains details about the PayTo payment method options.
6946    #[serde(skip_serializing_if = "Option::is_none")]
6947    pub payto: Option<UpdateSetupIntentPaymentMethodOptionsPayto>,
6948    /// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options.
6949    #[serde(skip_serializing_if = "Option::is_none")]
6950    pub sepa_debit: Option<UpdateSetupIntentPaymentMethodOptionsSepaDebit>,
6951    /// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options.
6952    #[serde(skip_serializing_if = "Option::is_none")]
6953    pub us_bank_account: Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccount>,
6954}
6955impl UpdateSetupIntentPaymentMethodOptions {
6956    pub fn new() -> Self {
6957        Self {
6958            acss_debit: None,
6959            amazon_pay: None,
6960            bacs_debit: None,
6961            card: None,
6962            card_present: None,
6963            klarna: None,
6964            link: None,
6965            paypal: None,
6966            payto: None,
6967            sepa_debit: None,
6968            us_bank_account: None,
6969        }
6970    }
6971}
6972impl Default for UpdateSetupIntentPaymentMethodOptions {
6973    fn default() -> Self {
6974        Self::new()
6975    }
6976}
6977/// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options.
6978#[derive(Clone, Debug, serde::Serialize)]
6979pub struct UpdateSetupIntentPaymentMethodOptionsAcssDebit {
6980    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
6981    /// Must be a [supported currency](https://stripe.com/docs/currencies).
6982    #[serde(skip_serializing_if = "Option::is_none")]
6983    pub currency: Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency>,
6984    /// Additional fields for Mandate creation
6985    #[serde(skip_serializing_if = "Option::is_none")]
6986    pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions>,
6987    /// Bank account verification method.
6988    #[serde(skip_serializing_if = "Option::is_none")]
6989    pub verification_method:
6990        Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
6991}
6992impl UpdateSetupIntentPaymentMethodOptionsAcssDebit {
6993    pub fn new() -> Self {
6994        Self { currency: None, mandate_options: None, verification_method: None }
6995    }
6996}
6997impl Default for UpdateSetupIntentPaymentMethodOptionsAcssDebit {
6998    fn default() -> Self {
6999        Self::new()
7000    }
7001}
7002/// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
7003/// Must be a [supported currency](https://stripe.com/docs/currencies).
7004#[derive(Clone, Eq, PartialEq)]
7005#[non_exhaustive]
7006pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
7007    Cad,
7008    Usd,
7009    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7010    Unknown(String),
7011}
7012impl UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
7013    pub fn as_str(&self) -> &str {
7014        use UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
7015        match self {
7016            Cad => "cad",
7017            Usd => "usd",
7018            Unknown(v) => v,
7019        }
7020    }
7021}
7022
7023impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
7024    type Err = std::convert::Infallible;
7025    fn from_str(s: &str) -> Result<Self, Self::Err> {
7026        use UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
7027        match s {
7028            "cad" => Ok(Cad),
7029            "usd" => Ok(Usd),
7030            v => {
7031                tracing::warn!(
7032                    "Unknown value '{}' for enum '{}'",
7033                    v,
7034                    "UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency"
7035                );
7036                Ok(Unknown(v.to_owned()))
7037            }
7038        }
7039    }
7040}
7041impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
7042    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7043        f.write_str(self.as_str())
7044    }
7045}
7046
7047impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
7048    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7049        f.write_str(self.as_str())
7050    }
7051}
7052impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
7053    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7054    where
7055        S: serde::Serializer,
7056    {
7057        serializer.serialize_str(self.as_str())
7058    }
7059}
7060#[cfg(feature = "deserialize")]
7061impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
7062    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7063        use std::str::FromStr;
7064        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7065        Ok(Self::from_str(&s).expect("infallible"))
7066    }
7067}
7068/// Additional fields for Mandate creation
7069#[derive(Clone, Debug, serde::Serialize)]
7070pub struct UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
7071    /// A URL for custom mandate text to render during confirmation step.
7072    /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,.
7073    /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent.
7074    #[serde(skip_serializing_if = "Option::is_none")]
7075    pub custom_mandate_url: Option<String>,
7076    /// List of Stripe products where this mandate can be selected automatically.
7077    #[serde(skip_serializing_if = "Option::is_none")]
7078    pub default_for:
7079        Option<Vec<UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor>>,
7080    /// Description of the mandate interval.
7081    /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'.
7082    #[serde(skip_serializing_if = "Option::is_none")]
7083    pub interval_description: Option<String>,
7084    /// Payment schedule for the mandate.
7085    #[serde(skip_serializing_if = "Option::is_none")]
7086    pub payment_schedule:
7087        Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
7088    /// Transaction type of the mandate.
7089    #[serde(skip_serializing_if = "Option::is_none")]
7090    pub transaction_type:
7091        Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
7092}
7093impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
7094    pub fn new() -> Self {
7095        Self {
7096            custom_mandate_url: None,
7097            default_for: None,
7098            interval_description: None,
7099            payment_schedule: None,
7100            transaction_type: None,
7101        }
7102    }
7103}
7104impl Default for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
7105    fn default() -> Self {
7106        Self::new()
7107    }
7108}
7109/// List of Stripe products where this mandate can be selected automatically.
7110#[derive(Clone, Eq, PartialEq)]
7111#[non_exhaustive]
7112pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
7113    Invoice,
7114    Subscription,
7115    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7116    Unknown(String),
7117}
7118impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
7119    pub fn as_str(&self) -> &str {
7120        use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
7121        match self {
7122            Invoice => "invoice",
7123            Subscription => "subscription",
7124            Unknown(v) => v,
7125        }
7126    }
7127}
7128
7129impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
7130    type Err = std::convert::Infallible;
7131    fn from_str(s: &str) -> Result<Self, Self::Err> {
7132        use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
7133        match s {
7134            "invoice" => Ok(Invoice),
7135            "subscription" => Ok(Subscription),
7136            v => {
7137                tracing::warn!(
7138                    "Unknown value '{}' for enum '{}'",
7139                    v,
7140                    "UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor"
7141                );
7142                Ok(Unknown(v.to_owned()))
7143            }
7144        }
7145    }
7146}
7147impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
7148    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7149        f.write_str(self.as_str())
7150    }
7151}
7152
7153impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
7154    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7155        f.write_str(self.as_str())
7156    }
7157}
7158impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
7159    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7160    where
7161        S: serde::Serializer,
7162    {
7163        serializer.serialize_str(self.as_str())
7164    }
7165}
7166#[cfg(feature = "deserialize")]
7167impl<'de> serde::Deserialize<'de>
7168    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
7169{
7170    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7171        use std::str::FromStr;
7172        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7173        Ok(Self::from_str(&s).expect("infallible"))
7174    }
7175}
7176/// Payment schedule for the mandate.
7177#[derive(Clone, Eq, PartialEq)]
7178#[non_exhaustive]
7179pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
7180    Combined,
7181    Interval,
7182    Sporadic,
7183    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7184    Unknown(String),
7185}
7186impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
7187    pub fn as_str(&self) -> &str {
7188        use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
7189        match self {
7190            Combined => "combined",
7191            Interval => "interval",
7192            Sporadic => "sporadic",
7193            Unknown(v) => v,
7194        }
7195    }
7196}
7197
7198impl std::str::FromStr
7199    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
7200{
7201    type Err = std::convert::Infallible;
7202    fn from_str(s: &str) -> Result<Self, Self::Err> {
7203        use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
7204        match s {
7205            "combined" => Ok(Combined),
7206            "interval" => Ok(Interval),
7207            "sporadic" => Ok(Sporadic),
7208            v => {
7209                tracing::warn!(
7210                    "Unknown value '{}' for enum '{}'",
7211                    v,
7212                    "UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"
7213                );
7214                Ok(Unknown(v.to_owned()))
7215            }
7216        }
7217    }
7218}
7219impl std::fmt::Display
7220    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
7221{
7222    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7223        f.write_str(self.as_str())
7224    }
7225}
7226
7227impl std::fmt::Debug
7228    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
7229{
7230    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7231        f.write_str(self.as_str())
7232    }
7233}
7234impl serde::Serialize
7235    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
7236{
7237    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7238    where
7239        S: serde::Serializer,
7240    {
7241        serializer.serialize_str(self.as_str())
7242    }
7243}
7244#[cfg(feature = "deserialize")]
7245impl<'de> serde::Deserialize<'de>
7246    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
7247{
7248    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7249        use std::str::FromStr;
7250        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7251        Ok(Self::from_str(&s).expect("infallible"))
7252    }
7253}
7254/// Transaction type of the mandate.
7255#[derive(Clone, Eq, PartialEq)]
7256#[non_exhaustive]
7257pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
7258    Business,
7259    Personal,
7260    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7261    Unknown(String),
7262}
7263impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
7264    pub fn as_str(&self) -> &str {
7265        use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
7266        match self {
7267            Business => "business",
7268            Personal => "personal",
7269            Unknown(v) => v,
7270        }
7271    }
7272}
7273
7274impl std::str::FromStr
7275    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
7276{
7277    type Err = std::convert::Infallible;
7278    fn from_str(s: &str) -> Result<Self, Self::Err> {
7279        use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
7280        match s {
7281            "business" => Ok(Business),
7282            "personal" => Ok(Personal),
7283            v => {
7284                tracing::warn!(
7285                    "Unknown value '{}' for enum '{}'",
7286                    v,
7287                    "UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"
7288                );
7289                Ok(Unknown(v.to_owned()))
7290            }
7291        }
7292    }
7293}
7294impl std::fmt::Display
7295    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
7296{
7297    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7298        f.write_str(self.as_str())
7299    }
7300}
7301
7302impl std::fmt::Debug
7303    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
7304{
7305    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7306        f.write_str(self.as_str())
7307    }
7308}
7309impl serde::Serialize
7310    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
7311{
7312    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7313    where
7314        S: serde::Serializer,
7315    {
7316        serializer.serialize_str(self.as_str())
7317    }
7318}
7319#[cfg(feature = "deserialize")]
7320impl<'de> serde::Deserialize<'de>
7321    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
7322{
7323    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7324        use std::str::FromStr;
7325        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7326        Ok(Self::from_str(&s).expect("infallible"))
7327    }
7328}
7329/// Bank account verification method.
7330#[derive(Clone, Eq, PartialEq)]
7331#[non_exhaustive]
7332pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
7333    Automatic,
7334    Instant,
7335    Microdeposits,
7336    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7337    Unknown(String),
7338}
7339impl UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
7340    pub fn as_str(&self) -> &str {
7341        use UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
7342        match self {
7343            Automatic => "automatic",
7344            Instant => "instant",
7345            Microdeposits => "microdeposits",
7346            Unknown(v) => v,
7347        }
7348    }
7349}
7350
7351impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
7352    type Err = std::convert::Infallible;
7353    fn from_str(s: &str) -> Result<Self, Self::Err> {
7354        use UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
7355        match s {
7356            "automatic" => Ok(Automatic),
7357            "instant" => Ok(Instant),
7358            "microdeposits" => Ok(Microdeposits),
7359            v => {
7360                tracing::warn!(
7361                    "Unknown value '{}' for enum '{}'",
7362                    v,
7363                    "UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod"
7364                );
7365                Ok(Unknown(v.to_owned()))
7366            }
7367        }
7368    }
7369}
7370impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
7371    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7372        f.write_str(self.as_str())
7373    }
7374}
7375
7376impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
7377    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7378        f.write_str(self.as_str())
7379    }
7380}
7381impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
7382    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7383    where
7384        S: serde::Serializer,
7385    {
7386        serializer.serialize_str(self.as_str())
7387    }
7388}
7389#[cfg(feature = "deserialize")]
7390impl<'de> serde::Deserialize<'de>
7391    for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod
7392{
7393    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7394        use std::str::FromStr;
7395        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7396        Ok(Self::from_str(&s).expect("infallible"))
7397    }
7398}
7399/// If this is a `bacs_debit` SetupIntent, this sub-hash contains details about the Bacs Debit payment method options.
7400#[derive(Clone, Debug, serde::Serialize)]
7401pub struct UpdateSetupIntentPaymentMethodOptionsBacsDebit {
7402    /// Additional fields for Mandate creation
7403    #[serde(skip_serializing_if = "Option::is_none")]
7404    pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
7405}
7406impl UpdateSetupIntentPaymentMethodOptionsBacsDebit {
7407    pub fn new() -> Self {
7408        Self { mandate_options: None }
7409    }
7410}
7411impl Default for UpdateSetupIntentPaymentMethodOptionsBacsDebit {
7412    fn default() -> Self {
7413        Self::new()
7414    }
7415}
7416/// Configuration for any card setup attempted on this SetupIntent.
7417#[derive(Clone, Debug, serde::Serialize)]
7418pub struct UpdateSetupIntentPaymentMethodOptionsCard {
7419    /// Configuration options for setting up an eMandate for cards issued in India.
7420    #[serde(skip_serializing_if = "Option::is_none")]
7421    pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsCardMandateOptions>,
7422    /// When specified, this parameter signals that a card has been collected
7423    /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This
7424    /// parameter can only be provided during confirmation.
7425    #[serde(skip_serializing_if = "Option::is_none")]
7426    pub moto: Option<bool>,
7427    /// Selected network to process this SetupIntent on.
7428    /// Depends on the available networks of the card attached to the SetupIntent.
7429    /// Can be only set confirm-time.
7430    #[serde(skip_serializing_if = "Option::is_none")]
7431    pub network: Option<UpdateSetupIntentPaymentMethodOptionsCardNetwork>,
7432    /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication).
7433    /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
7434    /// If not provided, this value defaults to `automatic`.
7435    /// Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
7436    #[serde(skip_serializing_if = "Option::is_none")]
7437    pub request_three_d_secure:
7438        Option<UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure>,
7439    /// If 3D Secure authentication was performed with a third-party provider,
7440    /// the authentication details to use for this setup.
7441    #[serde(skip_serializing_if = "Option::is_none")]
7442    pub three_d_secure: Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure>,
7443}
7444impl UpdateSetupIntentPaymentMethodOptionsCard {
7445    pub fn new() -> Self {
7446        Self {
7447            mandate_options: None,
7448            moto: None,
7449            network: None,
7450            request_three_d_secure: None,
7451            three_d_secure: None,
7452        }
7453    }
7454}
7455impl Default for UpdateSetupIntentPaymentMethodOptionsCard {
7456    fn default() -> Self {
7457        Self::new()
7458    }
7459}
7460/// Configuration options for setting up an eMandate for cards issued in India.
7461#[derive(Clone, Debug, serde::Serialize)]
7462pub struct UpdateSetupIntentPaymentMethodOptionsCardMandateOptions {
7463    /// Amount to be charged for future payments.
7464    pub amount: i64,
7465    /// One of `fixed` or `maximum`.
7466    /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
7467    /// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
7468    pub amount_type: UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType,
7469    /// Currency in which future payments will be charged.
7470    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
7471    /// Must be a [supported currency](https://stripe.com/docs/currencies).
7472    pub currency: stripe_types::Currency,
7473    /// A description of the mandate or subscription that is meant to be displayed to the customer.
7474    #[serde(skip_serializing_if = "Option::is_none")]
7475    pub description: Option<String>,
7476    /// End date of the mandate or subscription.
7477    /// If not provided, the mandate will be active until canceled.
7478    /// If provided, end date should be after start date.
7479    #[serde(skip_serializing_if = "Option::is_none")]
7480    pub end_date: Option<stripe_types::Timestamp>,
7481    /// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
7482    pub interval: UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval,
7483    /// The number of intervals between payments.
7484    /// For example, `interval=month` and `interval_count=3` indicates one payment every three months.
7485    /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).
7486    /// This parameter is optional when `interval=sporadic`.
7487    #[serde(skip_serializing_if = "Option::is_none")]
7488    pub interval_count: Option<u64>,
7489    /// Unique identifier for the mandate or subscription.
7490    pub reference: String,
7491    /// Start date of the mandate or subscription. Start date should not be lesser than yesterday.
7492    pub start_date: stripe_types::Timestamp,
7493    /// Specifies the type of mandates supported. Possible values are `india`.
7494    #[serde(skip_serializing_if = "Option::is_none")]
7495    pub supported_types:
7496        Option<Vec<UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
7497}
7498impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptions {
7499    pub fn new(
7500        amount: impl Into<i64>,
7501        amount_type: impl Into<UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
7502        currency: impl Into<stripe_types::Currency>,
7503        interval: impl Into<UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval>,
7504        reference: impl Into<String>,
7505        start_date: impl Into<stripe_types::Timestamp>,
7506    ) -> Self {
7507        Self {
7508            amount: amount.into(),
7509            amount_type: amount_type.into(),
7510            currency: currency.into(),
7511            description: None,
7512            end_date: None,
7513            interval: interval.into(),
7514            interval_count: None,
7515            reference: reference.into(),
7516            start_date: start_date.into(),
7517            supported_types: None,
7518        }
7519    }
7520}
7521/// One of `fixed` or `maximum`.
7522/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
7523/// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
7524#[derive(Clone, Eq, PartialEq)]
7525#[non_exhaustive]
7526pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
7527    Fixed,
7528    Maximum,
7529    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7530    Unknown(String),
7531}
7532impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
7533    pub fn as_str(&self) -> &str {
7534        use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
7535        match self {
7536            Fixed => "fixed",
7537            Maximum => "maximum",
7538            Unknown(v) => v,
7539        }
7540    }
7541}
7542
7543impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
7544    type Err = std::convert::Infallible;
7545    fn from_str(s: &str) -> Result<Self, Self::Err> {
7546        use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
7547        match s {
7548            "fixed" => Ok(Fixed),
7549            "maximum" => Ok(Maximum),
7550            v => {
7551                tracing::warn!(
7552                    "Unknown value '{}' for enum '{}'",
7553                    v,
7554                    "UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType"
7555                );
7556                Ok(Unknown(v.to_owned()))
7557            }
7558        }
7559    }
7560}
7561impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
7562    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7563        f.write_str(self.as_str())
7564    }
7565}
7566
7567impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
7568    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7569        f.write_str(self.as_str())
7570    }
7571}
7572impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
7573    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7574    where
7575        S: serde::Serializer,
7576    {
7577        serializer.serialize_str(self.as_str())
7578    }
7579}
7580#[cfg(feature = "deserialize")]
7581impl<'de> serde::Deserialize<'de>
7582    for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType
7583{
7584    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7585        use std::str::FromStr;
7586        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7587        Ok(Self::from_str(&s).expect("infallible"))
7588    }
7589}
7590/// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
7591#[derive(Clone, Eq, PartialEq)]
7592#[non_exhaustive]
7593pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
7594    Day,
7595    Month,
7596    Sporadic,
7597    Week,
7598    Year,
7599    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7600    Unknown(String),
7601}
7602impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
7603    pub fn as_str(&self) -> &str {
7604        use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
7605        match self {
7606            Day => "day",
7607            Month => "month",
7608            Sporadic => "sporadic",
7609            Week => "week",
7610            Year => "year",
7611            Unknown(v) => v,
7612        }
7613    }
7614}
7615
7616impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
7617    type Err = std::convert::Infallible;
7618    fn from_str(s: &str) -> Result<Self, Self::Err> {
7619        use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
7620        match s {
7621            "day" => Ok(Day),
7622            "month" => Ok(Month),
7623            "sporadic" => Ok(Sporadic),
7624            "week" => Ok(Week),
7625            "year" => Ok(Year),
7626            v => {
7627                tracing::warn!(
7628                    "Unknown value '{}' for enum '{}'",
7629                    v,
7630                    "UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval"
7631                );
7632                Ok(Unknown(v.to_owned()))
7633            }
7634        }
7635    }
7636}
7637impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
7638    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7639        f.write_str(self.as_str())
7640    }
7641}
7642
7643impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
7644    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7645        f.write_str(self.as_str())
7646    }
7647}
7648impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
7649    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7650    where
7651        S: serde::Serializer,
7652    {
7653        serializer.serialize_str(self.as_str())
7654    }
7655}
7656#[cfg(feature = "deserialize")]
7657impl<'de> serde::Deserialize<'de>
7658    for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval
7659{
7660    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7661        use std::str::FromStr;
7662        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7663        Ok(Self::from_str(&s).expect("infallible"))
7664    }
7665}
7666/// Specifies the type of mandates supported. Possible values are `india`.
7667#[derive(Clone, Eq, PartialEq)]
7668#[non_exhaustive]
7669pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
7670    India,
7671    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7672    Unknown(String),
7673}
7674impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
7675    pub fn as_str(&self) -> &str {
7676        use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
7677        match self {
7678            India => "india",
7679            Unknown(v) => v,
7680        }
7681    }
7682}
7683
7684impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
7685    type Err = std::convert::Infallible;
7686    fn from_str(s: &str) -> Result<Self, Self::Err> {
7687        use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
7688        match s {
7689            "india" => Ok(India),
7690            v => {
7691                tracing::warn!(
7692                    "Unknown value '{}' for enum '{}'",
7693                    v,
7694                    "UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"
7695                );
7696                Ok(Unknown(v.to_owned()))
7697            }
7698        }
7699    }
7700}
7701impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
7702    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7703        f.write_str(self.as_str())
7704    }
7705}
7706
7707impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
7708    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7709        f.write_str(self.as_str())
7710    }
7711}
7712impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
7713    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7714    where
7715        S: serde::Serializer,
7716    {
7717        serializer.serialize_str(self.as_str())
7718    }
7719}
7720#[cfg(feature = "deserialize")]
7721impl<'de> serde::Deserialize<'de>
7722    for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
7723{
7724    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7725        use std::str::FromStr;
7726        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7727        Ok(Self::from_str(&s).expect("infallible"))
7728    }
7729}
7730/// Selected network to process this SetupIntent on.
7731/// Depends on the available networks of the card attached to the SetupIntent.
7732/// Can be only set confirm-time.
7733#[derive(Clone, Eq, PartialEq)]
7734#[non_exhaustive]
7735pub enum UpdateSetupIntentPaymentMethodOptionsCardNetwork {
7736    Amex,
7737    CartesBancaires,
7738    Diners,
7739    Discover,
7740    EftposAu,
7741    Girocard,
7742    Interac,
7743    Jcb,
7744    Link,
7745    Mastercard,
7746    Unionpay,
7747    Unknown,
7748    Visa,
7749    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7750    /// This variant is prefixed with an underscore to avoid conflicts with Stripe's 'Unknown' variant.
7751    _Unknown(String),
7752}
7753impl UpdateSetupIntentPaymentMethodOptionsCardNetwork {
7754    pub fn as_str(&self) -> &str {
7755        use UpdateSetupIntentPaymentMethodOptionsCardNetwork::*;
7756        match self {
7757            Amex => "amex",
7758            CartesBancaires => "cartes_bancaires",
7759            Diners => "diners",
7760            Discover => "discover",
7761            EftposAu => "eftpos_au",
7762            Girocard => "girocard",
7763            Interac => "interac",
7764            Jcb => "jcb",
7765            Link => "link",
7766            Mastercard => "mastercard",
7767            Unionpay => "unionpay",
7768            Unknown => "unknown",
7769            Visa => "visa",
7770            _Unknown(v) => v,
7771        }
7772    }
7773}
7774
7775impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
7776    type Err = std::convert::Infallible;
7777    fn from_str(s: &str) -> Result<Self, Self::Err> {
7778        use UpdateSetupIntentPaymentMethodOptionsCardNetwork::*;
7779        match s {
7780            "amex" => Ok(Amex),
7781            "cartes_bancaires" => Ok(CartesBancaires),
7782            "diners" => Ok(Diners),
7783            "discover" => Ok(Discover),
7784            "eftpos_au" => Ok(EftposAu),
7785            "girocard" => Ok(Girocard),
7786            "interac" => Ok(Interac),
7787            "jcb" => Ok(Jcb),
7788            "link" => Ok(Link),
7789            "mastercard" => Ok(Mastercard),
7790            "unionpay" => Ok(Unionpay),
7791            "unknown" => Ok(Unknown),
7792            "visa" => Ok(Visa),
7793            v => {
7794                tracing::warn!(
7795                    "Unknown value '{}' for enum '{}'",
7796                    v,
7797                    "UpdateSetupIntentPaymentMethodOptionsCardNetwork"
7798                );
7799                Ok(_Unknown(v.to_owned()))
7800            }
7801        }
7802    }
7803}
7804impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
7805    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7806        f.write_str(self.as_str())
7807    }
7808}
7809
7810impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
7811    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7812        f.write_str(self.as_str())
7813    }
7814}
7815impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
7816    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7817    where
7818        S: serde::Serializer,
7819    {
7820        serializer.serialize_str(self.as_str())
7821    }
7822}
7823#[cfg(feature = "deserialize")]
7824impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
7825    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7826        use std::str::FromStr;
7827        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7828        Ok(Self::from_str(&s).expect("infallible"))
7829    }
7830}
7831/// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication).
7832/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
7833/// If not provided, this value defaults to `automatic`.
7834/// Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
7835#[derive(Clone, Eq, PartialEq)]
7836#[non_exhaustive]
7837pub enum UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
7838    Any,
7839    Automatic,
7840    Challenge,
7841    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7842    Unknown(String),
7843}
7844impl UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
7845    pub fn as_str(&self) -> &str {
7846        use UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
7847        match self {
7848            Any => "any",
7849            Automatic => "automatic",
7850            Challenge => "challenge",
7851            Unknown(v) => v,
7852        }
7853    }
7854}
7855
7856impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
7857    type Err = std::convert::Infallible;
7858    fn from_str(s: &str) -> Result<Self, Self::Err> {
7859        use UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
7860        match s {
7861            "any" => Ok(Any),
7862            "automatic" => Ok(Automatic),
7863            "challenge" => Ok(Challenge),
7864            v => {
7865                tracing::warn!(
7866                    "Unknown value '{}' for enum '{}'",
7867                    v,
7868                    "UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure"
7869                );
7870                Ok(Unknown(v.to_owned()))
7871            }
7872        }
7873    }
7874}
7875impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
7876    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7877        f.write_str(self.as_str())
7878    }
7879}
7880
7881impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
7882    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7883        f.write_str(self.as_str())
7884    }
7885}
7886impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
7887    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7888    where
7889        S: serde::Serializer,
7890    {
7891        serializer.serialize_str(self.as_str())
7892    }
7893}
7894#[cfg(feature = "deserialize")]
7895impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
7896    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7897        use std::str::FromStr;
7898        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7899        Ok(Self::from_str(&s).expect("infallible"))
7900    }
7901}
7902/// If 3D Secure authentication was performed with a third-party provider,
7903/// the authentication details to use for this setup.
7904#[derive(Clone, Debug, serde::Serialize)]
7905pub struct UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure {
7906    /// The `transStatus` returned from the card Issuer’s ACS in the ARes.
7907    #[serde(skip_serializing_if = "Option::is_none")]
7908    pub ares_trans_status:
7909        Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
7910    /// The cryptogram, also known as the "authentication value" (AAV, CAVV or
7911    /// AEVV). This value is 20 bytes, base64-encoded into a 28-character string.
7912    /// (Most 3D Secure providers will return the base64-encoded version, which
7913    /// is what you should specify here.)
7914    #[serde(skip_serializing_if = "Option::is_none")]
7915    pub cryptogram: Option<String>,
7916    /// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
7917    /// provider and indicates what degree of authentication was performed.
7918    #[serde(skip_serializing_if = "Option::is_none")]
7919    pub electronic_commerce_indicator:
7920        Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
7921    /// Network specific 3DS fields. Network specific arguments require an
7922    /// explicit card brand choice. The parameter `payment_method_options.card.network``
7923    /// must be populated accordingly
7924    #[serde(skip_serializing_if = "Option::is_none")]
7925    pub network_options:
7926        Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
7927    /// The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the
7928    /// AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99.
7929    #[serde(skip_serializing_if = "Option::is_none")]
7930    pub requestor_challenge_indicator: Option<String>,
7931    /// For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server
7932    /// Transaction ID (dsTransID).
7933    #[serde(skip_serializing_if = "Option::is_none")]
7934    pub transaction_id: Option<String>,
7935    /// The version of 3D Secure that was performed.
7936    #[serde(skip_serializing_if = "Option::is_none")]
7937    pub version: Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion>,
7938}
7939impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure {
7940    pub fn new() -> Self {
7941        Self {
7942            ares_trans_status: None,
7943            cryptogram: None,
7944            electronic_commerce_indicator: None,
7945            network_options: None,
7946            requestor_challenge_indicator: None,
7947            transaction_id: None,
7948            version: None,
7949        }
7950    }
7951}
7952impl Default for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure {
7953    fn default() -> Self {
7954        Self::new()
7955    }
7956}
7957/// The `transStatus` returned from the card Issuer’s ACS in the ARes.
7958#[derive(Clone, Eq, PartialEq)]
7959#[non_exhaustive]
7960pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
7961    A,
7962    C,
7963    I,
7964    N,
7965    R,
7966    U,
7967    Y,
7968    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7969    Unknown(String),
7970}
7971impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
7972    pub fn as_str(&self) -> &str {
7973        use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
7974        match self {
7975            A => "A",
7976            C => "C",
7977            I => "I",
7978            N => "N",
7979            R => "R",
7980            U => "U",
7981            Y => "Y",
7982            Unknown(v) => v,
7983        }
7984    }
7985}
7986
7987impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
7988    type Err = std::convert::Infallible;
7989    fn from_str(s: &str) -> Result<Self, Self::Err> {
7990        use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
7991        match s {
7992            "A" => Ok(A),
7993            "C" => Ok(C),
7994            "I" => Ok(I),
7995            "N" => Ok(N),
7996            "R" => Ok(R),
7997            "U" => Ok(U),
7998            "Y" => Ok(Y),
7999            v => {
8000                tracing::warn!(
8001                    "Unknown value '{}' for enum '{}'",
8002                    v,
8003                    "UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"
8004                );
8005                Ok(Unknown(v.to_owned()))
8006            }
8007        }
8008    }
8009}
8010impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
8011    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8012        f.write_str(self.as_str())
8013    }
8014}
8015
8016impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
8017    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8018        f.write_str(self.as_str())
8019    }
8020}
8021impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
8022    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8023    where
8024        S: serde::Serializer,
8025    {
8026        serializer.serialize_str(self.as_str())
8027    }
8028}
8029#[cfg(feature = "deserialize")]
8030impl<'de> serde::Deserialize<'de>
8031    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
8032{
8033    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8034        use std::str::FromStr;
8035        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8036        Ok(Self::from_str(&s).expect("infallible"))
8037    }
8038}
8039/// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
8040/// provider and indicates what degree of authentication was performed.
8041#[derive(Clone, Eq, PartialEq)]
8042#[non_exhaustive]
8043pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
8044    V01,
8045    V02,
8046    V05,
8047    V06,
8048    V07,
8049    /// An unrecognized value from Stripe. Should not be used as a request parameter.
8050    Unknown(String),
8051}
8052impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
8053    pub fn as_str(&self) -> &str {
8054        use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
8055        match self {
8056            V01 => "01",
8057            V02 => "02",
8058            V05 => "05",
8059            V06 => "06",
8060            V07 => "07",
8061            Unknown(v) => v,
8062        }
8063    }
8064}
8065
8066impl std::str::FromStr
8067    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
8068{
8069    type Err = std::convert::Infallible;
8070    fn from_str(s: &str) -> Result<Self, Self::Err> {
8071        use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
8072        match s {
8073            "01" => Ok(V01),
8074            "02" => Ok(V02),
8075            "05" => Ok(V05),
8076            "06" => Ok(V06),
8077            "07" => Ok(V07),
8078            v => {
8079                tracing::warn!(
8080                    "Unknown value '{}' for enum '{}'",
8081                    v,
8082                    "UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"
8083                );
8084                Ok(Unknown(v.to_owned()))
8085            }
8086        }
8087    }
8088}
8089impl std::fmt::Display
8090    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
8091{
8092    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8093        f.write_str(self.as_str())
8094    }
8095}
8096
8097impl std::fmt::Debug
8098    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
8099{
8100    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8101        f.write_str(self.as_str())
8102    }
8103}
8104impl serde::Serialize
8105    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
8106{
8107    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8108    where
8109        S: serde::Serializer,
8110    {
8111        serializer.serialize_str(self.as_str())
8112    }
8113}
8114#[cfg(feature = "deserialize")]
8115impl<'de> serde::Deserialize<'de>
8116    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
8117{
8118    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8119        use std::str::FromStr;
8120        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8121        Ok(Self::from_str(&s).expect("infallible"))
8122    }
8123}
8124/// Network specific 3DS fields. Network specific arguments require an
8125/// explicit card brand choice. The parameter `payment_method_options.card.network``
8126/// must be populated accordingly
8127#[derive(Clone, Debug, serde::Serialize)]
8128pub struct UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
8129    /// Cartes Bancaires-specific 3DS fields.
8130    #[serde(skip_serializing_if = "Option::is_none")]
8131    pub cartes_bancaires:
8132        Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires>,
8133}
8134impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
8135    pub fn new() -> Self {
8136        Self { cartes_bancaires: None }
8137    }
8138}
8139impl Default for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
8140    fn default() -> Self {
8141        Self::new()
8142    }
8143}
8144/// Cartes Bancaires-specific 3DS fields.
8145#[derive(Clone, Debug, serde::Serialize)]
8146pub struct UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
8147    /// The cryptogram calculation algorithm used by the card Issuer's ACS
8148    /// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
8149    /// messageExtension: CB-AVALGO
8150    pub cb_avalgo:
8151        UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
8152    /// The exemption indicator returned from Cartes Bancaires in the ARes.
8153    /// message extension: CB-EXEMPTION; string (4 characters)
8154    /// This is a 3 byte bitmap (low significant byte first and most significant
8155    /// bit first) that has been Base64 encoded
8156    #[serde(skip_serializing_if = "Option::is_none")]
8157    pub cb_exemption: Option<String>,
8158    /// The risk score returned from Cartes Bancaires in the ARes.
8159    /// message extension: CB-SCORE; numeric value 0-99
8160    #[serde(skip_serializing_if = "Option::is_none")]
8161    pub cb_score: Option<i64>,
8162}
8163impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
8164    pub fn new(
8165        cb_avalgo: impl Into<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
8166    ) -> Self {
8167        Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
8168    }
8169}
8170/// The cryptogram calculation algorithm used by the card Issuer's ACS
8171/// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
8172/// messageExtension: CB-AVALGO
8173#[derive(Clone, Eq, PartialEq)]
8174#[non_exhaustive]
8175pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
8176{
8177    V0,
8178    V1,
8179    V2,
8180    V3,
8181    V4,
8182    A,
8183    /// An unrecognized value from Stripe. Should not be used as a request parameter.
8184    Unknown(String),
8185}
8186impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
8187    pub fn as_str(&self) -> &str {
8188        use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
8189        match self {
8190            V0 => "0",
8191            V1 => "1",
8192            V2 => "2",
8193            V3 => "3",
8194            V4 => "4",
8195            A => "A",
8196            Unknown(v) => v,
8197        }
8198    }
8199}
8200
8201impl std::str::FromStr
8202    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
8203{
8204    type Err = std::convert::Infallible;
8205    fn from_str(s: &str) -> Result<Self, Self::Err> {
8206        use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
8207        match s {
8208            "0" => Ok(V0),
8209            "1" => Ok(V1),
8210            "2" => Ok(V2),
8211            "3" => Ok(V3),
8212            "4" => Ok(V4),
8213            "A" => Ok(A),
8214            v => {
8215                tracing::warn!(
8216                    "Unknown value '{}' for enum '{}'",
8217                    v,
8218                    "UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"
8219                );
8220                Ok(Unknown(v.to_owned()))
8221            }
8222        }
8223    }
8224}
8225impl std::fmt::Display
8226    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
8227{
8228    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8229        f.write_str(self.as_str())
8230    }
8231}
8232
8233impl std::fmt::Debug
8234    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
8235{
8236    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8237        f.write_str(self.as_str())
8238    }
8239}
8240impl serde::Serialize
8241    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
8242{
8243    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8244    where
8245        S: serde::Serializer,
8246    {
8247        serializer.serialize_str(self.as_str())
8248    }
8249}
8250#[cfg(feature = "deserialize")]
8251impl<'de> serde::Deserialize<'de>
8252    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
8253{
8254    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8255        use std::str::FromStr;
8256        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8257        Ok(Self::from_str(&s).expect("infallible"))
8258    }
8259}
8260/// The version of 3D Secure that was performed.
8261#[derive(Clone, Eq, PartialEq)]
8262#[non_exhaustive]
8263pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
8264    V1_0_2,
8265    V2_1_0,
8266    V2_2_0,
8267    /// An unrecognized value from Stripe. Should not be used as a request parameter.
8268    Unknown(String),
8269}
8270impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
8271    pub fn as_str(&self) -> &str {
8272        use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
8273        match self {
8274            V1_0_2 => "1.0.2",
8275            V2_1_0 => "2.1.0",
8276            V2_2_0 => "2.2.0",
8277            Unknown(v) => v,
8278        }
8279    }
8280}
8281
8282impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
8283    type Err = std::convert::Infallible;
8284    fn from_str(s: &str) -> Result<Self, Self::Err> {
8285        use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
8286        match s {
8287            "1.0.2" => Ok(V1_0_2),
8288            "2.1.0" => Ok(V2_1_0),
8289            "2.2.0" => Ok(V2_2_0),
8290            v => {
8291                tracing::warn!(
8292                    "Unknown value '{}' for enum '{}'",
8293                    v,
8294                    "UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion"
8295                );
8296                Ok(Unknown(v.to_owned()))
8297            }
8298        }
8299    }
8300}
8301impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
8302    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8303        f.write_str(self.as_str())
8304    }
8305}
8306
8307impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
8308    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8309        f.write_str(self.as_str())
8310    }
8311}
8312impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
8313    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8314    where
8315        S: serde::Serializer,
8316    {
8317        serializer.serialize_str(self.as_str())
8318    }
8319}
8320#[cfg(feature = "deserialize")]
8321impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
8322    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8323        use std::str::FromStr;
8324        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8325        Ok(Self::from_str(&s).expect("infallible"))
8326    }
8327}
8328/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options.
8329#[derive(Clone, Debug, serde::Serialize)]
8330pub struct UpdateSetupIntentPaymentMethodOptionsKlarna {
8331    /// The currency of the SetupIntent. Three letter ISO currency code.
8332    #[serde(skip_serializing_if = "Option::is_none")]
8333    pub currency: Option<stripe_types::Currency>,
8334    /// On-demand details if setting up a payment method for on-demand payments.
8335    #[serde(skip_serializing_if = "Option::is_none")]
8336    pub on_demand: Option<UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemand>,
8337    /// Preferred language of the Klarna authorization page that the customer is redirected to
8338    #[serde(skip_serializing_if = "Option::is_none")]
8339    pub preferred_locale: Option<UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale>,
8340    /// Subscription details if setting up or charging a subscription
8341    #[serde(skip_serializing_if = "Option::is_none")]
8342    pub subscriptions: Option<Vec<UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptions>>,
8343}
8344impl UpdateSetupIntentPaymentMethodOptionsKlarna {
8345    pub fn new() -> Self {
8346        Self { currency: None, on_demand: None, preferred_locale: None, subscriptions: None }
8347    }
8348}
8349impl Default for UpdateSetupIntentPaymentMethodOptionsKlarna {
8350    fn default() -> Self {
8351        Self::new()
8352    }
8353}
8354/// On-demand details if setting up a payment method for on-demand payments.
8355#[derive(Clone, Debug, serde::Serialize)]
8356pub struct UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
8357    /// Your average amount value.
8358    /// You can use a value across your customer base, or segment based on customer type, country, etc.
8359    #[serde(skip_serializing_if = "Option::is_none")]
8360    pub average_amount: Option<i64>,
8361    /// The maximum value you may charge a customer per purchase.
8362    /// You can use a value across your customer base, or segment based on customer type, country, etc.
8363    #[serde(skip_serializing_if = "Option::is_none")]
8364    pub maximum_amount: Option<i64>,
8365    /// The lowest or minimum value you may charge a customer per purchase.
8366    /// You can use a value across your customer base, or segment based on customer type, country, etc.
8367    #[serde(skip_serializing_if = "Option::is_none")]
8368    pub minimum_amount: Option<i64>,
8369    /// Interval at which the customer is making purchases
8370    #[serde(skip_serializing_if = "Option::is_none")]
8371    pub purchase_interval:
8372        Option<UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
8373    /// The number of `purchase_interval` between charges
8374    #[serde(skip_serializing_if = "Option::is_none")]
8375    pub purchase_interval_count: Option<u64>,
8376}
8377impl UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
8378    pub fn new() -> Self {
8379        Self {
8380            average_amount: None,
8381            maximum_amount: None,
8382            minimum_amount: None,
8383            purchase_interval: None,
8384            purchase_interval_count: None,
8385        }
8386    }
8387}
8388impl Default for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
8389    fn default() -> Self {
8390        Self::new()
8391    }
8392}
8393/// Interval at which the customer is making purchases
8394#[derive(Clone, Eq, PartialEq)]
8395#[non_exhaustive]
8396pub enum UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
8397    Day,
8398    Month,
8399    Week,
8400    Year,
8401    /// An unrecognized value from Stripe. Should not be used as a request parameter.
8402    Unknown(String),
8403}
8404impl UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
8405    pub fn as_str(&self) -> &str {
8406        use UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
8407        match self {
8408            Day => "day",
8409            Month => "month",
8410            Week => "week",
8411            Year => "year",
8412            Unknown(v) => v,
8413        }
8414    }
8415}
8416
8417impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
8418    type Err = std::convert::Infallible;
8419    fn from_str(s: &str) -> Result<Self, Self::Err> {
8420        use UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
8421        match s {
8422            "day" => Ok(Day),
8423            "month" => Ok(Month),
8424            "week" => Ok(Week),
8425            "year" => Ok(Year),
8426            v => {
8427                tracing::warn!(
8428                    "Unknown value '{}' for enum '{}'",
8429                    v,
8430                    "UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"
8431                );
8432                Ok(Unknown(v.to_owned()))
8433            }
8434        }
8435    }
8436}
8437impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
8438    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8439        f.write_str(self.as_str())
8440    }
8441}
8442
8443impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
8444    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8445        f.write_str(self.as_str())
8446    }
8447}
8448impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
8449    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8450    where
8451        S: serde::Serializer,
8452    {
8453        serializer.serialize_str(self.as_str())
8454    }
8455}
8456#[cfg(feature = "deserialize")]
8457impl<'de> serde::Deserialize<'de>
8458    for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
8459{
8460    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8461        use std::str::FromStr;
8462        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8463        Ok(Self::from_str(&s).expect("infallible"))
8464    }
8465}
8466/// Preferred language of the Klarna authorization page that the customer is redirected to
8467#[derive(Clone, Eq, PartialEq)]
8468#[non_exhaustive]
8469pub enum UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
8470    CsMinusCz,
8471    DaMinusDk,
8472    DeMinusAt,
8473    DeMinusCh,
8474    DeMinusDe,
8475    ElMinusGr,
8476    EnMinusAt,
8477    EnMinusAu,
8478    EnMinusBe,
8479    EnMinusCa,
8480    EnMinusCh,
8481    EnMinusCz,
8482    EnMinusDe,
8483    EnMinusDk,
8484    EnMinusEs,
8485    EnMinusFi,
8486    EnMinusFr,
8487    EnMinusGb,
8488    EnMinusGr,
8489    EnMinusIe,
8490    EnMinusIt,
8491    EnMinusNl,
8492    EnMinusNo,
8493    EnMinusNz,
8494    EnMinusPl,
8495    EnMinusPt,
8496    EnMinusRo,
8497    EnMinusSe,
8498    EnMinusUs,
8499    EsMinusEs,
8500    EsMinusUs,
8501    FiMinusFi,
8502    FrMinusBe,
8503    FrMinusCa,
8504    FrMinusCh,
8505    FrMinusFr,
8506    ItMinusCh,
8507    ItMinusIt,
8508    NbMinusNo,
8509    NlMinusBe,
8510    NlMinusNl,
8511    PlMinusPl,
8512    PtMinusPt,
8513    RoMinusRo,
8514    SvMinusFi,
8515    SvMinusSe,
8516    /// An unrecognized value from Stripe. Should not be used as a request parameter.
8517    Unknown(String),
8518}
8519impl UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
8520    pub fn as_str(&self) -> &str {
8521        use UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
8522        match self {
8523            CsMinusCz => "cs-CZ",
8524            DaMinusDk => "da-DK",
8525            DeMinusAt => "de-AT",
8526            DeMinusCh => "de-CH",
8527            DeMinusDe => "de-DE",
8528            ElMinusGr => "el-GR",
8529            EnMinusAt => "en-AT",
8530            EnMinusAu => "en-AU",
8531            EnMinusBe => "en-BE",
8532            EnMinusCa => "en-CA",
8533            EnMinusCh => "en-CH",
8534            EnMinusCz => "en-CZ",
8535            EnMinusDe => "en-DE",
8536            EnMinusDk => "en-DK",
8537            EnMinusEs => "en-ES",
8538            EnMinusFi => "en-FI",
8539            EnMinusFr => "en-FR",
8540            EnMinusGb => "en-GB",
8541            EnMinusGr => "en-GR",
8542            EnMinusIe => "en-IE",
8543            EnMinusIt => "en-IT",
8544            EnMinusNl => "en-NL",
8545            EnMinusNo => "en-NO",
8546            EnMinusNz => "en-NZ",
8547            EnMinusPl => "en-PL",
8548            EnMinusPt => "en-PT",
8549            EnMinusRo => "en-RO",
8550            EnMinusSe => "en-SE",
8551            EnMinusUs => "en-US",
8552            EsMinusEs => "es-ES",
8553            EsMinusUs => "es-US",
8554            FiMinusFi => "fi-FI",
8555            FrMinusBe => "fr-BE",
8556            FrMinusCa => "fr-CA",
8557            FrMinusCh => "fr-CH",
8558            FrMinusFr => "fr-FR",
8559            ItMinusCh => "it-CH",
8560            ItMinusIt => "it-IT",
8561            NbMinusNo => "nb-NO",
8562            NlMinusBe => "nl-BE",
8563            NlMinusNl => "nl-NL",
8564            PlMinusPl => "pl-PL",
8565            PtMinusPt => "pt-PT",
8566            RoMinusRo => "ro-RO",
8567            SvMinusFi => "sv-FI",
8568            SvMinusSe => "sv-SE",
8569            Unknown(v) => v,
8570        }
8571    }
8572}
8573
8574impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
8575    type Err = std::convert::Infallible;
8576    fn from_str(s: &str) -> Result<Self, Self::Err> {
8577        use UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
8578        match s {
8579            "cs-CZ" => Ok(CsMinusCz),
8580            "da-DK" => Ok(DaMinusDk),
8581            "de-AT" => Ok(DeMinusAt),
8582            "de-CH" => Ok(DeMinusCh),
8583            "de-DE" => Ok(DeMinusDe),
8584            "el-GR" => Ok(ElMinusGr),
8585            "en-AT" => Ok(EnMinusAt),
8586            "en-AU" => Ok(EnMinusAu),
8587            "en-BE" => Ok(EnMinusBe),
8588            "en-CA" => Ok(EnMinusCa),
8589            "en-CH" => Ok(EnMinusCh),
8590            "en-CZ" => Ok(EnMinusCz),
8591            "en-DE" => Ok(EnMinusDe),
8592            "en-DK" => Ok(EnMinusDk),
8593            "en-ES" => Ok(EnMinusEs),
8594            "en-FI" => Ok(EnMinusFi),
8595            "en-FR" => Ok(EnMinusFr),
8596            "en-GB" => Ok(EnMinusGb),
8597            "en-GR" => Ok(EnMinusGr),
8598            "en-IE" => Ok(EnMinusIe),
8599            "en-IT" => Ok(EnMinusIt),
8600            "en-NL" => Ok(EnMinusNl),
8601            "en-NO" => Ok(EnMinusNo),
8602            "en-NZ" => Ok(EnMinusNz),
8603            "en-PL" => Ok(EnMinusPl),
8604            "en-PT" => Ok(EnMinusPt),
8605            "en-RO" => Ok(EnMinusRo),
8606            "en-SE" => Ok(EnMinusSe),
8607            "en-US" => Ok(EnMinusUs),
8608            "es-ES" => Ok(EsMinusEs),
8609            "es-US" => Ok(EsMinusUs),
8610            "fi-FI" => Ok(FiMinusFi),
8611            "fr-BE" => Ok(FrMinusBe),
8612            "fr-CA" => Ok(FrMinusCa),
8613            "fr-CH" => Ok(FrMinusCh),
8614            "fr-FR" => Ok(FrMinusFr),
8615            "it-CH" => Ok(ItMinusCh),
8616            "it-IT" => Ok(ItMinusIt),
8617            "nb-NO" => Ok(NbMinusNo),
8618            "nl-BE" => Ok(NlMinusBe),
8619            "nl-NL" => Ok(NlMinusNl),
8620            "pl-PL" => Ok(PlMinusPl),
8621            "pt-PT" => Ok(PtMinusPt),
8622            "ro-RO" => Ok(RoMinusRo),
8623            "sv-FI" => Ok(SvMinusFi),
8624            "sv-SE" => Ok(SvMinusSe),
8625            v => {
8626                tracing::warn!(
8627                    "Unknown value '{}' for enum '{}'",
8628                    v,
8629                    "UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale"
8630                );
8631                Ok(Unknown(v.to_owned()))
8632            }
8633        }
8634    }
8635}
8636impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
8637    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8638        f.write_str(self.as_str())
8639    }
8640}
8641
8642impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
8643    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8644        f.write_str(self.as_str())
8645    }
8646}
8647impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
8648    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8649    where
8650        S: serde::Serializer,
8651    {
8652        serializer.serialize_str(self.as_str())
8653    }
8654}
8655#[cfg(feature = "deserialize")]
8656impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
8657    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8658        use std::str::FromStr;
8659        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8660        Ok(Self::from_str(&s).expect("infallible"))
8661    }
8662}
8663/// Subscription details if setting up or charging a subscription
8664#[derive(Clone, Debug, serde::Serialize)]
8665pub struct UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
8666    /// Unit of time between subscription charges.
8667    pub interval: UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
8668    /// The number of intervals (specified in the `interval` attribute) between subscription charges.
8669    /// For example, `interval=month` and `interval_count=3` charges every 3 months.
8670    #[serde(skip_serializing_if = "Option::is_none")]
8671    pub interval_count: Option<u64>,
8672    /// Name for subscription.
8673    #[serde(skip_serializing_if = "Option::is_none")]
8674    pub name: Option<String>,
8675    /// Describes the upcoming charge for this subscription.
8676    pub next_billing: SubscriptionNextBillingParam,
8677    /// A non-customer-facing reference to correlate subscription charges in the Klarna app.
8678    /// Use a value that persists across subscription charges.
8679    pub reference: String,
8680}
8681impl UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
8682    pub fn new(
8683        interval: impl Into<UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
8684        next_billing: impl Into<SubscriptionNextBillingParam>,
8685        reference: impl Into<String>,
8686    ) -> Self {
8687        Self {
8688            interval: interval.into(),
8689            interval_count: None,
8690            name: None,
8691            next_billing: next_billing.into(),
8692            reference: reference.into(),
8693        }
8694    }
8695}
8696/// Unit of time between subscription charges.
8697#[derive(Clone, Eq, PartialEq)]
8698#[non_exhaustive]
8699pub enum UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
8700    Day,
8701    Month,
8702    Week,
8703    Year,
8704    /// An unrecognized value from Stripe. Should not be used as a request parameter.
8705    Unknown(String),
8706}
8707impl UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
8708    pub fn as_str(&self) -> &str {
8709        use UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
8710        match self {
8711            Day => "day",
8712            Month => "month",
8713            Week => "week",
8714            Year => "year",
8715            Unknown(v) => v,
8716        }
8717    }
8718}
8719
8720impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
8721    type Err = std::convert::Infallible;
8722    fn from_str(s: &str) -> Result<Self, Self::Err> {
8723        use UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
8724        match s {
8725            "day" => Ok(Day),
8726            "month" => Ok(Month),
8727            "week" => Ok(Week),
8728            "year" => Ok(Year),
8729            v => {
8730                tracing::warn!(
8731                    "Unknown value '{}' for enum '{}'",
8732                    v,
8733                    "UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"
8734                );
8735                Ok(Unknown(v.to_owned()))
8736            }
8737        }
8738    }
8739}
8740impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
8741    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8742        f.write_str(self.as_str())
8743    }
8744}
8745
8746impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
8747    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8748        f.write_str(self.as_str())
8749    }
8750}
8751impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
8752    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8753    where
8754        S: serde::Serializer,
8755    {
8756        serializer.serialize_str(self.as_str())
8757    }
8758}
8759#[cfg(feature = "deserialize")]
8760impl<'de> serde::Deserialize<'de>
8761    for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
8762{
8763    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8764        use std::str::FromStr;
8765        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8766        Ok(Self::from_str(&s).expect("infallible"))
8767    }
8768}
8769/// If this is a `payto` SetupIntent, this sub-hash contains details about the PayTo payment method options.
8770#[derive(Clone, Debug, serde::Serialize)]
8771pub struct UpdateSetupIntentPaymentMethodOptionsPayto {
8772    /// Additional fields for Mandate creation.
8773    #[serde(skip_serializing_if = "Option::is_none")]
8774    pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptions>,
8775}
8776impl UpdateSetupIntentPaymentMethodOptionsPayto {
8777    pub fn new() -> Self {
8778        Self { mandate_options: None }
8779    }
8780}
8781impl Default for UpdateSetupIntentPaymentMethodOptionsPayto {
8782    fn default() -> Self {
8783        Self::new()
8784    }
8785}
8786/// Additional fields for Mandate creation.
8787#[derive(Clone, Debug, serde::Serialize)]
8788pub struct UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptions {
8789    /// Amount that will be collected. It is required when `amount_type` is `fixed`.
8790    #[serde(skip_serializing_if = "Option::is_none")]
8791    pub amount: Option<i64>,
8792    /// The type of amount that will be collected.
8793    /// The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively.
8794    /// Defaults to `maximum`.
8795    #[serde(skip_serializing_if = "Option::is_none")]
8796    pub amount_type: Option<UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType>,
8797    /// Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date.
8798    #[serde(skip_serializing_if = "Option::is_none")]
8799    pub end_date: Option<String>,
8800    /// The periodicity at which payments will be collected. Defaults to `adhoc`.
8801    #[serde(skip_serializing_if = "Option::is_none")]
8802    pub payment_schedule:
8803        Option<UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule>,
8804    /// The number of payments that will be made during a payment period.
8805    /// Defaults to 1 except for when `payment_schedule` is `adhoc`.
8806    /// In that case, it defaults to no limit.
8807    #[serde(skip_serializing_if = "Option::is_none")]
8808    pub payments_per_period: Option<i64>,
8809    /// The purpose for which payments are made. Has a default value based on your merchant category code.
8810    #[serde(skip_serializing_if = "Option::is_none")]
8811    pub purpose: Option<UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose>,
8812    /// Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to confirmation time.
8813    #[serde(skip_serializing_if = "Option::is_none")]
8814    pub start_date: Option<String>,
8815}
8816impl UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptions {
8817    pub fn new() -> Self {
8818        Self {
8819            amount: None,
8820            amount_type: None,
8821            end_date: None,
8822            payment_schedule: None,
8823            payments_per_period: None,
8824            purpose: None,
8825            start_date: None,
8826        }
8827    }
8828}
8829impl Default for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptions {
8830    fn default() -> Self {
8831        Self::new()
8832    }
8833}
8834/// The type of amount that will be collected.
8835/// The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively.
8836/// Defaults to `maximum`.
8837#[derive(Clone, Eq, PartialEq)]
8838#[non_exhaustive]
8839pub enum UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
8840    Fixed,
8841    Maximum,
8842    /// An unrecognized value from Stripe. Should not be used as a request parameter.
8843    Unknown(String),
8844}
8845impl UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
8846    pub fn as_str(&self) -> &str {
8847        use UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType::*;
8848        match self {
8849            Fixed => "fixed",
8850            Maximum => "maximum",
8851            Unknown(v) => v,
8852        }
8853    }
8854}
8855
8856impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
8857    type Err = std::convert::Infallible;
8858    fn from_str(s: &str) -> Result<Self, Self::Err> {
8859        use UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType::*;
8860        match s {
8861            "fixed" => Ok(Fixed),
8862            "maximum" => Ok(Maximum),
8863            v => {
8864                tracing::warn!(
8865                    "Unknown value '{}' for enum '{}'",
8866                    v,
8867                    "UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType"
8868                );
8869                Ok(Unknown(v.to_owned()))
8870            }
8871        }
8872    }
8873}
8874impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
8875    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8876        f.write_str(self.as_str())
8877    }
8878}
8879
8880impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
8881    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8882        f.write_str(self.as_str())
8883    }
8884}
8885impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
8886    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8887    where
8888        S: serde::Serializer,
8889    {
8890        serializer.serialize_str(self.as_str())
8891    }
8892}
8893#[cfg(feature = "deserialize")]
8894impl<'de> serde::Deserialize<'de>
8895    for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType
8896{
8897    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8898        use std::str::FromStr;
8899        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8900        Ok(Self::from_str(&s).expect("infallible"))
8901    }
8902}
8903/// The periodicity at which payments will be collected. Defaults to `adhoc`.
8904#[derive(Clone, Eq, PartialEq)]
8905#[non_exhaustive]
8906pub enum UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
8907    Adhoc,
8908    Annual,
8909    Daily,
8910    Fortnightly,
8911    Monthly,
8912    Quarterly,
8913    SemiAnnual,
8914    Weekly,
8915    /// An unrecognized value from Stripe. Should not be used as a request parameter.
8916    Unknown(String),
8917}
8918impl UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
8919    pub fn as_str(&self) -> &str {
8920        use UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule::*;
8921        match self {
8922            Adhoc => "adhoc",
8923            Annual => "annual",
8924            Daily => "daily",
8925            Fortnightly => "fortnightly",
8926            Monthly => "monthly",
8927            Quarterly => "quarterly",
8928            SemiAnnual => "semi_annual",
8929            Weekly => "weekly",
8930            Unknown(v) => v,
8931        }
8932    }
8933}
8934
8935impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
8936    type Err = std::convert::Infallible;
8937    fn from_str(s: &str) -> Result<Self, Self::Err> {
8938        use UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule::*;
8939        match s {
8940            "adhoc" => Ok(Adhoc),
8941            "annual" => Ok(Annual),
8942            "daily" => Ok(Daily),
8943            "fortnightly" => Ok(Fortnightly),
8944            "monthly" => Ok(Monthly),
8945            "quarterly" => Ok(Quarterly),
8946            "semi_annual" => Ok(SemiAnnual),
8947            "weekly" => Ok(Weekly),
8948            v => {
8949                tracing::warn!(
8950                    "Unknown value '{}' for enum '{}'",
8951                    v,
8952                    "UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule"
8953                );
8954                Ok(Unknown(v.to_owned()))
8955            }
8956        }
8957    }
8958}
8959impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
8960    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8961        f.write_str(self.as_str())
8962    }
8963}
8964
8965impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
8966    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8967        f.write_str(self.as_str())
8968    }
8969}
8970impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
8971    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8972    where
8973        S: serde::Serializer,
8974    {
8975        serializer.serialize_str(self.as_str())
8976    }
8977}
8978#[cfg(feature = "deserialize")]
8979impl<'de> serde::Deserialize<'de>
8980    for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule
8981{
8982    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8983        use std::str::FromStr;
8984        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8985        Ok(Self::from_str(&s).expect("infallible"))
8986    }
8987}
8988/// The purpose for which payments are made. Has a default value based on your merchant category code.
8989#[derive(Clone, Eq, PartialEq)]
8990#[non_exhaustive]
8991pub enum UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
8992    DependantSupport,
8993    Government,
8994    Loan,
8995    Mortgage,
8996    Other,
8997    Pension,
8998    Personal,
8999    Retail,
9000    Salary,
9001    Tax,
9002    Utility,
9003    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9004    Unknown(String),
9005}
9006impl UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
9007    pub fn as_str(&self) -> &str {
9008        use UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose::*;
9009        match self {
9010            DependantSupport => "dependant_support",
9011            Government => "government",
9012            Loan => "loan",
9013            Mortgage => "mortgage",
9014            Other => "other",
9015            Pension => "pension",
9016            Personal => "personal",
9017            Retail => "retail",
9018            Salary => "salary",
9019            Tax => "tax",
9020            Utility => "utility",
9021            Unknown(v) => v,
9022        }
9023    }
9024}
9025
9026impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
9027    type Err = std::convert::Infallible;
9028    fn from_str(s: &str) -> Result<Self, Self::Err> {
9029        use UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose::*;
9030        match s {
9031            "dependant_support" => Ok(DependantSupport),
9032            "government" => Ok(Government),
9033            "loan" => Ok(Loan),
9034            "mortgage" => Ok(Mortgage),
9035            "other" => Ok(Other),
9036            "pension" => Ok(Pension),
9037            "personal" => Ok(Personal),
9038            "retail" => Ok(Retail),
9039            "salary" => Ok(Salary),
9040            "tax" => Ok(Tax),
9041            "utility" => Ok(Utility),
9042            v => {
9043                tracing::warn!(
9044                    "Unknown value '{}' for enum '{}'",
9045                    v,
9046                    "UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose"
9047                );
9048                Ok(Unknown(v.to_owned()))
9049            }
9050        }
9051    }
9052}
9053impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
9054    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9055        f.write_str(self.as_str())
9056    }
9057}
9058
9059impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
9060    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9061        f.write_str(self.as_str())
9062    }
9063}
9064impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
9065    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9066    where
9067        S: serde::Serializer,
9068    {
9069        serializer.serialize_str(self.as_str())
9070    }
9071}
9072#[cfg(feature = "deserialize")]
9073impl<'de> serde::Deserialize<'de>
9074    for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose
9075{
9076    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9077        use std::str::FromStr;
9078        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9079        Ok(Self::from_str(&s).expect("infallible"))
9080    }
9081}
9082/// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options.
9083#[derive(Clone, Debug, serde::Serialize)]
9084pub struct UpdateSetupIntentPaymentMethodOptionsSepaDebit {
9085    /// Additional fields for Mandate creation
9086    #[serde(skip_serializing_if = "Option::is_none")]
9087    pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions>,
9088}
9089impl UpdateSetupIntentPaymentMethodOptionsSepaDebit {
9090    pub fn new() -> Self {
9091        Self { mandate_options: None }
9092    }
9093}
9094impl Default for UpdateSetupIntentPaymentMethodOptionsSepaDebit {
9095    fn default() -> Self {
9096        Self::new()
9097    }
9098}
9099/// Additional fields for Mandate creation
9100#[derive(Clone, Debug, serde::Serialize)]
9101pub struct UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
9102    /// Prefix used to generate the Mandate reference.
9103    /// Must be at most 12 characters long.
9104    /// Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'.
9105    /// Cannot begin with 'STRIPE'.
9106    #[serde(skip_serializing_if = "Option::is_none")]
9107    pub reference_prefix: Option<String>,
9108}
9109impl UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
9110    pub fn new() -> Self {
9111        Self { reference_prefix: None }
9112    }
9113}
9114impl Default for UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
9115    fn default() -> Self {
9116        Self::new()
9117    }
9118}
9119/// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options.
9120#[derive(Clone, Debug, serde::Serialize)]
9121pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccount {
9122    /// Additional fields for Financial Connections Session creation
9123    #[serde(skip_serializing_if = "Option::is_none")]
9124    pub financial_connections:
9125        Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
9126    /// Additional fields for Mandate creation
9127    #[serde(skip_serializing_if = "Option::is_none")]
9128    pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
9129    /// Additional fields for network related functions
9130    #[serde(skip_serializing_if = "Option::is_none")]
9131    pub networks: Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks>,
9132    /// Bank account verification method.
9133    #[serde(skip_serializing_if = "Option::is_none")]
9134    pub verification_method:
9135        Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
9136}
9137impl UpdateSetupIntentPaymentMethodOptionsUsBankAccount {
9138    pub fn new() -> Self {
9139        Self {
9140            financial_connections: None,
9141            mandate_options: None,
9142            networks: None,
9143            verification_method: None,
9144        }
9145    }
9146}
9147impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccount {
9148    fn default() -> Self {
9149        Self::new()
9150    }
9151}
9152/// Additional fields for Financial Connections Session creation
9153#[derive(Clone, Debug, serde::Serialize)]
9154pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
9155    /// Provide filters for the linked accounts that the customer can select for the payment method.
9156    #[serde(skip_serializing_if = "Option::is_none")]
9157    pub filters:
9158        Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
9159    /// The list of permissions to request.
9160    /// If this parameter is passed, the `payment_method` permission must be included.
9161    /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
9162    #[serde(skip_serializing_if = "Option::is_none")]
9163    pub permissions: Option<
9164        Vec<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
9165    >,
9166    /// List of data features that you would like to retrieve upon account creation.
9167    #[serde(skip_serializing_if = "Option::is_none")]
9168    pub prefetch:
9169        Option<Vec<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>>,
9170    /// For webview integrations only.
9171    /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.
9172    #[serde(skip_serializing_if = "Option::is_none")]
9173    pub return_url: Option<String>,
9174}
9175impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
9176    pub fn new() -> Self {
9177        Self { filters: None, permissions: None, prefetch: None, return_url: None }
9178    }
9179}
9180impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
9181    fn default() -> Self {
9182        Self::new()
9183    }
9184}
9185/// Provide filters for the linked accounts that the customer can select for the payment method.
9186#[derive(Clone, Debug, serde::Serialize)]
9187pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
9188        /// The account subcategories to use to filter for selectable accounts.
9189    /// Valid subcategories are `checking` and `savings`.
9190#[serde(skip_serializing_if = "Option::is_none")]
9191pub account_subcategories: Option<Vec<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
9192
9193}
9194impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
9195    pub fn new() -> Self {
9196        Self { account_subcategories: None }
9197    }
9198}
9199impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
9200    fn default() -> Self {
9201        Self::new()
9202    }
9203}
9204/// The account subcategories to use to filter for selectable accounts.
9205/// Valid subcategories are `checking` and `savings`.
9206#[derive(Clone, Eq, PartialEq)]
9207#[non_exhaustive]
9208pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
9209{
9210    Checking,
9211    Savings,
9212    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9213    Unknown(String),
9214}
9215impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
9216    pub fn as_str(&self) -> &str {
9217        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
9218        match self {
9219Checking => "checking",
9220Savings => "savings",
9221Unknown(v) => v,
9222
9223        }
9224    }
9225}
9226
9227impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
9228    type Err = std::convert::Infallible;
9229    fn from_str(s: &str) -> Result<Self, Self::Err> {
9230        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
9231        match s {
9232    "checking" => Ok(Checking),
9233"savings" => Ok(Savings),
9234v => { tracing::warn!("Unknown value '{}' for enum '{}'", v, "UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"); Ok(Unknown(v.to_owned())) }
9235
9236        }
9237    }
9238}
9239impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
9240    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9241        f.write_str(self.as_str())
9242    }
9243}
9244
9245impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
9246    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9247        f.write_str(self.as_str())
9248    }
9249}
9250impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
9251    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
9252        serializer.serialize_str(self.as_str())
9253    }
9254}
9255#[cfg(feature = "deserialize")]
9256impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
9257    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9258        use std::str::FromStr;
9259        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9260        Ok(Self::from_str(&s).expect("infallible"))
9261    }
9262}
9263/// The list of permissions to request.
9264/// If this parameter is passed, the `payment_method` permission must be included.
9265/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
9266#[derive(Clone, Eq, PartialEq)]
9267#[non_exhaustive]
9268pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
9269    Balances,
9270    Ownership,
9271    PaymentMethod,
9272    Transactions,
9273    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9274    Unknown(String),
9275}
9276impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
9277    pub fn as_str(&self) -> &str {
9278        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
9279        match self {
9280            Balances => "balances",
9281            Ownership => "ownership",
9282            PaymentMethod => "payment_method",
9283            Transactions => "transactions",
9284            Unknown(v) => v,
9285        }
9286    }
9287}
9288
9289impl std::str::FromStr
9290    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
9291{
9292    type Err = std::convert::Infallible;
9293    fn from_str(s: &str) -> Result<Self, Self::Err> {
9294        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
9295        match s {
9296            "balances" => Ok(Balances),
9297            "ownership" => Ok(Ownership),
9298            "payment_method" => Ok(PaymentMethod),
9299            "transactions" => Ok(Transactions),
9300            v => {
9301                tracing::warn!(
9302                    "Unknown value '{}' for enum '{}'",
9303                    v,
9304                    "UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"
9305                );
9306                Ok(Unknown(v.to_owned()))
9307            }
9308        }
9309    }
9310}
9311impl std::fmt::Display
9312    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
9313{
9314    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9315        f.write_str(self.as_str())
9316    }
9317}
9318
9319impl std::fmt::Debug
9320    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
9321{
9322    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9323        f.write_str(self.as_str())
9324    }
9325}
9326impl serde::Serialize
9327    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
9328{
9329    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9330    where
9331        S: serde::Serializer,
9332    {
9333        serializer.serialize_str(self.as_str())
9334    }
9335}
9336#[cfg(feature = "deserialize")]
9337impl<'de> serde::Deserialize<'de>
9338    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
9339{
9340    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9341        use std::str::FromStr;
9342        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9343        Ok(Self::from_str(&s).expect("infallible"))
9344    }
9345}
9346/// List of data features that you would like to retrieve upon account creation.
9347#[derive(Clone, Eq, PartialEq)]
9348#[non_exhaustive]
9349pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
9350    Balances,
9351    Ownership,
9352    Transactions,
9353    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9354    Unknown(String),
9355}
9356impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
9357    pub fn as_str(&self) -> &str {
9358        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
9359        match self {
9360            Balances => "balances",
9361            Ownership => "ownership",
9362            Transactions => "transactions",
9363            Unknown(v) => v,
9364        }
9365    }
9366}
9367
9368impl std::str::FromStr
9369    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
9370{
9371    type Err = std::convert::Infallible;
9372    fn from_str(s: &str) -> Result<Self, Self::Err> {
9373        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
9374        match s {
9375            "balances" => Ok(Balances),
9376            "ownership" => Ok(Ownership),
9377            "transactions" => Ok(Transactions),
9378            v => {
9379                tracing::warn!(
9380                    "Unknown value '{}' for enum '{}'",
9381                    v,
9382                    "UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"
9383                );
9384                Ok(Unknown(v.to_owned()))
9385            }
9386        }
9387    }
9388}
9389impl std::fmt::Display
9390    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
9391{
9392    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9393        f.write_str(self.as_str())
9394    }
9395}
9396
9397impl std::fmt::Debug
9398    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
9399{
9400    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9401        f.write_str(self.as_str())
9402    }
9403}
9404impl serde::Serialize
9405    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
9406{
9407    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9408    where
9409        S: serde::Serializer,
9410    {
9411        serializer.serialize_str(self.as_str())
9412    }
9413}
9414#[cfg(feature = "deserialize")]
9415impl<'de> serde::Deserialize<'de>
9416    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
9417{
9418    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9419        use std::str::FromStr;
9420        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9421        Ok(Self::from_str(&s).expect("infallible"))
9422    }
9423}
9424/// Additional fields for Mandate creation
9425#[derive(Clone, Debug, serde::Serialize)]
9426pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
9427    /// The method used to collect offline mandate customer acceptance.
9428    #[serde(skip_serializing_if = "Option::is_none")]
9429    pub collection_method:
9430        Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
9431}
9432impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
9433    pub fn new() -> Self {
9434        Self { collection_method: None }
9435    }
9436}
9437impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
9438    fn default() -> Self {
9439        Self::new()
9440    }
9441}
9442/// The method used to collect offline mandate customer acceptance.
9443#[derive(Clone, Eq, PartialEq)]
9444#[non_exhaustive]
9445pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
9446    Paper,
9447    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9448    Unknown(String),
9449}
9450impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
9451    pub fn as_str(&self) -> &str {
9452        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
9453        match self {
9454            Paper => "paper",
9455            Unknown(v) => v,
9456        }
9457    }
9458}
9459
9460impl std::str::FromStr
9461    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
9462{
9463    type Err = std::convert::Infallible;
9464    fn from_str(s: &str) -> Result<Self, Self::Err> {
9465        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
9466        match s {
9467            "paper" => Ok(Paper),
9468            v => {
9469                tracing::warn!(
9470                    "Unknown value '{}' for enum '{}'",
9471                    v,
9472                    "UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"
9473                );
9474                Ok(Unknown(v.to_owned()))
9475            }
9476        }
9477    }
9478}
9479impl std::fmt::Display
9480    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
9481{
9482    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9483        f.write_str(self.as_str())
9484    }
9485}
9486
9487impl std::fmt::Debug
9488    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
9489{
9490    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9491        f.write_str(self.as_str())
9492    }
9493}
9494impl serde::Serialize
9495    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
9496{
9497    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9498    where
9499        S: serde::Serializer,
9500    {
9501        serializer.serialize_str(self.as_str())
9502    }
9503}
9504#[cfg(feature = "deserialize")]
9505impl<'de> serde::Deserialize<'de>
9506    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
9507{
9508    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9509        use std::str::FromStr;
9510        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9511        Ok(Self::from_str(&s).expect("infallible"))
9512    }
9513}
9514/// Additional fields for network related functions
9515#[derive(Clone, Debug, serde::Serialize)]
9516pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
9517    /// Triggers validations to run across the selected networks
9518    #[serde(skip_serializing_if = "Option::is_none")]
9519    pub requested: Option<Vec<UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
9520}
9521impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
9522    pub fn new() -> Self {
9523        Self { requested: None }
9524    }
9525}
9526impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
9527    fn default() -> Self {
9528        Self::new()
9529    }
9530}
9531/// Triggers validations to run across the selected networks
9532#[derive(Clone, Eq, PartialEq)]
9533#[non_exhaustive]
9534pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
9535    Ach,
9536    UsDomesticWire,
9537    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9538    Unknown(String),
9539}
9540impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
9541    pub fn as_str(&self) -> &str {
9542        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
9543        match self {
9544            Ach => "ach",
9545            UsDomesticWire => "us_domestic_wire",
9546            Unknown(v) => v,
9547        }
9548    }
9549}
9550
9551impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
9552    type Err = std::convert::Infallible;
9553    fn from_str(s: &str) -> Result<Self, Self::Err> {
9554        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
9555        match s {
9556            "ach" => Ok(Ach),
9557            "us_domestic_wire" => Ok(UsDomesticWire),
9558            v => {
9559                tracing::warn!(
9560                    "Unknown value '{}' for enum '{}'",
9561                    v,
9562                    "UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested"
9563                );
9564                Ok(Unknown(v.to_owned()))
9565            }
9566        }
9567    }
9568}
9569impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
9570    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9571        f.write_str(self.as_str())
9572    }
9573}
9574
9575impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
9576    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9577        f.write_str(self.as_str())
9578    }
9579}
9580impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
9581    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9582    where
9583        S: serde::Serializer,
9584    {
9585        serializer.serialize_str(self.as_str())
9586    }
9587}
9588#[cfg(feature = "deserialize")]
9589impl<'de> serde::Deserialize<'de>
9590    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested
9591{
9592    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9593        use std::str::FromStr;
9594        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9595        Ok(Self::from_str(&s).expect("infallible"))
9596    }
9597}
9598/// Bank account verification method.
9599#[derive(Clone, Eq, PartialEq)]
9600#[non_exhaustive]
9601pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
9602    Automatic,
9603    Instant,
9604    Microdeposits,
9605    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9606    Unknown(String),
9607}
9608impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
9609    pub fn as_str(&self) -> &str {
9610        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
9611        match self {
9612            Automatic => "automatic",
9613            Instant => "instant",
9614            Microdeposits => "microdeposits",
9615            Unknown(v) => v,
9616        }
9617    }
9618}
9619
9620impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
9621    type Err = std::convert::Infallible;
9622    fn from_str(s: &str) -> Result<Self, Self::Err> {
9623        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
9624        match s {
9625            "automatic" => Ok(Automatic),
9626            "instant" => Ok(Instant),
9627            "microdeposits" => Ok(Microdeposits),
9628            v => {
9629                tracing::warn!(
9630                    "Unknown value '{}' for enum '{}'",
9631                    v,
9632                    "UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod"
9633                );
9634                Ok(Unknown(v.to_owned()))
9635            }
9636        }
9637    }
9638}
9639impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
9640    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9641        f.write_str(self.as_str())
9642    }
9643}
9644
9645impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
9646    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9647        f.write_str(self.as_str())
9648    }
9649}
9650impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
9651    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9652    where
9653        S: serde::Serializer,
9654    {
9655        serializer.serialize_str(self.as_str())
9656    }
9657}
9658#[cfg(feature = "deserialize")]
9659impl<'de> serde::Deserialize<'de>
9660    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod
9661{
9662    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9663        use std::str::FromStr;
9664        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9665        Ok(Self::from_str(&s).expect("infallible"))
9666    }
9667}
9668/// Updates a SetupIntent object.
9669#[derive(Clone, Debug, serde::Serialize)]
9670pub struct UpdateSetupIntent {
9671    inner: UpdateSetupIntentBuilder,
9672    intent: stripe_shared::SetupIntentId,
9673}
9674impl UpdateSetupIntent {
9675    /// Construct a new `UpdateSetupIntent`.
9676    pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
9677        Self { intent: intent.into(), inner: UpdateSetupIntentBuilder::new() }
9678    }
9679    /// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.
9680    ///
9681    /// It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers.
9682    /// It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.
9683    pub fn attach_to_self(mut self, attach_to_self: impl Into<bool>) -> Self {
9684        self.inner.attach_to_self = Some(attach_to_self.into());
9685        self
9686    }
9687    /// ID of the Customer this SetupIntent belongs to, if one exists.
9688    ///
9689    /// If present, the SetupIntent's payment method will be attached to the Customer on successful setup.
9690    /// Payment methods attached to other Customers cannot be used with this SetupIntent.
9691    pub fn customer(mut self, customer: impl Into<String>) -> Self {
9692        self.inner.customer = Some(customer.into());
9693        self
9694    }
9695    /// ID of the Account this SetupIntent belongs to, if one exists.
9696    ///
9697    /// If present, the SetupIntent's payment method will be attached to the Account on successful setup.
9698    /// Payment methods attached to other Accounts cannot be used with this SetupIntent.
9699    pub fn customer_account(mut self, customer_account: impl Into<String>) -> Self {
9700        self.inner.customer_account = Some(customer_account.into());
9701        self
9702    }
9703    /// An arbitrary string attached to the object. Often useful for displaying to users.
9704    pub fn description(mut self, description: impl Into<String>) -> Self {
9705        self.inner.description = Some(description.into());
9706        self
9707    }
9708    /// The list of payment method types to exclude from use with this SetupIntent.
9709    pub fn excluded_payment_method_types(
9710        mut self,
9711        excluded_payment_method_types: impl Into<
9712            Vec<stripe_shared::SetupIntentExcludedPaymentMethodTypes>,
9713        >,
9714    ) -> Self {
9715        self.inner.excluded_payment_method_types = Some(excluded_payment_method_types.into());
9716        self
9717    }
9718    /// Specifies which fields in the response should be expanded.
9719    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
9720        self.inner.expand = Some(expand.into());
9721        self
9722    }
9723    /// Indicates the directions of money movement for which this payment method is intended to be used.
9724    ///
9725    /// Include `inbound` if you intend to use the payment method as the origin to pull funds from.
9726    /// Include `outbound` if you intend to use the payment method as the destination to send funds to.
9727    /// You can include both if you intend to use the payment method for both purposes.
9728    pub fn flow_directions(
9729        mut self,
9730        flow_directions: impl Into<Vec<stripe_shared::SetupIntentFlowDirections>>,
9731    ) -> Self {
9732        self.inner.flow_directions = Some(flow_directions.into());
9733        self
9734    }
9735    /// Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object.
9736    /// This can be useful for storing additional information about the object in a structured format.
9737    /// Individual keys can be unset by posting an empty value to them.
9738    /// All keys can be unset by posting an empty value to `metadata`.
9739    pub fn metadata(
9740        mut self,
9741        metadata: impl Into<std::collections::HashMap<String, String>>,
9742    ) -> Self {
9743        self.inner.metadata = Some(metadata.into());
9744        self
9745    }
9746    /// ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent.
9747    /// To unset this field to null, pass in an empty string.
9748    pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
9749        self.inner.payment_method = Some(payment_method.into());
9750        self
9751    }
9752    /// The ID of the [payment method configuration](https://docs.stripe.com/api/payment_method_configurations) to use with this SetupIntent.
9753    pub fn payment_method_configuration(
9754        mut self,
9755        payment_method_configuration: impl Into<String>,
9756    ) -> Self {
9757        self.inner.payment_method_configuration = Some(payment_method_configuration.into());
9758        self
9759    }
9760    /// When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://docs.stripe.com/api/setup_intents/object#setup_intent_object-payment_method).
9761    /// value in the SetupIntent.
9762    pub fn payment_method_data(
9763        mut self,
9764        payment_method_data: impl Into<UpdateSetupIntentPaymentMethodData>,
9765    ) -> Self {
9766        self.inner.payment_method_data = Some(payment_method_data.into());
9767        self
9768    }
9769    /// Payment method-specific configuration for this SetupIntent.
9770    pub fn payment_method_options(
9771        mut self,
9772        payment_method_options: impl Into<UpdateSetupIntentPaymentMethodOptions>,
9773    ) -> Self {
9774        self.inner.payment_method_options = Some(payment_method_options.into());
9775        self
9776    }
9777    /// The list of payment method types (for example, card) that this SetupIntent can set up.
9778    /// 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).
9779    /// A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type).
9780    pub fn payment_method_types(mut self, payment_method_types: impl Into<Vec<String>>) -> Self {
9781        self.inner.payment_method_types = Some(payment_method_types.into());
9782        self
9783    }
9784}
9785impl UpdateSetupIntent {
9786    /// Send the request and return the deserialized response.
9787    pub async fn send<C: StripeClient>(
9788        &self,
9789        client: &C,
9790    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
9791        self.customize().send(client).await
9792    }
9793
9794    /// Send the request and return the deserialized response, blocking until completion.
9795    pub fn send_blocking<C: StripeBlockingClient>(
9796        &self,
9797        client: &C,
9798    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
9799        self.customize().send_blocking(client)
9800    }
9801}
9802
9803impl StripeRequest for UpdateSetupIntent {
9804    type Output = stripe_shared::SetupIntent;
9805
9806    fn build(&self) -> RequestBuilder {
9807        let intent = &self.intent;
9808        RequestBuilder::new(StripeMethod::Post, format!("/setup_intents/{intent}"))
9809            .form(&self.inner)
9810    }
9811}
9812#[derive(Clone, Debug, serde::Serialize)]
9813struct CancelSetupIntentBuilder {
9814    #[serde(skip_serializing_if = "Option::is_none")]
9815    cancellation_reason: Option<stripe_shared::SetupIntentCancellationReason>,
9816    #[serde(skip_serializing_if = "Option::is_none")]
9817    expand: Option<Vec<String>>,
9818}
9819impl CancelSetupIntentBuilder {
9820    fn new() -> Self {
9821        Self { cancellation_reason: None, expand: None }
9822    }
9823}
9824/// You can cancel a SetupIntent object when it’s in one of these statuses: `requires_payment_method`, `requires_confirmation`, or `requires_action`.
9825///
9826///
9827/// After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error.
9828/// You can’t cancel the SetupIntent for a Checkout Session.
9829/// [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead.
9830#[derive(Clone, Debug, serde::Serialize)]
9831pub struct CancelSetupIntent {
9832    inner: CancelSetupIntentBuilder,
9833    intent: stripe_shared::SetupIntentId,
9834}
9835impl CancelSetupIntent {
9836    /// Construct a new `CancelSetupIntent`.
9837    pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
9838        Self { intent: intent.into(), inner: CancelSetupIntentBuilder::new() }
9839    }
9840    /// Reason for canceling this SetupIntent.
9841    /// Possible values are: `abandoned`, `requested_by_customer`, or `duplicate`.
9842    pub fn cancellation_reason(
9843        mut self,
9844        cancellation_reason: impl Into<stripe_shared::SetupIntentCancellationReason>,
9845    ) -> Self {
9846        self.inner.cancellation_reason = Some(cancellation_reason.into());
9847        self
9848    }
9849    /// Specifies which fields in the response should be expanded.
9850    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
9851        self.inner.expand = Some(expand.into());
9852        self
9853    }
9854}
9855impl CancelSetupIntent {
9856    /// Send the request and return the deserialized response.
9857    pub async fn send<C: StripeClient>(
9858        &self,
9859        client: &C,
9860    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
9861        self.customize().send(client).await
9862    }
9863
9864    /// Send the request and return the deserialized response, blocking until completion.
9865    pub fn send_blocking<C: StripeBlockingClient>(
9866        &self,
9867        client: &C,
9868    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
9869        self.customize().send_blocking(client)
9870    }
9871}
9872
9873impl StripeRequest for CancelSetupIntent {
9874    type Output = stripe_shared::SetupIntent;
9875
9876    fn build(&self) -> RequestBuilder {
9877        let intent = &self.intent;
9878        RequestBuilder::new(StripeMethod::Post, format!("/setup_intents/{intent}/cancel"))
9879            .form(&self.inner)
9880    }
9881}
9882#[derive(Clone, Debug, serde::Serialize)]
9883struct ConfirmSetupIntentBuilder {
9884    #[serde(skip_serializing_if = "Option::is_none")]
9885    confirmation_token: Option<String>,
9886    #[serde(skip_serializing_if = "Option::is_none")]
9887    expand: Option<Vec<String>>,
9888    #[serde(skip_serializing_if = "Option::is_none")]
9889    mandate_data: Option<ConfirmSetupIntentMandateData>,
9890    #[serde(skip_serializing_if = "Option::is_none")]
9891    payment_method: Option<String>,
9892    #[serde(skip_serializing_if = "Option::is_none")]
9893    payment_method_data: Option<ConfirmSetupIntentPaymentMethodData>,
9894    #[serde(skip_serializing_if = "Option::is_none")]
9895    payment_method_options: Option<ConfirmSetupIntentPaymentMethodOptions>,
9896    #[serde(skip_serializing_if = "Option::is_none")]
9897    return_url: Option<String>,
9898    #[serde(skip_serializing_if = "Option::is_none")]
9899    use_stripe_sdk: Option<bool>,
9900}
9901impl ConfirmSetupIntentBuilder {
9902    fn new() -> Self {
9903        Self {
9904            confirmation_token: None,
9905            expand: None,
9906            mandate_data: None,
9907            payment_method: None,
9908            payment_method_data: None,
9909            payment_method_options: None,
9910            return_url: None,
9911            use_stripe_sdk: None,
9912        }
9913    }
9914}
9915#[derive(Clone, Debug, serde::Serialize)]
9916#[serde(rename_all = "snake_case")]
9917pub enum ConfirmSetupIntentMandateData {
9918    #[serde(untagged)]
9919    SecretKeyParam(ConfirmSetupIntentSecretKeyParam),
9920    #[serde(untagged)]
9921    ClientKeyParam(ConfirmSetupIntentClientKeyParam),
9922}
9923#[derive(Clone, Debug, serde::Serialize)]
9924pub struct ConfirmSetupIntentSecretKeyParam {
9925    /// This hash contains details about the customer acceptance of the Mandate.
9926    pub customer_acceptance: ConfirmSetupIntentSecretKeyParamCustomerAcceptance,
9927}
9928impl ConfirmSetupIntentSecretKeyParam {
9929    pub fn new(
9930        customer_acceptance: impl Into<ConfirmSetupIntentSecretKeyParamCustomerAcceptance>,
9931    ) -> Self {
9932        Self { customer_acceptance: customer_acceptance.into() }
9933    }
9934}
9935/// This hash contains details about the customer acceptance of the Mandate.
9936#[derive(Clone, Debug, serde::Serialize)]
9937pub struct ConfirmSetupIntentSecretKeyParamCustomerAcceptance {
9938    /// The time at which the customer accepted the Mandate.
9939    #[serde(skip_serializing_if = "Option::is_none")]
9940    pub accepted_at: Option<stripe_types::Timestamp>,
9941    /// If this is a Mandate accepted offline, this hash contains details about the offline acceptance.
9942    #[serde(skip_serializing_if = "Option::is_none")]
9943    #[serde(with = "stripe_types::with_serde_json_opt")]
9944    pub offline: Option<miniserde::json::Value>,
9945    /// If this is a Mandate accepted online, this hash contains details about the online acceptance.
9946    #[serde(skip_serializing_if = "Option::is_none")]
9947    pub online: Option<OnlineParam>,
9948    /// The type of customer acceptance information included with the Mandate.
9949    /// One of `online` or `offline`.
9950    #[serde(rename = "type")]
9951    pub type_: ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType,
9952}
9953impl ConfirmSetupIntentSecretKeyParamCustomerAcceptance {
9954    pub fn new(type_: impl Into<ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType>) -> Self {
9955        Self { accepted_at: None, offline: None, online: None, type_: type_.into() }
9956    }
9957}
9958/// The type of customer acceptance information included with the Mandate.
9959/// One of `online` or `offline`.
9960#[derive(Clone, Eq, PartialEq)]
9961#[non_exhaustive]
9962pub enum ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
9963    Offline,
9964    Online,
9965    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9966    Unknown(String),
9967}
9968impl ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
9969    pub fn as_str(&self) -> &str {
9970        use ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType::*;
9971        match self {
9972            Offline => "offline",
9973            Online => "online",
9974            Unknown(v) => v,
9975        }
9976    }
9977}
9978
9979impl std::str::FromStr for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
9980    type Err = std::convert::Infallible;
9981    fn from_str(s: &str) -> Result<Self, Self::Err> {
9982        use ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType::*;
9983        match s {
9984            "offline" => Ok(Offline),
9985            "online" => Ok(Online),
9986            v => {
9987                tracing::warn!(
9988                    "Unknown value '{}' for enum '{}'",
9989                    v,
9990                    "ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType"
9991                );
9992                Ok(Unknown(v.to_owned()))
9993            }
9994        }
9995    }
9996}
9997impl std::fmt::Display for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
9998    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9999        f.write_str(self.as_str())
10000    }
10001}
10002
10003impl std::fmt::Debug for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
10004    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10005        f.write_str(self.as_str())
10006    }
10007}
10008impl serde::Serialize for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
10009    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10010    where
10011        S: serde::Serializer,
10012    {
10013        serializer.serialize_str(self.as_str())
10014    }
10015}
10016#[cfg(feature = "deserialize")]
10017impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
10018    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10019        use std::str::FromStr;
10020        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10021        Ok(Self::from_str(&s).expect("infallible"))
10022    }
10023}
10024#[derive(Clone, Debug, serde::Serialize)]
10025pub struct ConfirmSetupIntentClientKeyParam {
10026    /// This hash contains details about the customer acceptance of the Mandate.
10027    pub customer_acceptance: ConfirmSetupIntentClientKeyParamCustomerAcceptance,
10028}
10029impl ConfirmSetupIntentClientKeyParam {
10030    pub fn new(
10031        customer_acceptance: impl Into<ConfirmSetupIntentClientKeyParamCustomerAcceptance>,
10032    ) -> Self {
10033        Self { customer_acceptance: customer_acceptance.into() }
10034    }
10035}
10036/// This hash contains details about the customer acceptance of the Mandate.
10037#[derive(Clone, Debug, serde::Serialize)]
10038pub struct ConfirmSetupIntentClientKeyParamCustomerAcceptance {
10039    /// If this is a Mandate accepted online, this hash contains details about the online acceptance.
10040    pub online: ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline,
10041    /// The type of customer acceptance information included with the Mandate.
10042    #[serde(rename = "type")]
10043    pub type_: ConfirmSetupIntentClientKeyParamCustomerAcceptanceType,
10044}
10045impl ConfirmSetupIntentClientKeyParamCustomerAcceptance {
10046    pub fn new(
10047        online: impl Into<ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline>,
10048        type_: impl Into<ConfirmSetupIntentClientKeyParamCustomerAcceptanceType>,
10049    ) -> Self {
10050        Self { online: online.into(), type_: type_.into() }
10051    }
10052}
10053/// If this is a Mandate accepted online, this hash contains details about the online acceptance.
10054#[derive(Clone, Debug, serde::Serialize)]
10055pub struct ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline {
10056    /// The IP address from which the Mandate was accepted by the customer.
10057    #[serde(skip_serializing_if = "Option::is_none")]
10058    pub ip_address: Option<String>,
10059    /// The user agent of the browser from which the Mandate was accepted by the customer.
10060    #[serde(skip_serializing_if = "Option::is_none")]
10061    pub user_agent: Option<String>,
10062}
10063impl ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline {
10064    pub fn new() -> Self {
10065        Self { ip_address: None, user_agent: None }
10066    }
10067}
10068impl Default for ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline {
10069    fn default() -> Self {
10070        Self::new()
10071    }
10072}
10073/// The type of customer acceptance information included with the Mandate.
10074#[derive(Clone, Eq, PartialEq)]
10075#[non_exhaustive]
10076pub enum ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
10077    Online,
10078    /// An unrecognized value from Stripe. Should not be used as a request parameter.
10079    Unknown(String),
10080}
10081impl ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
10082    pub fn as_str(&self) -> &str {
10083        use ConfirmSetupIntentClientKeyParamCustomerAcceptanceType::*;
10084        match self {
10085            Online => "online",
10086            Unknown(v) => v,
10087        }
10088    }
10089}
10090
10091impl std::str::FromStr for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
10092    type Err = std::convert::Infallible;
10093    fn from_str(s: &str) -> Result<Self, Self::Err> {
10094        use ConfirmSetupIntentClientKeyParamCustomerAcceptanceType::*;
10095        match s {
10096            "online" => Ok(Online),
10097            v => {
10098                tracing::warn!(
10099                    "Unknown value '{}' for enum '{}'",
10100                    v,
10101                    "ConfirmSetupIntentClientKeyParamCustomerAcceptanceType"
10102                );
10103                Ok(Unknown(v.to_owned()))
10104            }
10105        }
10106    }
10107}
10108impl std::fmt::Display for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
10109    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10110        f.write_str(self.as_str())
10111    }
10112}
10113
10114impl std::fmt::Debug for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
10115    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10116        f.write_str(self.as_str())
10117    }
10118}
10119impl serde::Serialize for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
10120    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10121    where
10122        S: serde::Serializer,
10123    {
10124        serializer.serialize_str(self.as_str())
10125    }
10126}
10127#[cfg(feature = "deserialize")]
10128impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
10129    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10130        use std::str::FromStr;
10131        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10132        Ok(Self::from_str(&s).expect("infallible"))
10133    }
10134}
10135/// When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://docs.stripe.com/api/setup_intents/object#setup_intent_object-payment_method).
10136/// value in the SetupIntent.
10137#[derive(Clone, Debug, serde::Serialize)]
10138pub struct ConfirmSetupIntentPaymentMethodData {
10139    /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
10140    #[serde(skip_serializing_if = "Option::is_none")]
10141    pub acss_debit: Option<PaymentMethodParam>,
10142    /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
10143    #[serde(skip_serializing_if = "Option::is_none")]
10144    #[serde(with = "stripe_types::with_serde_json_opt")]
10145    pub affirm: Option<miniserde::json::Value>,
10146    /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
10147    #[serde(skip_serializing_if = "Option::is_none")]
10148    #[serde(with = "stripe_types::with_serde_json_opt")]
10149    pub afterpay_clearpay: Option<miniserde::json::Value>,
10150    /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
10151    #[serde(skip_serializing_if = "Option::is_none")]
10152    #[serde(with = "stripe_types::with_serde_json_opt")]
10153    pub alipay: Option<miniserde::json::Value>,
10154    /// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
10155    /// 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.
10156    /// The field defaults to `unspecified`.
10157    #[serde(skip_serializing_if = "Option::is_none")]
10158    pub allow_redisplay: Option<ConfirmSetupIntentPaymentMethodDataAllowRedisplay>,
10159    /// If this is a Alma PaymentMethod, this hash contains details about the Alma payment method.
10160    #[serde(skip_serializing_if = "Option::is_none")]
10161    #[serde(with = "stripe_types::with_serde_json_opt")]
10162    pub alma: Option<miniserde::json::Value>,
10163    /// If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method.
10164    #[serde(skip_serializing_if = "Option::is_none")]
10165    #[serde(with = "stripe_types::with_serde_json_opt")]
10166    pub amazon_pay: Option<miniserde::json::Value>,
10167    /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
10168    #[serde(skip_serializing_if = "Option::is_none")]
10169    pub au_becs_debit: Option<ConfirmSetupIntentPaymentMethodDataAuBecsDebit>,
10170    /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
10171    #[serde(skip_serializing_if = "Option::is_none")]
10172    pub bacs_debit: Option<ConfirmSetupIntentPaymentMethodDataBacsDebit>,
10173    /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
10174    #[serde(skip_serializing_if = "Option::is_none")]
10175    #[serde(with = "stripe_types::with_serde_json_opt")]
10176    pub bancontact: Option<miniserde::json::Value>,
10177    /// If this is a `billie` PaymentMethod, this hash contains details about the Billie payment method.
10178    #[serde(skip_serializing_if = "Option::is_none")]
10179    #[serde(with = "stripe_types::with_serde_json_opt")]
10180    pub billie: Option<miniserde::json::Value>,
10181    /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
10182    #[serde(skip_serializing_if = "Option::is_none")]
10183    pub billing_details: Option<BillingDetailsInnerParams>,
10184    /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
10185    #[serde(skip_serializing_if = "Option::is_none")]
10186    #[serde(with = "stripe_types::with_serde_json_opt")]
10187    pub blik: Option<miniserde::json::Value>,
10188    /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
10189    #[serde(skip_serializing_if = "Option::is_none")]
10190    pub boleto: Option<ConfirmSetupIntentPaymentMethodDataBoleto>,
10191    /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
10192    #[serde(skip_serializing_if = "Option::is_none")]
10193    #[serde(with = "stripe_types::with_serde_json_opt")]
10194    pub cashapp: Option<miniserde::json::Value>,
10195    /// If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method.
10196    #[serde(skip_serializing_if = "Option::is_none")]
10197    #[serde(with = "stripe_types::with_serde_json_opt")]
10198    pub crypto: Option<miniserde::json::Value>,
10199    /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
10200    #[serde(skip_serializing_if = "Option::is_none")]
10201    #[serde(with = "stripe_types::with_serde_json_opt")]
10202    pub customer_balance: Option<miniserde::json::Value>,
10203    /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
10204    #[serde(skip_serializing_if = "Option::is_none")]
10205    pub eps: Option<ConfirmSetupIntentPaymentMethodDataEps>,
10206    /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
10207    #[serde(skip_serializing_if = "Option::is_none")]
10208    pub fpx: Option<ConfirmSetupIntentPaymentMethodDataFpx>,
10209    /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
10210    #[serde(skip_serializing_if = "Option::is_none")]
10211    #[serde(with = "stripe_types::with_serde_json_opt")]
10212    pub giropay: Option<miniserde::json::Value>,
10213    /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
10214    #[serde(skip_serializing_if = "Option::is_none")]
10215    #[serde(with = "stripe_types::with_serde_json_opt")]
10216    pub grabpay: Option<miniserde::json::Value>,
10217    /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
10218    #[serde(skip_serializing_if = "Option::is_none")]
10219    pub ideal: Option<ConfirmSetupIntentPaymentMethodDataIdeal>,
10220    /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
10221    #[serde(skip_serializing_if = "Option::is_none")]
10222    #[serde(with = "stripe_types::with_serde_json_opt")]
10223    pub interac_present: Option<miniserde::json::Value>,
10224    /// If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method.
10225    #[serde(skip_serializing_if = "Option::is_none")]
10226    #[serde(with = "stripe_types::with_serde_json_opt")]
10227    pub kakao_pay: Option<miniserde::json::Value>,
10228    /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
10229    #[serde(skip_serializing_if = "Option::is_none")]
10230    pub klarna: Option<ConfirmSetupIntentPaymentMethodDataKlarna>,
10231    /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
10232    #[serde(skip_serializing_if = "Option::is_none")]
10233    #[serde(with = "stripe_types::with_serde_json_opt")]
10234    pub konbini: Option<miniserde::json::Value>,
10235    /// If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method.
10236    #[serde(skip_serializing_if = "Option::is_none")]
10237    #[serde(with = "stripe_types::with_serde_json_opt")]
10238    pub kr_card: Option<miniserde::json::Value>,
10239    /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
10240    #[serde(skip_serializing_if = "Option::is_none")]
10241    #[serde(with = "stripe_types::with_serde_json_opt")]
10242    pub link: Option<miniserde::json::Value>,
10243    /// If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method.
10244    #[serde(skip_serializing_if = "Option::is_none")]
10245    #[serde(with = "stripe_types::with_serde_json_opt")]
10246    pub mb_way: Option<miniserde::json::Value>,
10247    /// Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object.
10248    /// This can be useful for storing additional information about the object in a structured format.
10249    /// Individual keys can be unset by posting an empty value to them.
10250    /// All keys can be unset by posting an empty value to `metadata`.
10251    #[serde(skip_serializing_if = "Option::is_none")]
10252    pub metadata: Option<std::collections::HashMap<String, String>>,
10253    /// If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
10254    #[serde(skip_serializing_if = "Option::is_none")]
10255    #[serde(with = "stripe_types::with_serde_json_opt")]
10256    pub mobilepay: Option<miniserde::json::Value>,
10257    /// If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method.
10258    #[serde(skip_serializing_if = "Option::is_none")]
10259    #[serde(with = "stripe_types::with_serde_json_opt")]
10260    pub multibanco: Option<miniserde::json::Value>,
10261    /// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
10262    #[serde(skip_serializing_if = "Option::is_none")]
10263    pub naver_pay: Option<ConfirmSetupIntentPaymentMethodDataNaverPay>,
10264    /// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
10265    #[serde(skip_serializing_if = "Option::is_none")]
10266    pub nz_bank_account: Option<ConfirmSetupIntentPaymentMethodDataNzBankAccount>,
10267    /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
10268    #[serde(skip_serializing_if = "Option::is_none")]
10269    #[serde(with = "stripe_types::with_serde_json_opt")]
10270    pub oxxo: Option<miniserde::json::Value>,
10271    /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
10272    #[serde(skip_serializing_if = "Option::is_none")]
10273    pub p24: Option<ConfirmSetupIntentPaymentMethodDataP24>,
10274    /// If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method.
10275    #[serde(skip_serializing_if = "Option::is_none")]
10276    #[serde(with = "stripe_types::with_serde_json_opt")]
10277    pub pay_by_bank: Option<miniserde::json::Value>,
10278    /// If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method.
10279    #[serde(skip_serializing_if = "Option::is_none")]
10280    #[serde(with = "stripe_types::with_serde_json_opt")]
10281    pub payco: Option<miniserde::json::Value>,
10282    /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
10283    #[serde(skip_serializing_if = "Option::is_none")]
10284    #[serde(with = "stripe_types::with_serde_json_opt")]
10285    pub paynow: Option<miniserde::json::Value>,
10286    /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
10287    #[serde(skip_serializing_if = "Option::is_none")]
10288    #[serde(with = "stripe_types::with_serde_json_opt")]
10289    pub paypal: Option<miniserde::json::Value>,
10290    /// If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method.
10291    #[serde(skip_serializing_if = "Option::is_none")]
10292    pub payto: Option<ConfirmSetupIntentPaymentMethodDataPayto>,
10293    /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
10294    #[serde(skip_serializing_if = "Option::is_none")]
10295    #[serde(with = "stripe_types::with_serde_json_opt")]
10296    pub pix: Option<miniserde::json::Value>,
10297    /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
10298    #[serde(skip_serializing_if = "Option::is_none")]
10299    #[serde(with = "stripe_types::with_serde_json_opt")]
10300    pub promptpay: Option<miniserde::json::Value>,
10301    /// Options to configure Radar.
10302    /// See [Radar Session](https://docs.stripe.com/radar/radar-session) for more information.
10303    #[serde(skip_serializing_if = "Option::is_none")]
10304    pub radar_options: Option<RadarOptionsWithHiddenOptions>,
10305    /// If this is a `revolut_pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
10306    #[serde(skip_serializing_if = "Option::is_none")]
10307    #[serde(with = "stripe_types::with_serde_json_opt")]
10308    pub revolut_pay: Option<miniserde::json::Value>,
10309    /// If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method.
10310    #[serde(skip_serializing_if = "Option::is_none")]
10311    #[serde(with = "stripe_types::with_serde_json_opt")]
10312    pub samsung_pay: Option<miniserde::json::Value>,
10313    /// If this is a `satispay` PaymentMethod, this hash contains details about the Satispay payment method.
10314    #[serde(skip_serializing_if = "Option::is_none")]
10315    #[serde(with = "stripe_types::with_serde_json_opt")]
10316    pub satispay: Option<miniserde::json::Value>,
10317    /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
10318    #[serde(skip_serializing_if = "Option::is_none")]
10319    pub sepa_debit: Option<ConfirmSetupIntentPaymentMethodDataSepaDebit>,
10320    /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
10321    #[serde(skip_serializing_if = "Option::is_none")]
10322    pub sofort: Option<ConfirmSetupIntentPaymentMethodDataSofort>,
10323    /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
10324    #[serde(skip_serializing_if = "Option::is_none")]
10325    #[serde(with = "stripe_types::with_serde_json_opt")]
10326    pub swish: Option<miniserde::json::Value>,
10327    /// If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method.
10328    #[serde(skip_serializing_if = "Option::is_none")]
10329    #[serde(with = "stripe_types::with_serde_json_opt")]
10330    pub twint: Option<miniserde::json::Value>,
10331    /// The type of the PaymentMethod.
10332    /// An additional hash is included on the PaymentMethod with a name matching this value.
10333    /// It contains additional information specific to the PaymentMethod type.
10334    #[serde(rename = "type")]
10335    pub type_: ConfirmSetupIntentPaymentMethodDataType,
10336    /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
10337    #[serde(skip_serializing_if = "Option::is_none")]
10338    pub us_bank_account: Option<ConfirmSetupIntentPaymentMethodDataUsBankAccount>,
10339    /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
10340    #[serde(skip_serializing_if = "Option::is_none")]
10341    #[serde(with = "stripe_types::with_serde_json_opt")]
10342    pub wechat_pay: Option<miniserde::json::Value>,
10343    /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
10344    #[serde(skip_serializing_if = "Option::is_none")]
10345    #[serde(with = "stripe_types::with_serde_json_opt")]
10346    pub zip: Option<miniserde::json::Value>,
10347}
10348impl ConfirmSetupIntentPaymentMethodData {
10349    pub fn new(type_: impl Into<ConfirmSetupIntentPaymentMethodDataType>) -> Self {
10350        Self {
10351            acss_debit: None,
10352            affirm: None,
10353            afterpay_clearpay: None,
10354            alipay: None,
10355            allow_redisplay: None,
10356            alma: None,
10357            amazon_pay: None,
10358            au_becs_debit: None,
10359            bacs_debit: None,
10360            bancontact: None,
10361            billie: None,
10362            billing_details: None,
10363            blik: None,
10364            boleto: None,
10365            cashapp: None,
10366            crypto: None,
10367            customer_balance: None,
10368            eps: None,
10369            fpx: None,
10370            giropay: None,
10371            grabpay: None,
10372            ideal: None,
10373            interac_present: None,
10374            kakao_pay: None,
10375            klarna: None,
10376            konbini: None,
10377            kr_card: None,
10378            link: None,
10379            mb_way: None,
10380            metadata: None,
10381            mobilepay: None,
10382            multibanco: None,
10383            naver_pay: None,
10384            nz_bank_account: None,
10385            oxxo: None,
10386            p24: None,
10387            pay_by_bank: None,
10388            payco: None,
10389            paynow: None,
10390            paypal: None,
10391            payto: None,
10392            pix: None,
10393            promptpay: None,
10394            radar_options: None,
10395            revolut_pay: None,
10396            samsung_pay: None,
10397            satispay: None,
10398            sepa_debit: None,
10399            sofort: None,
10400            swish: None,
10401            twint: None,
10402            type_: type_.into(),
10403            us_bank_account: None,
10404            wechat_pay: None,
10405            zip: None,
10406        }
10407    }
10408}
10409/// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
10410/// 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.
10411/// The field defaults to `unspecified`.
10412#[derive(Clone, Eq, PartialEq)]
10413#[non_exhaustive]
10414pub enum ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
10415    Always,
10416    Limited,
10417    Unspecified,
10418    /// An unrecognized value from Stripe. Should not be used as a request parameter.
10419    Unknown(String),
10420}
10421impl ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
10422    pub fn as_str(&self) -> &str {
10423        use ConfirmSetupIntentPaymentMethodDataAllowRedisplay::*;
10424        match self {
10425            Always => "always",
10426            Limited => "limited",
10427            Unspecified => "unspecified",
10428            Unknown(v) => v,
10429        }
10430    }
10431}
10432
10433impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
10434    type Err = std::convert::Infallible;
10435    fn from_str(s: &str) -> Result<Self, Self::Err> {
10436        use ConfirmSetupIntentPaymentMethodDataAllowRedisplay::*;
10437        match s {
10438            "always" => Ok(Always),
10439            "limited" => Ok(Limited),
10440            "unspecified" => Ok(Unspecified),
10441            v => {
10442                tracing::warn!(
10443                    "Unknown value '{}' for enum '{}'",
10444                    v,
10445                    "ConfirmSetupIntentPaymentMethodDataAllowRedisplay"
10446                );
10447                Ok(Unknown(v.to_owned()))
10448            }
10449        }
10450    }
10451}
10452impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
10453    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10454        f.write_str(self.as_str())
10455    }
10456}
10457
10458impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
10459    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10460        f.write_str(self.as_str())
10461    }
10462}
10463impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
10464    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10465    where
10466        S: serde::Serializer,
10467    {
10468        serializer.serialize_str(self.as_str())
10469    }
10470}
10471#[cfg(feature = "deserialize")]
10472impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
10473    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10474        use std::str::FromStr;
10475        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10476        Ok(Self::from_str(&s).expect("infallible"))
10477    }
10478}
10479/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
10480#[derive(Clone, Debug, serde::Serialize)]
10481pub struct ConfirmSetupIntentPaymentMethodDataAuBecsDebit {
10482    /// The account number for the bank account.
10483    pub account_number: String,
10484    /// Bank-State-Branch number of the bank account.
10485    pub bsb_number: String,
10486}
10487impl ConfirmSetupIntentPaymentMethodDataAuBecsDebit {
10488    pub fn new(account_number: impl Into<String>, bsb_number: impl Into<String>) -> Self {
10489        Self { account_number: account_number.into(), bsb_number: bsb_number.into() }
10490    }
10491}
10492/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
10493#[derive(Clone, Debug, serde::Serialize)]
10494pub struct ConfirmSetupIntentPaymentMethodDataBacsDebit {
10495    /// Account number of the bank account that the funds will be debited from.
10496    #[serde(skip_serializing_if = "Option::is_none")]
10497    pub account_number: Option<String>,
10498    /// Sort code of the bank account. (e.g., `10-20-30`)
10499    #[serde(skip_serializing_if = "Option::is_none")]
10500    pub sort_code: Option<String>,
10501}
10502impl ConfirmSetupIntentPaymentMethodDataBacsDebit {
10503    pub fn new() -> Self {
10504        Self { account_number: None, sort_code: None }
10505    }
10506}
10507impl Default for ConfirmSetupIntentPaymentMethodDataBacsDebit {
10508    fn default() -> Self {
10509        Self::new()
10510    }
10511}
10512/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
10513#[derive(Clone, Debug, serde::Serialize)]
10514pub struct ConfirmSetupIntentPaymentMethodDataBoleto {
10515    /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)
10516    pub tax_id: String,
10517}
10518impl ConfirmSetupIntentPaymentMethodDataBoleto {
10519    pub fn new(tax_id: impl Into<String>) -> Self {
10520        Self { tax_id: tax_id.into() }
10521    }
10522}
10523/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
10524#[derive(Clone, Debug, serde::Serialize)]
10525pub struct ConfirmSetupIntentPaymentMethodDataEps {
10526    /// The customer's bank.
10527    #[serde(skip_serializing_if = "Option::is_none")]
10528    pub bank: Option<ConfirmSetupIntentPaymentMethodDataEpsBank>,
10529}
10530impl ConfirmSetupIntentPaymentMethodDataEps {
10531    pub fn new() -> Self {
10532        Self { bank: None }
10533    }
10534}
10535impl Default for ConfirmSetupIntentPaymentMethodDataEps {
10536    fn default() -> Self {
10537        Self::new()
10538    }
10539}
10540/// The customer's bank.
10541#[derive(Clone, Eq, PartialEq)]
10542#[non_exhaustive]
10543pub enum ConfirmSetupIntentPaymentMethodDataEpsBank {
10544    ArzteUndApothekerBank,
10545    AustrianAnadiBankAg,
10546    BankAustria,
10547    BankhausCarlSpangler,
10548    BankhausSchelhammerUndSchatteraAg,
10549    BawagPskAg,
10550    BksBankAg,
10551    BrullKallmusBankAg,
10552    BtvVierLanderBank,
10553    CapitalBankGraweGruppeAg,
10554    DeutscheBankAg,
10555    Dolomitenbank,
10556    EasybankAg,
10557    ErsteBankUndSparkassen,
10558    HypoAlpeadriabankInternationalAg,
10559    HypoBankBurgenlandAktiengesellschaft,
10560    HypoNoeLbFurNiederosterreichUWien,
10561    HypoOberosterreichSalzburgSteiermark,
10562    HypoTirolBankAg,
10563    HypoVorarlbergBankAg,
10564    MarchfelderBank,
10565    OberbankAg,
10566    RaiffeisenBankengruppeOsterreich,
10567    SchoellerbankAg,
10568    SpardaBankWien,
10569    VolksbankGruppe,
10570    VolkskreditbankAg,
10571    VrBankBraunau,
10572    /// An unrecognized value from Stripe. Should not be used as a request parameter.
10573    Unknown(String),
10574}
10575impl ConfirmSetupIntentPaymentMethodDataEpsBank {
10576    pub fn as_str(&self) -> &str {
10577        use ConfirmSetupIntentPaymentMethodDataEpsBank::*;
10578        match self {
10579            ArzteUndApothekerBank => "arzte_und_apotheker_bank",
10580            AustrianAnadiBankAg => "austrian_anadi_bank_ag",
10581            BankAustria => "bank_austria",
10582            BankhausCarlSpangler => "bankhaus_carl_spangler",
10583            BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag",
10584            BawagPskAg => "bawag_psk_ag",
10585            BksBankAg => "bks_bank_ag",
10586            BrullKallmusBankAg => "brull_kallmus_bank_ag",
10587            BtvVierLanderBank => "btv_vier_lander_bank",
10588            CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
10589            DeutscheBankAg => "deutsche_bank_ag",
10590            Dolomitenbank => "dolomitenbank",
10591            EasybankAg => "easybank_ag",
10592            ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
10593            HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag",
10594            HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft",
10595            HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien",
10596            HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark",
10597            HypoTirolBankAg => "hypo_tirol_bank_ag",
10598            HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
10599            MarchfelderBank => "marchfelder_bank",
10600            OberbankAg => "oberbank_ag",
10601            RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich",
10602            SchoellerbankAg => "schoellerbank_ag",
10603            SpardaBankWien => "sparda_bank_wien",
10604            VolksbankGruppe => "volksbank_gruppe",
10605            VolkskreditbankAg => "volkskreditbank_ag",
10606            VrBankBraunau => "vr_bank_braunau",
10607            Unknown(v) => v,
10608        }
10609    }
10610}
10611
10612impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataEpsBank {
10613    type Err = std::convert::Infallible;
10614    fn from_str(s: &str) -> Result<Self, Self::Err> {
10615        use ConfirmSetupIntentPaymentMethodDataEpsBank::*;
10616        match s {
10617            "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank),
10618            "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg),
10619            "bank_austria" => Ok(BankAustria),
10620            "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler),
10621            "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg),
10622            "bawag_psk_ag" => Ok(BawagPskAg),
10623            "bks_bank_ag" => Ok(BksBankAg),
10624            "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg),
10625            "btv_vier_lander_bank" => Ok(BtvVierLanderBank),
10626            "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg),
10627            "deutsche_bank_ag" => Ok(DeutscheBankAg),
10628            "dolomitenbank" => Ok(Dolomitenbank),
10629            "easybank_ag" => Ok(EasybankAg),
10630            "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen),
10631            "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg),
10632            "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft),
10633            "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien),
10634            "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark),
10635            "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg),
10636            "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg),
10637            "marchfelder_bank" => Ok(MarchfelderBank),
10638            "oberbank_ag" => Ok(OberbankAg),
10639            "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich),
10640            "schoellerbank_ag" => Ok(SchoellerbankAg),
10641            "sparda_bank_wien" => Ok(SpardaBankWien),
10642            "volksbank_gruppe" => Ok(VolksbankGruppe),
10643            "volkskreditbank_ag" => Ok(VolkskreditbankAg),
10644            "vr_bank_braunau" => Ok(VrBankBraunau),
10645            v => {
10646                tracing::warn!(
10647                    "Unknown value '{}' for enum '{}'",
10648                    v,
10649                    "ConfirmSetupIntentPaymentMethodDataEpsBank"
10650                );
10651                Ok(Unknown(v.to_owned()))
10652            }
10653        }
10654    }
10655}
10656impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataEpsBank {
10657    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10658        f.write_str(self.as_str())
10659    }
10660}
10661
10662impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataEpsBank {
10663    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10664        f.write_str(self.as_str())
10665    }
10666}
10667impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataEpsBank {
10668    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10669    where
10670        S: serde::Serializer,
10671    {
10672        serializer.serialize_str(self.as_str())
10673    }
10674}
10675#[cfg(feature = "deserialize")]
10676impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataEpsBank {
10677    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10678        use std::str::FromStr;
10679        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10680        Ok(Self::from_str(&s).expect("infallible"))
10681    }
10682}
10683/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
10684#[derive(Clone, Debug, serde::Serialize)]
10685pub struct ConfirmSetupIntentPaymentMethodDataFpx {
10686    /// Account holder type for FPX transaction
10687    #[serde(skip_serializing_if = "Option::is_none")]
10688    pub account_holder_type: Option<ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType>,
10689    /// The customer's bank.
10690    pub bank: ConfirmSetupIntentPaymentMethodDataFpxBank,
10691}
10692impl ConfirmSetupIntentPaymentMethodDataFpx {
10693    pub fn new(bank: impl Into<ConfirmSetupIntentPaymentMethodDataFpxBank>) -> Self {
10694        Self { account_holder_type: None, bank: bank.into() }
10695    }
10696}
10697/// Account holder type for FPX transaction
10698#[derive(Clone, Eq, PartialEq)]
10699#[non_exhaustive]
10700pub enum ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
10701    Company,
10702    Individual,
10703    /// An unrecognized value from Stripe. Should not be used as a request parameter.
10704    Unknown(String),
10705}
10706impl ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
10707    pub fn as_str(&self) -> &str {
10708        use ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType::*;
10709        match self {
10710            Company => "company",
10711            Individual => "individual",
10712            Unknown(v) => v,
10713        }
10714    }
10715}
10716
10717impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
10718    type Err = std::convert::Infallible;
10719    fn from_str(s: &str) -> Result<Self, Self::Err> {
10720        use ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType::*;
10721        match s {
10722            "company" => Ok(Company),
10723            "individual" => Ok(Individual),
10724            v => {
10725                tracing::warn!(
10726                    "Unknown value '{}' for enum '{}'",
10727                    v,
10728                    "ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType"
10729                );
10730                Ok(Unknown(v.to_owned()))
10731            }
10732        }
10733    }
10734}
10735impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
10736    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10737        f.write_str(self.as_str())
10738    }
10739}
10740
10741impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
10742    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10743        f.write_str(self.as_str())
10744    }
10745}
10746impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
10747    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10748    where
10749        S: serde::Serializer,
10750    {
10751        serializer.serialize_str(self.as_str())
10752    }
10753}
10754#[cfg(feature = "deserialize")]
10755impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
10756    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10757        use std::str::FromStr;
10758        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10759        Ok(Self::from_str(&s).expect("infallible"))
10760    }
10761}
10762/// The customer's bank.
10763#[derive(Clone, Eq, PartialEq)]
10764#[non_exhaustive]
10765pub enum ConfirmSetupIntentPaymentMethodDataFpxBank {
10766    AffinBank,
10767    Agrobank,
10768    AllianceBank,
10769    Ambank,
10770    BankIslam,
10771    BankMuamalat,
10772    BankOfChina,
10773    BankRakyat,
10774    Bsn,
10775    Cimb,
10776    DeutscheBank,
10777    HongLeongBank,
10778    Hsbc,
10779    Kfh,
10780    Maybank2e,
10781    Maybank2u,
10782    Ocbc,
10783    PbEnterprise,
10784    PublicBank,
10785    Rhb,
10786    StandardChartered,
10787    Uob,
10788    /// An unrecognized value from Stripe. Should not be used as a request parameter.
10789    Unknown(String),
10790}
10791impl ConfirmSetupIntentPaymentMethodDataFpxBank {
10792    pub fn as_str(&self) -> &str {
10793        use ConfirmSetupIntentPaymentMethodDataFpxBank::*;
10794        match self {
10795            AffinBank => "affin_bank",
10796            Agrobank => "agrobank",
10797            AllianceBank => "alliance_bank",
10798            Ambank => "ambank",
10799            BankIslam => "bank_islam",
10800            BankMuamalat => "bank_muamalat",
10801            BankOfChina => "bank_of_china",
10802            BankRakyat => "bank_rakyat",
10803            Bsn => "bsn",
10804            Cimb => "cimb",
10805            DeutscheBank => "deutsche_bank",
10806            HongLeongBank => "hong_leong_bank",
10807            Hsbc => "hsbc",
10808            Kfh => "kfh",
10809            Maybank2e => "maybank2e",
10810            Maybank2u => "maybank2u",
10811            Ocbc => "ocbc",
10812            PbEnterprise => "pb_enterprise",
10813            PublicBank => "public_bank",
10814            Rhb => "rhb",
10815            StandardChartered => "standard_chartered",
10816            Uob => "uob",
10817            Unknown(v) => v,
10818        }
10819    }
10820}
10821
10822impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataFpxBank {
10823    type Err = std::convert::Infallible;
10824    fn from_str(s: &str) -> Result<Self, Self::Err> {
10825        use ConfirmSetupIntentPaymentMethodDataFpxBank::*;
10826        match s {
10827            "affin_bank" => Ok(AffinBank),
10828            "agrobank" => Ok(Agrobank),
10829            "alliance_bank" => Ok(AllianceBank),
10830            "ambank" => Ok(Ambank),
10831            "bank_islam" => Ok(BankIslam),
10832            "bank_muamalat" => Ok(BankMuamalat),
10833            "bank_of_china" => Ok(BankOfChina),
10834            "bank_rakyat" => Ok(BankRakyat),
10835            "bsn" => Ok(Bsn),
10836            "cimb" => Ok(Cimb),
10837            "deutsche_bank" => Ok(DeutscheBank),
10838            "hong_leong_bank" => Ok(HongLeongBank),
10839            "hsbc" => Ok(Hsbc),
10840            "kfh" => Ok(Kfh),
10841            "maybank2e" => Ok(Maybank2e),
10842            "maybank2u" => Ok(Maybank2u),
10843            "ocbc" => Ok(Ocbc),
10844            "pb_enterprise" => Ok(PbEnterprise),
10845            "public_bank" => Ok(PublicBank),
10846            "rhb" => Ok(Rhb),
10847            "standard_chartered" => Ok(StandardChartered),
10848            "uob" => Ok(Uob),
10849            v => {
10850                tracing::warn!(
10851                    "Unknown value '{}' for enum '{}'",
10852                    v,
10853                    "ConfirmSetupIntentPaymentMethodDataFpxBank"
10854                );
10855                Ok(Unknown(v.to_owned()))
10856            }
10857        }
10858    }
10859}
10860impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataFpxBank {
10861    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10862        f.write_str(self.as_str())
10863    }
10864}
10865
10866impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataFpxBank {
10867    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10868        f.write_str(self.as_str())
10869    }
10870}
10871impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataFpxBank {
10872    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10873    where
10874        S: serde::Serializer,
10875    {
10876        serializer.serialize_str(self.as_str())
10877    }
10878}
10879#[cfg(feature = "deserialize")]
10880impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataFpxBank {
10881    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10882        use std::str::FromStr;
10883        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10884        Ok(Self::from_str(&s).expect("infallible"))
10885    }
10886}
10887/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
10888#[derive(Clone, Debug, serde::Serialize)]
10889pub struct ConfirmSetupIntentPaymentMethodDataIdeal {
10890    /// The customer's bank.
10891    /// Only use this parameter for existing customers.
10892    /// Don't use it for new customers.
10893    #[serde(skip_serializing_if = "Option::is_none")]
10894    pub bank: Option<ConfirmSetupIntentPaymentMethodDataIdealBank>,
10895}
10896impl ConfirmSetupIntentPaymentMethodDataIdeal {
10897    pub fn new() -> Self {
10898        Self { bank: None }
10899    }
10900}
10901impl Default for ConfirmSetupIntentPaymentMethodDataIdeal {
10902    fn default() -> Self {
10903        Self::new()
10904    }
10905}
10906/// The customer's bank.
10907/// Only use this parameter for existing customers.
10908/// Don't use it for new customers.
10909#[derive(Clone, Eq, PartialEq)]
10910#[non_exhaustive]
10911pub enum ConfirmSetupIntentPaymentMethodDataIdealBank {
10912    AbnAmro,
10913    AsnBank,
10914    Bunq,
10915    Buut,
10916    Finom,
10917    Handelsbanken,
10918    Ing,
10919    Knab,
10920    Mollie,
10921    Moneyou,
10922    N26,
10923    Nn,
10924    Rabobank,
10925    Regiobank,
10926    Revolut,
10927    SnsBank,
10928    TriodosBank,
10929    VanLanschot,
10930    Yoursafe,
10931    /// An unrecognized value from Stripe. Should not be used as a request parameter.
10932    Unknown(String),
10933}
10934impl ConfirmSetupIntentPaymentMethodDataIdealBank {
10935    pub fn as_str(&self) -> &str {
10936        use ConfirmSetupIntentPaymentMethodDataIdealBank::*;
10937        match self {
10938            AbnAmro => "abn_amro",
10939            AsnBank => "asn_bank",
10940            Bunq => "bunq",
10941            Buut => "buut",
10942            Finom => "finom",
10943            Handelsbanken => "handelsbanken",
10944            Ing => "ing",
10945            Knab => "knab",
10946            Mollie => "mollie",
10947            Moneyou => "moneyou",
10948            N26 => "n26",
10949            Nn => "nn",
10950            Rabobank => "rabobank",
10951            Regiobank => "regiobank",
10952            Revolut => "revolut",
10953            SnsBank => "sns_bank",
10954            TriodosBank => "triodos_bank",
10955            VanLanschot => "van_lanschot",
10956            Yoursafe => "yoursafe",
10957            Unknown(v) => v,
10958        }
10959    }
10960}
10961
10962impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataIdealBank {
10963    type Err = std::convert::Infallible;
10964    fn from_str(s: &str) -> Result<Self, Self::Err> {
10965        use ConfirmSetupIntentPaymentMethodDataIdealBank::*;
10966        match s {
10967            "abn_amro" => Ok(AbnAmro),
10968            "asn_bank" => Ok(AsnBank),
10969            "bunq" => Ok(Bunq),
10970            "buut" => Ok(Buut),
10971            "finom" => Ok(Finom),
10972            "handelsbanken" => Ok(Handelsbanken),
10973            "ing" => Ok(Ing),
10974            "knab" => Ok(Knab),
10975            "mollie" => Ok(Mollie),
10976            "moneyou" => Ok(Moneyou),
10977            "n26" => Ok(N26),
10978            "nn" => Ok(Nn),
10979            "rabobank" => Ok(Rabobank),
10980            "regiobank" => Ok(Regiobank),
10981            "revolut" => Ok(Revolut),
10982            "sns_bank" => Ok(SnsBank),
10983            "triodos_bank" => Ok(TriodosBank),
10984            "van_lanschot" => Ok(VanLanschot),
10985            "yoursafe" => Ok(Yoursafe),
10986            v => {
10987                tracing::warn!(
10988                    "Unknown value '{}' for enum '{}'",
10989                    v,
10990                    "ConfirmSetupIntentPaymentMethodDataIdealBank"
10991                );
10992                Ok(Unknown(v.to_owned()))
10993            }
10994        }
10995    }
10996}
10997impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataIdealBank {
10998    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10999        f.write_str(self.as_str())
11000    }
11001}
11002
11003impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataIdealBank {
11004    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11005        f.write_str(self.as_str())
11006    }
11007}
11008impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataIdealBank {
11009    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11010    where
11011        S: serde::Serializer,
11012    {
11013        serializer.serialize_str(self.as_str())
11014    }
11015}
11016#[cfg(feature = "deserialize")]
11017impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataIdealBank {
11018    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11019        use std::str::FromStr;
11020        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11021        Ok(Self::from_str(&s).expect("infallible"))
11022    }
11023}
11024/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
11025#[derive(Copy, Clone, Debug, serde::Serialize)]
11026pub struct ConfirmSetupIntentPaymentMethodDataKlarna {
11027    /// Customer's date of birth
11028    #[serde(skip_serializing_if = "Option::is_none")]
11029    pub dob: Option<DateOfBirth>,
11030}
11031impl ConfirmSetupIntentPaymentMethodDataKlarna {
11032    pub fn new() -> Self {
11033        Self { dob: None }
11034    }
11035}
11036impl Default for ConfirmSetupIntentPaymentMethodDataKlarna {
11037    fn default() -> Self {
11038        Self::new()
11039    }
11040}
11041/// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
11042#[derive(Clone, Debug, serde::Serialize)]
11043pub struct ConfirmSetupIntentPaymentMethodDataNaverPay {
11044    /// Whether to use Naver Pay points or a card to fund this transaction.
11045    /// If not provided, this defaults to `card`.
11046    #[serde(skip_serializing_if = "Option::is_none")]
11047    pub funding: Option<ConfirmSetupIntentPaymentMethodDataNaverPayFunding>,
11048}
11049impl ConfirmSetupIntentPaymentMethodDataNaverPay {
11050    pub fn new() -> Self {
11051        Self { funding: None }
11052    }
11053}
11054impl Default for ConfirmSetupIntentPaymentMethodDataNaverPay {
11055    fn default() -> Self {
11056        Self::new()
11057    }
11058}
11059/// Whether to use Naver Pay points or a card to fund this transaction.
11060/// If not provided, this defaults to `card`.
11061#[derive(Clone, Eq, PartialEq)]
11062#[non_exhaustive]
11063pub enum ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
11064    Card,
11065    Points,
11066    /// An unrecognized value from Stripe. Should not be used as a request parameter.
11067    Unknown(String),
11068}
11069impl ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
11070    pub fn as_str(&self) -> &str {
11071        use ConfirmSetupIntentPaymentMethodDataNaverPayFunding::*;
11072        match self {
11073            Card => "card",
11074            Points => "points",
11075            Unknown(v) => v,
11076        }
11077    }
11078}
11079
11080impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
11081    type Err = std::convert::Infallible;
11082    fn from_str(s: &str) -> Result<Self, Self::Err> {
11083        use ConfirmSetupIntentPaymentMethodDataNaverPayFunding::*;
11084        match s {
11085            "card" => Ok(Card),
11086            "points" => Ok(Points),
11087            v => {
11088                tracing::warn!(
11089                    "Unknown value '{}' for enum '{}'",
11090                    v,
11091                    "ConfirmSetupIntentPaymentMethodDataNaverPayFunding"
11092                );
11093                Ok(Unknown(v.to_owned()))
11094            }
11095        }
11096    }
11097}
11098impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
11099    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11100        f.write_str(self.as_str())
11101    }
11102}
11103
11104impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
11105    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11106        f.write_str(self.as_str())
11107    }
11108}
11109impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
11110    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11111    where
11112        S: serde::Serializer,
11113    {
11114        serializer.serialize_str(self.as_str())
11115    }
11116}
11117#[cfg(feature = "deserialize")]
11118impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
11119    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11120        use std::str::FromStr;
11121        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11122        Ok(Self::from_str(&s).expect("infallible"))
11123    }
11124}
11125/// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
11126#[derive(Clone, Debug, serde::Serialize)]
11127pub struct ConfirmSetupIntentPaymentMethodDataNzBankAccount {
11128    /// The name on the bank account.
11129    /// Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod’s billing details.
11130    #[serde(skip_serializing_if = "Option::is_none")]
11131    pub account_holder_name: Option<String>,
11132    /// The account number for the bank account.
11133    pub account_number: String,
11134    /// The numeric code for the bank account's bank.
11135    pub bank_code: String,
11136    /// The numeric code for the bank account's bank branch.
11137    pub branch_code: String,
11138    #[serde(skip_serializing_if = "Option::is_none")]
11139    pub reference: Option<String>,
11140    /// The suffix of the bank account number.
11141    pub suffix: String,
11142}
11143impl ConfirmSetupIntentPaymentMethodDataNzBankAccount {
11144    pub fn new(
11145        account_number: impl Into<String>,
11146        bank_code: impl Into<String>,
11147        branch_code: impl Into<String>,
11148        suffix: impl Into<String>,
11149    ) -> Self {
11150        Self {
11151            account_holder_name: None,
11152            account_number: account_number.into(),
11153            bank_code: bank_code.into(),
11154            branch_code: branch_code.into(),
11155            reference: None,
11156            suffix: suffix.into(),
11157        }
11158    }
11159}
11160/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
11161#[derive(Clone, Debug, serde::Serialize)]
11162pub struct ConfirmSetupIntentPaymentMethodDataP24 {
11163    /// The customer's bank.
11164    #[serde(skip_serializing_if = "Option::is_none")]
11165    pub bank: Option<ConfirmSetupIntentPaymentMethodDataP24Bank>,
11166}
11167impl ConfirmSetupIntentPaymentMethodDataP24 {
11168    pub fn new() -> Self {
11169        Self { bank: None }
11170    }
11171}
11172impl Default for ConfirmSetupIntentPaymentMethodDataP24 {
11173    fn default() -> Self {
11174        Self::new()
11175    }
11176}
11177/// The customer's bank.
11178#[derive(Clone, Eq, PartialEq)]
11179#[non_exhaustive]
11180pub enum ConfirmSetupIntentPaymentMethodDataP24Bank {
11181    AliorBank,
11182    BankMillennium,
11183    BankNowyBfgSa,
11184    BankPekaoSa,
11185    BankiSpbdzielcze,
11186    Blik,
11187    BnpParibas,
11188    Boz,
11189    CitiHandlowy,
11190    CreditAgricole,
11191    Envelobank,
11192    EtransferPocztowy24,
11193    GetinBank,
11194    Ideabank,
11195    Ing,
11196    Inteligo,
11197    MbankMtransfer,
11198    NestPrzelew,
11199    NoblePay,
11200    PbacZIpko,
11201    PlusBank,
11202    SantanderPrzelew24,
11203    TmobileUsbugiBankowe,
11204    ToyotaBank,
11205    Velobank,
11206    VolkswagenBank,
11207    /// An unrecognized value from Stripe. Should not be used as a request parameter.
11208    Unknown(String),
11209}
11210impl ConfirmSetupIntentPaymentMethodDataP24Bank {
11211    pub fn as_str(&self) -> &str {
11212        use ConfirmSetupIntentPaymentMethodDataP24Bank::*;
11213        match self {
11214            AliorBank => "alior_bank",
11215            BankMillennium => "bank_millennium",
11216            BankNowyBfgSa => "bank_nowy_bfg_sa",
11217            BankPekaoSa => "bank_pekao_sa",
11218            BankiSpbdzielcze => "banki_spbdzielcze",
11219            Blik => "blik",
11220            BnpParibas => "bnp_paribas",
11221            Boz => "boz",
11222            CitiHandlowy => "citi_handlowy",
11223            CreditAgricole => "credit_agricole",
11224            Envelobank => "envelobank",
11225            EtransferPocztowy24 => "etransfer_pocztowy24",
11226            GetinBank => "getin_bank",
11227            Ideabank => "ideabank",
11228            Ing => "ing",
11229            Inteligo => "inteligo",
11230            MbankMtransfer => "mbank_mtransfer",
11231            NestPrzelew => "nest_przelew",
11232            NoblePay => "noble_pay",
11233            PbacZIpko => "pbac_z_ipko",
11234            PlusBank => "plus_bank",
11235            SantanderPrzelew24 => "santander_przelew24",
11236            TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
11237            ToyotaBank => "toyota_bank",
11238            Velobank => "velobank",
11239            VolkswagenBank => "volkswagen_bank",
11240            Unknown(v) => v,
11241        }
11242    }
11243}
11244
11245impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataP24Bank {
11246    type Err = std::convert::Infallible;
11247    fn from_str(s: &str) -> Result<Self, Self::Err> {
11248        use ConfirmSetupIntentPaymentMethodDataP24Bank::*;
11249        match s {
11250            "alior_bank" => Ok(AliorBank),
11251            "bank_millennium" => Ok(BankMillennium),
11252            "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa),
11253            "bank_pekao_sa" => Ok(BankPekaoSa),
11254            "banki_spbdzielcze" => Ok(BankiSpbdzielcze),
11255            "blik" => Ok(Blik),
11256            "bnp_paribas" => Ok(BnpParibas),
11257            "boz" => Ok(Boz),
11258            "citi_handlowy" => Ok(CitiHandlowy),
11259            "credit_agricole" => Ok(CreditAgricole),
11260            "envelobank" => Ok(Envelobank),
11261            "etransfer_pocztowy24" => Ok(EtransferPocztowy24),
11262            "getin_bank" => Ok(GetinBank),
11263            "ideabank" => Ok(Ideabank),
11264            "ing" => Ok(Ing),
11265            "inteligo" => Ok(Inteligo),
11266            "mbank_mtransfer" => Ok(MbankMtransfer),
11267            "nest_przelew" => Ok(NestPrzelew),
11268            "noble_pay" => Ok(NoblePay),
11269            "pbac_z_ipko" => Ok(PbacZIpko),
11270            "plus_bank" => Ok(PlusBank),
11271            "santander_przelew24" => Ok(SantanderPrzelew24),
11272            "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe),
11273            "toyota_bank" => Ok(ToyotaBank),
11274            "velobank" => Ok(Velobank),
11275            "volkswagen_bank" => Ok(VolkswagenBank),
11276            v => {
11277                tracing::warn!(
11278                    "Unknown value '{}' for enum '{}'",
11279                    v,
11280                    "ConfirmSetupIntentPaymentMethodDataP24Bank"
11281                );
11282                Ok(Unknown(v.to_owned()))
11283            }
11284        }
11285    }
11286}
11287impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataP24Bank {
11288    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11289        f.write_str(self.as_str())
11290    }
11291}
11292
11293impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataP24Bank {
11294    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11295        f.write_str(self.as_str())
11296    }
11297}
11298impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataP24Bank {
11299    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11300    where
11301        S: serde::Serializer,
11302    {
11303        serializer.serialize_str(self.as_str())
11304    }
11305}
11306#[cfg(feature = "deserialize")]
11307impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataP24Bank {
11308    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11309        use std::str::FromStr;
11310        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11311        Ok(Self::from_str(&s).expect("infallible"))
11312    }
11313}
11314/// If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method.
11315#[derive(Clone, Debug, serde::Serialize)]
11316pub struct ConfirmSetupIntentPaymentMethodDataPayto {
11317    /// The account number for the bank account.
11318    #[serde(skip_serializing_if = "Option::is_none")]
11319    pub account_number: Option<String>,
11320    /// Bank-State-Branch number of the bank account.
11321    #[serde(skip_serializing_if = "Option::is_none")]
11322    pub bsb_number: Option<String>,
11323    /// The PayID alias for the bank account.
11324    #[serde(skip_serializing_if = "Option::is_none")]
11325    pub pay_id: Option<String>,
11326}
11327impl ConfirmSetupIntentPaymentMethodDataPayto {
11328    pub fn new() -> Self {
11329        Self { account_number: None, bsb_number: None, pay_id: None }
11330    }
11331}
11332impl Default for ConfirmSetupIntentPaymentMethodDataPayto {
11333    fn default() -> Self {
11334        Self::new()
11335    }
11336}
11337/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
11338#[derive(Clone, Debug, serde::Serialize)]
11339pub struct ConfirmSetupIntentPaymentMethodDataSepaDebit {
11340    /// IBAN of the bank account.
11341    pub iban: String,
11342}
11343impl ConfirmSetupIntentPaymentMethodDataSepaDebit {
11344    pub fn new(iban: impl Into<String>) -> Self {
11345        Self { iban: iban.into() }
11346    }
11347}
11348/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
11349#[derive(Clone, Debug, serde::Serialize)]
11350pub struct ConfirmSetupIntentPaymentMethodDataSofort {
11351    /// Two-letter ISO code representing the country the bank account is located in.
11352    pub country: ConfirmSetupIntentPaymentMethodDataSofortCountry,
11353}
11354impl ConfirmSetupIntentPaymentMethodDataSofort {
11355    pub fn new(country: impl Into<ConfirmSetupIntentPaymentMethodDataSofortCountry>) -> Self {
11356        Self { country: country.into() }
11357    }
11358}
11359/// Two-letter ISO code representing the country the bank account is located in.
11360#[derive(Clone, Eq, PartialEq)]
11361#[non_exhaustive]
11362pub enum ConfirmSetupIntentPaymentMethodDataSofortCountry {
11363    At,
11364    Be,
11365    De,
11366    Es,
11367    It,
11368    Nl,
11369    /// An unrecognized value from Stripe. Should not be used as a request parameter.
11370    Unknown(String),
11371}
11372impl ConfirmSetupIntentPaymentMethodDataSofortCountry {
11373    pub fn as_str(&self) -> &str {
11374        use ConfirmSetupIntentPaymentMethodDataSofortCountry::*;
11375        match self {
11376            At => "AT",
11377            Be => "BE",
11378            De => "DE",
11379            Es => "ES",
11380            It => "IT",
11381            Nl => "NL",
11382            Unknown(v) => v,
11383        }
11384    }
11385}
11386
11387impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataSofortCountry {
11388    type Err = std::convert::Infallible;
11389    fn from_str(s: &str) -> Result<Self, Self::Err> {
11390        use ConfirmSetupIntentPaymentMethodDataSofortCountry::*;
11391        match s {
11392            "AT" => Ok(At),
11393            "BE" => Ok(Be),
11394            "DE" => Ok(De),
11395            "ES" => Ok(Es),
11396            "IT" => Ok(It),
11397            "NL" => Ok(Nl),
11398            v => {
11399                tracing::warn!(
11400                    "Unknown value '{}' for enum '{}'",
11401                    v,
11402                    "ConfirmSetupIntentPaymentMethodDataSofortCountry"
11403                );
11404                Ok(Unknown(v.to_owned()))
11405            }
11406        }
11407    }
11408}
11409impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataSofortCountry {
11410    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11411        f.write_str(self.as_str())
11412    }
11413}
11414
11415impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataSofortCountry {
11416    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11417        f.write_str(self.as_str())
11418    }
11419}
11420impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataSofortCountry {
11421    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11422    where
11423        S: serde::Serializer,
11424    {
11425        serializer.serialize_str(self.as_str())
11426    }
11427}
11428#[cfg(feature = "deserialize")]
11429impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataSofortCountry {
11430    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11431        use std::str::FromStr;
11432        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11433        Ok(Self::from_str(&s).expect("infallible"))
11434    }
11435}
11436/// The type of the PaymentMethod.
11437/// An additional hash is included on the PaymentMethod with a name matching this value.
11438/// It contains additional information specific to the PaymentMethod type.
11439#[derive(Clone, Eq, PartialEq)]
11440#[non_exhaustive]
11441pub enum ConfirmSetupIntentPaymentMethodDataType {
11442    AcssDebit,
11443    Affirm,
11444    AfterpayClearpay,
11445    Alipay,
11446    Alma,
11447    AmazonPay,
11448    AuBecsDebit,
11449    BacsDebit,
11450    Bancontact,
11451    Billie,
11452    Blik,
11453    Boleto,
11454    Cashapp,
11455    Crypto,
11456    CustomerBalance,
11457    Eps,
11458    Fpx,
11459    Giropay,
11460    Grabpay,
11461    Ideal,
11462    KakaoPay,
11463    Klarna,
11464    Konbini,
11465    KrCard,
11466    Link,
11467    MbWay,
11468    Mobilepay,
11469    Multibanco,
11470    NaverPay,
11471    NzBankAccount,
11472    Oxxo,
11473    P24,
11474    PayByBank,
11475    Payco,
11476    Paynow,
11477    Paypal,
11478    Payto,
11479    Pix,
11480    Promptpay,
11481    RevolutPay,
11482    SamsungPay,
11483    Satispay,
11484    SepaDebit,
11485    Sofort,
11486    Swish,
11487    Twint,
11488    UsBankAccount,
11489    WechatPay,
11490    Zip,
11491    /// An unrecognized value from Stripe. Should not be used as a request parameter.
11492    Unknown(String),
11493}
11494impl ConfirmSetupIntentPaymentMethodDataType {
11495    pub fn as_str(&self) -> &str {
11496        use ConfirmSetupIntentPaymentMethodDataType::*;
11497        match self {
11498            AcssDebit => "acss_debit",
11499            Affirm => "affirm",
11500            AfterpayClearpay => "afterpay_clearpay",
11501            Alipay => "alipay",
11502            Alma => "alma",
11503            AmazonPay => "amazon_pay",
11504            AuBecsDebit => "au_becs_debit",
11505            BacsDebit => "bacs_debit",
11506            Bancontact => "bancontact",
11507            Billie => "billie",
11508            Blik => "blik",
11509            Boleto => "boleto",
11510            Cashapp => "cashapp",
11511            Crypto => "crypto",
11512            CustomerBalance => "customer_balance",
11513            Eps => "eps",
11514            Fpx => "fpx",
11515            Giropay => "giropay",
11516            Grabpay => "grabpay",
11517            Ideal => "ideal",
11518            KakaoPay => "kakao_pay",
11519            Klarna => "klarna",
11520            Konbini => "konbini",
11521            KrCard => "kr_card",
11522            Link => "link",
11523            MbWay => "mb_way",
11524            Mobilepay => "mobilepay",
11525            Multibanco => "multibanco",
11526            NaverPay => "naver_pay",
11527            NzBankAccount => "nz_bank_account",
11528            Oxxo => "oxxo",
11529            P24 => "p24",
11530            PayByBank => "pay_by_bank",
11531            Payco => "payco",
11532            Paynow => "paynow",
11533            Paypal => "paypal",
11534            Payto => "payto",
11535            Pix => "pix",
11536            Promptpay => "promptpay",
11537            RevolutPay => "revolut_pay",
11538            SamsungPay => "samsung_pay",
11539            Satispay => "satispay",
11540            SepaDebit => "sepa_debit",
11541            Sofort => "sofort",
11542            Swish => "swish",
11543            Twint => "twint",
11544            UsBankAccount => "us_bank_account",
11545            WechatPay => "wechat_pay",
11546            Zip => "zip",
11547            Unknown(v) => v,
11548        }
11549    }
11550}
11551
11552impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataType {
11553    type Err = std::convert::Infallible;
11554    fn from_str(s: &str) -> Result<Self, Self::Err> {
11555        use ConfirmSetupIntentPaymentMethodDataType::*;
11556        match s {
11557            "acss_debit" => Ok(AcssDebit),
11558            "affirm" => Ok(Affirm),
11559            "afterpay_clearpay" => Ok(AfterpayClearpay),
11560            "alipay" => Ok(Alipay),
11561            "alma" => Ok(Alma),
11562            "amazon_pay" => Ok(AmazonPay),
11563            "au_becs_debit" => Ok(AuBecsDebit),
11564            "bacs_debit" => Ok(BacsDebit),
11565            "bancontact" => Ok(Bancontact),
11566            "billie" => Ok(Billie),
11567            "blik" => Ok(Blik),
11568            "boleto" => Ok(Boleto),
11569            "cashapp" => Ok(Cashapp),
11570            "crypto" => Ok(Crypto),
11571            "customer_balance" => Ok(CustomerBalance),
11572            "eps" => Ok(Eps),
11573            "fpx" => Ok(Fpx),
11574            "giropay" => Ok(Giropay),
11575            "grabpay" => Ok(Grabpay),
11576            "ideal" => Ok(Ideal),
11577            "kakao_pay" => Ok(KakaoPay),
11578            "klarna" => Ok(Klarna),
11579            "konbini" => Ok(Konbini),
11580            "kr_card" => Ok(KrCard),
11581            "link" => Ok(Link),
11582            "mb_way" => Ok(MbWay),
11583            "mobilepay" => Ok(Mobilepay),
11584            "multibanco" => Ok(Multibanco),
11585            "naver_pay" => Ok(NaverPay),
11586            "nz_bank_account" => Ok(NzBankAccount),
11587            "oxxo" => Ok(Oxxo),
11588            "p24" => Ok(P24),
11589            "pay_by_bank" => Ok(PayByBank),
11590            "payco" => Ok(Payco),
11591            "paynow" => Ok(Paynow),
11592            "paypal" => Ok(Paypal),
11593            "payto" => Ok(Payto),
11594            "pix" => Ok(Pix),
11595            "promptpay" => Ok(Promptpay),
11596            "revolut_pay" => Ok(RevolutPay),
11597            "samsung_pay" => Ok(SamsungPay),
11598            "satispay" => Ok(Satispay),
11599            "sepa_debit" => Ok(SepaDebit),
11600            "sofort" => Ok(Sofort),
11601            "swish" => Ok(Swish),
11602            "twint" => Ok(Twint),
11603            "us_bank_account" => Ok(UsBankAccount),
11604            "wechat_pay" => Ok(WechatPay),
11605            "zip" => Ok(Zip),
11606            v => {
11607                tracing::warn!(
11608                    "Unknown value '{}' for enum '{}'",
11609                    v,
11610                    "ConfirmSetupIntentPaymentMethodDataType"
11611                );
11612                Ok(Unknown(v.to_owned()))
11613            }
11614        }
11615    }
11616}
11617impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataType {
11618    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11619        f.write_str(self.as_str())
11620    }
11621}
11622
11623impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataType {
11624    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11625        f.write_str(self.as_str())
11626    }
11627}
11628impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataType {
11629    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11630    where
11631        S: serde::Serializer,
11632    {
11633        serializer.serialize_str(self.as_str())
11634    }
11635}
11636#[cfg(feature = "deserialize")]
11637impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataType {
11638    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11639        use std::str::FromStr;
11640        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11641        Ok(Self::from_str(&s).expect("infallible"))
11642    }
11643}
11644/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
11645#[derive(Clone, Debug, serde::Serialize)]
11646pub struct ConfirmSetupIntentPaymentMethodDataUsBankAccount {
11647    /// Account holder type: individual or company.
11648    #[serde(skip_serializing_if = "Option::is_none")]
11649    pub account_holder_type:
11650        Option<ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType>,
11651    /// Account number of the bank account.
11652    #[serde(skip_serializing_if = "Option::is_none")]
11653    pub account_number: Option<String>,
11654    /// Account type: checkings or savings. Defaults to checking if omitted.
11655    #[serde(skip_serializing_if = "Option::is_none")]
11656    pub account_type: Option<ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType>,
11657    /// The ID of a Financial Connections Account to use as a payment method.
11658    #[serde(skip_serializing_if = "Option::is_none")]
11659    pub financial_connections_account: Option<String>,
11660    /// Routing number of the bank account.
11661    #[serde(skip_serializing_if = "Option::is_none")]
11662    pub routing_number: Option<String>,
11663}
11664impl ConfirmSetupIntentPaymentMethodDataUsBankAccount {
11665    pub fn new() -> Self {
11666        Self {
11667            account_holder_type: None,
11668            account_number: None,
11669            account_type: None,
11670            financial_connections_account: None,
11671            routing_number: None,
11672        }
11673    }
11674}
11675impl Default for ConfirmSetupIntentPaymentMethodDataUsBankAccount {
11676    fn default() -> Self {
11677        Self::new()
11678    }
11679}
11680/// Account holder type: individual or company.
11681#[derive(Clone, Eq, PartialEq)]
11682#[non_exhaustive]
11683pub enum ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
11684    Company,
11685    Individual,
11686    /// An unrecognized value from Stripe. Should not be used as a request parameter.
11687    Unknown(String),
11688}
11689impl ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
11690    pub fn as_str(&self) -> &str {
11691        use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
11692        match self {
11693            Company => "company",
11694            Individual => "individual",
11695            Unknown(v) => v,
11696        }
11697    }
11698}
11699
11700impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
11701    type Err = std::convert::Infallible;
11702    fn from_str(s: &str) -> Result<Self, Self::Err> {
11703        use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
11704        match s {
11705            "company" => Ok(Company),
11706            "individual" => Ok(Individual),
11707            v => {
11708                tracing::warn!(
11709                    "Unknown value '{}' for enum '{}'",
11710                    v,
11711                    "ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType"
11712                );
11713                Ok(Unknown(v.to_owned()))
11714            }
11715        }
11716    }
11717}
11718impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
11719    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11720        f.write_str(self.as_str())
11721    }
11722}
11723
11724impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
11725    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11726        f.write_str(self.as_str())
11727    }
11728}
11729impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
11730    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11731    where
11732        S: serde::Serializer,
11733    {
11734        serializer.serialize_str(self.as_str())
11735    }
11736}
11737#[cfg(feature = "deserialize")]
11738impl<'de> serde::Deserialize<'de>
11739    for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType
11740{
11741    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11742        use std::str::FromStr;
11743        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11744        Ok(Self::from_str(&s).expect("infallible"))
11745    }
11746}
11747/// Account type: checkings or savings. Defaults to checking if omitted.
11748#[derive(Clone, Eq, PartialEq)]
11749#[non_exhaustive]
11750pub enum ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
11751    Checking,
11752    Savings,
11753    /// An unrecognized value from Stripe. Should not be used as a request parameter.
11754    Unknown(String),
11755}
11756impl ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
11757    pub fn as_str(&self) -> &str {
11758        use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
11759        match self {
11760            Checking => "checking",
11761            Savings => "savings",
11762            Unknown(v) => v,
11763        }
11764    }
11765}
11766
11767impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
11768    type Err = std::convert::Infallible;
11769    fn from_str(s: &str) -> Result<Self, Self::Err> {
11770        use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
11771        match s {
11772            "checking" => Ok(Checking),
11773            "savings" => Ok(Savings),
11774            v => {
11775                tracing::warn!(
11776                    "Unknown value '{}' for enum '{}'",
11777                    v,
11778                    "ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType"
11779                );
11780                Ok(Unknown(v.to_owned()))
11781            }
11782        }
11783    }
11784}
11785impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
11786    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11787        f.write_str(self.as_str())
11788    }
11789}
11790
11791impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
11792    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11793        f.write_str(self.as_str())
11794    }
11795}
11796impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
11797    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11798    where
11799        S: serde::Serializer,
11800    {
11801        serializer.serialize_str(self.as_str())
11802    }
11803}
11804#[cfg(feature = "deserialize")]
11805impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
11806    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11807        use std::str::FromStr;
11808        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11809        Ok(Self::from_str(&s).expect("infallible"))
11810    }
11811}
11812/// Payment method-specific configuration for this SetupIntent.
11813#[derive(Clone, Debug, serde::Serialize)]
11814pub struct ConfirmSetupIntentPaymentMethodOptions {
11815    /// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options.
11816    #[serde(skip_serializing_if = "Option::is_none")]
11817    pub acss_debit: Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebit>,
11818    /// If this is a `amazon_pay` SetupIntent, this sub-hash contains details about the AmazonPay payment method options.
11819    #[serde(skip_serializing_if = "Option::is_none")]
11820    #[serde(with = "stripe_types::with_serde_json_opt")]
11821    pub amazon_pay: Option<miniserde::json::Value>,
11822    /// If this is a `bacs_debit` SetupIntent, this sub-hash contains details about the Bacs Debit payment method options.
11823    #[serde(skip_serializing_if = "Option::is_none")]
11824    pub bacs_debit: Option<ConfirmSetupIntentPaymentMethodOptionsBacsDebit>,
11825    /// Configuration for any card setup attempted on this SetupIntent.
11826    #[serde(skip_serializing_if = "Option::is_none")]
11827    pub card: Option<ConfirmSetupIntentPaymentMethodOptionsCard>,
11828    /// If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options.
11829    #[serde(skip_serializing_if = "Option::is_none")]
11830    #[serde(with = "stripe_types::with_serde_json_opt")]
11831    pub card_present: Option<miniserde::json::Value>,
11832    /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options.
11833    #[serde(skip_serializing_if = "Option::is_none")]
11834    pub klarna: Option<ConfirmSetupIntentPaymentMethodOptionsKlarna>,
11835    /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
11836    #[serde(skip_serializing_if = "Option::is_none")]
11837    pub link: Option<SetupIntentPaymentMethodOptionsParam>,
11838    /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
11839    #[serde(skip_serializing_if = "Option::is_none")]
11840    pub paypal: Option<PaymentMethodOptionsParam>,
11841    /// If this is a `payto` SetupIntent, this sub-hash contains details about the PayTo payment method options.
11842    #[serde(skip_serializing_if = "Option::is_none")]
11843    pub payto: Option<ConfirmSetupIntentPaymentMethodOptionsPayto>,
11844    /// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options.
11845    #[serde(skip_serializing_if = "Option::is_none")]
11846    pub sepa_debit: Option<ConfirmSetupIntentPaymentMethodOptionsSepaDebit>,
11847    /// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options.
11848    #[serde(skip_serializing_if = "Option::is_none")]
11849    pub us_bank_account: Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccount>,
11850}
11851impl ConfirmSetupIntentPaymentMethodOptions {
11852    pub fn new() -> Self {
11853        Self {
11854            acss_debit: None,
11855            amazon_pay: None,
11856            bacs_debit: None,
11857            card: None,
11858            card_present: None,
11859            klarna: None,
11860            link: None,
11861            paypal: None,
11862            payto: None,
11863            sepa_debit: None,
11864            us_bank_account: None,
11865        }
11866    }
11867}
11868impl Default for ConfirmSetupIntentPaymentMethodOptions {
11869    fn default() -> Self {
11870        Self::new()
11871    }
11872}
11873/// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options.
11874#[derive(Clone, Debug, serde::Serialize)]
11875pub struct ConfirmSetupIntentPaymentMethodOptionsAcssDebit {
11876    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
11877    /// Must be a [supported currency](https://stripe.com/docs/currencies).
11878    #[serde(skip_serializing_if = "Option::is_none")]
11879    pub currency: Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency>,
11880    /// Additional fields for Mandate creation
11881    #[serde(skip_serializing_if = "Option::is_none")]
11882    pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions>,
11883    /// Bank account verification method.
11884    #[serde(skip_serializing_if = "Option::is_none")]
11885    pub verification_method:
11886        Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
11887}
11888impl ConfirmSetupIntentPaymentMethodOptionsAcssDebit {
11889    pub fn new() -> Self {
11890        Self { currency: None, mandate_options: None, verification_method: None }
11891    }
11892}
11893impl Default for ConfirmSetupIntentPaymentMethodOptionsAcssDebit {
11894    fn default() -> Self {
11895        Self::new()
11896    }
11897}
11898/// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
11899/// Must be a [supported currency](https://stripe.com/docs/currencies).
11900#[derive(Clone, Eq, PartialEq)]
11901#[non_exhaustive]
11902pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
11903    Cad,
11904    Usd,
11905    /// An unrecognized value from Stripe. Should not be used as a request parameter.
11906    Unknown(String),
11907}
11908impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
11909    pub fn as_str(&self) -> &str {
11910        use ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
11911        match self {
11912            Cad => "cad",
11913            Usd => "usd",
11914            Unknown(v) => v,
11915        }
11916    }
11917}
11918
11919impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
11920    type Err = std::convert::Infallible;
11921    fn from_str(s: &str) -> Result<Self, Self::Err> {
11922        use ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
11923        match s {
11924            "cad" => Ok(Cad),
11925            "usd" => Ok(Usd),
11926            v => {
11927                tracing::warn!(
11928                    "Unknown value '{}' for enum '{}'",
11929                    v,
11930                    "ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency"
11931                );
11932                Ok(Unknown(v.to_owned()))
11933            }
11934        }
11935    }
11936}
11937impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
11938    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11939        f.write_str(self.as_str())
11940    }
11941}
11942
11943impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
11944    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11945        f.write_str(self.as_str())
11946    }
11947}
11948impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
11949    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11950    where
11951        S: serde::Serializer,
11952    {
11953        serializer.serialize_str(self.as_str())
11954    }
11955}
11956#[cfg(feature = "deserialize")]
11957impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
11958    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11959        use std::str::FromStr;
11960        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11961        Ok(Self::from_str(&s).expect("infallible"))
11962    }
11963}
11964/// Additional fields for Mandate creation
11965#[derive(Clone, Debug, serde::Serialize)]
11966pub struct ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
11967    /// A URL for custom mandate text to render during confirmation step.
11968    /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,.
11969    /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent.
11970    #[serde(skip_serializing_if = "Option::is_none")]
11971    pub custom_mandate_url: Option<String>,
11972    /// List of Stripe products where this mandate can be selected automatically.
11973    #[serde(skip_serializing_if = "Option::is_none")]
11974    pub default_for:
11975        Option<Vec<ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor>>,
11976    /// Description of the mandate interval.
11977    /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'.
11978    #[serde(skip_serializing_if = "Option::is_none")]
11979    pub interval_description: Option<String>,
11980    /// Payment schedule for the mandate.
11981    #[serde(skip_serializing_if = "Option::is_none")]
11982    pub payment_schedule:
11983        Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
11984    /// Transaction type of the mandate.
11985    #[serde(skip_serializing_if = "Option::is_none")]
11986    pub transaction_type:
11987        Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
11988}
11989impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
11990    pub fn new() -> Self {
11991        Self {
11992            custom_mandate_url: None,
11993            default_for: None,
11994            interval_description: None,
11995            payment_schedule: None,
11996            transaction_type: None,
11997        }
11998    }
11999}
12000impl Default for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
12001    fn default() -> Self {
12002        Self::new()
12003    }
12004}
12005/// List of Stripe products where this mandate can be selected automatically.
12006#[derive(Clone, Eq, PartialEq)]
12007#[non_exhaustive]
12008pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
12009    Invoice,
12010    Subscription,
12011    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12012    Unknown(String),
12013}
12014impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
12015    pub fn as_str(&self) -> &str {
12016        use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
12017        match self {
12018            Invoice => "invoice",
12019            Subscription => "subscription",
12020            Unknown(v) => v,
12021        }
12022    }
12023}
12024
12025impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
12026    type Err = std::convert::Infallible;
12027    fn from_str(s: &str) -> Result<Self, Self::Err> {
12028        use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
12029        match s {
12030            "invoice" => Ok(Invoice),
12031            "subscription" => Ok(Subscription),
12032            v => {
12033                tracing::warn!(
12034                    "Unknown value '{}' for enum '{}'",
12035                    v,
12036                    "ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor"
12037                );
12038                Ok(Unknown(v.to_owned()))
12039            }
12040        }
12041    }
12042}
12043impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
12044    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12045        f.write_str(self.as_str())
12046    }
12047}
12048
12049impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
12050    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12051        f.write_str(self.as_str())
12052    }
12053}
12054impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
12055    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12056    where
12057        S: serde::Serializer,
12058    {
12059        serializer.serialize_str(self.as_str())
12060    }
12061}
12062#[cfg(feature = "deserialize")]
12063impl<'de> serde::Deserialize<'de>
12064    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
12065{
12066    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12067        use std::str::FromStr;
12068        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12069        Ok(Self::from_str(&s).expect("infallible"))
12070    }
12071}
12072/// Payment schedule for the mandate.
12073#[derive(Clone, Eq, PartialEq)]
12074#[non_exhaustive]
12075pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
12076    Combined,
12077    Interval,
12078    Sporadic,
12079    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12080    Unknown(String),
12081}
12082impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
12083    pub fn as_str(&self) -> &str {
12084        use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
12085        match self {
12086            Combined => "combined",
12087            Interval => "interval",
12088            Sporadic => "sporadic",
12089            Unknown(v) => v,
12090        }
12091    }
12092}
12093
12094impl std::str::FromStr
12095    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
12096{
12097    type Err = std::convert::Infallible;
12098    fn from_str(s: &str) -> Result<Self, Self::Err> {
12099        use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
12100        match s {
12101            "combined" => Ok(Combined),
12102            "interval" => Ok(Interval),
12103            "sporadic" => Ok(Sporadic),
12104            v => {
12105                tracing::warn!(
12106                    "Unknown value '{}' for enum '{}'",
12107                    v,
12108                    "ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"
12109                );
12110                Ok(Unknown(v.to_owned()))
12111            }
12112        }
12113    }
12114}
12115impl std::fmt::Display
12116    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
12117{
12118    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12119        f.write_str(self.as_str())
12120    }
12121}
12122
12123impl std::fmt::Debug
12124    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
12125{
12126    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12127        f.write_str(self.as_str())
12128    }
12129}
12130impl serde::Serialize
12131    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
12132{
12133    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12134    where
12135        S: serde::Serializer,
12136    {
12137        serializer.serialize_str(self.as_str())
12138    }
12139}
12140#[cfg(feature = "deserialize")]
12141impl<'de> serde::Deserialize<'de>
12142    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
12143{
12144    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12145        use std::str::FromStr;
12146        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12147        Ok(Self::from_str(&s).expect("infallible"))
12148    }
12149}
12150/// Transaction type of the mandate.
12151#[derive(Clone, Eq, PartialEq)]
12152#[non_exhaustive]
12153pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
12154    Business,
12155    Personal,
12156    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12157    Unknown(String),
12158}
12159impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
12160    pub fn as_str(&self) -> &str {
12161        use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
12162        match self {
12163            Business => "business",
12164            Personal => "personal",
12165            Unknown(v) => v,
12166        }
12167    }
12168}
12169
12170impl std::str::FromStr
12171    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
12172{
12173    type Err = std::convert::Infallible;
12174    fn from_str(s: &str) -> Result<Self, Self::Err> {
12175        use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
12176        match s {
12177            "business" => Ok(Business),
12178            "personal" => Ok(Personal),
12179            v => {
12180                tracing::warn!(
12181                    "Unknown value '{}' for enum '{}'",
12182                    v,
12183                    "ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"
12184                );
12185                Ok(Unknown(v.to_owned()))
12186            }
12187        }
12188    }
12189}
12190impl std::fmt::Display
12191    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
12192{
12193    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12194        f.write_str(self.as_str())
12195    }
12196}
12197
12198impl std::fmt::Debug
12199    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
12200{
12201    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12202        f.write_str(self.as_str())
12203    }
12204}
12205impl serde::Serialize
12206    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
12207{
12208    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12209    where
12210        S: serde::Serializer,
12211    {
12212        serializer.serialize_str(self.as_str())
12213    }
12214}
12215#[cfg(feature = "deserialize")]
12216impl<'de> serde::Deserialize<'de>
12217    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
12218{
12219    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12220        use std::str::FromStr;
12221        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12222        Ok(Self::from_str(&s).expect("infallible"))
12223    }
12224}
12225/// Bank account verification method.
12226#[derive(Clone, Eq, PartialEq)]
12227#[non_exhaustive]
12228pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
12229    Automatic,
12230    Instant,
12231    Microdeposits,
12232    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12233    Unknown(String),
12234}
12235impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
12236    pub fn as_str(&self) -> &str {
12237        use ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
12238        match self {
12239            Automatic => "automatic",
12240            Instant => "instant",
12241            Microdeposits => "microdeposits",
12242            Unknown(v) => v,
12243        }
12244    }
12245}
12246
12247impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
12248    type Err = std::convert::Infallible;
12249    fn from_str(s: &str) -> Result<Self, Self::Err> {
12250        use ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
12251        match s {
12252            "automatic" => Ok(Automatic),
12253            "instant" => Ok(Instant),
12254            "microdeposits" => Ok(Microdeposits),
12255            v => {
12256                tracing::warn!(
12257                    "Unknown value '{}' for enum '{}'",
12258                    v,
12259                    "ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod"
12260                );
12261                Ok(Unknown(v.to_owned()))
12262            }
12263        }
12264    }
12265}
12266impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
12267    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12268        f.write_str(self.as_str())
12269    }
12270}
12271
12272impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
12273    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12274        f.write_str(self.as_str())
12275    }
12276}
12277impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
12278    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12279    where
12280        S: serde::Serializer,
12281    {
12282        serializer.serialize_str(self.as_str())
12283    }
12284}
12285#[cfg(feature = "deserialize")]
12286impl<'de> serde::Deserialize<'de>
12287    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod
12288{
12289    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12290        use std::str::FromStr;
12291        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12292        Ok(Self::from_str(&s).expect("infallible"))
12293    }
12294}
12295/// If this is a `bacs_debit` SetupIntent, this sub-hash contains details about the Bacs Debit payment method options.
12296#[derive(Clone, Debug, serde::Serialize)]
12297pub struct ConfirmSetupIntentPaymentMethodOptionsBacsDebit {
12298    /// Additional fields for Mandate creation
12299    #[serde(skip_serializing_if = "Option::is_none")]
12300    pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
12301}
12302impl ConfirmSetupIntentPaymentMethodOptionsBacsDebit {
12303    pub fn new() -> Self {
12304        Self { mandate_options: None }
12305    }
12306}
12307impl Default for ConfirmSetupIntentPaymentMethodOptionsBacsDebit {
12308    fn default() -> Self {
12309        Self::new()
12310    }
12311}
12312/// Configuration for any card setup attempted on this SetupIntent.
12313#[derive(Clone, Debug, serde::Serialize)]
12314pub struct ConfirmSetupIntentPaymentMethodOptionsCard {
12315    /// Configuration options for setting up an eMandate for cards issued in India.
12316    #[serde(skip_serializing_if = "Option::is_none")]
12317    pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsCardMandateOptions>,
12318    /// When specified, this parameter signals that a card has been collected
12319    /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This
12320    /// parameter can only be provided during confirmation.
12321    #[serde(skip_serializing_if = "Option::is_none")]
12322    pub moto: Option<bool>,
12323    /// Selected network to process this SetupIntent on.
12324    /// Depends on the available networks of the card attached to the SetupIntent.
12325    /// Can be only set confirm-time.
12326    #[serde(skip_serializing_if = "Option::is_none")]
12327    pub network: Option<ConfirmSetupIntentPaymentMethodOptionsCardNetwork>,
12328    /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication).
12329    /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
12330    /// If not provided, this value defaults to `automatic`.
12331    /// Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
12332    #[serde(skip_serializing_if = "Option::is_none")]
12333    pub request_three_d_secure:
12334        Option<ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure>,
12335    /// If 3D Secure authentication was performed with a third-party provider,
12336    /// the authentication details to use for this setup.
12337    #[serde(skip_serializing_if = "Option::is_none")]
12338    pub three_d_secure: Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure>,
12339}
12340impl ConfirmSetupIntentPaymentMethodOptionsCard {
12341    pub fn new() -> Self {
12342        Self {
12343            mandate_options: None,
12344            moto: None,
12345            network: None,
12346            request_three_d_secure: None,
12347            three_d_secure: None,
12348        }
12349    }
12350}
12351impl Default for ConfirmSetupIntentPaymentMethodOptionsCard {
12352    fn default() -> Self {
12353        Self::new()
12354    }
12355}
12356/// Configuration options for setting up an eMandate for cards issued in India.
12357#[derive(Clone, Debug, serde::Serialize)]
12358pub struct ConfirmSetupIntentPaymentMethodOptionsCardMandateOptions {
12359    /// Amount to be charged for future payments.
12360    pub amount: i64,
12361    /// One of `fixed` or `maximum`.
12362    /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
12363    /// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
12364    pub amount_type: ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType,
12365    /// Currency in which future payments will be charged.
12366    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
12367    /// Must be a [supported currency](https://stripe.com/docs/currencies).
12368    pub currency: stripe_types::Currency,
12369    /// A description of the mandate or subscription that is meant to be displayed to the customer.
12370    #[serde(skip_serializing_if = "Option::is_none")]
12371    pub description: Option<String>,
12372    /// End date of the mandate or subscription.
12373    /// If not provided, the mandate will be active until canceled.
12374    /// If provided, end date should be after start date.
12375    #[serde(skip_serializing_if = "Option::is_none")]
12376    pub end_date: Option<stripe_types::Timestamp>,
12377    /// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
12378    pub interval: ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval,
12379    /// The number of intervals between payments.
12380    /// For example, `interval=month` and `interval_count=3` indicates one payment every three months.
12381    /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).
12382    /// This parameter is optional when `interval=sporadic`.
12383    #[serde(skip_serializing_if = "Option::is_none")]
12384    pub interval_count: Option<u64>,
12385    /// Unique identifier for the mandate or subscription.
12386    pub reference: String,
12387    /// Start date of the mandate or subscription. Start date should not be lesser than yesterday.
12388    pub start_date: stripe_types::Timestamp,
12389    /// Specifies the type of mandates supported. Possible values are `india`.
12390    #[serde(skip_serializing_if = "Option::is_none")]
12391    pub supported_types:
12392        Option<Vec<ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
12393}
12394impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptions {
12395    pub fn new(
12396        amount: impl Into<i64>,
12397        amount_type: impl Into<ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
12398        currency: impl Into<stripe_types::Currency>,
12399        interval: impl Into<ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval>,
12400        reference: impl Into<String>,
12401        start_date: impl Into<stripe_types::Timestamp>,
12402    ) -> Self {
12403        Self {
12404            amount: amount.into(),
12405            amount_type: amount_type.into(),
12406            currency: currency.into(),
12407            description: None,
12408            end_date: None,
12409            interval: interval.into(),
12410            interval_count: None,
12411            reference: reference.into(),
12412            start_date: start_date.into(),
12413            supported_types: None,
12414        }
12415    }
12416}
12417/// One of `fixed` or `maximum`.
12418/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
12419/// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
12420#[derive(Clone, Eq, PartialEq)]
12421#[non_exhaustive]
12422pub enum ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
12423    Fixed,
12424    Maximum,
12425    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12426    Unknown(String),
12427}
12428impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
12429    pub fn as_str(&self) -> &str {
12430        use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
12431        match self {
12432            Fixed => "fixed",
12433            Maximum => "maximum",
12434            Unknown(v) => v,
12435        }
12436    }
12437}
12438
12439impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
12440    type Err = std::convert::Infallible;
12441    fn from_str(s: &str) -> Result<Self, Self::Err> {
12442        use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
12443        match s {
12444            "fixed" => Ok(Fixed),
12445            "maximum" => Ok(Maximum),
12446            v => {
12447                tracing::warn!(
12448                    "Unknown value '{}' for enum '{}'",
12449                    v,
12450                    "ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType"
12451                );
12452                Ok(Unknown(v.to_owned()))
12453            }
12454        }
12455    }
12456}
12457impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
12458    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12459        f.write_str(self.as_str())
12460    }
12461}
12462
12463impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
12464    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12465        f.write_str(self.as_str())
12466    }
12467}
12468impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
12469    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12470    where
12471        S: serde::Serializer,
12472    {
12473        serializer.serialize_str(self.as_str())
12474    }
12475}
12476#[cfg(feature = "deserialize")]
12477impl<'de> serde::Deserialize<'de>
12478    for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType
12479{
12480    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12481        use std::str::FromStr;
12482        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12483        Ok(Self::from_str(&s).expect("infallible"))
12484    }
12485}
12486/// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
12487#[derive(Clone, Eq, PartialEq)]
12488#[non_exhaustive]
12489pub enum ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
12490    Day,
12491    Month,
12492    Sporadic,
12493    Week,
12494    Year,
12495    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12496    Unknown(String),
12497}
12498impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
12499    pub fn as_str(&self) -> &str {
12500        use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
12501        match self {
12502            Day => "day",
12503            Month => "month",
12504            Sporadic => "sporadic",
12505            Week => "week",
12506            Year => "year",
12507            Unknown(v) => v,
12508        }
12509    }
12510}
12511
12512impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
12513    type Err = std::convert::Infallible;
12514    fn from_str(s: &str) -> Result<Self, Self::Err> {
12515        use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
12516        match s {
12517            "day" => Ok(Day),
12518            "month" => Ok(Month),
12519            "sporadic" => Ok(Sporadic),
12520            "week" => Ok(Week),
12521            "year" => Ok(Year),
12522            v => {
12523                tracing::warn!(
12524                    "Unknown value '{}' for enum '{}'",
12525                    v,
12526                    "ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval"
12527                );
12528                Ok(Unknown(v.to_owned()))
12529            }
12530        }
12531    }
12532}
12533impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
12534    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12535        f.write_str(self.as_str())
12536    }
12537}
12538
12539impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
12540    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12541        f.write_str(self.as_str())
12542    }
12543}
12544impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
12545    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12546    where
12547        S: serde::Serializer,
12548    {
12549        serializer.serialize_str(self.as_str())
12550    }
12551}
12552#[cfg(feature = "deserialize")]
12553impl<'de> serde::Deserialize<'de>
12554    for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval
12555{
12556    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12557        use std::str::FromStr;
12558        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12559        Ok(Self::from_str(&s).expect("infallible"))
12560    }
12561}
12562/// Specifies the type of mandates supported. Possible values are `india`.
12563#[derive(Clone, Eq, PartialEq)]
12564#[non_exhaustive]
12565pub enum ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
12566    India,
12567    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12568    Unknown(String),
12569}
12570impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
12571    pub fn as_str(&self) -> &str {
12572        use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
12573        match self {
12574            India => "india",
12575            Unknown(v) => v,
12576        }
12577    }
12578}
12579
12580impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
12581    type Err = std::convert::Infallible;
12582    fn from_str(s: &str) -> Result<Self, Self::Err> {
12583        use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
12584        match s {
12585            "india" => Ok(India),
12586            v => {
12587                tracing::warn!(
12588                    "Unknown value '{}' for enum '{}'",
12589                    v,
12590                    "ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"
12591                );
12592                Ok(Unknown(v.to_owned()))
12593            }
12594        }
12595    }
12596}
12597impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
12598    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12599        f.write_str(self.as_str())
12600    }
12601}
12602
12603impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
12604    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12605        f.write_str(self.as_str())
12606    }
12607}
12608impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
12609    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12610    where
12611        S: serde::Serializer,
12612    {
12613        serializer.serialize_str(self.as_str())
12614    }
12615}
12616#[cfg(feature = "deserialize")]
12617impl<'de> serde::Deserialize<'de>
12618    for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
12619{
12620    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12621        use std::str::FromStr;
12622        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12623        Ok(Self::from_str(&s).expect("infallible"))
12624    }
12625}
12626/// Selected network to process this SetupIntent on.
12627/// Depends on the available networks of the card attached to the SetupIntent.
12628/// Can be only set confirm-time.
12629#[derive(Clone, Eq, PartialEq)]
12630#[non_exhaustive]
12631pub enum ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
12632    Amex,
12633    CartesBancaires,
12634    Diners,
12635    Discover,
12636    EftposAu,
12637    Girocard,
12638    Interac,
12639    Jcb,
12640    Link,
12641    Mastercard,
12642    Unionpay,
12643    Unknown,
12644    Visa,
12645    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12646    /// This variant is prefixed with an underscore to avoid conflicts with Stripe's 'Unknown' variant.
12647    _Unknown(String),
12648}
12649impl ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
12650    pub fn as_str(&self) -> &str {
12651        use ConfirmSetupIntentPaymentMethodOptionsCardNetwork::*;
12652        match self {
12653            Amex => "amex",
12654            CartesBancaires => "cartes_bancaires",
12655            Diners => "diners",
12656            Discover => "discover",
12657            EftposAu => "eftpos_au",
12658            Girocard => "girocard",
12659            Interac => "interac",
12660            Jcb => "jcb",
12661            Link => "link",
12662            Mastercard => "mastercard",
12663            Unionpay => "unionpay",
12664            Unknown => "unknown",
12665            Visa => "visa",
12666            _Unknown(v) => v,
12667        }
12668    }
12669}
12670
12671impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
12672    type Err = std::convert::Infallible;
12673    fn from_str(s: &str) -> Result<Self, Self::Err> {
12674        use ConfirmSetupIntentPaymentMethodOptionsCardNetwork::*;
12675        match s {
12676            "amex" => Ok(Amex),
12677            "cartes_bancaires" => Ok(CartesBancaires),
12678            "diners" => Ok(Diners),
12679            "discover" => Ok(Discover),
12680            "eftpos_au" => Ok(EftposAu),
12681            "girocard" => Ok(Girocard),
12682            "interac" => Ok(Interac),
12683            "jcb" => Ok(Jcb),
12684            "link" => Ok(Link),
12685            "mastercard" => Ok(Mastercard),
12686            "unionpay" => Ok(Unionpay),
12687            "unknown" => Ok(Unknown),
12688            "visa" => Ok(Visa),
12689            v => {
12690                tracing::warn!(
12691                    "Unknown value '{}' for enum '{}'",
12692                    v,
12693                    "ConfirmSetupIntentPaymentMethodOptionsCardNetwork"
12694                );
12695                Ok(_Unknown(v.to_owned()))
12696            }
12697        }
12698    }
12699}
12700impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
12701    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12702        f.write_str(self.as_str())
12703    }
12704}
12705
12706impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
12707    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12708        f.write_str(self.as_str())
12709    }
12710}
12711impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
12712    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12713    where
12714        S: serde::Serializer,
12715    {
12716        serializer.serialize_str(self.as_str())
12717    }
12718}
12719#[cfg(feature = "deserialize")]
12720impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
12721    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12722        use std::str::FromStr;
12723        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12724        Ok(Self::from_str(&s).expect("infallible"))
12725    }
12726}
12727/// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication).
12728/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
12729/// If not provided, this value defaults to `automatic`.
12730/// Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
12731#[derive(Clone, Eq, PartialEq)]
12732#[non_exhaustive]
12733pub enum ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
12734    Any,
12735    Automatic,
12736    Challenge,
12737    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12738    Unknown(String),
12739}
12740impl ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
12741    pub fn as_str(&self) -> &str {
12742        use ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
12743        match self {
12744            Any => "any",
12745            Automatic => "automatic",
12746            Challenge => "challenge",
12747            Unknown(v) => v,
12748        }
12749    }
12750}
12751
12752impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
12753    type Err = std::convert::Infallible;
12754    fn from_str(s: &str) -> Result<Self, Self::Err> {
12755        use ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
12756        match s {
12757            "any" => Ok(Any),
12758            "automatic" => Ok(Automatic),
12759            "challenge" => Ok(Challenge),
12760            v => {
12761                tracing::warn!(
12762                    "Unknown value '{}' for enum '{}'",
12763                    v,
12764                    "ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure"
12765                );
12766                Ok(Unknown(v.to_owned()))
12767            }
12768        }
12769    }
12770}
12771impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
12772    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12773        f.write_str(self.as_str())
12774    }
12775}
12776
12777impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
12778    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12779        f.write_str(self.as_str())
12780    }
12781}
12782impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
12783    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12784    where
12785        S: serde::Serializer,
12786    {
12787        serializer.serialize_str(self.as_str())
12788    }
12789}
12790#[cfg(feature = "deserialize")]
12791impl<'de> serde::Deserialize<'de>
12792    for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure
12793{
12794    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12795        use std::str::FromStr;
12796        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12797        Ok(Self::from_str(&s).expect("infallible"))
12798    }
12799}
12800/// If 3D Secure authentication was performed with a third-party provider,
12801/// the authentication details to use for this setup.
12802#[derive(Clone, Debug, serde::Serialize)]
12803pub struct ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure {
12804    /// The `transStatus` returned from the card Issuer’s ACS in the ARes.
12805    #[serde(skip_serializing_if = "Option::is_none")]
12806    pub ares_trans_status:
12807        Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
12808    /// The cryptogram, also known as the "authentication value" (AAV, CAVV or
12809    /// AEVV). This value is 20 bytes, base64-encoded into a 28-character string.
12810    /// (Most 3D Secure providers will return the base64-encoded version, which
12811    /// is what you should specify here.)
12812    #[serde(skip_serializing_if = "Option::is_none")]
12813    pub cryptogram: Option<String>,
12814    /// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
12815    /// provider and indicates what degree of authentication was performed.
12816    #[serde(skip_serializing_if = "Option::is_none")]
12817    pub electronic_commerce_indicator:
12818        Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
12819    /// Network specific 3DS fields. Network specific arguments require an
12820    /// explicit card brand choice. The parameter `payment_method_options.card.network``
12821    /// must be populated accordingly
12822    #[serde(skip_serializing_if = "Option::is_none")]
12823    pub network_options:
12824        Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
12825    /// The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the
12826    /// AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99.
12827    #[serde(skip_serializing_if = "Option::is_none")]
12828    pub requestor_challenge_indicator: Option<String>,
12829    /// For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server
12830    /// Transaction ID (dsTransID).
12831    #[serde(skip_serializing_if = "Option::is_none")]
12832    pub transaction_id: Option<String>,
12833    /// The version of 3D Secure that was performed.
12834    #[serde(skip_serializing_if = "Option::is_none")]
12835    pub version: Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion>,
12836}
12837impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure {
12838    pub fn new() -> Self {
12839        Self {
12840            ares_trans_status: None,
12841            cryptogram: None,
12842            electronic_commerce_indicator: None,
12843            network_options: None,
12844            requestor_challenge_indicator: None,
12845            transaction_id: None,
12846            version: None,
12847        }
12848    }
12849}
12850impl Default for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure {
12851    fn default() -> Self {
12852        Self::new()
12853    }
12854}
12855/// The `transStatus` returned from the card Issuer’s ACS in the ARes.
12856#[derive(Clone, Eq, PartialEq)]
12857#[non_exhaustive]
12858pub enum ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
12859    A,
12860    C,
12861    I,
12862    N,
12863    R,
12864    U,
12865    Y,
12866    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12867    Unknown(String),
12868}
12869impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
12870    pub fn as_str(&self) -> &str {
12871        use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
12872        match self {
12873            A => "A",
12874            C => "C",
12875            I => "I",
12876            N => "N",
12877            R => "R",
12878            U => "U",
12879            Y => "Y",
12880            Unknown(v) => v,
12881        }
12882    }
12883}
12884
12885impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
12886    type Err = std::convert::Infallible;
12887    fn from_str(s: &str) -> Result<Self, Self::Err> {
12888        use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
12889        match s {
12890            "A" => Ok(A),
12891            "C" => Ok(C),
12892            "I" => Ok(I),
12893            "N" => Ok(N),
12894            "R" => Ok(R),
12895            "U" => Ok(U),
12896            "Y" => Ok(Y),
12897            v => {
12898                tracing::warn!(
12899                    "Unknown value '{}' for enum '{}'",
12900                    v,
12901                    "ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"
12902                );
12903                Ok(Unknown(v.to_owned()))
12904            }
12905        }
12906    }
12907}
12908impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
12909    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12910        f.write_str(self.as_str())
12911    }
12912}
12913
12914impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
12915    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12916        f.write_str(self.as_str())
12917    }
12918}
12919impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
12920    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12921    where
12922        S: serde::Serializer,
12923    {
12924        serializer.serialize_str(self.as_str())
12925    }
12926}
12927#[cfg(feature = "deserialize")]
12928impl<'de> serde::Deserialize<'de>
12929    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
12930{
12931    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12932        use std::str::FromStr;
12933        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12934        Ok(Self::from_str(&s).expect("infallible"))
12935    }
12936}
12937/// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
12938/// provider and indicates what degree of authentication was performed.
12939#[derive(Clone, Eq, PartialEq)]
12940#[non_exhaustive]
12941pub enum ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
12942    V01,
12943    V02,
12944    V05,
12945    V06,
12946    V07,
12947    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12948    Unknown(String),
12949}
12950impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
12951    pub fn as_str(&self) -> &str {
12952        use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
12953        match self {
12954            V01 => "01",
12955            V02 => "02",
12956            V05 => "05",
12957            V06 => "06",
12958            V07 => "07",
12959            Unknown(v) => v,
12960        }
12961    }
12962}
12963
12964impl std::str::FromStr
12965    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
12966{
12967    type Err = std::convert::Infallible;
12968    fn from_str(s: &str) -> Result<Self, Self::Err> {
12969        use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
12970        match s {
12971            "01" => Ok(V01),
12972            "02" => Ok(V02),
12973            "05" => Ok(V05),
12974            "06" => Ok(V06),
12975            "07" => Ok(V07),
12976            v => {
12977                tracing::warn!(
12978                    "Unknown value '{}' for enum '{}'",
12979                    v,
12980                    "ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"
12981                );
12982                Ok(Unknown(v.to_owned()))
12983            }
12984        }
12985    }
12986}
12987impl std::fmt::Display
12988    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
12989{
12990    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12991        f.write_str(self.as_str())
12992    }
12993}
12994
12995impl std::fmt::Debug
12996    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
12997{
12998    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12999        f.write_str(self.as_str())
13000    }
13001}
13002impl serde::Serialize
13003    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
13004{
13005    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13006    where
13007        S: serde::Serializer,
13008    {
13009        serializer.serialize_str(self.as_str())
13010    }
13011}
13012#[cfg(feature = "deserialize")]
13013impl<'de> serde::Deserialize<'de>
13014    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
13015{
13016    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13017        use std::str::FromStr;
13018        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13019        Ok(Self::from_str(&s).expect("infallible"))
13020    }
13021}
13022/// Network specific 3DS fields. Network specific arguments require an
13023/// explicit card brand choice. The parameter `payment_method_options.card.network``
13024/// must be populated accordingly
13025#[derive(Clone, Debug, serde::Serialize)]
13026pub struct ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
13027    /// Cartes Bancaires-specific 3DS fields.
13028    #[serde(skip_serializing_if = "Option::is_none")]
13029    pub cartes_bancaires:
13030        Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires>,
13031}
13032impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
13033    pub fn new() -> Self {
13034        Self { cartes_bancaires: None }
13035    }
13036}
13037impl Default for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
13038    fn default() -> Self {
13039        Self::new()
13040    }
13041}
13042/// Cartes Bancaires-specific 3DS fields.
13043#[derive(Clone, Debug, serde::Serialize)]
13044pub struct ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
13045    /// The cryptogram calculation algorithm used by the card Issuer's ACS
13046    /// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
13047    /// messageExtension: CB-AVALGO
13048    pub cb_avalgo:
13049        ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
13050    /// The exemption indicator returned from Cartes Bancaires in the ARes.
13051    /// message extension: CB-EXEMPTION; string (4 characters)
13052    /// This is a 3 byte bitmap (low significant byte first and most significant
13053    /// bit first) that has been Base64 encoded
13054    #[serde(skip_serializing_if = "Option::is_none")]
13055    pub cb_exemption: Option<String>,
13056    /// The risk score returned from Cartes Bancaires in the ARes.
13057    /// message extension: CB-SCORE; numeric value 0-99
13058    #[serde(skip_serializing_if = "Option::is_none")]
13059    pub cb_score: Option<i64>,
13060}
13061impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
13062    pub fn new(
13063        cb_avalgo: impl Into<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
13064    ) -> Self {
13065        Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
13066    }
13067}
13068/// The cryptogram calculation algorithm used by the card Issuer's ACS
13069/// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
13070/// messageExtension: CB-AVALGO
13071#[derive(Clone, Eq, PartialEq)]
13072#[non_exhaustive]
13073pub enum ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
13074{
13075    V0,
13076    V1,
13077    V2,
13078    V3,
13079    V4,
13080    A,
13081    /// An unrecognized value from Stripe. Should not be used as a request parameter.
13082    Unknown(String),
13083}
13084impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
13085    pub fn as_str(&self) -> &str {
13086        use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
13087        match self {
13088            V0 => "0",
13089            V1 => "1",
13090            V2 => "2",
13091            V3 => "3",
13092            V4 => "4",
13093            A => "A",
13094            Unknown(v) => v,
13095        }
13096    }
13097}
13098
13099impl std::str::FromStr
13100    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
13101{
13102    type Err = std::convert::Infallible;
13103    fn from_str(s: &str) -> Result<Self, Self::Err> {
13104        use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
13105        match s {
13106            "0" => Ok(V0),
13107            "1" => Ok(V1),
13108            "2" => Ok(V2),
13109            "3" => Ok(V3),
13110            "4" => Ok(V4),
13111            "A" => Ok(A),
13112            v => {
13113                tracing::warn!(
13114                    "Unknown value '{}' for enum '{}'",
13115                    v,
13116                    "ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"
13117                );
13118                Ok(Unknown(v.to_owned()))
13119            }
13120        }
13121    }
13122}
13123impl std::fmt::Display
13124    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
13125{
13126    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13127        f.write_str(self.as_str())
13128    }
13129}
13130
13131impl std::fmt::Debug
13132    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
13133{
13134    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13135        f.write_str(self.as_str())
13136    }
13137}
13138impl serde::Serialize
13139    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
13140{
13141    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13142    where
13143        S: serde::Serializer,
13144    {
13145        serializer.serialize_str(self.as_str())
13146    }
13147}
13148#[cfg(feature = "deserialize")]
13149impl<'de> serde::Deserialize<'de>
13150    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
13151{
13152    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13153        use std::str::FromStr;
13154        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13155        Ok(Self::from_str(&s).expect("infallible"))
13156    }
13157}
13158/// The version of 3D Secure that was performed.
13159#[derive(Clone, Eq, PartialEq)]
13160#[non_exhaustive]
13161pub enum ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
13162    V1_0_2,
13163    V2_1_0,
13164    V2_2_0,
13165    /// An unrecognized value from Stripe. Should not be used as a request parameter.
13166    Unknown(String),
13167}
13168impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
13169    pub fn as_str(&self) -> &str {
13170        use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
13171        match self {
13172            V1_0_2 => "1.0.2",
13173            V2_1_0 => "2.1.0",
13174            V2_2_0 => "2.2.0",
13175            Unknown(v) => v,
13176        }
13177    }
13178}
13179
13180impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
13181    type Err = std::convert::Infallible;
13182    fn from_str(s: &str) -> Result<Self, Self::Err> {
13183        use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
13184        match s {
13185            "1.0.2" => Ok(V1_0_2),
13186            "2.1.0" => Ok(V2_1_0),
13187            "2.2.0" => Ok(V2_2_0),
13188            v => {
13189                tracing::warn!(
13190                    "Unknown value '{}' for enum '{}'",
13191                    v,
13192                    "ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion"
13193                );
13194                Ok(Unknown(v.to_owned()))
13195            }
13196        }
13197    }
13198}
13199impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
13200    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13201        f.write_str(self.as_str())
13202    }
13203}
13204
13205impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
13206    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13207        f.write_str(self.as_str())
13208    }
13209}
13210impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
13211    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13212    where
13213        S: serde::Serializer,
13214    {
13215        serializer.serialize_str(self.as_str())
13216    }
13217}
13218#[cfg(feature = "deserialize")]
13219impl<'de> serde::Deserialize<'de>
13220    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion
13221{
13222    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13223        use std::str::FromStr;
13224        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13225        Ok(Self::from_str(&s).expect("infallible"))
13226    }
13227}
13228/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options.
13229#[derive(Clone, Debug, serde::Serialize)]
13230pub struct ConfirmSetupIntentPaymentMethodOptionsKlarna {
13231    /// The currency of the SetupIntent. Three letter ISO currency code.
13232    #[serde(skip_serializing_if = "Option::is_none")]
13233    pub currency: Option<stripe_types::Currency>,
13234    /// On-demand details if setting up a payment method for on-demand payments.
13235    #[serde(skip_serializing_if = "Option::is_none")]
13236    pub on_demand: Option<ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemand>,
13237    /// Preferred language of the Klarna authorization page that the customer is redirected to
13238    #[serde(skip_serializing_if = "Option::is_none")]
13239    pub preferred_locale: Option<ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale>,
13240    /// Subscription details if setting up or charging a subscription
13241    #[serde(skip_serializing_if = "Option::is_none")]
13242    pub subscriptions: Option<Vec<ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptions>>,
13243}
13244impl ConfirmSetupIntentPaymentMethodOptionsKlarna {
13245    pub fn new() -> Self {
13246        Self { currency: None, on_demand: None, preferred_locale: None, subscriptions: None }
13247    }
13248}
13249impl Default for ConfirmSetupIntentPaymentMethodOptionsKlarna {
13250    fn default() -> Self {
13251        Self::new()
13252    }
13253}
13254/// On-demand details if setting up a payment method for on-demand payments.
13255#[derive(Clone, Debug, serde::Serialize)]
13256pub struct ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemand {
13257    /// Your average amount value.
13258    /// You can use a value across your customer base, or segment based on customer type, country, etc.
13259    #[serde(skip_serializing_if = "Option::is_none")]
13260    pub average_amount: Option<i64>,
13261    /// The maximum value you may charge a customer per purchase.
13262    /// You can use a value across your customer base, or segment based on customer type, country, etc.
13263    #[serde(skip_serializing_if = "Option::is_none")]
13264    pub maximum_amount: Option<i64>,
13265    /// The lowest or minimum value you may charge a customer per purchase.
13266    /// You can use a value across your customer base, or segment based on customer type, country, etc.
13267    #[serde(skip_serializing_if = "Option::is_none")]
13268    pub minimum_amount: Option<i64>,
13269    /// Interval at which the customer is making purchases
13270    #[serde(skip_serializing_if = "Option::is_none")]
13271    pub purchase_interval:
13272        Option<ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
13273    /// The number of `purchase_interval` between charges
13274    #[serde(skip_serializing_if = "Option::is_none")]
13275    pub purchase_interval_count: Option<u64>,
13276}
13277impl ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemand {
13278    pub fn new() -> Self {
13279        Self {
13280            average_amount: None,
13281            maximum_amount: None,
13282            minimum_amount: None,
13283            purchase_interval: None,
13284            purchase_interval_count: None,
13285        }
13286    }
13287}
13288impl Default for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemand {
13289    fn default() -> Self {
13290        Self::new()
13291    }
13292}
13293/// Interval at which the customer is making purchases
13294#[derive(Clone, Eq, PartialEq)]
13295#[non_exhaustive]
13296pub enum ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
13297    Day,
13298    Month,
13299    Week,
13300    Year,
13301    /// An unrecognized value from Stripe. Should not be used as a request parameter.
13302    Unknown(String),
13303}
13304impl ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
13305    pub fn as_str(&self) -> &str {
13306        use ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
13307        match self {
13308            Day => "day",
13309            Month => "month",
13310            Week => "week",
13311            Year => "year",
13312            Unknown(v) => v,
13313        }
13314    }
13315}
13316
13317impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
13318    type Err = std::convert::Infallible;
13319    fn from_str(s: &str) -> Result<Self, Self::Err> {
13320        use ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
13321        match s {
13322            "day" => Ok(Day),
13323            "month" => Ok(Month),
13324            "week" => Ok(Week),
13325            "year" => Ok(Year),
13326            v => {
13327                tracing::warn!(
13328                    "Unknown value '{}' for enum '{}'",
13329                    v,
13330                    "ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"
13331                );
13332                Ok(Unknown(v.to_owned()))
13333            }
13334        }
13335    }
13336}
13337impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
13338    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13339        f.write_str(self.as_str())
13340    }
13341}
13342
13343impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
13344    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13345        f.write_str(self.as_str())
13346    }
13347}
13348impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
13349    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13350    where
13351        S: serde::Serializer,
13352    {
13353        serializer.serialize_str(self.as_str())
13354    }
13355}
13356#[cfg(feature = "deserialize")]
13357impl<'de> serde::Deserialize<'de>
13358    for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
13359{
13360    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13361        use std::str::FromStr;
13362        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13363        Ok(Self::from_str(&s).expect("infallible"))
13364    }
13365}
13366/// Preferred language of the Klarna authorization page that the customer is redirected to
13367#[derive(Clone, Eq, PartialEq)]
13368#[non_exhaustive]
13369pub enum ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
13370    CsMinusCz,
13371    DaMinusDk,
13372    DeMinusAt,
13373    DeMinusCh,
13374    DeMinusDe,
13375    ElMinusGr,
13376    EnMinusAt,
13377    EnMinusAu,
13378    EnMinusBe,
13379    EnMinusCa,
13380    EnMinusCh,
13381    EnMinusCz,
13382    EnMinusDe,
13383    EnMinusDk,
13384    EnMinusEs,
13385    EnMinusFi,
13386    EnMinusFr,
13387    EnMinusGb,
13388    EnMinusGr,
13389    EnMinusIe,
13390    EnMinusIt,
13391    EnMinusNl,
13392    EnMinusNo,
13393    EnMinusNz,
13394    EnMinusPl,
13395    EnMinusPt,
13396    EnMinusRo,
13397    EnMinusSe,
13398    EnMinusUs,
13399    EsMinusEs,
13400    EsMinusUs,
13401    FiMinusFi,
13402    FrMinusBe,
13403    FrMinusCa,
13404    FrMinusCh,
13405    FrMinusFr,
13406    ItMinusCh,
13407    ItMinusIt,
13408    NbMinusNo,
13409    NlMinusBe,
13410    NlMinusNl,
13411    PlMinusPl,
13412    PtMinusPt,
13413    RoMinusRo,
13414    SvMinusFi,
13415    SvMinusSe,
13416    /// An unrecognized value from Stripe. Should not be used as a request parameter.
13417    Unknown(String),
13418}
13419impl ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
13420    pub fn as_str(&self) -> &str {
13421        use ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
13422        match self {
13423            CsMinusCz => "cs-CZ",
13424            DaMinusDk => "da-DK",
13425            DeMinusAt => "de-AT",
13426            DeMinusCh => "de-CH",
13427            DeMinusDe => "de-DE",
13428            ElMinusGr => "el-GR",
13429            EnMinusAt => "en-AT",
13430            EnMinusAu => "en-AU",
13431            EnMinusBe => "en-BE",
13432            EnMinusCa => "en-CA",
13433            EnMinusCh => "en-CH",
13434            EnMinusCz => "en-CZ",
13435            EnMinusDe => "en-DE",
13436            EnMinusDk => "en-DK",
13437            EnMinusEs => "en-ES",
13438            EnMinusFi => "en-FI",
13439            EnMinusFr => "en-FR",
13440            EnMinusGb => "en-GB",
13441            EnMinusGr => "en-GR",
13442            EnMinusIe => "en-IE",
13443            EnMinusIt => "en-IT",
13444            EnMinusNl => "en-NL",
13445            EnMinusNo => "en-NO",
13446            EnMinusNz => "en-NZ",
13447            EnMinusPl => "en-PL",
13448            EnMinusPt => "en-PT",
13449            EnMinusRo => "en-RO",
13450            EnMinusSe => "en-SE",
13451            EnMinusUs => "en-US",
13452            EsMinusEs => "es-ES",
13453            EsMinusUs => "es-US",
13454            FiMinusFi => "fi-FI",
13455            FrMinusBe => "fr-BE",
13456            FrMinusCa => "fr-CA",
13457            FrMinusCh => "fr-CH",
13458            FrMinusFr => "fr-FR",
13459            ItMinusCh => "it-CH",
13460            ItMinusIt => "it-IT",
13461            NbMinusNo => "nb-NO",
13462            NlMinusBe => "nl-BE",
13463            NlMinusNl => "nl-NL",
13464            PlMinusPl => "pl-PL",
13465            PtMinusPt => "pt-PT",
13466            RoMinusRo => "ro-RO",
13467            SvMinusFi => "sv-FI",
13468            SvMinusSe => "sv-SE",
13469            Unknown(v) => v,
13470        }
13471    }
13472}
13473
13474impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
13475    type Err = std::convert::Infallible;
13476    fn from_str(s: &str) -> Result<Self, Self::Err> {
13477        use ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
13478        match s {
13479            "cs-CZ" => Ok(CsMinusCz),
13480            "da-DK" => Ok(DaMinusDk),
13481            "de-AT" => Ok(DeMinusAt),
13482            "de-CH" => Ok(DeMinusCh),
13483            "de-DE" => Ok(DeMinusDe),
13484            "el-GR" => Ok(ElMinusGr),
13485            "en-AT" => Ok(EnMinusAt),
13486            "en-AU" => Ok(EnMinusAu),
13487            "en-BE" => Ok(EnMinusBe),
13488            "en-CA" => Ok(EnMinusCa),
13489            "en-CH" => Ok(EnMinusCh),
13490            "en-CZ" => Ok(EnMinusCz),
13491            "en-DE" => Ok(EnMinusDe),
13492            "en-DK" => Ok(EnMinusDk),
13493            "en-ES" => Ok(EnMinusEs),
13494            "en-FI" => Ok(EnMinusFi),
13495            "en-FR" => Ok(EnMinusFr),
13496            "en-GB" => Ok(EnMinusGb),
13497            "en-GR" => Ok(EnMinusGr),
13498            "en-IE" => Ok(EnMinusIe),
13499            "en-IT" => Ok(EnMinusIt),
13500            "en-NL" => Ok(EnMinusNl),
13501            "en-NO" => Ok(EnMinusNo),
13502            "en-NZ" => Ok(EnMinusNz),
13503            "en-PL" => Ok(EnMinusPl),
13504            "en-PT" => Ok(EnMinusPt),
13505            "en-RO" => Ok(EnMinusRo),
13506            "en-SE" => Ok(EnMinusSe),
13507            "en-US" => Ok(EnMinusUs),
13508            "es-ES" => Ok(EsMinusEs),
13509            "es-US" => Ok(EsMinusUs),
13510            "fi-FI" => Ok(FiMinusFi),
13511            "fr-BE" => Ok(FrMinusBe),
13512            "fr-CA" => Ok(FrMinusCa),
13513            "fr-CH" => Ok(FrMinusCh),
13514            "fr-FR" => Ok(FrMinusFr),
13515            "it-CH" => Ok(ItMinusCh),
13516            "it-IT" => Ok(ItMinusIt),
13517            "nb-NO" => Ok(NbMinusNo),
13518            "nl-BE" => Ok(NlMinusBe),
13519            "nl-NL" => Ok(NlMinusNl),
13520            "pl-PL" => Ok(PlMinusPl),
13521            "pt-PT" => Ok(PtMinusPt),
13522            "ro-RO" => Ok(RoMinusRo),
13523            "sv-FI" => Ok(SvMinusFi),
13524            "sv-SE" => Ok(SvMinusSe),
13525            v => {
13526                tracing::warn!(
13527                    "Unknown value '{}' for enum '{}'",
13528                    v,
13529                    "ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale"
13530                );
13531                Ok(Unknown(v.to_owned()))
13532            }
13533        }
13534    }
13535}
13536impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
13537    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13538        f.write_str(self.as_str())
13539    }
13540}
13541
13542impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
13543    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13544        f.write_str(self.as_str())
13545    }
13546}
13547impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
13548    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13549    where
13550        S: serde::Serializer,
13551    {
13552        serializer.serialize_str(self.as_str())
13553    }
13554}
13555#[cfg(feature = "deserialize")]
13556impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
13557    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13558        use std::str::FromStr;
13559        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13560        Ok(Self::from_str(&s).expect("infallible"))
13561    }
13562}
13563/// Subscription details if setting up or charging a subscription
13564#[derive(Clone, Debug, serde::Serialize)]
13565pub struct ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
13566    /// Unit of time between subscription charges.
13567    pub interval: ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
13568    /// The number of intervals (specified in the `interval` attribute) between subscription charges.
13569    /// For example, `interval=month` and `interval_count=3` charges every 3 months.
13570    #[serde(skip_serializing_if = "Option::is_none")]
13571    pub interval_count: Option<u64>,
13572    /// Name for subscription.
13573    #[serde(skip_serializing_if = "Option::is_none")]
13574    pub name: Option<String>,
13575    /// Describes the upcoming charge for this subscription.
13576    pub next_billing: SubscriptionNextBillingParam,
13577    /// A non-customer-facing reference to correlate subscription charges in the Klarna app.
13578    /// Use a value that persists across subscription charges.
13579    pub reference: String,
13580}
13581impl ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
13582    pub fn new(
13583        interval: impl Into<ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
13584        next_billing: impl Into<SubscriptionNextBillingParam>,
13585        reference: impl Into<String>,
13586    ) -> Self {
13587        Self {
13588            interval: interval.into(),
13589            interval_count: None,
13590            name: None,
13591            next_billing: next_billing.into(),
13592            reference: reference.into(),
13593        }
13594    }
13595}
13596/// Unit of time between subscription charges.
13597#[derive(Clone, Eq, PartialEq)]
13598#[non_exhaustive]
13599pub enum ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
13600    Day,
13601    Month,
13602    Week,
13603    Year,
13604    /// An unrecognized value from Stripe. Should not be used as a request parameter.
13605    Unknown(String),
13606}
13607impl ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
13608    pub fn as_str(&self) -> &str {
13609        use ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
13610        match self {
13611            Day => "day",
13612            Month => "month",
13613            Week => "week",
13614            Year => "year",
13615            Unknown(v) => v,
13616        }
13617    }
13618}
13619
13620impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
13621    type Err = std::convert::Infallible;
13622    fn from_str(s: &str) -> Result<Self, Self::Err> {
13623        use ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
13624        match s {
13625            "day" => Ok(Day),
13626            "month" => Ok(Month),
13627            "week" => Ok(Week),
13628            "year" => Ok(Year),
13629            v => {
13630                tracing::warn!(
13631                    "Unknown value '{}' for enum '{}'",
13632                    v,
13633                    "ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"
13634                );
13635                Ok(Unknown(v.to_owned()))
13636            }
13637        }
13638    }
13639}
13640impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
13641    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13642        f.write_str(self.as_str())
13643    }
13644}
13645
13646impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
13647    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13648        f.write_str(self.as_str())
13649    }
13650}
13651impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
13652    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13653    where
13654        S: serde::Serializer,
13655    {
13656        serializer.serialize_str(self.as_str())
13657    }
13658}
13659#[cfg(feature = "deserialize")]
13660impl<'de> serde::Deserialize<'de>
13661    for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
13662{
13663    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13664        use std::str::FromStr;
13665        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13666        Ok(Self::from_str(&s).expect("infallible"))
13667    }
13668}
13669/// If this is a `payto` SetupIntent, this sub-hash contains details about the PayTo payment method options.
13670#[derive(Clone, Debug, serde::Serialize)]
13671pub struct ConfirmSetupIntentPaymentMethodOptionsPayto {
13672    /// Additional fields for Mandate creation.
13673    #[serde(skip_serializing_if = "Option::is_none")]
13674    pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptions>,
13675}
13676impl ConfirmSetupIntentPaymentMethodOptionsPayto {
13677    pub fn new() -> Self {
13678        Self { mandate_options: None }
13679    }
13680}
13681impl Default for ConfirmSetupIntentPaymentMethodOptionsPayto {
13682    fn default() -> Self {
13683        Self::new()
13684    }
13685}
13686/// Additional fields for Mandate creation.
13687#[derive(Clone, Debug, serde::Serialize)]
13688pub struct ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptions {
13689    /// Amount that will be collected. It is required when `amount_type` is `fixed`.
13690    #[serde(skip_serializing_if = "Option::is_none")]
13691    pub amount: Option<i64>,
13692    /// The type of amount that will be collected.
13693    /// The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively.
13694    /// Defaults to `maximum`.
13695    #[serde(skip_serializing_if = "Option::is_none")]
13696    pub amount_type: Option<ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType>,
13697    /// Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date.
13698    #[serde(skip_serializing_if = "Option::is_none")]
13699    pub end_date: Option<String>,
13700    /// The periodicity at which payments will be collected. Defaults to `adhoc`.
13701    #[serde(skip_serializing_if = "Option::is_none")]
13702    pub payment_schedule:
13703        Option<ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule>,
13704    /// The number of payments that will be made during a payment period.
13705    /// Defaults to 1 except for when `payment_schedule` is `adhoc`.
13706    /// In that case, it defaults to no limit.
13707    #[serde(skip_serializing_if = "Option::is_none")]
13708    pub payments_per_period: Option<i64>,
13709    /// The purpose for which payments are made. Has a default value based on your merchant category code.
13710    #[serde(skip_serializing_if = "Option::is_none")]
13711    pub purpose: Option<ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose>,
13712    /// Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to confirmation time.
13713    #[serde(skip_serializing_if = "Option::is_none")]
13714    pub start_date: Option<String>,
13715}
13716impl ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptions {
13717    pub fn new() -> Self {
13718        Self {
13719            amount: None,
13720            amount_type: None,
13721            end_date: None,
13722            payment_schedule: None,
13723            payments_per_period: None,
13724            purpose: None,
13725            start_date: None,
13726        }
13727    }
13728}
13729impl Default for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptions {
13730    fn default() -> Self {
13731        Self::new()
13732    }
13733}
13734/// The type of amount that will be collected.
13735/// The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively.
13736/// Defaults to `maximum`.
13737#[derive(Clone, Eq, PartialEq)]
13738#[non_exhaustive]
13739pub enum ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
13740    Fixed,
13741    Maximum,
13742    /// An unrecognized value from Stripe. Should not be used as a request parameter.
13743    Unknown(String),
13744}
13745impl ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
13746    pub fn as_str(&self) -> &str {
13747        use ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType::*;
13748        match self {
13749            Fixed => "fixed",
13750            Maximum => "maximum",
13751            Unknown(v) => v,
13752        }
13753    }
13754}
13755
13756impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
13757    type Err = std::convert::Infallible;
13758    fn from_str(s: &str) -> Result<Self, Self::Err> {
13759        use ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType::*;
13760        match s {
13761            "fixed" => Ok(Fixed),
13762            "maximum" => Ok(Maximum),
13763            v => {
13764                tracing::warn!(
13765                    "Unknown value '{}' for enum '{}'",
13766                    v,
13767                    "ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType"
13768                );
13769                Ok(Unknown(v.to_owned()))
13770            }
13771        }
13772    }
13773}
13774impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
13775    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13776        f.write_str(self.as_str())
13777    }
13778}
13779
13780impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
13781    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13782        f.write_str(self.as_str())
13783    }
13784}
13785impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
13786    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13787    where
13788        S: serde::Serializer,
13789    {
13790        serializer.serialize_str(self.as_str())
13791    }
13792}
13793#[cfg(feature = "deserialize")]
13794impl<'de> serde::Deserialize<'de>
13795    for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType
13796{
13797    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13798        use std::str::FromStr;
13799        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13800        Ok(Self::from_str(&s).expect("infallible"))
13801    }
13802}
13803/// The periodicity at which payments will be collected. Defaults to `adhoc`.
13804#[derive(Clone, Eq, PartialEq)]
13805#[non_exhaustive]
13806pub enum ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
13807    Adhoc,
13808    Annual,
13809    Daily,
13810    Fortnightly,
13811    Monthly,
13812    Quarterly,
13813    SemiAnnual,
13814    Weekly,
13815    /// An unrecognized value from Stripe. Should not be used as a request parameter.
13816    Unknown(String),
13817}
13818impl ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
13819    pub fn as_str(&self) -> &str {
13820        use ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule::*;
13821        match self {
13822            Adhoc => "adhoc",
13823            Annual => "annual",
13824            Daily => "daily",
13825            Fortnightly => "fortnightly",
13826            Monthly => "monthly",
13827            Quarterly => "quarterly",
13828            SemiAnnual => "semi_annual",
13829            Weekly => "weekly",
13830            Unknown(v) => v,
13831        }
13832    }
13833}
13834
13835impl std::str::FromStr
13836    for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule
13837{
13838    type Err = std::convert::Infallible;
13839    fn from_str(s: &str) -> Result<Self, Self::Err> {
13840        use ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule::*;
13841        match s {
13842            "adhoc" => Ok(Adhoc),
13843            "annual" => Ok(Annual),
13844            "daily" => Ok(Daily),
13845            "fortnightly" => Ok(Fortnightly),
13846            "monthly" => Ok(Monthly),
13847            "quarterly" => Ok(Quarterly),
13848            "semi_annual" => Ok(SemiAnnual),
13849            "weekly" => Ok(Weekly),
13850            v => {
13851                tracing::warn!(
13852                    "Unknown value '{}' for enum '{}'",
13853                    v,
13854                    "ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule"
13855                );
13856                Ok(Unknown(v.to_owned()))
13857            }
13858        }
13859    }
13860}
13861impl std::fmt::Display
13862    for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule
13863{
13864    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13865        f.write_str(self.as_str())
13866    }
13867}
13868
13869impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
13870    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13871        f.write_str(self.as_str())
13872    }
13873}
13874impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
13875    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13876    where
13877        S: serde::Serializer,
13878    {
13879        serializer.serialize_str(self.as_str())
13880    }
13881}
13882#[cfg(feature = "deserialize")]
13883impl<'de> serde::Deserialize<'de>
13884    for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule
13885{
13886    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13887        use std::str::FromStr;
13888        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13889        Ok(Self::from_str(&s).expect("infallible"))
13890    }
13891}
13892/// The purpose for which payments are made. Has a default value based on your merchant category code.
13893#[derive(Clone, Eq, PartialEq)]
13894#[non_exhaustive]
13895pub enum ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
13896    DependantSupport,
13897    Government,
13898    Loan,
13899    Mortgage,
13900    Other,
13901    Pension,
13902    Personal,
13903    Retail,
13904    Salary,
13905    Tax,
13906    Utility,
13907    /// An unrecognized value from Stripe. Should not be used as a request parameter.
13908    Unknown(String),
13909}
13910impl ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
13911    pub fn as_str(&self) -> &str {
13912        use ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose::*;
13913        match self {
13914            DependantSupport => "dependant_support",
13915            Government => "government",
13916            Loan => "loan",
13917            Mortgage => "mortgage",
13918            Other => "other",
13919            Pension => "pension",
13920            Personal => "personal",
13921            Retail => "retail",
13922            Salary => "salary",
13923            Tax => "tax",
13924            Utility => "utility",
13925            Unknown(v) => v,
13926        }
13927    }
13928}
13929
13930impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
13931    type Err = std::convert::Infallible;
13932    fn from_str(s: &str) -> Result<Self, Self::Err> {
13933        use ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose::*;
13934        match s {
13935            "dependant_support" => Ok(DependantSupport),
13936            "government" => Ok(Government),
13937            "loan" => Ok(Loan),
13938            "mortgage" => Ok(Mortgage),
13939            "other" => Ok(Other),
13940            "pension" => Ok(Pension),
13941            "personal" => Ok(Personal),
13942            "retail" => Ok(Retail),
13943            "salary" => Ok(Salary),
13944            "tax" => Ok(Tax),
13945            "utility" => Ok(Utility),
13946            v => {
13947                tracing::warn!(
13948                    "Unknown value '{}' for enum '{}'",
13949                    v,
13950                    "ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose"
13951                );
13952                Ok(Unknown(v.to_owned()))
13953            }
13954        }
13955    }
13956}
13957impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
13958    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13959        f.write_str(self.as_str())
13960    }
13961}
13962
13963impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
13964    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13965        f.write_str(self.as_str())
13966    }
13967}
13968impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
13969    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13970    where
13971        S: serde::Serializer,
13972    {
13973        serializer.serialize_str(self.as_str())
13974    }
13975}
13976#[cfg(feature = "deserialize")]
13977impl<'de> serde::Deserialize<'de>
13978    for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose
13979{
13980    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13981        use std::str::FromStr;
13982        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13983        Ok(Self::from_str(&s).expect("infallible"))
13984    }
13985}
13986/// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options.
13987#[derive(Clone, Debug, serde::Serialize)]
13988pub struct ConfirmSetupIntentPaymentMethodOptionsSepaDebit {
13989    /// Additional fields for Mandate creation
13990    #[serde(skip_serializing_if = "Option::is_none")]
13991    pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsSepaDebitMandateOptions>,
13992}
13993impl ConfirmSetupIntentPaymentMethodOptionsSepaDebit {
13994    pub fn new() -> Self {
13995        Self { mandate_options: None }
13996    }
13997}
13998impl Default for ConfirmSetupIntentPaymentMethodOptionsSepaDebit {
13999    fn default() -> Self {
14000        Self::new()
14001    }
14002}
14003/// Additional fields for Mandate creation
14004#[derive(Clone, Debug, serde::Serialize)]
14005pub struct ConfirmSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
14006    /// Prefix used to generate the Mandate reference.
14007    /// Must be at most 12 characters long.
14008    /// Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'.
14009    /// Cannot begin with 'STRIPE'.
14010    #[serde(skip_serializing_if = "Option::is_none")]
14011    pub reference_prefix: Option<String>,
14012}
14013impl ConfirmSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
14014    pub fn new() -> Self {
14015        Self { reference_prefix: None }
14016    }
14017}
14018impl Default for ConfirmSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
14019    fn default() -> Self {
14020        Self::new()
14021    }
14022}
14023/// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options.
14024#[derive(Clone, Debug, serde::Serialize)]
14025pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccount {
14026    /// Additional fields for Financial Connections Session creation
14027    #[serde(skip_serializing_if = "Option::is_none")]
14028    pub financial_connections:
14029        Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
14030    /// Additional fields for Mandate creation
14031    #[serde(skip_serializing_if = "Option::is_none")]
14032    pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
14033    /// Additional fields for network related functions
14034    #[serde(skip_serializing_if = "Option::is_none")]
14035    pub networks: Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks>,
14036    /// Bank account verification method.
14037    #[serde(skip_serializing_if = "Option::is_none")]
14038    pub verification_method:
14039        Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
14040}
14041impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccount {
14042    pub fn new() -> Self {
14043        Self {
14044            financial_connections: None,
14045            mandate_options: None,
14046            networks: None,
14047            verification_method: None,
14048        }
14049    }
14050}
14051impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccount {
14052    fn default() -> Self {
14053        Self::new()
14054    }
14055}
14056/// Additional fields for Financial Connections Session creation
14057#[derive(Clone, Debug, serde::Serialize)]
14058pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
14059    /// Provide filters for the linked accounts that the customer can select for the payment method.
14060    #[serde(skip_serializing_if = "Option::is_none")]
14061    pub filters:
14062        Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
14063    /// The list of permissions to request.
14064    /// If this parameter is passed, the `payment_method` permission must be included.
14065    /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
14066    #[serde(skip_serializing_if = "Option::is_none")]
14067    pub permissions: Option<
14068        Vec<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
14069    >,
14070    /// List of data features that you would like to retrieve upon account creation.
14071    #[serde(skip_serializing_if = "Option::is_none")]
14072    pub prefetch: Option<
14073        Vec<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>,
14074    >,
14075    /// For webview integrations only.
14076    /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.
14077    #[serde(skip_serializing_if = "Option::is_none")]
14078    pub return_url: Option<String>,
14079}
14080impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
14081    pub fn new() -> Self {
14082        Self { filters: None, permissions: None, prefetch: None, return_url: None }
14083    }
14084}
14085impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
14086    fn default() -> Self {
14087        Self::new()
14088    }
14089}
14090/// Provide filters for the linked accounts that the customer can select for the payment method.
14091#[derive(Clone, Debug, serde::Serialize)]
14092pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
14093        /// The account subcategories to use to filter for selectable accounts.
14094    /// Valid subcategories are `checking` and `savings`.
14095#[serde(skip_serializing_if = "Option::is_none")]
14096pub account_subcategories: Option<Vec<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
14097
14098}
14099impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
14100    pub fn new() -> Self {
14101        Self { account_subcategories: None }
14102    }
14103}
14104impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
14105    fn default() -> Self {
14106        Self::new()
14107    }
14108}
14109/// The account subcategories to use to filter for selectable accounts.
14110/// Valid subcategories are `checking` and `savings`.
14111#[derive(Clone, Eq, PartialEq)]
14112#[non_exhaustive]
14113pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
14114{
14115    Checking,
14116    Savings,
14117    /// An unrecognized value from Stripe. Should not be used as a request parameter.
14118    Unknown(String),
14119}
14120impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
14121    pub fn as_str(&self) -> &str {
14122        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
14123        match self {
14124Checking => "checking",
14125Savings => "savings",
14126Unknown(v) => v,
14127
14128        }
14129    }
14130}
14131
14132impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
14133    type Err = std::convert::Infallible;
14134    fn from_str(s: &str) -> Result<Self, Self::Err> {
14135        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
14136        match s {
14137    "checking" => Ok(Checking),
14138"savings" => Ok(Savings),
14139v => { tracing::warn!("Unknown value '{}' for enum '{}'", v, "ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"); Ok(Unknown(v.to_owned())) }
14140
14141        }
14142    }
14143}
14144impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
14145    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14146        f.write_str(self.as_str())
14147    }
14148}
14149
14150impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
14151    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14152        f.write_str(self.as_str())
14153    }
14154}
14155impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
14156    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
14157        serializer.serialize_str(self.as_str())
14158    }
14159}
14160#[cfg(feature = "deserialize")]
14161impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
14162    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14163        use std::str::FromStr;
14164        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14165        Ok(Self::from_str(&s).expect("infallible"))
14166    }
14167}
14168/// The list of permissions to request.
14169/// If this parameter is passed, the `payment_method` permission must be included.
14170/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
14171#[derive(Clone, Eq, PartialEq)]
14172#[non_exhaustive]
14173pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
14174    Balances,
14175    Ownership,
14176    PaymentMethod,
14177    Transactions,
14178    /// An unrecognized value from Stripe. Should not be used as a request parameter.
14179    Unknown(String),
14180}
14181impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
14182    pub fn as_str(&self) -> &str {
14183        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
14184        match self {
14185            Balances => "balances",
14186            Ownership => "ownership",
14187            PaymentMethod => "payment_method",
14188            Transactions => "transactions",
14189            Unknown(v) => v,
14190        }
14191    }
14192}
14193
14194impl std::str::FromStr
14195    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
14196{
14197    type Err = std::convert::Infallible;
14198    fn from_str(s: &str) -> Result<Self, Self::Err> {
14199        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
14200        match s {
14201            "balances" => Ok(Balances),
14202            "ownership" => Ok(Ownership),
14203            "payment_method" => Ok(PaymentMethod),
14204            "transactions" => Ok(Transactions),
14205            v => {
14206                tracing::warn!(
14207                    "Unknown value '{}' for enum '{}'",
14208                    v,
14209                    "ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"
14210                );
14211                Ok(Unknown(v.to_owned()))
14212            }
14213        }
14214    }
14215}
14216impl std::fmt::Display
14217    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
14218{
14219    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14220        f.write_str(self.as_str())
14221    }
14222}
14223
14224impl std::fmt::Debug
14225    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
14226{
14227    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14228        f.write_str(self.as_str())
14229    }
14230}
14231impl serde::Serialize
14232    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
14233{
14234    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14235    where
14236        S: serde::Serializer,
14237    {
14238        serializer.serialize_str(self.as_str())
14239    }
14240}
14241#[cfg(feature = "deserialize")]
14242impl<'de> serde::Deserialize<'de>
14243    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
14244{
14245    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14246        use std::str::FromStr;
14247        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14248        Ok(Self::from_str(&s).expect("infallible"))
14249    }
14250}
14251/// List of data features that you would like to retrieve upon account creation.
14252#[derive(Clone, Eq, PartialEq)]
14253#[non_exhaustive]
14254pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
14255    Balances,
14256    Ownership,
14257    Transactions,
14258    /// An unrecognized value from Stripe. Should not be used as a request parameter.
14259    Unknown(String),
14260}
14261impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
14262    pub fn as_str(&self) -> &str {
14263        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
14264        match self {
14265            Balances => "balances",
14266            Ownership => "ownership",
14267            Transactions => "transactions",
14268            Unknown(v) => v,
14269        }
14270    }
14271}
14272
14273impl std::str::FromStr
14274    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
14275{
14276    type Err = std::convert::Infallible;
14277    fn from_str(s: &str) -> Result<Self, Self::Err> {
14278        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
14279        match s {
14280            "balances" => Ok(Balances),
14281            "ownership" => Ok(Ownership),
14282            "transactions" => Ok(Transactions),
14283            v => {
14284                tracing::warn!(
14285                    "Unknown value '{}' for enum '{}'",
14286                    v,
14287                    "ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"
14288                );
14289                Ok(Unknown(v.to_owned()))
14290            }
14291        }
14292    }
14293}
14294impl std::fmt::Display
14295    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
14296{
14297    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14298        f.write_str(self.as_str())
14299    }
14300}
14301
14302impl std::fmt::Debug
14303    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
14304{
14305    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14306        f.write_str(self.as_str())
14307    }
14308}
14309impl serde::Serialize
14310    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
14311{
14312    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14313    where
14314        S: serde::Serializer,
14315    {
14316        serializer.serialize_str(self.as_str())
14317    }
14318}
14319#[cfg(feature = "deserialize")]
14320impl<'de> serde::Deserialize<'de>
14321    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
14322{
14323    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14324        use std::str::FromStr;
14325        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14326        Ok(Self::from_str(&s).expect("infallible"))
14327    }
14328}
14329/// Additional fields for Mandate creation
14330#[derive(Clone, Debug, serde::Serialize)]
14331pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
14332    /// The method used to collect offline mandate customer acceptance.
14333    #[serde(skip_serializing_if = "Option::is_none")]
14334    pub collection_method:
14335        Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
14336}
14337impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
14338    pub fn new() -> Self {
14339        Self { collection_method: None }
14340    }
14341}
14342impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
14343    fn default() -> Self {
14344        Self::new()
14345    }
14346}
14347/// The method used to collect offline mandate customer acceptance.
14348#[derive(Clone, Eq, PartialEq)]
14349#[non_exhaustive]
14350pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
14351    Paper,
14352    /// An unrecognized value from Stripe. Should not be used as a request parameter.
14353    Unknown(String),
14354}
14355impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
14356    pub fn as_str(&self) -> &str {
14357        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
14358        match self {
14359            Paper => "paper",
14360            Unknown(v) => v,
14361        }
14362    }
14363}
14364
14365impl std::str::FromStr
14366    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
14367{
14368    type Err = std::convert::Infallible;
14369    fn from_str(s: &str) -> Result<Self, Self::Err> {
14370        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
14371        match s {
14372            "paper" => Ok(Paper),
14373            v => {
14374                tracing::warn!(
14375                    "Unknown value '{}' for enum '{}'",
14376                    v,
14377                    "ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"
14378                );
14379                Ok(Unknown(v.to_owned()))
14380            }
14381        }
14382    }
14383}
14384impl std::fmt::Display
14385    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
14386{
14387    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14388        f.write_str(self.as_str())
14389    }
14390}
14391
14392impl std::fmt::Debug
14393    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
14394{
14395    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14396        f.write_str(self.as_str())
14397    }
14398}
14399impl serde::Serialize
14400    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
14401{
14402    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14403    where
14404        S: serde::Serializer,
14405    {
14406        serializer.serialize_str(self.as_str())
14407    }
14408}
14409#[cfg(feature = "deserialize")]
14410impl<'de> serde::Deserialize<'de>
14411    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
14412{
14413    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14414        use std::str::FromStr;
14415        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14416        Ok(Self::from_str(&s).expect("infallible"))
14417    }
14418}
14419/// Additional fields for network related functions
14420#[derive(Clone, Debug, serde::Serialize)]
14421pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
14422    /// Triggers validations to run across the selected networks
14423    #[serde(skip_serializing_if = "Option::is_none")]
14424    pub requested:
14425        Option<Vec<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
14426}
14427impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
14428    pub fn new() -> Self {
14429        Self { requested: None }
14430    }
14431}
14432impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
14433    fn default() -> Self {
14434        Self::new()
14435    }
14436}
14437/// Triggers validations to run across the selected networks
14438#[derive(Clone, Eq, PartialEq)]
14439#[non_exhaustive]
14440pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
14441    Ach,
14442    UsDomesticWire,
14443    /// An unrecognized value from Stripe. Should not be used as a request parameter.
14444    Unknown(String),
14445}
14446impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
14447    pub fn as_str(&self) -> &str {
14448        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
14449        match self {
14450            Ach => "ach",
14451            UsDomesticWire => "us_domestic_wire",
14452            Unknown(v) => v,
14453        }
14454    }
14455}
14456
14457impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
14458    type Err = std::convert::Infallible;
14459    fn from_str(s: &str) -> Result<Self, Self::Err> {
14460        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
14461        match s {
14462            "ach" => Ok(Ach),
14463            "us_domestic_wire" => Ok(UsDomesticWire),
14464            v => {
14465                tracing::warn!(
14466                    "Unknown value '{}' for enum '{}'",
14467                    v,
14468                    "ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested"
14469                );
14470                Ok(Unknown(v.to_owned()))
14471            }
14472        }
14473    }
14474}
14475impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
14476    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14477        f.write_str(self.as_str())
14478    }
14479}
14480
14481impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
14482    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14483        f.write_str(self.as_str())
14484    }
14485}
14486impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
14487    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14488    where
14489        S: serde::Serializer,
14490    {
14491        serializer.serialize_str(self.as_str())
14492    }
14493}
14494#[cfg(feature = "deserialize")]
14495impl<'de> serde::Deserialize<'de>
14496    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested
14497{
14498    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14499        use std::str::FromStr;
14500        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14501        Ok(Self::from_str(&s).expect("infallible"))
14502    }
14503}
14504/// Bank account verification method.
14505#[derive(Clone, Eq, PartialEq)]
14506#[non_exhaustive]
14507pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
14508    Automatic,
14509    Instant,
14510    Microdeposits,
14511    /// An unrecognized value from Stripe. Should not be used as a request parameter.
14512    Unknown(String),
14513}
14514impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
14515    pub fn as_str(&self) -> &str {
14516        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
14517        match self {
14518            Automatic => "automatic",
14519            Instant => "instant",
14520            Microdeposits => "microdeposits",
14521            Unknown(v) => v,
14522        }
14523    }
14524}
14525
14526impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
14527    type Err = std::convert::Infallible;
14528    fn from_str(s: &str) -> Result<Self, Self::Err> {
14529        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
14530        match s {
14531            "automatic" => Ok(Automatic),
14532            "instant" => Ok(Instant),
14533            "microdeposits" => Ok(Microdeposits),
14534            v => {
14535                tracing::warn!(
14536                    "Unknown value '{}' for enum '{}'",
14537                    v,
14538                    "ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod"
14539                );
14540                Ok(Unknown(v.to_owned()))
14541            }
14542        }
14543    }
14544}
14545impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
14546    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14547        f.write_str(self.as_str())
14548    }
14549}
14550
14551impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
14552    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14553        f.write_str(self.as_str())
14554    }
14555}
14556impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
14557    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14558    where
14559        S: serde::Serializer,
14560    {
14561        serializer.serialize_str(self.as_str())
14562    }
14563}
14564#[cfg(feature = "deserialize")]
14565impl<'de> serde::Deserialize<'de>
14566    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod
14567{
14568    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14569        use std::str::FromStr;
14570        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14571        Ok(Self::from_str(&s).expect("infallible"))
14572    }
14573}
14574/// Confirm that your customer intends to set up the current or
14575/// provided payment method. For example, you would confirm a SetupIntent
14576/// when a customer hits the “Save” button on a payment method management
14577/// page on your website.
14578///
14579/// If the selected payment method does not require any additional
14580/// steps from the customer, the SetupIntent will transition to the
14581/// `succeeded` status.
14582///
14583/// Otherwise, it will transition to the `requires_action` status and
14584/// suggest additional actions via `next_action`. If setup fails,
14585/// the SetupIntent will transition to the
14586/// `requires_payment_method` status or the `canceled` status if the
14587/// confirmation limit is reached.
14588#[derive(Clone, Debug, serde::Serialize)]
14589pub struct ConfirmSetupIntent {
14590    inner: ConfirmSetupIntentBuilder,
14591    intent: stripe_shared::SetupIntentId,
14592}
14593impl ConfirmSetupIntent {
14594    /// Construct a new `ConfirmSetupIntent`.
14595    pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
14596        Self { intent: intent.into(), inner: ConfirmSetupIntentBuilder::new() }
14597    }
14598    /// ID of the ConfirmationToken used to confirm this SetupIntent.
14599    ///
14600    /// 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.
14601    pub fn confirmation_token(mut self, confirmation_token: impl Into<String>) -> Self {
14602        self.inner.confirmation_token = Some(confirmation_token.into());
14603        self
14604    }
14605    /// Specifies which fields in the response should be expanded.
14606    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
14607        self.inner.expand = Some(expand.into());
14608        self
14609    }
14610    pub fn mandate_data(mut self, mandate_data: impl Into<ConfirmSetupIntentMandateData>) -> Self {
14611        self.inner.mandate_data = Some(mandate_data.into());
14612        self
14613    }
14614    /// ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent.
14615    pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
14616        self.inner.payment_method = Some(payment_method.into());
14617        self
14618    }
14619    /// When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://docs.stripe.com/api/setup_intents/object#setup_intent_object-payment_method).
14620    /// value in the SetupIntent.
14621    pub fn payment_method_data(
14622        mut self,
14623        payment_method_data: impl Into<ConfirmSetupIntentPaymentMethodData>,
14624    ) -> Self {
14625        self.inner.payment_method_data = Some(payment_method_data.into());
14626        self
14627    }
14628    /// Payment method-specific configuration for this SetupIntent.
14629    pub fn payment_method_options(
14630        mut self,
14631        payment_method_options: impl Into<ConfirmSetupIntentPaymentMethodOptions>,
14632    ) -> Self {
14633        self.inner.payment_method_options = Some(payment_method_options.into());
14634        self
14635    }
14636    /// The URL to redirect your customer back to after they authenticate on the payment method's app or site.
14637    /// If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme.
14638    /// This parameter is only used for cards and other redirect-based payment methods.
14639    pub fn return_url(mut self, return_url: impl Into<String>) -> Self {
14640        self.inner.return_url = Some(return_url.into());
14641        self
14642    }
14643    /// Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions.
14644    pub fn use_stripe_sdk(mut self, use_stripe_sdk: impl Into<bool>) -> Self {
14645        self.inner.use_stripe_sdk = Some(use_stripe_sdk.into());
14646        self
14647    }
14648}
14649impl ConfirmSetupIntent {
14650    /// Send the request and return the deserialized response.
14651    pub async fn send<C: StripeClient>(
14652        &self,
14653        client: &C,
14654    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
14655        self.customize().send(client).await
14656    }
14657
14658    /// Send the request and return the deserialized response, blocking until completion.
14659    pub fn send_blocking<C: StripeBlockingClient>(
14660        &self,
14661        client: &C,
14662    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
14663        self.customize().send_blocking(client)
14664    }
14665}
14666
14667impl StripeRequest for ConfirmSetupIntent {
14668    type Output = stripe_shared::SetupIntent;
14669
14670    fn build(&self) -> RequestBuilder {
14671        let intent = &self.intent;
14672        RequestBuilder::new(StripeMethod::Post, format!("/setup_intents/{intent}/confirm"))
14673            .form(&self.inner)
14674    }
14675}
14676#[derive(Clone, Debug, serde::Serialize)]
14677struct VerifyMicrodepositsSetupIntentBuilder {
14678    #[serde(skip_serializing_if = "Option::is_none")]
14679    amounts: Option<Vec<i64>>,
14680    #[serde(skip_serializing_if = "Option::is_none")]
14681    descriptor_code: Option<String>,
14682    #[serde(skip_serializing_if = "Option::is_none")]
14683    expand: Option<Vec<String>>,
14684}
14685impl VerifyMicrodepositsSetupIntentBuilder {
14686    fn new() -> Self {
14687        Self { amounts: None, descriptor_code: None, expand: None }
14688    }
14689}
14690/// Verifies microdeposits on a SetupIntent object.
14691#[derive(Clone, Debug, serde::Serialize)]
14692pub struct VerifyMicrodepositsSetupIntent {
14693    inner: VerifyMicrodepositsSetupIntentBuilder,
14694    intent: stripe_shared::SetupIntentId,
14695}
14696impl VerifyMicrodepositsSetupIntent {
14697    /// Construct a new `VerifyMicrodepositsSetupIntent`.
14698    pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
14699        Self { intent: intent.into(), inner: VerifyMicrodepositsSetupIntentBuilder::new() }
14700    }
14701    /// Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account.
14702    pub fn amounts(mut self, amounts: impl Into<Vec<i64>>) -> Self {
14703        self.inner.amounts = Some(amounts.into());
14704        self
14705    }
14706    /// A six-character code starting with SM present in the microdeposit sent to the bank account.
14707    pub fn descriptor_code(mut self, descriptor_code: impl Into<String>) -> Self {
14708        self.inner.descriptor_code = Some(descriptor_code.into());
14709        self
14710    }
14711    /// Specifies which fields in the response should be expanded.
14712    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
14713        self.inner.expand = Some(expand.into());
14714        self
14715    }
14716}
14717impl VerifyMicrodepositsSetupIntent {
14718    /// Send the request and return the deserialized response.
14719    pub async fn send<C: StripeClient>(
14720        &self,
14721        client: &C,
14722    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
14723        self.customize().send(client).await
14724    }
14725
14726    /// Send the request and return the deserialized response, blocking until completion.
14727    pub fn send_blocking<C: StripeBlockingClient>(
14728        &self,
14729        client: &C,
14730    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
14731        self.customize().send_blocking(client)
14732    }
14733}
14734
14735impl StripeRequest for VerifyMicrodepositsSetupIntent {
14736    type Output = stripe_shared::SetupIntent;
14737
14738    fn build(&self) -> RequestBuilder {
14739        let intent = &self.intent;
14740        RequestBuilder::new(
14741            StripeMethod::Post,
14742            format!("/setup_intents/{intent}/verify_microdeposits"),
14743        )
14744        .form(&self.inner)
14745    }
14746}
14747
14748#[derive(Clone, Debug, serde::Serialize)]
14749pub struct OnlineParam {
14750    /// The IP address from which the Mandate was accepted by the customer.
14751    pub ip_address: String,
14752    /// The user agent of the browser from which the Mandate was accepted by the customer.
14753    pub user_agent: String,
14754}
14755impl OnlineParam {
14756    pub fn new(ip_address: impl Into<String>, user_agent: impl Into<String>) -> Self {
14757        Self { ip_address: ip_address.into(), user_agent: user_agent.into() }
14758    }
14759}
14760#[derive(Clone, Debug, serde::Serialize)]
14761pub struct PaymentMethodParam {
14762    /// Customer's bank account number.
14763    pub account_number: String,
14764    /// Institution number of the customer's bank.
14765    pub institution_number: String,
14766    /// Transit number of the customer's bank.
14767    pub transit_number: String,
14768}
14769impl PaymentMethodParam {
14770    pub fn new(
14771        account_number: impl Into<String>,
14772        institution_number: impl Into<String>,
14773        transit_number: impl Into<String>,
14774    ) -> Self {
14775        Self {
14776            account_number: account_number.into(),
14777            institution_number: institution_number.into(),
14778            transit_number: transit_number.into(),
14779        }
14780    }
14781}
14782#[derive(Clone, Debug, serde::Serialize)]
14783pub struct BillingDetailsAddress {
14784    /// City, district, suburb, town, or village.
14785    #[serde(skip_serializing_if = "Option::is_none")]
14786    pub city: Option<String>,
14787    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
14788    #[serde(skip_serializing_if = "Option::is_none")]
14789    pub country: Option<String>,
14790    /// Address line 1, such as the street, PO Box, or company name.
14791    #[serde(skip_serializing_if = "Option::is_none")]
14792    pub line1: Option<String>,
14793    /// Address line 2, such as the apartment, suite, unit, or building.
14794    #[serde(skip_serializing_if = "Option::is_none")]
14795    pub line2: Option<String>,
14796    /// ZIP or postal code.
14797    #[serde(skip_serializing_if = "Option::is_none")]
14798    pub postal_code: Option<String>,
14799    /// State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)).
14800    #[serde(skip_serializing_if = "Option::is_none")]
14801    pub state: Option<String>,
14802}
14803impl BillingDetailsAddress {
14804    pub fn new() -> Self {
14805        Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
14806    }
14807}
14808impl Default for BillingDetailsAddress {
14809    fn default() -> Self {
14810        Self::new()
14811    }
14812}
14813#[derive(Copy, Clone, Debug, serde::Serialize)]
14814pub struct DateOfBirth {
14815    /// The day of birth, between 1 and 31.
14816    pub day: i64,
14817    /// The month of birth, between 1 and 12.
14818    pub month: i64,
14819    /// The four-digit year of birth.
14820    pub year: i64,
14821}
14822impl DateOfBirth {
14823    pub fn new(day: impl Into<i64>, month: impl Into<i64>, year: impl Into<i64>) -> Self {
14824        Self { day: day.into(), month: month.into(), year: year.into() }
14825    }
14826}
14827#[derive(Clone, Debug, serde::Serialize)]
14828pub struct RadarOptionsWithHiddenOptions {
14829    /// A [Radar Session](https://docs.stripe.com/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments.
14830    #[serde(skip_serializing_if = "Option::is_none")]
14831    pub session: Option<String>,
14832}
14833impl RadarOptionsWithHiddenOptions {
14834    pub fn new() -> Self {
14835        Self { session: None }
14836    }
14837}
14838impl Default for RadarOptionsWithHiddenOptions {
14839    fn default() -> Self {
14840        Self::new()
14841    }
14842}
14843#[derive(Clone, Debug, serde::Serialize)]
14844pub struct PaymentMethodOptionsMandateOptionsParam {
14845    /// Prefix used to generate the Mandate reference.
14846    /// Must be at most 12 characters long.
14847    /// Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'.
14848    /// Cannot begin with 'DDIC' or 'STRIPE'.
14849    #[serde(skip_serializing_if = "Option::is_none")]
14850    pub reference_prefix: Option<String>,
14851}
14852impl PaymentMethodOptionsMandateOptionsParam {
14853    pub fn new() -> Self {
14854        Self { reference_prefix: None }
14855    }
14856}
14857impl Default for PaymentMethodOptionsMandateOptionsParam {
14858    fn default() -> Self {
14859        Self::new()
14860    }
14861}
14862#[derive(Clone, Debug, serde::Serialize)]
14863pub struct SubscriptionNextBillingParam {
14864    /// The amount of the next charge for the subscription.
14865    pub amount: i64,
14866    /// The date of the next charge for the subscription in YYYY-MM-DD format.
14867    pub date: String,
14868}
14869impl SubscriptionNextBillingParam {
14870    pub fn new(amount: impl Into<i64>, date: impl Into<String>) -> Self {
14871        Self { amount: amount.into(), date: date.into() }
14872    }
14873}
14874#[derive(Clone, Debug, serde::Serialize)]
14875pub struct SetupIntentPaymentMethodOptionsParam {
14876    /// \[Deprecated\] This is a legacy parameter that no longer has any function.
14877    #[serde(skip_serializing_if = "Option::is_none")]
14878    pub persistent_token: Option<String>,
14879}
14880impl SetupIntentPaymentMethodOptionsParam {
14881    pub fn new() -> Self {
14882        Self { persistent_token: None }
14883    }
14884}
14885impl Default for SetupIntentPaymentMethodOptionsParam {
14886    fn default() -> Self {
14887        Self::new()
14888    }
14889}
14890#[derive(Clone, Debug, serde::Serialize)]
14891pub struct PaymentMethodOptionsParam {
14892    /// The PayPal Billing Agreement ID (BAID).
14893    /// This is an ID generated by PayPal which represents the mandate between the merchant and the customer.
14894    #[serde(skip_serializing_if = "Option::is_none")]
14895    pub billing_agreement_id: Option<String>,
14896}
14897impl PaymentMethodOptionsParam {
14898    pub fn new() -> Self {
14899        Self { billing_agreement_id: None }
14900    }
14901}
14902impl Default for PaymentMethodOptionsParam {
14903    fn default() -> Self {
14904        Self::new()
14905    }
14906}
14907#[derive(Clone, Debug, serde::Serialize)]
14908pub struct BillingDetailsInnerParams {
14909    /// Billing address.
14910    #[serde(skip_serializing_if = "Option::is_none")]
14911    pub address: Option<BillingDetailsAddress>,
14912    /// Email address.
14913    #[serde(skip_serializing_if = "Option::is_none")]
14914    pub email: Option<String>,
14915    /// Full name.
14916    #[serde(skip_serializing_if = "Option::is_none")]
14917    pub name: Option<String>,
14918    /// Billing phone number (including extension).
14919    #[serde(skip_serializing_if = "Option::is_none")]
14920    pub phone: Option<String>,
14921    /// Taxpayer identification number.
14922    /// Used only for transactions between LATAM buyers and non-LATAM sellers.
14923    #[serde(skip_serializing_if = "Option::is_none")]
14924    pub tax_id: Option<String>,
14925}
14926impl BillingDetailsInnerParams {
14927    pub fn new() -> Self {
14928        Self { address: None, email: None, name: None, phone: None, tax_id: None }
14929    }
14930}
14931impl Default for BillingDetailsInnerParams {
14932    fn default() -> Self {
14933        Self::new()
14934    }
14935}