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    ending_before: Option<String>,
15    #[serde(skip_serializing_if = "Option::is_none")]
16    expand: Option<Vec<String>>,
17    #[serde(skip_serializing_if = "Option::is_none")]
18    limit: Option<i64>,
19    #[serde(skip_serializing_if = "Option::is_none")]
20    payment_method: Option<String>,
21    #[serde(skip_serializing_if = "Option::is_none")]
22    starting_after: Option<String>,
23}
24impl ListSetupIntentBuilder {
25    fn new() -> Self {
26        Self {
27            attach_to_self: None,
28            created: None,
29            customer: None,
30            ending_before: None,
31            expand: None,
32            limit: None,
33            payment_method: None,
34            starting_after: None,
35        }
36    }
37}
38/// Returns a list of SetupIntents.
39#[derive(Clone, Debug, serde::Serialize)]
40pub struct ListSetupIntent {
41    inner: ListSetupIntentBuilder,
42}
43impl ListSetupIntent {
44    /// Construct a new `ListSetupIntent`.
45    pub fn new() -> Self {
46        Self { inner: ListSetupIntentBuilder::new() }
47    }
48    /// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.
49    ///
50    /// It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers.
51    /// 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.
52    pub fn attach_to_self(mut self, attach_to_self: impl Into<bool>) -> Self {
53        self.inner.attach_to_self = Some(attach_to_self.into());
54        self
55    }
56    /// A filter on the list, based on the object `created` field.
57    /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options.
58    pub fn created(mut self, created: impl Into<stripe_types::RangeQueryTs>) -> Self {
59        self.inner.created = Some(created.into());
60        self
61    }
62    /// Only return SetupIntents for the customer specified by this customer ID.
63    pub fn customer(mut self, customer: impl Into<String>) -> Self {
64        self.inner.customer = Some(customer.into());
65        self
66    }
67    /// A cursor for use in pagination.
68    /// `ending_before` is an object ID that defines your place in the list.
69    /// 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.
70    pub fn ending_before(mut self, ending_before: impl Into<String>) -> Self {
71        self.inner.ending_before = Some(ending_before.into());
72        self
73    }
74    /// Specifies which fields in the response should be expanded.
75    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
76        self.inner.expand = Some(expand.into());
77        self
78    }
79    /// A limit on the number of objects to be returned.
80    /// Limit can range between 1 and 100, and the default is 10.
81    pub fn limit(mut self, limit: impl Into<i64>) -> Self {
82        self.inner.limit = Some(limit.into());
83        self
84    }
85    /// Only return SetupIntents that associate with the specified payment method.
86    pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
87        self.inner.payment_method = Some(payment_method.into());
88        self
89    }
90    /// A cursor for use in pagination.
91    /// `starting_after` is an object ID that defines your place in the list.
92    /// 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.
93    pub fn starting_after(mut self, starting_after: impl Into<String>) -> Self {
94        self.inner.starting_after = Some(starting_after.into());
95        self
96    }
97}
98impl Default for ListSetupIntent {
99    fn default() -> Self {
100        Self::new()
101    }
102}
103impl ListSetupIntent {
104    /// Send the request and return the deserialized response.
105    pub async fn send<C: StripeClient>(
106        &self,
107        client: &C,
108    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
109        self.customize().send(client).await
110    }
111
112    /// Send the request and return the deserialized response, blocking until completion.
113    pub fn send_blocking<C: StripeBlockingClient>(
114        &self,
115        client: &C,
116    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
117        self.customize().send_blocking(client)
118    }
119
120    pub fn paginate(
121        &self,
122    ) -> stripe_client_core::ListPaginator<stripe_types::List<stripe_shared::SetupIntent>> {
123        stripe_client_core::ListPaginator::new_list("/setup_intents", &self.inner)
124    }
125}
126
127impl StripeRequest for ListSetupIntent {
128    type Output = stripe_types::List<stripe_shared::SetupIntent>;
129
130    fn build(&self) -> RequestBuilder {
131        RequestBuilder::new(StripeMethod::Get, "/setup_intents").query(&self.inner)
132    }
133}
134#[derive(Clone, Debug, serde::Serialize)]
135struct RetrieveSetupIntentBuilder {
136    #[serde(skip_serializing_if = "Option::is_none")]
137    client_secret: Option<String>,
138    #[serde(skip_serializing_if = "Option::is_none")]
139    expand: Option<Vec<String>>,
140}
141impl RetrieveSetupIntentBuilder {
142    fn new() -> Self {
143        Self { client_secret: None, expand: None }
144    }
145}
146/// Retrieves the details of a SetupIntent that has previously been created.
147///
148/// Client-side retrieval using a publishable key is allowed when the `client_secret` is provided in the query string.
149///
150///
151/// When retrieved with a publishable key, only a subset of properties will be returned.
152/// Please refer to the [SetupIntent](https://stripe.com/docs/api#setup_intent_object) object reference for more details.
153#[derive(Clone, Debug, serde::Serialize)]
154pub struct RetrieveSetupIntent {
155    inner: RetrieveSetupIntentBuilder,
156    intent: stripe_shared::SetupIntentId,
157}
158impl RetrieveSetupIntent {
159    /// Construct a new `RetrieveSetupIntent`.
160    pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
161        Self { intent: intent.into(), inner: RetrieveSetupIntentBuilder::new() }
162    }
163    /// The client secret of the SetupIntent.
164    /// We require this string if you use a publishable key to retrieve the SetupIntent.
165    pub fn client_secret(mut self, client_secret: impl Into<String>) -> Self {
166        self.inner.client_secret = Some(client_secret.into());
167        self
168    }
169    /// Specifies which fields in the response should be expanded.
170    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
171        self.inner.expand = Some(expand.into());
172        self
173    }
174}
175impl RetrieveSetupIntent {
176    /// Send the request and return the deserialized response.
177    pub async fn send<C: StripeClient>(
178        &self,
179        client: &C,
180    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
181        self.customize().send(client).await
182    }
183
184    /// Send the request and return the deserialized response, blocking until completion.
185    pub fn send_blocking<C: StripeBlockingClient>(
186        &self,
187        client: &C,
188    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
189        self.customize().send_blocking(client)
190    }
191}
192
193impl StripeRequest for RetrieveSetupIntent {
194    type Output = stripe_shared::SetupIntent;
195
196    fn build(&self) -> RequestBuilder {
197        let intent = &self.intent;
198        RequestBuilder::new(StripeMethod::Get, format!("/setup_intents/{intent}"))
199            .query(&self.inner)
200    }
201}
202#[derive(Clone, Debug, serde::Serialize)]
203struct CreateSetupIntentBuilder {
204    #[serde(skip_serializing_if = "Option::is_none")]
205    attach_to_self: Option<bool>,
206    #[serde(skip_serializing_if = "Option::is_none")]
207    automatic_payment_methods: Option<CreateSetupIntentAutomaticPaymentMethods>,
208    #[serde(skip_serializing_if = "Option::is_none")]
209    confirm: Option<bool>,
210    #[serde(skip_serializing_if = "Option::is_none")]
211    confirmation_token: Option<String>,
212    #[serde(skip_serializing_if = "Option::is_none")]
213    customer: Option<String>,
214    #[serde(skip_serializing_if = "Option::is_none")]
215    description: Option<String>,
216    #[serde(skip_serializing_if = "Option::is_none")]
217    excluded_payment_method_types:
218        Option<Vec<stripe_shared::SetupIntentExcludedPaymentMethodTypes>>,
219    #[serde(skip_serializing_if = "Option::is_none")]
220    expand: Option<Vec<String>>,
221    #[serde(skip_serializing_if = "Option::is_none")]
222    flow_directions: Option<Vec<stripe_shared::SetupIntentFlowDirections>>,
223    #[serde(skip_serializing_if = "Option::is_none")]
224    mandate_data: Option<CreateSetupIntentMandateData>,
225    #[serde(skip_serializing_if = "Option::is_none")]
226    metadata: Option<std::collections::HashMap<String, String>>,
227    #[serde(skip_serializing_if = "Option::is_none")]
228    on_behalf_of: Option<String>,
229    #[serde(skip_serializing_if = "Option::is_none")]
230    payment_method: Option<String>,
231    #[serde(skip_serializing_if = "Option::is_none")]
232    payment_method_configuration: Option<String>,
233    #[serde(skip_serializing_if = "Option::is_none")]
234    payment_method_data: Option<CreateSetupIntentPaymentMethodData>,
235    #[serde(skip_serializing_if = "Option::is_none")]
236    payment_method_options: Option<CreateSetupIntentPaymentMethodOptions>,
237    #[serde(skip_serializing_if = "Option::is_none")]
238    payment_method_types: Option<Vec<String>>,
239    #[serde(skip_serializing_if = "Option::is_none")]
240    return_url: Option<String>,
241    #[serde(skip_serializing_if = "Option::is_none")]
242    single_use: Option<CreateSetupIntentSingleUse>,
243    #[serde(skip_serializing_if = "Option::is_none")]
244    usage: Option<CreateSetupIntentUsage>,
245    #[serde(skip_serializing_if = "Option::is_none")]
246    use_stripe_sdk: Option<bool>,
247}
248impl CreateSetupIntentBuilder {
249    fn new() -> Self {
250        Self {
251            attach_to_self: None,
252            automatic_payment_methods: None,
253            confirm: None,
254            confirmation_token: None,
255            customer: None,
256            description: None,
257            excluded_payment_method_types: None,
258            expand: None,
259            flow_directions: None,
260            mandate_data: None,
261            metadata: None,
262            on_behalf_of: None,
263            payment_method: None,
264            payment_method_configuration: None,
265            payment_method_data: None,
266            payment_method_options: None,
267            payment_method_types: None,
268            return_url: None,
269            single_use: None,
270            usage: None,
271            use_stripe_sdk: None,
272        }
273    }
274}
275/// When you enable this parameter, this SetupIntent accepts payment methods that you enable in the Dashboard and that are compatible with its other parameters.
276#[derive(Copy, Clone, Debug, serde::Serialize)]
277pub struct CreateSetupIntentAutomaticPaymentMethods {
278    /// Controls whether this SetupIntent will accept redirect-based payment methods.
279    ///
280    /// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps.
281    /// To [confirm](https://stripe.com/docs/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.
282    #[serde(skip_serializing_if = "Option::is_none")]
283    pub allow_redirects: Option<CreateSetupIntentAutomaticPaymentMethodsAllowRedirects>,
284    /// Whether this feature is enabled.
285    pub enabled: bool,
286}
287impl CreateSetupIntentAutomaticPaymentMethods {
288    pub fn new(enabled: impl Into<bool>) -> Self {
289        Self { allow_redirects: None, enabled: enabled.into() }
290    }
291}
292/// Controls whether this SetupIntent will accept redirect-based payment methods.
293///
294/// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps.
295/// To [confirm](https://stripe.com/docs/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.
296#[derive(Copy, Clone, Eq, PartialEq)]
297pub enum CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
298    Always,
299    Never,
300}
301impl CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
302    pub fn as_str(self) -> &'static str {
303        use CreateSetupIntentAutomaticPaymentMethodsAllowRedirects::*;
304        match self {
305            Always => "always",
306            Never => "never",
307        }
308    }
309}
310
311impl std::str::FromStr for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
312    type Err = stripe_types::StripeParseError;
313    fn from_str(s: &str) -> Result<Self, Self::Err> {
314        use CreateSetupIntentAutomaticPaymentMethodsAllowRedirects::*;
315        match s {
316            "always" => Ok(Always),
317            "never" => Ok(Never),
318            _ => Err(stripe_types::StripeParseError),
319        }
320    }
321}
322impl std::fmt::Display for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
323    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
324        f.write_str(self.as_str())
325    }
326}
327
328impl std::fmt::Debug for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
329    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
330        f.write_str(self.as_str())
331    }
332}
333impl serde::Serialize for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
334    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
335    where
336        S: serde::Serializer,
337    {
338        serializer.serialize_str(self.as_str())
339    }
340}
341#[cfg(feature = "deserialize")]
342impl<'de> serde::Deserialize<'de> for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
343    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
344        use std::str::FromStr;
345        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
346        Self::from_str(&s).map_err(|_| {
347            serde::de::Error::custom(
348                "Unknown value for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects",
349            )
350        })
351    }
352}
353/// This hash contains details about the mandate to create.
354/// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm).
355#[derive(Clone, Debug, serde::Serialize)]
356pub struct CreateSetupIntentMandateData {
357    /// This hash contains details about the customer acceptance of the Mandate.
358    pub customer_acceptance: CreateSetupIntentMandateDataCustomerAcceptance,
359}
360impl CreateSetupIntentMandateData {
361    pub fn new(
362        customer_acceptance: impl Into<CreateSetupIntentMandateDataCustomerAcceptance>,
363    ) -> Self {
364        Self { customer_acceptance: customer_acceptance.into() }
365    }
366}
367/// This hash contains details about the customer acceptance of the Mandate.
368#[derive(Clone, Debug, serde::Serialize)]
369pub struct CreateSetupIntentMandateDataCustomerAcceptance {
370    /// The time at which the customer accepted the Mandate.
371    #[serde(skip_serializing_if = "Option::is_none")]
372    pub accepted_at: Option<stripe_types::Timestamp>,
373    /// If this is a Mandate accepted offline, this hash contains details about the offline acceptance.
374    #[serde(skip_serializing_if = "Option::is_none")]
375    #[serde(with = "stripe_types::with_serde_json_opt")]
376    pub offline: Option<miniserde::json::Value>,
377    /// If this is a Mandate accepted online, this hash contains details about the online acceptance.
378    #[serde(skip_serializing_if = "Option::is_none")]
379    pub online: Option<OnlineParam>,
380    /// The type of customer acceptance information included with the Mandate.
381    /// One of `online` or `offline`.
382    #[serde(rename = "type")]
383    pub type_: CreateSetupIntentMandateDataCustomerAcceptanceType,
384}
385impl CreateSetupIntentMandateDataCustomerAcceptance {
386    pub fn new(type_: impl Into<CreateSetupIntentMandateDataCustomerAcceptanceType>) -> Self {
387        Self { accepted_at: None, offline: None, online: None, type_: type_.into() }
388    }
389}
390/// The type of customer acceptance information included with the Mandate.
391/// One of `online` or `offline`.
392#[derive(Copy, Clone, Eq, PartialEq)]
393pub enum CreateSetupIntentMandateDataCustomerAcceptanceType {
394    Offline,
395    Online,
396}
397impl CreateSetupIntentMandateDataCustomerAcceptanceType {
398    pub fn as_str(self) -> &'static str {
399        use CreateSetupIntentMandateDataCustomerAcceptanceType::*;
400        match self {
401            Offline => "offline",
402            Online => "online",
403        }
404    }
405}
406
407impl std::str::FromStr for CreateSetupIntentMandateDataCustomerAcceptanceType {
408    type Err = stripe_types::StripeParseError;
409    fn from_str(s: &str) -> Result<Self, Self::Err> {
410        use CreateSetupIntentMandateDataCustomerAcceptanceType::*;
411        match s {
412            "offline" => Ok(Offline),
413            "online" => Ok(Online),
414            _ => Err(stripe_types::StripeParseError),
415        }
416    }
417}
418impl std::fmt::Display for CreateSetupIntentMandateDataCustomerAcceptanceType {
419    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
420        f.write_str(self.as_str())
421    }
422}
423
424impl std::fmt::Debug for CreateSetupIntentMandateDataCustomerAcceptanceType {
425    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
426        f.write_str(self.as_str())
427    }
428}
429impl serde::Serialize for CreateSetupIntentMandateDataCustomerAcceptanceType {
430    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
431    where
432        S: serde::Serializer,
433    {
434        serializer.serialize_str(self.as_str())
435    }
436}
437#[cfg(feature = "deserialize")]
438impl<'de> serde::Deserialize<'de> for CreateSetupIntentMandateDataCustomerAcceptanceType {
439    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
440        use std::str::FromStr;
441        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
442        Self::from_str(&s).map_err(|_| {
443            serde::de::Error::custom(
444                "Unknown value for CreateSetupIntentMandateDataCustomerAcceptanceType",
445            )
446        })
447    }
448}
449/// When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method).
450/// value in the SetupIntent.
451#[derive(Clone, Debug, serde::Serialize)]
452pub struct CreateSetupIntentPaymentMethodData {
453    /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
454    #[serde(skip_serializing_if = "Option::is_none")]
455    pub acss_debit: Option<PaymentMethodParam>,
456    /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
457    #[serde(skip_serializing_if = "Option::is_none")]
458    #[serde(with = "stripe_types::with_serde_json_opt")]
459    pub affirm: Option<miniserde::json::Value>,
460    /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
461    #[serde(skip_serializing_if = "Option::is_none")]
462    #[serde(with = "stripe_types::with_serde_json_opt")]
463    pub afterpay_clearpay: Option<miniserde::json::Value>,
464    /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
465    #[serde(skip_serializing_if = "Option::is_none")]
466    #[serde(with = "stripe_types::with_serde_json_opt")]
467    pub alipay: Option<miniserde::json::Value>,
468    /// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
469    /// 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.
470    /// The field defaults to `unspecified`.
471    #[serde(skip_serializing_if = "Option::is_none")]
472    pub allow_redisplay: Option<CreateSetupIntentPaymentMethodDataAllowRedisplay>,
473    /// If this is a Alma PaymentMethod, this hash contains details about the Alma payment method.
474    #[serde(skip_serializing_if = "Option::is_none")]
475    #[serde(with = "stripe_types::with_serde_json_opt")]
476    pub alma: Option<miniserde::json::Value>,
477    /// If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method.
478    #[serde(skip_serializing_if = "Option::is_none")]
479    #[serde(with = "stripe_types::with_serde_json_opt")]
480    pub amazon_pay: Option<miniserde::json::Value>,
481    /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
482    #[serde(skip_serializing_if = "Option::is_none")]
483    pub au_becs_debit: Option<CreateSetupIntentPaymentMethodDataAuBecsDebit>,
484    /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
485    #[serde(skip_serializing_if = "Option::is_none")]
486    pub bacs_debit: Option<CreateSetupIntentPaymentMethodDataBacsDebit>,
487    /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
488    #[serde(skip_serializing_if = "Option::is_none")]
489    #[serde(with = "stripe_types::with_serde_json_opt")]
490    pub bancontact: Option<miniserde::json::Value>,
491    /// If this is a `billie` PaymentMethod, this hash contains details about the Billie payment method.
492    #[serde(skip_serializing_if = "Option::is_none")]
493    #[serde(with = "stripe_types::with_serde_json_opt")]
494    pub billie: Option<miniserde::json::Value>,
495    /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
496    #[serde(skip_serializing_if = "Option::is_none")]
497    pub billing_details: Option<BillingDetailsInnerParams>,
498    /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
499    #[serde(skip_serializing_if = "Option::is_none")]
500    #[serde(with = "stripe_types::with_serde_json_opt")]
501    pub blik: Option<miniserde::json::Value>,
502    /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
503    #[serde(skip_serializing_if = "Option::is_none")]
504    pub boleto: Option<CreateSetupIntentPaymentMethodDataBoleto>,
505    /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
506    #[serde(skip_serializing_if = "Option::is_none")]
507    #[serde(with = "stripe_types::with_serde_json_opt")]
508    pub cashapp: Option<miniserde::json::Value>,
509    /// If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method.
510    #[serde(skip_serializing_if = "Option::is_none")]
511    #[serde(with = "stripe_types::with_serde_json_opt")]
512    pub crypto: Option<miniserde::json::Value>,
513    /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
514    #[serde(skip_serializing_if = "Option::is_none")]
515    #[serde(with = "stripe_types::with_serde_json_opt")]
516    pub customer_balance: Option<miniserde::json::Value>,
517    /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
518    #[serde(skip_serializing_if = "Option::is_none")]
519    pub eps: Option<CreateSetupIntentPaymentMethodDataEps>,
520    /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
521    #[serde(skip_serializing_if = "Option::is_none")]
522    pub fpx: Option<CreateSetupIntentPaymentMethodDataFpx>,
523    /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
524    #[serde(skip_serializing_if = "Option::is_none")]
525    #[serde(with = "stripe_types::with_serde_json_opt")]
526    pub giropay: Option<miniserde::json::Value>,
527    /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
528    #[serde(skip_serializing_if = "Option::is_none")]
529    #[serde(with = "stripe_types::with_serde_json_opt")]
530    pub grabpay: Option<miniserde::json::Value>,
531    /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
532    #[serde(skip_serializing_if = "Option::is_none")]
533    pub ideal: Option<CreateSetupIntentPaymentMethodDataIdeal>,
534    /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
535    #[serde(skip_serializing_if = "Option::is_none")]
536    #[serde(with = "stripe_types::with_serde_json_opt")]
537    pub interac_present: Option<miniserde::json::Value>,
538    /// If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method.
539    #[serde(skip_serializing_if = "Option::is_none")]
540    #[serde(with = "stripe_types::with_serde_json_opt")]
541    pub kakao_pay: Option<miniserde::json::Value>,
542    /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
543    #[serde(skip_serializing_if = "Option::is_none")]
544    pub klarna: Option<CreateSetupIntentPaymentMethodDataKlarna>,
545    /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
546    #[serde(skip_serializing_if = "Option::is_none")]
547    #[serde(with = "stripe_types::with_serde_json_opt")]
548    pub konbini: Option<miniserde::json::Value>,
549    /// If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method.
550    #[serde(skip_serializing_if = "Option::is_none")]
551    #[serde(with = "stripe_types::with_serde_json_opt")]
552    pub kr_card: Option<miniserde::json::Value>,
553    /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
554    #[serde(skip_serializing_if = "Option::is_none")]
555    #[serde(with = "stripe_types::with_serde_json_opt")]
556    pub link: Option<miniserde::json::Value>,
557    /// If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method.
558    #[serde(skip_serializing_if = "Option::is_none")]
559    #[serde(with = "stripe_types::with_serde_json_opt")]
560    pub mb_way: Option<miniserde::json::Value>,
561    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
562    /// This can be useful for storing additional information about the object in a structured format.
563    /// Individual keys can be unset by posting an empty value to them.
564    /// All keys can be unset by posting an empty value to `metadata`.
565    #[serde(skip_serializing_if = "Option::is_none")]
566    pub metadata: Option<std::collections::HashMap<String, String>>,
567    /// If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
568    #[serde(skip_serializing_if = "Option::is_none")]
569    #[serde(with = "stripe_types::with_serde_json_opt")]
570    pub mobilepay: Option<miniserde::json::Value>,
571    /// If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method.
572    #[serde(skip_serializing_if = "Option::is_none")]
573    #[serde(with = "stripe_types::with_serde_json_opt")]
574    pub multibanco: Option<miniserde::json::Value>,
575    /// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
576    #[serde(skip_serializing_if = "Option::is_none")]
577    pub naver_pay: Option<CreateSetupIntentPaymentMethodDataNaverPay>,
578    /// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
579    #[serde(skip_serializing_if = "Option::is_none")]
580    pub nz_bank_account: Option<CreateSetupIntentPaymentMethodDataNzBankAccount>,
581    /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
582    #[serde(skip_serializing_if = "Option::is_none")]
583    #[serde(with = "stripe_types::with_serde_json_opt")]
584    pub oxxo: Option<miniserde::json::Value>,
585    /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
586    #[serde(skip_serializing_if = "Option::is_none")]
587    pub p24: Option<CreateSetupIntentPaymentMethodDataP24>,
588    /// If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method.
589    #[serde(skip_serializing_if = "Option::is_none")]
590    #[serde(with = "stripe_types::with_serde_json_opt")]
591    pub pay_by_bank: Option<miniserde::json::Value>,
592    /// If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method.
593    #[serde(skip_serializing_if = "Option::is_none")]
594    #[serde(with = "stripe_types::with_serde_json_opt")]
595    pub payco: Option<miniserde::json::Value>,
596    /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
597    #[serde(skip_serializing_if = "Option::is_none")]
598    #[serde(with = "stripe_types::with_serde_json_opt")]
599    pub paynow: Option<miniserde::json::Value>,
600    /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
601    #[serde(skip_serializing_if = "Option::is_none")]
602    #[serde(with = "stripe_types::with_serde_json_opt")]
603    pub paypal: Option<miniserde::json::Value>,
604    /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
605    #[serde(skip_serializing_if = "Option::is_none")]
606    #[serde(with = "stripe_types::with_serde_json_opt")]
607    pub pix: Option<miniserde::json::Value>,
608    /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
609    #[serde(skip_serializing_if = "Option::is_none")]
610    #[serde(with = "stripe_types::with_serde_json_opt")]
611    pub promptpay: Option<miniserde::json::Value>,
612    /// Options to configure Radar.
613    /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
614    #[serde(skip_serializing_if = "Option::is_none")]
615    pub radar_options: Option<RadarOptionsWithHiddenOptions>,
616    /// If this is a `revolut_pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
617    #[serde(skip_serializing_if = "Option::is_none")]
618    #[serde(with = "stripe_types::with_serde_json_opt")]
619    pub revolut_pay: Option<miniserde::json::Value>,
620    /// If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method.
621    #[serde(skip_serializing_if = "Option::is_none")]
622    #[serde(with = "stripe_types::with_serde_json_opt")]
623    pub samsung_pay: Option<miniserde::json::Value>,
624    /// If this is a `satispay` PaymentMethod, this hash contains details about the Satispay payment method.
625    #[serde(skip_serializing_if = "Option::is_none")]
626    #[serde(with = "stripe_types::with_serde_json_opt")]
627    pub satispay: Option<miniserde::json::Value>,
628    /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
629    #[serde(skip_serializing_if = "Option::is_none")]
630    pub sepa_debit: Option<CreateSetupIntentPaymentMethodDataSepaDebit>,
631    /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
632    #[serde(skip_serializing_if = "Option::is_none")]
633    pub sofort: Option<CreateSetupIntentPaymentMethodDataSofort>,
634    /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
635    #[serde(skip_serializing_if = "Option::is_none")]
636    #[serde(with = "stripe_types::with_serde_json_opt")]
637    pub swish: Option<miniserde::json::Value>,
638    /// If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method.
639    #[serde(skip_serializing_if = "Option::is_none")]
640    #[serde(with = "stripe_types::with_serde_json_opt")]
641    pub twint: Option<miniserde::json::Value>,
642    /// The type of the PaymentMethod.
643    /// An additional hash is included on the PaymentMethod with a name matching this value.
644    /// It contains additional information specific to the PaymentMethod type.
645    #[serde(rename = "type")]
646    pub type_: CreateSetupIntentPaymentMethodDataType,
647    /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
648    #[serde(skip_serializing_if = "Option::is_none")]
649    pub us_bank_account: Option<CreateSetupIntentPaymentMethodDataUsBankAccount>,
650    /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
651    #[serde(skip_serializing_if = "Option::is_none")]
652    #[serde(with = "stripe_types::with_serde_json_opt")]
653    pub wechat_pay: Option<miniserde::json::Value>,
654    /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
655    #[serde(skip_serializing_if = "Option::is_none")]
656    #[serde(with = "stripe_types::with_serde_json_opt")]
657    pub zip: Option<miniserde::json::Value>,
658}
659impl CreateSetupIntentPaymentMethodData {
660    pub fn new(type_: impl Into<CreateSetupIntentPaymentMethodDataType>) -> Self {
661        Self {
662            acss_debit: None,
663            affirm: None,
664            afterpay_clearpay: None,
665            alipay: None,
666            allow_redisplay: None,
667            alma: None,
668            amazon_pay: None,
669            au_becs_debit: None,
670            bacs_debit: None,
671            bancontact: None,
672            billie: None,
673            billing_details: None,
674            blik: None,
675            boleto: None,
676            cashapp: None,
677            crypto: None,
678            customer_balance: None,
679            eps: None,
680            fpx: None,
681            giropay: None,
682            grabpay: None,
683            ideal: None,
684            interac_present: None,
685            kakao_pay: None,
686            klarna: None,
687            konbini: None,
688            kr_card: None,
689            link: None,
690            mb_way: None,
691            metadata: None,
692            mobilepay: None,
693            multibanco: None,
694            naver_pay: None,
695            nz_bank_account: None,
696            oxxo: None,
697            p24: None,
698            pay_by_bank: None,
699            payco: None,
700            paynow: None,
701            paypal: None,
702            pix: None,
703            promptpay: None,
704            radar_options: None,
705            revolut_pay: None,
706            samsung_pay: None,
707            satispay: None,
708            sepa_debit: None,
709            sofort: None,
710            swish: None,
711            twint: None,
712            type_: type_.into(),
713            us_bank_account: None,
714            wechat_pay: None,
715            zip: None,
716        }
717    }
718}
719/// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
720/// 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.
721/// The field defaults to `unspecified`.
722#[derive(Copy, Clone, Eq, PartialEq)]
723pub enum CreateSetupIntentPaymentMethodDataAllowRedisplay {
724    Always,
725    Limited,
726    Unspecified,
727}
728impl CreateSetupIntentPaymentMethodDataAllowRedisplay {
729    pub fn as_str(self) -> &'static str {
730        use CreateSetupIntentPaymentMethodDataAllowRedisplay::*;
731        match self {
732            Always => "always",
733            Limited => "limited",
734            Unspecified => "unspecified",
735        }
736    }
737}
738
739impl std::str::FromStr for CreateSetupIntentPaymentMethodDataAllowRedisplay {
740    type Err = stripe_types::StripeParseError;
741    fn from_str(s: &str) -> Result<Self, Self::Err> {
742        use CreateSetupIntentPaymentMethodDataAllowRedisplay::*;
743        match s {
744            "always" => Ok(Always),
745            "limited" => Ok(Limited),
746            "unspecified" => Ok(Unspecified),
747            _ => Err(stripe_types::StripeParseError),
748        }
749    }
750}
751impl std::fmt::Display for CreateSetupIntentPaymentMethodDataAllowRedisplay {
752    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
753        f.write_str(self.as_str())
754    }
755}
756
757impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataAllowRedisplay {
758    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
759        f.write_str(self.as_str())
760    }
761}
762impl serde::Serialize for CreateSetupIntentPaymentMethodDataAllowRedisplay {
763    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
764    where
765        S: serde::Serializer,
766    {
767        serializer.serialize_str(self.as_str())
768    }
769}
770#[cfg(feature = "deserialize")]
771impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataAllowRedisplay {
772    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
773        use std::str::FromStr;
774        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
775        Self::from_str(&s).map_err(|_| {
776            serde::de::Error::custom(
777                "Unknown value for CreateSetupIntentPaymentMethodDataAllowRedisplay",
778            )
779        })
780    }
781}
782/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
783#[derive(Clone, Debug, serde::Serialize)]
784pub struct CreateSetupIntentPaymentMethodDataAuBecsDebit {
785    /// The account number for the bank account.
786    pub account_number: String,
787    /// Bank-State-Branch number of the bank account.
788    pub bsb_number: String,
789}
790impl CreateSetupIntentPaymentMethodDataAuBecsDebit {
791    pub fn new(account_number: impl Into<String>, bsb_number: impl Into<String>) -> Self {
792        Self { account_number: account_number.into(), bsb_number: bsb_number.into() }
793    }
794}
795/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
796#[derive(Clone, Debug, serde::Serialize)]
797pub struct CreateSetupIntentPaymentMethodDataBacsDebit {
798    /// Account number of the bank account that the funds will be debited from.
799    #[serde(skip_serializing_if = "Option::is_none")]
800    pub account_number: Option<String>,
801    /// Sort code of the bank account. (e.g., `10-20-30`)
802    #[serde(skip_serializing_if = "Option::is_none")]
803    pub sort_code: Option<String>,
804}
805impl CreateSetupIntentPaymentMethodDataBacsDebit {
806    pub fn new() -> Self {
807        Self { account_number: None, sort_code: None }
808    }
809}
810impl Default for CreateSetupIntentPaymentMethodDataBacsDebit {
811    fn default() -> Self {
812        Self::new()
813    }
814}
815/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
816#[derive(Clone, Debug, serde::Serialize)]
817pub struct CreateSetupIntentPaymentMethodDataBoleto {
818    /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)
819    pub tax_id: String,
820}
821impl CreateSetupIntentPaymentMethodDataBoleto {
822    pub fn new(tax_id: impl Into<String>) -> Self {
823        Self { tax_id: tax_id.into() }
824    }
825}
826/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
827#[derive(Clone, Debug, serde::Serialize)]
828pub struct CreateSetupIntentPaymentMethodDataEps {
829    /// The customer's bank.
830    #[serde(skip_serializing_if = "Option::is_none")]
831    pub bank: Option<CreateSetupIntentPaymentMethodDataEpsBank>,
832}
833impl CreateSetupIntentPaymentMethodDataEps {
834    pub fn new() -> Self {
835        Self { bank: None }
836    }
837}
838impl Default for CreateSetupIntentPaymentMethodDataEps {
839    fn default() -> Self {
840        Self::new()
841    }
842}
843/// The customer's bank.
844#[derive(Clone, Eq, PartialEq)]
845#[non_exhaustive]
846pub enum CreateSetupIntentPaymentMethodDataEpsBank {
847    ArzteUndApothekerBank,
848    AustrianAnadiBankAg,
849    BankAustria,
850    BankhausCarlSpangler,
851    BankhausSchelhammerUndSchatteraAg,
852    BawagPskAg,
853    BksBankAg,
854    BrullKallmusBankAg,
855    BtvVierLanderBank,
856    CapitalBankGraweGruppeAg,
857    DeutscheBankAg,
858    Dolomitenbank,
859    EasybankAg,
860    ErsteBankUndSparkassen,
861    HypoAlpeadriabankInternationalAg,
862    HypoBankBurgenlandAktiengesellschaft,
863    HypoNoeLbFurNiederosterreichUWien,
864    HypoOberosterreichSalzburgSteiermark,
865    HypoTirolBankAg,
866    HypoVorarlbergBankAg,
867    MarchfelderBank,
868    OberbankAg,
869    RaiffeisenBankengruppeOsterreich,
870    SchoellerbankAg,
871    SpardaBankWien,
872    VolksbankGruppe,
873    VolkskreditbankAg,
874    VrBankBraunau,
875    /// An unrecognized value from Stripe. Should not be used as a request parameter.
876    Unknown(String),
877}
878impl CreateSetupIntentPaymentMethodDataEpsBank {
879    pub fn as_str(&self) -> &str {
880        use CreateSetupIntentPaymentMethodDataEpsBank::*;
881        match self {
882            ArzteUndApothekerBank => "arzte_und_apotheker_bank",
883            AustrianAnadiBankAg => "austrian_anadi_bank_ag",
884            BankAustria => "bank_austria",
885            BankhausCarlSpangler => "bankhaus_carl_spangler",
886            BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag",
887            BawagPskAg => "bawag_psk_ag",
888            BksBankAg => "bks_bank_ag",
889            BrullKallmusBankAg => "brull_kallmus_bank_ag",
890            BtvVierLanderBank => "btv_vier_lander_bank",
891            CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
892            DeutscheBankAg => "deutsche_bank_ag",
893            Dolomitenbank => "dolomitenbank",
894            EasybankAg => "easybank_ag",
895            ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
896            HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag",
897            HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft",
898            HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien",
899            HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark",
900            HypoTirolBankAg => "hypo_tirol_bank_ag",
901            HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
902            MarchfelderBank => "marchfelder_bank",
903            OberbankAg => "oberbank_ag",
904            RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich",
905            SchoellerbankAg => "schoellerbank_ag",
906            SpardaBankWien => "sparda_bank_wien",
907            VolksbankGruppe => "volksbank_gruppe",
908            VolkskreditbankAg => "volkskreditbank_ag",
909            VrBankBraunau => "vr_bank_braunau",
910            Unknown(v) => v,
911        }
912    }
913}
914
915impl std::str::FromStr for CreateSetupIntentPaymentMethodDataEpsBank {
916    type Err = std::convert::Infallible;
917    fn from_str(s: &str) -> Result<Self, Self::Err> {
918        use CreateSetupIntentPaymentMethodDataEpsBank::*;
919        match s {
920            "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank),
921            "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg),
922            "bank_austria" => Ok(BankAustria),
923            "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler),
924            "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg),
925            "bawag_psk_ag" => Ok(BawagPskAg),
926            "bks_bank_ag" => Ok(BksBankAg),
927            "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg),
928            "btv_vier_lander_bank" => Ok(BtvVierLanderBank),
929            "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg),
930            "deutsche_bank_ag" => Ok(DeutscheBankAg),
931            "dolomitenbank" => Ok(Dolomitenbank),
932            "easybank_ag" => Ok(EasybankAg),
933            "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen),
934            "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg),
935            "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft),
936            "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien),
937            "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark),
938            "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg),
939            "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg),
940            "marchfelder_bank" => Ok(MarchfelderBank),
941            "oberbank_ag" => Ok(OberbankAg),
942            "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich),
943            "schoellerbank_ag" => Ok(SchoellerbankAg),
944            "sparda_bank_wien" => Ok(SpardaBankWien),
945            "volksbank_gruppe" => Ok(VolksbankGruppe),
946            "volkskreditbank_ag" => Ok(VolkskreditbankAg),
947            "vr_bank_braunau" => Ok(VrBankBraunau),
948            v => Ok(Unknown(v.to_owned())),
949        }
950    }
951}
952impl std::fmt::Display for CreateSetupIntentPaymentMethodDataEpsBank {
953    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
954        f.write_str(self.as_str())
955    }
956}
957
958impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataEpsBank {
959    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
960        f.write_str(self.as_str())
961    }
962}
963impl serde::Serialize for CreateSetupIntentPaymentMethodDataEpsBank {
964    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
965    where
966        S: serde::Serializer,
967    {
968        serializer.serialize_str(self.as_str())
969    }
970}
971#[cfg(feature = "deserialize")]
972impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataEpsBank {
973    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
974        use std::str::FromStr;
975        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
976        Ok(Self::from_str(&s).unwrap())
977    }
978}
979/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
980#[derive(Clone, Debug, serde::Serialize)]
981pub struct CreateSetupIntentPaymentMethodDataFpx {
982    /// Account holder type for FPX transaction
983    #[serde(skip_serializing_if = "Option::is_none")]
984    pub account_holder_type: Option<CreateSetupIntentPaymentMethodDataFpxAccountHolderType>,
985    /// The customer's bank.
986    pub bank: CreateSetupIntentPaymentMethodDataFpxBank,
987}
988impl CreateSetupIntentPaymentMethodDataFpx {
989    pub fn new(bank: impl Into<CreateSetupIntentPaymentMethodDataFpxBank>) -> Self {
990        Self { account_holder_type: None, bank: bank.into() }
991    }
992}
993/// Account holder type for FPX transaction
994#[derive(Copy, Clone, Eq, PartialEq)]
995pub enum CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
996    Company,
997    Individual,
998}
999impl CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1000    pub fn as_str(self) -> &'static str {
1001        use CreateSetupIntentPaymentMethodDataFpxAccountHolderType::*;
1002        match self {
1003            Company => "company",
1004            Individual => "individual",
1005        }
1006    }
1007}
1008
1009impl std::str::FromStr for CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1010    type Err = stripe_types::StripeParseError;
1011    fn from_str(s: &str) -> Result<Self, Self::Err> {
1012        use CreateSetupIntentPaymentMethodDataFpxAccountHolderType::*;
1013        match s {
1014            "company" => Ok(Company),
1015            "individual" => Ok(Individual),
1016            _ => Err(stripe_types::StripeParseError),
1017        }
1018    }
1019}
1020impl std::fmt::Display for CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1021    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1022        f.write_str(self.as_str())
1023    }
1024}
1025
1026impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1027    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1028        f.write_str(self.as_str())
1029    }
1030}
1031impl serde::Serialize for CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1032    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1033    where
1034        S: serde::Serializer,
1035    {
1036        serializer.serialize_str(self.as_str())
1037    }
1038}
1039#[cfg(feature = "deserialize")]
1040impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
1041    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1042        use std::str::FromStr;
1043        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1044        Self::from_str(&s).map_err(|_| {
1045            serde::de::Error::custom(
1046                "Unknown value for CreateSetupIntentPaymentMethodDataFpxAccountHolderType",
1047            )
1048        })
1049    }
1050}
1051/// The customer's bank.
1052#[derive(Clone, Eq, PartialEq)]
1053#[non_exhaustive]
1054pub enum CreateSetupIntentPaymentMethodDataFpxBank {
1055    AffinBank,
1056    Agrobank,
1057    AllianceBank,
1058    Ambank,
1059    BankIslam,
1060    BankMuamalat,
1061    BankOfChina,
1062    BankRakyat,
1063    Bsn,
1064    Cimb,
1065    DeutscheBank,
1066    HongLeongBank,
1067    Hsbc,
1068    Kfh,
1069    Maybank2e,
1070    Maybank2u,
1071    Ocbc,
1072    PbEnterprise,
1073    PublicBank,
1074    Rhb,
1075    StandardChartered,
1076    Uob,
1077    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1078    Unknown(String),
1079}
1080impl CreateSetupIntentPaymentMethodDataFpxBank {
1081    pub fn as_str(&self) -> &str {
1082        use CreateSetupIntentPaymentMethodDataFpxBank::*;
1083        match self {
1084            AffinBank => "affin_bank",
1085            Agrobank => "agrobank",
1086            AllianceBank => "alliance_bank",
1087            Ambank => "ambank",
1088            BankIslam => "bank_islam",
1089            BankMuamalat => "bank_muamalat",
1090            BankOfChina => "bank_of_china",
1091            BankRakyat => "bank_rakyat",
1092            Bsn => "bsn",
1093            Cimb => "cimb",
1094            DeutscheBank => "deutsche_bank",
1095            HongLeongBank => "hong_leong_bank",
1096            Hsbc => "hsbc",
1097            Kfh => "kfh",
1098            Maybank2e => "maybank2e",
1099            Maybank2u => "maybank2u",
1100            Ocbc => "ocbc",
1101            PbEnterprise => "pb_enterprise",
1102            PublicBank => "public_bank",
1103            Rhb => "rhb",
1104            StandardChartered => "standard_chartered",
1105            Uob => "uob",
1106            Unknown(v) => v,
1107        }
1108    }
1109}
1110
1111impl std::str::FromStr for CreateSetupIntentPaymentMethodDataFpxBank {
1112    type Err = std::convert::Infallible;
1113    fn from_str(s: &str) -> Result<Self, Self::Err> {
1114        use CreateSetupIntentPaymentMethodDataFpxBank::*;
1115        match s {
1116            "affin_bank" => Ok(AffinBank),
1117            "agrobank" => Ok(Agrobank),
1118            "alliance_bank" => Ok(AllianceBank),
1119            "ambank" => Ok(Ambank),
1120            "bank_islam" => Ok(BankIslam),
1121            "bank_muamalat" => Ok(BankMuamalat),
1122            "bank_of_china" => Ok(BankOfChina),
1123            "bank_rakyat" => Ok(BankRakyat),
1124            "bsn" => Ok(Bsn),
1125            "cimb" => Ok(Cimb),
1126            "deutsche_bank" => Ok(DeutscheBank),
1127            "hong_leong_bank" => Ok(HongLeongBank),
1128            "hsbc" => Ok(Hsbc),
1129            "kfh" => Ok(Kfh),
1130            "maybank2e" => Ok(Maybank2e),
1131            "maybank2u" => Ok(Maybank2u),
1132            "ocbc" => Ok(Ocbc),
1133            "pb_enterprise" => Ok(PbEnterprise),
1134            "public_bank" => Ok(PublicBank),
1135            "rhb" => Ok(Rhb),
1136            "standard_chartered" => Ok(StandardChartered),
1137            "uob" => Ok(Uob),
1138            v => Ok(Unknown(v.to_owned())),
1139        }
1140    }
1141}
1142impl std::fmt::Display for CreateSetupIntentPaymentMethodDataFpxBank {
1143    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1144        f.write_str(self.as_str())
1145    }
1146}
1147
1148impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataFpxBank {
1149    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1150        f.write_str(self.as_str())
1151    }
1152}
1153impl serde::Serialize for CreateSetupIntentPaymentMethodDataFpxBank {
1154    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1155    where
1156        S: serde::Serializer,
1157    {
1158        serializer.serialize_str(self.as_str())
1159    }
1160}
1161#[cfg(feature = "deserialize")]
1162impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataFpxBank {
1163    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1164        use std::str::FromStr;
1165        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1166        Ok(Self::from_str(&s).unwrap())
1167    }
1168}
1169/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
1170#[derive(Clone, Debug, serde::Serialize)]
1171pub struct CreateSetupIntentPaymentMethodDataIdeal {
1172    /// The customer's bank.
1173    /// Only use this parameter for existing customers.
1174    /// Don't use it for new customers.
1175    #[serde(skip_serializing_if = "Option::is_none")]
1176    pub bank: Option<CreateSetupIntentPaymentMethodDataIdealBank>,
1177}
1178impl CreateSetupIntentPaymentMethodDataIdeal {
1179    pub fn new() -> Self {
1180        Self { bank: None }
1181    }
1182}
1183impl Default for CreateSetupIntentPaymentMethodDataIdeal {
1184    fn default() -> Self {
1185        Self::new()
1186    }
1187}
1188/// The customer's bank.
1189/// Only use this parameter for existing customers.
1190/// Don't use it for new customers.
1191#[derive(Clone, Eq, PartialEq)]
1192#[non_exhaustive]
1193pub enum CreateSetupIntentPaymentMethodDataIdealBank {
1194    AbnAmro,
1195    AsnBank,
1196    Bunq,
1197    Buut,
1198    Finom,
1199    Handelsbanken,
1200    Ing,
1201    Knab,
1202    Moneyou,
1203    N26,
1204    Nn,
1205    Rabobank,
1206    Regiobank,
1207    Revolut,
1208    SnsBank,
1209    TriodosBank,
1210    VanLanschot,
1211    Yoursafe,
1212    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1213    Unknown(String),
1214}
1215impl CreateSetupIntentPaymentMethodDataIdealBank {
1216    pub fn as_str(&self) -> &str {
1217        use CreateSetupIntentPaymentMethodDataIdealBank::*;
1218        match self {
1219            AbnAmro => "abn_amro",
1220            AsnBank => "asn_bank",
1221            Bunq => "bunq",
1222            Buut => "buut",
1223            Finom => "finom",
1224            Handelsbanken => "handelsbanken",
1225            Ing => "ing",
1226            Knab => "knab",
1227            Moneyou => "moneyou",
1228            N26 => "n26",
1229            Nn => "nn",
1230            Rabobank => "rabobank",
1231            Regiobank => "regiobank",
1232            Revolut => "revolut",
1233            SnsBank => "sns_bank",
1234            TriodosBank => "triodos_bank",
1235            VanLanschot => "van_lanschot",
1236            Yoursafe => "yoursafe",
1237            Unknown(v) => v,
1238        }
1239    }
1240}
1241
1242impl std::str::FromStr for CreateSetupIntentPaymentMethodDataIdealBank {
1243    type Err = std::convert::Infallible;
1244    fn from_str(s: &str) -> Result<Self, Self::Err> {
1245        use CreateSetupIntentPaymentMethodDataIdealBank::*;
1246        match s {
1247            "abn_amro" => Ok(AbnAmro),
1248            "asn_bank" => Ok(AsnBank),
1249            "bunq" => Ok(Bunq),
1250            "buut" => Ok(Buut),
1251            "finom" => Ok(Finom),
1252            "handelsbanken" => Ok(Handelsbanken),
1253            "ing" => Ok(Ing),
1254            "knab" => Ok(Knab),
1255            "moneyou" => Ok(Moneyou),
1256            "n26" => Ok(N26),
1257            "nn" => Ok(Nn),
1258            "rabobank" => Ok(Rabobank),
1259            "regiobank" => Ok(Regiobank),
1260            "revolut" => Ok(Revolut),
1261            "sns_bank" => Ok(SnsBank),
1262            "triodos_bank" => Ok(TriodosBank),
1263            "van_lanschot" => Ok(VanLanschot),
1264            "yoursafe" => Ok(Yoursafe),
1265            v => Ok(Unknown(v.to_owned())),
1266        }
1267    }
1268}
1269impl std::fmt::Display for CreateSetupIntentPaymentMethodDataIdealBank {
1270    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1271        f.write_str(self.as_str())
1272    }
1273}
1274
1275impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataIdealBank {
1276    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1277        f.write_str(self.as_str())
1278    }
1279}
1280impl serde::Serialize for CreateSetupIntentPaymentMethodDataIdealBank {
1281    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1282    where
1283        S: serde::Serializer,
1284    {
1285        serializer.serialize_str(self.as_str())
1286    }
1287}
1288#[cfg(feature = "deserialize")]
1289impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataIdealBank {
1290    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1291        use std::str::FromStr;
1292        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1293        Ok(Self::from_str(&s).unwrap())
1294    }
1295}
1296/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
1297#[derive(Copy, Clone, Debug, serde::Serialize)]
1298pub struct CreateSetupIntentPaymentMethodDataKlarna {
1299    /// Customer's date of birth
1300    #[serde(skip_serializing_if = "Option::is_none")]
1301    pub dob: Option<DateOfBirth>,
1302}
1303impl CreateSetupIntentPaymentMethodDataKlarna {
1304    pub fn new() -> Self {
1305        Self { dob: None }
1306    }
1307}
1308impl Default for CreateSetupIntentPaymentMethodDataKlarna {
1309    fn default() -> Self {
1310        Self::new()
1311    }
1312}
1313/// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
1314#[derive(Copy, Clone, Debug, serde::Serialize)]
1315pub struct CreateSetupIntentPaymentMethodDataNaverPay {
1316    /// Whether to use Naver Pay points or a card to fund this transaction.
1317    /// If not provided, this defaults to `card`.
1318    #[serde(skip_serializing_if = "Option::is_none")]
1319    pub funding: Option<CreateSetupIntentPaymentMethodDataNaverPayFunding>,
1320}
1321impl CreateSetupIntentPaymentMethodDataNaverPay {
1322    pub fn new() -> Self {
1323        Self { funding: None }
1324    }
1325}
1326impl Default for CreateSetupIntentPaymentMethodDataNaverPay {
1327    fn default() -> Self {
1328        Self::new()
1329    }
1330}
1331/// Whether to use Naver Pay points or a card to fund this transaction.
1332/// If not provided, this defaults to `card`.
1333#[derive(Copy, Clone, Eq, PartialEq)]
1334pub enum CreateSetupIntentPaymentMethodDataNaverPayFunding {
1335    Card,
1336    Points,
1337}
1338impl CreateSetupIntentPaymentMethodDataNaverPayFunding {
1339    pub fn as_str(self) -> &'static str {
1340        use CreateSetupIntentPaymentMethodDataNaverPayFunding::*;
1341        match self {
1342            Card => "card",
1343            Points => "points",
1344        }
1345    }
1346}
1347
1348impl std::str::FromStr for CreateSetupIntentPaymentMethodDataNaverPayFunding {
1349    type Err = stripe_types::StripeParseError;
1350    fn from_str(s: &str) -> Result<Self, Self::Err> {
1351        use CreateSetupIntentPaymentMethodDataNaverPayFunding::*;
1352        match s {
1353            "card" => Ok(Card),
1354            "points" => Ok(Points),
1355            _ => Err(stripe_types::StripeParseError),
1356        }
1357    }
1358}
1359impl std::fmt::Display for CreateSetupIntentPaymentMethodDataNaverPayFunding {
1360    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1361        f.write_str(self.as_str())
1362    }
1363}
1364
1365impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataNaverPayFunding {
1366    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1367        f.write_str(self.as_str())
1368    }
1369}
1370impl serde::Serialize for CreateSetupIntentPaymentMethodDataNaverPayFunding {
1371    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1372    where
1373        S: serde::Serializer,
1374    {
1375        serializer.serialize_str(self.as_str())
1376    }
1377}
1378#[cfg(feature = "deserialize")]
1379impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataNaverPayFunding {
1380    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1381        use std::str::FromStr;
1382        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1383        Self::from_str(&s).map_err(|_| {
1384            serde::de::Error::custom(
1385                "Unknown value for CreateSetupIntentPaymentMethodDataNaverPayFunding",
1386            )
1387        })
1388    }
1389}
1390/// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
1391#[derive(Clone, Debug, serde::Serialize)]
1392pub struct CreateSetupIntentPaymentMethodDataNzBankAccount {
1393    /// The name on the bank account.
1394    /// Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod’s billing details.
1395    #[serde(skip_serializing_if = "Option::is_none")]
1396    pub account_holder_name: Option<String>,
1397    /// The account number for the bank account.
1398    pub account_number: String,
1399    /// The numeric code for the bank account's bank.
1400    pub bank_code: String,
1401    /// The numeric code for the bank account's bank branch.
1402    pub branch_code: String,
1403    #[serde(skip_serializing_if = "Option::is_none")]
1404    pub reference: Option<String>,
1405    /// The suffix of the bank account number.
1406    pub suffix: String,
1407}
1408impl CreateSetupIntentPaymentMethodDataNzBankAccount {
1409    pub fn new(
1410        account_number: impl Into<String>,
1411        bank_code: impl Into<String>,
1412        branch_code: impl Into<String>,
1413        suffix: impl Into<String>,
1414    ) -> Self {
1415        Self {
1416            account_holder_name: None,
1417            account_number: account_number.into(),
1418            bank_code: bank_code.into(),
1419            branch_code: branch_code.into(),
1420            reference: None,
1421            suffix: suffix.into(),
1422        }
1423    }
1424}
1425/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
1426#[derive(Clone, Debug, serde::Serialize)]
1427pub struct CreateSetupIntentPaymentMethodDataP24 {
1428    /// The customer's bank.
1429    #[serde(skip_serializing_if = "Option::is_none")]
1430    pub bank: Option<CreateSetupIntentPaymentMethodDataP24Bank>,
1431}
1432impl CreateSetupIntentPaymentMethodDataP24 {
1433    pub fn new() -> Self {
1434        Self { bank: None }
1435    }
1436}
1437impl Default for CreateSetupIntentPaymentMethodDataP24 {
1438    fn default() -> Self {
1439        Self::new()
1440    }
1441}
1442/// The customer's bank.
1443#[derive(Clone, Eq, PartialEq)]
1444#[non_exhaustive]
1445pub enum CreateSetupIntentPaymentMethodDataP24Bank {
1446    AliorBank,
1447    BankMillennium,
1448    BankNowyBfgSa,
1449    BankPekaoSa,
1450    BankiSpbdzielcze,
1451    Blik,
1452    BnpParibas,
1453    Boz,
1454    CitiHandlowy,
1455    CreditAgricole,
1456    Envelobank,
1457    EtransferPocztowy24,
1458    GetinBank,
1459    Ideabank,
1460    Ing,
1461    Inteligo,
1462    MbankMtransfer,
1463    NestPrzelew,
1464    NoblePay,
1465    PbacZIpko,
1466    PlusBank,
1467    SantanderPrzelew24,
1468    TmobileUsbugiBankowe,
1469    ToyotaBank,
1470    Velobank,
1471    VolkswagenBank,
1472    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1473    Unknown(String),
1474}
1475impl CreateSetupIntentPaymentMethodDataP24Bank {
1476    pub fn as_str(&self) -> &str {
1477        use CreateSetupIntentPaymentMethodDataP24Bank::*;
1478        match self {
1479            AliorBank => "alior_bank",
1480            BankMillennium => "bank_millennium",
1481            BankNowyBfgSa => "bank_nowy_bfg_sa",
1482            BankPekaoSa => "bank_pekao_sa",
1483            BankiSpbdzielcze => "banki_spbdzielcze",
1484            Blik => "blik",
1485            BnpParibas => "bnp_paribas",
1486            Boz => "boz",
1487            CitiHandlowy => "citi_handlowy",
1488            CreditAgricole => "credit_agricole",
1489            Envelobank => "envelobank",
1490            EtransferPocztowy24 => "etransfer_pocztowy24",
1491            GetinBank => "getin_bank",
1492            Ideabank => "ideabank",
1493            Ing => "ing",
1494            Inteligo => "inteligo",
1495            MbankMtransfer => "mbank_mtransfer",
1496            NestPrzelew => "nest_przelew",
1497            NoblePay => "noble_pay",
1498            PbacZIpko => "pbac_z_ipko",
1499            PlusBank => "plus_bank",
1500            SantanderPrzelew24 => "santander_przelew24",
1501            TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
1502            ToyotaBank => "toyota_bank",
1503            Velobank => "velobank",
1504            VolkswagenBank => "volkswagen_bank",
1505            Unknown(v) => v,
1506        }
1507    }
1508}
1509
1510impl std::str::FromStr for CreateSetupIntentPaymentMethodDataP24Bank {
1511    type Err = std::convert::Infallible;
1512    fn from_str(s: &str) -> Result<Self, Self::Err> {
1513        use CreateSetupIntentPaymentMethodDataP24Bank::*;
1514        match s {
1515            "alior_bank" => Ok(AliorBank),
1516            "bank_millennium" => Ok(BankMillennium),
1517            "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa),
1518            "bank_pekao_sa" => Ok(BankPekaoSa),
1519            "banki_spbdzielcze" => Ok(BankiSpbdzielcze),
1520            "blik" => Ok(Blik),
1521            "bnp_paribas" => Ok(BnpParibas),
1522            "boz" => Ok(Boz),
1523            "citi_handlowy" => Ok(CitiHandlowy),
1524            "credit_agricole" => Ok(CreditAgricole),
1525            "envelobank" => Ok(Envelobank),
1526            "etransfer_pocztowy24" => Ok(EtransferPocztowy24),
1527            "getin_bank" => Ok(GetinBank),
1528            "ideabank" => Ok(Ideabank),
1529            "ing" => Ok(Ing),
1530            "inteligo" => Ok(Inteligo),
1531            "mbank_mtransfer" => Ok(MbankMtransfer),
1532            "nest_przelew" => Ok(NestPrzelew),
1533            "noble_pay" => Ok(NoblePay),
1534            "pbac_z_ipko" => Ok(PbacZIpko),
1535            "plus_bank" => Ok(PlusBank),
1536            "santander_przelew24" => Ok(SantanderPrzelew24),
1537            "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe),
1538            "toyota_bank" => Ok(ToyotaBank),
1539            "velobank" => Ok(Velobank),
1540            "volkswagen_bank" => Ok(VolkswagenBank),
1541            v => Ok(Unknown(v.to_owned())),
1542        }
1543    }
1544}
1545impl std::fmt::Display for CreateSetupIntentPaymentMethodDataP24Bank {
1546    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1547        f.write_str(self.as_str())
1548    }
1549}
1550
1551impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataP24Bank {
1552    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1553        f.write_str(self.as_str())
1554    }
1555}
1556impl serde::Serialize for CreateSetupIntentPaymentMethodDataP24Bank {
1557    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1558    where
1559        S: serde::Serializer,
1560    {
1561        serializer.serialize_str(self.as_str())
1562    }
1563}
1564#[cfg(feature = "deserialize")]
1565impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataP24Bank {
1566    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1567        use std::str::FromStr;
1568        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1569        Ok(Self::from_str(&s).unwrap())
1570    }
1571}
1572/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
1573#[derive(Clone, Debug, serde::Serialize)]
1574pub struct CreateSetupIntentPaymentMethodDataSepaDebit {
1575    /// IBAN of the bank account.
1576    pub iban: String,
1577}
1578impl CreateSetupIntentPaymentMethodDataSepaDebit {
1579    pub fn new(iban: impl Into<String>) -> Self {
1580        Self { iban: iban.into() }
1581    }
1582}
1583/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
1584#[derive(Copy, Clone, Debug, serde::Serialize)]
1585pub struct CreateSetupIntentPaymentMethodDataSofort {
1586    /// Two-letter ISO code representing the country the bank account is located in.
1587    pub country: CreateSetupIntentPaymentMethodDataSofortCountry,
1588}
1589impl CreateSetupIntentPaymentMethodDataSofort {
1590    pub fn new(country: impl Into<CreateSetupIntentPaymentMethodDataSofortCountry>) -> Self {
1591        Self { country: country.into() }
1592    }
1593}
1594/// Two-letter ISO code representing the country the bank account is located in.
1595#[derive(Copy, Clone, Eq, PartialEq)]
1596pub enum CreateSetupIntentPaymentMethodDataSofortCountry {
1597    At,
1598    Be,
1599    De,
1600    Es,
1601    It,
1602    Nl,
1603}
1604impl CreateSetupIntentPaymentMethodDataSofortCountry {
1605    pub fn as_str(self) -> &'static str {
1606        use CreateSetupIntentPaymentMethodDataSofortCountry::*;
1607        match self {
1608            At => "AT",
1609            Be => "BE",
1610            De => "DE",
1611            Es => "ES",
1612            It => "IT",
1613            Nl => "NL",
1614        }
1615    }
1616}
1617
1618impl std::str::FromStr for CreateSetupIntentPaymentMethodDataSofortCountry {
1619    type Err = stripe_types::StripeParseError;
1620    fn from_str(s: &str) -> Result<Self, Self::Err> {
1621        use CreateSetupIntentPaymentMethodDataSofortCountry::*;
1622        match s {
1623            "AT" => Ok(At),
1624            "BE" => Ok(Be),
1625            "DE" => Ok(De),
1626            "ES" => Ok(Es),
1627            "IT" => Ok(It),
1628            "NL" => Ok(Nl),
1629            _ => Err(stripe_types::StripeParseError),
1630        }
1631    }
1632}
1633impl std::fmt::Display for CreateSetupIntentPaymentMethodDataSofortCountry {
1634    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1635        f.write_str(self.as_str())
1636    }
1637}
1638
1639impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataSofortCountry {
1640    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1641        f.write_str(self.as_str())
1642    }
1643}
1644impl serde::Serialize for CreateSetupIntentPaymentMethodDataSofortCountry {
1645    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1646    where
1647        S: serde::Serializer,
1648    {
1649        serializer.serialize_str(self.as_str())
1650    }
1651}
1652#[cfg(feature = "deserialize")]
1653impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataSofortCountry {
1654    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1655        use std::str::FromStr;
1656        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1657        Self::from_str(&s).map_err(|_| {
1658            serde::de::Error::custom(
1659                "Unknown value for CreateSetupIntentPaymentMethodDataSofortCountry",
1660            )
1661        })
1662    }
1663}
1664/// The type of the PaymentMethod.
1665/// An additional hash is included on the PaymentMethod with a name matching this value.
1666/// It contains additional information specific to the PaymentMethod type.
1667#[derive(Clone, Eq, PartialEq)]
1668#[non_exhaustive]
1669pub enum CreateSetupIntentPaymentMethodDataType {
1670    AcssDebit,
1671    Affirm,
1672    AfterpayClearpay,
1673    Alipay,
1674    Alma,
1675    AmazonPay,
1676    AuBecsDebit,
1677    BacsDebit,
1678    Bancontact,
1679    Billie,
1680    Blik,
1681    Boleto,
1682    Cashapp,
1683    Crypto,
1684    CustomerBalance,
1685    Eps,
1686    Fpx,
1687    Giropay,
1688    Grabpay,
1689    Ideal,
1690    KakaoPay,
1691    Klarna,
1692    Konbini,
1693    KrCard,
1694    Link,
1695    MbWay,
1696    Mobilepay,
1697    Multibanco,
1698    NaverPay,
1699    NzBankAccount,
1700    Oxxo,
1701    P24,
1702    PayByBank,
1703    Payco,
1704    Paynow,
1705    Paypal,
1706    Pix,
1707    Promptpay,
1708    RevolutPay,
1709    SamsungPay,
1710    Satispay,
1711    SepaDebit,
1712    Sofort,
1713    Swish,
1714    Twint,
1715    UsBankAccount,
1716    WechatPay,
1717    Zip,
1718    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1719    Unknown(String),
1720}
1721impl CreateSetupIntentPaymentMethodDataType {
1722    pub fn as_str(&self) -> &str {
1723        use CreateSetupIntentPaymentMethodDataType::*;
1724        match self {
1725            AcssDebit => "acss_debit",
1726            Affirm => "affirm",
1727            AfterpayClearpay => "afterpay_clearpay",
1728            Alipay => "alipay",
1729            Alma => "alma",
1730            AmazonPay => "amazon_pay",
1731            AuBecsDebit => "au_becs_debit",
1732            BacsDebit => "bacs_debit",
1733            Bancontact => "bancontact",
1734            Billie => "billie",
1735            Blik => "blik",
1736            Boleto => "boleto",
1737            Cashapp => "cashapp",
1738            Crypto => "crypto",
1739            CustomerBalance => "customer_balance",
1740            Eps => "eps",
1741            Fpx => "fpx",
1742            Giropay => "giropay",
1743            Grabpay => "grabpay",
1744            Ideal => "ideal",
1745            KakaoPay => "kakao_pay",
1746            Klarna => "klarna",
1747            Konbini => "konbini",
1748            KrCard => "kr_card",
1749            Link => "link",
1750            MbWay => "mb_way",
1751            Mobilepay => "mobilepay",
1752            Multibanco => "multibanco",
1753            NaverPay => "naver_pay",
1754            NzBankAccount => "nz_bank_account",
1755            Oxxo => "oxxo",
1756            P24 => "p24",
1757            PayByBank => "pay_by_bank",
1758            Payco => "payco",
1759            Paynow => "paynow",
1760            Paypal => "paypal",
1761            Pix => "pix",
1762            Promptpay => "promptpay",
1763            RevolutPay => "revolut_pay",
1764            SamsungPay => "samsung_pay",
1765            Satispay => "satispay",
1766            SepaDebit => "sepa_debit",
1767            Sofort => "sofort",
1768            Swish => "swish",
1769            Twint => "twint",
1770            UsBankAccount => "us_bank_account",
1771            WechatPay => "wechat_pay",
1772            Zip => "zip",
1773            Unknown(v) => v,
1774        }
1775    }
1776}
1777
1778impl std::str::FromStr for CreateSetupIntentPaymentMethodDataType {
1779    type Err = std::convert::Infallible;
1780    fn from_str(s: &str) -> Result<Self, Self::Err> {
1781        use CreateSetupIntentPaymentMethodDataType::*;
1782        match s {
1783            "acss_debit" => Ok(AcssDebit),
1784            "affirm" => Ok(Affirm),
1785            "afterpay_clearpay" => Ok(AfterpayClearpay),
1786            "alipay" => Ok(Alipay),
1787            "alma" => Ok(Alma),
1788            "amazon_pay" => Ok(AmazonPay),
1789            "au_becs_debit" => Ok(AuBecsDebit),
1790            "bacs_debit" => Ok(BacsDebit),
1791            "bancontact" => Ok(Bancontact),
1792            "billie" => Ok(Billie),
1793            "blik" => Ok(Blik),
1794            "boleto" => Ok(Boleto),
1795            "cashapp" => Ok(Cashapp),
1796            "crypto" => Ok(Crypto),
1797            "customer_balance" => Ok(CustomerBalance),
1798            "eps" => Ok(Eps),
1799            "fpx" => Ok(Fpx),
1800            "giropay" => Ok(Giropay),
1801            "grabpay" => Ok(Grabpay),
1802            "ideal" => Ok(Ideal),
1803            "kakao_pay" => Ok(KakaoPay),
1804            "klarna" => Ok(Klarna),
1805            "konbini" => Ok(Konbini),
1806            "kr_card" => Ok(KrCard),
1807            "link" => Ok(Link),
1808            "mb_way" => Ok(MbWay),
1809            "mobilepay" => Ok(Mobilepay),
1810            "multibanco" => Ok(Multibanco),
1811            "naver_pay" => Ok(NaverPay),
1812            "nz_bank_account" => Ok(NzBankAccount),
1813            "oxxo" => Ok(Oxxo),
1814            "p24" => Ok(P24),
1815            "pay_by_bank" => Ok(PayByBank),
1816            "payco" => Ok(Payco),
1817            "paynow" => Ok(Paynow),
1818            "paypal" => Ok(Paypal),
1819            "pix" => Ok(Pix),
1820            "promptpay" => Ok(Promptpay),
1821            "revolut_pay" => Ok(RevolutPay),
1822            "samsung_pay" => Ok(SamsungPay),
1823            "satispay" => Ok(Satispay),
1824            "sepa_debit" => Ok(SepaDebit),
1825            "sofort" => Ok(Sofort),
1826            "swish" => Ok(Swish),
1827            "twint" => Ok(Twint),
1828            "us_bank_account" => Ok(UsBankAccount),
1829            "wechat_pay" => Ok(WechatPay),
1830            "zip" => Ok(Zip),
1831            v => Ok(Unknown(v.to_owned())),
1832        }
1833    }
1834}
1835impl std::fmt::Display for CreateSetupIntentPaymentMethodDataType {
1836    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1837        f.write_str(self.as_str())
1838    }
1839}
1840
1841impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataType {
1842    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1843        f.write_str(self.as_str())
1844    }
1845}
1846impl serde::Serialize for CreateSetupIntentPaymentMethodDataType {
1847    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1848    where
1849        S: serde::Serializer,
1850    {
1851        serializer.serialize_str(self.as_str())
1852    }
1853}
1854#[cfg(feature = "deserialize")]
1855impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataType {
1856    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1857        use std::str::FromStr;
1858        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1859        Ok(Self::from_str(&s).unwrap())
1860    }
1861}
1862/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
1863#[derive(Clone, Debug, serde::Serialize)]
1864pub struct CreateSetupIntentPaymentMethodDataUsBankAccount {
1865    /// Account holder type: individual or company.
1866    #[serde(skip_serializing_if = "Option::is_none")]
1867    pub account_holder_type:
1868        Option<CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType>,
1869    /// Account number of the bank account.
1870    #[serde(skip_serializing_if = "Option::is_none")]
1871    pub account_number: Option<String>,
1872    /// Account type: checkings or savings. Defaults to checking if omitted.
1873    #[serde(skip_serializing_if = "Option::is_none")]
1874    pub account_type: Option<CreateSetupIntentPaymentMethodDataUsBankAccountAccountType>,
1875    /// The ID of a Financial Connections Account to use as a payment method.
1876    #[serde(skip_serializing_if = "Option::is_none")]
1877    pub financial_connections_account: Option<String>,
1878    /// Routing number of the bank account.
1879    #[serde(skip_serializing_if = "Option::is_none")]
1880    pub routing_number: Option<String>,
1881}
1882impl CreateSetupIntentPaymentMethodDataUsBankAccount {
1883    pub fn new() -> Self {
1884        Self {
1885            account_holder_type: None,
1886            account_number: None,
1887            account_type: None,
1888            financial_connections_account: None,
1889            routing_number: None,
1890        }
1891    }
1892}
1893impl Default for CreateSetupIntentPaymentMethodDataUsBankAccount {
1894    fn default() -> Self {
1895        Self::new()
1896    }
1897}
1898/// Account holder type: individual or company.
1899#[derive(Copy, Clone, Eq, PartialEq)]
1900pub enum CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
1901    Company,
1902    Individual,
1903}
1904impl CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
1905    pub fn as_str(self) -> &'static str {
1906        use CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
1907        match self {
1908            Company => "company",
1909            Individual => "individual",
1910        }
1911    }
1912}
1913
1914impl std::str::FromStr for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
1915    type Err = stripe_types::StripeParseError;
1916    fn from_str(s: &str) -> Result<Self, Self::Err> {
1917        use CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
1918        match s {
1919            "company" => Ok(Company),
1920            "individual" => Ok(Individual),
1921            _ => Err(stripe_types::StripeParseError),
1922        }
1923    }
1924}
1925impl std::fmt::Display for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
1926    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1927        f.write_str(self.as_str())
1928    }
1929}
1930
1931impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
1932    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1933        f.write_str(self.as_str())
1934    }
1935}
1936impl serde::Serialize for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
1937    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1938    where
1939        S: serde::Serializer,
1940    {
1941        serializer.serialize_str(self.as_str())
1942    }
1943}
1944#[cfg(feature = "deserialize")]
1945impl<'de> serde::Deserialize<'de>
1946    for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType
1947{
1948    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1949        use std::str::FromStr;
1950        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1951        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType"))
1952    }
1953}
1954/// Account type: checkings or savings. Defaults to checking if omitted.
1955#[derive(Copy, Clone, Eq, PartialEq)]
1956pub enum CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
1957    Checking,
1958    Savings,
1959}
1960impl CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
1961    pub fn as_str(self) -> &'static str {
1962        use CreateSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
1963        match self {
1964            Checking => "checking",
1965            Savings => "savings",
1966        }
1967    }
1968}
1969
1970impl std::str::FromStr for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
1971    type Err = stripe_types::StripeParseError;
1972    fn from_str(s: &str) -> Result<Self, Self::Err> {
1973        use CreateSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
1974        match s {
1975            "checking" => Ok(Checking),
1976            "savings" => Ok(Savings),
1977            _ => Err(stripe_types::StripeParseError),
1978        }
1979    }
1980}
1981impl std::fmt::Display for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
1982    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1983        f.write_str(self.as_str())
1984    }
1985}
1986
1987impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
1988    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1989        f.write_str(self.as_str())
1990    }
1991}
1992impl serde::Serialize for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
1993    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1994    where
1995        S: serde::Serializer,
1996    {
1997        serializer.serialize_str(self.as_str())
1998    }
1999}
2000#[cfg(feature = "deserialize")]
2001impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
2002    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2003        use std::str::FromStr;
2004        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2005        Self::from_str(&s).map_err(|_| {
2006            serde::de::Error::custom(
2007                "Unknown value for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType",
2008            )
2009        })
2010    }
2011}
2012/// Payment method-specific configuration for this SetupIntent.
2013#[derive(Clone, Debug, serde::Serialize)]
2014pub struct CreateSetupIntentPaymentMethodOptions {
2015    /// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options.
2016    #[serde(skip_serializing_if = "Option::is_none")]
2017    pub acss_debit: Option<CreateSetupIntentPaymentMethodOptionsAcssDebit>,
2018    /// If this is a `amazon_pay` SetupIntent, this sub-hash contains details about the AmazonPay payment method options.
2019    #[serde(skip_serializing_if = "Option::is_none")]
2020    #[serde(with = "stripe_types::with_serde_json_opt")]
2021    pub amazon_pay: Option<miniserde::json::Value>,
2022    /// If this is a `bacs_debit` SetupIntent, this sub-hash contains details about the Bacs Debit payment method options.
2023    #[serde(skip_serializing_if = "Option::is_none")]
2024    pub bacs_debit: Option<CreateSetupIntentPaymentMethodOptionsBacsDebit>,
2025    /// Configuration for any card setup attempted on this SetupIntent.
2026    #[serde(skip_serializing_if = "Option::is_none")]
2027    pub card: Option<CreateSetupIntentPaymentMethodOptionsCard>,
2028    /// If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options.
2029    #[serde(skip_serializing_if = "Option::is_none")]
2030    #[serde(with = "stripe_types::with_serde_json_opt")]
2031    pub card_present: Option<miniserde::json::Value>,
2032    /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options.
2033    #[serde(skip_serializing_if = "Option::is_none")]
2034    pub klarna: Option<CreateSetupIntentPaymentMethodOptionsKlarna>,
2035    /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
2036    #[serde(skip_serializing_if = "Option::is_none")]
2037    pub link: Option<SetupIntentPaymentMethodOptionsParam>,
2038    /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
2039    #[serde(skip_serializing_if = "Option::is_none")]
2040    pub paypal: Option<PaymentMethodOptionsParam>,
2041    /// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options.
2042    #[serde(skip_serializing_if = "Option::is_none")]
2043    pub sepa_debit: Option<CreateSetupIntentPaymentMethodOptionsSepaDebit>,
2044    /// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options.
2045    #[serde(skip_serializing_if = "Option::is_none")]
2046    pub us_bank_account: Option<CreateSetupIntentPaymentMethodOptionsUsBankAccount>,
2047}
2048impl CreateSetupIntentPaymentMethodOptions {
2049    pub fn new() -> Self {
2050        Self {
2051            acss_debit: None,
2052            amazon_pay: None,
2053            bacs_debit: None,
2054            card: None,
2055            card_present: None,
2056            klarna: None,
2057            link: None,
2058            paypal: None,
2059            sepa_debit: None,
2060            us_bank_account: None,
2061        }
2062    }
2063}
2064impl Default for CreateSetupIntentPaymentMethodOptions {
2065    fn default() -> Self {
2066        Self::new()
2067    }
2068}
2069/// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options.
2070#[derive(Clone, Debug, serde::Serialize)]
2071pub struct CreateSetupIntentPaymentMethodOptionsAcssDebit {
2072    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
2073    /// Must be a [supported currency](https://stripe.com/docs/currencies).
2074    #[serde(skip_serializing_if = "Option::is_none")]
2075    pub currency: Option<CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency>,
2076    /// Additional fields for Mandate creation
2077    #[serde(skip_serializing_if = "Option::is_none")]
2078    pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions>,
2079    /// Bank account verification method.
2080    #[serde(skip_serializing_if = "Option::is_none")]
2081    pub verification_method:
2082        Option<CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
2083}
2084impl CreateSetupIntentPaymentMethodOptionsAcssDebit {
2085    pub fn new() -> Self {
2086        Self { currency: None, mandate_options: None, verification_method: None }
2087    }
2088}
2089impl Default for CreateSetupIntentPaymentMethodOptionsAcssDebit {
2090    fn default() -> Self {
2091        Self::new()
2092    }
2093}
2094/// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
2095/// Must be a [supported currency](https://stripe.com/docs/currencies).
2096#[derive(Copy, Clone, Eq, PartialEq)]
2097pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2098    Cad,
2099    Usd,
2100}
2101impl CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2102    pub fn as_str(self) -> &'static str {
2103        use CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
2104        match self {
2105            Cad => "cad",
2106            Usd => "usd",
2107        }
2108    }
2109}
2110
2111impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2112    type Err = stripe_types::StripeParseError;
2113    fn from_str(s: &str) -> Result<Self, Self::Err> {
2114        use CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
2115        match s {
2116            "cad" => Ok(Cad),
2117            "usd" => Ok(Usd),
2118            _ => Err(stripe_types::StripeParseError),
2119        }
2120    }
2121}
2122impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2123    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2124        f.write_str(self.as_str())
2125    }
2126}
2127
2128impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2129    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2130        f.write_str(self.as_str())
2131    }
2132}
2133impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2134    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2135    where
2136        S: serde::Serializer,
2137    {
2138        serializer.serialize_str(self.as_str())
2139    }
2140}
2141#[cfg(feature = "deserialize")]
2142impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2143    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2144        use std::str::FromStr;
2145        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2146        Self::from_str(&s).map_err(|_| {
2147            serde::de::Error::custom(
2148                "Unknown value for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency",
2149            )
2150        })
2151    }
2152}
2153/// Additional fields for Mandate creation
2154#[derive(Clone, Debug, serde::Serialize)]
2155pub struct CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
2156    /// A URL for custom mandate text to render during confirmation step.
2157    /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,.
2158    /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent.
2159    #[serde(skip_serializing_if = "Option::is_none")]
2160    pub custom_mandate_url: Option<String>,
2161    /// List of Stripe products where this mandate can be selected automatically.
2162    #[serde(skip_serializing_if = "Option::is_none")]
2163    pub default_for:
2164        Option<Vec<CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor>>,
2165    /// Description of the mandate interval.
2166    /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'.
2167    #[serde(skip_serializing_if = "Option::is_none")]
2168    pub interval_description: Option<String>,
2169    /// Payment schedule for the mandate.
2170    #[serde(skip_serializing_if = "Option::is_none")]
2171    pub payment_schedule:
2172        Option<CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
2173    /// Transaction type of the mandate.
2174    #[serde(skip_serializing_if = "Option::is_none")]
2175    pub transaction_type:
2176        Option<CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
2177}
2178impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
2179    pub fn new() -> Self {
2180        Self {
2181            custom_mandate_url: None,
2182            default_for: None,
2183            interval_description: None,
2184            payment_schedule: None,
2185            transaction_type: None,
2186        }
2187    }
2188}
2189impl Default for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
2190    fn default() -> Self {
2191        Self::new()
2192    }
2193}
2194/// List of Stripe products where this mandate can be selected automatically.
2195#[derive(Copy, Clone, Eq, PartialEq)]
2196pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2197    Invoice,
2198    Subscription,
2199}
2200impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2201    pub fn as_str(self) -> &'static str {
2202        use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
2203        match self {
2204            Invoice => "invoice",
2205            Subscription => "subscription",
2206        }
2207    }
2208}
2209
2210impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2211    type Err = stripe_types::StripeParseError;
2212    fn from_str(s: &str) -> Result<Self, Self::Err> {
2213        use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
2214        match s {
2215            "invoice" => Ok(Invoice),
2216            "subscription" => Ok(Subscription),
2217            _ => Err(stripe_types::StripeParseError),
2218        }
2219    }
2220}
2221impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2222    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2223        f.write_str(self.as_str())
2224    }
2225}
2226
2227impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2228    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2229        f.write_str(self.as_str())
2230    }
2231}
2232impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2233    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2234    where
2235        S: serde::Serializer,
2236    {
2237        serializer.serialize_str(self.as_str())
2238    }
2239}
2240#[cfg(feature = "deserialize")]
2241impl<'de> serde::Deserialize<'de>
2242    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
2243{
2244    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2245        use std::str::FromStr;
2246        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2247        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor"))
2248    }
2249}
2250/// Payment schedule for the mandate.
2251#[derive(Copy, Clone, Eq, PartialEq)]
2252pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
2253    Combined,
2254    Interval,
2255    Sporadic,
2256}
2257impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
2258    pub fn as_str(self) -> &'static str {
2259        use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
2260        match self {
2261            Combined => "combined",
2262            Interval => "interval",
2263            Sporadic => "sporadic",
2264        }
2265    }
2266}
2267
2268impl std::str::FromStr
2269    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2270{
2271    type Err = stripe_types::StripeParseError;
2272    fn from_str(s: &str) -> Result<Self, Self::Err> {
2273        use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
2274        match s {
2275            "combined" => Ok(Combined),
2276            "interval" => Ok(Interval),
2277            "sporadic" => Ok(Sporadic),
2278            _ => Err(stripe_types::StripeParseError),
2279        }
2280    }
2281}
2282impl std::fmt::Display
2283    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2284{
2285    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2286        f.write_str(self.as_str())
2287    }
2288}
2289
2290impl std::fmt::Debug
2291    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2292{
2293    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2294        f.write_str(self.as_str())
2295    }
2296}
2297impl serde::Serialize
2298    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2299{
2300    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2301    where
2302        S: serde::Serializer,
2303    {
2304        serializer.serialize_str(self.as_str())
2305    }
2306}
2307#[cfg(feature = "deserialize")]
2308impl<'de> serde::Deserialize<'de>
2309    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2310{
2311    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2312        use std::str::FromStr;
2313        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2314        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"))
2315    }
2316}
2317/// Transaction type of the mandate.
2318#[derive(Copy, Clone, Eq, PartialEq)]
2319pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
2320    Business,
2321    Personal,
2322}
2323impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
2324    pub fn as_str(self) -> &'static str {
2325        use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
2326        match self {
2327            Business => "business",
2328            Personal => "personal",
2329        }
2330    }
2331}
2332
2333impl std::str::FromStr
2334    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2335{
2336    type Err = stripe_types::StripeParseError;
2337    fn from_str(s: &str) -> Result<Self, Self::Err> {
2338        use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
2339        match s {
2340            "business" => Ok(Business),
2341            "personal" => Ok(Personal),
2342            _ => Err(stripe_types::StripeParseError),
2343        }
2344    }
2345}
2346impl std::fmt::Display
2347    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2348{
2349    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2350        f.write_str(self.as_str())
2351    }
2352}
2353
2354impl std::fmt::Debug
2355    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2356{
2357    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2358        f.write_str(self.as_str())
2359    }
2360}
2361impl serde::Serialize
2362    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2363{
2364    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2365    where
2366        S: serde::Serializer,
2367    {
2368        serializer.serialize_str(self.as_str())
2369    }
2370}
2371#[cfg(feature = "deserialize")]
2372impl<'de> serde::Deserialize<'de>
2373    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2374{
2375    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2376        use std::str::FromStr;
2377        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2378        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"))
2379    }
2380}
2381/// Bank account verification method.
2382#[derive(Copy, Clone, Eq, PartialEq)]
2383pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2384    Automatic,
2385    Instant,
2386    Microdeposits,
2387}
2388impl CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2389    pub fn as_str(self) -> &'static str {
2390        use CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
2391        match self {
2392            Automatic => "automatic",
2393            Instant => "instant",
2394            Microdeposits => "microdeposits",
2395        }
2396    }
2397}
2398
2399impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2400    type Err = stripe_types::StripeParseError;
2401    fn from_str(s: &str) -> Result<Self, Self::Err> {
2402        use CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
2403        match s {
2404            "automatic" => Ok(Automatic),
2405            "instant" => Ok(Instant),
2406            "microdeposits" => Ok(Microdeposits),
2407            _ => Err(stripe_types::StripeParseError),
2408        }
2409    }
2410}
2411impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2412    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2413        f.write_str(self.as_str())
2414    }
2415}
2416
2417impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2418    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2419        f.write_str(self.as_str())
2420    }
2421}
2422impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2423    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2424    where
2425        S: serde::Serializer,
2426    {
2427        serializer.serialize_str(self.as_str())
2428    }
2429}
2430#[cfg(feature = "deserialize")]
2431impl<'de> serde::Deserialize<'de>
2432    for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod
2433{
2434    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2435        use std::str::FromStr;
2436        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2437        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod"))
2438    }
2439}
2440/// If this is a `bacs_debit` SetupIntent, this sub-hash contains details about the Bacs Debit payment method options.
2441#[derive(Clone, Debug, serde::Serialize)]
2442pub struct CreateSetupIntentPaymentMethodOptionsBacsDebit {
2443    /// Additional fields for Mandate creation
2444    #[serde(skip_serializing_if = "Option::is_none")]
2445    pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
2446}
2447impl CreateSetupIntentPaymentMethodOptionsBacsDebit {
2448    pub fn new() -> Self {
2449        Self { mandate_options: None }
2450    }
2451}
2452impl Default for CreateSetupIntentPaymentMethodOptionsBacsDebit {
2453    fn default() -> Self {
2454        Self::new()
2455    }
2456}
2457/// Configuration for any card setup attempted on this SetupIntent.
2458#[derive(Clone, Debug, serde::Serialize)]
2459pub struct CreateSetupIntentPaymentMethodOptionsCard {
2460    /// Configuration options for setting up an eMandate for cards issued in India.
2461    #[serde(skip_serializing_if = "Option::is_none")]
2462    pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsCardMandateOptions>,
2463    /// When specified, this parameter signals that a card has been collected
2464    /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This
2465    /// parameter can only be provided during confirmation.
2466    #[serde(skip_serializing_if = "Option::is_none")]
2467    pub moto: Option<bool>,
2468    /// Selected network to process this SetupIntent on.
2469    /// Depends on the available networks of the card attached to the SetupIntent.
2470    /// Can be only set confirm-time.
2471    #[serde(skip_serializing_if = "Option::is_none")]
2472    pub network: Option<CreateSetupIntentPaymentMethodOptionsCardNetwork>,
2473    /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication).
2474    /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
2475    /// If not provided, this value defaults to `automatic`.
2476    /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
2477    #[serde(skip_serializing_if = "Option::is_none")]
2478    pub request_three_d_secure:
2479        Option<CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure>,
2480    /// If 3D Secure authentication was performed with a third-party provider,
2481    /// the authentication details to use for this setup.
2482    #[serde(skip_serializing_if = "Option::is_none")]
2483    pub three_d_secure: Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecure>,
2484}
2485impl CreateSetupIntentPaymentMethodOptionsCard {
2486    pub fn new() -> Self {
2487        Self {
2488            mandate_options: None,
2489            moto: None,
2490            network: None,
2491            request_three_d_secure: None,
2492            three_d_secure: None,
2493        }
2494    }
2495}
2496impl Default for CreateSetupIntentPaymentMethodOptionsCard {
2497    fn default() -> Self {
2498        Self::new()
2499    }
2500}
2501/// Configuration options for setting up an eMandate for cards issued in India.
2502#[derive(Clone, Debug, serde::Serialize)]
2503pub struct CreateSetupIntentPaymentMethodOptionsCardMandateOptions {
2504    /// Amount to be charged for future payments.
2505    pub amount: i64,
2506    /// One of `fixed` or `maximum`.
2507    /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
2508    /// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
2509    pub amount_type: CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType,
2510    /// Currency in which future payments will be charged.
2511    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
2512    /// Must be a [supported currency](https://stripe.com/docs/currencies).
2513    pub currency: stripe_types::Currency,
2514    /// A description of the mandate or subscription that is meant to be displayed to the customer.
2515    #[serde(skip_serializing_if = "Option::is_none")]
2516    pub description: Option<String>,
2517    /// End date of the mandate or subscription.
2518    /// If not provided, the mandate will be active until canceled.
2519    /// If provided, end date should be after start date.
2520    #[serde(skip_serializing_if = "Option::is_none")]
2521    pub end_date: Option<stripe_types::Timestamp>,
2522    /// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
2523    pub interval: CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval,
2524    /// The number of intervals between payments.
2525    /// For example, `interval=month` and `interval_count=3` indicates one payment every three months.
2526    /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).
2527    /// This parameter is optional when `interval=sporadic`.
2528    #[serde(skip_serializing_if = "Option::is_none")]
2529    pub interval_count: Option<u64>,
2530    /// Unique identifier for the mandate or subscription.
2531    pub reference: String,
2532    /// Start date of the mandate or subscription. Start date should not be lesser than yesterday.
2533    pub start_date: stripe_types::Timestamp,
2534    /// Specifies the type of mandates supported. Possible values are `india`.
2535    #[serde(skip_serializing_if = "Option::is_none")]
2536    pub supported_types:
2537        Option<Vec<CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
2538}
2539impl CreateSetupIntentPaymentMethodOptionsCardMandateOptions {
2540    pub fn new(
2541        amount: impl Into<i64>,
2542        amount_type: impl Into<CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
2543        currency: impl Into<stripe_types::Currency>,
2544        interval: impl Into<CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval>,
2545        reference: impl Into<String>,
2546        start_date: impl Into<stripe_types::Timestamp>,
2547    ) -> Self {
2548        Self {
2549            amount: amount.into(),
2550            amount_type: amount_type.into(),
2551            currency: currency.into(),
2552            description: None,
2553            end_date: None,
2554            interval: interval.into(),
2555            interval_count: None,
2556            reference: reference.into(),
2557            start_date: start_date.into(),
2558            supported_types: None,
2559        }
2560    }
2561}
2562/// One of `fixed` or `maximum`.
2563/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
2564/// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
2565#[derive(Copy, Clone, Eq, PartialEq)]
2566pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
2567    Fixed,
2568    Maximum,
2569}
2570impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
2571    pub fn as_str(self) -> &'static str {
2572        use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
2573        match self {
2574            Fixed => "fixed",
2575            Maximum => "maximum",
2576        }
2577    }
2578}
2579
2580impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
2581    type Err = stripe_types::StripeParseError;
2582    fn from_str(s: &str) -> Result<Self, Self::Err> {
2583        use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
2584        match s {
2585            "fixed" => Ok(Fixed),
2586            "maximum" => Ok(Maximum),
2587            _ => Err(stripe_types::StripeParseError),
2588        }
2589    }
2590}
2591impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
2592    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2593        f.write_str(self.as_str())
2594    }
2595}
2596
2597impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
2598    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2599        f.write_str(self.as_str())
2600    }
2601}
2602impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
2603    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2604    where
2605        S: serde::Serializer,
2606    {
2607        serializer.serialize_str(self.as_str())
2608    }
2609}
2610#[cfg(feature = "deserialize")]
2611impl<'de> serde::Deserialize<'de>
2612    for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType
2613{
2614    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2615        use std::str::FromStr;
2616        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2617        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType"))
2618    }
2619}
2620/// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
2621#[derive(Copy, Clone, Eq, PartialEq)]
2622pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
2623    Day,
2624    Month,
2625    Sporadic,
2626    Week,
2627    Year,
2628}
2629impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
2630    pub fn as_str(self) -> &'static str {
2631        use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
2632        match self {
2633            Day => "day",
2634            Month => "month",
2635            Sporadic => "sporadic",
2636            Week => "week",
2637            Year => "year",
2638        }
2639    }
2640}
2641
2642impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
2643    type Err = stripe_types::StripeParseError;
2644    fn from_str(s: &str) -> Result<Self, Self::Err> {
2645        use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
2646        match s {
2647            "day" => Ok(Day),
2648            "month" => Ok(Month),
2649            "sporadic" => Ok(Sporadic),
2650            "week" => Ok(Week),
2651            "year" => Ok(Year),
2652            _ => Err(stripe_types::StripeParseError),
2653        }
2654    }
2655}
2656impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
2657    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2658        f.write_str(self.as_str())
2659    }
2660}
2661
2662impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
2663    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2664        f.write_str(self.as_str())
2665    }
2666}
2667impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
2668    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2669    where
2670        S: serde::Serializer,
2671    {
2672        serializer.serialize_str(self.as_str())
2673    }
2674}
2675#[cfg(feature = "deserialize")]
2676impl<'de> serde::Deserialize<'de>
2677    for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval
2678{
2679    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2680        use std::str::FromStr;
2681        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2682        Self::from_str(&s).map_err(|_| {
2683            serde::de::Error::custom(
2684                "Unknown value for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval",
2685            )
2686        })
2687    }
2688}
2689/// Specifies the type of mandates supported. Possible values are `india`.
2690#[derive(Copy, Clone, Eq, PartialEq)]
2691pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
2692    India,
2693}
2694impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
2695    pub fn as_str(self) -> &'static str {
2696        use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
2697        match self {
2698            India => "india",
2699        }
2700    }
2701}
2702
2703impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
2704    type Err = stripe_types::StripeParseError;
2705    fn from_str(s: &str) -> Result<Self, Self::Err> {
2706        use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
2707        match s {
2708            "india" => Ok(India),
2709            _ => Err(stripe_types::StripeParseError),
2710        }
2711    }
2712}
2713impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
2714    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2715        f.write_str(self.as_str())
2716    }
2717}
2718
2719impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
2720    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2721        f.write_str(self.as_str())
2722    }
2723}
2724impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
2725    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2726    where
2727        S: serde::Serializer,
2728    {
2729        serializer.serialize_str(self.as_str())
2730    }
2731}
2732#[cfg(feature = "deserialize")]
2733impl<'de> serde::Deserialize<'de>
2734    for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
2735{
2736    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2737        use std::str::FromStr;
2738        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2739        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"))
2740    }
2741}
2742/// Selected network to process this SetupIntent on.
2743/// Depends on the available networks of the card attached to the SetupIntent.
2744/// Can be only set confirm-time.
2745#[derive(Copy, Clone, Eq, PartialEq)]
2746pub enum CreateSetupIntentPaymentMethodOptionsCardNetwork {
2747    Amex,
2748    CartesBancaires,
2749    Diners,
2750    Discover,
2751    EftposAu,
2752    Girocard,
2753    Interac,
2754    Jcb,
2755    Link,
2756    Mastercard,
2757    Unionpay,
2758    Unknown,
2759    Visa,
2760}
2761impl CreateSetupIntentPaymentMethodOptionsCardNetwork {
2762    pub fn as_str(self) -> &'static str {
2763        use CreateSetupIntentPaymentMethodOptionsCardNetwork::*;
2764        match self {
2765            Amex => "amex",
2766            CartesBancaires => "cartes_bancaires",
2767            Diners => "diners",
2768            Discover => "discover",
2769            EftposAu => "eftpos_au",
2770            Girocard => "girocard",
2771            Interac => "interac",
2772            Jcb => "jcb",
2773            Link => "link",
2774            Mastercard => "mastercard",
2775            Unionpay => "unionpay",
2776            Unknown => "unknown",
2777            Visa => "visa",
2778        }
2779    }
2780}
2781
2782impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardNetwork {
2783    type Err = stripe_types::StripeParseError;
2784    fn from_str(s: &str) -> Result<Self, Self::Err> {
2785        use CreateSetupIntentPaymentMethodOptionsCardNetwork::*;
2786        match s {
2787            "amex" => Ok(Amex),
2788            "cartes_bancaires" => Ok(CartesBancaires),
2789            "diners" => Ok(Diners),
2790            "discover" => Ok(Discover),
2791            "eftpos_au" => Ok(EftposAu),
2792            "girocard" => Ok(Girocard),
2793            "interac" => Ok(Interac),
2794            "jcb" => Ok(Jcb),
2795            "link" => Ok(Link),
2796            "mastercard" => Ok(Mastercard),
2797            "unionpay" => Ok(Unionpay),
2798            "unknown" => Ok(Unknown),
2799            "visa" => Ok(Visa),
2800            _ => Err(stripe_types::StripeParseError),
2801        }
2802    }
2803}
2804impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardNetwork {
2805    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2806        f.write_str(self.as_str())
2807    }
2808}
2809
2810impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardNetwork {
2811    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2812        f.write_str(self.as_str())
2813    }
2814}
2815impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardNetwork {
2816    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2817    where
2818        S: serde::Serializer,
2819    {
2820        serializer.serialize_str(self.as_str())
2821    }
2822}
2823#[cfg(feature = "deserialize")]
2824impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsCardNetwork {
2825    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2826        use std::str::FromStr;
2827        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2828        Self::from_str(&s).map_err(|_| {
2829            serde::de::Error::custom(
2830                "Unknown value for CreateSetupIntentPaymentMethodOptionsCardNetwork",
2831            )
2832        })
2833    }
2834}
2835/// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication).
2836/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
2837/// If not provided, this value defaults to `automatic`.
2838/// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
2839#[derive(Copy, Clone, Eq, PartialEq)]
2840pub enum CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
2841    Any,
2842    Automatic,
2843    Challenge,
2844}
2845impl CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
2846    pub fn as_str(self) -> &'static str {
2847        use CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
2848        match self {
2849            Any => "any",
2850            Automatic => "automatic",
2851            Challenge => "challenge",
2852        }
2853    }
2854}
2855
2856impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
2857    type Err = stripe_types::StripeParseError;
2858    fn from_str(s: &str) -> Result<Self, Self::Err> {
2859        use CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
2860        match s {
2861            "any" => Ok(Any),
2862            "automatic" => Ok(Automatic),
2863            "challenge" => Ok(Challenge),
2864            _ => Err(stripe_types::StripeParseError),
2865        }
2866    }
2867}
2868impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
2869    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2870        f.write_str(self.as_str())
2871    }
2872}
2873
2874impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
2875    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2876        f.write_str(self.as_str())
2877    }
2878}
2879impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
2880    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2881    where
2882        S: serde::Serializer,
2883    {
2884        serializer.serialize_str(self.as_str())
2885    }
2886}
2887#[cfg(feature = "deserialize")]
2888impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
2889    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2890        use std::str::FromStr;
2891        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2892        Self::from_str(&s).map_err(|_| {
2893            serde::de::Error::custom(
2894                "Unknown value for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure",
2895            )
2896        })
2897    }
2898}
2899/// If 3D Secure authentication was performed with a third-party provider,
2900/// the authentication details to use for this setup.
2901#[derive(Clone, Debug, serde::Serialize)]
2902pub struct CreateSetupIntentPaymentMethodOptionsCardThreeDSecure {
2903    /// The `transStatus` returned from the card Issuer’s ACS in the ARes.
2904    #[serde(skip_serializing_if = "Option::is_none")]
2905    pub ares_trans_status:
2906        Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
2907    /// The cryptogram, also known as the "authentication value" (AAV, CAVV or
2908    /// AEVV). This value is 20 bytes, base64-encoded into a 28-character string.
2909    /// (Most 3D Secure providers will return the base64-encoded version, which
2910    /// is what you should specify here.)
2911    #[serde(skip_serializing_if = "Option::is_none")]
2912    pub cryptogram: Option<String>,
2913    /// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
2914    /// provider and indicates what degree of authentication was performed.
2915    #[serde(skip_serializing_if = "Option::is_none")]
2916    pub electronic_commerce_indicator:
2917        Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
2918    /// Network specific 3DS fields. Network specific arguments require an
2919    /// explicit card brand choice. The parameter `payment_method_options.card.network``
2920    /// must be populated accordingly
2921    #[serde(skip_serializing_if = "Option::is_none")]
2922    pub network_options:
2923        Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
2924    /// The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the
2925    /// AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99.
2926    #[serde(skip_serializing_if = "Option::is_none")]
2927    pub requestor_challenge_indicator: Option<String>,
2928    /// For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server
2929    /// Transaction ID (dsTransID).
2930    #[serde(skip_serializing_if = "Option::is_none")]
2931    pub transaction_id: Option<String>,
2932    /// The version of 3D Secure that was performed.
2933    #[serde(skip_serializing_if = "Option::is_none")]
2934    pub version: Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion>,
2935}
2936impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecure {
2937    pub fn new() -> Self {
2938        Self {
2939            ares_trans_status: None,
2940            cryptogram: None,
2941            electronic_commerce_indicator: None,
2942            network_options: None,
2943            requestor_challenge_indicator: None,
2944            transaction_id: None,
2945            version: None,
2946        }
2947    }
2948}
2949impl Default for CreateSetupIntentPaymentMethodOptionsCardThreeDSecure {
2950    fn default() -> Self {
2951        Self::new()
2952    }
2953}
2954/// The `transStatus` returned from the card Issuer’s ACS in the ARes.
2955#[derive(Copy, Clone, Eq, PartialEq)]
2956pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
2957    A,
2958    C,
2959    I,
2960    N,
2961    R,
2962    U,
2963    Y,
2964}
2965impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
2966    pub fn as_str(self) -> &'static str {
2967        use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
2968        match self {
2969            A => "A",
2970            C => "C",
2971            I => "I",
2972            N => "N",
2973            R => "R",
2974            U => "U",
2975            Y => "Y",
2976        }
2977    }
2978}
2979
2980impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
2981    type Err = stripe_types::StripeParseError;
2982    fn from_str(s: &str) -> Result<Self, Self::Err> {
2983        use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
2984        match s {
2985            "A" => Ok(A),
2986            "C" => Ok(C),
2987            "I" => Ok(I),
2988            "N" => Ok(N),
2989            "R" => Ok(R),
2990            "U" => Ok(U),
2991            "Y" => Ok(Y),
2992            _ => Err(stripe_types::StripeParseError),
2993        }
2994    }
2995}
2996impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
2997    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2998        f.write_str(self.as_str())
2999    }
3000}
3001
3002impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
3003    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3004        f.write_str(self.as_str())
3005    }
3006}
3007impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
3008    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3009    where
3010        S: serde::Serializer,
3011    {
3012        serializer.serialize_str(self.as_str())
3013    }
3014}
3015#[cfg(feature = "deserialize")]
3016impl<'de> serde::Deserialize<'de>
3017    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
3018{
3019    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3020        use std::str::FromStr;
3021        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3022        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"))
3023    }
3024}
3025/// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
3026/// provider and indicates what degree of authentication was performed.
3027#[derive(Copy, Clone, Eq, PartialEq)]
3028pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
3029    V01,
3030    V02,
3031    V05,
3032    V06,
3033    V07,
3034}
3035impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
3036    pub fn as_str(self) -> &'static str {
3037        use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
3038        match self {
3039            V01 => "01",
3040            V02 => "02",
3041            V05 => "05",
3042            V06 => "06",
3043            V07 => "07",
3044        }
3045    }
3046}
3047
3048impl std::str::FromStr
3049    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
3050{
3051    type Err = stripe_types::StripeParseError;
3052    fn from_str(s: &str) -> Result<Self, Self::Err> {
3053        use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
3054        match s {
3055            "01" => Ok(V01),
3056            "02" => Ok(V02),
3057            "05" => Ok(V05),
3058            "06" => Ok(V06),
3059            "07" => Ok(V07),
3060            _ => Err(stripe_types::StripeParseError),
3061        }
3062    }
3063}
3064impl std::fmt::Display
3065    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
3066{
3067    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3068        f.write_str(self.as_str())
3069    }
3070}
3071
3072impl std::fmt::Debug
3073    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
3074{
3075    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3076        f.write_str(self.as_str())
3077    }
3078}
3079impl serde::Serialize
3080    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
3081{
3082    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3083    where
3084        S: serde::Serializer,
3085    {
3086        serializer.serialize_str(self.as_str())
3087    }
3088}
3089#[cfg(feature = "deserialize")]
3090impl<'de> serde::Deserialize<'de>
3091    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
3092{
3093    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3094        use std::str::FromStr;
3095        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3096        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"))
3097    }
3098}
3099/// Network specific 3DS fields. Network specific arguments require an
3100/// explicit card brand choice. The parameter `payment_method_options.card.network``
3101/// must be populated accordingly
3102#[derive(Clone, Debug, serde::Serialize)]
3103pub struct CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
3104    /// Cartes Bancaires-specific 3DS fields.
3105    #[serde(skip_serializing_if = "Option::is_none")]
3106    pub cartes_bancaires:
3107        Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires>,
3108}
3109impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
3110    pub fn new() -> Self {
3111        Self { cartes_bancaires: None }
3112    }
3113}
3114impl Default for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
3115    fn default() -> Self {
3116        Self::new()
3117    }
3118}
3119/// Cartes Bancaires-specific 3DS fields.
3120#[derive(Clone, Debug, serde::Serialize)]
3121pub struct CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
3122    /// The cryptogram calculation algorithm used by the card Issuer's ACS
3123    /// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
3124    /// messageExtension: CB-AVALGO
3125    pub cb_avalgo:
3126        CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
3127    /// The exemption indicator returned from Cartes Bancaires in the ARes.
3128    /// message extension: CB-EXEMPTION; string (4 characters)
3129    /// This is a 3 byte bitmap (low significant byte first and most significant
3130    /// bit first) that has been Base64 encoded
3131    #[serde(skip_serializing_if = "Option::is_none")]
3132    pub cb_exemption: Option<String>,
3133    /// The risk score returned from Cartes Bancaires in the ARes.
3134    /// message extension: CB-SCORE; numeric value 0-99
3135    #[serde(skip_serializing_if = "Option::is_none")]
3136    pub cb_score: Option<i64>,
3137}
3138impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
3139    pub fn new(
3140        cb_avalgo: impl Into<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
3141    ) -> Self {
3142        Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
3143    }
3144}
3145/// The cryptogram calculation algorithm used by the card Issuer's ACS
3146/// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
3147/// messageExtension: CB-AVALGO
3148#[derive(Copy, Clone, Eq, PartialEq)]
3149pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
3150{
3151    V0,
3152    V1,
3153    V2,
3154    V3,
3155    V4,
3156    A,
3157}
3158impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
3159    pub fn as_str(self) -> &'static str {
3160        use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
3161        match self {
3162            V0 => "0",
3163            V1 => "1",
3164            V2 => "2",
3165            V3 => "3",
3166            V4 => "4",
3167            A => "A",
3168        }
3169    }
3170}
3171
3172impl std::str::FromStr
3173    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
3174{
3175    type Err = stripe_types::StripeParseError;
3176    fn from_str(s: &str) -> Result<Self, Self::Err> {
3177        use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
3178        match s {
3179            "0" => Ok(V0),
3180            "1" => Ok(V1),
3181            "2" => Ok(V2),
3182            "3" => Ok(V3),
3183            "4" => Ok(V4),
3184            "A" => Ok(A),
3185            _ => Err(stripe_types::StripeParseError),
3186        }
3187    }
3188}
3189impl std::fmt::Display
3190    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
3191{
3192    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3193        f.write_str(self.as_str())
3194    }
3195}
3196
3197impl std::fmt::Debug
3198    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
3199{
3200    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3201        f.write_str(self.as_str())
3202    }
3203}
3204impl serde::Serialize
3205    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
3206{
3207    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3208    where
3209        S: serde::Serializer,
3210    {
3211        serializer.serialize_str(self.as_str())
3212    }
3213}
3214#[cfg(feature = "deserialize")]
3215impl<'de> serde::Deserialize<'de>
3216    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
3217{
3218    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3219        use std::str::FromStr;
3220        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3221        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"))
3222    }
3223}
3224/// The version of 3D Secure that was performed.
3225#[derive(Copy, Clone, Eq, PartialEq)]
3226pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3227    V1_0_2,
3228    V2_1_0,
3229    V2_2_0,
3230}
3231impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3232    pub fn as_str(self) -> &'static str {
3233        use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
3234        match self {
3235            V1_0_2 => "1.0.2",
3236            V2_1_0 => "2.1.0",
3237            V2_2_0 => "2.2.0",
3238        }
3239    }
3240}
3241
3242impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3243    type Err = stripe_types::StripeParseError;
3244    fn from_str(s: &str) -> Result<Self, Self::Err> {
3245        use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
3246        match s {
3247            "1.0.2" => Ok(V1_0_2),
3248            "2.1.0" => Ok(V2_1_0),
3249            "2.2.0" => Ok(V2_2_0),
3250            _ => Err(stripe_types::StripeParseError),
3251        }
3252    }
3253}
3254impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3255    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3256        f.write_str(self.as_str())
3257    }
3258}
3259
3260impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3261    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3262        f.write_str(self.as_str())
3263    }
3264}
3265impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3266    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3267    where
3268        S: serde::Serializer,
3269    {
3270        serializer.serialize_str(self.as_str())
3271    }
3272}
3273#[cfg(feature = "deserialize")]
3274impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3275    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3276        use std::str::FromStr;
3277        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3278        Self::from_str(&s).map_err(|_| {
3279            serde::de::Error::custom(
3280                "Unknown value for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion",
3281            )
3282        })
3283    }
3284}
3285/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options.
3286#[derive(Clone, Debug, serde::Serialize)]
3287pub struct CreateSetupIntentPaymentMethodOptionsKlarna {
3288    /// The currency of the SetupIntent. Three letter ISO currency code.
3289    #[serde(skip_serializing_if = "Option::is_none")]
3290    pub currency: Option<stripe_types::Currency>,
3291    /// On-demand details if setting up a payment method for on-demand payments.
3292    #[serde(skip_serializing_if = "Option::is_none")]
3293    pub on_demand: Option<CreateSetupIntentPaymentMethodOptionsKlarnaOnDemand>,
3294    /// Preferred language of the Klarna authorization page that the customer is redirected to
3295    #[serde(skip_serializing_if = "Option::is_none")]
3296    pub preferred_locale: Option<CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale>,
3297    /// Subscription details if setting up or charging a subscription
3298    #[serde(skip_serializing_if = "Option::is_none")]
3299    pub subscriptions: Option<Vec<CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptions>>,
3300}
3301impl CreateSetupIntentPaymentMethodOptionsKlarna {
3302    pub fn new() -> Self {
3303        Self { currency: None, on_demand: None, preferred_locale: None, subscriptions: None }
3304    }
3305}
3306impl Default for CreateSetupIntentPaymentMethodOptionsKlarna {
3307    fn default() -> Self {
3308        Self::new()
3309    }
3310}
3311/// On-demand details if setting up a payment method for on-demand payments.
3312#[derive(Copy, Clone, Debug, serde::Serialize)]
3313pub struct CreateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
3314    /// Your average amount value.
3315    /// You can use a value across your customer base, or segment based on customer type, country, etc.
3316    #[serde(skip_serializing_if = "Option::is_none")]
3317    pub average_amount: Option<i64>,
3318    /// The maximum value you may charge a customer per purchase.
3319    /// You can use a value across your customer base, or segment based on customer type, country, etc.
3320    #[serde(skip_serializing_if = "Option::is_none")]
3321    pub maximum_amount: Option<i64>,
3322    /// The lowest or minimum value you may charge a customer per purchase.
3323    /// You can use a value across your customer base, or segment based on customer type, country, etc.
3324    #[serde(skip_serializing_if = "Option::is_none")]
3325    pub minimum_amount: Option<i64>,
3326    /// Interval at which the customer is making purchases
3327    #[serde(skip_serializing_if = "Option::is_none")]
3328    pub purchase_interval:
3329        Option<CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
3330    /// The number of `purchase_interval` between charges
3331    #[serde(skip_serializing_if = "Option::is_none")]
3332    pub purchase_interval_count: Option<u64>,
3333}
3334impl CreateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
3335    pub fn new() -> Self {
3336        Self {
3337            average_amount: None,
3338            maximum_amount: None,
3339            minimum_amount: None,
3340            purchase_interval: None,
3341            purchase_interval_count: None,
3342        }
3343    }
3344}
3345impl Default for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
3346    fn default() -> Self {
3347        Self::new()
3348    }
3349}
3350/// Interval at which the customer is making purchases
3351#[derive(Copy, Clone, Eq, PartialEq)]
3352pub enum CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
3353    Day,
3354    Month,
3355    Week,
3356    Year,
3357}
3358impl CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
3359    pub fn as_str(self) -> &'static str {
3360        use CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
3361        match self {
3362            Day => "day",
3363            Month => "month",
3364            Week => "week",
3365            Year => "year",
3366        }
3367    }
3368}
3369
3370impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
3371    type Err = stripe_types::StripeParseError;
3372    fn from_str(s: &str) -> Result<Self, Self::Err> {
3373        use CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
3374        match s {
3375            "day" => Ok(Day),
3376            "month" => Ok(Month),
3377            "week" => Ok(Week),
3378            "year" => Ok(Year),
3379            _ => Err(stripe_types::StripeParseError),
3380        }
3381    }
3382}
3383impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
3384    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3385        f.write_str(self.as_str())
3386    }
3387}
3388
3389impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
3390    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3391        f.write_str(self.as_str())
3392    }
3393}
3394impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
3395    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3396    where
3397        S: serde::Serializer,
3398    {
3399        serializer.serialize_str(self.as_str())
3400    }
3401}
3402#[cfg(feature = "deserialize")]
3403impl<'de> serde::Deserialize<'de>
3404    for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
3405{
3406    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3407        use std::str::FromStr;
3408        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3409        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"))
3410    }
3411}
3412/// Preferred language of the Klarna authorization page that the customer is redirected to
3413#[derive(Clone, Eq, PartialEq)]
3414#[non_exhaustive]
3415pub enum CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3416    CsMinusCz,
3417    DaMinusDk,
3418    DeMinusAt,
3419    DeMinusCh,
3420    DeMinusDe,
3421    ElMinusGr,
3422    EnMinusAt,
3423    EnMinusAu,
3424    EnMinusBe,
3425    EnMinusCa,
3426    EnMinusCh,
3427    EnMinusCz,
3428    EnMinusDe,
3429    EnMinusDk,
3430    EnMinusEs,
3431    EnMinusFi,
3432    EnMinusFr,
3433    EnMinusGb,
3434    EnMinusGr,
3435    EnMinusIe,
3436    EnMinusIt,
3437    EnMinusNl,
3438    EnMinusNo,
3439    EnMinusNz,
3440    EnMinusPl,
3441    EnMinusPt,
3442    EnMinusRo,
3443    EnMinusSe,
3444    EnMinusUs,
3445    EsMinusEs,
3446    EsMinusUs,
3447    FiMinusFi,
3448    FrMinusBe,
3449    FrMinusCa,
3450    FrMinusCh,
3451    FrMinusFr,
3452    ItMinusCh,
3453    ItMinusIt,
3454    NbMinusNo,
3455    NlMinusBe,
3456    NlMinusNl,
3457    PlMinusPl,
3458    PtMinusPt,
3459    RoMinusRo,
3460    SvMinusFi,
3461    SvMinusSe,
3462    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3463    Unknown(String),
3464}
3465impl CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3466    pub fn as_str(&self) -> &str {
3467        use CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
3468        match self {
3469            CsMinusCz => "cs-CZ",
3470            DaMinusDk => "da-DK",
3471            DeMinusAt => "de-AT",
3472            DeMinusCh => "de-CH",
3473            DeMinusDe => "de-DE",
3474            ElMinusGr => "el-GR",
3475            EnMinusAt => "en-AT",
3476            EnMinusAu => "en-AU",
3477            EnMinusBe => "en-BE",
3478            EnMinusCa => "en-CA",
3479            EnMinusCh => "en-CH",
3480            EnMinusCz => "en-CZ",
3481            EnMinusDe => "en-DE",
3482            EnMinusDk => "en-DK",
3483            EnMinusEs => "en-ES",
3484            EnMinusFi => "en-FI",
3485            EnMinusFr => "en-FR",
3486            EnMinusGb => "en-GB",
3487            EnMinusGr => "en-GR",
3488            EnMinusIe => "en-IE",
3489            EnMinusIt => "en-IT",
3490            EnMinusNl => "en-NL",
3491            EnMinusNo => "en-NO",
3492            EnMinusNz => "en-NZ",
3493            EnMinusPl => "en-PL",
3494            EnMinusPt => "en-PT",
3495            EnMinusRo => "en-RO",
3496            EnMinusSe => "en-SE",
3497            EnMinusUs => "en-US",
3498            EsMinusEs => "es-ES",
3499            EsMinusUs => "es-US",
3500            FiMinusFi => "fi-FI",
3501            FrMinusBe => "fr-BE",
3502            FrMinusCa => "fr-CA",
3503            FrMinusCh => "fr-CH",
3504            FrMinusFr => "fr-FR",
3505            ItMinusCh => "it-CH",
3506            ItMinusIt => "it-IT",
3507            NbMinusNo => "nb-NO",
3508            NlMinusBe => "nl-BE",
3509            NlMinusNl => "nl-NL",
3510            PlMinusPl => "pl-PL",
3511            PtMinusPt => "pt-PT",
3512            RoMinusRo => "ro-RO",
3513            SvMinusFi => "sv-FI",
3514            SvMinusSe => "sv-SE",
3515            Unknown(v) => v,
3516        }
3517    }
3518}
3519
3520impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3521    type Err = std::convert::Infallible;
3522    fn from_str(s: &str) -> Result<Self, Self::Err> {
3523        use CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
3524        match s {
3525            "cs-CZ" => Ok(CsMinusCz),
3526            "da-DK" => Ok(DaMinusDk),
3527            "de-AT" => Ok(DeMinusAt),
3528            "de-CH" => Ok(DeMinusCh),
3529            "de-DE" => Ok(DeMinusDe),
3530            "el-GR" => Ok(ElMinusGr),
3531            "en-AT" => Ok(EnMinusAt),
3532            "en-AU" => Ok(EnMinusAu),
3533            "en-BE" => Ok(EnMinusBe),
3534            "en-CA" => Ok(EnMinusCa),
3535            "en-CH" => Ok(EnMinusCh),
3536            "en-CZ" => Ok(EnMinusCz),
3537            "en-DE" => Ok(EnMinusDe),
3538            "en-DK" => Ok(EnMinusDk),
3539            "en-ES" => Ok(EnMinusEs),
3540            "en-FI" => Ok(EnMinusFi),
3541            "en-FR" => Ok(EnMinusFr),
3542            "en-GB" => Ok(EnMinusGb),
3543            "en-GR" => Ok(EnMinusGr),
3544            "en-IE" => Ok(EnMinusIe),
3545            "en-IT" => Ok(EnMinusIt),
3546            "en-NL" => Ok(EnMinusNl),
3547            "en-NO" => Ok(EnMinusNo),
3548            "en-NZ" => Ok(EnMinusNz),
3549            "en-PL" => Ok(EnMinusPl),
3550            "en-PT" => Ok(EnMinusPt),
3551            "en-RO" => Ok(EnMinusRo),
3552            "en-SE" => Ok(EnMinusSe),
3553            "en-US" => Ok(EnMinusUs),
3554            "es-ES" => Ok(EsMinusEs),
3555            "es-US" => Ok(EsMinusUs),
3556            "fi-FI" => Ok(FiMinusFi),
3557            "fr-BE" => Ok(FrMinusBe),
3558            "fr-CA" => Ok(FrMinusCa),
3559            "fr-CH" => Ok(FrMinusCh),
3560            "fr-FR" => Ok(FrMinusFr),
3561            "it-CH" => Ok(ItMinusCh),
3562            "it-IT" => Ok(ItMinusIt),
3563            "nb-NO" => Ok(NbMinusNo),
3564            "nl-BE" => Ok(NlMinusBe),
3565            "nl-NL" => Ok(NlMinusNl),
3566            "pl-PL" => Ok(PlMinusPl),
3567            "pt-PT" => Ok(PtMinusPt),
3568            "ro-RO" => Ok(RoMinusRo),
3569            "sv-FI" => Ok(SvMinusFi),
3570            "sv-SE" => Ok(SvMinusSe),
3571            v => Ok(Unknown(v.to_owned())),
3572        }
3573    }
3574}
3575impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3576    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3577        f.write_str(self.as_str())
3578    }
3579}
3580
3581impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3582    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3583        f.write_str(self.as_str())
3584    }
3585}
3586impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3587    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3588    where
3589        S: serde::Serializer,
3590    {
3591        serializer.serialize_str(self.as_str())
3592    }
3593}
3594#[cfg(feature = "deserialize")]
3595impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3596    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3597        use std::str::FromStr;
3598        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3599        Ok(Self::from_str(&s).unwrap())
3600    }
3601}
3602/// Subscription details if setting up or charging a subscription
3603#[derive(Clone, Debug, serde::Serialize)]
3604pub struct CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
3605    /// Unit of time between subscription charges.
3606    pub interval: CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
3607    /// The number of intervals (specified in the `interval` attribute) between subscription charges.
3608    /// For example, `interval=month` and `interval_count=3` charges every 3 months.
3609    #[serde(skip_serializing_if = "Option::is_none")]
3610    pub interval_count: Option<u64>,
3611    /// Name for subscription.
3612    #[serde(skip_serializing_if = "Option::is_none")]
3613    pub name: Option<String>,
3614    /// Describes the upcoming charge for this subscription.
3615    pub next_billing: SubscriptionNextBillingParam,
3616    /// A non-customer-facing reference to correlate subscription charges in the Klarna app.
3617    /// Use a value that persists across subscription charges.
3618    pub reference: String,
3619}
3620impl CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
3621    pub fn new(
3622        interval: impl Into<CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
3623        next_billing: impl Into<SubscriptionNextBillingParam>,
3624        reference: impl Into<String>,
3625    ) -> Self {
3626        Self {
3627            interval: interval.into(),
3628            interval_count: None,
3629            name: None,
3630            next_billing: next_billing.into(),
3631            reference: reference.into(),
3632        }
3633    }
3634}
3635/// Unit of time between subscription charges.
3636#[derive(Copy, Clone, Eq, PartialEq)]
3637pub enum CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
3638    Day,
3639    Month,
3640    Week,
3641    Year,
3642}
3643impl CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
3644    pub fn as_str(self) -> &'static str {
3645        use CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
3646        match self {
3647            Day => "day",
3648            Month => "month",
3649            Week => "week",
3650            Year => "year",
3651        }
3652    }
3653}
3654
3655impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
3656    type Err = stripe_types::StripeParseError;
3657    fn from_str(s: &str) -> Result<Self, Self::Err> {
3658        use CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
3659        match s {
3660            "day" => Ok(Day),
3661            "month" => Ok(Month),
3662            "week" => Ok(Week),
3663            "year" => Ok(Year),
3664            _ => Err(stripe_types::StripeParseError),
3665        }
3666    }
3667}
3668impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
3669    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3670        f.write_str(self.as_str())
3671    }
3672}
3673
3674impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
3675    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3676        f.write_str(self.as_str())
3677    }
3678}
3679impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
3680    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3681    where
3682        S: serde::Serializer,
3683    {
3684        serializer.serialize_str(self.as_str())
3685    }
3686}
3687#[cfg(feature = "deserialize")]
3688impl<'de> serde::Deserialize<'de>
3689    for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
3690{
3691    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3692        use std::str::FromStr;
3693        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3694        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"))
3695    }
3696}
3697/// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options.
3698#[derive(Clone, Debug, serde::Serialize)]
3699pub struct CreateSetupIntentPaymentMethodOptionsSepaDebit {
3700    /// Additional fields for Mandate creation
3701    #[serde(skip_serializing_if = "Option::is_none")]
3702    pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions>,
3703}
3704impl CreateSetupIntentPaymentMethodOptionsSepaDebit {
3705    pub fn new() -> Self {
3706        Self { mandate_options: None }
3707    }
3708}
3709impl Default for CreateSetupIntentPaymentMethodOptionsSepaDebit {
3710    fn default() -> Self {
3711        Self::new()
3712    }
3713}
3714/// Additional fields for Mandate creation
3715#[derive(Clone, Debug, serde::Serialize)]
3716pub struct CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
3717    /// Prefix used to generate the Mandate reference.
3718    /// Must be at most 12 characters long.
3719    /// Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'.
3720    /// Cannot begin with 'STRIPE'.
3721    #[serde(skip_serializing_if = "Option::is_none")]
3722    pub reference_prefix: Option<String>,
3723}
3724impl CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
3725    pub fn new() -> Self {
3726        Self { reference_prefix: None }
3727    }
3728}
3729impl Default for CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
3730    fn default() -> Self {
3731        Self::new()
3732    }
3733}
3734/// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options.
3735#[derive(Clone, Debug, serde::Serialize)]
3736pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccount {
3737    /// Additional fields for Financial Connections Session creation
3738    #[serde(skip_serializing_if = "Option::is_none")]
3739    pub financial_connections:
3740        Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
3741    /// Additional fields for Mandate creation
3742    #[serde(skip_serializing_if = "Option::is_none")]
3743    pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
3744    /// Additional fields for network related functions
3745    #[serde(skip_serializing_if = "Option::is_none")]
3746    pub networks: Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks>,
3747    /// Bank account verification method.
3748    #[serde(skip_serializing_if = "Option::is_none")]
3749    pub verification_method:
3750        Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
3751}
3752impl CreateSetupIntentPaymentMethodOptionsUsBankAccount {
3753    pub fn new() -> Self {
3754        Self {
3755            financial_connections: None,
3756            mandate_options: None,
3757            networks: None,
3758            verification_method: None,
3759        }
3760    }
3761}
3762impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccount {
3763    fn default() -> Self {
3764        Self::new()
3765    }
3766}
3767/// Additional fields for Financial Connections Session creation
3768#[derive(Clone, Debug, serde::Serialize)]
3769pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
3770    /// Provide filters for the linked accounts that the customer can select for the payment method.
3771    #[serde(skip_serializing_if = "Option::is_none")]
3772    pub filters:
3773        Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
3774    /// The list of permissions to request.
3775    /// If this parameter is passed, the `payment_method` permission must be included.
3776    /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
3777    #[serde(skip_serializing_if = "Option::is_none")]
3778    pub permissions: Option<
3779        Vec<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
3780    >,
3781    /// List of data features that you would like to retrieve upon account creation.
3782    #[serde(skip_serializing_if = "Option::is_none")]
3783    pub prefetch:
3784        Option<Vec<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>>,
3785    /// For webview integrations only.
3786    /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.
3787    #[serde(skip_serializing_if = "Option::is_none")]
3788    pub return_url: Option<String>,
3789}
3790impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
3791    pub fn new() -> Self {
3792        Self { filters: None, permissions: None, prefetch: None, return_url: None }
3793    }
3794}
3795impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
3796    fn default() -> Self {
3797        Self::new()
3798    }
3799}
3800/// Provide filters for the linked accounts that the customer can select for the payment method.
3801#[derive(Clone, Debug, serde::Serialize)]
3802pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
3803        /// The account subcategories to use to filter for selectable accounts.
3804    /// Valid subcategories are `checking` and `savings`.
3805#[serde(skip_serializing_if = "Option::is_none")]
3806pub account_subcategories: Option<Vec<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
3807
3808}
3809impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
3810    pub fn new() -> Self {
3811        Self { account_subcategories: None }
3812    }
3813}
3814impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
3815    fn default() -> Self {
3816        Self::new()
3817    }
3818}
3819/// The account subcategories to use to filter for selectable accounts.
3820/// Valid subcategories are `checking` and `savings`.
3821#[derive(Copy, Clone, Eq, PartialEq)]
3822pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
3823{
3824    Checking,
3825    Savings,
3826}
3827impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
3828    pub fn as_str(self) -> &'static str {
3829        use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
3830        match self {
3831Checking => "checking",
3832Savings => "savings",
3833
3834        }
3835    }
3836}
3837
3838impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
3839    type Err = stripe_types::StripeParseError;
3840    fn from_str(s: &str) -> Result<Self, Self::Err> {
3841        use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
3842        match s {
3843    "checking" => Ok(Checking),
3844"savings" => Ok(Savings),
3845_ => Err(stripe_types::StripeParseError)
3846
3847        }
3848    }
3849}
3850impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
3851    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3852        f.write_str(self.as_str())
3853    }
3854}
3855
3856impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
3857    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3858        f.write_str(self.as_str())
3859    }
3860}
3861impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
3862    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
3863        serializer.serialize_str(self.as_str())
3864    }
3865}
3866#[cfg(feature = "deserialize")]
3867impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
3868    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3869        use std::str::FromStr;
3870        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3871        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"))
3872    }
3873}
3874/// The list of permissions to request.
3875/// If this parameter is passed, the `payment_method` permission must be included.
3876/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
3877#[derive(Copy, Clone, Eq, PartialEq)]
3878pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
3879    Balances,
3880    Ownership,
3881    PaymentMethod,
3882    Transactions,
3883}
3884impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
3885    pub fn as_str(self) -> &'static str {
3886        use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
3887        match self {
3888            Balances => "balances",
3889            Ownership => "ownership",
3890            PaymentMethod => "payment_method",
3891            Transactions => "transactions",
3892        }
3893    }
3894}
3895
3896impl std::str::FromStr
3897    for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
3898{
3899    type Err = stripe_types::StripeParseError;
3900    fn from_str(s: &str) -> Result<Self, Self::Err> {
3901        use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
3902        match s {
3903            "balances" => Ok(Balances),
3904            "ownership" => Ok(Ownership),
3905            "payment_method" => Ok(PaymentMethod),
3906            "transactions" => Ok(Transactions),
3907            _ => Err(stripe_types::StripeParseError),
3908        }
3909    }
3910}
3911impl std::fmt::Display
3912    for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
3913{
3914    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3915        f.write_str(self.as_str())
3916    }
3917}
3918
3919impl std::fmt::Debug
3920    for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
3921{
3922    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3923        f.write_str(self.as_str())
3924    }
3925}
3926impl serde::Serialize
3927    for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
3928{
3929    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3930    where
3931        S: serde::Serializer,
3932    {
3933        serializer.serialize_str(self.as_str())
3934    }
3935}
3936#[cfg(feature = "deserialize")]
3937impl<'de> serde::Deserialize<'de>
3938    for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
3939{
3940    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3941        use std::str::FromStr;
3942        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3943        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"))
3944    }
3945}
3946/// List of data features that you would like to retrieve upon account creation.
3947#[derive(Copy, Clone, Eq, PartialEq)]
3948pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
3949    Balances,
3950    Ownership,
3951    Transactions,
3952}
3953impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
3954    pub fn as_str(self) -> &'static str {
3955        use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
3956        match self {
3957            Balances => "balances",
3958            Ownership => "ownership",
3959            Transactions => "transactions",
3960        }
3961    }
3962}
3963
3964impl std::str::FromStr
3965    for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
3966{
3967    type Err = stripe_types::StripeParseError;
3968    fn from_str(s: &str) -> Result<Self, Self::Err> {
3969        use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
3970        match s {
3971            "balances" => Ok(Balances),
3972            "ownership" => Ok(Ownership),
3973            "transactions" => Ok(Transactions),
3974            _ => Err(stripe_types::StripeParseError),
3975        }
3976    }
3977}
3978impl std::fmt::Display
3979    for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
3980{
3981    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3982        f.write_str(self.as_str())
3983    }
3984}
3985
3986impl std::fmt::Debug
3987    for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
3988{
3989    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3990        f.write_str(self.as_str())
3991    }
3992}
3993impl serde::Serialize
3994    for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
3995{
3996    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3997    where
3998        S: serde::Serializer,
3999    {
4000        serializer.serialize_str(self.as_str())
4001    }
4002}
4003#[cfg(feature = "deserialize")]
4004impl<'de> serde::Deserialize<'de>
4005    for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
4006{
4007    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4008        use std::str::FromStr;
4009        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4010        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"))
4011    }
4012}
4013/// Additional fields for Mandate creation
4014#[derive(Copy, Clone, Debug, serde::Serialize)]
4015pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
4016    /// The method used to collect offline mandate customer acceptance.
4017    #[serde(skip_serializing_if = "Option::is_none")]
4018    pub collection_method:
4019        Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
4020}
4021impl CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
4022    pub fn new() -> Self {
4023        Self { collection_method: None }
4024    }
4025}
4026impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
4027    fn default() -> Self {
4028        Self::new()
4029    }
4030}
4031/// The method used to collect offline mandate customer acceptance.
4032#[derive(Copy, Clone, Eq, PartialEq)]
4033pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
4034    Paper,
4035}
4036impl CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
4037    pub fn as_str(self) -> &'static str {
4038        use CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
4039        match self {
4040            Paper => "paper",
4041        }
4042    }
4043}
4044
4045impl std::str::FromStr
4046    for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
4047{
4048    type Err = stripe_types::StripeParseError;
4049    fn from_str(s: &str) -> Result<Self, Self::Err> {
4050        use CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
4051        match s {
4052            "paper" => Ok(Paper),
4053            _ => Err(stripe_types::StripeParseError),
4054        }
4055    }
4056}
4057impl std::fmt::Display
4058    for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
4059{
4060    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4061        f.write_str(self.as_str())
4062    }
4063}
4064
4065impl std::fmt::Debug
4066    for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
4067{
4068    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4069        f.write_str(self.as_str())
4070    }
4071}
4072impl serde::Serialize
4073    for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
4074{
4075    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4076    where
4077        S: serde::Serializer,
4078    {
4079        serializer.serialize_str(self.as_str())
4080    }
4081}
4082#[cfg(feature = "deserialize")]
4083impl<'de> serde::Deserialize<'de>
4084    for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
4085{
4086    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4087        use std::str::FromStr;
4088        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4089        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"))
4090    }
4091}
4092/// Additional fields for network related functions
4093#[derive(Clone, Debug, serde::Serialize)]
4094pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
4095    /// Triggers validations to run across the selected networks
4096    #[serde(skip_serializing_if = "Option::is_none")]
4097    pub requested: Option<Vec<CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
4098}
4099impl CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
4100    pub fn new() -> Self {
4101        Self { requested: None }
4102    }
4103}
4104impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
4105    fn default() -> Self {
4106        Self::new()
4107    }
4108}
4109/// Triggers validations to run across the selected networks
4110#[derive(Copy, Clone, Eq, PartialEq)]
4111pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
4112    Ach,
4113    UsDomesticWire,
4114}
4115impl CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
4116    pub fn as_str(self) -> &'static str {
4117        use CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
4118        match self {
4119            Ach => "ach",
4120            UsDomesticWire => "us_domestic_wire",
4121        }
4122    }
4123}
4124
4125impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
4126    type Err = stripe_types::StripeParseError;
4127    fn from_str(s: &str) -> Result<Self, Self::Err> {
4128        use CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
4129        match s {
4130            "ach" => Ok(Ach),
4131            "us_domestic_wire" => Ok(UsDomesticWire),
4132            _ => Err(stripe_types::StripeParseError),
4133        }
4134    }
4135}
4136impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
4137    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4138        f.write_str(self.as_str())
4139    }
4140}
4141
4142impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
4143    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4144        f.write_str(self.as_str())
4145    }
4146}
4147impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
4148    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4149    where
4150        S: serde::Serializer,
4151    {
4152        serializer.serialize_str(self.as_str())
4153    }
4154}
4155#[cfg(feature = "deserialize")]
4156impl<'de> serde::Deserialize<'de>
4157    for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested
4158{
4159    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4160        use std::str::FromStr;
4161        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4162        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested"))
4163    }
4164}
4165/// Bank account verification method.
4166#[derive(Copy, Clone, Eq, PartialEq)]
4167pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
4168    Automatic,
4169    Instant,
4170    Microdeposits,
4171}
4172impl CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
4173    pub fn as_str(self) -> &'static str {
4174        use CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
4175        match self {
4176            Automatic => "automatic",
4177            Instant => "instant",
4178            Microdeposits => "microdeposits",
4179        }
4180    }
4181}
4182
4183impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
4184    type Err = stripe_types::StripeParseError;
4185    fn from_str(s: &str) -> Result<Self, Self::Err> {
4186        use CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
4187        match s {
4188            "automatic" => Ok(Automatic),
4189            "instant" => Ok(Instant),
4190            "microdeposits" => Ok(Microdeposits),
4191            _ => Err(stripe_types::StripeParseError),
4192        }
4193    }
4194}
4195impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
4196    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4197        f.write_str(self.as_str())
4198    }
4199}
4200
4201impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
4202    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4203        f.write_str(self.as_str())
4204    }
4205}
4206impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
4207    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4208    where
4209        S: serde::Serializer,
4210    {
4211        serializer.serialize_str(self.as_str())
4212    }
4213}
4214#[cfg(feature = "deserialize")]
4215impl<'de> serde::Deserialize<'de>
4216    for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod
4217{
4218    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4219        use std::str::FromStr;
4220        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4221        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod"))
4222    }
4223}
4224/// If you populate this hash, this SetupIntent generates a `single_use` mandate after successful completion.
4225///
4226/// 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`.
4227#[derive(Clone, Debug, serde::Serialize)]
4228pub struct CreateSetupIntentSingleUse {
4229    /// Amount the customer is granting permission to collect later.
4230    /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency).
4231    /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts).
4232    /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
4233    pub amount: i64,
4234    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
4235    /// Must be a [supported currency](https://stripe.com/docs/currencies).
4236    pub currency: stripe_types::Currency,
4237}
4238impl CreateSetupIntentSingleUse {
4239    pub fn new(amount: impl Into<i64>, currency: impl Into<stripe_types::Currency>) -> Self {
4240        Self { amount: amount.into(), currency: currency.into() }
4241    }
4242}
4243/// Indicates how the payment method is intended to be used in the future.
4244/// If not provided, this value defaults to `off_session`.
4245#[derive(Copy, Clone, Eq, PartialEq)]
4246pub enum CreateSetupIntentUsage {
4247    OffSession,
4248    OnSession,
4249}
4250impl CreateSetupIntentUsage {
4251    pub fn as_str(self) -> &'static str {
4252        use CreateSetupIntentUsage::*;
4253        match self {
4254            OffSession => "off_session",
4255            OnSession => "on_session",
4256        }
4257    }
4258}
4259
4260impl std::str::FromStr for CreateSetupIntentUsage {
4261    type Err = stripe_types::StripeParseError;
4262    fn from_str(s: &str) -> Result<Self, Self::Err> {
4263        use CreateSetupIntentUsage::*;
4264        match s {
4265            "off_session" => Ok(OffSession),
4266            "on_session" => Ok(OnSession),
4267            _ => Err(stripe_types::StripeParseError),
4268        }
4269    }
4270}
4271impl std::fmt::Display for CreateSetupIntentUsage {
4272    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4273        f.write_str(self.as_str())
4274    }
4275}
4276
4277impl std::fmt::Debug for CreateSetupIntentUsage {
4278    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4279        f.write_str(self.as_str())
4280    }
4281}
4282impl serde::Serialize for CreateSetupIntentUsage {
4283    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4284    where
4285        S: serde::Serializer,
4286    {
4287        serializer.serialize_str(self.as_str())
4288    }
4289}
4290#[cfg(feature = "deserialize")]
4291impl<'de> serde::Deserialize<'de> for CreateSetupIntentUsage {
4292    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4293        use std::str::FromStr;
4294        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4295        Self::from_str(&s)
4296            .map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentUsage"))
4297    }
4298}
4299/// Creates a SetupIntent object.
4300///
4301/// After you create the SetupIntent, attach a payment method and [confirm](https://stripe.com/docs/api/setup_intents/confirm).
4302/// it to collect any required permissions to charge the payment method later.
4303#[derive(Clone, Debug, serde::Serialize)]
4304pub struct CreateSetupIntent {
4305    inner: CreateSetupIntentBuilder,
4306}
4307impl CreateSetupIntent {
4308    /// Construct a new `CreateSetupIntent`.
4309    pub fn new() -> Self {
4310        Self { inner: CreateSetupIntentBuilder::new() }
4311    }
4312    /// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.
4313    ///
4314    /// It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers.
4315    /// 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.
4316    pub fn attach_to_self(mut self, attach_to_self: impl Into<bool>) -> Self {
4317        self.inner.attach_to_self = Some(attach_to_self.into());
4318        self
4319    }
4320    /// When you enable this parameter, this SetupIntent accepts payment methods that you enable in the Dashboard and that are compatible with its other parameters.
4321    pub fn automatic_payment_methods(
4322        mut self,
4323        automatic_payment_methods: impl Into<CreateSetupIntentAutomaticPaymentMethods>,
4324    ) -> Self {
4325        self.inner.automatic_payment_methods = Some(automatic_payment_methods.into());
4326        self
4327    }
4328    /// Set to `true` to attempt to confirm this SetupIntent immediately.
4329    /// This parameter defaults to `false`.
4330    /// If a card is the attached payment method, you can provide a `return_url` in case further authentication is necessary.
4331    pub fn confirm(mut self, confirm: impl Into<bool>) -> Self {
4332        self.inner.confirm = Some(confirm.into());
4333        self
4334    }
4335    /// ID of the ConfirmationToken used to confirm this SetupIntent.
4336    ///
4337    /// 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.
4338    pub fn confirmation_token(mut self, confirmation_token: impl Into<String>) -> Self {
4339        self.inner.confirmation_token = Some(confirmation_token.into());
4340        self
4341    }
4342    /// ID of the Customer this SetupIntent belongs to, if one exists.
4343    ///
4344    /// If present, the SetupIntent's payment method will be attached to the Customer on successful setup.
4345    /// Payment methods attached to other Customers cannot be used with this SetupIntent.
4346    pub fn customer(mut self, customer: impl Into<String>) -> Self {
4347        self.inner.customer = Some(customer.into());
4348        self
4349    }
4350    /// An arbitrary string attached to the object. Often useful for displaying to users.
4351    pub fn description(mut self, description: impl Into<String>) -> Self {
4352        self.inner.description = Some(description.into());
4353        self
4354    }
4355    /// The list of payment method types to exclude from use with this SetupIntent.
4356    pub fn excluded_payment_method_types(
4357        mut self,
4358        excluded_payment_method_types: impl Into<
4359            Vec<stripe_shared::SetupIntentExcludedPaymentMethodTypes>,
4360        >,
4361    ) -> Self {
4362        self.inner.excluded_payment_method_types = Some(excluded_payment_method_types.into());
4363        self
4364    }
4365    /// Specifies which fields in the response should be expanded.
4366    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
4367        self.inner.expand = Some(expand.into());
4368        self
4369    }
4370    /// Indicates the directions of money movement for which this payment method is intended to be used.
4371    ///
4372    /// Include `inbound` if you intend to use the payment method as the origin to pull funds from.
4373    /// Include `outbound` if you intend to use the payment method as the destination to send funds to.
4374    /// You can include both if you intend to use the payment method for both purposes.
4375    pub fn flow_directions(
4376        mut self,
4377        flow_directions: impl Into<Vec<stripe_shared::SetupIntentFlowDirections>>,
4378    ) -> Self {
4379        self.inner.flow_directions = Some(flow_directions.into());
4380        self
4381    }
4382    /// This hash contains details about the mandate to create.
4383    /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm).
4384    pub fn mandate_data(mut self, mandate_data: impl Into<CreateSetupIntentMandateData>) -> Self {
4385        self.inner.mandate_data = Some(mandate_data.into());
4386        self
4387    }
4388    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
4389    /// This can be useful for storing additional information about the object in a structured format.
4390    /// Individual keys can be unset by posting an empty value to them.
4391    /// All keys can be unset by posting an empty value to `metadata`.
4392    pub fn metadata(
4393        mut self,
4394        metadata: impl Into<std::collections::HashMap<String, String>>,
4395    ) -> Self {
4396        self.inner.metadata = Some(metadata.into());
4397        self
4398    }
4399    /// The Stripe account ID created for this SetupIntent.
4400    pub fn on_behalf_of(mut self, on_behalf_of: impl Into<String>) -> Self {
4401        self.inner.on_behalf_of = Some(on_behalf_of.into());
4402        self
4403    }
4404    /// ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent.
4405    pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
4406        self.inner.payment_method = Some(payment_method.into());
4407        self
4408    }
4409    /// The ID of the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) to use with this SetupIntent.
4410    pub fn payment_method_configuration(
4411        mut self,
4412        payment_method_configuration: impl Into<String>,
4413    ) -> Self {
4414        self.inner.payment_method_configuration = Some(payment_method_configuration.into());
4415        self
4416    }
4417    /// When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method).
4418    /// value in the SetupIntent.
4419    pub fn payment_method_data(
4420        mut self,
4421        payment_method_data: impl Into<CreateSetupIntentPaymentMethodData>,
4422    ) -> Self {
4423        self.inner.payment_method_data = Some(payment_method_data.into());
4424        self
4425    }
4426    /// Payment method-specific configuration for this SetupIntent.
4427    pub fn payment_method_options(
4428        mut self,
4429        payment_method_options: impl Into<CreateSetupIntentPaymentMethodOptions>,
4430    ) -> Self {
4431        self.inner.payment_method_options = Some(payment_method_options.into());
4432        self
4433    }
4434    /// The list of payment method types (for example, card) that this SetupIntent can use.
4435    /// 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).
4436    /// A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type).
4437    pub fn payment_method_types(mut self, payment_method_types: impl Into<Vec<String>>) -> Self {
4438        self.inner.payment_method_types = Some(payment_method_types.into());
4439        self
4440    }
4441    /// The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site.
4442    /// To redirect to a mobile application, you can alternatively supply an application URI scheme.
4443    /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm).
4444    pub fn return_url(mut self, return_url: impl Into<String>) -> Self {
4445        self.inner.return_url = Some(return_url.into());
4446        self
4447    }
4448    /// If you populate this hash, this SetupIntent generates a `single_use` mandate after successful completion.
4449    ///
4450    /// 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`.
4451    pub fn single_use(mut self, single_use: impl Into<CreateSetupIntentSingleUse>) -> Self {
4452        self.inner.single_use = Some(single_use.into());
4453        self
4454    }
4455    /// Indicates how the payment method is intended to be used in the future.
4456    /// If not provided, this value defaults to `off_session`.
4457    pub fn usage(mut self, usage: impl Into<CreateSetupIntentUsage>) -> Self {
4458        self.inner.usage = Some(usage.into());
4459        self
4460    }
4461    /// Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions.
4462    pub fn use_stripe_sdk(mut self, use_stripe_sdk: impl Into<bool>) -> Self {
4463        self.inner.use_stripe_sdk = Some(use_stripe_sdk.into());
4464        self
4465    }
4466}
4467impl Default for CreateSetupIntent {
4468    fn default() -> Self {
4469        Self::new()
4470    }
4471}
4472impl CreateSetupIntent {
4473    /// Send the request and return the deserialized response.
4474    pub async fn send<C: StripeClient>(
4475        &self,
4476        client: &C,
4477    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
4478        self.customize().send(client).await
4479    }
4480
4481    /// Send the request and return the deserialized response, blocking until completion.
4482    pub fn send_blocking<C: StripeBlockingClient>(
4483        &self,
4484        client: &C,
4485    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
4486        self.customize().send_blocking(client)
4487    }
4488}
4489
4490impl StripeRequest for CreateSetupIntent {
4491    type Output = stripe_shared::SetupIntent;
4492
4493    fn build(&self) -> RequestBuilder {
4494        RequestBuilder::new(StripeMethod::Post, "/setup_intents").form(&self.inner)
4495    }
4496}
4497#[derive(Clone, Debug, serde::Serialize)]
4498struct UpdateSetupIntentBuilder {
4499    #[serde(skip_serializing_if = "Option::is_none")]
4500    attach_to_self: Option<bool>,
4501    #[serde(skip_serializing_if = "Option::is_none")]
4502    customer: Option<String>,
4503    #[serde(skip_serializing_if = "Option::is_none")]
4504    description: Option<String>,
4505    #[serde(skip_serializing_if = "Option::is_none")]
4506    excluded_payment_method_types:
4507        Option<Vec<stripe_shared::SetupIntentExcludedPaymentMethodTypes>>,
4508    #[serde(skip_serializing_if = "Option::is_none")]
4509    expand: Option<Vec<String>>,
4510    #[serde(skip_serializing_if = "Option::is_none")]
4511    flow_directions: Option<Vec<stripe_shared::SetupIntentFlowDirections>>,
4512    #[serde(skip_serializing_if = "Option::is_none")]
4513    metadata: Option<std::collections::HashMap<String, String>>,
4514    #[serde(skip_serializing_if = "Option::is_none")]
4515    payment_method: Option<String>,
4516    #[serde(skip_serializing_if = "Option::is_none")]
4517    payment_method_configuration: Option<String>,
4518    #[serde(skip_serializing_if = "Option::is_none")]
4519    payment_method_data: Option<UpdateSetupIntentPaymentMethodData>,
4520    #[serde(skip_serializing_if = "Option::is_none")]
4521    payment_method_options: Option<UpdateSetupIntentPaymentMethodOptions>,
4522    #[serde(skip_serializing_if = "Option::is_none")]
4523    payment_method_types: Option<Vec<String>>,
4524}
4525impl UpdateSetupIntentBuilder {
4526    fn new() -> Self {
4527        Self {
4528            attach_to_self: None,
4529            customer: None,
4530            description: None,
4531            excluded_payment_method_types: None,
4532            expand: None,
4533            flow_directions: None,
4534            metadata: None,
4535            payment_method: None,
4536            payment_method_configuration: None,
4537            payment_method_data: None,
4538            payment_method_options: None,
4539            payment_method_types: None,
4540        }
4541    }
4542}
4543/// When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method).
4544/// value in the SetupIntent.
4545#[derive(Clone, Debug, serde::Serialize)]
4546pub struct UpdateSetupIntentPaymentMethodData {
4547    /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
4548    #[serde(skip_serializing_if = "Option::is_none")]
4549    pub acss_debit: Option<PaymentMethodParam>,
4550    /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
4551    #[serde(skip_serializing_if = "Option::is_none")]
4552    #[serde(with = "stripe_types::with_serde_json_opt")]
4553    pub affirm: Option<miniserde::json::Value>,
4554    /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
4555    #[serde(skip_serializing_if = "Option::is_none")]
4556    #[serde(with = "stripe_types::with_serde_json_opt")]
4557    pub afterpay_clearpay: Option<miniserde::json::Value>,
4558    /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
4559    #[serde(skip_serializing_if = "Option::is_none")]
4560    #[serde(with = "stripe_types::with_serde_json_opt")]
4561    pub alipay: Option<miniserde::json::Value>,
4562    /// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
4563    /// 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.
4564    /// The field defaults to `unspecified`.
4565    #[serde(skip_serializing_if = "Option::is_none")]
4566    pub allow_redisplay: Option<UpdateSetupIntentPaymentMethodDataAllowRedisplay>,
4567    /// If this is a Alma PaymentMethod, this hash contains details about the Alma payment method.
4568    #[serde(skip_serializing_if = "Option::is_none")]
4569    #[serde(with = "stripe_types::with_serde_json_opt")]
4570    pub alma: Option<miniserde::json::Value>,
4571    /// If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method.
4572    #[serde(skip_serializing_if = "Option::is_none")]
4573    #[serde(with = "stripe_types::with_serde_json_opt")]
4574    pub amazon_pay: Option<miniserde::json::Value>,
4575    /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
4576    #[serde(skip_serializing_if = "Option::is_none")]
4577    pub au_becs_debit: Option<UpdateSetupIntentPaymentMethodDataAuBecsDebit>,
4578    /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
4579    #[serde(skip_serializing_if = "Option::is_none")]
4580    pub bacs_debit: Option<UpdateSetupIntentPaymentMethodDataBacsDebit>,
4581    /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
4582    #[serde(skip_serializing_if = "Option::is_none")]
4583    #[serde(with = "stripe_types::with_serde_json_opt")]
4584    pub bancontact: Option<miniserde::json::Value>,
4585    /// If this is a `billie` PaymentMethod, this hash contains details about the Billie payment method.
4586    #[serde(skip_serializing_if = "Option::is_none")]
4587    #[serde(with = "stripe_types::with_serde_json_opt")]
4588    pub billie: Option<miniserde::json::Value>,
4589    /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
4590    #[serde(skip_serializing_if = "Option::is_none")]
4591    pub billing_details: Option<BillingDetailsInnerParams>,
4592    /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
4593    #[serde(skip_serializing_if = "Option::is_none")]
4594    #[serde(with = "stripe_types::with_serde_json_opt")]
4595    pub blik: Option<miniserde::json::Value>,
4596    /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
4597    #[serde(skip_serializing_if = "Option::is_none")]
4598    pub boleto: Option<UpdateSetupIntentPaymentMethodDataBoleto>,
4599    /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
4600    #[serde(skip_serializing_if = "Option::is_none")]
4601    #[serde(with = "stripe_types::with_serde_json_opt")]
4602    pub cashapp: Option<miniserde::json::Value>,
4603    /// If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method.
4604    #[serde(skip_serializing_if = "Option::is_none")]
4605    #[serde(with = "stripe_types::with_serde_json_opt")]
4606    pub crypto: Option<miniserde::json::Value>,
4607    /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
4608    #[serde(skip_serializing_if = "Option::is_none")]
4609    #[serde(with = "stripe_types::with_serde_json_opt")]
4610    pub customer_balance: Option<miniserde::json::Value>,
4611    /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
4612    #[serde(skip_serializing_if = "Option::is_none")]
4613    pub eps: Option<UpdateSetupIntentPaymentMethodDataEps>,
4614    /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
4615    #[serde(skip_serializing_if = "Option::is_none")]
4616    pub fpx: Option<UpdateSetupIntentPaymentMethodDataFpx>,
4617    /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
4618    #[serde(skip_serializing_if = "Option::is_none")]
4619    #[serde(with = "stripe_types::with_serde_json_opt")]
4620    pub giropay: Option<miniserde::json::Value>,
4621    /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
4622    #[serde(skip_serializing_if = "Option::is_none")]
4623    #[serde(with = "stripe_types::with_serde_json_opt")]
4624    pub grabpay: Option<miniserde::json::Value>,
4625    /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
4626    #[serde(skip_serializing_if = "Option::is_none")]
4627    pub ideal: Option<UpdateSetupIntentPaymentMethodDataIdeal>,
4628    /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
4629    #[serde(skip_serializing_if = "Option::is_none")]
4630    #[serde(with = "stripe_types::with_serde_json_opt")]
4631    pub interac_present: Option<miniserde::json::Value>,
4632    /// If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method.
4633    #[serde(skip_serializing_if = "Option::is_none")]
4634    #[serde(with = "stripe_types::with_serde_json_opt")]
4635    pub kakao_pay: Option<miniserde::json::Value>,
4636    /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
4637    #[serde(skip_serializing_if = "Option::is_none")]
4638    pub klarna: Option<UpdateSetupIntentPaymentMethodDataKlarna>,
4639    /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
4640    #[serde(skip_serializing_if = "Option::is_none")]
4641    #[serde(with = "stripe_types::with_serde_json_opt")]
4642    pub konbini: Option<miniserde::json::Value>,
4643    /// If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method.
4644    #[serde(skip_serializing_if = "Option::is_none")]
4645    #[serde(with = "stripe_types::with_serde_json_opt")]
4646    pub kr_card: Option<miniserde::json::Value>,
4647    /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
4648    #[serde(skip_serializing_if = "Option::is_none")]
4649    #[serde(with = "stripe_types::with_serde_json_opt")]
4650    pub link: Option<miniserde::json::Value>,
4651    /// If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method.
4652    #[serde(skip_serializing_if = "Option::is_none")]
4653    #[serde(with = "stripe_types::with_serde_json_opt")]
4654    pub mb_way: Option<miniserde::json::Value>,
4655    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
4656    /// This can be useful for storing additional information about the object in a structured format.
4657    /// Individual keys can be unset by posting an empty value to them.
4658    /// All keys can be unset by posting an empty value to `metadata`.
4659    #[serde(skip_serializing_if = "Option::is_none")]
4660    pub metadata: Option<std::collections::HashMap<String, String>>,
4661    /// If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
4662    #[serde(skip_serializing_if = "Option::is_none")]
4663    #[serde(with = "stripe_types::with_serde_json_opt")]
4664    pub mobilepay: Option<miniserde::json::Value>,
4665    /// If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method.
4666    #[serde(skip_serializing_if = "Option::is_none")]
4667    #[serde(with = "stripe_types::with_serde_json_opt")]
4668    pub multibanco: Option<miniserde::json::Value>,
4669    /// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
4670    #[serde(skip_serializing_if = "Option::is_none")]
4671    pub naver_pay: Option<UpdateSetupIntentPaymentMethodDataNaverPay>,
4672    /// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
4673    #[serde(skip_serializing_if = "Option::is_none")]
4674    pub nz_bank_account: Option<UpdateSetupIntentPaymentMethodDataNzBankAccount>,
4675    /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
4676    #[serde(skip_serializing_if = "Option::is_none")]
4677    #[serde(with = "stripe_types::with_serde_json_opt")]
4678    pub oxxo: Option<miniserde::json::Value>,
4679    /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
4680    #[serde(skip_serializing_if = "Option::is_none")]
4681    pub p24: Option<UpdateSetupIntentPaymentMethodDataP24>,
4682    /// If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method.
4683    #[serde(skip_serializing_if = "Option::is_none")]
4684    #[serde(with = "stripe_types::with_serde_json_opt")]
4685    pub pay_by_bank: Option<miniserde::json::Value>,
4686    /// If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method.
4687    #[serde(skip_serializing_if = "Option::is_none")]
4688    #[serde(with = "stripe_types::with_serde_json_opt")]
4689    pub payco: Option<miniserde::json::Value>,
4690    /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
4691    #[serde(skip_serializing_if = "Option::is_none")]
4692    #[serde(with = "stripe_types::with_serde_json_opt")]
4693    pub paynow: Option<miniserde::json::Value>,
4694    /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
4695    #[serde(skip_serializing_if = "Option::is_none")]
4696    #[serde(with = "stripe_types::with_serde_json_opt")]
4697    pub paypal: Option<miniserde::json::Value>,
4698    /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
4699    #[serde(skip_serializing_if = "Option::is_none")]
4700    #[serde(with = "stripe_types::with_serde_json_opt")]
4701    pub pix: Option<miniserde::json::Value>,
4702    /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
4703    #[serde(skip_serializing_if = "Option::is_none")]
4704    #[serde(with = "stripe_types::with_serde_json_opt")]
4705    pub promptpay: Option<miniserde::json::Value>,
4706    /// Options to configure Radar.
4707    /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
4708    #[serde(skip_serializing_if = "Option::is_none")]
4709    pub radar_options: Option<RadarOptionsWithHiddenOptions>,
4710    /// If this is a `revolut_pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
4711    #[serde(skip_serializing_if = "Option::is_none")]
4712    #[serde(with = "stripe_types::with_serde_json_opt")]
4713    pub revolut_pay: Option<miniserde::json::Value>,
4714    /// If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method.
4715    #[serde(skip_serializing_if = "Option::is_none")]
4716    #[serde(with = "stripe_types::with_serde_json_opt")]
4717    pub samsung_pay: Option<miniserde::json::Value>,
4718    /// If this is a `satispay` PaymentMethod, this hash contains details about the Satispay payment method.
4719    #[serde(skip_serializing_if = "Option::is_none")]
4720    #[serde(with = "stripe_types::with_serde_json_opt")]
4721    pub satispay: Option<miniserde::json::Value>,
4722    /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
4723    #[serde(skip_serializing_if = "Option::is_none")]
4724    pub sepa_debit: Option<UpdateSetupIntentPaymentMethodDataSepaDebit>,
4725    /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
4726    #[serde(skip_serializing_if = "Option::is_none")]
4727    pub sofort: Option<UpdateSetupIntentPaymentMethodDataSofort>,
4728    /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
4729    #[serde(skip_serializing_if = "Option::is_none")]
4730    #[serde(with = "stripe_types::with_serde_json_opt")]
4731    pub swish: Option<miniserde::json::Value>,
4732    /// If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method.
4733    #[serde(skip_serializing_if = "Option::is_none")]
4734    #[serde(with = "stripe_types::with_serde_json_opt")]
4735    pub twint: Option<miniserde::json::Value>,
4736    /// The type of the PaymentMethod.
4737    /// An additional hash is included on the PaymentMethod with a name matching this value.
4738    /// It contains additional information specific to the PaymentMethod type.
4739    #[serde(rename = "type")]
4740    pub type_: UpdateSetupIntentPaymentMethodDataType,
4741    /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
4742    #[serde(skip_serializing_if = "Option::is_none")]
4743    pub us_bank_account: Option<UpdateSetupIntentPaymentMethodDataUsBankAccount>,
4744    /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
4745    #[serde(skip_serializing_if = "Option::is_none")]
4746    #[serde(with = "stripe_types::with_serde_json_opt")]
4747    pub wechat_pay: Option<miniserde::json::Value>,
4748    /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
4749    #[serde(skip_serializing_if = "Option::is_none")]
4750    #[serde(with = "stripe_types::with_serde_json_opt")]
4751    pub zip: Option<miniserde::json::Value>,
4752}
4753impl UpdateSetupIntentPaymentMethodData {
4754    pub fn new(type_: impl Into<UpdateSetupIntentPaymentMethodDataType>) -> Self {
4755        Self {
4756            acss_debit: None,
4757            affirm: None,
4758            afterpay_clearpay: None,
4759            alipay: None,
4760            allow_redisplay: None,
4761            alma: None,
4762            amazon_pay: None,
4763            au_becs_debit: None,
4764            bacs_debit: None,
4765            bancontact: None,
4766            billie: None,
4767            billing_details: None,
4768            blik: None,
4769            boleto: None,
4770            cashapp: None,
4771            crypto: None,
4772            customer_balance: None,
4773            eps: None,
4774            fpx: None,
4775            giropay: None,
4776            grabpay: None,
4777            ideal: None,
4778            interac_present: None,
4779            kakao_pay: None,
4780            klarna: None,
4781            konbini: None,
4782            kr_card: None,
4783            link: None,
4784            mb_way: None,
4785            metadata: None,
4786            mobilepay: None,
4787            multibanco: None,
4788            naver_pay: None,
4789            nz_bank_account: None,
4790            oxxo: None,
4791            p24: None,
4792            pay_by_bank: None,
4793            payco: None,
4794            paynow: None,
4795            paypal: None,
4796            pix: None,
4797            promptpay: None,
4798            radar_options: None,
4799            revolut_pay: None,
4800            samsung_pay: None,
4801            satispay: None,
4802            sepa_debit: None,
4803            sofort: None,
4804            swish: None,
4805            twint: None,
4806            type_: type_.into(),
4807            us_bank_account: None,
4808            wechat_pay: None,
4809            zip: None,
4810        }
4811    }
4812}
4813/// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
4814/// 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.
4815/// The field defaults to `unspecified`.
4816#[derive(Copy, Clone, Eq, PartialEq)]
4817pub enum UpdateSetupIntentPaymentMethodDataAllowRedisplay {
4818    Always,
4819    Limited,
4820    Unspecified,
4821}
4822impl UpdateSetupIntentPaymentMethodDataAllowRedisplay {
4823    pub fn as_str(self) -> &'static str {
4824        use UpdateSetupIntentPaymentMethodDataAllowRedisplay::*;
4825        match self {
4826            Always => "always",
4827            Limited => "limited",
4828            Unspecified => "unspecified",
4829        }
4830    }
4831}
4832
4833impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
4834    type Err = stripe_types::StripeParseError;
4835    fn from_str(s: &str) -> Result<Self, Self::Err> {
4836        use UpdateSetupIntentPaymentMethodDataAllowRedisplay::*;
4837        match s {
4838            "always" => Ok(Always),
4839            "limited" => Ok(Limited),
4840            "unspecified" => Ok(Unspecified),
4841            _ => Err(stripe_types::StripeParseError),
4842        }
4843    }
4844}
4845impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
4846    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4847        f.write_str(self.as_str())
4848    }
4849}
4850
4851impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
4852    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4853        f.write_str(self.as_str())
4854    }
4855}
4856impl serde::Serialize for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
4857    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4858    where
4859        S: serde::Serializer,
4860    {
4861        serializer.serialize_str(self.as_str())
4862    }
4863}
4864#[cfg(feature = "deserialize")]
4865impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
4866    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4867        use std::str::FromStr;
4868        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4869        Self::from_str(&s).map_err(|_| {
4870            serde::de::Error::custom(
4871                "Unknown value for UpdateSetupIntentPaymentMethodDataAllowRedisplay",
4872            )
4873        })
4874    }
4875}
4876/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
4877#[derive(Clone, Debug, serde::Serialize)]
4878pub struct UpdateSetupIntentPaymentMethodDataAuBecsDebit {
4879    /// The account number for the bank account.
4880    pub account_number: String,
4881    /// Bank-State-Branch number of the bank account.
4882    pub bsb_number: String,
4883}
4884impl UpdateSetupIntentPaymentMethodDataAuBecsDebit {
4885    pub fn new(account_number: impl Into<String>, bsb_number: impl Into<String>) -> Self {
4886        Self { account_number: account_number.into(), bsb_number: bsb_number.into() }
4887    }
4888}
4889/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
4890#[derive(Clone, Debug, serde::Serialize)]
4891pub struct UpdateSetupIntentPaymentMethodDataBacsDebit {
4892    /// Account number of the bank account that the funds will be debited from.
4893    #[serde(skip_serializing_if = "Option::is_none")]
4894    pub account_number: Option<String>,
4895    /// Sort code of the bank account. (e.g., `10-20-30`)
4896    #[serde(skip_serializing_if = "Option::is_none")]
4897    pub sort_code: Option<String>,
4898}
4899impl UpdateSetupIntentPaymentMethodDataBacsDebit {
4900    pub fn new() -> Self {
4901        Self { account_number: None, sort_code: None }
4902    }
4903}
4904impl Default for UpdateSetupIntentPaymentMethodDataBacsDebit {
4905    fn default() -> Self {
4906        Self::new()
4907    }
4908}
4909/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
4910#[derive(Clone, Debug, serde::Serialize)]
4911pub struct UpdateSetupIntentPaymentMethodDataBoleto {
4912    /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)
4913    pub tax_id: String,
4914}
4915impl UpdateSetupIntentPaymentMethodDataBoleto {
4916    pub fn new(tax_id: impl Into<String>) -> Self {
4917        Self { tax_id: tax_id.into() }
4918    }
4919}
4920/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
4921#[derive(Clone, Debug, serde::Serialize)]
4922pub struct UpdateSetupIntentPaymentMethodDataEps {
4923    /// The customer's bank.
4924    #[serde(skip_serializing_if = "Option::is_none")]
4925    pub bank: Option<UpdateSetupIntentPaymentMethodDataEpsBank>,
4926}
4927impl UpdateSetupIntentPaymentMethodDataEps {
4928    pub fn new() -> Self {
4929        Self { bank: None }
4930    }
4931}
4932impl Default for UpdateSetupIntentPaymentMethodDataEps {
4933    fn default() -> Self {
4934        Self::new()
4935    }
4936}
4937/// The customer's bank.
4938#[derive(Clone, Eq, PartialEq)]
4939#[non_exhaustive]
4940pub enum UpdateSetupIntentPaymentMethodDataEpsBank {
4941    ArzteUndApothekerBank,
4942    AustrianAnadiBankAg,
4943    BankAustria,
4944    BankhausCarlSpangler,
4945    BankhausSchelhammerUndSchatteraAg,
4946    BawagPskAg,
4947    BksBankAg,
4948    BrullKallmusBankAg,
4949    BtvVierLanderBank,
4950    CapitalBankGraweGruppeAg,
4951    DeutscheBankAg,
4952    Dolomitenbank,
4953    EasybankAg,
4954    ErsteBankUndSparkassen,
4955    HypoAlpeadriabankInternationalAg,
4956    HypoBankBurgenlandAktiengesellschaft,
4957    HypoNoeLbFurNiederosterreichUWien,
4958    HypoOberosterreichSalzburgSteiermark,
4959    HypoTirolBankAg,
4960    HypoVorarlbergBankAg,
4961    MarchfelderBank,
4962    OberbankAg,
4963    RaiffeisenBankengruppeOsterreich,
4964    SchoellerbankAg,
4965    SpardaBankWien,
4966    VolksbankGruppe,
4967    VolkskreditbankAg,
4968    VrBankBraunau,
4969    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4970    Unknown(String),
4971}
4972impl UpdateSetupIntentPaymentMethodDataEpsBank {
4973    pub fn as_str(&self) -> &str {
4974        use UpdateSetupIntentPaymentMethodDataEpsBank::*;
4975        match self {
4976            ArzteUndApothekerBank => "arzte_und_apotheker_bank",
4977            AustrianAnadiBankAg => "austrian_anadi_bank_ag",
4978            BankAustria => "bank_austria",
4979            BankhausCarlSpangler => "bankhaus_carl_spangler",
4980            BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag",
4981            BawagPskAg => "bawag_psk_ag",
4982            BksBankAg => "bks_bank_ag",
4983            BrullKallmusBankAg => "brull_kallmus_bank_ag",
4984            BtvVierLanderBank => "btv_vier_lander_bank",
4985            CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
4986            DeutscheBankAg => "deutsche_bank_ag",
4987            Dolomitenbank => "dolomitenbank",
4988            EasybankAg => "easybank_ag",
4989            ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
4990            HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag",
4991            HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft",
4992            HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien",
4993            HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark",
4994            HypoTirolBankAg => "hypo_tirol_bank_ag",
4995            HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
4996            MarchfelderBank => "marchfelder_bank",
4997            OberbankAg => "oberbank_ag",
4998            RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich",
4999            SchoellerbankAg => "schoellerbank_ag",
5000            SpardaBankWien => "sparda_bank_wien",
5001            VolksbankGruppe => "volksbank_gruppe",
5002            VolkskreditbankAg => "volkskreditbank_ag",
5003            VrBankBraunau => "vr_bank_braunau",
5004            Unknown(v) => v,
5005        }
5006    }
5007}
5008
5009impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataEpsBank {
5010    type Err = std::convert::Infallible;
5011    fn from_str(s: &str) -> Result<Self, Self::Err> {
5012        use UpdateSetupIntentPaymentMethodDataEpsBank::*;
5013        match s {
5014            "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank),
5015            "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg),
5016            "bank_austria" => Ok(BankAustria),
5017            "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler),
5018            "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg),
5019            "bawag_psk_ag" => Ok(BawagPskAg),
5020            "bks_bank_ag" => Ok(BksBankAg),
5021            "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg),
5022            "btv_vier_lander_bank" => Ok(BtvVierLanderBank),
5023            "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg),
5024            "deutsche_bank_ag" => Ok(DeutscheBankAg),
5025            "dolomitenbank" => Ok(Dolomitenbank),
5026            "easybank_ag" => Ok(EasybankAg),
5027            "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen),
5028            "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg),
5029            "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft),
5030            "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien),
5031            "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark),
5032            "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg),
5033            "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg),
5034            "marchfelder_bank" => Ok(MarchfelderBank),
5035            "oberbank_ag" => Ok(OberbankAg),
5036            "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich),
5037            "schoellerbank_ag" => Ok(SchoellerbankAg),
5038            "sparda_bank_wien" => Ok(SpardaBankWien),
5039            "volksbank_gruppe" => Ok(VolksbankGruppe),
5040            "volkskreditbank_ag" => Ok(VolkskreditbankAg),
5041            "vr_bank_braunau" => Ok(VrBankBraunau),
5042            v => Ok(Unknown(v.to_owned())),
5043        }
5044    }
5045}
5046impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataEpsBank {
5047    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5048        f.write_str(self.as_str())
5049    }
5050}
5051
5052impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataEpsBank {
5053    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5054        f.write_str(self.as_str())
5055    }
5056}
5057impl serde::Serialize for UpdateSetupIntentPaymentMethodDataEpsBank {
5058    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5059    where
5060        S: serde::Serializer,
5061    {
5062        serializer.serialize_str(self.as_str())
5063    }
5064}
5065#[cfg(feature = "deserialize")]
5066impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataEpsBank {
5067    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5068        use std::str::FromStr;
5069        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5070        Ok(Self::from_str(&s).unwrap())
5071    }
5072}
5073/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
5074#[derive(Clone, Debug, serde::Serialize)]
5075pub struct UpdateSetupIntentPaymentMethodDataFpx {
5076    /// Account holder type for FPX transaction
5077    #[serde(skip_serializing_if = "Option::is_none")]
5078    pub account_holder_type: Option<UpdateSetupIntentPaymentMethodDataFpxAccountHolderType>,
5079    /// The customer's bank.
5080    pub bank: UpdateSetupIntentPaymentMethodDataFpxBank,
5081}
5082impl UpdateSetupIntentPaymentMethodDataFpx {
5083    pub fn new(bank: impl Into<UpdateSetupIntentPaymentMethodDataFpxBank>) -> Self {
5084        Self { account_holder_type: None, bank: bank.into() }
5085    }
5086}
5087/// Account holder type for FPX transaction
5088#[derive(Copy, Clone, Eq, PartialEq)]
5089pub enum UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5090    Company,
5091    Individual,
5092}
5093impl UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5094    pub fn as_str(self) -> &'static str {
5095        use UpdateSetupIntentPaymentMethodDataFpxAccountHolderType::*;
5096        match self {
5097            Company => "company",
5098            Individual => "individual",
5099        }
5100    }
5101}
5102
5103impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5104    type Err = stripe_types::StripeParseError;
5105    fn from_str(s: &str) -> Result<Self, Self::Err> {
5106        use UpdateSetupIntentPaymentMethodDataFpxAccountHolderType::*;
5107        match s {
5108            "company" => Ok(Company),
5109            "individual" => Ok(Individual),
5110            _ => Err(stripe_types::StripeParseError),
5111        }
5112    }
5113}
5114impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5115    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5116        f.write_str(self.as_str())
5117    }
5118}
5119
5120impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5121    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5122        f.write_str(self.as_str())
5123    }
5124}
5125impl serde::Serialize for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5126    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5127    where
5128        S: serde::Serializer,
5129    {
5130        serializer.serialize_str(self.as_str())
5131    }
5132}
5133#[cfg(feature = "deserialize")]
5134impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5135    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5136        use std::str::FromStr;
5137        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5138        Self::from_str(&s).map_err(|_| {
5139            serde::de::Error::custom(
5140                "Unknown value for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType",
5141            )
5142        })
5143    }
5144}
5145/// The customer's bank.
5146#[derive(Clone, Eq, PartialEq)]
5147#[non_exhaustive]
5148pub enum UpdateSetupIntentPaymentMethodDataFpxBank {
5149    AffinBank,
5150    Agrobank,
5151    AllianceBank,
5152    Ambank,
5153    BankIslam,
5154    BankMuamalat,
5155    BankOfChina,
5156    BankRakyat,
5157    Bsn,
5158    Cimb,
5159    DeutscheBank,
5160    HongLeongBank,
5161    Hsbc,
5162    Kfh,
5163    Maybank2e,
5164    Maybank2u,
5165    Ocbc,
5166    PbEnterprise,
5167    PublicBank,
5168    Rhb,
5169    StandardChartered,
5170    Uob,
5171    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5172    Unknown(String),
5173}
5174impl UpdateSetupIntentPaymentMethodDataFpxBank {
5175    pub fn as_str(&self) -> &str {
5176        use UpdateSetupIntentPaymentMethodDataFpxBank::*;
5177        match self {
5178            AffinBank => "affin_bank",
5179            Agrobank => "agrobank",
5180            AllianceBank => "alliance_bank",
5181            Ambank => "ambank",
5182            BankIslam => "bank_islam",
5183            BankMuamalat => "bank_muamalat",
5184            BankOfChina => "bank_of_china",
5185            BankRakyat => "bank_rakyat",
5186            Bsn => "bsn",
5187            Cimb => "cimb",
5188            DeutscheBank => "deutsche_bank",
5189            HongLeongBank => "hong_leong_bank",
5190            Hsbc => "hsbc",
5191            Kfh => "kfh",
5192            Maybank2e => "maybank2e",
5193            Maybank2u => "maybank2u",
5194            Ocbc => "ocbc",
5195            PbEnterprise => "pb_enterprise",
5196            PublicBank => "public_bank",
5197            Rhb => "rhb",
5198            StandardChartered => "standard_chartered",
5199            Uob => "uob",
5200            Unknown(v) => v,
5201        }
5202    }
5203}
5204
5205impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataFpxBank {
5206    type Err = std::convert::Infallible;
5207    fn from_str(s: &str) -> Result<Self, Self::Err> {
5208        use UpdateSetupIntentPaymentMethodDataFpxBank::*;
5209        match s {
5210            "affin_bank" => Ok(AffinBank),
5211            "agrobank" => Ok(Agrobank),
5212            "alliance_bank" => Ok(AllianceBank),
5213            "ambank" => Ok(Ambank),
5214            "bank_islam" => Ok(BankIslam),
5215            "bank_muamalat" => Ok(BankMuamalat),
5216            "bank_of_china" => Ok(BankOfChina),
5217            "bank_rakyat" => Ok(BankRakyat),
5218            "bsn" => Ok(Bsn),
5219            "cimb" => Ok(Cimb),
5220            "deutsche_bank" => Ok(DeutscheBank),
5221            "hong_leong_bank" => Ok(HongLeongBank),
5222            "hsbc" => Ok(Hsbc),
5223            "kfh" => Ok(Kfh),
5224            "maybank2e" => Ok(Maybank2e),
5225            "maybank2u" => Ok(Maybank2u),
5226            "ocbc" => Ok(Ocbc),
5227            "pb_enterprise" => Ok(PbEnterprise),
5228            "public_bank" => Ok(PublicBank),
5229            "rhb" => Ok(Rhb),
5230            "standard_chartered" => Ok(StandardChartered),
5231            "uob" => Ok(Uob),
5232            v => Ok(Unknown(v.to_owned())),
5233        }
5234    }
5235}
5236impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataFpxBank {
5237    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5238        f.write_str(self.as_str())
5239    }
5240}
5241
5242impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataFpxBank {
5243    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5244        f.write_str(self.as_str())
5245    }
5246}
5247impl serde::Serialize for UpdateSetupIntentPaymentMethodDataFpxBank {
5248    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5249    where
5250        S: serde::Serializer,
5251    {
5252        serializer.serialize_str(self.as_str())
5253    }
5254}
5255#[cfg(feature = "deserialize")]
5256impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataFpxBank {
5257    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5258        use std::str::FromStr;
5259        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5260        Ok(Self::from_str(&s).unwrap())
5261    }
5262}
5263/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
5264#[derive(Clone, Debug, serde::Serialize)]
5265pub struct UpdateSetupIntentPaymentMethodDataIdeal {
5266    /// The customer's bank.
5267    /// Only use this parameter for existing customers.
5268    /// Don't use it for new customers.
5269    #[serde(skip_serializing_if = "Option::is_none")]
5270    pub bank: Option<UpdateSetupIntentPaymentMethodDataIdealBank>,
5271}
5272impl UpdateSetupIntentPaymentMethodDataIdeal {
5273    pub fn new() -> Self {
5274        Self { bank: None }
5275    }
5276}
5277impl Default for UpdateSetupIntentPaymentMethodDataIdeal {
5278    fn default() -> Self {
5279        Self::new()
5280    }
5281}
5282/// The customer's bank.
5283/// Only use this parameter for existing customers.
5284/// Don't use it for new customers.
5285#[derive(Clone, Eq, PartialEq)]
5286#[non_exhaustive]
5287pub enum UpdateSetupIntentPaymentMethodDataIdealBank {
5288    AbnAmro,
5289    AsnBank,
5290    Bunq,
5291    Buut,
5292    Finom,
5293    Handelsbanken,
5294    Ing,
5295    Knab,
5296    Moneyou,
5297    N26,
5298    Nn,
5299    Rabobank,
5300    Regiobank,
5301    Revolut,
5302    SnsBank,
5303    TriodosBank,
5304    VanLanschot,
5305    Yoursafe,
5306    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5307    Unknown(String),
5308}
5309impl UpdateSetupIntentPaymentMethodDataIdealBank {
5310    pub fn as_str(&self) -> &str {
5311        use UpdateSetupIntentPaymentMethodDataIdealBank::*;
5312        match self {
5313            AbnAmro => "abn_amro",
5314            AsnBank => "asn_bank",
5315            Bunq => "bunq",
5316            Buut => "buut",
5317            Finom => "finom",
5318            Handelsbanken => "handelsbanken",
5319            Ing => "ing",
5320            Knab => "knab",
5321            Moneyou => "moneyou",
5322            N26 => "n26",
5323            Nn => "nn",
5324            Rabobank => "rabobank",
5325            Regiobank => "regiobank",
5326            Revolut => "revolut",
5327            SnsBank => "sns_bank",
5328            TriodosBank => "triodos_bank",
5329            VanLanschot => "van_lanschot",
5330            Yoursafe => "yoursafe",
5331            Unknown(v) => v,
5332        }
5333    }
5334}
5335
5336impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataIdealBank {
5337    type Err = std::convert::Infallible;
5338    fn from_str(s: &str) -> Result<Self, Self::Err> {
5339        use UpdateSetupIntentPaymentMethodDataIdealBank::*;
5340        match s {
5341            "abn_amro" => Ok(AbnAmro),
5342            "asn_bank" => Ok(AsnBank),
5343            "bunq" => Ok(Bunq),
5344            "buut" => Ok(Buut),
5345            "finom" => Ok(Finom),
5346            "handelsbanken" => Ok(Handelsbanken),
5347            "ing" => Ok(Ing),
5348            "knab" => Ok(Knab),
5349            "moneyou" => Ok(Moneyou),
5350            "n26" => Ok(N26),
5351            "nn" => Ok(Nn),
5352            "rabobank" => Ok(Rabobank),
5353            "regiobank" => Ok(Regiobank),
5354            "revolut" => Ok(Revolut),
5355            "sns_bank" => Ok(SnsBank),
5356            "triodos_bank" => Ok(TriodosBank),
5357            "van_lanschot" => Ok(VanLanschot),
5358            "yoursafe" => Ok(Yoursafe),
5359            v => Ok(Unknown(v.to_owned())),
5360        }
5361    }
5362}
5363impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataIdealBank {
5364    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5365        f.write_str(self.as_str())
5366    }
5367}
5368
5369impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataIdealBank {
5370    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5371        f.write_str(self.as_str())
5372    }
5373}
5374impl serde::Serialize for UpdateSetupIntentPaymentMethodDataIdealBank {
5375    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5376    where
5377        S: serde::Serializer,
5378    {
5379        serializer.serialize_str(self.as_str())
5380    }
5381}
5382#[cfg(feature = "deserialize")]
5383impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataIdealBank {
5384    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5385        use std::str::FromStr;
5386        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5387        Ok(Self::from_str(&s).unwrap())
5388    }
5389}
5390/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
5391#[derive(Copy, Clone, Debug, serde::Serialize)]
5392pub struct UpdateSetupIntentPaymentMethodDataKlarna {
5393    /// Customer's date of birth
5394    #[serde(skip_serializing_if = "Option::is_none")]
5395    pub dob: Option<DateOfBirth>,
5396}
5397impl UpdateSetupIntentPaymentMethodDataKlarna {
5398    pub fn new() -> Self {
5399        Self { dob: None }
5400    }
5401}
5402impl Default for UpdateSetupIntentPaymentMethodDataKlarna {
5403    fn default() -> Self {
5404        Self::new()
5405    }
5406}
5407/// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
5408#[derive(Copy, Clone, Debug, serde::Serialize)]
5409pub struct UpdateSetupIntentPaymentMethodDataNaverPay {
5410    /// Whether to use Naver Pay points or a card to fund this transaction.
5411    /// If not provided, this defaults to `card`.
5412    #[serde(skip_serializing_if = "Option::is_none")]
5413    pub funding: Option<UpdateSetupIntentPaymentMethodDataNaverPayFunding>,
5414}
5415impl UpdateSetupIntentPaymentMethodDataNaverPay {
5416    pub fn new() -> Self {
5417        Self { funding: None }
5418    }
5419}
5420impl Default for UpdateSetupIntentPaymentMethodDataNaverPay {
5421    fn default() -> Self {
5422        Self::new()
5423    }
5424}
5425/// Whether to use Naver Pay points or a card to fund this transaction.
5426/// If not provided, this defaults to `card`.
5427#[derive(Copy, Clone, Eq, PartialEq)]
5428pub enum UpdateSetupIntentPaymentMethodDataNaverPayFunding {
5429    Card,
5430    Points,
5431}
5432impl UpdateSetupIntentPaymentMethodDataNaverPayFunding {
5433    pub fn as_str(self) -> &'static str {
5434        use UpdateSetupIntentPaymentMethodDataNaverPayFunding::*;
5435        match self {
5436            Card => "card",
5437            Points => "points",
5438        }
5439    }
5440}
5441
5442impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
5443    type Err = stripe_types::StripeParseError;
5444    fn from_str(s: &str) -> Result<Self, Self::Err> {
5445        use UpdateSetupIntentPaymentMethodDataNaverPayFunding::*;
5446        match s {
5447            "card" => Ok(Card),
5448            "points" => Ok(Points),
5449            _ => Err(stripe_types::StripeParseError),
5450        }
5451    }
5452}
5453impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
5454    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5455        f.write_str(self.as_str())
5456    }
5457}
5458
5459impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
5460    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5461        f.write_str(self.as_str())
5462    }
5463}
5464impl serde::Serialize for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
5465    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5466    where
5467        S: serde::Serializer,
5468    {
5469        serializer.serialize_str(self.as_str())
5470    }
5471}
5472#[cfg(feature = "deserialize")]
5473impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
5474    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5475        use std::str::FromStr;
5476        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5477        Self::from_str(&s).map_err(|_| {
5478            serde::de::Error::custom(
5479                "Unknown value for UpdateSetupIntentPaymentMethodDataNaverPayFunding",
5480            )
5481        })
5482    }
5483}
5484/// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
5485#[derive(Clone, Debug, serde::Serialize)]
5486pub struct UpdateSetupIntentPaymentMethodDataNzBankAccount {
5487    /// The name on the bank account.
5488    /// Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod’s billing details.
5489    #[serde(skip_serializing_if = "Option::is_none")]
5490    pub account_holder_name: Option<String>,
5491    /// The account number for the bank account.
5492    pub account_number: String,
5493    /// The numeric code for the bank account's bank.
5494    pub bank_code: String,
5495    /// The numeric code for the bank account's bank branch.
5496    pub branch_code: String,
5497    #[serde(skip_serializing_if = "Option::is_none")]
5498    pub reference: Option<String>,
5499    /// The suffix of the bank account number.
5500    pub suffix: String,
5501}
5502impl UpdateSetupIntentPaymentMethodDataNzBankAccount {
5503    pub fn new(
5504        account_number: impl Into<String>,
5505        bank_code: impl Into<String>,
5506        branch_code: impl Into<String>,
5507        suffix: impl Into<String>,
5508    ) -> Self {
5509        Self {
5510            account_holder_name: None,
5511            account_number: account_number.into(),
5512            bank_code: bank_code.into(),
5513            branch_code: branch_code.into(),
5514            reference: None,
5515            suffix: suffix.into(),
5516        }
5517    }
5518}
5519/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
5520#[derive(Clone, Debug, serde::Serialize)]
5521pub struct UpdateSetupIntentPaymentMethodDataP24 {
5522    /// The customer's bank.
5523    #[serde(skip_serializing_if = "Option::is_none")]
5524    pub bank: Option<UpdateSetupIntentPaymentMethodDataP24Bank>,
5525}
5526impl UpdateSetupIntentPaymentMethodDataP24 {
5527    pub fn new() -> Self {
5528        Self { bank: None }
5529    }
5530}
5531impl Default for UpdateSetupIntentPaymentMethodDataP24 {
5532    fn default() -> Self {
5533        Self::new()
5534    }
5535}
5536/// The customer's bank.
5537#[derive(Clone, Eq, PartialEq)]
5538#[non_exhaustive]
5539pub enum UpdateSetupIntentPaymentMethodDataP24Bank {
5540    AliorBank,
5541    BankMillennium,
5542    BankNowyBfgSa,
5543    BankPekaoSa,
5544    BankiSpbdzielcze,
5545    Blik,
5546    BnpParibas,
5547    Boz,
5548    CitiHandlowy,
5549    CreditAgricole,
5550    Envelobank,
5551    EtransferPocztowy24,
5552    GetinBank,
5553    Ideabank,
5554    Ing,
5555    Inteligo,
5556    MbankMtransfer,
5557    NestPrzelew,
5558    NoblePay,
5559    PbacZIpko,
5560    PlusBank,
5561    SantanderPrzelew24,
5562    TmobileUsbugiBankowe,
5563    ToyotaBank,
5564    Velobank,
5565    VolkswagenBank,
5566    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5567    Unknown(String),
5568}
5569impl UpdateSetupIntentPaymentMethodDataP24Bank {
5570    pub fn as_str(&self) -> &str {
5571        use UpdateSetupIntentPaymentMethodDataP24Bank::*;
5572        match self {
5573            AliorBank => "alior_bank",
5574            BankMillennium => "bank_millennium",
5575            BankNowyBfgSa => "bank_nowy_bfg_sa",
5576            BankPekaoSa => "bank_pekao_sa",
5577            BankiSpbdzielcze => "banki_spbdzielcze",
5578            Blik => "blik",
5579            BnpParibas => "bnp_paribas",
5580            Boz => "boz",
5581            CitiHandlowy => "citi_handlowy",
5582            CreditAgricole => "credit_agricole",
5583            Envelobank => "envelobank",
5584            EtransferPocztowy24 => "etransfer_pocztowy24",
5585            GetinBank => "getin_bank",
5586            Ideabank => "ideabank",
5587            Ing => "ing",
5588            Inteligo => "inteligo",
5589            MbankMtransfer => "mbank_mtransfer",
5590            NestPrzelew => "nest_przelew",
5591            NoblePay => "noble_pay",
5592            PbacZIpko => "pbac_z_ipko",
5593            PlusBank => "plus_bank",
5594            SantanderPrzelew24 => "santander_przelew24",
5595            TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
5596            ToyotaBank => "toyota_bank",
5597            Velobank => "velobank",
5598            VolkswagenBank => "volkswagen_bank",
5599            Unknown(v) => v,
5600        }
5601    }
5602}
5603
5604impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataP24Bank {
5605    type Err = std::convert::Infallible;
5606    fn from_str(s: &str) -> Result<Self, Self::Err> {
5607        use UpdateSetupIntentPaymentMethodDataP24Bank::*;
5608        match s {
5609            "alior_bank" => Ok(AliorBank),
5610            "bank_millennium" => Ok(BankMillennium),
5611            "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa),
5612            "bank_pekao_sa" => Ok(BankPekaoSa),
5613            "banki_spbdzielcze" => Ok(BankiSpbdzielcze),
5614            "blik" => Ok(Blik),
5615            "bnp_paribas" => Ok(BnpParibas),
5616            "boz" => Ok(Boz),
5617            "citi_handlowy" => Ok(CitiHandlowy),
5618            "credit_agricole" => Ok(CreditAgricole),
5619            "envelobank" => Ok(Envelobank),
5620            "etransfer_pocztowy24" => Ok(EtransferPocztowy24),
5621            "getin_bank" => Ok(GetinBank),
5622            "ideabank" => Ok(Ideabank),
5623            "ing" => Ok(Ing),
5624            "inteligo" => Ok(Inteligo),
5625            "mbank_mtransfer" => Ok(MbankMtransfer),
5626            "nest_przelew" => Ok(NestPrzelew),
5627            "noble_pay" => Ok(NoblePay),
5628            "pbac_z_ipko" => Ok(PbacZIpko),
5629            "plus_bank" => Ok(PlusBank),
5630            "santander_przelew24" => Ok(SantanderPrzelew24),
5631            "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe),
5632            "toyota_bank" => Ok(ToyotaBank),
5633            "velobank" => Ok(Velobank),
5634            "volkswagen_bank" => Ok(VolkswagenBank),
5635            v => Ok(Unknown(v.to_owned())),
5636        }
5637    }
5638}
5639impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataP24Bank {
5640    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5641        f.write_str(self.as_str())
5642    }
5643}
5644
5645impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataP24Bank {
5646    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5647        f.write_str(self.as_str())
5648    }
5649}
5650impl serde::Serialize for UpdateSetupIntentPaymentMethodDataP24Bank {
5651    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5652    where
5653        S: serde::Serializer,
5654    {
5655        serializer.serialize_str(self.as_str())
5656    }
5657}
5658#[cfg(feature = "deserialize")]
5659impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataP24Bank {
5660    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5661        use std::str::FromStr;
5662        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5663        Ok(Self::from_str(&s).unwrap())
5664    }
5665}
5666/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
5667#[derive(Clone, Debug, serde::Serialize)]
5668pub struct UpdateSetupIntentPaymentMethodDataSepaDebit {
5669    /// IBAN of the bank account.
5670    pub iban: String,
5671}
5672impl UpdateSetupIntentPaymentMethodDataSepaDebit {
5673    pub fn new(iban: impl Into<String>) -> Self {
5674        Self { iban: iban.into() }
5675    }
5676}
5677/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
5678#[derive(Copy, Clone, Debug, serde::Serialize)]
5679pub struct UpdateSetupIntentPaymentMethodDataSofort {
5680    /// Two-letter ISO code representing the country the bank account is located in.
5681    pub country: UpdateSetupIntentPaymentMethodDataSofortCountry,
5682}
5683impl UpdateSetupIntentPaymentMethodDataSofort {
5684    pub fn new(country: impl Into<UpdateSetupIntentPaymentMethodDataSofortCountry>) -> Self {
5685        Self { country: country.into() }
5686    }
5687}
5688/// Two-letter ISO code representing the country the bank account is located in.
5689#[derive(Copy, Clone, Eq, PartialEq)]
5690pub enum UpdateSetupIntentPaymentMethodDataSofortCountry {
5691    At,
5692    Be,
5693    De,
5694    Es,
5695    It,
5696    Nl,
5697}
5698impl UpdateSetupIntentPaymentMethodDataSofortCountry {
5699    pub fn as_str(self) -> &'static str {
5700        use UpdateSetupIntentPaymentMethodDataSofortCountry::*;
5701        match self {
5702            At => "AT",
5703            Be => "BE",
5704            De => "DE",
5705            Es => "ES",
5706            It => "IT",
5707            Nl => "NL",
5708        }
5709    }
5710}
5711
5712impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataSofortCountry {
5713    type Err = stripe_types::StripeParseError;
5714    fn from_str(s: &str) -> Result<Self, Self::Err> {
5715        use UpdateSetupIntentPaymentMethodDataSofortCountry::*;
5716        match s {
5717            "AT" => Ok(At),
5718            "BE" => Ok(Be),
5719            "DE" => Ok(De),
5720            "ES" => Ok(Es),
5721            "IT" => Ok(It),
5722            "NL" => Ok(Nl),
5723            _ => Err(stripe_types::StripeParseError),
5724        }
5725    }
5726}
5727impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataSofortCountry {
5728    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5729        f.write_str(self.as_str())
5730    }
5731}
5732
5733impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataSofortCountry {
5734    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5735        f.write_str(self.as_str())
5736    }
5737}
5738impl serde::Serialize for UpdateSetupIntentPaymentMethodDataSofortCountry {
5739    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5740    where
5741        S: serde::Serializer,
5742    {
5743        serializer.serialize_str(self.as_str())
5744    }
5745}
5746#[cfg(feature = "deserialize")]
5747impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataSofortCountry {
5748    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5749        use std::str::FromStr;
5750        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5751        Self::from_str(&s).map_err(|_| {
5752            serde::de::Error::custom(
5753                "Unknown value for UpdateSetupIntentPaymentMethodDataSofortCountry",
5754            )
5755        })
5756    }
5757}
5758/// The type of the PaymentMethod.
5759/// An additional hash is included on the PaymentMethod with a name matching this value.
5760/// It contains additional information specific to the PaymentMethod type.
5761#[derive(Clone, Eq, PartialEq)]
5762#[non_exhaustive]
5763pub enum UpdateSetupIntentPaymentMethodDataType {
5764    AcssDebit,
5765    Affirm,
5766    AfterpayClearpay,
5767    Alipay,
5768    Alma,
5769    AmazonPay,
5770    AuBecsDebit,
5771    BacsDebit,
5772    Bancontact,
5773    Billie,
5774    Blik,
5775    Boleto,
5776    Cashapp,
5777    Crypto,
5778    CustomerBalance,
5779    Eps,
5780    Fpx,
5781    Giropay,
5782    Grabpay,
5783    Ideal,
5784    KakaoPay,
5785    Klarna,
5786    Konbini,
5787    KrCard,
5788    Link,
5789    MbWay,
5790    Mobilepay,
5791    Multibanco,
5792    NaverPay,
5793    NzBankAccount,
5794    Oxxo,
5795    P24,
5796    PayByBank,
5797    Payco,
5798    Paynow,
5799    Paypal,
5800    Pix,
5801    Promptpay,
5802    RevolutPay,
5803    SamsungPay,
5804    Satispay,
5805    SepaDebit,
5806    Sofort,
5807    Swish,
5808    Twint,
5809    UsBankAccount,
5810    WechatPay,
5811    Zip,
5812    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5813    Unknown(String),
5814}
5815impl UpdateSetupIntentPaymentMethodDataType {
5816    pub fn as_str(&self) -> &str {
5817        use UpdateSetupIntentPaymentMethodDataType::*;
5818        match self {
5819            AcssDebit => "acss_debit",
5820            Affirm => "affirm",
5821            AfterpayClearpay => "afterpay_clearpay",
5822            Alipay => "alipay",
5823            Alma => "alma",
5824            AmazonPay => "amazon_pay",
5825            AuBecsDebit => "au_becs_debit",
5826            BacsDebit => "bacs_debit",
5827            Bancontact => "bancontact",
5828            Billie => "billie",
5829            Blik => "blik",
5830            Boleto => "boleto",
5831            Cashapp => "cashapp",
5832            Crypto => "crypto",
5833            CustomerBalance => "customer_balance",
5834            Eps => "eps",
5835            Fpx => "fpx",
5836            Giropay => "giropay",
5837            Grabpay => "grabpay",
5838            Ideal => "ideal",
5839            KakaoPay => "kakao_pay",
5840            Klarna => "klarna",
5841            Konbini => "konbini",
5842            KrCard => "kr_card",
5843            Link => "link",
5844            MbWay => "mb_way",
5845            Mobilepay => "mobilepay",
5846            Multibanco => "multibanco",
5847            NaverPay => "naver_pay",
5848            NzBankAccount => "nz_bank_account",
5849            Oxxo => "oxxo",
5850            P24 => "p24",
5851            PayByBank => "pay_by_bank",
5852            Payco => "payco",
5853            Paynow => "paynow",
5854            Paypal => "paypal",
5855            Pix => "pix",
5856            Promptpay => "promptpay",
5857            RevolutPay => "revolut_pay",
5858            SamsungPay => "samsung_pay",
5859            Satispay => "satispay",
5860            SepaDebit => "sepa_debit",
5861            Sofort => "sofort",
5862            Swish => "swish",
5863            Twint => "twint",
5864            UsBankAccount => "us_bank_account",
5865            WechatPay => "wechat_pay",
5866            Zip => "zip",
5867            Unknown(v) => v,
5868        }
5869    }
5870}
5871
5872impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataType {
5873    type Err = std::convert::Infallible;
5874    fn from_str(s: &str) -> Result<Self, Self::Err> {
5875        use UpdateSetupIntentPaymentMethodDataType::*;
5876        match s {
5877            "acss_debit" => Ok(AcssDebit),
5878            "affirm" => Ok(Affirm),
5879            "afterpay_clearpay" => Ok(AfterpayClearpay),
5880            "alipay" => Ok(Alipay),
5881            "alma" => Ok(Alma),
5882            "amazon_pay" => Ok(AmazonPay),
5883            "au_becs_debit" => Ok(AuBecsDebit),
5884            "bacs_debit" => Ok(BacsDebit),
5885            "bancontact" => Ok(Bancontact),
5886            "billie" => Ok(Billie),
5887            "blik" => Ok(Blik),
5888            "boleto" => Ok(Boleto),
5889            "cashapp" => Ok(Cashapp),
5890            "crypto" => Ok(Crypto),
5891            "customer_balance" => Ok(CustomerBalance),
5892            "eps" => Ok(Eps),
5893            "fpx" => Ok(Fpx),
5894            "giropay" => Ok(Giropay),
5895            "grabpay" => Ok(Grabpay),
5896            "ideal" => Ok(Ideal),
5897            "kakao_pay" => Ok(KakaoPay),
5898            "klarna" => Ok(Klarna),
5899            "konbini" => Ok(Konbini),
5900            "kr_card" => Ok(KrCard),
5901            "link" => Ok(Link),
5902            "mb_way" => Ok(MbWay),
5903            "mobilepay" => Ok(Mobilepay),
5904            "multibanco" => Ok(Multibanco),
5905            "naver_pay" => Ok(NaverPay),
5906            "nz_bank_account" => Ok(NzBankAccount),
5907            "oxxo" => Ok(Oxxo),
5908            "p24" => Ok(P24),
5909            "pay_by_bank" => Ok(PayByBank),
5910            "payco" => Ok(Payco),
5911            "paynow" => Ok(Paynow),
5912            "paypal" => Ok(Paypal),
5913            "pix" => Ok(Pix),
5914            "promptpay" => Ok(Promptpay),
5915            "revolut_pay" => Ok(RevolutPay),
5916            "samsung_pay" => Ok(SamsungPay),
5917            "satispay" => Ok(Satispay),
5918            "sepa_debit" => Ok(SepaDebit),
5919            "sofort" => Ok(Sofort),
5920            "swish" => Ok(Swish),
5921            "twint" => Ok(Twint),
5922            "us_bank_account" => Ok(UsBankAccount),
5923            "wechat_pay" => Ok(WechatPay),
5924            "zip" => Ok(Zip),
5925            v => Ok(Unknown(v.to_owned())),
5926        }
5927    }
5928}
5929impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataType {
5930    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5931        f.write_str(self.as_str())
5932    }
5933}
5934
5935impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataType {
5936    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5937        f.write_str(self.as_str())
5938    }
5939}
5940impl serde::Serialize for UpdateSetupIntentPaymentMethodDataType {
5941    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5942    where
5943        S: serde::Serializer,
5944    {
5945        serializer.serialize_str(self.as_str())
5946    }
5947}
5948#[cfg(feature = "deserialize")]
5949impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataType {
5950    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5951        use std::str::FromStr;
5952        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5953        Ok(Self::from_str(&s).unwrap())
5954    }
5955}
5956/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
5957#[derive(Clone, Debug, serde::Serialize)]
5958pub struct UpdateSetupIntentPaymentMethodDataUsBankAccount {
5959    /// Account holder type: individual or company.
5960    #[serde(skip_serializing_if = "Option::is_none")]
5961    pub account_holder_type:
5962        Option<UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType>,
5963    /// Account number of the bank account.
5964    #[serde(skip_serializing_if = "Option::is_none")]
5965    pub account_number: Option<String>,
5966    /// Account type: checkings or savings. Defaults to checking if omitted.
5967    #[serde(skip_serializing_if = "Option::is_none")]
5968    pub account_type: Option<UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType>,
5969    /// The ID of a Financial Connections Account to use as a payment method.
5970    #[serde(skip_serializing_if = "Option::is_none")]
5971    pub financial_connections_account: Option<String>,
5972    /// Routing number of the bank account.
5973    #[serde(skip_serializing_if = "Option::is_none")]
5974    pub routing_number: Option<String>,
5975}
5976impl UpdateSetupIntentPaymentMethodDataUsBankAccount {
5977    pub fn new() -> Self {
5978        Self {
5979            account_holder_type: None,
5980            account_number: None,
5981            account_type: None,
5982            financial_connections_account: None,
5983            routing_number: None,
5984        }
5985    }
5986}
5987impl Default for UpdateSetupIntentPaymentMethodDataUsBankAccount {
5988    fn default() -> Self {
5989        Self::new()
5990    }
5991}
5992/// Account holder type: individual or company.
5993#[derive(Copy, Clone, Eq, PartialEq)]
5994pub enum UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
5995    Company,
5996    Individual,
5997}
5998impl UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
5999    pub fn as_str(self) -> &'static str {
6000        use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
6001        match self {
6002            Company => "company",
6003            Individual => "individual",
6004        }
6005    }
6006}
6007
6008impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
6009    type Err = stripe_types::StripeParseError;
6010    fn from_str(s: &str) -> Result<Self, Self::Err> {
6011        use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
6012        match s {
6013            "company" => Ok(Company),
6014            "individual" => Ok(Individual),
6015            _ => Err(stripe_types::StripeParseError),
6016        }
6017    }
6018}
6019impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
6020    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6021        f.write_str(self.as_str())
6022    }
6023}
6024
6025impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
6026    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6027        f.write_str(self.as_str())
6028    }
6029}
6030impl serde::Serialize for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
6031    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6032    where
6033        S: serde::Serializer,
6034    {
6035        serializer.serialize_str(self.as_str())
6036    }
6037}
6038#[cfg(feature = "deserialize")]
6039impl<'de> serde::Deserialize<'de>
6040    for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType
6041{
6042    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6043        use std::str::FromStr;
6044        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6045        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType"))
6046    }
6047}
6048/// Account type: checkings or savings. Defaults to checking if omitted.
6049#[derive(Copy, Clone, Eq, PartialEq)]
6050pub enum UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6051    Checking,
6052    Savings,
6053}
6054impl UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6055    pub fn as_str(self) -> &'static str {
6056        use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
6057        match self {
6058            Checking => "checking",
6059            Savings => "savings",
6060        }
6061    }
6062}
6063
6064impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6065    type Err = stripe_types::StripeParseError;
6066    fn from_str(s: &str) -> Result<Self, Self::Err> {
6067        use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
6068        match s {
6069            "checking" => Ok(Checking),
6070            "savings" => Ok(Savings),
6071            _ => Err(stripe_types::StripeParseError),
6072        }
6073    }
6074}
6075impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6076    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6077        f.write_str(self.as_str())
6078    }
6079}
6080
6081impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6082    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6083        f.write_str(self.as_str())
6084    }
6085}
6086impl serde::Serialize for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6087    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6088    where
6089        S: serde::Serializer,
6090    {
6091        serializer.serialize_str(self.as_str())
6092    }
6093}
6094#[cfg(feature = "deserialize")]
6095impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6096    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6097        use std::str::FromStr;
6098        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6099        Self::from_str(&s).map_err(|_| {
6100            serde::de::Error::custom(
6101                "Unknown value for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType",
6102            )
6103        })
6104    }
6105}
6106/// Payment method-specific configuration for this SetupIntent.
6107#[derive(Clone, Debug, serde::Serialize)]
6108pub struct UpdateSetupIntentPaymentMethodOptions {
6109    /// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options.
6110    #[serde(skip_serializing_if = "Option::is_none")]
6111    pub acss_debit: Option<UpdateSetupIntentPaymentMethodOptionsAcssDebit>,
6112    /// If this is a `amazon_pay` SetupIntent, this sub-hash contains details about the AmazonPay payment method options.
6113    #[serde(skip_serializing_if = "Option::is_none")]
6114    #[serde(with = "stripe_types::with_serde_json_opt")]
6115    pub amazon_pay: Option<miniserde::json::Value>,
6116    /// If this is a `bacs_debit` SetupIntent, this sub-hash contains details about the Bacs Debit payment method options.
6117    #[serde(skip_serializing_if = "Option::is_none")]
6118    pub bacs_debit: Option<UpdateSetupIntentPaymentMethodOptionsBacsDebit>,
6119    /// Configuration for any card setup attempted on this SetupIntent.
6120    #[serde(skip_serializing_if = "Option::is_none")]
6121    pub card: Option<UpdateSetupIntentPaymentMethodOptionsCard>,
6122    /// If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options.
6123    #[serde(skip_serializing_if = "Option::is_none")]
6124    #[serde(with = "stripe_types::with_serde_json_opt")]
6125    pub card_present: Option<miniserde::json::Value>,
6126    /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options.
6127    #[serde(skip_serializing_if = "Option::is_none")]
6128    pub klarna: Option<UpdateSetupIntentPaymentMethodOptionsKlarna>,
6129    /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
6130    #[serde(skip_serializing_if = "Option::is_none")]
6131    pub link: Option<SetupIntentPaymentMethodOptionsParam>,
6132    /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
6133    #[serde(skip_serializing_if = "Option::is_none")]
6134    pub paypal: Option<PaymentMethodOptionsParam>,
6135    /// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options.
6136    #[serde(skip_serializing_if = "Option::is_none")]
6137    pub sepa_debit: Option<UpdateSetupIntentPaymentMethodOptionsSepaDebit>,
6138    /// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options.
6139    #[serde(skip_serializing_if = "Option::is_none")]
6140    pub us_bank_account: Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccount>,
6141}
6142impl UpdateSetupIntentPaymentMethodOptions {
6143    pub fn new() -> Self {
6144        Self {
6145            acss_debit: None,
6146            amazon_pay: None,
6147            bacs_debit: None,
6148            card: None,
6149            card_present: None,
6150            klarna: None,
6151            link: None,
6152            paypal: None,
6153            sepa_debit: None,
6154            us_bank_account: None,
6155        }
6156    }
6157}
6158impl Default for UpdateSetupIntentPaymentMethodOptions {
6159    fn default() -> Self {
6160        Self::new()
6161    }
6162}
6163/// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options.
6164#[derive(Clone, Debug, serde::Serialize)]
6165pub struct UpdateSetupIntentPaymentMethodOptionsAcssDebit {
6166    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
6167    /// Must be a [supported currency](https://stripe.com/docs/currencies).
6168    #[serde(skip_serializing_if = "Option::is_none")]
6169    pub currency: Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency>,
6170    /// Additional fields for Mandate creation
6171    #[serde(skip_serializing_if = "Option::is_none")]
6172    pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions>,
6173    /// Bank account verification method.
6174    #[serde(skip_serializing_if = "Option::is_none")]
6175    pub verification_method:
6176        Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
6177}
6178impl UpdateSetupIntentPaymentMethodOptionsAcssDebit {
6179    pub fn new() -> Self {
6180        Self { currency: None, mandate_options: None, verification_method: None }
6181    }
6182}
6183impl Default for UpdateSetupIntentPaymentMethodOptionsAcssDebit {
6184    fn default() -> Self {
6185        Self::new()
6186    }
6187}
6188/// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
6189/// Must be a [supported currency](https://stripe.com/docs/currencies).
6190#[derive(Copy, Clone, Eq, PartialEq)]
6191pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
6192    Cad,
6193    Usd,
6194}
6195impl UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
6196    pub fn as_str(self) -> &'static str {
6197        use UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
6198        match self {
6199            Cad => "cad",
6200            Usd => "usd",
6201        }
6202    }
6203}
6204
6205impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
6206    type Err = stripe_types::StripeParseError;
6207    fn from_str(s: &str) -> Result<Self, Self::Err> {
6208        use UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
6209        match s {
6210            "cad" => Ok(Cad),
6211            "usd" => Ok(Usd),
6212            _ => Err(stripe_types::StripeParseError),
6213        }
6214    }
6215}
6216impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
6217    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6218        f.write_str(self.as_str())
6219    }
6220}
6221
6222impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
6223    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6224        f.write_str(self.as_str())
6225    }
6226}
6227impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
6228    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6229    where
6230        S: serde::Serializer,
6231    {
6232        serializer.serialize_str(self.as_str())
6233    }
6234}
6235#[cfg(feature = "deserialize")]
6236impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
6237    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6238        use std::str::FromStr;
6239        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6240        Self::from_str(&s).map_err(|_| {
6241            serde::de::Error::custom(
6242                "Unknown value for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency",
6243            )
6244        })
6245    }
6246}
6247/// Additional fields for Mandate creation
6248#[derive(Clone, Debug, serde::Serialize)]
6249pub struct UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
6250    /// A URL for custom mandate text to render during confirmation step.
6251    /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,.
6252    /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent.
6253    #[serde(skip_serializing_if = "Option::is_none")]
6254    pub custom_mandate_url: Option<String>,
6255    /// List of Stripe products where this mandate can be selected automatically.
6256    #[serde(skip_serializing_if = "Option::is_none")]
6257    pub default_for:
6258        Option<Vec<UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor>>,
6259    /// Description of the mandate interval.
6260    /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'.
6261    #[serde(skip_serializing_if = "Option::is_none")]
6262    pub interval_description: Option<String>,
6263    /// Payment schedule for the mandate.
6264    #[serde(skip_serializing_if = "Option::is_none")]
6265    pub payment_schedule:
6266        Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
6267    /// Transaction type of the mandate.
6268    #[serde(skip_serializing_if = "Option::is_none")]
6269    pub transaction_type:
6270        Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
6271}
6272impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
6273    pub fn new() -> Self {
6274        Self {
6275            custom_mandate_url: None,
6276            default_for: None,
6277            interval_description: None,
6278            payment_schedule: None,
6279            transaction_type: None,
6280        }
6281    }
6282}
6283impl Default for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
6284    fn default() -> Self {
6285        Self::new()
6286    }
6287}
6288/// List of Stripe products where this mandate can be selected automatically.
6289#[derive(Copy, Clone, Eq, PartialEq)]
6290pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
6291    Invoice,
6292    Subscription,
6293}
6294impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
6295    pub fn as_str(self) -> &'static str {
6296        use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
6297        match self {
6298            Invoice => "invoice",
6299            Subscription => "subscription",
6300        }
6301    }
6302}
6303
6304impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
6305    type Err = stripe_types::StripeParseError;
6306    fn from_str(s: &str) -> Result<Self, Self::Err> {
6307        use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
6308        match s {
6309            "invoice" => Ok(Invoice),
6310            "subscription" => Ok(Subscription),
6311            _ => Err(stripe_types::StripeParseError),
6312        }
6313    }
6314}
6315impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
6316    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6317        f.write_str(self.as_str())
6318    }
6319}
6320
6321impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
6322    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6323        f.write_str(self.as_str())
6324    }
6325}
6326impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
6327    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6328    where
6329        S: serde::Serializer,
6330    {
6331        serializer.serialize_str(self.as_str())
6332    }
6333}
6334#[cfg(feature = "deserialize")]
6335impl<'de> serde::Deserialize<'de>
6336    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
6337{
6338    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6339        use std::str::FromStr;
6340        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6341        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor"))
6342    }
6343}
6344/// Payment schedule for the mandate.
6345#[derive(Copy, Clone, Eq, PartialEq)]
6346pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
6347    Combined,
6348    Interval,
6349    Sporadic,
6350}
6351impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
6352    pub fn as_str(self) -> &'static str {
6353        use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
6354        match self {
6355            Combined => "combined",
6356            Interval => "interval",
6357            Sporadic => "sporadic",
6358        }
6359    }
6360}
6361
6362impl std::str::FromStr
6363    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
6364{
6365    type Err = stripe_types::StripeParseError;
6366    fn from_str(s: &str) -> Result<Self, Self::Err> {
6367        use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
6368        match s {
6369            "combined" => Ok(Combined),
6370            "interval" => Ok(Interval),
6371            "sporadic" => Ok(Sporadic),
6372            _ => Err(stripe_types::StripeParseError),
6373        }
6374    }
6375}
6376impl std::fmt::Display
6377    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
6378{
6379    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6380        f.write_str(self.as_str())
6381    }
6382}
6383
6384impl std::fmt::Debug
6385    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
6386{
6387    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6388        f.write_str(self.as_str())
6389    }
6390}
6391impl serde::Serialize
6392    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
6393{
6394    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6395    where
6396        S: serde::Serializer,
6397    {
6398        serializer.serialize_str(self.as_str())
6399    }
6400}
6401#[cfg(feature = "deserialize")]
6402impl<'de> serde::Deserialize<'de>
6403    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
6404{
6405    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6406        use std::str::FromStr;
6407        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6408        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"))
6409    }
6410}
6411/// Transaction type of the mandate.
6412#[derive(Copy, Clone, Eq, PartialEq)]
6413pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
6414    Business,
6415    Personal,
6416}
6417impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
6418    pub fn as_str(self) -> &'static str {
6419        use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
6420        match self {
6421            Business => "business",
6422            Personal => "personal",
6423        }
6424    }
6425}
6426
6427impl std::str::FromStr
6428    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
6429{
6430    type Err = stripe_types::StripeParseError;
6431    fn from_str(s: &str) -> Result<Self, Self::Err> {
6432        use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
6433        match s {
6434            "business" => Ok(Business),
6435            "personal" => Ok(Personal),
6436            _ => Err(stripe_types::StripeParseError),
6437        }
6438    }
6439}
6440impl std::fmt::Display
6441    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
6442{
6443    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6444        f.write_str(self.as_str())
6445    }
6446}
6447
6448impl std::fmt::Debug
6449    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
6450{
6451    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6452        f.write_str(self.as_str())
6453    }
6454}
6455impl serde::Serialize
6456    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
6457{
6458    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6459    where
6460        S: serde::Serializer,
6461    {
6462        serializer.serialize_str(self.as_str())
6463    }
6464}
6465#[cfg(feature = "deserialize")]
6466impl<'de> serde::Deserialize<'de>
6467    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
6468{
6469    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6470        use std::str::FromStr;
6471        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6472        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"))
6473    }
6474}
6475/// Bank account verification method.
6476#[derive(Copy, Clone, Eq, PartialEq)]
6477pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
6478    Automatic,
6479    Instant,
6480    Microdeposits,
6481}
6482impl UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
6483    pub fn as_str(self) -> &'static str {
6484        use UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
6485        match self {
6486            Automatic => "automatic",
6487            Instant => "instant",
6488            Microdeposits => "microdeposits",
6489        }
6490    }
6491}
6492
6493impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
6494    type Err = stripe_types::StripeParseError;
6495    fn from_str(s: &str) -> Result<Self, Self::Err> {
6496        use UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
6497        match s {
6498            "automatic" => Ok(Automatic),
6499            "instant" => Ok(Instant),
6500            "microdeposits" => Ok(Microdeposits),
6501            _ => Err(stripe_types::StripeParseError),
6502        }
6503    }
6504}
6505impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
6506    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6507        f.write_str(self.as_str())
6508    }
6509}
6510
6511impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
6512    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6513        f.write_str(self.as_str())
6514    }
6515}
6516impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
6517    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6518    where
6519        S: serde::Serializer,
6520    {
6521        serializer.serialize_str(self.as_str())
6522    }
6523}
6524#[cfg(feature = "deserialize")]
6525impl<'de> serde::Deserialize<'de>
6526    for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod
6527{
6528    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6529        use std::str::FromStr;
6530        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6531        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod"))
6532    }
6533}
6534/// If this is a `bacs_debit` SetupIntent, this sub-hash contains details about the Bacs Debit payment method options.
6535#[derive(Clone, Debug, serde::Serialize)]
6536pub struct UpdateSetupIntentPaymentMethodOptionsBacsDebit {
6537    /// Additional fields for Mandate creation
6538    #[serde(skip_serializing_if = "Option::is_none")]
6539    pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
6540}
6541impl UpdateSetupIntentPaymentMethodOptionsBacsDebit {
6542    pub fn new() -> Self {
6543        Self { mandate_options: None }
6544    }
6545}
6546impl Default for UpdateSetupIntentPaymentMethodOptionsBacsDebit {
6547    fn default() -> Self {
6548        Self::new()
6549    }
6550}
6551/// Configuration for any card setup attempted on this SetupIntent.
6552#[derive(Clone, Debug, serde::Serialize)]
6553pub struct UpdateSetupIntentPaymentMethodOptionsCard {
6554    /// Configuration options for setting up an eMandate for cards issued in India.
6555    #[serde(skip_serializing_if = "Option::is_none")]
6556    pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsCardMandateOptions>,
6557    /// When specified, this parameter signals that a card has been collected
6558    /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This
6559    /// parameter can only be provided during confirmation.
6560    #[serde(skip_serializing_if = "Option::is_none")]
6561    pub moto: Option<bool>,
6562    /// Selected network to process this SetupIntent on.
6563    /// Depends on the available networks of the card attached to the SetupIntent.
6564    /// Can be only set confirm-time.
6565    #[serde(skip_serializing_if = "Option::is_none")]
6566    pub network: Option<UpdateSetupIntentPaymentMethodOptionsCardNetwork>,
6567    /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication).
6568    /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
6569    /// If not provided, this value defaults to `automatic`.
6570    /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
6571    #[serde(skip_serializing_if = "Option::is_none")]
6572    pub request_three_d_secure:
6573        Option<UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure>,
6574    /// If 3D Secure authentication was performed with a third-party provider,
6575    /// the authentication details to use for this setup.
6576    #[serde(skip_serializing_if = "Option::is_none")]
6577    pub three_d_secure: Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure>,
6578}
6579impl UpdateSetupIntentPaymentMethodOptionsCard {
6580    pub fn new() -> Self {
6581        Self {
6582            mandate_options: None,
6583            moto: None,
6584            network: None,
6585            request_three_d_secure: None,
6586            three_d_secure: None,
6587        }
6588    }
6589}
6590impl Default for UpdateSetupIntentPaymentMethodOptionsCard {
6591    fn default() -> Self {
6592        Self::new()
6593    }
6594}
6595/// Configuration options for setting up an eMandate for cards issued in India.
6596#[derive(Clone, Debug, serde::Serialize)]
6597pub struct UpdateSetupIntentPaymentMethodOptionsCardMandateOptions {
6598    /// Amount to be charged for future payments.
6599    pub amount: i64,
6600    /// One of `fixed` or `maximum`.
6601    /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
6602    /// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
6603    pub amount_type: UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType,
6604    /// Currency in which future payments will be charged.
6605    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
6606    /// Must be a [supported currency](https://stripe.com/docs/currencies).
6607    pub currency: stripe_types::Currency,
6608    /// A description of the mandate or subscription that is meant to be displayed to the customer.
6609    #[serde(skip_serializing_if = "Option::is_none")]
6610    pub description: Option<String>,
6611    /// End date of the mandate or subscription.
6612    /// If not provided, the mandate will be active until canceled.
6613    /// If provided, end date should be after start date.
6614    #[serde(skip_serializing_if = "Option::is_none")]
6615    pub end_date: Option<stripe_types::Timestamp>,
6616    /// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
6617    pub interval: UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval,
6618    /// The number of intervals between payments.
6619    /// For example, `interval=month` and `interval_count=3` indicates one payment every three months.
6620    /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).
6621    /// This parameter is optional when `interval=sporadic`.
6622    #[serde(skip_serializing_if = "Option::is_none")]
6623    pub interval_count: Option<u64>,
6624    /// Unique identifier for the mandate or subscription.
6625    pub reference: String,
6626    /// Start date of the mandate or subscription. Start date should not be lesser than yesterday.
6627    pub start_date: stripe_types::Timestamp,
6628    /// Specifies the type of mandates supported. Possible values are `india`.
6629    #[serde(skip_serializing_if = "Option::is_none")]
6630    pub supported_types:
6631        Option<Vec<UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
6632}
6633impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptions {
6634    pub fn new(
6635        amount: impl Into<i64>,
6636        amount_type: impl Into<UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
6637        currency: impl Into<stripe_types::Currency>,
6638        interval: impl Into<UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval>,
6639        reference: impl Into<String>,
6640        start_date: impl Into<stripe_types::Timestamp>,
6641    ) -> Self {
6642        Self {
6643            amount: amount.into(),
6644            amount_type: amount_type.into(),
6645            currency: currency.into(),
6646            description: None,
6647            end_date: None,
6648            interval: interval.into(),
6649            interval_count: None,
6650            reference: reference.into(),
6651            start_date: start_date.into(),
6652            supported_types: None,
6653        }
6654    }
6655}
6656/// One of `fixed` or `maximum`.
6657/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
6658/// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
6659#[derive(Copy, Clone, Eq, PartialEq)]
6660pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
6661    Fixed,
6662    Maximum,
6663}
6664impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
6665    pub fn as_str(self) -> &'static str {
6666        use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
6667        match self {
6668            Fixed => "fixed",
6669            Maximum => "maximum",
6670        }
6671    }
6672}
6673
6674impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
6675    type Err = stripe_types::StripeParseError;
6676    fn from_str(s: &str) -> Result<Self, Self::Err> {
6677        use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
6678        match s {
6679            "fixed" => Ok(Fixed),
6680            "maximum" => Ok(Maximum),
6681            _ => Err(stripe_types::StripeParseError),
6682        }
6683    }
6684}
6685impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
6686    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6687        f.write_str(self.as_str())
6688    }
6689}
6690
6691impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
6692    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6693        f.write_str(self.as_str())
6694    }
6695}
6696impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
6697    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6698    where
6699        S: serde::Serializer,
6700    {
6701        serializer.serialize_str(self.as_str())
6702    }
6703}
6704#[cfg(feature = "deserialize")]
6705impl<'de> serde::Deserialize<'de>
6706    for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType
6707{
6708    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6709        use std::str::FromStr;
6710        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6711        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType"))
6712    }
6713}
6714/// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
6715#[derive(Copy, Clone, Eq, PartialEq)]
6716pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
6717    Day,
6718    Month,
6719    Sporadic,
6720    Week,
6721    Year,
6722}
6723impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
6724    pub fn as_str(self) -> &'static str {
6725        use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
6726        match self {
6727            Day => "day",
6728            Month => "month",
6729            Sporadic => "sporadic",
6730            Week => "week",
6731            Year => "year",
6732        }
6733    }
6734}
6735
6736impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
6737    type Err = stripe_types::StripeParseError;
6738    fn from_str(s: &str) -> Result<Self, Self::Err> {
6739        use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
6740        match s {
6741            "day" => Ok(Day),
6742            "month" => Ok(Month),
6743            "sporadic" => Ok(Sporadic),
6744            "week" => Ok(Week),
6745            "year" => Ok(Year),
6746            _ => Err(stripe_types::StripeParseError),
6747        }
6748    }
6749}
6750impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
6751    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6752        f.write_str(self.as_str())
6753    }
6754}
6755
6756impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
6757    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6758        f.write_str(self.as_str())
6759    }
6760}
6761impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
6762    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6763    where
6764        S: serde::Serializer,
6765    {
6766        serializer.serialize_str(self.as_str())
6767    }
6768}
6769#[cfg(feature = "deserialize")]
6770impl<'de> serde::Deserialize<'de>
6771    for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval
6772{
6773    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6774        use std::str::FromStr;
6775        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6776        Self::from_str(&s).map_err(|_| {
6777            serde::de::Error::custom(
6778                "Unknown value for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval",
6779            )
6780        })
6781    }
6782}
6783/// Specifies the type of mandates supported. Possible values are `india`.
6784#[derive(Copy, Clone, Eq, PartialEq)]
6785pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
6786    India,
6787}
6788impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
6789    pub fn as_str(self) -> &'static str {
6790        use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
6791        match self {
6792            India => "india",
6793        }
6794    }
6795}
6796
6797impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
6798    type Err = stripe_types::StripeParseError;
6799    fn from_str(s: &str) -> Result<Self, Self::Err> {
6800        use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
6801        match s {
6802            "india" => Ok(India),
6803            _ => Err(stripe_types::StripeParseError),
6804        }
6805    }
6806}
6807impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
6808    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6809        f.write_str(self.as_str())
6810    }
6811}
6812
6813impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
6814    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6815        f.write_str(self.as_str())
6816    }
6817}
6818impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
6819    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6820    where
6821        S: serde::Serializer,
6822    {
6823        serializer.serialize_str(self.as_str())
6824    }
6825}
6826#[cfg(feature = "deserialize")]
6827impl<'de> serde::Deserialize<'de>
6828    for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
6829{
6830    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6831        use std::str::FromStr;
6832        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6833        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"))
6834    }
6835}
6836/// Selected network to process this SetupIntent on.
6837/// Depends on the available networks of the card attached to the SetupIntent.
6838/// Can be only set confirm-time.
6839#[derive(Copy, Clone, Eq, PartialEq)]
6840pub enum UpdateSetupIntentPaymentMethodOptionsCardNetwork {
6841    Amex,
6842    CartesBancaires,
6843    Diners,
6844    Discover,
6845    EftposAu,
6846    Girocard,
6847    Interac,
6848    Jcb,
6849    Link,
6850    Mastercard,
6851    Unionpay,
6852    Unknown,
6853    Visa,
6854}
6855impl UpdateSetupIntentPaymentMethodOptionsCardNetwork {
6856    pub fn as_str(self) -> &'static str {
6857        use UpdateSetupIntentPaymentMethodOptionsCardNetwork::*;
6858        match self {
6859            Amex => "amex",
6860            CartesBancaires => "cartes_bancaires",
6861            Diners => "diners",
6862            Discover => "discover",
6863            EftposAu => "eftpos_au",
6864            Girocard => "girocard",
6865            Interac => "interac",
6866            Jcb => "jcb",
6867            Link => "link",
6868            Mastercard => "mastercard",
6869            Unionpay => "unionpay",
6870            Unknown => "unknown",
6871            Visa => "visa",
6872        }
6873    }
6874}
6875
6876impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
6877    type Err = stripe_types::StripeParseError;
6878    fn from_str(s: &str) -> Result<Self, Self::Err> {
6879        use UpdateSetupIntentPaymentMethodOptionsCardNetwork::*;
6880        match s {
6881            "amex" => Ok(Amex),
6882            "cartes_bancaires" => Ok(CartesBancaires),
6883            "diners" => Ok(Diners),
6884            "discover" => Ok(Discover),
6885            "eftpos_au" => Ok(EftposAu),
6886            "girocard" => Ok(Girocard),
6887            "interac" => Ok(Interac),
6888            "jcb" => Ok(Jcb),
6889            "link" => Ok(Link),
6890            "mastercard" => Ok(Mastercard),
6891            "unionpay" => Ok(Unionpay),
6892            "unknown" => Ok(Unknown),
6893            "visa" => Ok(Visa),
6894            _ => Err(stripe_types::StripeParseError),
6895        }
6896    }
6897}
6898impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
6899    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6900        f.write_str(self.as_str())
6901    }
6902}
6903
6904impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
6905    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6906        f.write_str(self.as_str())
6907    }
6908}
6909impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
6910    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6911    where
6912        S: serde::Serializer,
6913    {
6914        serializer.serialize_str(self.as_str())
6915    }
6916}
6917#[cfg(feature = "deserialize")]
6918impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
6919    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6920        use std::str::FromStr;
6921        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6922        Self::from_str(&s).map_err(|_| {
6923            serde::de::Error::custom(
6924                "Unknown value for UpdateSetupIntentPaymentMethodOptionsCardNetwork",
6925            )
6926        })
6927    }
6928}
6929/// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication).
6930/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
6931/// If not provided, this value defaults to `automatic`.
6932/// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
6933#[derive(Copy, Clone, Eq, PartialEq)]
6934pub enum UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
6935    Any,
6936    Automatic,
6937    Challenge,
6938}
6939impl UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
6940    pub fn as_str(self) -> &'static str {
6941        use UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
6942        match self {
6943            Any => "any",
6944            Automatic => "automatic",
6945            Challenge => "challenge",
6946        }
6947    }
6948}
6949
6950impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
6951    type Err = stripe_types::StripeParseError;
6952    fn from_str(s: &str) -> Result<Self, Self::Err> {
6953        use UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
6954        match s {
6955            "any" => Ok(Any),
6956            "automatic" => Ok(Automatic),
6957            "challenge" => Ok(Challenge),
6958            _ => Err(stripe_types::StripeParseError),
6959        }
6960    }
6961}
6962impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
6963    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6964        f.write_str(self.as_str())
6965    }
6966}
6967
6968impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
6969    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6970        f.write_str(self.as_str())
6971    }
6972}
6973impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
6974    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6975    where
6976        S: serde::Serializer,
6977    {
6978        serializer.serialize_str(self.as_str())
6979    }
6980}
6981#[cfg(feature = "deserialize")]
6982impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
6983    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6984        use std::str::FromStr;
6985        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6986        Self::from_str(&s).map_err(|_| {
6987            serde::de::Error::custom(
6988                "Unknown value for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure",
6989            )
6990        })
6991    }
6992}
6993/// If 3D Secure authentication was performed with a third-party provider,
6994/// the authentication details to use for this setup.
6995#[derive(Clone, Debug, serde::Serialize)]
6996pub struct UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure {
6997    /// The `transStatus` returned from the card Issuer’s ACS in the ARes.
6998    #[serde(skip_serializing_if = "Option::is_none")]
6999    pub ares_trans_status:
7000        Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
7001    /// The cryptogram, also known as the "authentication value" (AAV, CAVV or
7002    /// AEVV). This value is 20 bytes, base64-encoded into a 28-character string.
7003    /// (Most 3D Secure providers will return the base64-encoded version, which
7004    /// is what you should specify here.)
7005    #[serde(skip_serializing_if = "Option::is_none")]
7006    pub cryptogram: Option<String>,
7007    /// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
7008    /// provider and indicates what degree of authentication was performed.
7009    #[serde(skip_serializing_if = "Option::is_none")]
7010    pub electronic_commerce_indicator:
7011        Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
7012    /// Network specific 3DS fields. Network specific arguments require an
7013    /// explicit card brand choice. The parameter `payment_method_options.card.network``
7014    /// must be populated accordingly
7015    #[serde(skip_serializing_if = "Option::is_none")]
7016    pub network_options:
7017        Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
7018    /// The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the
7019    /// AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99.
7020    #[serde(skip_serializing_if = "Option::is_none")]
7021    pub requestor_challenge_indicator: Option<String>,
7022    /// For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server
7023    /// Transaction ID (dsTransID).
7024    #[serde(skip_serializing_if = "Option::is_none")]
7025    pub transaction_id: Option<String>,
7026    /// The version of 3D Secure that was performed.
7027    #[serde(skip_serializing_if = "Option::is_none")]
7028    pub version: Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion>,
7029}
7030impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure {
7031    pub fn new() -> Self {
7032        Self {
7033            ares_trans_status: None,
7034            cryptogram: None,
7035            electronic_commerce_indicator: None,
7036            network_options: None,
7037            requestor_challenge_indicator: None,
7038            transaction_id: None,
7039            version: None,
7040        }
7041    }
7042}
7043impl Default for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure {
7044    fn default() -> Self {
7045        Self::new()
7046    }
7047}
7048/// The `transStatus` returned from the card Issuer’s ACS in the ARes.
7049#[derive(Copy, Clone, Eq, PartialEq)]
7050pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
7051    A,
7052    C,
7053    I,
7054    N,
7055    R,
7056    U,
7057    Y,
7058}
7059impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
7060    pub fn as_str(self) -> &'static str {
7061        use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
7062        match self {
7063            A => "A",
7064            C => "C",
7065            I => "I",
7066            N => "N",
7067            R => "R",
7068            U => "U",
7069            Y => "Y",
7070        }
7071    }
7072}
7073
7074impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
7075    type Err = stripe_types::StripeParseError;
7076    fn from_str(s: &str) -> Result<Self, Self::Err> {
7077        use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
7078        match s {
7079            "A" => Ok(A),
7080            "C" => Ok(C),
7081            "I" => Ok(I),
7082            "N" => Ok(N),
7083            "R" => Ok(R),
7084            "U" => Ok(U),
7085            "Y" => Ok(Y),
7086            _ => Err(stripe_types::StripeParseError),
7087        }
7088    }
7089}
7090impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
7091    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7092        f.write_str(self.as_str())
7093    }
7094}
7095
7096impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
7097    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7098        f.write_str(self.as_str())
7099    }
7100}
7101impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
7102    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7103    where
7104        S: serde::Serializer,
7105    {
7106        serializer.serialize_str(self.as_str())
7107    }
7108}
7109#[cfg(feature = "deserialize")]
7110impl<'de> serde::Deserialize<'de>
7111    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
7112{
7113    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7114        use std::str::FromStr;
7115        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7116        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"))
7117    }
7118}
7119/// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
7120/// provider and indicates what degree of authentication was performed.
7121#[derive(Copy, Clone, Eq, PartialEq)]
7122pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
7123    V01,
7124    V02,
7125    V05,
7126    V06,
7127    V07,
7128}
7129impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
7130    pub fn as_str(self) -> &'static str {
7131        use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
7132        match self {
7133            V01 => "01",
7134            V02 => "02",
7135            V05 => "05",
7136            V06 => "06",
7137            V07 => "07",
7138        }
7139    }
7140}
7141
7142impl std::str::FromStr
7143    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
7144{
7145    type Err = stripe_types::StripeParseError;
7146    fn from_str(s: &str) -> Result<Self, Self::Err> {
7147        use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
7148        match s {
7149            "01" => Ok(V01),
7150            "02" => Ok(V02),
7151            "05" => Ok(V05),
7152            "06" => Ok(V06),
7153            "07" => Ok(V07),
7154            _ => Err(stripe_types::StripeParseError),
7155        }
7156    }
7157}
7158impl std::fmt::Display
7159    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
7160{
7161    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7162        f.write_str(self.as_str())
7163    }
7164}
7165
7166impl std::fmt::Debug
7167    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
7168{
7169    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7170        f.write_str(self.as_str())
7171    }
7172}
7173impl serde::Serialize
7174    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
7175{
7176    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7177    where
7178        S: serde::Serializer,
7179    {
7180        serializer.serialize_str(self.as_str())
7181    }
7182}
7183#[cfg(feature = "deserialize")]
7184impl<'de> serde::Deserialize<'de>
7185    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
7186{
7187    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7188        use std::str::FromStr;
7189        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7190        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"))
7191    }
7192}
7193/// Network specific 3DS fields. Network specific arguments require an
7194/// explicit card brand choice. The parameter `payment_method_options.card.network``
7195/// must be populated accordingly
7196#[derive(Clone, Debug, serde::Serialize)]
7197pub struct UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
7198    /// Cartes Bancaires-specific 3DS fields.
7199    #[serde(skip_serializing_if = "Option::is_none")]
7200    pub cartes_bancaires:
7201        Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires>,
7202}
7203impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
7204    pub fn new() -> Self {
7205        Self { cartes_bancaires: None }
7206    }
7207}
7208impl Default for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
7209    fn default() -> Self {
7210        Self::new()
7211    }
7212}
7213/// Cartes Bancaires-specific 3DS fields.
7214#[derive(Clone, Debug, serde::Serialize)]
7215pub struct UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
7216    /// The cryptogram calculation algorithm used by the card Issuer's ACS
7217    /// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
7218    /// messageExtension: CB-AVALGO
7219    pub cb_avalgo:
7220        UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
7221    /// The exemption indicator returned from Cartes Bancaires in the ARes.
7222    /// message extension: CB-EXEMPTION; string (4 characters)
7223    /// This is a 3 byte bitmap (low significant byte first and most significant
7224    /// bit first) that has been Base64 encoded
7225    #[serde(skip_serializing_if = "Option::is_none")]
7226    pub cb_exemption: Option<String>,
7227    /// The risk score returned from Cartes Bancaires in the ARes.
7228    /// message extension: CB-SCORE; numeric value 0-99
7229    #[serde(skip_serializing_if = "Option::is_none")]
7230    pub cb_score: Option<i64>,
7231}
7232impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
7233    pub fn new(
7234        cb_avalgo: impl Into<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
7235    ) -> Self {
7236        Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
7237    }
7238}
7239/// The cryptogram calculation algorithm used by the card Issuer's ACS
7240/// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
7241/// messageExtension: CB-AVALGO
7242#[derive(Copy, Clone, Eq, PartialEq)]
7243pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
7244{
7245    V0,
7246    V1,
7247    V2,
7248    V3,
7249    V4,
7250    A,
7251}
7252impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
7253    pub fn as_str(self) -> &'static str {
7254        use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
7255        match self {
7256            V0 => "0",
7257            V1 => "1",
7258            V2 => "2",
7259            V3 => "3",
7260            V4 => "4",
7261            A => "A",
7262        }
7263    }
7264}
7265
7266impl std::str::FromStr
7267    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
7268{
7269    type Err = stripe_types::StripeParseError;
7270    fn from_str(s: &str) -> Result<Self, Self::Err> {
7271        use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
7272        match s {
7273            "0" => Ok(V0),
7274            "1" => Ok(V1),
7275            "2" => Ok(V2),
7276            "3" => Ok(V3),
7277            "4" => Ok(V4),
7278            "A" => Ok(A),
7279            _ => Err(stripe_types::StripeParseError),
7280        }
7281    }
7282}
7283impl std::fmt::Display
7284    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
7285{
7286    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7287        f.write_str(self.as_str())
7288    }
7289}
7290
7291impl std::fmt::Debug
7292    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
7293{
7294    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7295        f.write_str(self.as_str())
7296    }
7297}
7298impl serde::Serialize
7299    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
7300{
7301    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7302    where
7303        S: serde::Serializer,
7304    {
7305        serializer.serialize_str(self.as_str())
7306    }
7307}
7308#[cfg(feature = "deserialize")]
7309impl<'de> serde::Deserialize<'de>
7310    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
7311{
7312    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7313        use std::str::FromStr;
7314        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7315        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"))
7316    }
7317}
7318/// The version of 3D Secure that was performed.
7319#[derive(Copy, Clone, Eq, PartialEq)]
7320pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
7321    V1_0_2,
7322    V2_1_0,
7323    V2_2_0,
7324}
7325impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
7326    pub fn as_str(self) -> &'static str {
7327        use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
7328        match self {
7329            V1_0_2 => "1.0.2",
7330            V2_1_0 => "2.1.0",
7331            V2_2_0 => "2.2.0",
7332        }
7333    }
7334}
7335
7336impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
7337    type Err = stripe_types::StripeParseError;
7338    fn from_str(s: &str) -> Result<Self, Self::Err> {
7339        use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
7340        match s {
7341            "1.0.2" => Ok(V1_0_2),
7342            "2.1.0" => Ok(V2_1_0),
7343            "2.2.0" => Ok(V2_2_0),
7344            _ => Err(stripe_types::StripeParseError),
7345        }
7346    }
7347}
7348impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
7349    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7350        f.write_str(self.as_str())
7351    }
7352}
7353
7354impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
7355    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7356        f.write_str(self.as_str())
7357    }
7358}
7359impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
7360    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7361    where
7362        S: serde::Serializer,
7363    {
7364        serializer.serialize_str(self.as_str())
7365    }
7366}
7367#[cfg(feature = "deserialize")]
7368impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
7369    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7370        use std::str::FromStr;
7371        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7372        Self::from_str(&s).map_err(|_| {
7373            serde::de::Error::custom(
7374                "Unknown value for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion",
7375            )
7376        })
7377    }
7378}
7379/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options.
7380#[derive(Clone, Debug, serde::Serialize)]
7381pub struct UpdateSetupIntentPaymentMethodOptionsKlarna {
7382    /// The currency of the SetupIntent. Three letter ISO currency code.
7383    #[serde(skip_serializing_if = "Option::is_none")]
7384    pub currency: Option<stripe_types::Currency>,
7385    /// On-demand details if setting up a payment method for on-demand payments.
7386    #[serde(skip_serializing_if = "Option::is_none")]
7387    pub on_demand: Option<UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemand>,
7388    /// Preferred language of the Klarna authorization page that the customer is redirected to
7389    #[serde(skip_serializing_if = "Option::is_none")]
7390    pub preferred_locale: Option<UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale>,
7391    /// Subscription details if setting up or charging a subscription
7392    #[serde(skip_serializing_if = "Option::is_none")]
7393    pub subscriptions: Option<Vec<UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptions>>,
7394}
7395impl UpdateSetupIntentPaymentMethodOptionsKlarna {
7396    pub fn new() -> Self {
7397        Self { currency: None, on_demand: None, preferred_locale: None, subscriptions: None }
7398    }
7399}
7400impl Default for UpdateSetupIntentPaymentMethodOptionsKlarna {
7401    fn default() -> Self {
7402        Self::new()
7403    }
7404}
7405/// On-demand details if setting up a payment method for on-demand payments.
7406#[derive(Copy, Clone, Debug, serde::Serialize)]
7407pub struct UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
7408    /// Your average amount value.
7409    /// You can use a value across your customer base, or segment based on customer type, country, etc.
7410    #[serde(skip_serializing_if = "Option::is_none")]
7411    pub average_amount: Option<i64>,
7412    /// The maximum value you may charge a customer per purchase.
7413    /// You can use a value across your customer base, or segment based on customer type, country, etc.
7414    #[serde(skip_serializing_if = "Option::is_none")]
7415    pub maximum_amount: Option<i64>,
7416    /// The lowest or minimum value you may charge a customer per purchase.
7417    /// You can use a value across your customer base, or segment based on customer type, country, etc.
7418    #[serde(skip_serializing_if = "Option::is_none")]
7419    pub minimum_amount: Option<i64>,
7420    /// Interval at which the customer is making purchases
7421    #[serde(skip_serializing_if = "Option::is_none")]
7422    pub purchase_interval:
7423        Option<UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
7424    /// The number of `purchase_interval` between charges
7425    #[serde(skip_serializing_if = "Option::is_none")]
7426    pub purchase_interval_count: Option<u64>,
7427}
7428impl UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
7429    pub fn new() -> Self {
7430        Self {
7431            average_amount: None,
7432            maximum_amount: None,
7433            minimum_amount: None,
7434            purchase_interval: None,
7435            purchase_interval_count: None,
7436        }
7437    }
7438}
7439impl Default for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
7440    fn default() -> Self {
7441        Self::new()
7442    }
7443}
7444/// Interval at which the customer is making purchases
7445#[derive(Copy, Clone, Eq, PartialEq)]
7446pub enum UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7447    Day,
7448    Month,
7449    Week,
7450    Year,
7451}
7452impl UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7453    pub fn as_str(self) -> &'static str {
7454        use UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
7455        match self {
7456            Day => "day",
7457            Month => "month",
7458            Week => "week",
7459            Year => "year",
7460        }
7461    }
7462}
7463
7464impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7465    type Err = stripe_types::StripeParseError;
7466    fn from_str(s: &str) -> Result<Self, Self::Err> {
7467        use UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
7468        match s {
7469            "day" => Ok(Day),
7470            "month" => Ok(Month),
7471            "week" => Ok(Week),
7472            "year" => Ok(Year),
7473            _ => Err(stripe_types::StripeParseError),
7474        }
7475    }
7476}
7477impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7478    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7479        f.write_str(self.as_str())
7480    }
7481}
7482
7483impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7484    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7485        f.write_str(self.as_str())
7486    }
7487}
7488impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7489    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7490    where
7491        S: serde::Serializer,
7492    {
7493        serializer.serialize_str(self.as_str())
7494    }
7495}
7496#[cfg(feature = "deserialize")]
7497impl<'de> serde::Deserialize<'de>
7498    for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
7499{
7500    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7501        use std::str::FromStr;
7502        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7503        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"))
7504    }
7505}
7506/// Preferred language of the Klarna authorization page that the customer is redirected to
7507#[derive(Clone, Eq, PartialEq)]
7508#[non_exhaustive]
7509pub enum UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
7510    CsMinusCz,
7511    DaMinusDk,
7512    DeMinusAt,
7513    DeMinusCh,
7514    DeMinusDe,
7515    ElMinusGr,
7516    EnMinusAt,
7517    EnMinusAu,
7518    EnMinusBe,
7519    EnMinusCa,
7520    EnMinusCh,
7521    EnMinusCz,
7522    EnMinusDe,
7523    EnMinusDk,
7524    EnMinusEs,
7525    EnMinusFi,
7526    EnMinusFr,
7527    EnMinusGb,
7528    EnMinusGr,
7529    EnMinusIe,
7530    EnMinusIt,
7531    EnMinusNl,
7532    EnMinusNo,
7533    EnMinusNz,
7534    EnMinusPl,
7535    EnMinusPt,
7536    EnMinusRo,
7537    EnMinusSe,
7538    EnMinusUs,
7539    EsMinusEs,
7540    EsMinusUs,
7541    FiMinusFi,
7542    FrMinusBe,
7543    FrMinusCa,
7544    FrMinusCh,
7545    FrMinusFr,
7546    ItMinusCh,
7547    ItMinusIt,
7548    NbMinusNo,
7549    NlMinusBe,
7550    NlMinusNl,
7551    PlMinusPl,
7552    PtMinusPt,
7553    RoMinusRo,
7554    SvMinusFi,
7555    SvMinusSe,
7556    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7557    Unknown(String),
7558}
7559impl UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
7560    pub fn as_str(&self) -> &str {
7561        use UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
7562        match self {
7563            CsMinusCz => "cs-CZ",
7564            DaMinusDk => "da-DK",
7565            DeMinusAt => "de-AT",
7566            DeMinusCh => "de-CH",
7567            DeMinusDe => "de-DE",
7568            ElMinusGr => "el-GR",
7569            EnMinusAt => "en-AT",
7570            EnMinusAu => "en-AU",
7571            EnMinusBe => "en-BE",
7572            EnMinusCa => "en-CA",
7573            EnMinusCh => "en-CH",
7574            EnMinusCz => "en-CZ",
7575            EnMinusDe => "en-DE",
7576            EnMinusDk => "en-DK",
7577            EnMinusEs => "en-ES",
7578            EnMinusFi => "en-FI",
7579            EnMinusFr => "en-FR",
7580            EnMinusGb => "en-GB",
7581            EnMinusGr => "en-GR",
7582            EnMinusIe => "en-IE",
7583            EnMinusIt => "en-IT",
7584            EnMinusNl => "en-NL",
7585            EnMinusNo => "en-NO",
7586            EnMinusNz => "en-NZ",
7587            EnMinusPl => "en-PL",
7588            EnMinusPt => "en-PT",
7589            EnMinusRo => "en-RO",
7590            EnMinusSe => "en-SE",
7591            EnMinusUs => "en-US",
7592            EsMinusEs => "es-ES",
7593            EsMinusUs => "es-US",
7594            FiMinusFi => "fi-FI",
7595            FrMinusBe => "fr-BE",
7596            FrMinusCa => "fr-CA",
7597            FrMinusCh => "fr-CH",
7598            FrMinusFr => "fr-FR",
7599            ItMinusCh => "it-CH",
7600            ItMinusIt => "it-IT",
7601            NbMinusNo => "nb-NO",
7602            NlMinusBe => "nl-BE",
7603            NlMinusNl => "nl-NL",
7604            PlMinusPl => "pl-PL",
7605            PtMinusPt => "pt-PT",
7606            RoMinusRo => "ro-RO",
7607            SvMinusFi => "sv-FI",
7608            SvMinusSe => "sv-SE",
7609            Unknown(v) => v,
7610        }
7611    }
7612}
7613
7614impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
7615    type Err = std::convert::Infallible;
7616    fn from_str(s: &str) -> Result<Self, Self::Err> {
7617        use UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
7618        match s {
7619            "cs-CZ" => Ok(CsMinusCz),
7620            "da-DK" => Ok(DaMinusDk),
7621            "de-AT" => Ok(DeMinusAt),
7622            "de-CH" => Ok(DeMinusCh),
7623            "de-DE" => Ok(DeMinusDe),
7624            "el-GR" => Ok(ElMinusGr),
7625            "en-AT" => Ok(EnMinusAt),
7626            "en-AU" => Ok(EnMinusAu),
7627            "en-BE" => Ok(EnMinusBe),
7628            "en-CA" => Ok(EnMinusCa),
7629            "en-CH" => Ok(EnMinusCh),
7630            "en-CZ" => Ok(EnMinusCz),
7631            "en-DE" => Ok(EnMinusDe),
7632            "en-DK" => Ok(EnMinusDk),
7633            "en-ES" => Ok(EnMinusEs),
7634            "en-FI" => Ok(EnMinusFi),
7635            "en-FR" => Ok(EnMinusFr),
7636            "en-GB" => Ok(EnMinusGb),
7637            "en-GR" => Ok(EnMinusGr),
7638            "en-IE" => Ok(EnMinusIe),
7639            "en-IT" => Ok(EnMinusIt),
7640            "en-NL" => Ok(EnMinusNl),
7641            "en-NO" => Ok(EnMinusNo),
7642            "en-NZ" => Ok(EnMinusNz),
7643            "en-PL" => Ok(EnMinusPl),
7644            "en-PT" => Ok(EnMinusPt),
7645            "en-RO" => Ok(EnMinusRo),
7646            "en-SE" => Ok(EnMinusSe),
7647            "en-US" => Ok(EnMinusUs),
7648            "es-ES" => Ok(EsMinusEs),
7649            "es-US" => Ok(EsMinusUs),
7650            "fi-FI" => Ok(FiMinusFi),
7651            "fr-BE" => Ok(FrMinusBe),
7652            "fr-CA" => Ok(FrMinusCa),
7653            "fr-CH" => Ok(FrMinusCh),
7654            "fr-FR" => Ok(FrMinusFr),
7655            "it-CH" => Ok(ItMinusCh),
7656            "it-IT" => Ok(ItMinusIt),
7657            "nb-NO" => Ok(NbMinusNo),
7658            "nl-BE" => Ok(NlMinusBe),
7659            "nl-NL" => Ok(NlMinusNl),
7660            "pl-PL" => Ok(PlMinusPl),
7661            "pt-PT" => Ok(PtMinusPt),
7662            "ro-RO" => Ok(RoMinusRo),
7663            "sv-FI" => Ok(SvMinusFi),
7664            "sv-SE" => Ok(SvMinusSe),
7665            v => Ok(Unknown(v.to_owned())),
7666        }
7667    }
7668}
7669impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
7670    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7671        f.write_str(self.as_str())
7672    }
7673}
7674
7675impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
7676    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7677        f.write_str(self.as_str())
7678    }
7679}
7680impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
7681    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7682    where
7683        S: serde::Serializer,
7684    {
7685        serializer.serialize_str(self.as_str())
7686    }
7687}
7688#[cfg(feature = "deserialize")]
7689impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
7690    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7691        use std::str::FromStr;
7692        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7693        Ok(Self::from_str(&s).unwrap())
7694    }
7695}
7696/// Subscription details if setting up or charging a subscription
7697#[derive(Clone, Debug, serde::Serialize)]
7698pub struct UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
7699    /// Unit of time between subscription charges.
7700    pub interval: UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
7701    /// The number of intervals (specified in the `interval` attribute) between subscription charges.
7702    /// For example, `interval=month` and `interval_count=3` charges every 3 months.
7703    #[serde(skip_serializing_if = "Option::is_none")]
7704    pub interval_count: Option<u64>,
7705    /// Name for subscription.
7706    #[serde(skip_serializing_if = "Option::is_none")]
7707    pub name: Option<String>,
7708    /// Describes the upcoming charge for this subscription.
7709    pub next_billing: SubscriptionNextBillingParam,
7710    /// A non-customer-facing reference to correlate subscription charges in the Klarna app.
7711    /// Use a value that persists across subscription charges.
7712    pub reference: String,
7713}
7714impl UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
7715    pub fn new(
7716        interval: impl Into<UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
7717        next_billing: impl Into<SubscriptionNextBillingParam>,
7718        reference: impl Into<String>,
7719    ) -> Self {
7720        Self {
7721            interval: interval.into(),
7722            interval_count: None,
7723            name: None,
7724            next_billing: next_billing.into(),
7725            reference: reference.into(),
7726        }
7727    }
7728}
7729/// Unit of time between subscription charges.
7730#[derive(Copy, Clone, Eq, PartialEq)]
7731pub enum UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7732    Day,
7733    Month,
7734    Week,
7735    Year,
7736}
7737impl UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7738    pub fn as_str(self) -> &'static str {
7739        use UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
7740        match self {
7741            Day => "day",
7742            Month => "month",
7743            Week => "week",
7744            Year => "year",
7745        }
7746    }
7747}
7748
7749impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7750    type Err = stripe_types::StripeParseError;
7751    fn from_str(s: &str) -> Result<Self, Self::Err> {
7752        use UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
7753        match s {
7754            "day" => Ok(Day),
7755            "month" => Ok(Month),
7756            "week" => Ok(Week),
7757            "year" => Ok(Year),
7758            _ => Err(stripe_types::StripeParseError),
7759        }
7760    }
7761}
7762impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7763    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7764        f.write_str(self.as_str())
7765    }
7766}
7767
7768impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7769    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7770        f.write_str(self.as_str())
7771    }
7772}
7773impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7774    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7775    where
7776        S: serde::Serializer,
7777    {
7778        serializer.serialize_str(self.as_str())
7779    }
7780}
7781#[cfg(feature = "deserialize")]
7782impl<'de> serde::Deserialize<'de>
7783    for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
7784{
7785    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7786        use std::str::FromStr;
7787        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7788        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"))
7789    }
7790}
7791/// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options.
7792#[derive(Clone, Debug, serde::Serialize)]
7793pub struct UpdateSetupIntentPaymentMethodOptionsSepaDebit {
7794    /// Additional fields for Mandate creation
7795    #[serde(skip_serializing_if = "Option::is_none")]
7796    pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions>,
7797}
7798impl UpdateSetupIntentPaymentMethodOptionsSepaDebit {
7799    pub fn new() -> Self {
7800        Self { mandate_options: None }
7801    }
7802}
7803impl Default for UpdateSetupIntentPaymentMethodOptionsSepaDebit {
7804    fn default() -> Self {
7805        Self::new()
7806    }
7807}
7808/// Additional fields for Mandate creation
7809#[derive(Clone, Debug, serde::Serialize)]
7810pub struct UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
7811    /// Prefix used to generate the Mandate reference.
7812    /// Must be at most 12 characters long.
7813    /// Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'.
7814    /// Cannot begin with 'STRIPE'.
7815    #[serde(skip_serializing_if = "Option::is_none")]
7816    pub reference_prefix: Option<String>,
7817}
7818impl UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
7819    pub fn new() -> Self {
7820        Self { reference_prefix: None }
7821    }
7822}
7823impl Default for UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
7824    fn default() -> Self {
7825        Self::new()
7826    }
7827}
7828/// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options.
7829#[derive(Clone, Debug, serde::Serialize)]
7830pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccount {
7831    /// Additional fields for Financial Connections Session creation
7832    #[serde(skip_serializing_if = "Option::is_none")]
7833    pub financial_connections:
7834        Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
7835    /// Additional fields for Mandate creation
7836    #[serde(skip_serializing_if = "Option::is_none")]
7837    pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
7838    /// Additional fields for network related functions
7839    #[serde(skip_serializing_if = "Option::is_none")]
7840    pub networks: Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks>,
7841    /// Bank account verification method.
7842    #[serde(skip_serializing_if = "Option::is_none")]
7843    pub verification_method:
7844        Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
7845}
7846impl UpdateSetupIntentPaymentMethodOptionsUsBankAccount {
7847    pub fn new() -> Self {
7848        Self {
7849            financial_connections: None,
7850            mandate_options: None,
7851            networks: None,
7852            verification_method: None,
7853        }
7854    }
7855}
7856impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccount {
7857    fn default() -> Self {
7858        Self::new()
7859    }
7860}
7861/// Additional fields for Financial Connections Session creation
7862#[derive(Clone, Debug, serde::Serialize)]
7863pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
7864    /// Provide filters for the linked accounts that the customer can select for the payment method.
7865    #[serde(skip_serializing_if = "Option::is_none")]
7866    pub filters:
7867        Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
7868    /// The list of permissions to request.
7869    /// If this parameter is passed, the `payment_method` permission must be included.
7870    /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
7871    #[serde(skip_serializing_if = "Option::is_none")]
7872    pub permissions: Option<
7873        Vec<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
7874    >,
7875    /// List of data features that you would like to retrieve upon account creation.
7876    #[serde(skip_serializing_if = "Option::is_none")]
7877    pub prefetch:
7878        Option<Vec<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>>,
7879    /// For webview integrations only.
7880    /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.
7881    #[serde(skip_serializing_if = "Option::is_none")]
7882    pub return_url: Option<String>,
7883}
7884impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
7885    pub fn new() -> Self {
7886        Self { filters: None, permissions: None, prefetch: None, return_url: None }
7887    }
7888}
7889impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
7890    fn default() -> Self {
7891        Self::new()
7892    }
7893}
7894/// Provide filters for the linked accounts that the customer can select for the payment method.
7895#[derive(Clone, Debug, serde::Serialize)]
7896pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
7897        /// The account subcategories to use to filter for selectable accounts.
7898    /// Valid subcategories are `checking` and `savings`.
7899#[serde(skip_serializing_if = "Option::is_none")]
7900pub account_subcategories: Option<Vec<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
7901
7902}
7903impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
7904    pub fn new() -> Self {
7905        Self { account_subcategories: None }
7906    }
7907}
7908impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
7909    fn default() -> Self {
7910        Self::new()
7911    }
7912}
7913/// The account subcategories to use to filter for selectable accounts.
7914/// Valid subcategories are `checking` and `savings`.
7915#[derive(Copy, Clone, Eq, PartialEq)]
7916pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
7917{
7918    Checking,
7919    Savings,
7920}
7921impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
7922    pub fn as_str(self) -> &'static str {
7923        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
7924        match self {
7925Checking => "checking",
7926Savings => "savings",
7927
7928        }
7929    }
7930}
7931
7932impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
7933    type Err = stripe_types::StripeParseError;
7934    fn from_str(s: &str) -> Result<Self, Self::Err> {
7935        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
7936        match s {
7937    "checking" => Ok(Checking),
7938"savings" => Ok(Savings),
7939_ => Err(stripe_types::StripeParseError)
7940
7941        }
7942    }
7943}
7944impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
7945    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7946        f.write_str(self.as_str())
7947    }
7948}
7949
7950impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
7951    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7952        f.write_str(self.as_str())
7953    }
7954}
7955impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
7956    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
7957        serializer.serialize_str(self.as_str())
7958    }
7959}
7960#[cfg(feature = "deserialize")]
7961impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
7962    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7963        use std::str::FromStr;
7964        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7965        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"))
7966    }
7967}
7968/// The list of permissions to request.
7969/// If this parameter is passed, the `payment_method` permission must be included.
7970/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
7971#[derive(Copy, Clone, Eq, PartialEq)]
7972pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
7973    Balances,
7974    Ownership,
7975    PaymentMethod,
7976    Transactions,
7977}
7978impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
7979    pub fn as_str(self) -> &'static str {
7980        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
7981        match self {
7982            Balances => "balances",
7983            Ownership => "ownership",
7984            PaymentMethod => "payment_method",
7985            Transactions => "transactions",
7986        }
7987    }
7988}
7989
7990impl std::str::FromStr
7991    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
7992{
7993    type Err = stripe_types::StripeParseError;
7994    fn from_str(s: &str) -> Result<Self, Self::Err> {
7995        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
7996        match s {
7997            "balances" => Ok(Balances),
7998            "ownership" => Ok(Ownership),
7999            "payment_method" => Ok(PaymentMethod),
8000            "transactions" => Ok(Transactions),
8001            _ => Err(stripe_types::StripeParseError),
8002        }
8003    }
8004}
8005impl std::fmt::Display
8006    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
8007{
8008    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8009        f.write_str(self.as_str())
8010    }
8011}
8012
8013impl std::fmt::Debug
8014    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
8015{
8016    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8017        f.write_str(self.as_str())
8018    }
8019}
8020impl serde::Serialize
8021    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
8022{
8023    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8024    where
8025        S: serde::Serializer,
8026    {
8027        serializer.serialize_str(self.as_str())
8028    }
8029}
8030#[cfg(feature = "deserialize")]
8031impl<'de> serde::Deserialize<'de>
8032    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
8033{
8034    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8035        use std::str::FromStr;
8036        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8037        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"))
8038    }
8039}
8040/// List of data features that you would like to retrieve upon account creation.
8041#[derive(Copy, Clone, Eq, PartialEq)]
8042pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
8043    Balances,
8044    Ownership,
8045    Transactions,
8046}
8047impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
8048    pub fn as_str(self) -> &'static str {
8049        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
8050        match self {
8051            Balances => "balances",
8052            Ownership => "ownership",
8053            Transactions => "transactions",
8054        }
8055    }
8056}
8057
8058impl std::str::FromStr
8059    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
8060{
8061    type Err = stripe_types::StripeParseError;
8062    fn from_str(s: &str) -> Result<Self, Self::Err> {
8063        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
8064        match s {
8065            "balances" => Ok(Balances),
8066            "ownership" => Ok(Ownership),
8067            "transactions" => Ok(Transactions),
8068            _ => Err(stripe_types::StripeParseError),
8069        }
8070    }
8071}
8072impl std::fmt::Display
8073    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
8074{
8075    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8076        f.write_str(self.as_str())
8077    }
8078}
8079
8080impl std::fmt::Debug
8081    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
8082{
8083    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8084        f.write_str(self.as_str())
8085    }
8086}
8087impl serde::Serialize
8088    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
8089{
8090    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8091    where
8092        S: serde::Serializer,
8093    {
8094        serializer.serialize_str(self.as_str())
8095    }
8096}
8097#[cfg(feature = "deserialize")]
8098impl<'de> serde::Deserialize<'de>
8099    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
8100{
8101    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8102        use std::str::FromStr;
8103        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8104        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"))
8105    }
8106}
8107/// Additional fields for Mandate creation
8108#[derive(Copy, Clone, Debug, serde::Serialize)]
8109pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
8110    /// The method used to collect offline mandate customer acceptance.
8111    #[serde(skip_serializing_if = "Option::is_none")]
8112    pub collection_method:
8113        Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
8114}
8115impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
8116    pub fn new() -> Self {
8117        Self { collection_method: None }
8118    }
8119}
8120impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
8121    fn default() -> Self {
8122        Self::new()
8123    }
8124}
8125/// The method used to collect offline mandate customer acceptance.
8126#[derive(Copy, Clone, Eq, PartialEq)]
8127pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
8128    Paper,
8129}
8130impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
8131    pub fn as_str(self) -> &'static str {
8132        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
8133        match self {
8134            Paper => "paper",
8135        }
8136    }
8137}
8138
8139impl std::str::FromStr
8140    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
8141{
8142    type Err = stripe_types::StripeParseError;
8143    fn from_str(s: &str) -> Result<Self, Self::Err> {
8144        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
8145        match s {
8146            "paper" => Ok(Paper),
8147            _ => Err(stripe_types::StripeParseError),
8148        }
8149    }
8150}
8151impl std::fmt::Display
8152    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
8153{
8154    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8155        f.write_str(self.as_str())
8156    }
8157}
8158
8159impl std::fmt::Debug
8160    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
8161{
8162    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8163        f.write_str(self.as_str())
8164    }
8165}
8166impl serde::Serialize
8167    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
8168{
8169    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8170    where
8171        S: serde::Serializer,
8172    {
8173        serializer.serialize_str(self.as_str())
8174    }
8175}
8176#[cfg(feature = "deserialize")]
8177impl<'de> serde::Deserialize<'de>
8178    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
8179{
8180    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8181        use std::str::FromStr;
8182        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8183        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"))
8184    }
8185}
8186/// Additional fields for network related functions
8187#[derive(Clone, Debug, serde::Serialize)]
8188pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
8189    /// Triggers validations to run across the selected networks
8190    #[serde(skip_serializing_if = "Option::is_none")]
8191    pub requested: Option<Vec<UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
8192}
8193impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
8194    pub fn new() -> Self {
8195        Self { requested: None }
8196    }
8197}
8198impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
8199    fn default() -> Self {
8200        Self::new()
8201    }
8202}
8203/// Triggers validations to run across the selected networks
8204#[derive(Copy, Clone, Eq, PartialEq)]
8205pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
8206    Ach,
8207    UsDomesticWire,
8208}
8209impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
8210    pub fn as_str(self) -> &'static str {
8211        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
8212        match self {
8213            Ach => "ach",
8214            UsDomesticWire => "us_domestic_wire",
8215        }
8216    }
8217}
8218
8219impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
8220    type Err = stripe_types::StripeParseError;
8221    fn from_str(s: &str) -> Result<Self, Self::Err> {
8222        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
8223        match s {
8224            "ach" => Ok(Ach),
8225            "us_domestic_wire" => Ok(UsDomesticWire),
8226            _ => Err(stripe_types::StripeParseError),
8227        }
8228    }
8229}
8230impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
8231    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8232        f.write_str(self.as_str())
8233    }
8234}
8235
8236impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
8237    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8238        f.write_str(self.as_str())
8239    }
8240}
8241impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
8242    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8243    where
8244        S: serde::Serializer,
8245    {
8246        serializer.serialize_str(self.as_str())
8247    }
8248}
8249#[cfg(feature = "deserialize")]
8250impl<'de> serde::Deserialize<'de>
8251    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested
8252{
8253    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8254        use std::str::FromStr;
8255        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8256        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested"))
8257    }
8258}
8259/// Bank account verification method.
8260#[derive(Copy, Clone, Eq, PartialEq)]
8261pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
8262    Automatic,
8263    Instant,
8264    Microdeposits,
8265}
8266impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
8267    pub fn as_str(self) -> &'static str {
8268        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
8269        match self {
8270            Automatic => "automatic",
8271            Instant => "instant",
8272            Microdeposits => "microdeposits",
8273        }
8274    }
8275}
8276
8277impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
8278    type Err = stripe_types::StripeParseError;
8279    fn from_str(s: &str) -> Result<Self, Self::Err> {
8280        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
8281        match s {
8282            "automatic" => Ok(Automatic),
8283            "instant" => Ok(Instant),
8284            "microdeposits" => Ok(Microdeposits),
8285            _ => Err(stripe_types::StripeParseError),
8286        }
8287    }
8288}
8289impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
8290    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8291        f.write_str(self.as_str())
8292    }
8293}
8294
8295impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
8296    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8297        f.write_str(self.as_str())
8298    }
8299}
8300impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
8301    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8302    where
8303        S: serde::Serializer,
8304    {
8305        serializer.serialize_str(self.as_str())
8306    }
8307}
8308#[cfg(feature = "deserialize")]
8309impl<'de> serde::Deserialize<'de>
8310    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod
8311{
8312    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8313        use std::str::FromStr;
8314        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8315        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod"))
8316    }
8317}
8318/// Updates a SetupIntent object.
8319#[derive(Clone, Debug, serde::Serialize)]
8320pub struct UpdateSetupIntent {
8321    inner: UpdateSetupIntentBuilder,
8322    intent: stripe_shared::SetupIntentId,
8323}
8324impl UpdateSetupIntent {
8325    /// Construct a new `UpdateSetupIntent`.
8326    pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
8327        Self { intent: intent.into(), inner: UpdateSetupIntentBuilder::new() }
8328    }
8329    /// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.
8330    ///
8331    /// It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers.
8332    /// 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.
8333    pub fn attach_to_self(mut self, attach_to_self: impl Into<bool>) -> Self {
8334        self.inner.attach_to_self = Some(attach_to_self.into());
8335        self
8336    }
8337    /// ID of the Customer this SetupIntent belongs to, if one exists.
8338    ///
8339    /// If present, the SetupIntent's payment method will be attached to the Customer on successful setup.
8340    /// Payment methods attached to other Customers cannot be used with this SetupIntent.
8341    pub fn customer(mut self, customer: impl Into<String>) -> Self {
8342        self.inner.customer = Some(customer.into());
8343        self
8344    }
8345    /// An arbitrary string attached to the object. Often useful for displaying to users.
8346    pub fn description(mut self, description: impl Into<String>) -> Self {
8347        self.inner.description = Some(description.into());
8348        self
8349    }
8350    /// The list of payment method types to exclude from use with this SetupIntent.
8351    pub fn excluded_payment_method_types(
8352        mut self,
8353        excluded_payment_method_types: impl Into<
8354            Vec<stripe_shared::SetupIntentExcludedPaymentMethodTypes>,
8355        >,
8356    ) -> Self {
8357        self.inner.excluded_payment_method_types = Some(excluded_payment_method_types.into());
8358        self
8359    }
8360    /// Specifies which fields in the response should be expanded.
8361    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
8362        self.inner.expand = Some(expand.into());
8363        self
8364    }
8365    /// Indicates the directions of money movement for which this payment method is intended to be used.
8366    ///
8367    /// Include `inbound` if you intend to use the payment method as the origin to pull funds from.
8368    /// Include `outbound` if you intend to use the payment method as the destination to send funds to.
8369    /// You can include both if you intend to use the payment method for both purposes.
8370    pub fn flow_directions(
8371        mut self,
8372        flow_directions: impl Into<Vec<stripe_shared::SetupIntentFlowDirections>>,
8373    ) -> Self {
8374        self.inner.flow_directions = Some(flow_directions.into());
8375        self
8376    }
8377    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
8378    /// This can be useful for storing additional information about the object in a structured format.
8379    /// Individual keys can be unset by posting an empty value to them.
8380    /// All keys can be unset by posting an empty value to `metadata`.
8381    pub fn metadata(
8382        mut self,
8383        metadata: impl Into<std::collections::HashMap<String, String>>,
8384    ) -> Self {
8385        self.inner.metadata = Some(metadata.into());
8386        self
8387    }
8388    /// ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent.
8389    /// To unset this field to null, pass in an empty string.
8390    pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
8391        self.inner.payment_method = Some(payment_method.into());
8392        self
8393    }
8394    /// The ID of the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) to use with this SetupIntent.
8395    pub fn payment_method_configuration(
8396        mut self,
8397        payment_method_configuration: impl Into<String>,
8398    ) -> Self {
8399        self.inner.payment_method_configuration = Some(payment_method_configuration.into());
8400        self
8401    }
8402    /// When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method).
8403    /// value in the SetupIntent.
8404    pub fn payment_method_data(
8405        mut self,
8406        payment_method_data: impl Into<UpdateSetupIntentPaymentMethodData>,
8407    ) -> Self {
8408        self.inner.payment_method_data = Some(payment_method_data.into());
8409        self
8410    }
8411    /// Payment method-specific configuration for this SetupIntent.
8412    pub fn payment_method_options(
8413        mut self,
8414        payment_method_options: impl Into<UpdateSetupIntentPaymentMethodOptions>,
8415    ) -> Self {
8416        self.inner.payment_method_options = Some(payment_method_options.into());
8417        self
8418    }
8419    /// The list of payment method types (for example, card) that this SetupIntent can set up.
8420    /// 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).
8421    /// A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type).
8422    pub fn payment_method_types(mut self, payment_method_types: impl Into<Vec<String>>) -> Self {
8423        self.inner.payment_method_types = Some(payment_method_types.into());
8424        self
8425    }
8426}
8427impl UpdateSetupIntent {
8428    /// Send the request and return the deserialized response.
8429    pub async fn send<C: StripeClient>(
8430        &self,
8431        client: &C,
8432    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
8433        self.customize().send(client).await
8434    }
8435
8436    /// Send the request and return the deserialized response, blocking until completion.
8437    pub fn send_blocking<C: StripeBlockingClient>(
8438        &self,
8439        client: &C,
8440    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
8441        self.customize().send_blocking(client)
8442    }
8443}
8444
8445impl StripeRequest for UpdateSetupIntent {
8446    type Output = stripe_shared::SetupIntent;
8447
8448    fn build(&self) -> RequestBuilder {
8449        let intent = &self.intent;
8450        RequestBuilder::new(StripeMethod::Post, format!("/setup_intents/{intent}"))
8451            .form(&self.inner)
8452    }
8453}
8454#[derive(Clone, Debug, serde::Serialize)]
8455struct CancelSetupIntentBuilder {
8456    #[serde(skip_serializing_if = "Option::is_none")]
8457    cancellation_reason: Option<stripe_shared::SetupIntentCancellationReason>,
8458    #[serde(skip_serializing_if = "Option::is_none")]
8459    expand: Option<Vec<String>>,
8460}
8461impl CancelSetupIntentBuilder {
8462    fn new() -> Self {
8463        Self { cancellation_reason: None, expand: None }
8464    }
8465}
8466/// You can cancel a SetupIntent object when it’s in one of these statuses: `requires_payment_method`, `requires_confirmation`, or `requires_action`.
8467///
8468///
8469/// After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error.
8470/// You can’t cancel the SetupIntent for a Checkout Session.
8471/// [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead.
8472#[derive(Clone, Debug, serde::Serialize)]
8473pub struct CancelSetupIntent {
8474    inner: CancelSetupIntentBuilder,
8475    intent: stripe_shared::SetupIntentId,
8476}
8477impl CancelSetupIntent {
8478    /// Construct a new `CancelSetupIntent`.
8479    pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
8480        Self { intent: intent.into(), inner: CancelSetupIntentBuilder::new() }
8481    }
8482    /// Reason for canceling this SetupIntent.
8483    /// Possible values are: `abandoned`, `requested_by_customer`, or `duplicate`.
8484    pub fn cancellation_reason(
8485        mut self,
8486        cancellation_reason: impl Into<stripe_shared::SetupIntentCancellationReason>,
8487    ) -> Self {
8488        self.inner.cancellation_reason = Some(cancellation_reason.into());
8489        self
8490    }
8491    /// Specifies which fields in the response should be expanded.
8492    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
8493        self.inner.expand = Some(expand.into());
8494        self
8495    }
8496}
8497impl CancelSetupIntent {
8498    /// Send the request and return the deserialized response.
8499    pub async fn send<C: StripeClient>(
8500        &self,
8501        client: &C,
8502    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
8503        self.customize().send(client).await
8504    }
8505
8506    /// Send the request and return the deserialized response, blocking until completion.
8507    pub fn send_blocking<C: StripeBlockingClient>(
8508        &self,
8509        client: &C,
8510    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
8511        self.customize().send_blocking(client)
8512    }
8513}
8514
8515impl StripeRequest for CancelSetupIntent {
8516    type Output = stripe_shared::SetupIntent;
8517
8518    fn build(&self) -> RequestBuilder {
8519        let intent = &self.intent;
8520        RequestBuilder::new(StripeMethod::Post, format!("/setup_intents/{intent}/cancel"))
8521            .form(&self.inner)
8522    }
8523}
8524#[derive(Clone, Debug, serde::Serialize)]
8525struct ConfirmSetupIntentBuilder {
8526    #[serde(skip_serializing_if = "Option::is_none")]
8527    confirmation_token: Option<String>,
8528    #[serde(skip_serializing_if = "Option::is_none")]
8529    expand: Option<Vec<String>>,
8530    #[serde(skip_serializing_if = "Option::is_none")]
8531    mandate_data: Option<ConfirmSetupIntentMandateData>,
8532    #[serde(skip_serializing_if = "Option::is_none")]
8533    payment_method: Option<String>,
8534    #[serde(skip_serializing_if = "Option::is_none")]
8535    payment_method_data: Option<ConfirmSetupIntentPaymentMethodData>,
8536    #[serde(skip_serializing_if = "Option::is_none")]
8537    payment_method_options: Option<ConfirmSetupIntentPaymentMethodOptions>,
8538    #[serde(skip_serializing_if = "Option::is_none")]
8539    return_url: Option<String>,
8540    #[serde(skip_serializing_if = "Option::is_none")]
8541    use_stripe_sdk: Option<bool>,
8542}
8543impl ConfirmSetupIntentBuilder {
8544    fn new() -> Self {
8545        Self {
8546            confirmation_token: None,
8547            expand: None,
8548            mandate_data: None,
8549            payment_method: None,
8550            payment_method_data: None,
8551            payment_method_options: None,
8552            return_url: None,
8553            use_stripe_sdk: None,
8554        }
8555    }
8556}
8557#[derive(Clone, Debug, serde::Serialize)]
8558#[serde(rename_all = "snake_case")]
8559pub enum ConfirmSetupIntentMandateData {
8560    #[serde(untagged)]
8561    SecretKeyParam(ConfirmSetupIntentSecretKeyParam),
8562    #[serde(untagged)]
8563    ClientKeyParam(ConfirmSetupIntentClientKeyParam),
8564}
8565#[derive(Clone, Debug, serde::Serialize)]
8566pub struct ConfirmSetupIntentSecretKeyParam {
8567    /// This hash contains details about the customer acceptance of the Mandate.
8568    pub customer_acceptance: ConfirmSetupIntentSecretKeyParamCustomerAcceptance,
8569}
8570impl ConfirmSetupIntentSecretKeyParam {
8571    pub fn new(
8572        customer_acceptance: impl Into<ConfirmSetupIntentSecretKeyParamCustomerAcceptance>,
8573    ) -> Self {
8574        Self { customer_acceptance: customer_acceptance.into() }
8575    }
8576}
8577/// This hash contains details about the customer acceptance of the Mandate.
8578#[derive(Clone, Debug, serde::Serialize)]
8579pub struct ConfirmSetupIntentSecretKeyParamCustomerAcceptance {
8580    /// The time at which the customer accepted the Mandate.
8581    #[serde(skip_serializing_if = "Option::is_none")]
8582    pub accepted_at: Option<stripe_types::Timestamp>,
8583    /// If this is a Mandate accepted offline, this hash contains details about the offline acceptance.
8584    #[serde(skip_serializing_if = "Option::is_none")]
8585    #[serde(with = "stripe_types::with_serde_json_opt")]
8586    pub offline: Option<miniserde::json::Value>,
8587    /// If this is a Mandate accepted online, this hash contains details about the online acceptance.
8588    #[serde(skip_serializing_if = "Option::is_none")]
8589    pub online: Option<OnlineParam>,
8590    /// The type of customer acceptance information included with the Mandate.
8591    /// One of `online` or `offline`.
8592    #[serde(rename = "type")]
8593    pub type_: ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType,
8594}
8595impl ConfirmSetupIntentSecretKeyParamCustomerAcceptance {
8596    pub fn new(type_: impl Into<ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType>) -> Self {
8597        Self { accepted_at: None, offline: None, online: None, type_: type_.into() }
8598    }
8599}
8600/// The type of customer acceptance information included with the Mandate.
8601/// One of `online` or `offline`.
8602#[derive(Copy, Clone, Eq, PartialEq)]
8603pub enum ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
8604    Offline,
8605    Online,
8606}
8607impl ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
8608    pub fn as_str(self) -> &'static str {
8609        use ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType::*;
8610        match self {
8611            Offline => "offline",
8612            Online => "online",
8613        }
8614    }
8615}
8616
8617impl std::str::FromStr for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
8618    type Err = stripe_types::StripeParseError;
8619    fn from_str(s: &str) -> Result<Self, Self::Err> {
8620        use ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType::*;
8621        match s {
8622            "offline" => Ok(Offline),
8623            "online" => Ok(Online),
8624            _ => Err(stripe_types::StripeParseError),
8625        }
8626    }
8627}
8628impl std::fmt::Display for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
8629    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8630        f.write_str(self.as_str())
8631    }
8632}
8633
8634impl std::fmt::Debug for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
8635    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8636        f.write_str(self.as_str())
8637    }
8638}
8639impl serde::Serialize for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
8640    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8641    where
8642        S: serde::Serializer,
8643    {
8644        serializer.serialize_str(self.as_str())
8645    }
8646}
8647#[cfg(feature = "deserialize")]
8648impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
8649    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8650        use std::str::FromStr;
8651        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8652        Self::from_str(&s).map_err(|_| {
8653            serde::de::Error::custom(
8654                "Unknown value for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType",
8655            )
8656        })
8657    }
8658}
8659#[derive(Clone, Debug, serde::Serialize)]
8660pub struct ConfirmSetupIntentClientKeyParam {
8661    /// This hash contains details about the customer acceptance of the Mandate.
8662    pub customer_acceptance: ConfirmSetupIntentClientKeyParamCustomerAcceptance,
8663}
8664impl ConfirmSetupIntentClientKeyParam {
8665    pub fn new(
8666        customer_acceptance: impl Into<ConfirmSetupIntentClientKeyParamCustomerAcceptance>,
8667    ) -> Self {
8668        Self { customer_acceptance: customer_acceptance.into() }
8669    }
8670}
8671/// This hash contains details about the customer acceptance of the Mandate.
8672#[derive(Clone, Debug, serde::Serialize)]
8673pub struct ConfirmSetupIntentClientKeyParamCustomerAcceptance {
8674    /// If this is a Mandate accepted online, this hash contains details about the online acceptance.
8675    pub online: ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline,
8676    /// The type of customer acceptance information included with the Mandate.
8677    #[serde(rename = "type")]
8678    pub type_: ConfirmSetupIntentClientKeyParamCustomerAcceptanceType,
8679}
8680impl ConfirmSetupIntentClientKeyParamCustomerAcceptance {
8681    pub fn new(
8682        online: impl Into<ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline>,
8683        type_: impl Into<ConfirmSetupIntentClientKeyParamCustomerAcceptanceType>,
8684    ) -> Self {
8685        Self { online: online.into(), type_: type_.into() }
8686    }
8687}
8688/// If this is a Mandate accepted online, this hash contains details about the online acceptance.
8689#[derive(Clone, Debug, serde::Serialize)]
8690pub struct ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline {
8691    /// The IP address from which the Mandate was accepted by the customer.
8692    #[serde(skip_serializing_if = "Option::is_none")]
8693    pub ip_address: Option<String>,
8694    /// The user agent of the browser from which the Mandate was accepted by the customer.
8695    #[serde(skip_serializing_if = "Option::is_none")]
8696    pub user_agent: Option<String>,
8697}
8698impl ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline {
8699    pub fn new() -> Self {
8700        Self { ip_address: None, user_agent: None }
8701    }
8702}
8703impl Default for ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline {
8704    fn default() -> Self {
8705        Self::new()
8706    }
8707}
8708/// The type of customer acceptance information included with the Mandate.
8709#[derive(Copy, Clone, Eq, PartialEq)]
8710pub enum ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
8711    Online,
8712}
8713impl ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
8714    pub fn as_str(self) -> &'static str {
8715        use ConfirmSetupIntentClientKeyParamCustomerAcceptanceType::*;
8716        match self {
8717            Online => "online",
8718        }
8719    }
8720}
8721
8722impl std::str::FromStr for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
8723    type Err = stripe_types::StripeParseError;
8724    fn from_str(s: &str) -> Result<Self, Self::Err> {
8725        use ConfirmSetupIntentClientKeyParamCustomerAcceptanceType::*;
8726        match s {
8727            "online" => Ok(Online),
8728            _ => Err(stripe_types::StripeParseError),
8729        }
8730    }
8731}
8732impl std::fmt::Display for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
8733    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8734        f.write_str(self.as_str())
8735    }
8736}
8737
8738impl std::fmt::Debug for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
8739    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8740        f.write_str(self.as_str())
8741    }
8742}
8743impl serde::Serialize for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
8744    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8745    where
8746        S: serde::Serializer,
8747    {
8748        serializer.serialize_str(self.as_str())
8749    }
8750}
8751#[cfg(feature = "deserialize")]
8752impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
8753    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8754        use std::str::FromStr;
8755        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8756        Self::from_str(&s).map_err(|_| {
8757            serde::de::Error::custom(
8758                "Unknown value for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType",
8759            )
8760        })
8761    }
8762}
8763/// When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method).
8764/// value in the SetupIntent.
8765#[derive(Clone, Debug, serde::Serialize)]
8766pub struct ConfirmSetupIntentPaymentMethodData {
8767    /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
8768    #[serde(skip_serializing_if = "Option::is_none")]
8769    pub acss_debit: Option<PaymentMethodParam>,
8770    /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
8771    #[serde(skip_serializing_if = "Option::is_none")]
8772    #[serde(with = "stripe_types::with_serde_json_opt")]
8773    pub affirm: Option<miniserde::json::Value>,
8774    /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
8775    #[serde(skip_serializing_if = "Option::is_none")]
8776    #[serde(with = "stripe_types::with_serde_json_opt")]
8777    pub afterpay_clearpay: Option<miniserde::json::Value>,
8778    /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
8779    #[serde(skip_serializing_if = "Option::is_none")]
8780    #[serde(with = "stripe_types::with_serde_json_opt")]
8781    pub alipay: Option<miniserde::json::Value>,
8782    /// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
8783    /// 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.
8784    /// The field defaults to `unspecified`.
8785    #[serde(skip_serializing_if = "Option::is_none")]
8786    pub allow_redisplay: Option<ConfirmSetupIntentPaymentMethodDataAllowRedisplay>,
8787    /// If this is a Alma PaymentMethod, this hash contains details about the Alma payment method.
8788    #[serde(skip_serializing_if = "Option::is_none")]
8789    #[serde(with = "stripe_types::with_serde_json_opt")]
8790    pub alma: Option<miniserde::json::Value>,
8791    /// If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method.
8792    #[serde(skip_serializing_if = "Option::is_none")]
8793    #[serde(with = "stripe_types::with_serde_json_opt")]
8794    pub amazon_pay: Option<miniserde::json::Value>,
8795    /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
8796    #[serde(skip_serializing_if = "Option::is_none")]
8797    pub au_becs_debit: Option<ConfirmSetupIntentPaymentMethodDataAuBecsDebit>,
8798    /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
8799    #[serde(skip_serializing_if = "Option::is_none")]
8800    pub bacs_debit: Option<ConfirmSetupIntentPaymentMethodDataBacsDebit>,
8801    /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
8802    #[serde(skip_serializing_if = "Option::is_none")]
8803    #[serde(with = "stripe_types::with_serde_json_opt")]
8804    pub bancontact: Option<miniserde::json::Value>,
8805    /// If this is a `billie` PaymentMethod, this hash contains details about the Billie payment method.
8806    #[serde(skip_serializing_if = "Option::is_none")]
8807    #[serde(with = "stripe_types::with_serde_json_opt")]
8808    pub billie: Option<miniserde::json::Value>,
8809    /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
8810    #[serde(skip_serializing_if = "Option::is_none")]
8811    pub billing_details: Option<BillingDetailsInnerParams>,
8812    /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
8813    #[serde(skip_serializing_if = "Option::is_none")]
8814    #[serde(with = "stripe_types::with_serde_json_opt")]
8815    pub blik: Option<miniserde::json::Value>,
8816    /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
8817    #[serde(skip_serializing_if = "Option::is_none")]
8818    pub boleto: Option<ConfirmSetupIntentPaymentMethodDataBoleto>,
8819    /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
8820    #[serde(skip_serializing_if = "Option::is_none")]
8821    #[serde(with = "stripe_types::with_serde_json_opt")]
8822    pub cashapp: Option<miniserde::json::Value>,
8823    /// If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method.
8824    #[serde(skip_serializing_if = "Option::is_none")]
8825    #[serde(with = "stripe_types::with_serde_json_opt")]
8826    pub crypto: Option<miniserde::json::Value>,
8827    /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
8828    #[serde(skip_serializing_if = "Option::is_none")]
8829    #[serde(with = "stripe_types::with_serde_json_opt")]
8830    pub customer_balance: Option<miniserde::json::Value>,
8831    /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
8832    #[serde(skip_serializing_if = "Option::is_none")]
8833    pub eps: Option<ConfirmSetupIntentPaymentMethodDataEps>,
8834    /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
8835    #[serde(skip_serializing_if = "Option::is_none")]
8836    pub fpx: Option<ConfirmSetupIntentPaymentMethodDataFpx>,
8837    /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
8838    #[serde(skip_serializing_if = "Option::is_none")]
8839    #[serde(with = "stripe_types::with_serde_json_opt")]
8840    pub giropay: Option<miniserde::json::Value>,
8841    /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
8842    #[serde(skip_serializing_if = "Option::is_none")]
8843    #[serde(with = "stripe_types::with_serde_json_opt")]
8844    pub grabpay: Option<miniserde::json::Value>,
8845    /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
8846    #[serde(skip_serializing_if = "Option::is_none")]
8847    pub ideal: Option<ConfirmSetupIntentPaymentMethodDataIdeal>,
8848    /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
8849    #[serde(skip_serializing_if = "Option::is_none")]
8850    #[serde(with = "stripe_types::with_serde_json_opt")]
8851    pub interac_present: Option<miniserde::json::Value>,
8852    /// If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method.
8853    #[serde(skip_serializing_if = "Option::is_none")]
8854    #[serde(with = "stripe_types::with_serde_json_opt")]
8855    pub kakao_pay: Option<miniserde::json::Value>,
8856    /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
8857    #[serde(skip_serializing_if = "Option::is_none")]
8858    pub klarna: Option<ConfirmSetupIntentPaymentMethodDataKlarna>,
8859    /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
8860    #[serde(skip_serializing_if = "Option::is_none")]
8861    #[serde(with = "stripe_types::with_serde_json_opt")]
8862    pub konbini: Option<miniserde::json::Value>,
8863    /// If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method.
8864    #[serde(skip_serializing_if = "Option::is_none")]
8865    #[serde(with = "stripe_types::with_serde_json_opt")]
8866    pub kr_card: Option<miniserde::json::Value>,
8867    /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
8868    #[serde(skip_serializing_if = "Option::is_none")]
8869    #[serde(with = "stripe_types::with_serde_json_opt")]
8870    pub link: Option<miniserde::json::Value>,
8871    /// If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method.
8872    #[serde(skip_serializing_if = "Option::is_none")]
8873    #[serde(with = "stripe_types::with_serde_json_opt")]
8874    pub mb_way: Option<miniserde::json::Value>,
8875    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
8876    /// This can be useful for storing additional information about the object in a structured format.
8877    /// Individual keys can be unset by posting an empty value to them.
8878    /// All keys can be unset by posting an empty value to `metadata`.
8879    #[serde(skip_serializing_if = "Option::is_none")]
8880    pub metadata: Option<std::collections::HashMap<String, String>>,
8881    /// If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
8882    #[serde(skip_serializing_if = "Option::is_none")]
8883    #[serde(with = "stripe_types::with_serde_json_opt")]
8884    pub mobilepay: Option<miniserde::json::Value>,
8885    /// If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method.
8886    #[serde(skip_serializing_if = "Option::is_none")]
8887    #[serde(with = "stripe_types::with_serde_json_opt")]
8888    pub multibanco: Option<miniserde::json::Value>,
8889    /// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
8890    #[serde(skip_serializing_if = "Option::is_none")]
8891    pub naver_pay: Option<ConfirmSetupIntentPaymentMethodDataNaverPay>,
8892    /// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
8893    #[serde(skip_serializing_if = "Option::is_none")]
8894    pub nz_bank_account: Option<ConfirmSetupIntentPaymentMethodDataNzBankAccount>,
8895    /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
8896    #[serde(skip_serializing_if = "Option::is_none")]
8897    #[serde(with = "stripe_types::with_serde_json_opt")]
8898    pub oxxo: Option<miniserde::json::Value>,
8899    /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
8900    #[serde(skip_serializing_if = "Option::is_none")]
8901    pub p24: Option<ConfirmSetupIntentPaymentMethodDataP24>,
8902    /// If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method.
8903    #[serde(skip_serializing_if = "Option::is_none")]
8904    #[serde(with = "stripe_types::with_serde_json_opt")]
8905    pub pay_by_bank: Option<miniserde::json::Value>,
8906    /// If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method.
8907    #[serde(skip_serializing_if = "Option::is_none")]
8908    #[serde(with = "stripe_types::with_serde_json_opt")]
8909    pub payco: Option<miniserde::json::Value>,
8910    /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
8911    #[serde(skip_serializing_if = "Option::is_none")]
8912    #[serde(with = "stripe_types::with_serde_json_opt")]
8913    pub paynow: Option<miniserde::json::Value>,
8914    /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
8915    #[serde(skip_serializing_if = "Option::is_none")]
8916    #[serde(with = "stripe_types::with_serde_json_opt")]
8917    pub paypal: Option<miniserde::json::Value>,
8918    /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
8919    #[serde(skip_serializing_if = "Option::is_none")]
8920    #[serde(with = "stripe_types::with_serde_json_opt")]
8921    pub pix: Option<miniserde::json::Value>,
8922    /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
8923    #[serde(skip_serializing_if = "Option::is_none")]
8924    #[serde(with = "stripe_types::with_serde_json_opt")]
8925    pub promptpay: Option<miniserde::json::Value>,
8926    /// Options to configure Radar.
8927    /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
8928    #[serde(skip_serializing_if = "Option::is_none")]
8929    pub radar_options: Option<RadarOptionsWithHiddenOptions>,
8930    /// If this is a `revolut_pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
8931    #[serde(skip_serializing_if = "Option::is_none")]
8932    #[serde(with = "stripe_types::with_serde_json_opt")]
8933    pub revolut_pay: Option<miniserde::json::Value>,
8934    /// If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method.
8935    #[serde(skip_serializing_if = "Option::is_none")]
8936    #[serde(with = "stripe_types::with_serde_json_opt")]
8937    pub samsung_pay: Option<miniserde::json::Value>,
8938    /// If this is a `satispay` PaymentMethod, this hash contains details about the Satispay payment method.
8939    #[serde(skip_serializing_if = "Option::is_none")]
8940    #[serde(with = "stripe_types::with_serde_json_opt")]
8941    pub satispay: Option<miniserde::json::Value>,
8942    /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
8943    #[serde(skip_serializing_if = "Option::is_none")]
8944    pub sepa_debit: Option<ConfirmSetupIntentPaymentMethodDataSepaDebit>,
8945    /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
8946    #[serde(skip_serializing_if = "Option::is_none")]
8947    pub sofort: Option<ConfirmSetupIntentPaymentMethodDataSofort>,
8948    /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
8949    #[serde(skip_serializing_if = "Option::is_none")]
8950    #[serde(with = "stripe_types::with_serde_json_opt")]
8951    pub swish: Option<miniserde::json::Value>,
8952    /// If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method.
8953    #[serde(skip_serializing_if = "Option::is_none")]
8954    #[serde(with = "stripe_types::with_serde_json_opt")]
8955    pub twint: Option<miniserde::json::Value>,
8956    /// The type of the PaymentMethod.
8957    /// An additional hash is included on the PaymentMethod with a name matching this value.
8958    /// It contains additional information specific to the PaymentMethod type.
8959    #[serde(rename = "type")]
8960    pub type_: ConfirmSetupIntentPaymentMethodDataType,
8961    /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
8962    #[serde(skip_serializing_if = "Option::is_none")]
8963    pub us_bank_account: Option<ConfirmSetupIntentPaymentMethodDataUsBankAccount>,
8964    /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
8965    #[serde(skip_serializing_if = "Option::is_none")]
8966    #[serde(with = "stripe_types::with_serde_json_opt")]
8967    pub wechat_pay: Option<miniserde::json::Value>,
8968    /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
8969    #[serde(skip_serializing_if = "Option::is_none")]
8970    #[serde(with = "stripe_types::with_serde_json_opt")]
8971    pub zip: Option<miniserde::json::Value>,
8972}
8973impl ConfirmSetupIntentPaymentMethodData {
8974    pub fn new(type_: impl Into<ConfirmSetupIntentPaymentMethodDataType>) -> Self {
8975        Self {
8976            acss_debit: None,
8977            affirm: None,
8978            afterpay_clearpay: None,
8979            alipay: None,
8980            allow_redisplay: None,
8981            alma: None,
8982            amazon_pay: None,
8983            au_becs_debit: None,
8984            bacs_debit: None,
8985            bancontact: None,
8986            billie: None,
8987            billing_details: None,
8988            blik: None,
8989            boleto: None,
8990            cashapp: None,
8991            crypto: None,
8992            customer_balance: None,
8993            eps: None,
8994            fpx: None,
8995            giropay: None,
8996            grabpay: None,
8997            ideal: None,
8998            interac_present: None,
8999            kakao_pay: None,
9000            klarna: None,
9001            konbini: None,
9002            kr_card: None,
9003            link: None,
9004            mb_way: None,
9005            metadata: None,
9006            mobilepay: None,
9007            multibanco: None,
9008            naver_pay: None,
9009            nz_bank_account: None,
9010            oxxo: None,
9011            p24: None,
9012            pay_by_bank: None,
9013            payco: None,
9014            paynow: None,
9015            paypal: None,
9016            pix: None,
9017            promptpay: None,
9018            radar_options: None,
9019            revolut_pay: None,
9020            samsung_pay: None,
9021            satispay: None,
9022            sepa_debit: None,
9023            sofort: None,
9024            swish: None,
9025            twint: None,
9026            type_: type_.into(),
9027            us_bank_account: None,
9028            wechat_pay: None,
9029            zip: None,
9030        }
9031    }
9032}
9033/// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
9034/// 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.
9035/// The field defaults to `unspecified`.
9036#[derive(Copy, Clone, Eq, PartialEq)]
9037pub enum ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
9038    Always,
9039    Limited,
9040    Unspecified,
9041}
9042impl ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
9043    pub fn as_str(self) -> &'static str {
9044        use ConfirmSetupIntentPaymentMethodDataAllowRedisplay::*;
9045        match self {
9046            Always => "always",
9047            Limited => "limited",
9048            Unspecified => "unspecified",
9049        }
9050    }
9051}
9052
9053impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
9054    type Err = stripe_types::StripeParseError;
9055    fn from_str(s: &str) -> Result<Self, Self::Err> {
9056        use ConfirmSetupIntentPaymentMethodDataAllowRedisplay::*;
9057        match s {
9058            "always" => Ok(Always),
9059            "limited" => Ok(Limited),
9060            "unspecified" => Ok(Unspecified),
9061            _ => Err(stripe_types::StripeParseError),
9062        }
9063    }
9064}
9065impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
9066    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9067        f.write_str(self.as_str())
9068    }
9069}
9070
9071impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
9072    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9073        f.write_str(self.as_str())
9074    }
9075}
9076impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
9077    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9078    where
9079        S: serde::Serializer,
9080    {
9081        serializer.serialize_str(self.as_str())
9082    }
9083}
9084#[cfg(feature = "deserialize")]
9085impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
9086    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9087        use std::str::FromStr;
9088        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9089        Self::from_str(&s).map_err(|_| {
9090            serde::de::Error::custom(
9091                "Unknown value for ConfirmSetupIntentPaymentMethodDataAllowRedisplay",
9092            )
9093        })
9094    }
9095}
9096/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
9097#[derive(Clone, Debug, serde::Serialize)]
9098pub struct ConfirmSetupIntentPaymentMethodDataAuBecsDebit {
9099    /// The account number for the bank account.
9100    pub account_number: String,
9101    /// Bank-State-Branch number of the bank account.
9102    pub bsb_number: String,
9103}
9104impl ConfirmSetupIntentPaymentMethodDataAuBecsDebit {
9105    pub fn new(account_number: impl Into<String>, bsb_number: impl Into<String>) -> Self {
9106        Self { account_number: account_number.into(), bsb_number: bsb_number.into() }
9107    }
9108}
9109/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
9110#[derive(Clone, Debug, serde::Serialize)]
9111pub struct ConfirmSetupIntentPaymentMethodDataBacsDebit {
9112    /// Account number of the bank account that the funds will be debited from.
9113    #[serde(skip_serializing_if = "Option::is_none")]
9114    pub account_number: Option<String>,
9115    /// Sort code of the bank account. (e.g., `10-20-30`)
9116    #[serde(skip_serializing_if = "Option::is_none")]
9117    pub sort_code: Option<String>,
9118}
9119impl ConfirmSetupIntentPaymentMethodDataBacsDebit {
9120    pub fn new() -> Self {
9121        Self { account_number: None, sort_code: None }
9122    }
9123}
9124impl Default for ConfirmSetupIntentPaymentMethodDataBacsDebit {
9125    fn default() -> Self {
9126        Self::new()
9127    }
9128}
9129/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
9130#[derive(Clone, Debug, serde::Serialize)]
9131pub struct ConfirmSetupIntentPaymentMethodDataBoleto {
9132    /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)
9133    pub tax_id: String,
9134}
9135impl ConfirmSetupIntentPaymentMethodDataBoleto {
9136    pub fn new(tax_id: impl Into<String>) -> Self {
9137        Self { tax_id: tax_id.into() }
9138    }
9139}
9140/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
9141#[derive(Clone, Debug, serde::Serialize)]
9142pub struct ConfirmSetupIntentPaymentMethodDataEps {
9143    /// The customer's bank.
9144    #[serde(skip_serializing_if = "Option::is_none")]
9145    pub bank: Option<ConfirmSetupIntentPaymentMethodDataEpsBank>,
9146}
9147impl ConfirmSetupIntentPaymentMethodDataEps {
9148    pub fn new() -> Self {
9149        Self { bank: None }
9150    }
9151}
9152impl Default for ConfirmSetupIntentPaymentMethodDataEps {
9153    fn default() -> Self {
9154        Self::new()
9155    }
9156}
9157/// The customer's bank.
9158#[derive(Clone, Eq, PartialEq)]
9159#[non_exhaustive]
9160pub enum ConfirmSetupIntentPaymentMethodDataEpsBank {
9161    ArzteUndApothekerBank,
9162    AustrianAnadiBankAg,
9163    BankAustria,
9164    BankhausCarlSpangler,
9165    BankhausSchelhammerUndSchatteraAg,
9166    BawagPskAg,
9167    BksBankAg,
9168    BrullKallmusBankAg,
9169    BtvVierLanderBank,
9170    CapitalBankGraweGruppeAg,
9171    DeutscheBankAg,
9172    Dolomitenbank,
9173    EasybankAg,
9174    ErsteBankUndSparkassen,
9175    HypoAlpeadriabankInternationalAg,
9176    HypoBankBurgenlandAktiengesellschaft,
9177    HypoNoeLbFurNiederosterreichUWien,
9178    HypoOberosterreichSalzburgSteiermark,
9179    HypoTirolBankAg,
9180    HypoVorarlbergBankAg,
9181    MarchfelderBank,
9182    OberbankAg,
9183    RaiffeisenBankengruppeOsterreich,
9184    SchoellerbankAg,
9185    SpardaBankWien,
9186    VolksbankGruppe,
9187    VolkskreditbankAg,
9188    VrBankBraunau,
9189    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9190    Unknown(String),
9191}
9192impl ConfirmSetupIntentPaymentMethodDataEpsBank {
9193    pub fn as_str(&self) -> &str {
9194        use ConfirmSetupIntentPaymentMethodDataEpsBank::*;
9195        match self {
9196            ArzteUndApothekerBank => "arzte_und_apotheker_bank",
9197            AustrianAnadiBankAg => "austrian_anadi_bank_ag",
9198            BankAustria => "bank_austria",
9199            BankhausCarlSpangler => "bankhaus_carl_spangler",
9200            BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag",
9201            BawagPskAg => "bawag_psk_ag",
9202            BksBankAg => "bks_bank_ag",
9203            BrullKallmusBankAg => "brull_kallmus_bank_ag",
9204            BtvVierLanderBank => "btv_vier_lander_bank",
9205            CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
9206            DeutscheBankAg => "deutsche_bank_ag",
9207            Dolomitenbank => "dolomitenbank",
9208            EasybankAg => "easybank_ag",
9209            ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
9210            HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag",
9211            HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft",
9212            HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien",
9213            HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark",
9214            HypoTirolBankAg => "hypo_tirol_bank_ag",
9215            HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
9216            MarchfelderBank => "marchfelder_bank",
9217            OberbankAg => "oberbank_ag",
9218            RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich",
9219            SchoellerbankAg => "schoellerbank_ag",
9220            SpardaBankWien => "sparda_bank_wien",
9221            VolksbankGruppe => "volksbank_gruppe",
9222            VolkskreditbankAg => "volkskreditbank_ag",
9223            VrBankBraunau => "vr_bank_braunau",
9224            Unknown(v) => v,
9225        }
9226    }
9227}
9228
9229impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataEpsBank {
9230    type Err = std::convert::Infallible;
9231    fn from_str(s: &str) -> Result<Self, Self::Err> {
9232        use ConfirmSetupIntentPaymentMethodDataEpsBank::*;
9233        match s {
9234            "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank),
9235            "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg),
9236            "bank_austria" => Ok(BankAustria),
9237            "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler),
9238            "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg),
9239            "bawag_psk_ag" => Ok(BawagPskAg),
9240            "bks_bank_ag" => Ok(BksBankAg),
9241            "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg),
9242            "btv_vier_lander_bank" => Ok(BtvVierLanderBank),
9243            "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg),
9244            "deutsche_bank_ag" => Ok(DeutscheBankAg),
9245            "dolomitenbank" => Ok(Dolomitenbank),
9246            "easybank_ag" => Ok(EasybankAg),
9247            "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen),
9248            "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg),
9249            "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft),
9250            "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien),
9251            "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark),
9252            "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg),
9253            "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg),
9254            "marchfelder_bank" => Ok(MarchfelderBank),
9255            "oberbank_ag" => Ok(OberbankAg),
9256            "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich),
9257            "schoellerbank_ag" => Ok(SchoellerbankAg),
9258            "sparda_bank_wien" => Ok(SpardaBankWien),
9259            "volksbank_gruppe" => Ok(VolksbankGruppe),
9260            "volkskreditbank_ag" => Ok(VolkskreditbankAg),
9261            "vr_bank_braunau" => Ok(VrBankBraunau),
9262            v => Ok(Unknown(v.to_owned())),
9263        }
9264    }
9265}
9266impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataEpsBank {
9267    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9268        f.write_str(self.as_str())
9269    }
9270}
9271
9272impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataEpsBank {
9273    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9274        f.write_str(self.as_str())
9275    }
9276}
9277impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataEpsBank {
9278    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9279    where
9280        S: serde::Serializer,
9281    {
9282        serializer.serialize_str(self.as_str())
9283    }
9284}
9285#[cfg(feature = "deserialize")]
9286impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataEpsBank {
9287    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9288        use std::str::FromStr;
9289        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9290        Ok(Self::from_str(&s).unwrap())
9291    }
9292}
9293/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
9294#[derive(Clone, Debug, serde::Serialize)]
9295pub struct ConfirmSetupIntentPaymentMethodDataFpx {
9296    /// Account holder type for FPX transaction
9297    #[serde(skip_serializing_if = "Option::is_none")]
9298    pub account_holder_type: Option<ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType>,
9299    /// The customer's bank.
9300    pub bank: ConfirmSetupIntentPaymentMethodDataFpxBank,
9301}
9302impl ConfirmSetupIntentPaymentMethodDataFpx {
9303    pub fn new(bank: impl Into<ConfirmSetupIntentPaymentMethodDataFpxBank>) -> Self {
9304        Self { account_holder_type: None, bank: bank.into() }
9305    }
9306}
9307/// Account holder type for FPX transaction
9308#[derive(Copy, Clone, Eq, PartialEq)]
9309pub enum ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
9310    Company,
9311    Individual,
9312}
9313impl ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
9314    pub fn as_str(self) -> &'static str {
9315        use ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType::*;
9316        match self {
9317            Company => "company",
9318            Individual => "individual",
9319        }
9320    }
9321}
9322
9323impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
9324    type Err = stripe_types::StripeParseError;
9325    fn from_str(s: &str) -> Result<Self, Self::Err> {
9326        use ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType::*;
9327        match s {
9328            "company" => Ok(Company),
9329            "individual" => Ok(Individual),
9330            _ => Err(stripe_types::StripeParseError),
9331        }
9332    }
9333}
9334impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
9335    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9336        f.write_str(self.as_str())
9337    }
9338}
9339
9340impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
9341    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9342        f.write_str(self.as_str())
9343    }
9344}
9345impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
9346    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9347    where
9348        S: serde::Serializer,
9349    {
9350        serializer.serialize_str(self.as_str())
9351    }
9352}
9353#[cfg(feature = "deserialize")]
9354impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
9355    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9356        use std::str::FromStr;
9357        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9358        Self::from_str(&s).map_err(|_| {
9359            serde::de::Error::custom(
9360                "Unknown value for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType",
9361            )
9362        })
9363    }
9364}
9365/// The customer's bank.
9366#[derive(Clone, Eq, PartialEq)]
9367#[non_exhaustive]
9368pub enum ConfirmSetupIntentPaymentMethodDataFpxBank {
9369    AffinBank,
9370    Agrobank,
9371    AllianceBank,
9372    Ambank,
9373    BankIslam,
9374    BankMuamalat,
9375    BankOfChina,
9376    BankRakyat,
9377    Bsn,
9378    Cimb,
9379    DeutscheBank,
9380    HongLeongBank,
9381    Hsbc,
9382    Kfh,
9383    Maybank2e,
9384    Maybank2u,
9385    Ocbc,
9386    PbEnterprise,
9387    PublicBank,
9388    Rhb,
9389    StandardChartered,
9390    Uob,
9391    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9392    Unknown(String),
9393}
9394impl ConfirmSetupIntentPaymentMethodDataFpxBank {
9395    pub fn as_str(&self) -> &str {
9396        use ConfirmSetupIntentPaymentMethodDataFpxBank::*;
9397        match self {
9398            AffinBank => "affin_bank",
9399            Agrobank => "agrobank",
9400            AllianceBank => "alliance_bank",
9401            Ambank => "ambank",
9402            BankIslam => "bank_islam",
9403            BankMuamalat => "bank_muamalat",
9404            BankOfChina => "bank_of_china",
9405            BankRakyat => "bank_rakyat",
9406            Bsn => "bsn",
9407            Cimb => "cimb",
9408            DeutscheBank => "deutsche_bank",
9409            HongLeongBank => "hong_leong_bank",
9410            Hsbc => "hsbc",
9411            Kfh => "kfh",
9412            Maybank2e => "maybank2e",
9413            Maybank2u => "maybank2u",
9414            Ocbc => "ocbc",
9415            PbEnterprise => "pb_enterprise",
9416            PublicBank => "public_bank",
9417            Rhb => "rhb",
9418            StandardChartered => "standard_chartered",
9419            Uob => "uob",
9420            Unknown(v) => v,
9421        }
9422    }
9423}
9424
9425impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataFpxBank {
9426    type Err = std::convert::Infallible;
9427    fn from_str(s: &str) -> Result<Self, Self::Err> {
9428        use ConfirmSetupIntentPaymentMethodDataFpxBank::*;
9429        match s {
9430            "affin_bank" => Ok(AffinBank),
9431            "agrobank" => Ok(Agrobank),
9432            "alliance_bank" => Ok(AllianceBank),
9433            "ambank" => Ok(Ambank),
9434            "bank_islam" => Ok(BankIslam),
9435            "bank_muamalat" => Ok(BankMuamalat),
9436            "bank_of_china" => Ok(BankOfChina),
9437            "bank_rakyat" => Ok(BankRakyat),
9438            "bsn" => Ok(Bsn),
9439            "cimb" => Ok(Cimb),
9440            "deutsche_bank" => Ok(DeutscheBank),
9441            "hong_leong_bank" => Ok(HongLeongBank),
9442            "hsbc" => Ok(Hsbc),
9443            "kfh" => Ok(Kfh),
9444            "maybank2e" => Ok(Maybank2e),
9445            "maybank2u" => Ok(Maybank2u),
9446            "ocbc" => Ok(Ocbc),
9447            "pb_enterprise" => Ok(PbEnterprise),
9448            "public_bank" => Ok(PublicBank),
9449            "rhb" => Ok(Rhb),
9450            "standard_chartered" => Ok(StandardChartered),
9451            "uob" => Ok(Uob),
9452            v => Ok(Unknown(v.to_owned())),
9453        }
9454    }
9455}
9456impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataFpxBank {
9457    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9458        f.write_str(self.as_str())
9459    }
9460}
9461
9462impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataFpxBank {
9463    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9464        f.write_str(self.as_str())
9465    }
9466}
9467impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataFpxBank {
9468    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9469    where
9470        S: serde::Serializer,
9471    {
9472        serializer.serialize_str(self.as_str())
9473    }
9474}
9475#[cfg(feature = "deserialize")]
9476impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataFpxBank {
9477    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9478        use std::str::FromStr;
9479        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9480        Ok(Self::from_str(&s).unwrap())
9481    }
9482}
9483/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
9484#[derive(Clone, Debug, serde::Serialize)]
9485pub struct ConfirmSetupIntentPaymentMethodDataIdeal {
9486    /// The customer's bank.
9487    /// Only use this parameter for existing customers.
9488    /// Don't use it for new customers.
9489    #[serde(skip_serializing_if = "Option::is_none")]
9490    pub bank: Option<ConfirmSetupIntentPaymentMethodDataIdealBank>,
9491}
9492impl ConfirmSetupIntentPaymentMethodDataIdeal {
9493    pub fn new() -> Self {
9494        Self { bank: None }
9495    }
9496}
9497impl Default for ConfirmSetupIntentPaymentMethodDataIdeal {
9498    fn default() -> Self {
9499        Self::new()
9500    }
9501}
9502/// The customer's bank.
9503/// Only use this parameter for existing customers.
9504/// Don't use it for new customers.
9505#[derive(Clone, Eq, PartialEq)]
9506#[non_exhaustive]
9507pub enum ConfirmSetupIntentPaymentMethodDataIdealBank {
9508    AbnAmro,
9509    AsnBank,
9510    Bunq,
9511    Buut,
9512    Finom,
9513    Handelsbanken,
9514    Ing,
9515    Knab,
9516    Moneyou,
9517    N26,
9518    Nn,
9519    Rabobank,
9520    Regiobank,
9521    Revolut,
9522    SnsBank,
9523    TriodosBank,
9524    VanLanschot,
9525    Yoursafe,
9526    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9527    Unknown(String),
9528}
9529impl ConfirmSetupIntentPaymentMethodDataIdealBank {
9530    pub fn as_str(&self) -> &str {
9531        use ConfirmSetupIntentPaymentMethodDataIdealBank::*;
9532        match self {
9533            AbnAmro => "abn_amro",
9534            AsnBank => "asn_bank",
9535            Bunq => "bunq",
9536            Buut => "buut",
9537            Finom => "finom",
9538            Handelsbanken => "handelsbanken",
9539            Ing => "ing",
9540            Knab => "knab",
9541            Moneyou => "moneyou",
9542            N26 => "n26",
9543            Nn => "nn",
9544            Rabobank => "rabobank",
9545            Regiobank => "regiobank",
9546            Revolut => "revolut",
9547            SnsBank => "sns_bank",
9548            TriodosBank => "triodos_bank",
9549            VanLanschot => "van_lanschot",
9550            Yoursafe => "yoursafe",
9551            Unknown(v) => v,
9552        }
9553    }
9554}
9555
9556impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataIdealBank {
9557    type Err = std::convert::Infallible;
9558    fn from_str(s: &str) -> Result<Self, Self::Err> {
9559        use ConfirmSetupIntentPaymentMethodDataIdealBank::*;
9560        match s {
9561            "abn_amro" => Ok(AbnAmro),
9562            "asn_bank" => Ok(AsnBank),
9563            "bunq" => Ok(Bunq),
9564            "buut" => Ok(Buut),
9565            "finom" => Ok(Finom),
9566            "handelsbanken" => Ok(Handelsbanken),
9567            "ing" => Ok(Ing),
9568            "knab" => Ok(Knab),
9569            "moneyou" => Ok(Moneyou),
9570            "n26" => Ok(N26),
9571            "nn" => Ok(Nn),
9572            "rabobank" => Ok(Rabobank),
9573            "regiobank" => Ok(Regiobank),
9574            "revolut" => Ok(Revolut),
9575            "sns_bank" => Ok(SnsBank),
9576            "triodos_bank" => Ok(TriodosBank),
9577            "van_lanschot" => Ok(VanLanschot),
9578            "yoursafe" => Ok(Yoursafe),
9579            v => Ok(Unknown(v.to_owned())),
9580        }
9581    }
9582}
9583impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataIdealBank {
9584    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9585        f.write_str(self.as_str())
9586    }
9587}
9588
9589impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataIdealBank {
9590    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9591        f.write_str(self.as_str())
9592    }
9593}
9594impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataIdealBank {
9595    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9596    where
9597        S: serde::Serializer,
9598    {
9599        serializer.serialize_str(self.as_str())
9600    }
9601}
9602#[cfg(feature = "deserialize")]
9603impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataIdealBank {
9604    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9605        use std::str::FromStr;
9606        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9607        Ok(Self::from_str(&s).unwrap())
9608    }
9609}
9610/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
9611#[derive(Copy, Clone, Debug, serde::Serialize)]
9612pub struct ConfirmSetupIntentPaymentMethodDataKlarna {
9613    /// Customer's date of birth
9614    #[serde(skip_serializing_if = "Option::is_none")]
9615    pub dob: Option<DateOfBirth>,
9616}
9617impl ConfirmSetupIntentPaymentMethodDataKlarna {
9618    pub fn new() -> Self {
9619        Self { dob: None }
9620    }
9621}
9622impl Default for ConfirmSetupIntentPaymentMethodDataKlarna {
9623    fn default() -> Self {
9624        Self::new()
9625    }
9626}
9627/// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
9628#[derive(Copy, Clone, Debug, serde::Serialize)]
9629pub struct ConfirmSetupIntentPaymentMethodDataNaverPay {
9630    /// Whether to use Naver Pay points or a card to fund this transaction.
9631    /// If not provided, this defaults to `card`.
9632    #[serde(skip_serializing_if = "Option::is_none")]
9633    pub funding: Option<ConfirmSetupIntentPaymentMethodDataNaverPayFunding>,
9634}
9635impl ConfirmSetupIntentPaymentMethodDataNaverPay {
9636    pub fn new() -> Self {
9637        Self { funding: None }
9638    }
9639}
9640impl Default for ConfirmSetupIntentPaymentMethodDataNaverPay {
9641    fn default() -> Self {
9642        Self::new()
9643    }
9644}
9645/// Whether to use Naver Pay points or a card to fund this transaction.
9646/// If not provided, this defaults to `card`.
9647#[derive(Copy, Clone, Eq, PartialEq)]
9648pub enum ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
9649    Card,
9650    Points,
9651}
9652impl ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
9653    pub fn as_str(self) -> &'static str {
9654        use ConfirmSetupIntentPaymentMethodDataNaverPayFunding::*;
9655        match self {
9656            Card => "card",
9657            Points => "points",
9658        }
9659    }
9660}
9661
9662impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
9663    type Err = stripe_types::StripeParseError;
9664    fn from_str(s: &str) -> Result<Self, Self::Err> {
9665        use ConfirmSetupIntentPaymentMethodDataNaverPayFunding::*;
9666        match s {
9667            "card" => Ok(Card),
9668            "points" => Ok(Points),
9669            _ => Err(stripe_types::StripeParseError),
9670        }
9671    }
9672}
9673impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
9674    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9675        f.write_str(self.as_str())
9676    }
9677}
9678
9679impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
9680    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9681        f.write_str(self.as_str())
9682    }
9683}
9684impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
9685    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9686    where
9687        S: serde::Serializer,
9688    {
9689        serializer.serialize_str(self.as_str())
9690    }
9691}
9692#[cfg(feature = "deserialize")]
9693impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
9694    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9695        use std::str::FromStr;
9696        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9697        Self::from_str(&s).map_err(|_| {
9698            serde::de::Error::custom(
9699                "Unknown value for ConfirmSetupIntentPaymentMethodDataNaverPayFunding",
9700            )
9701        })
9702    }
9703}
9704/// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
9705#[derive(Clone, Debug, serde::Serialize)]
9706pub struct ConfirmSetupIntentPaymentMethodDataNzBankAccount {
9707    /// The name on the bank account.
9708    /// Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod’s billing details.
9709    #[serde(skip_serializing_if = "Option::is_none")]
9710    pub account_holder_name: Option<String>,
9711    /// The account number for the bank account.
9712    pub account_number: String,
9713    /// The numeric code for the bank account's bank.
9714    pub bank_code: String,
9715    /// The numeric code for the bank account's bank branch.
9716    pub branch_code: String,
9717    #[serde(skip_serializing_if = "Option::is_none")]
9718    pub reference: Option<String>,
9719    /// The suffix of the bank account number.
9720    pub suffix: String,
9721}
9722impl ConfirmSetupIntentPaymentMethodDataNzBankAccount {
9723    pub fn new(
9724        account_number: impl Into<String>,
9725        bank_code: impl Into<String>,
9726        branch_code: impl Into<String>,
9727        suffix: impl Into<String>,
9728    ) -> Self {
9729        Self {
9730            account_holder_name: None,
9731            account_number: account_number.into(),
9732            bank_code: bank_code.into(),
9733            branch_code: branch_code.into(),
9734            reference: None,
9735            suffix: suffix.into(),
9736        }
9737    }
9738}
9739/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
9740#[derive(Clone, Debug, serde::Serialize)]
9741pub struct ConfirmSetupIntentPaymentMethodDataP24 {
9742    /// The customer's bank.
9743    #[serde(skip_serializing_if = "Option::is_none")]
9744    pub bank: Option<ConfirmSetupIntentPaymentMethodDataP24Bank>,
9745}
9746impl ConfirmSetupIntentPaymentMethodDataP24 {
9747    pub fn new() -> Self {
9748        Self { bank: None }
9749    }
9750}
9751impl Default for ConfirmSetupIntentPaymentMethodDataP24 {
9752    fn default() -> Self {
9753        Self::new()
9754    }
9755}
9756/// The customer's bank.
9757#[derive(Clone, Eq, PartialEq)]
9758#[non_exhaustive]
9759pub enum ConfirmSetupIntentPaymentMethodDataP24Bank {
9760    AliorBank,
9761    BankMillennium,
9762    BankNowyBfgSa,
9763    BankPekaoSa,
9764    BankiSpbdzielcze,
9765    Blik,
9766    BnpParibas,
9767    Boz,
9768    CitiHandlowy,
9769    CreditAgricole,
9770    Envelobank,
9771    EtransferPocztowy24,
9772    GetinBank,
9773    Ideabank,
9774    Ing,
9775    Inteligo,
9776    MbankMtransfer,
9777    NestPrzelew,
9778    NoblePay,
9779    PbacZIpko,
9780    PlusBank,
9781    SantanderPrzelew24,
9782    TmobileUsbugiBankowe,
9783    ToyotaBank,
9784    Velobank,
9785    VolkswagenBank,
9786    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9787    Unknown(String),
9788}
9789impl ConfirmSetupIntentPaymentMethodDataP24Bank {
9790    pub fn as_str(&self) -> &str {
9791        use ConfirmSetupIntentPaymentMethodDataP24Bank::*;
9792        match self {
9793            AliorBank => "alior_bank",
9794            BankMillennium => "bank_millennium",
9795            BankNowyBfgSa => "bank_nowy_bfg_sa",
9796            BankPekaoSa => "bank_pekao_sa",
9797            BankiSpbdzielcze => "banki_spbdzielcze",
9798            Blik => "blik",
9799            BnpParibas => "bnp_paribas",
9800            Boz => "boz",
9801            CitiHandlowy => "citi_handlowy",
9802            CreditAgricole => "credit_agricole",
9803            Envelobank => "envelobank",
9804            EtransferPocztowy24 => "etransfer_pocztowy24",
9805            GetinBank => "getin_bank",
9806            Ideabank => "ideabank",
9807            Ing => "ing",
9808            Inteligo => "inteligo",
9809            MbankMtransfer => "mbank_mtransfer",
9810            NestPrzelew => "nest_przelew",
9811            NoblePay => "noble_pay",
9812            PbacZIpko => "pbac_z_ipko",
9813            PlusBank => "plus_bank",
9814            SantanderPrzelew24 => "santander_przelew24",
9815            TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
9816            ToyotaBank => "toyota_bank",
9817            Velobank => "velobank",
9818            VolkswagenBank => "volkswagen_bank",
9819            Unknown(v) => v,
9820        }
9821    }
9822}
9823
9824impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataP24Bank {
9825    type Err = std::convert::Infallible;
9826    fn from_str(s: &str) -> Result<Self, Self::Err> {
9827        use ConfirmSetupIntentPaymentMethodDataP24Bank::*;
9828        match s {
9829            "alior_bank" => Ok(AliorBank),
9830            "bank_millennium" => Ok(BankMillennium),
9831            "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa),
9832            "bank_pekao_sa" => Ok(BankPekaoSa),
9833            "banki_spbdzielcze" => Ok(BankiSpbdzielcze),
9834            "blik" => Ok(Blik),
9835            "bnp_paribas" => Ok(BnpParibas),
9836            "boz" => Ok(Boz),
9837            "citi_handlowy" => Ok(CitiHandlowy),
9838            "credit_agricole" => Ok(CreditAgricole),
9839            "envelobank" => Ok(Envelobank),
9840            "etransfer_pocztowy24" => Ok(EtransferPocztowy24),
9841            "getin_bank" => Ok(GetinBank),
9842            "ideabank" => Ok(Ideabank),
9843            "ing" => Ok(Ing),
9844            "inteligo" => Ok(Inteligo),
9845            "mbank_mtransfer" => Ok(MbankMtransfer),
9846            "nest_przelew" => Ok(NestPrzelew),
9847            "noble_pay" => Ok(NoblePay),
9848            "pbac_z_ipko" => Ok(PbacZIpko),
9849            "plus_bank" => Ok(PlusBank),
9850            "santander_przelew24" => Ok(SantanderPrzelew24),
9851            "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe),
9852            "toyota_bank" => Ok(ToyotaBank),
9853            "velobank" => Ok(Velobank),
9854            "volkswagen_bank" => Ok(VolkswagenBank),
9855            v => Ok(Unknown(v.to_owned())),
9856        }
9857    }
9858}
9859impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataP24Bank {
9860    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9861        f.write_str(self.as_str())
9862    }
9863}
9864
9865impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataP24Bank {
9866    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9867        f.write_str(self.as_str())
9868    }
9869}
9870impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataP24Bank {
9871    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9872    where
9873        S: serde::Serializer,
9874    {
9875        serializer.serialize_str(self.as_str())
9876    }
9877}
9878#[cfg(feature = "deserialize")]
9879impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataP24Bank {
9880    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9881        use std::str::FromStr;
9882        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9883        Ok(Self::from_str(&s).unwrap())
9884    }
9885}
9886/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
9887#[derive(Clone, Debug, serde::Serialize)]
9888pub struct ConfirmSetupIntentPaymentMethodDataSepaDebit {
9889    /// IBAN of the bank account.
9890    pub iban: String,
9891}
9892impl ConfirmSetupIntentPaymentMethodDataSepaDebit {
9893    pub fn new(iban: impl Into<String>) -> Self {
9894        Self { iban: iban.into() }
9895    }
9896}
9897/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
9898#[derive(Copy, Clone, Debug, serde::Serialize)]
9899pub struct ConfirmSetupIntentPaymentMethodDataSofort {
9900    /// Two-letter ISO code representing the country the bank account is located in.
9901    pub country: ConfirmSetupIntentPaymentMethodDataSofortCountry,
9902}
9903impl ConfirmSetupIntentPaymentMethodDataSofort {
9904    pub fn new(country: impl Into<ConfirmSetupIntentPaymentMethodDataSofortCountry>) -> Self {
9905        Self { country: country.into() }
9906    }
9907}
9908/// Two-letter ISO code representing the country the bank account is located in.
9909#[derive(Copy, Clone, Eq, PartialEq)]
9910pub enum ConfirmSetupIntentPaymentMethodDataSofortCountry {
9911    At,
9912    Be,
9913    De,
9914    Es,
9915    It,
9916    Nl,
9917}
9918impl ConfirmSetupIntentPaymentMethodDataSofortCountry {
9919    pub fn as_str(self) -> &'static str {
9920        use ConfirmSetupIntentPaymentMethodDataSofortCountry::*;
9921        match self {
9922            At => "AT",
9923            Be => "BE",
9924            De => "DE",
9925            Es => "ES",
9926            It => "IT",
9927            Nl => "NL",
9928        }
9929    }
9930}
9931
9932impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataSofortCountry {
9933    type Err = stripe_types::StripeParseError;
9934    fn from_str(s: &str) -> Result<Self, Self::Err> {
9935        use ConfirmSetupIntentPaymentMethodDataSofortCountry::*;
9936        match s {
9937            "AT" => Ok(At),
9938            "BE" => Ok(Be),
9939            "DE" => Ok(De),
9940            "ES" => Ok(Es),
9941            "IT" => Ok(It),
9942            "NL" => Ok(Nl),
9943            _ => Err(stripe_types::StripeParseError),
9944        }
9945    }
9946}
9947impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataSofortCountry {
9948    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9949        f.write_str(self.as_str())
9950    }
9951}
9952
9953impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataSofortCountry {
9954    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9955        f.write_str(self.as_str())
9956    }
9957}
9958impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataSofortCountry {
9959    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9960    where
9961        S: serde::Serializer,
9962    {
9963        serializer.serialize_str(self.as_str())
9964    }
9965}
9966#[cfg(feature = "deserialize")]
9967impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataSofortCountry {
9968    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9969        use std::str::FromStr;
9970        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9971        Self::from_str(&s).map_err(|_| {
9972            serde::de::Error::custom(
9973                "Unknown value for ConfirmSetupIntentPaymentMethodDataSofortCountry",
9974            )
9975        })
9976    }
9977}
9978/// The type of the PaymentMethod.
9979/// An additional hash is included on the PaymentMethod with a name matching this value.
9980/// It contains additional information specific to the PaymentMethod type.
9981#[derive(Clone, Eq, PartialEq)]
9982#[non_exhaustive]
9983pub enum ConfirmSetupIntentPaymentMethodDataType {
9984    AcssDebit,
9985    Affirm,
9986    AfterpayClearpay,
9987    Alipay,
9988    Alma,
9989    AmazonPay,
9990    AuBecsDebit,
9991    BacsDebit,
9992    Bancontact,
9993    Billie,
9994    Blik,
9995    Boleto,
9996    Cashapp,
9997    Crypto,
9998    CustomerBalance,
9999    Eps,
10000    Fpx,
10001    Giropay,
10002    Grabpay,
10003    Ideal,
10004    KakaoPay,
10005    Klarna,
10006    Konbini,
10007    KrCard,
10008    Link,
10009    MbWay,
10010    Mobilepay,
10011    Multibanco,
10012    NaverPay,
10013    NzBankAccount,
10014    Oxxo,
10015    P24,
10016    PayByBank,
10017    Payco,
10018    Paynow,
10019    Paypal,
10020    Pix,
10021    Promptpay,
10022    RevolutPay,
10023    SamsungPay,
10024    Satispay,
10025    SepaDebit,
10026    Sofort,
10027    Swish,
10028    Twint,
10029    UsBankAccount,
10030    WechatPay,
10031    Zip,
10032    /// An unrecognized value from Stripe. Should not be used as a request parameter.
10033    Unknown(String),
10034}
10035impl ConfirmSetupIntentPaymentMethodDataType {
10036    pub fn as_str(&self) -> &str {
10037        use ConfirmSetupIntentPaymentMethodDataType::*;
10038        match self {
10039            AcssDebit => "acss_debit",
10040            Affirm => "affirm",
10041            AfterpayClearpay => "afterpay_clearpay",
10042            Alipay => "alipay",
10043            Alma => "alma",
10044            AmazonPay => "amazon_pay",
10045            AuBecsDebit => "au_becs_debit",
10046            BacsDebit => "bacs_debit",
10047            Bancontact => "bancontact",
10048            Billie => "billie",
10049            Blik => "blik",
10050            Boleto => "boleto",
10051            Cashapp => "cashapp",
10052            Crypto => "crypto",
10053            CustomerBalance => "customer_balance",
10054            Eps => "eps",
10055            Fpx => "fpx",
10056            Giropay => "giropay",
10057            Grabpay => "grabpay",
10058            Ideal => "ideal",
10059            KakaoPay => "kakao_pay",
10060            Klarna => "klarna",
10061            Konbini => "konbini",
10062            KrCard => "kr_card",
10063            Link => "link",
10064            MbWay => "mb_way",
10065            Mobilepay => "mobilepay",
10066            Multibanco => "multibanco",
10067            NaverPay => "naver_pay",
10068            NzBankAccount => "nz_bank_account",
10069            Oxxo => "oxxo",
10070            P24 => "p24",
10071            PayByBank => "pay_by_bank",
10072            Payco => "payco",
10073            Paynow => "paynow",
10074            Paypal => "paypal",
10075            Pix => "pix",
10076            Promptpay => "promptpay",
10077            RevolutPay => "revolut_pay",
10078            SamsungPay => "samsung_pay",
10079            Satispay => "satispay",
10080            SepaDebit => "sepa_debit",
10081            Sofort => "sofort",
10082            Swish => "swish",
10083            Twint => "twint",
10084            UsBankAccount => "us_bank_account",
10085            WechatPay => "wechat_pay",
10086            Zip => "zip",
10087            Unknown(v) => v,
10088        }
10089    }
10090}
10091
10092impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataType {
10093    type Err = std::convert::Infallible;
10094    fn from_str(s: &str) -> Result<Self, Self::Err> {
10095        use ConfirmSetupIntentPaymentMethodDataType::*;
10096        match s {
10097            "acss_debit" => Ok(AcssDebit),
10098            "affirm" => Ok(Affirm),
10099            "afterpay_clearpay" => Ok(AfterpayClearpay),
10100            "alipay" => Ok(Alipay),
10101            "alma" => Ok(Alma),
10102            "amazon_pay" => Ok(AmazonPay),
10103            "au_becs_debit" => Ok(AuBecsDebit),
10104            "bacs_debit" => Ok(BacsDebit),
10105            "bancontact" => Ok(Bancontact),
10106            "billie" => Ok(Billie),
10107            "blik" => Ok(Blik),
10108            "boleto" => Ok(Boleto),
10109            "cashapp" => Ok(Cashapp),
10110            "crypto" => Ok(Crypto),
10111            "customer_balance" => Ok(CustomerBalance),
10112            "eps" => Ok(Eps),
10113            "fpx" => Ok(Fpx),
10114            "giropay" => Ok(Giropay),
10115            "grabpay" => Ok(Grabpay),
10116            "ideal" => Ok(Ideal),
10117            "kakao_pay" => Ok(KakaoPay),
10118            "klarna" => Ok(Klarna),
10119            "konbini" => Ok(Konbini),
10120            "kr_card" => Ok(KrCard),
10121            "link" => Ok(Link),
10122            "mb_way" => Ok(MbWay),
10123            "mobilepay" => Ok(Mobilepay),
10124            "multibanco" => Ok(Multibanco),
10125            "naver_pay" => Ok(NaverPay),
10126            "nz_bank_account" => Ok(NzBankAccount),
10127            "oxxo" => Ok(Oxxo),
10128            "p24" => Ok(P24),
10129            "pay_by_bank" => Ok(PayByBank),
10130            "payco" => Ok(Payco),
10131            "paynow" => Ok(Paynow),
10132            "paypal" => Ok(Paypal),
10133            "pix" => Ok(Pix),
10134            "promptpay" => Ok(Promptpay),
10135            "revolut_pay" => Ok(RevolutPay),
10136            "samsung_pay" => Ok(SamsungPay),
10137            "satispay" => Ok(Satispay),
10138            "sepa_debit" => Ok(SepaDebit),
10139            "sofort" => Ok(Sofort),
10140            "swish" => Ok(Swish),
10141            "twint" => Ok(Twint),
10142            "us_bank_account" => Ok(UsBankAccount),
10143            "wechat_pay" => Ok(WechatPay),
10144            "zip" => Ok(Zip),
10145            v => Ok(Unknown(v.to_owned())),
10146        }
10147    }
10148}
10149impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataType {
10150    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10151        f.write_str(self.as_str())
10152    }
10153}
10154
10155impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataType {
10156    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10157        f.write_str(self.as_str())
10158    }
10159}
10160impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataType {
10161    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10162    where
10163        S: serde::Serializer,
10164    {
10165        serializer.serialize_str(self.as_str())
10166    }
10167}
10168#[cfg(feature = "deserialize")]
10169impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataType {
10170    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10171        use std::str::FromStr;
10172        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10173        Ok(Self::from_str(&s).unwrap())
10174    }
10175}
10176/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
10177#[derive(Clone, Debug, serde::Serialize)]
10178pub struct ConfirmSetupIntentPaymentMethodDataUsBankAccount {
10179    /// Account holder type: individual or company.
10180    #[serde(skip_serializing_if = "Option::is_none")]
10181    pub account_holder_type:
10182        Option<ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType>,
10183    /// Account number of the bank account.
10184    #[serde(skip_serializing_if = "Option::is_none")]
10185    pub account_number: Option<String>,
10186    /// Account type: checkings or savings. Defaults to checking if omitted.
10187    #[serde(skip_serializing_if = "Option::is_none")]
10188    pub account_type: Option<ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType>,
10189    /// The ID of a Financial Connections Account to use as a payment method.
10190    #[serde(skip_serializing_if = "Option::is_none")]
10191    pub financial_connections_account: Option<String>,
10192    /// Routing number of the bank account.
10193    #[serde(skip_serializing_if = "Option::is_none")]
10194    pub routing_number: Option<String>,
10195}
10196impl ConfirmSetupIntentPaymentMethodDataUsBankAccount {
10197    pub fn new() -> Self {
10198        Self {
10199            account_holder_type: None,
10200            account_number: None,
10201            account_type: None,
10202            financial_connections_account: None,
10203            routing_number: None,
10204        }
10205    }
10206}
10207impl Default for ConfirmSetupIntentPaymentMethodDataUsBankAccount {
10208    fn default() -> Self {
10209        Self::new()
10210    }
10211}
10212/// Account holder type: individual or company.
10213#[derive(Copy, Clone, Eq, PartialEq)]
10214pub enum ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
10215    Company,
10216    Individual,
10217}
10218impl ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
10219    pub fn as_str(self) -> &'static str {
10220        use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
10221        match self {
10222            Company => "company",
10223            Individual => "individual",
10224        }
10225    }
10226}
10227
10228impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
10229    type Err = stripe_types::StripeParseError;
10230    fn from_str(s: &str) -> Result<Self, Self::Err> {
10231        use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
10232        match s {
10233            "company" => Ok(Company),
10234            "individual" => Ok(Individual),
10235            _ => Err(stripe_types::StripeParseError),
10236        }
10237    }
10238}
10239impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
10240    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10241        f.write_str(self.as_str())
10242    }
10243}
10244
10245impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
10246    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10247        f.write_str(self.as_str())
10248    }
10249}
10250impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
10251    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10252    where
10253        S: serde::Serializer,
10254    {
10255        serializer.serialize_str(self.as_str())
10256    }
10257}
10258#[cfg(feature = "deserialize")]
10259impl<'de> serde::Deserialize<'de>
10260    for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType
10261{
10262    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10263        use std::str::FromStr;
10264        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10265        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType"))
10266    }
10267}
10268/// Account type: checkings or savings. Defaults to checking if omitted.
10269#[derive(Copy, Clone, Eq, PartialEq)]
10270pub enum ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
10271    Checking,
10272    Savings,
10273}
10274impl ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
10275    pub fn as_str(self) -> &'static str {
10276        use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
10277        match self {
10278            Checking => "checking",
10279            Savings => "savings",
10280        }
10281    }
10282}
10283
10284impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
10285    type Err = stripe_types::StripeParseError;
10286    fn from_str(s: &str) -> Result<Self, Self::Err> {
10287        use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
10288        match s {
10289            "checking" => Ok(Checking),
10290            "savings" => Ok(Savings),
10291            _ => Err(stripe_types::StripeParseError),
10292        }
10293    }
10294}
10295impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
10296    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10297        f.write_str(self.as_str())
10298    }
10299}
10300
10301impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
10302    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10303        f.write_str(self.as_str())
10304    }
10305}
10306impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
10307    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10308    where
10309        S: serde::Serializer,
10310    {
10311        serializer.serialize_str(self.as_str())
10312    }
10313}
10314#[cfg(feature = "deserialize")]
10315impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
10316    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10317        use std::str::FromStr;
10318        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10319        Self::from_str(&s).map_err(|_| {
10320            serde::de::Error::custom(
10321                "Unknown value for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType",
10322            )
10323        })
10324    }
10325}
10326/// Payment method-specific configuration for this SetupIntent.
10327#[derive(Clone, Debug, serde::Serialize)]
10328pub struct ConfirmSetupIntentPaymentMethodOptions {
10329    /// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options.
10330    #[serde(skip_serializing_if = "Option::is_none")]
10331    pub acss_debit: Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebit>,
10332    /// If this is a `amazon_pay` SetupIntent, this sub-hash contains details about the AmazonPay payment method options.
10333    #[serde(skip_serializing_if = "Option::is_none")]
10334    #[serde(with = "stripe_types::with_serde_json_opt")]
10335    pub amazon_pay: Option<miniserde::json::Value>,
10336    /// If this is a `bacs_debit` SetupIntent, this sub-hash contains details about the Bacs Debit payment method options.
10337    #[serde(skip_serializing_if = "Option::is_none")]
10338    pub bacs_debit: Option<ConfirmSetupIntentPaymentMethodOptionsBacsDebit>,
10339    /// Configuration for any card setup attempted on this SetupIntent.
10340    #[serde(skip_serializing_if = "Option::is_none")]
10341    pub card: Option<ConfirmSetupIntentPaymentMethodOptionsCard>,
10342    /// If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options.
10343    #[serde(skip_serializing_if = "Option::is_none")]
10344    #[serde(with = "stripe_types::with_serde_json_opt")]
10345    pub card_present: Option<miniserde::json::Value>,
10346    /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options.
10347    #[serde(skip_serializing_if = "Option::is_none")]
10348    pub klarna: Option<ConfirmSetupIntentPaymentMethodOptionsKlarna>,
10349    /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
10350    #[serde(skip_serializing_if = "Option::is_none")]
10351    pub link: Option<SetupIntentPaymentMethodOptionsParam>,
10352    /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
10353    #[serde(skip_serializing_if = "Option::is_none")]
10354    pub paypal: Option<PaymentMethodOptionsParam>,
10355    /// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options.
10356    #[serde(skip_serializing_if = "Option::is_none")]
10357    pub sepa_debit: Option<ConfirmSetupIntentPaymentMethodOptionsSepaDebit>,
10358    /// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options.
10359    #[serde(skip_serializing_if = "Option::is_none")]
10360    pub us_bank_account: Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccount>,
10361}
10362impl ConfirmSetupIntentPaymentMethodOptions {
10363    pub fn new() -> Self {
10364        Self {
10365            acss_debit: None,
10366            amazon_pay: None,
10367            bacs_debit: None,
10368            card: None,
10369            card_present: None,
10370            klarna: None,
10371            link: None,
10372            paypal: None,
10373            sepa_debit: None,
10374            us_bank_account: None,
10375        }
10376    }
10377}
10378impl Default for ConfirmSetupIntentPaymentMethodOptions {
10379    fn default() -> Self {
10380        Self::new()
10381    }
10382}
10383/// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options.
10384#[derive(Clone, Debug, serde::Serialize)]
10385pub struct ConfirmSetupIntentPaymentMethodOptionsAcssDebit {
10386    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
10387    /// Must be a [supported currency](https://stripe.com/docs/currencies).
10388    #[serde(skip_serializing_if = "Option::is_none")]
10389    pub currency: Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency>,
10390    /// Additional fields for Mandate creation
10391    #[serde(skip_serializing_if = "Option::is_none")]
10392    pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions>,
10393    /// Bank account verification method.
10394    #[serde(skip_serializing_if = "Option::is_none")]
10395    pub verification_method:
10396        Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
10397}
10398impl ConfirmSetupIntentPaymentMethodOptionsAcssDebit {
10399    pub fn new() -> Self {
10400        Self { currency: None, mandate_options: None, verification_method: None }
10401    }
10402}
10403impl Default for ConfirmSetupIntentPaymentMethodOptionsAcssDebit {
10404    fn default() -> Self {
10405        Self::new()
10406    }
10407}
10408/// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
10409/// Must be a [supported currency](https://stripe.com/docs/currencies).
10410#[derive(Copy, Clone, Eq, PartialEq)]
10411pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
10412    Cad,
10413    Usd,
10414}
10415impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
10416    pub fn as_str(self) -> &'static str {
10417        use ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
10418        match self {
10419            Cad => "cad",
10420            Usd => "usd",
10421        }
10422    }
10423}
10424
10425impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
10426    type Err = stripe_types::StripeParseError;
10427    fn from_str(s: &str) -> Result<Self, Self::Err> {
10428        use ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
10429        match s {
10430            "cad" => Ok(Cad),
10431            "usd" => Ok(Usd),
10432            _ => Err(stripe_types::StripeParseError),
10433        }
10434    }
10435}
10436impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
10437    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10438        f.write_str(self.as_str())
10439    }
10440}
10441
10442impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
10443    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10444        f.write_str(self.as_str())
10445    }
10446}
10447impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
10448    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10449    where
10450        S: serde::Serializer,
10451    {
10452        serializer.serialize_str(self.as_str())
10453    }
10454}
10455#[cfg(feature = "deserialize")]
10456impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
10457    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10458        use std::str::FromStr;
10459        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10460        Self::from_str(&s).map_err(|_| {
10461            serde::de::Error::custom(
10462                "Unknown value for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency",
10463            )
10464        })
10465    }
10466}
10467/// Additional fields for Mandate creation
10468#[derive(Clone, Debug, serde::Serialize)]
10469pub struct ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
10470    /// A URL for custom mandate text to render during confirmation step.
10471    /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,.
10472    /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent.
10473    #[serde(skip_serializing_if = "Option::is_none")]
10474    pub custom_mandate_url: Option<String>,
10475    /// List of Stripe products where this mandate can be selected automatically.
10476    #[serde(skip_serializing_if = "Option::is_none")]
10477    pub default_for:
10478        Option<Vec<ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor>>,
10479    /// Description of the mandate interval.
10480    /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'.
10481    #[serde(skip_serializing_if = "Option::is_none")]
10482    pub interval_description: Option<String>,
10483    /// Payment schedule for the mandate.
10484    #[serde(skip_serializing_if = "Option::is_none")]
10485    pub payment_schedule:
10486        Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
10487    /// Transaction type of the mandate.
10488    #[serde(skip_serializing_if = "Option::is_none")]
10489    pub transaction_type:
10490        Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
10491}
10492impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
10493    pub fn new() -> Self {
10494        Self {
10495            custom_mandate_url: None,
10496            default_for: None,
10497            interval_description: None,
10498            payment_schedule: None,
10499            transaction_type: None,
10500        }
10501    }
10502}
10503impl Default for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
10504    fn default() -> Self {
10505        Self::new()
10506    }
10507}
10508/// List of Stripe products where this mandate can be selected automatically.
10509#[derive(Copy, Clone, Eq, PartialEq)]
10510pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
10511    Invoice,
10512    Subscription,
10513}
10514impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
10515    pub fn as_str(self) -> &'static str {
10516        use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
10517        match self {
10518            Invoice => "invoice",
10519            Subscription => "subscription",
10520        }
10521    }
10522}
10523
10524impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
10525    type Err = stripe_types::StripeParseError;
10526    fn from_str(s: &str) -> Result<Self, Self::Err> {
10527        use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
10528        match s {
10529            "invoice" => Ok(Invoice),
10530            "subscription" => Ok(Subscription),
10531            _ => Err(stripe_types::StripeParseError),
10532        }
10533    }
10534}
10535impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
10536    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10537        f.write_str(self.as_str())
10538    }
10539}
10540
10541impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
10542    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10543        f.write_str(self.as_str())
10544    }
10545}
10546impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
10547    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10548    where
10549        S: serde::Serializer,
10550    {
10551        serializer.serialize_str(self.as_str())
10552    }
10553}
10554#[cfg(feature = "deserialize")]
10555impl<'de> serde::Deserialize<'de>
10556    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
10557{
10558    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10559        use std::str::FromStr;
10560        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10561        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor"))
10562    }
10563}
10564/// Payment schedule for the mandate.
10565#[derive(Copy, Clone, Eq, PartialEq)]
10566pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
10567    Combined,
10568    Interval,
10569    Sporadic,
10570}
10571impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
10572    pub fn as_str(self) -> &'static str {
10573        use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
10574        match self {
10575            Combined => "combined",
10576            Interval => "interval",
10577            Sporadic => "sporadic",
10578        }
10579    }
10580}
10581
10582impl std::str::FromStr
10583    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
10584{
10585    type Err = stripe_types::StripeParseError;
10586    fn from_str(s: &str) -> Result<Self, Self::Err> {
10587        use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
10588        match s {
10589            "combined" => Ok(Combined),
10590            "interval" => Ok(Interval),
10591            "sporadic" => Ok(Sporadic),
10592            _ => Err(stripe_types::StripeParseError),
10593        }
10594    }
10595}
10596impl std::fmt::Display
10597    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
10598{
10599    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10600        f.write_str(self.as_str())
10601    }
10602}
10603
10604impl std::fmt::Debug
10605    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
10606{
10607    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10608        f.write_str(self.as_str())
10609    }
10610}
10611impl serde::Serialize
10612    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
10613{
10614    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10615    where
10616        S: serde::Serializer,
10617    {
10618        serializer.serialize_str(self.as_str())
10619    }
10620}
10621#[cfg(feature = "deserialize")]
10622impl<'de> serde::Deserialize<'de>
10623    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
10624{
10625    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10626        use std::str::FromStr;
10627        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10628        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"))
10629    }
10630}
10631/// Transaction type of the mandate.
10632#[derive(Copy, Clone, Eq, PartialEq)]
10633pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
10634    Business,
10635    Personal,
10636}
10637impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
10638    pub fn as_str(self) -> &'static str {
10639        use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
10640        match self {
10641            Business => "business",
10642            Personal => "personal",
10643        }
10644    }
10645}
10646
10647impl std::str::FromStr
10648    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
10649{
10650    type Err = stripe_types::StripeParseError;
10651    fn from_str(s: &str) -> Result<Self, Self::Err> {
10652        use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
10653        match s {
10654            "business" => Ok(Business),
10655            "personal" => Ok(Personal),
10656            _ => Err(stripe_types::StripeParseError),
10657        }
10658    }
10659}
10660impl std::fmt::Display
10661    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
10662{
10663    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10664        f.write_str(self.as_str())
10665    }
10666}
10667
10668impl std::fmt::Debug
10669    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
10670{
10671    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10672        f.write_str(self.as_str())
10673    }
10674}
10675impl serde::Serialize
10676    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
10677{
10678    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10679    where
10680        S: serde::Serializer,
10681    {
10682        serializer.serialize_str(self.as_str())
10683    }
10684}
10685#[cfg(feature = "deserialize")]
10686impl<'de> serde::Deserialize<'de>
10687    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
10688{
10689    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10690        use std::str::FromStr;
10691        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10692        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"))
10693    }
10694}
10695/// Bank account verification method.
10696#[derive(Copy, Clone, Eq, PartialEq)]
10697pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
10698    Automatic,
10699    Instant,
10700    Microdeposits,
10701}
10702impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
10703    pub fn as_str(self) -> &'static str {
10704        use ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
10705        match self {
10706            Automatic => "automatic",
10707            Instant => "instant",
10708            Microdeposits => "microdeposits",
10709        }
10710    }
10711}
10712
10713impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
10714    type Err = stripe_types::StripeParseError;
10715    fn from_str(s: &str) -> Result<Self, Self::Err> {
10716        use ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
10717        match s {
10718            "automatic" => Ok(Automatic),
10719            "instant" => Ok(Instant),
10720            "microdeposits" => Ok(Microdeposits),
10721            _ => Err(stripe_types::StripeParseError),
10722        }
10723    }
10724}
10725impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
10726    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10727        f.write_str(self.as_str())
10728    }
10729}
10730
10731impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
10732    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10733        f.write_str(self.as_str())
10734    }
10735}
10736impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
10737    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10738    where
10739        S: serde::Serializer,
10740    {
10741        serializer.serialize_str(self.as_str())
10742    }
10743}
10744#[cfg(feature = "deserialize")]
10745impl<'de> serde::Deserialize<'de>
10746    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod
10747{
10748    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10749        use std::str::FromStr;
10750        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10751        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod"))
10752    }
10753}
10754/// If this is a `bacs_debit` SetupIntent, this sub-hash contains details about the Bacs Debit payment method options.
10755#[derive(Clone, Debug, serde::Serialize)]
10756pub struct ConfirmSetupIntentPaymentMethodOptionsBacsDebit {
10757    /// Additional fields for Mandate creation
10758    #[serde(skip_serializing_if = "Option::is_none")]
10759    pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
10760}
10761impl ConfirmSetupIntentPaymentMethodOptionsBacsDebit {
10762    pub fn new() -> Self {
10763        Self { mandate_options: None }
10764    }
10765}
10766impl Default for ConfirmSetupIntentPaymentMethodOptionsBacsDebit {
10767    fn default() -> Self {
10768        Self::new()
10769    }
10770}
10771/// Configuration for any card setup attempted on this SetupIntent.
10772#[derive(Clone, Debug, serde::Serialize)]
10773pub struct ConfirmSetupIntentPaymentMethodOptionsCard {
10774    /// Configuration options for setting up an eMandate for cards issued in India.
10775    #[serde(skip_serializing_if = "Option::is_none")]
10776    pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsCardMandateOptions>,
10777    /// When specified, this parameter signals that a card has been collected
10778    /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This
10779    /// parameter can only be provided during confirmation.
10780    #[serde(skip_serializing_if = "Option::is_none")]
10781    pub moto: Option<bool>,
10782    /// Selected network to process this SetupIntent on.
10783    /// Depends on the available networks of the card attached to the SetupIntent.
10784    /// Can be only set confirm-time.
10785    #[serde(skip_serializing_if = "Option::is_none")]
10786    pub network: Option<ConfirmSetupIntentPaymentMethodOptionsCardNetwork>,
10787    /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication).
10788    /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
10789    /// If not provided, this value defaults to `automatic`.
10790    /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
10791    #[serde(skip_serializing_if = "Option::is_none")]
10792    pub request_three_d_secure:
10793        Option<ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure>,
10794    /// If 3D Secure authentication was performed with a third-party provider,
10795    /// the authentication details to use for this setup.
10796    #[serde(skip_serializing_if = "Option::is_none")]
10797    pub three_d_secure: Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure>,
10798}
10799impl ConfirmSetupIntentPaymentMethodOptionsCard {
10800    pub fn new() -> Self {
10801        Self {
10802            mandate_options: None,
10803            moto: None,
10804            network: None,
10805            request_three_d_secure: None,
10806            three_d_secure: None,
10807        }
10808    }
10809}
10810impl Default for ConfirmSetupIntentPaymentMethodOptionsCard {
10811    fn default() -> Self {
10812        Self::new()
10813    }
10814}
10815/// Configuration options for setting up an eMandate for cards issued in India.
10816#[derive(Clone, Debug, serde::Serialize)]
10817pub struct ConfirmSetupIntentPaymentMethodOptionsCardMandateOptions {
10818    /// Amount to be charged for future payments.
10819    pub amount: i64,
10820    /// One of `fixed` or `maximum`.
10821    /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
10822    /// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
10823    pub amount_type: ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType,
10824    /// Currency in which future payments will be charged.
10825    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
10826    /// Must be a [supported currency](https://stripe.com/docs/currencies).
10827    pub currency: stripe_types::Currency,
10828    /// A description of the mandate or subscription that is meant to be displayed to the customer.
10829    #[serde(skip_serializing_if = "Option::is_none")]
10830    pub description: Option<String>,
10831    /// End date of the mandate or subscription.
10832    /// If not provided, the mandate will be active until canceled.
10833    /// If provided, end date should be after start date.
10834    #[serde(skip_serializing_if = "Option::is_none")]
10835    pub end_date: Option<stripe_types::Timestamp>,
10836    /// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
10837    pub interval: ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval,
10838    /// The number of intervals between payments.
10839    /// For example, `interval=month` and `interval_count=3` indicates one payment every three months.
10840    /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).
10841    /// This parameter is optional when `interval=sporadic`.
10842    #[serde(skip_serializing_if = "Option::is_none")]
10843    pub interval_count: Option<u64>,
10844    /// Unique identifier for the mandate or subscription.
10845    pub reference: String,
10846    /// Start date of the mandate or subscription. Start date should not be lesser than yesterday.
10847    pub start_date: stripe_types::Timestamp,
10848    /// Specifies the type of mandates supported. Possible values are `india`.
10849    #[serde(skip_serializing_if = "Option::is_none")]
10850    pub supported_types:
10851        Option<Vec<ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
10852}
10853impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptions {
10854    pub fn new(
10855        amount: impl Into<i64>,
10856        amount_type: impl Into<ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
10857        currency: impl Into<stripe_types::Currency>,
10858        interval: impl Into<ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval>,
10859        reference: impl Into<String>,
10860        start_date: impl Into<stripe_types::Timestamp>,
10861    ) -> Self {
10862        Self {
10863            amount: amount.into(),
10864            amount_type: amount_type.into(),
10865            currency: currency.into(),
10866            description: None,
10867            end_date: None,
10868            interval: interval.into(),
10869            interval_count: None,
10870            reference: reference.into(),
10871            start_date: start_date.into(),
10872            supported_types: None,
10873        }
10874    }
10875}
10876/// One of `fixed` or `maximum`.
10877/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
10878/// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
10879#[derive(Copy, Clone, Eq, PartialEq)]
10880pub enum ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
10881    Fixed,
10882    Maximum,
10883}
10884impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
10885    pub fn as_str(self) -> &'static str {
10886        use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
10887        match self {
10888            Fixed => "fixed",
10889            Maximum => "maximum",
10890        }
10891    }
10892}
10893
10894impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
10895    type Err = stripe_types::StripeParseError;
10896    fn from_str(s: &str) -> Result<Self, Self::Err> {
10897        use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
10898        match s {
10899            "fixed" => Ok(Fixed),
10900            "maximum" => Ok(Maximum),
10901            _ => Err(stripe_types::StripeParseError),
10902        }
10903    }
10904}
10905impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
10906    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10907        f.write_str(self.as_str())
10908    }
10909}
10910
10911impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
10912    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10913        f.write_str(self.as_str())
10914    }
10915}
10916impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
10917    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10918    where
10919        S: serde::Serializer,
10920    {
10921        serializer.serialize_str(self.as_str())
10922    }
10923}
10924#[cfg(feature = "deserialize")]
10925impl<'de> serde::Deserialize<'de>
10926    for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType
10927{
10928    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10929        use std::str::FromStr;
10930        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10931        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType"))
10932    }
10933}
10934/// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
10935#[derive(Copy, Clone, Eq, PartialEq)]
10936pub enum ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
10937    Day,
10938    Month,
10939    Sporadic,
10940    Week,
10941    Year,
10942}
10943impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
10944    pub fn as_str(self) -> &'static str {
10945        use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
10946        match self {
10947            Day => "day",
10948            Month => "month",
10949            Sporadic => "sporadic",
10950            Week => "week",
10951            Year => "year",
10952        }
10953    }
10954}
10955
10956impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
10957    type Err = stripe_types::StripeParseError;
10958    fn from_str(s: &str) -> Result<Self, Self::Err> {
10959        use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
10960        match s {
10961            "day" => Ok(Day),
10962            "month" => Ok(Month),
10963            "sporadic" => Ok(Sporadic),
10964            "week" => Ok(Week),
10965            "year" => Ok(Year),
10966            _ => Err(stripe_types::StripeParseError),
10967        }
10968    }
10969}
10970impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
10971    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10972        f.write_str(self.as_str())
10973    }
10974}
10975
10976impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
10977    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10978        f.write_str(self.as_str())
10979    }
10980}
10981impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
10982    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10983    where
10984        S: serde::Serializer,
10985    {
10986        serializer.serialize_str(self.as_str())
10987    }
10988}
10989#[cfg(feature = "deserialize")]
10990impl<'de> serde::Deserialize<'de>
10991    for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval
10992{
10993    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10994        use std::str::FromStr;
10995        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10996        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval"))
10997    }
10998}
10999/// Specifies the type of mandates supported. Possible values are `india`.
11000#[derive(Copy, Clone, Eq, PartialEq)]
11001pub enum ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
11002    India,
11003}
11004impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
11005    pub fn as_str(self) -> &'static str {
11006        use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
11007        match self {
11008            India => "india",
11009        }
11010    }
11011}
11012
11013impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
11014    type Err = stripe_types::StripeParseError;
11015    fn from_str(s: &str) -> Result<Self, Self::Err> {
11016        use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
11017        match s {
11018            "india" => Ok(India),
11019            _ => Err(stripe_types::StripeParseError),
11020        }
11021    }
11022}
11023impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
11024    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11025        f.write_str(self.as_str())
11026    }
11027}
11028
11029impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
11030    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11031        f.write_str(self.as_str())
11032    }
11033}
11034impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
11035    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11036    where
11037        S: serde::Serializer,
11038    {
11039        serializer.serialize_str(self.as_str())
11040    }
11041}
11042#[cfg(feature = "deserialize")]
11043impl<'de> serde::Deserialize<'de>
11044    for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
11045{
11046    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11047        use std::str::FromStr;
11048        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11049        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"))
11050    }
11051}
11052/// Selected network to process this SetupIntent on.
11053/// Depends on the available networks of the card attached to the SetupIntent.
11054/// Can be only set confirm-time.
11055#[derive(Copy, Clone, Eq, PartialEq)]
11056pub enum ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
11057    Amex,
11058    CartesBancaires,
11059    Diners,
11060    Discover,
11061    EftposAu,
11062    Girocard,
11063    Interac,
11064    Jcb,
11065    Link,
11066    Mastercard,
11067    Unionpay,
11068    Unknown,
11069    Visa,
11070}
11071impl ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
11072    pub fn as_str(self) -> &'static str {
11073        use ConfirmSetupIntentPaymentMethodOptionsCardNetwork::*;
11074        match self {
11075            Amex => "amex",
11076            CartesBancaires => "cartes_bancaires",
11077            Diners => "diners",
11078            Discover => "discover",
11079            EftposAu => "eftpos_au",
11080            Girocard => "girocard",
11081            Interac => "interac",
11082            Jcb => "jcb",
11083            Link => "link",
11084            Mastercard => "mastercard",
11085            Unionpay => "unionpay",
11086            Unknown => "unknown",
11087            Visa => "visa",
11088        }
11089    }
11090}
11091
11092impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
11093    type Err = stripe_types::StripeParseError;
11094    fn from_str(s: &str) -> Result<Self, Self::Err> {
11095        use ConfirmSetupIntentPaymentMethodOptionsCardNetwork::*;
11096        match s {
11097            "amex" => Ok(Amex),
11098            "cartes_bancaires" => Ok(CartesBancaires),
11099            "diners" => Ok(Diners),
11100            "discover" => Ok(Discover),
11101            "eftpos_au" => Ok(EftposAu),
11102            "girocard" => Ok(Girocard),
11103            "interac" => Ok(Interac),
11104            "jcb" => Ok(Jcb),
11105            "link" => Ok(Link),
11106            "mastercard" => Ok(Mastercard),
11107            "unionpay" => Ok(Unionpay),
11108            "unknown" => Ok(Unknown),
11109            "visa" => Ok(Visa),
11110            _ => Err(stripe_types::StripeParseError),
11111        }
11112    }
11113}
11114impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
11115    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11116        f.write_str(self.as_str())
11117    }
11118}
11119
11120impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
11121    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11122        f.write_str(self.as_str())
11123    }
11124}
11125impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
11126    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11127    where
11128        S: serde::Serializer,
11129    {
11130        serializer.serialize_str(self.as_str())
11131    }
11132}
11133#[cfg(feature = "deserialize")]
11134impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
11135    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11136        use std::str::FromStr;
11137        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11138        Self::from_str(&s).map_err(|_| {
11139            serde::de::Error::custom(
11140                "Unknown value for ConfirmSetupIntentPaymentMethodOptionsCardNetwork",
11141            )
11142        })
11143    }
11144}
11145/// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication).
11146/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
11147/// If not provided, this value defaults to `automatic`.
11148/// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
11149#[derive(Copy, Clone, Eq, PartialEq)]
11150pub enum ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
11151    Any,
11152    Automatic,
11153    Challenge,
11154}
11155impl ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
11156    pub fn as_str(self) -> &'static str {
11157        use ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
11158        match self {
11159            Any => "any",
11160            Automatic => "automatic",
11161            Challenge => "challenge",
11162        }
11163    }
11164}
11165
11166impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
11167    type Err = stripe_types::StripeParseError;
11168    fn from_str(s: &str) -> Result<Self, Self::Err> {
11169        use ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
11170        match s {
11171            "any" => Ok(Any),
11172            "automatic" => Ok(Automatic),
11173            "challenge" => Ok(Challenge),
11174            _ => Err(stripe_types::StripeParseError),
11175        }
11176    }
11177}
11178impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
11179    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11180        f.write_str(self.as_str())
11181    }
11182}
11183
11184impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
11185    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11186        f.write_str(self.as_str())
11187    }
11188}
11189impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
11190    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11191    where
11192        S: serde::Serializer,
11193    {
11194        serializer.serialize_str(self.as_str())
11195    }
11196}
11197#[cfg(feature = "deserialize")]
11198impl<'de> serde::Deserialize<'de>
11199    for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure
11200{
11201    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11202        use std::str::FromStr;
11203        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11204        Self::from_str(&s).map_err(|_| {
11205            serde::de::Error::custom(
11206                "Unknown value for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure",
11207            )
11208        })
11209    }
11210}
11211/// If 3D Secure authentication was performed with a third-party provider,
11212/// the authentication details to use for this setup.
11213#[derive(Clone, Debug, serde::Serialize)]
11214pub struct ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure {
11215    /// The `transStatus` returned from the card Issuer’s ACS in the ARes.
11216    #[serde(skip_serializing_if = "Option::is_none")]
11217    pub ares_trans_status:
11218        Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
11219    /// The cryptogram, also known as the "authentication value" (AAV, CAVV or
11220    /// AEVV). This value is 20 bytes, base64-encoded into a 28-character string.
11221    /// (Most 3D Secure providers will return the base64-encoded version, which
11222    /// is what you should specify here.)
11223    #[serde(skip_serializing_if = "Option::is_none")]
11224    pub cryptogram: Option<String>,
11225    /// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
11226    /// provider and indicates what degree of authentication was performed.
11227    #[serde(skip_serializing_if = "Option::is_none")]
11228    pub electronic_commerce_indicator:
11229        Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
11230    /// Network specific 3DS fields. Network specific arguments require an
11231    /// explicit card brand choice. The parameter `payment_method_options.card.network``
11232    /// must be populated accordingly
11233    #[serde(skip_serializing_if = "Option::is_none")]
11234    pub network_options:
11235        Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
11236    /// The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the
11237    /// AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99.
11238    #[serde(skip_serializing_if = "Option::is_none")]
11239    pub requestor_challenge_indicator: Option<String>,
11240    /// For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server
11241    /// Transaction ID (dsTransID).
11242    #[serde(skip_serializing_if = "Option::is_none")]
11243    pub transaction_id: Option<String>,
11244    /// The version of 3D Secure that was performed.
11245    #[serde(skip_serializing_if = "Option::is_none")]
11246    pub version: Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion>,
11247}
11248impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure {
11249    pub fn new() -> Self {
11250        Self {
11251            ares_trans_status: None,
11252            cryptogram: None,
11253            electronic_commerce_indicator: None,
11254            network_options: None,
11255            requestor_challenge_indicator: None,
11256            transaction_id: None,
11257            version: None,
11258        }
11259    }
11260}
11261impl Default for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure {
11262    fn default() -> Self {
11263        Self::new()
11264    }
11265}
11266/// The `transStatus` returned from the card Issuer’s ACS in the ARes.
11267#[derive(Copy, Clone, Eq, PartialEq)]
11268pub enum ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
11269    A,
11270    C,
11271    I,
11272    N,
11273    R,
11274    U,
11275    Y,
11276}
11277impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
11278    pub fn as_str(self) -> &'static str {
11279        use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
11280        match self {
11281            A => "A",
11282            C => "C",
11283            I => "I",
11284            N => "N",
11285            R => "R",
11286            U => "U",
11287            Y => "Y",
11288        }
11289    }
11290}
11291
11292impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
11293    type Err = stripe_types::StripeParseError;
11294    fn from_str(s: &str) -> Result<Self, Self::Err> {
11295        use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
11296        match s {
11297            "A" => Ok(A),
11298            "C" => Ok(C),
11299            "I" => Ok(I),
11300            "N" => Ok(N),
11301            "R" => Ok(R),
11302            "U" => Ok(U),
11303            "Y" => Ok(Y),
11304            _ => Err(stripe_types::StripeParseError),
11305        }
11306    }
11307}
11308impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
11309    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11310        f.write_str(self.as_str())
11311    }
11312}
11313
11314impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
11315    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11316        f.write_str(self.as_str())
11317    }
11318}
11319impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
11320    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11321    where
11322        S: serde::Serializer,
11323    {
11324        serializer.serialize_str(self.as_str())
11325    }
11326}
11327#[cfg(feature = "deserialize")]
11328impl<'de> serde::Deserialize<'de>
11329    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
11330{
11331    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11332        use std::str::FromStr;
11333        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11334        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"))
11335    }
11336}
11337/// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
11338/// provider and indicates what degree of authentication was performed.
11339#[derive(Copy, Clone, Eq, PartialEq)]
11340pub enum ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
11341    V01,
11342    V02,
11343    V05,
11344    V06,
11345    V07,
11346}
11347impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
11348    pub fn as_str(self) -> &'static str {
11349        use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
11350        match self {
11351            V01 => "01",
11352            V02 => "02",
11353            V05 => "05",
11354            V06 => "06",
11355            V07 => "07",
11356        }
11357    }
11358}
11359
11360impl std::str::FromStr
11361    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
11362{
11363    type Err = stripe_types::StripeParseError;
11364    fn from_str(s: &str) -> Result<Self, Self::Err> {
11365        use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
11366        match s {
11367            "01" => Ok(V01),
11368            "02" => Ok(V02),
11369            "05" => Ok(V05),
11370            "06" => Ok(V06),
11371            "07" => Ok(V07),
11372            _ => Err(stripe_types::StripeParseError),
11373        }
11374    }
11375}
11376impl std::fmt::Display
11377    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
11378{
11379    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11380        f.write_str(self.as_str())
11381    }
11382}
11383
11384impl std::fmt::Debug
11385    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
11386{
11387    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11388        f.write_str(self.as_str())
11389    }
11390}
11391impl serde::Serialize
11392    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
11393{
11394    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11395    where
11396        S: serde::Serializer,
11397    {
11398        serializer.serialize_str(self.as_str())
11399    }
11400}
11401#[cfg(feature = "deserialize")]
11402impl<'de> serde::Deserialize<'de>
11403    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
11404{
11405    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11406        use std::str::FromStr;
11407        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11408        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"))
11409    }
11410}
11411/// Network specific 3DS fields. Network specific arguments require an
11412/// explicit card brand choice. The parameter `payment_method_options.card.network``
11413/// must be populated accordingly
11414#[derive(Clone, Debug, serde::Serialize)]
11415pub struct ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
11416    /// Cartes Bancaires-specific 3DS fields.
11417    #[serde(skip_serializing_if = "Option::is_none")]
11418    pub cartes_bancaires:
11419        Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires>,
11420}
11421impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
11422    pub fn new() -> Self {
11423        Self { cartes_bancaires: None }
11424    }
11425}
11426impl Default for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
11427    fn default() -> Self {
11428        Self::new()
11429    }
11430}
11431/// Cartes Bancaires-specific 3DS fields.
11432#[derive(Clone, Debug, serde::Serialize)]
11433pub struct ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
11434    /// The cryptogram calculation algorithm used by the card Issuer's ACS
11435    /// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
11436    /// messageExtension: CB-AVALGO
11437    pub cb_avalgo:
11438        ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
11439    /// The exemption indicator returned from Cartes Bancaires in the ARes.
11440    /// message extension: CB-EXEMPTION; string (4 characters)
11441    /// This is a 3 byte bitmap (low significant byte first and most significant
11442    /// bit first) that has been Base64 encoded
11443    #[serde(skip_serializing_if = "Option::is_none")]
11444    pub cb_exemption: Option<String>,
11445    /// The risk score returned from Cartes Bancaires in the ARes.
11446    /// message extension: CB-SCORE; numeric value 0-99
11447    #[serde(skip_serializing_if = "Option::is_none")]
11448    pub cb_score: Option<i64>,
11449}
11450impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
11451    pub fn new(
11452        cb_avalgo: impl Into<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
11453    ) -> Self {
11454        Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
11455    }
11456}
11457/// The cryptogram calculation algorithm used by the card Issuer's ACS
11458/// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
11459/// messageExtension: CB-AVALGO
11460#[derive(Copy, Clone, Eq, PartialEq)]
11461pub enum ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
11462{
11463    V0,
11464    V1,
11465    V2,
11466    V3,
11467    V4,
11468    A,
11469}
11470impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
11471    pub fn as_str(self) -> &'static str {
11472        use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
11473        match self {
11474            V0 => "0",
11475            V1 => "1",
11476            V2 => "2",
11477            V3 => "3",
11478            V4 => "4",
11479            A => "A",
11480        }
11481    }
11482}
11483
11484impl std::str::FromStr
11485    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
11486{
11487    type Err = stripe_types::StripeParseError;
11488    fn from_str(s: &str) -> Result<Self, Self::Err> {
11489        use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
11490        match s {
11491            "0" => Ok(V0),
11492            "1" => Ok(V1),
11493            "2" => Ok(V2),
11494            "3" => Ok(V3),
11495            "4" => Ok(V4),
11496            "A" => Ok(A),
11497            _ => Err(stripe_types::StripeParseError),
11498        }
11499    }
11500}
11501impl std::fmt::Display
11502    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
11503{
11504    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11505        f.write_str(self.as_str())
11506    }
11507}
11508
11509impl std::fmt::Debug
11510    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
11511{
11512    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11513        f.write_str(self.as_str())
11514    }
11515}
11516impl serde::Serialize
11517    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
11518{
11519    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11520    where
11521        S: serde::Serializer,
11522    {
11523        serializer.serialize_str(self.as_str())
11524    }
11525}
11526#[cfg(feature = "deserialize")]
11527impl<'de> serde::Deserialize<'de>
11528    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
11529{
11530    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11531        use std::str::FromStr;
11532        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11533        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"))
11534    }
11535}
11536/// The version of 3D Secure that was performed.
11537#[derive(Copy, Clone, Eq, PartialEq)]
11538pub enum ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
11539    V1_0_2,
11540    V2_1_0,
11541    V2_2_0,
11542}
11543impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
11544    pub fn as_str(self) -> &'static str {
11545        use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
11546        match self {
11547            V1_0_2 => "1.0.2",
11548            V2_1_0 => "2.1.0",
11549            V2_2_0 => "2.2.0",
11550        }
11551    }
11552}
11553
11554impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
11555    type Err = stripe_types::StripeParseError;
11556    fn from_str(s: &str) -> Result<Self, Self::Err> {
11557        use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
11558        match s {
11559            "1.0.2" => Ok(V1_0_2),
11560            "2.1.0" => Ok(V2_1_0),
11561            "2.2.0" => Ok(V2_2_0),
11562            _ => Err(stripe_types::StripeParseError),
11563        }
11564    }
11565}
11566impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
11567    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11568        f.write_str(self.as_str())
11569    }
11570}
11571
11572impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
11573    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11574        f.write_str(self.as_str())
11575    }
11576}
11577impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
11578    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11579    where
11580        S: serde::Serializer,
11581    {
11582        serializer.serialize_str(self.as_str())
11583    }
11584}
11585#[cfg(feature = "deserialize")]
11586impl<'de> serde::Deserialize<'de>
11587    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion
11588{
11589    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11590        use std::str::FromStr;
11591        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11592        Self::from_str(&s).map_err(|_| {
11593            serde::de::Error::custom(
11594                "Unknown value for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion",
11595            )
11596        })
11597    }
11598}
11599/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options.
11600#[derive(Clone, Debug, serde::Serialize)]
11601pub struct ConfirmSetupIntentPaymentMethodOptionsKlarna {
11602    /// The currency of the SetupIntent. Three letter ISO currency code.
11603    #[serde(skip_serializing_if = "Option::is_none")]
11604    pub currency: Option<stripe_types::Currency>,
11605    /// On-demand details if setting up a payment method for on-demand payments.
11606    #[serde(skip_serializing_if = "Option::is_none")]
11607    pub on_demand: Option<ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemand>,
11608    /// Preferred language of the Klarna authorization page that the customer is redirected to
11609    #[serde(skip_serializing_if = "Option::is_none")]
11610    pub preferred_locale: Option<ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale>,
11611    /// Subscription details if setting up or charging a subscription
11612    #[serde(skip_serializing_if = "Option::is_none")]
11613    pub subscriptions: Option<Vec<ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptions>>,
11614}
11615impl ConfirmSetupIntentPaymentMethodOptionsKlarna {
11616    pub fn new() -> Self {
11617        Self { currency: None, on_demand: None, preferred_locale: None, subscriptions: None }
11618    }
11619}
11620impl Default for ConfirmSetupIntentPaymentMethodOptionsKlarna {
11621    fn default() -> Self {
11622        Self::new()
11623    }
11624}
11625/// On-demand details if setting up a payment method for on-demand payments.
11626#[derive(Copy, Clone, Debug, serde::Serialize)]
11627pub struct ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemand {
11628    /// Your average amount value.
11629    /// You can use a value across your customer base, or segment based on customer type, country, etc.
11630    #[serde(skip_serializing_if = "Option::is_none")]
11631    pub average_amount: Option<i64>,
11632    /// The maximum value you may charge a customer per purchase.
11633    /// You can use a value across your customer base, or segment based on customer type, country, etc.
11634    #[serde(skip_serializing_if = "Option::is_none")]
11635    pub maximum_amount: Option<i64>,
11636    /// The lowest or minimum value you may charge a customer per purchase.
11637    /// You can use a value across your customer base, or segment based on customer type, country, etc.
11638    #[serde(skip_serializing_if = "Option::is_none")]
11639    pub minimum_amount: Option<i64>,
11640    /// Interval at which the customer is making purchases
11641    #[serde(skip_serializing_if = "Option::is_none")]
11642    pub purchase_interval:
11643        Option<ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
11644    /// The number of `purchase_interval` between charges
11645    #[serde(skip_serializing_if = "Option::is_none")]
11646    pub purchase_interval_count: Option<u64>,
11647}
11648impl ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemand {
11649    pub fn new() -> Self {
11650        Self {
11651            average_amount: None,
11652            maximum_amount: None,
11653            minimum_amount: None,
11654            purchase_interval: None,
11655            purchase_interval_count: None,
11656        }
11657    }
11658}
11659impl Default for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemand {
11660    fn default() -> Self {
11661        Self::new()
11662    }
11663}
11664/// Interval at which the customer is making purchases
11665#[derive(Copy, Clone, Eq, PartialEq)]
11666pub enum ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
11667    Day,
11668    Month,
11669    Week,
11670    Year,
11671}
11672impl ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
11673    pub fn as_str(self) -> &'static str {
11674        use ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
11675        match self {
11676            Day => "day",
11677            Month => "month",
11678            Week => "week",
11679            Year => "year",
11680        }
11681    }
11682}
11683
11684impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
11685    type Err = stripe_types::StripeParseError;
11686    fn from_str(s: &str) -> Result<Self, Self::Err> {
11687        use ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
11688        match s {
11689            "day" => Ok(Day),
11690            "month" => Ok(Month),
11691            "week" => Ok(Week),
11692            "year" => Ok(Year),
11693            _ => Err(stripe_types::StripeParseError),
11694        }
11695    }
11696}
11697impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
11698    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11699        f.write_str(self.as_str())
11700    }
11701}
11702
11703impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
11704    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11705        f.write_str(self.as_str())
11706    }
11707}
11708impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
11709    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11710    where
11711        S: serde::Serializer,
11712    {
11713        serializer.serialize_str(self.as_str())
11714    }
11715}
11716#[cfg(feature = "deserialize")]
11717impl<'de> serde::Deserialize<'de>
11718    for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
11719{
11720    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11721        use std::str::FromStr;
11722        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11723        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"))
11724    }
11725}
11726/// Preferred language of the Klarna authorization page that the customer is redirected to
11727#[derive(Clone, Eq, PartialEq)]
11728#[non_exhaustive]
11729pub enum ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
11730    CsMinusCz,
11731    DaMinusDk,
11732    DeMinusAt,
11733    DeMinusCh,
11734    DeMinusDe,
11735    ElMinusGr,
11736    EnMinusAt,
11737    EnMinusAu,
11738    EnMinusBe,
11739    EnMinusCa,
11740    EnMinusCh,
11741    EnMinusCz,
11742    EnMinusDe,
11743    EnMinusDk,
11744    EnMinusEs,
11745    EnMinusFi,
11746    EnMinusFr,
11747    EnMinusGb,
11748    EnMinusGr,
11749    EnMinusIe,
11750    EnMinusIt,
11751    EnMinusNl,
11752    EnMinusNo,
11753    EnMinusNz,
11754    EnMinusPl,
11755    EnMinusPt,
11756    EnMinusRo,
11757    EnMinusSe,
11758    EnMinusUs,
11759    EsMinusEs,
11760    EsMinusUs,
11761    FiMinusFi,
11762    FrMinusBe,
11763    FrMinusCa,
11764    FrMinusCh,
11765    FrMinusFr,
11766    ItMinusCh,
11767    ItMinusIt,
11768    NbMinusNo,
11769    NlMinusBe,
11770    NlMinusNl,
11771    PlMinusPl,
11772    PtMinusPt,
11773    RoMinusRo,
11774    SvMinusFi,
11775    SvMinusSe,
11776    /// An unrecognized value from Stripe. Should not be used as a request parameter.
11777    Unknown(String),
11778}
11779impl ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
11780    pub fn as_str(&self) -> &str {
11781        use ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
11782        match self {
11783            CsMinusCz => "cs-CZ",
11784            DaMinusDk => "da-DK",
11785            DeMinusAt => "de-AT",
11786            DeMinusCh => "de-CH",
11787            DeMinusDe => "de-DE",
11788            ElMinusGr => "el-GR",
11789            EnMinusAt => "en-AT",
11790            EnMinusAu => "en-AU",
11791            EnMinusBe => "en-BE",
11792            EnMinusCa => "en-CA",
11793            EnMinusCh => "en-CH",
11794            EnMinusCz => "en-CZ",
11795            EnMinusDe => "en-DE",
11796            EnMinusDk => "en-DK",
11797            EnMinusEs => "en-ES",
11798            EnMinusFi => "en-FI",
11799            EnMinusFr => "en-FR",
11800            EnMinusGb => "en-GB",
11801            EnMinusGr => "en-GR",
11802            EnMinusIe => "en-IE",
11803            EnMinusIt => "en-IT",
11804            EnMinusNl => "en-NL",
11805            EnMinusNo => "en-NO",
11806            EnMinusNz => "en-NZ",
11807            EnMinusPl => "en-PL",
11808            EnMinusPt => "en-PT",
11809            EnMinusRo => "en-RO",
11810            EnMinusSe => "en-SE",
11811            EnMinusUs => "en-US",
11812            EsMinusEs => "es-ES",
11813            EsMinusUs => "es-US",
11814            FiMinusFi => "fi-FI",
11815            FrMinusBe => "fr-BE",
11816            FrMinusCa => "fr-CA",
11817            FrMinusCh => "fr-CH",
11818            FrMinusFr => "fr-FR",
11819            ItMinusCh => "it-CH",
11820            ItMinusIt => "it-IT",
11821            NbMinusNo => "nb-NO",
11822            NlMinusBe => "nl-BE",
11823            NlMinusNl => "nl-NL",
11824            PlMinusPl => "pl-PL",
11825            PtMinusPt => "pt-PT",
11826            RoMinusRo => "ro-RO",
11827            SvMinusFi => "sv-FI",
11828            SvMinusSe => "sv-SE",
11829            Unknown(v) => v,
11830        }
11831    }
11832}
11833
11834impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
11835    type Err = std::convert::Infallible;
11836    fn from_str(s: &str) -> Result<Self, Self::Err> {
11837        use ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
11838        match s {
11839            "cs-CZ" => Ok(CsMinusCz),
11840            "da-DK" => Ok(DaMinusDk),
11841            "de-AT" => Ok(DeMinusAt),
11842            "de-CH" => Ok(DeMinusCh),
11843            "de-DE" => Ok(DeMinusDe),
11844            "el-GR" => Ok(ElMinusGr),
11845            "en-AT" => Ok(EnMinusAt),
11846            "en-AU" => Ok(EnMinusAu),
11847            "en-BE" => Ok(EnMinusBe),
11848            "en-CA" => Ok(EnMinusCa),
11849            "en-CH" => Ok(EnMinusCh),
11850            "en-CZ" => Ok(EnMinusCz),
11851            "en-DE" => Ok(EnMinusDe),
11852            "en-DK" => Ok(EnMinusDk),
11853            "en-ES" => Ok(EnMinusEs),
11854            "en-FI" => Ok(EnMinusFi),
11855            "en-FR" => Ok(EnMinusFr),
11856            "en-GB" => Ok(EnMinusGb),
11857            "en-GR" => Ok(EnMinusGr),
11858            "en-IE" => Ok(EnMinusIe),
11859            "en-IT" => Ok(EnMinusIt),
11860            "en-NL" => Ok(EnMinusNl),
11861            "en-NO" => Ok(EnMinusNo),
11862            "en-NZ" => Ok(EnMinusNz),
11863            "en-PL" => Ok(EnMinusPl),
11864            "en-PT" => Ok(EnMinusPt),
11865            "en-RO" => Ok(EnMinusRo),
11866            "en-SE" => Ok(EnMinusSe),
11867            "en-US" => Ok(EnMinusUs),
11868            "es-ES" => Ok(EsMinusEs),
11869            "es-US" => Ok(EsMinusUs),
11870            "fi-FI" => Ok(FiMinusFi),
11871            "fr-BE" => Ok(FrMinusBe),
11872            "fr-CA" => Ok(FrMinusCa),
11873            "fr-CH" => Ok(FrMinusCh),
11874            "fr-FR" => Ok(FrMinusFr),
11875            "it-CH" => Ok(ItMinusCh),
11876            "it-IT" => Ok(ItMinusIt),
11877            "nb-NO" => Ok(NbMinusNo),
11878            "nl-BE" => Ok(NlMinusBe),
11879            "nl-NL" => Ok(NlMinusNl),
11880            "pl-PL" => Ok(PlMinusPl),
11881            "pt-PT" => Ok(PtMinusPt),
11882            "ro-RO" => Ok(RoMinusRo),
11883            "sv-FI" => Ok(SvMinusFi),
11884            "sv-SE" => Ok(SvMinusSe),
11885            v => Ok(Unknown(v.to_owned())),
11886        }
11887    }
11888}
11889impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
11890    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11891        f.write_str(self.as_str())
11892    }
11893}
11894
11895impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
11896    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11897        f.write_str(self.as_str())
11898    }
11899}
11900impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
11901    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11902    where
11903        S: serde::Serializer,
11904    {
11905        serializer.serialize_str(self.as_str())
11906    }
11907}
11908#[cfg(feature = "deserialize")]
11909impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
11910    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11911        use std::str::FromStr;
11912        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11913        Ok(Self::from_str(&s).unwrap())
11914    }
11915}
11916/// Subscription details if setting up or charging a subscription
11917#[derive(Clone, Debug, serde::Serialize)]
11918pub struct ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
11919    /// Unit of time between subscription charges.
11920    pub interval: ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
11921    /// The number of intervals (specified in the `interval` attribute) between subscription charges.
11922    /// For example, `interval=month` and `interval_count=3` charges every 3 months.
11923    #[serde(skip_serializing_if = "Option::is_none")]
11924    pub interval_count: Option<u64>,
11925    /// Name for subscription.
11926    #[serde(skip_serializing_if = "Option::is_none")]
11927    pub name: Option<String>,
11928    /// Describes the upcoming charge for this subscription.
11929    pub next_billing: SubscriptionNextBillingParam,
11930    /// A non-customer-facing reference to correlate subscription charges in the Klarna app.
11931    /// Use a value that persists across subscription charges.
11932    pub reference: String,
11933}
11934impl ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
11935    pub fn new(
11936        interval: impl Into<ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
11937        next_billing: impl Into<SubscriptionNextBillingParam>,
11938        reference: impl Into<String>,
11939    ) -> Self {
11940        Self {
11941            interval: interval.into(),
11942            interval_count: None,
11943            name: None,
11944            next_billing: next_billing.into(),
11945            reference: reference.into(),
11946        }
11947    }
11948}
11949/// Unit of time between subscription charges.
11950#[derive(Copy, Clone, Eq, PartialEq)]
11951pub enum ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
11952    Day,
11953    Month,
11954    Week,
11955    Year,
11956}
11957impl ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
11958    pub fn as_str(self) -> &'static str {
11959        use ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
11960        match self {
11961            Day => "day",
11962            Month => "month",
11963            Week => "week",
11964            Year => "year",
11965        }
11966    }
11967}
11968
11969impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
11970    type Err = stripe_types::StripeParseError;
11971    fn from_str(s: &str) -> Result<Self, Self::Err> {
11972        use ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
11973        match s {
11974            "day" => Ok(Day),
11975            "month" => Ok(Month),
11976            "week" => Ok(Week),
11977            "year" => Ok(Year),
11978            _ => Err(stripe_types::StripeParseError),
11979        }
11980    }
11981}
11982impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
11983    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11984        f.write_str(self.as_str())
11985    }
11986}
11987
11988impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
11989    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11990        f.write_str(self.as_str())
11991    }
11992}
11993impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
11994    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11995    where
11996        S: serde::Serializer,
11997    {
11998        serializer.serialize_str(self.as_str())
11999    }
12000}
12001#[cfg(feature = "deserialize")]
12002impl<'de> serde::Deserialize<'de>
12003    for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
12004{
12005    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12006        use std::str::FromStr;
12007        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12008        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"))
12009    }
12010}
12011/// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options.
12012#[derive(Clone, Debug, serde::Serialize)]
12013pub struct ConfirmSetupIntentPaymentMethodOptionsSepaDebit {
12014    /// Additional fields for Mandate creation
12015    #[serde(skip_serializing_if = "Option::is_none")]
12016    pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsSepaDebitMandateOptions>,
12017}
12018impl ConfirmSetupIntentPaymentMethodOptionsSepaDebit {
12019    pub fn new() -> Self {
12020        Self { mandate_options: None }
12021    }
12022}
12023impl Default for ConfirmSetupIntentPaymentMethodOptionsSepaDebit {
12024    fn default() -> Self {
12025        Self::new()
12026    }
12027}
12028/// Additional fields for Mandate creation
12029#[derive(Clone, Debug, serde::Serialize)]
12030pub struct ConfirmSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
12031    /// Prefix used to generate the Mandate reference.
12032    /// Must be at most 12 characters long.
12033    /// Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'.
12034    /// Cannot begin with 'STRIPE'.
12035    #[serde(skip_serializing_if = "Option::is_none")]
12036    pub reference_prefix: Option<String>,
12037}
12038impl ConfirmSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
12039    pub fn new() -> Self {
12040        Self { reference_prefix: None }
12041    }
12042}
12043impl Default for ConfirmSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
12044    fn default() -> Self {
12045        Self::new()
12046    }
12047}
12048/// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options.
12049#[derive(Clone, Debug, serde::Serialize)]
12050pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccount {
12051    /// Additional fields for Financial Connections Session creation
12052    #[serde(skip_serializing_if = "Option::is_none")]
12053    pub financial_connections:
12054        Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
12055    /// Additional fields for Mandate creation
12056    #[serde(skip_serializing_if = "Option::is_none")]
12057    pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
12058    /// Additional fields for network related functions
12059    #[serde(skip_serializing_if = "Option::is_none")]
12060    pub networks: Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks>,
12061    /// Bank account verification method.
12062    #[serde(skip_serializing_if = "Option::is_none")]
12063    pub verification_method:
12064        Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
12065}
12066impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccount {
12067    pub fn new() -> Self {
12068        Self {
12069            financial_connections: None,
12070            mandate_options: None,
12071            networks: None,
12072            verification_method: None,
12073        }
12074    }
12075}
12076impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccount {
12077    fn default() -> Self {
12078        Self::new()
12079    }
12080}
12081/// Additional fields for Financial Connections Session creation
12082#[derive(Clone, Debug, serde::Serialize)]
12083pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
12084    /// Provide filters for the linked accounts that the customer can select for the payment method.
12085    #[serde(skip_serializing_if = "Option::is_none")]
12086    pub filters:
12087        Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
12088    /// The list of permissions to request.
12089    /// If this parameter is passed, the `payment_method` permission must be included.
12090    /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
12091    #[serde(skip_serializing_if = "Option::is_none")]
12092    pub permissions: Option<
12093        Vec<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
12094    >,
12095    /// List of data features that you would like to retrieve upon account creation.
12096    #[serde(skip_serializing_if = "Option::is_none")]
12097    pub prefetch: Option<
12098        Vec<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>,
12099    >,
12100    /// For webview integrations only.
12101    /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.
12102    #[serde(skip_serializing_if = "Option::is_none")]
12103    pub return_url: Option<String>,
12104}
12105impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
12106    pub fn new() -> Self {
12107        Self { filters: None, permissions: None, prefetch: None, return_url: None }
12108    }
12109}
12110impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
12111    fn default() -> Self {
12112        Self::new()
12113    }
12114}
12115/// Provide filters for the linked accounts that the customer can select for the payment method.
12116#[derive(Clone, Debug, serde::Serialize)]
12117pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
12118        /// The account subcategories to use to filter for selectable accounts.
12119    /// Valid subcategories are `checking` and `savings`.
12120#[serde(skip_serializing_if = "Option::is_none")]
12121pub account_subcategories: Option<Vec<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
12122
12123}
12124impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
12125    pub fn new() -> Self {
12126        Self { account_subcategories: None }
12127    }
12128}
12129impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
12130    fn default() -> Self {
12131        Self::new()
12132    }
12133}
12134/// The account subcategories to use to filter for selectable accounts.
12135/// Valid subcategories are `checking` and `savings`.
12136#[derive(Copy, Clone, Eq, PartialEq)]
12137pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
12138{
12139    Checking,
12140    Savings,
12141}
12142impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
12143    pub fn as_str(self) -> &'static str {
12144        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
12145        match self {
12146Checking => "checking",
12147Savings => "savings",
12148
12149        }
12150    }
12151}
12152
12153impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
12154    type Err = stripe_types::StripeParseError;
12155    fn from_str(s: &str) -> Result<Self, Self::Err> {
12156        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
12157        match s {
12158    "checking" => Ok(Checking),
12159"savings" => Ok(Savings),
12160_ => Err(stripe_types::StripeParseError)
12161
12162        }
12163    }
12164}
12165impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
12166    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12167        f.write_str(self.as_str())
12168    }
12169}
12170
12171impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
12172    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12173        f.write_str(self.as_str())
12174    }
12175}
12176impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
12177    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
12178        serializer.serialize_str(self.as_str())
12179    }
12180}
12181#[cfg(feature = "deserialize")]
12182impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
12183    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12184        use std::str::FromStr;
12185        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12186        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"))
12187    }
12188}
12189/// The list of permissions to request.
12190/// If this parameter is passed, the `payment_method` permission must be included.
12191/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
12192#[derive(Copy, Clone, Eq, PartialEq)]
12193pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
12194    Balances,
12195    Ownership,
12196    PaymentMethod,
12197    Transactions,
12198}
12199impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
12200    pub fn as_str(self) -> &'static str {
12201        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
12202        match self {
12203            Balances => "balances",
12204            Ownership => "ownership",
12205            PaymentMethod => "payment_method",
12206            Transactions => "transactions",
12207        }
12208    }
12209}
12210
12211impl std::str::FromStr
12212    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
12213{
12214    type Err = stripe_types::StripeParseError;
12215    fn from_str(s: &str) -> Result<Self, Self::Err> {
12216        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
12217        match s {
12218            "balances" => Ok(Balances),
12219            "ownership" => Ok(Ownership),
12220            "payment_method" => Ok(PaymentMethod),
12221            "transactions" => Ok(Transactions),
12222            _ => Err(stripe_types::StripeParseError),
12223        }
12224    }
12225}
12226impl std::fmt::Display
12227    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
12228{
12229    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12230        f.write_str(self.as_str())
12231    }
12232}
12233
12234impl std::fmt::Debug
12235    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
12236{
12237    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12238        f.write_str(self.as_str())
12239    }
12240}
12241impl serde::Serialize
12242    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
12243{
12244    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12245    where
12246        S: serde::Serializer,
12247    {
12248        serializer.serialize_str(self.as_str())
12249    }
12250}
12251#[cfg(feature = "deserialize")]
12252impl<'de> serde::Deserialize<'de>
12253    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
12254{
12255    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12256        use std::str::FromStr;
12257        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12258        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"))
12259    }
12260}
12261/// List of data features that you would like to retrieve upon account creation.
12262#[derive(Copy, Clone, Eq, PartialEq)]
12263pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
12264    Balances,
12265    Ownership,
12266    Transactions,
12267}
12268impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
12269    pub fn as_str(self) -> &'static str {
12270        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
12271        match self {
12272            Balances => "balances",
12273            Ownership => "ownership",
12274            Transactions => "transactions",
12275        }
12276    }
12277}
12278
12279impl std::str::FromStr
12280    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
12281{
12282    type Err = stripe_types::StripeParseError;
12283    fn from_str(s: &str) -> Result<Self, Self::Err> {
12284        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
12285        match s {
12286            "balances" => Ok(Balances),
12287            "ownership" => Ok(Ownership),
12288            "transactions" => Ok(Transactions),
12289            _ => Err(stripe_types::StripeParseError),
12290        }
12291    }
12292}
12293impl std::fmt::Display
12294    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
12295{
12296    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12297        f.write_str(self.as_str())
12298    }
12299}
12300
12301impl std::fmt::Debug
12302    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
12303{
12304    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12305        f.write_str(self.as_str())
12306    }
12307}
12308impl serde::Serialize
12309    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
12310{
12311    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12312    where
12313        S: serde::Serializer,
12314    {
12315        serializer.serialize_str(self.as_str())
12316    }
12317}
12318#[cfg(feature = "deserialize")]
12319impl<'de> serde::Deserialize<'de>
12320    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
12321{
12322    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12323        use std::str::FromStr;
12324        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12325        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"))
12326    }
12327}
12328/// Additional fields for Mandate creation
12329#[derive(Copy, Clone, Debug, serde::Serialize)]
12330pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
12331    /// The method used to collect offline mandate customer acceptance.
12332    #[serde(skip_serializing_if = "Option::is_none")]
12333    pub collection_method:
12334        Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
12335}
12336impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
12337    pub fn new() -> Self {
12338        Self { collection_method: None }
12339    }
12340}
12341impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
12342    fn default() -> Self {
12343        Self::new()
12344    }
12345}
12346/// The method used to collect offline mandate customer acceptance.
12347#[derive(Copy, Clone, Eq, PartialEq)]
12348pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
12349    Paper,
12350}
12351impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
12352    pub fn as_str(self) -> &'static str {
12353        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
12354        match self {
12355            Paper => "paper",
12356        }
12357    }
12358}
12359
12360impl std::str::FromStr
12361    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
12362{
12363    type Err = stripe_types::StripeParseError;
12364    fn from_str(s: &str) -> Result<Self, Self::Err> {
12365        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
12366        match s {
12367            "paper" => Ok(Paper),
12368            _ => Err(stripe_types::StripeParseError),
12369        }
12370    }
12371}
12372impl std::fmt::Display
12373    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
12374{
12375    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12376        f.write_str(self.as_str())
12377    }
12378}
12379
12380impl std::fmt::Debug
12381    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
12382{
12383    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12384        f.write_str(self.as_str())
12385    }
12386}
12387impl serde::Serialize
12388    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
12389{
12390    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12391    where
12392        S: serde::Serializer,
12393    {
12394        serializer.serialize_str(self.as_str())
12395    }
12396}
12397#[cfg(feature = "deserialize")]
12398impl<'de> serde::Deserialize<'de>
12399    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
12400{
12401    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12402        use std::str::FromStr;
12403        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12404        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"))
12405    }
12406}
12407/// Additional fields for network related functions
12408#[derive(Clone, Debug, serde::Serialize)]
12409pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
12410    /// Triggers validations to run across the selected networks
12411    #[serde(skip_serializing_if = "Option::is_none")]
12412    pub requested:
12413        Option<Vec<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
12414}
12415impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
12416    pub fn new() -> Self {
12417        Self { requested: None }
12418    }
12419}
12420impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
12421    fn default() -> Self {
12422        Self::new()
12423    }
12424}
12425/// Triggers validations to run across the selected networks
12426#[derive(Copy, Clone, Eq, PartialEq)]
12427pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
12428    Ach,
12429    UsDomesticWire,
12430}
12431impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
12432    pub fn as_str(self) -> &'static str {
12433        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
12434        match self {
12435            Ach => "ach",
12436            UsDomesticWire => "us_domestic_wire",
12437        }
12438    }
12439}
12440
12441impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
12442    type Err = stripe_types::StripeParseError;
12443    fn from_str(s: &str) -> Result<Self, Self::Err> {
12444        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
12445        match s {
12446            "ach" => Ok(Ach),
12447            "us_domestic_wire" => Ok(UsDomesticWire),
12448            _ => Err(stripe_types::StripeParseError),
12449        }
12450    }
12451}
12452impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
12453    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12454        f.write_str(self.as_str())
12455    }
12456}
12457
12458impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
12459    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12460        f.write_str(self.as_str())
12461    }
12462}
12463impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
12464    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12465    where
12466        S: serde::Serializer,
12467    {
12468        serializer.serialize_str(self.as_str())
12469    }
12470}
12471#[cfg(feature = "deserialize")]
12472impl<'de> serde::Deserialize<'de>
12473    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested
12474{
12475    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12476        use std::str::FromStr;
12477        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12478        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested"))
12479    }
12480}
12481/// Bank account verification method.
12482#[derive(Copy, Clone, Eq, PartialEq)]
12483pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
12484    Automatic,
12485    Instant,
12486    Microdeposits,
12487}
12488impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
12489    pub fn as_str(self) -> &'static str {
12490        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
12491        match self {
12492            Automatic => "automatic",
12493            Instant => "instant",
12494            Microdeposits => "microdeposits",
12495        }
12496    }
12497}
12498
12499impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
12500    type Err = stripe_types::StripeParseError;
12501    fn from_str(s: &str) -> Result<Self, Self::Err> {
12502        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
12503        match s {
12504            "automatic" => Ok(Automatic),
12505            "instant" => Ok(Instant),
12506            "microdeposits" => Ok(Microdeposits),
12507            _ => Err(stripe_types::StripeParseError),
12508        }
12509    }
12510}
12511impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
12512    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12513        f.write_str(self.as_str())
12514    }
12515}
12516
12517impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
12518    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12519        f.write_str(self.as_str())
12520    }
12521}
12522impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
12523    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12524    where
12525        S: serde::Serializer,
12526    {
12527        serializer.serialize_str(self.as_str())
12528    }
12529}
12530#[cfg(feature = "deserialize")]
12531impl<'de> serde::Deserialize<'de>
12532    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod
12533{
12534    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12535        use std::str::FromStr;
12536        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12537        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod"))
12538    }
12539}
12540/// Confirm that your customer intends to set up the current or
12541/// provided payment method. For example, you would confirm a SetupIntent
12542/// when a customer hits the “Save” button on a payment method management
12543/// page on your website.
12544///
12545/// If the selected payment method does not require any additional
12546/// steps from the customer, the SetupIntent will transition to the
12547/// `succeeded` status.
12548///
12549/// Otherwise, it will transition to the `requires_action` status and
12550/// suggest additional actions via `next_action`. If setup fails,
12551/// the SetupIntent will transition to the
12552/// `requires_payment_method` status or the `canceled` status if the
12553/// confirmation limit is reached.
12554#[derive(Clone, Debug, serde::Serialize)]
12555pub struct ConfirmSetupIntent {
12556    inner: ConfirmSetupIntentBuilder,
12557    intent: stripe_shared::SetupIntentId,
12558}
12559impl ConfirmSetupIntent {
12560    /// Construct a new `ConfirmSetupIntent`.
12561    pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
12562        Self { intent: intent.into(), inner: ConfirmSetupIntentBuilder::new() }
12563    }
12564    /// ID of the ConfirmationToken used to confirm this SetupIntent.
12565    ///
12566    /// 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.
12567    pub fn confirmation_token(mut self, confirmation_token: impl Into<String>) -> Self {
12568        self.inner.confirmation_token = Some(confirmation_token.into());
12569        self
12570    }
12571    /// Specifies which fields in the response should be expanded.
12572    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
12573        self.inner.expand = Some(expand.into());
12574        self
12575    }
12576    pub fn mandate_data(mut self, mandate_data: impl Into<ConfirmSetupIntentMandateData>) -> Self {
12577        self.inner.mandate_data = Some(mandate_data.into());
12578        self
12579    }
12580    /// ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent.
12581    pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
12582        self.inner.payment_method = Some(payment_method.into());
12583        self
12584    }
12585    /// When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method).
12586    /// value in the SetupIntent.
12587    pub fn payment_method_data(
12588        mut self,
12589        payment_method_data: impl Into<ConfirmSetupIntentPaymentMethodData>,
12590    ) -> Self {
12591        self.inner.payment_method_data = Some(payment_method_data.into());
12592        self
12593    }
12594    /// Payment method-specific configuration for this SetupIntent.
12595    pub fn payment_method_options(
12596        mut self,
12597        payment_method_options: impl Into<ConfirmSetupIntentPaymentMethodOptions>,
12598    ) -> Self {
12599        self.inner.payment_method_options = Some(payment_method_options.into());
12600        self
12601    }
12602    /// The URL to redirect your customer back to after they authenticate on the payment method's app or site.
12603    /// If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme.
12604    /// This parameter is only used for cards and other redirect-based payment methods.
12605    pub fn return_url(mut self, return_url: impl Into<String>) -> Self {
12606        self.inner.return_url = Some(return_url.into());
12607        self
12608    }
12609    /// Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions.
12610    pub fn use_stripe_sdk(mut self, use_stripe_sdk: impl Into<bool>) -> Self {
12611        self.inner.use_stripe_sdk = Some(use_stripe_sdk.into());
12612        self
12613    }
12614}
12615impl ConfirmSetupIntent {
12616    /// Send the request and return the deserialized response.
12617    pub async fn send<C: StripeClient>(
12618        &self,
12619        client: &C,
12620    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
12621        self.customize().send(client).await
12622    }
12623
12624    /// Send the request and return the deserialized response, blocking until completion.
12625    pub fn send_blocking<C: StripeBlockingClient>(
12626        &self,
12627        client: &C,
12628    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
12629        self.customize().send_blocking(client)
12630    }
12631}
12632
12633impl StripeRequest for ConfirmSetupIntent {
12634    type Output = stripe_shared::SetupIntent;
12635
12636    fn build(&self) -> RequestBuilder {
12637        let intent = &self.intent;
12638        RequestBuilder::new(StripeMethod::Post, format!("/setup_intents/{intent}/confirm"))
12639            .form(&self.inner)
12640    }
12641}
12642#[derive(Clone, Debug, serde::Serialize)]
12643struct VerifyMicrodepositsSetupIntentBuilder {
12644    #[serde(skip_serializing_if = "Option::is_none")]
12645    amounts: Option<Vec<i64>>,
12646    #[serde(skip_serializing_if = "Option::is_none")]
12647    descriptor_code: Option<String>,
12648    #[serde(skip_serializing_if = "Option::is_none")]
12649    expand: Option<Vec<String>>,
12650}
12651impl VerifyMicrodepositsSetupIntentBuilder {
12652    fn new() -> Self {
12653        Self { amounts: None, descriptor_code: None, expand: None }
12654    }
12655}
12656/// Verifies microdeposits on a SetupIntent object.
12657#[derive(Clone, Debug, serde::Serialize)]
12658pub struct VerifyMicrodepositsSetupIntent {
12659    inner: VerifyMicrodepositsSetupIntentBuilder,
12660    intent: stripe_shared::SetupIntentId,
12661}
12662impl VerifyMicrodepositsSetupIntent {
12663    /// Construct a new `VerifyMicrodepositsSetupIntent`.
12664    pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
12665        Self { intent: intent.into(), inner: VerifyMicrodepositsSetupIntentBuilder::new() }
12666    }
12667    /// Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account.
12668    pub fn amounts(mut self, amounts: impl Into<Vec<i64>>) -> Self {
12669        self.inner.amounts = Some(amounts.into());
12670        self
12671    }
12672    /// A six-character code starting with SM present in the microdeposit sent to the bank account.
12673    pub fn descriptor_code(mut self, descriptor_code: impl Into<String>) -> Self {
12674        self.inner.descriptor_code = Some(descriptor_code.into());
12675        self
12676    }
12677    /// Specifies which fields in the response should be expanded.
12678    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
12679        self.inner.expand = Some(expand.into());
12680        self
12681    }
12682}
12683impl VerifyMicrodepositsSetupIntent {
12684    /// Send the request and return the deserialized response.
12685    pub async fn send<C: StripeClient>(
12686        &self,
12687        client: &C,
12688    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
12689        self.customize().send(client).await
12690    }
12691
12692    /// Send the request and return the deserialized response, blocking until completion.
12693    pub fn send_blocking<C: StripeBlockingClient>(
12694        &self,
12695        client: &C,
12696    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
12697        self.customize().send_blocking(client)
12698    }
12699}
12700
12701impl StripeRequest for VerifyMicrodepositsSetupIntent {
12702    type Output = stripe_shared::SetupIntent;
12703
12704    fn build(&self) -> RequestBuilder {
12705        let intent = &self.intent;
12706        RequestBuilder::new(
12707            StripeMethod::Post,
12708            format!("/setup_intents/{intent}/verify_microdeposits"),
12709        )
12710        .form(&self.inner)
12711    }
12712}
12713
12714#[derive(Clone, Debug, serde::Serialize)]
12715pub struct OnlineParam {
12716    /// The IP address from which the Mandate was accepted by the customer.
12717    pub ip_address: String,
12718    /// The user agent of the browser from which the Mandate was accepted by the customer.
12719    pub user_agent: String,
12720}
12721impl OnlineParam {
12722    pub fn new(ip_address: impl Into<String>, user_agent: impl Into<String>) -> Self {
12723        Self { ip_address: ip_address.into(), user_agent: user_agent.into() }
12724    }
12725}
12726#[derive(Clone, Debug, serde::Serialize)]
12727pub struct PaymentMethodParam {
12728    /// Customer's bank account number.
12729    pub account_number: String,
12730    /// Institution number of the customer's bank.
12731    pub institution_number: String,
12732    /// Transit number of the customer's bank.
12733    pub transit_number: String,
12734}
12735impl PaymentMethodParam {
12736    pub fn new(
12737        account_number: impl Into<String>,
12738        institution_number: impl Into<String>,
12739        transit_number: impl Into<String>,
12740    ) -> Self {
12741        Self {
12742            account_number: account_number.into(),
12743            institution_number: institution_number.into(),
12744            transit_number: transit_number.into(),
12745        }
12746    }
12747}
12748#[derive(Clone, Debug, serde::Serialize)]
12749pub struct BillingDetailsAddress {
12750    /// City, district, suburb, town, or village.
12751    #[serde(skip_serializing_if = "Option::is_none")]
12752    pub city: Option<String>,
12753    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
12754    #[serde(skip_serializing_if = "Option::is_none")]
12755    pub country: Option<String>,
12756    /// Address line 1, such as the street, PO Box, or company name.
12757    #[serde(skip_serializing_if = "Option::is_none")]
12758    pub line1: Option<String>,
12759    /// Address line 2, such as the apartment, suite, unit, or building.
12760    #[serde(skip_serializing_if = "Option::is_none")]
12761    pub line2: Option<String>,
12762    /// ZIP or postal code.
12763    #[serde(skip_serializing_if = "Option::is_none")]
12764    pub postal_code: Option<String>,
12765    /// State, county, province, or region.
12766    #[serde(skip_serializing_if = "Option::is_none")]
12767    pub state: Option<String>,
12768}
12769impl BillingDetailsAddress {
12770    pub fn new() -> Self {
12771        Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
12772    }
12773}
12774impl Default for BillingDetailsAddress {
12775    fn default() -> Self {
12776        Self::new()
12777    }
12778}
12779#[derive(Copy, Clone, Debug, serde::Serialize)]
12780pub struct DateOfBirth {
12781    /// The day of birth, between 1 and 31.
12782    pub day: i64,
12783    /// The month of birth, between 1 and 12.
12784    pub month: i64,
12785    /// The four-digit year of birth.
12786    pub year: i64,
12787}
12788impl DateOfBirth {
12789    pub fn new(day: impl Into<i64>, month: impl Into<i64>, year: impl Into<i64>) -> Self {
12790        Self { day: day.into(), month: month.into(), year: year.into() }
12791    }
12792}
12793#[derive(Clone, Debug, serde::Serialize)]
12794pub struct RadarOptionsWithHiddenOptions {
12795    /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments.
12796    #[serde(skip_serializing_if = "Option::is_none")]
12797    pub session: Option<String>,
12798}
12799impl RadarOptionsWithHiddenOptions {
12800    pub fn new() -> Self {
12801        Self { session: None }
12802    }
12803}
12804impl Default for RadarOptionsWithHiddenOptions {
12805    fn default() -> Self {
12806        Self::new()
12807    }
12808}
12809#[derive(Clone, Debug, serde::Serialize)]
12810pub struct PaymentMethodOptionsMandateOptionsParam {
12811    /// Prefix used to generate the Mandate reference.
12812    /// Must be at most 12 characters long.
12813    /// Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'.
12814    /// Cannot begin with 'DDIC' or 'STRIPE'.
12815    #[serde(skip_serializing_if = "Option::is_none")]
12816    pub reference_prefix: Option<String>,
12817}
12818impl PaymentMethodOptionsMandateOptionsParam {
12819    pub fn new() -> Self {
12820        Self { reference_prefix: None }
12821    }
12822}
12823impl Default for PaymentMethodOptionsMandateOptionsParam {
12824    fn default() -> Self {
12825        Self::new()
12826    }
12827}
12828#[derive(Clone, Debug, serde::Serialize)]
12829pub struct SubscriptionNextBillingParam {
12830    /// The amount of the next charge for the subscription.
12831    pub amount: i64,
12832    /// The date of the next charge for the subscription in YYYY-MM-DD format.
12833    pub date: String,
12834}
12835impl SubscriptionNextBillingParam {
12836    pub fn new(amount: impl Into<i64>, date: impl Into<String>) -> Self {
12837        Self { amount: amount.into(), date: date.into() }
12838    }
12839}
12840#[derive(Clone, Debug, serde::Serialize)]
12841pub struct SetupIntentPaymentMethodOptionsParam {
12842    /// \[Deprecated\] This is a legacy parameter that no longer has any function.
12843    #[serde(skip_serializing_if = "Option::is_none")]
12844    pub persistent_token: Option<String>,
12845}
12846impl SetupIntentPaymentMethodOptionsParam {
12847    pub fn new() -> Self {
12848        Self { persistent_token: None }
12849    }
12850}
12851impl Default for SetupIntentPaymentMethodOptionsParam {
12852    fn default() -> Self {
12853        Self::new()
12854    }
12855}
12856#[derive(Clone, Debug, serde::Serialize)]
12857pub struct PaymentMethodOptionsParam {
12858    /// The PayPal Billing Agreement ID (BAID).
12859    /// This is an ID generated by PayPal which represents the mandate between the merchant and the customer.
12860    #[serde(skip_serializing_if = "Option::is_none")]
12861    pub billing_agreement_id: Option<String>,
12862}
12863impl PaymentMethodOptionsParam {
12864    pub fn new() -> Self {
12865        Self { billing_agreement_id: None }
12866    }
12867}
12868impl Default for PaymentMethodOptionsParam {
12869    fn default() -> Self {
12870        Self::new()
12871    }
12872}
12873#[derive(Clone, Debug, serde::Serialize)]
12874pub struct BillingDetailsInnerParams {
12875    /// Billing address.
12876    #[serde(skip_serializing_if = "Option::is_none")]
12877    pub address: Option<BillingDetailsAddress>,
12878    /// Email address.
12879    #[serde(skip_serializing_if = "Option::is_none")]
12880    pub email: Option<String>,
12881    /// Full name.
12882    #[serde(skip_serializing_if = "Option::is_none")]
12883    pub name: Option<String>,
12884    /// Billing phone number (including extension).
12885    #[serde(skip_serializing_if = "Option::is_none")]
12886    pub phone: Option<String>,
12887    /// Taxpayer identification number.
12888    /// Used only for transactions between LATAM buyers and non-LATAM sellers.
12889    #[serde(skip_serializing_if = "Option::is_none")]
12890    pub tax_id: Option<String>,
12891}
12892impl BillingDetailsInnerParams {
12893    pub fn new() -> Self {
12894        Self { address: None, email: None, name: None, phone: None, tax_id: None }
12895    }
12896}
12897impl Default for BillingDetailsInnerParams {
12898    fn default() -> Self {
12899        Self::new()
12900    }
12901}