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    Handelsbanken,
1199    Ing,
1200    Knab,
1201    Moneyou,
1202    N26,
1203    Nn,
1204    Rabobank,
1205    Regiobank,
1206    Revolut,
1207    SnsBank,
1208    TriodosBank,
1209    VanLanschot,
1210    Yoursafe,
1211    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1212    Unknown(String),
1213}
1214impl CreateSetupIntentPaymentMethodDataIdealBank {
1215    pub fn as_str(&self) -> &str {
1216        use CreateSetupIntentPaymentMethodDataIdealBank::*;
1217        match self {
1218            AbnAmro => "abn_amro",
1219            AsnBank => "asn_bank",
1220            Bunq => "bunq",
1221            Buut => "buut",
1222            Handelsbanken => "handelsbanken",
1223            Ing => "ing",
1224            Knab => "knab",
1225            Moneyou => "moneyou",
1226            N26 => "n26",
1227            Nn => "nn",
1228            Rabobank => "rabobank",
1229            Regiobank => "regiobank",
1230            Revolut => "revolut",
1231            SnsBank => "sns_bank",
1232            TriodosBank => "triodos_bank",
1233            VanLanschot => "van_lanschot",
1234            Yoursafe => "yoursafe",
1235            Unknown(v) => v,
1236        }
1237    }
1238}
1239
1240impl std::str::FromStr for CreateSetupIntentPaymentMethodDataIdealBank {
1241    type Err = std::convert::Infallible;
1242    fn from_str(s: &str) -> Result<Self, Self::Err> {
1243        use CreateSetupIntentPaymentMethodDataIdealBank::*;
1244        match s {
1245            "abn_amro" => Ok(AbnAmro),
1246            "asn_bank" => Ok(AsnBank),
1247            "bunq" => Ok(Bunq),
1248            "buut" => Ok(Buut),
1249            "handelsbanken" => Ok(Handelsbanken),
1250            "ing" => Ok(Ing),
1251            "knab" => Ok(Knab),
1252            "moneyou" => Ok(Moneyou),
1253            "n26" => Ok(N26),
1254            "nn" => Ok(Nn),
1255            "rabobank" => Ok(Rabobank),
1256            "regiobank" => Ok(Regiobank),
1257            "revolut" => Ok(Revolut),
1258            "sns_bank" => Ok(SnsBank),
1259            "triodos_bank" => Ok(TriodosBank),
1260            "van_lanschot" => Ok(VanLanschot),
1261            "yoursafe" => Ok(Yoursafe),
1262            v => Ok(Unknown(v.to_owned())),
1263        }
1264    }
1265}
1266impl std::fmt::Display for CreateSetupIntentPaymentMethodDataIdealBank {
1267    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1268        f.write_str(self.as_str())
1269    }
1270}
1271
1272impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataIdealBank {
1273    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1274        f.write_str(self.as_str())
1275    }
1276}
1277impl serde::Serialize for CreateSetupIntentPaymentMethodDataIdealBank {
1278    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1279    where
1280        S: serde::Serializer,
1281    {
1282        serializer.serialize_str(self.as_str())
1283    }
1284}
1285#[cfg(feature = "deserialize")]
1286impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataIdealBank {
1287    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1288        use std::str::FromStr;
1289        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1290        Ok(Self::from_str(&s).unwrap())
1291    }
1292}
1293/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
1294#[derive(Copy, Clone, Debug, serde::Serialize)]
1295pub struct CreateSetupIntentPaymentMethodDataKlarna {
1296    /// Customer's date of birth
1297    #[serde(skip_serializing_if = "Option::is_none")]
1298    pub dob: Option<DateOfBirth>,
1299}
1300impl CreateSetupIntentPaymentMethodDataKlarna {
1301    pub fn new() -> Self {
1302        Self { dob: None }
1303    }
1304}
1305impl Default for CreateSetupIntentPaymentMethodDataKlarna {
1306    fn default() -> Self {
1307        Self::new()
1308    }
1309}
1310/// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
1311#[derive(Copy, Clone, Debug, serde::Serialize)]
1312pub struct CreateSetupIntentPaymentMethodDataNaverPay {
1313    /// Whether to use Naver Pay points or a card to fund this transaction.
1314    /// If not provided, this defaults to `card`.
1315    #[serde(skip_serializing_if = "Option::is_none")]
1316    pub funding: Option<CreateSetupIntentPaymentMethodDataNaverPayFunding>,
1317}
1318impl CreateSetupIntentPaymentMethodDataNaverPay {
1319    pub fn new() -> Self {
1320        Self { funding: None }
1321    }
1322}
1323impl Default for CreateSetupIntentPaymentMethodDataNaverPay {
1324    fn default() -> Self {
1325        Self::new()
1326    }
1327}
1328/// Whether to use Naver Pay points or a card to fund this transaction.
1329/// If not provided, this defaults to `card`.
1330#[derive(Copy, Clone, Eq, PartialEq)]
1331pub enum CreateSetupIntentPaymentMethodDataNaverPayFunding {
1332    Card,
1333    Points,
1334}
1335impl CreateSetupIntentPaymentMethodDataNaverPayFunding {
1336    pub fn as_str(self) -> &'static str {
1337        use CreateSetupIntentPaymentMethodDataNaverPayFunding::*;
1338        match self {
1339            Card => "card",
1340            Points => "points",
1341        }
1342    }
1343}
1344
1345impl std::str::FromStr for CreateSetupIntentPaymentMethodDataNaverPayFunding {
1346    type Err = stripe_types::StripeParseError;
1347    fn from_str(s: &str) -> Result<Self, Self::Err> {
1348        use CreateSetupIntentPaymentMethodDataNaverPayFunding::*;
1349        match s {
1350            "card" => Ok(Card),
1351            "points" => Ok(Points),
1352            _ => Err(stripe_types::StripeParseError),
1353        }
1354    }
1355}
1356impl std::fmt::Display for CreateSetupIntentPaymentMethodDataNaverPayFunding {
1357    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1358        f.write_str(self.as_str())
1359    }
1360}
1361
1362impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataNaverPayFunding {
1363    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1364        f.write_str(self.as_str())
1365    }
1366}
1367impl serde::Serialize for CreateSetupIntentPaymentMethodDataNaverPayFunding {
1368    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1369    where
1370        S: serde::Serializer,
1371    {
1372        serializer.serialize_str(self.as_str())
1373    }
1374}
1375#[cfg(feature = "deserialize")]
1376impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataNaverPayFunding {
1377    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1378        use std::str::FromStr;
1379        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1380        Self::from_str(&s).map_err(|_| {
1381            serde::de::Error::custom(
1382                "Unknown value for CreateSetupIntentPaymentMethodDataNaverPayFunding",
1383            )
1384        })
1385    }
1386}
1387/// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
1388#[derive(Clone, Debug, serde::Serialize)]
1389pub struct CreateSetupIntentPaymentMethodDataNzBankAccount {
1390    /// The name on the bank account.
1391    /// Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod’s billing details.
1392    #[serde(skip_serializing_if = "Option::is_none")]
1393    pub account_holder_name: Option<String>,
1394    /// The account number for the bank account.
1395    pub account_number: String,
1396    /// The numeric code for the bank account's bank.
1397    pub bank_code: String,
1398    /// The numeric code for the bank account's bank branch.
1399    pub branch_code: String,
1400    #[serde(skip_serializing_if = "Option::is_none")]
1401    pub reference: Option<String>,
1402    /// The suffix of the bank account number.
1403    pub suffix: String,
1404}
1405impl CreateSetupIntentPaymentMethodDataNzBankAccount {
1406    pub fn new(
1407        account_number: impl Into<String>,
1408        bank_code: impl Into<String>,
1409        branch_code: impl Into<String>,
1410        suffix: impl Into<String>,
1411    ) -> Self {
1412        Self {
1413            account_holder_name: None,
1414            account_number: account_number.into(),
1415            bank_code: bank_code.into(),
1416            branch_code: branch_code.into(),
1417            reference: None,
1418            suffix: suffix.into(),
1419        }
1420    }
1421}
1422/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
1423#[derive(Clone, Debug, serde::Serialize)]
1424pub struct CreateSetupIntentPaymentMethodDataP24 {
1425    /// The customer's bank.
1426    #[serde(skip_serializing_if = "Option::is_none")]
1427    pub bank: Option<CreateSetupIntentPaymentMethodDataP24Bank>,
1428}
1429impl CreateSetupIntentPaymentMethodDataP24 {
1430    pub fn new() -> Self {
1431        Self { bank: None }
1432    }
1433}
1434impl Default for CreateSetupIntentPaymentMethodDataP24 {
1435    fn default() -> Self {
1436        Self::new()
1437    }
1438}
1439/// The customer's bank.
1440#[derive(Clone, Eq, PartialEq)]
1441#[non_exhaustive]
1442pub enum CreateSetupIntentPaymentMethodDataP24Bank {
1443    AliorBank,
1444    BankMillennium,
1445    BankNowyBfgSa,
1446    BankPekaoSa,
1447    BankiSpbdzielcze,
1448    Blik,
1449    BnpParibas,
1450    Boz,
1451    CitiHandlowy,
1452    CreditAgricole,
1453    Envelobank,
1454    EtransferPocztowy24,
1455    GetinBank,
1456    Ideabank,
1457    Ing,
1458    Inteligo,
1459    MbankMtransfer,
1460    NestPrzelew,
1461    NoblePay,
1462    PbacZIpko,
1463    PlusBank,
1464    SantanderPrzelew24,
1465    TmobileUsbugiBankowe,
1466    ToyotaBank,
1467    Velobank,
1468    VolkswagenBank,
1469    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1470    Unknown(String),
1471}
1472impl CreateSetupIntentPaymentMethodDataP24Bank {
1473    pub fn as_str(&self) -> &str {
1474        use CreateSetupIntentPaymentMethodDataP24Bank::*;
1475        match self {
1476            AliorBank => "alior_bank",
1477            BankMillennium => "bank_millennium",
1478            BankNowyBfgSa => "bank_nowy_bfg_sa",
1479            BankPekaoSa => "bank_pekao_sa",
1480            BankiSpbdzielcze => "banki_spbdzielcze",
1481            Blik => "blik",
1482            BnpParibas => "bnp_paribas",
1483            Boz => "boz",
1484            CitiHandlowy => "citi_handlowy",
1485            CreditAgricole => "credit_agricole",
1486            Envelobank => "envelobank",
1487            EtransferPocztowy24 => "etransfer_pocztowy24",
1488            GetinBank => "getin_bank",
1489            Ideabank => "ideabank",
1490            Ing => "ing",
1491            Inteligo => "inteligo",
1492            MbankMtransfer => "mbank_mtransfer",
1493            NestPrzelew => "nest_przelew",
1494            NoblePay => "noble_pay",
1495            PbacZIpko => "pbac_z_ipko",
1496            PlusBank => "plus_bank",
1497            SantanderPrzelew24 => "santander_przelew24",
1498            TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
1499            ToyotaBank => "toyota_bank",
1500            Velobank => "velobank",
1501            VolkswagenBank => "volkswagen_bank",
1502            Unknown(v) => v,
1503        }
1504    }
1505}
1506
1507impl std::str::FromStr for CreateSetupIntentPaymentMethodDataP24Bank {
1508    type Err = std::convert::Infallible;
1509    fn from_str(s: &str) -> Result<Self, Self::Err> {
1510        use CreateSetupIntentPaymentMethodDataP24Bank::*;
1511        match s {
1512            "alior_bank" => Ok(AliorBank),
1513            "bank_millennium" => Ok(BankMillennium),
1514            "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa),
1515            "bank_pekao_sa" => Ok(BankPekaoSa),
1516            "banki_spbdzielcze" => Ok(BankiSpbdzielcze),
1517            "blik" => Ok(Blik),
1518            "bnp_paribas" => Ok(BnpParibas),
1519            "boz" => Ok(Boz),
1520            "citi_handlowy" => Ok(CitiHandlowy),
1521            "credit_agricole" => Ok(CreditAgricole),
1522            "envelobank" => Ok(Envelobank),
1523            "etransfer_pocztowy24" => Ok(EtransferPocztowy24),
1524            "getin_bank" => Ok(GetinBank),
1525            "ideabank" => Ok(Ideabank),
1526            "ing" => Ok(Ing),
1527            "inteligo" => Ok(Inteligo),
1528            "mbank_mtransfer" => Ok(MbankMtransfer),
1529            "nest_przelew" => Ok(NestPrzelew),
1530            "noble_pay" => Ok(NoblePay),
1531            "pbac_z_ipko" => Ok(PbacZIpko),
1532            "plus_bank" => Ok(PlusBank),
1533            "santander_przelew24" => Ok(SantanderPrzelew24),
1534            "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe),
1535            "toyota_bank" => Ok(ToyotaBank),
1536            "velobank" => Ok(Velobank),
1537            "volkswagen_bank" => Ok(VolkswagenBank),
1538            v => Ok(Unknown(v.to_owned())),
1539        }
1540    }
1541}
1542impl std::fmt::Display for CreateSetupIntentPaymentMethodDataP24Bank {
1543    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1544        f.write_str(self.as_str())
1545    }
1546}
1547
1548impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataP24Bank {
1549    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1550        f.write_str(self.as_str())
1551    }
1552}
1553impl serde::Serialize for CreateSetupIntentPaymentMethodDataP24Bank {
1554    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1555    where
1556        S: serde::Serializer,
1557    {
1558        serializer.serialize_str(self.as_str())
1559    }
1560}
1561#[cfg(feature = "deserialize")]
1562impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataP24Bank {
1563    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1564        use std::str::FromStr;
1565        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1566        Ok(Self::from_str(&s).unwrap())
1567    }
1568}
1569/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
1570#[derive(Clone, Debug, serde::Serialize)]
1571pub struct CreateSetupIntentPaymentMethodDataSepaDebit {
1572    /// IBAN of the bank account.
1573    pub iban: String,
1574}
1575impl CreateSetupIntentPaymentMethodDataSepaDebit {
1576    pub fn new(iban: impl Into<String>) -> Self {
1577        Self { iban: iban.into() }
1578    }
1579}
1580/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
1581#[derive(Copy, Clone, Debug, serde::Serialize)]
1582pub struct CreateSetupIntentPaymentMethodDataSofort {
1583    /// Two-letter ISO code representing the country the bank account is located in.
1584    pub country: CreateSetupIntentPaymentMethodDataSofortCountry,
1585}
1586impl CreateSetupIntentPaymentMethodDataSofort {
1587    pub fn new(country: impl Into<CreateSetupIntentPaymentMethodDataSofortCountry>) -> Self {
1588        Self { country: country.into() }
1589    }
1590}
1591/// Two-letter ISO code representing the country the bank account is located in.
1592#[derive(Copy, Clone, Eq, PartialEq)]
1593pub enum CreateSetupIntentPaymentMethodDataSofortCountry {
1594    At,
1595    Be,
1596    De,
1597    Es,
1598    It,
1599    Nl,
1600}
1601impl CreateSetupIntentPaymentMethodDataSofortCountry {
1602    pub fn as_str(self) -> &'static str {
1603        use CreateSetupIntentPaymentMethodDataSofortCountry::*;
1604        match self {
1605            At => "AT",
1606            Be => "BE",
1607            De => "DE",
1608            Es => "ES",
1609            It => "IT",
1610            Nl => "NL",
1611        }
1612    }
1613}
1614
1615impl std::str::FromStr for CreateSetupIntentPaymentMethodDataSofortCountry {
1616    type Err = stripe_types::StripeParseError;
1617    fn from_str(s: &str) -> Result<Self, Self::Err> {
1618        use CreateSetupIntentPaymentMethodDataSofortCountry::*;
1619        match s {
1620            "AT" => Ok(At),
1621            "BE" => Ok(Be),
1622            "DE" => Ok(De),
1623            "ES" => Ok(Es),
1624            "IT" => Ok(It),
1625            "NL" => Ok(Nl),
1626            _ => Err(stripe_types::StripeParseError),
1627        }
1628    }
1629}
1630impl std::fmt::Display for CreateSetupIntentPaymentMethodDataSofortCountry {
1631    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1632        f.write_str(self.as_str())
1633    }
1634}
1635
1636impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataSofortCountry {
1637    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1638        f.write_str(self.as_str())
1639    }
1640}
1641impl serde::Serialize for CreateSetupIntentPaymentMethodDataSofortCountry {
1642    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1643    where
1644        S: serde::Serializer,
1645    {
1646        serializer.serialize_str(self.as_str())
1647    }
1648}
1649#[cfg(feature = "deserialize")]
1650impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataSofortCountry {
1651    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1652        use std::str::FromStr;
1653        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1654        Self::from_str(&s).map_err(|_| {
1655            serde::de::Error::custom(
1656                "Unknown value for CreateSetupIntentPaymentMethodDataSofortCountry",
1657            )
1658        })
1659    }
1660}
1661/// The type of the PaymentMethod.
1662/// An additional hash is included on the PaymentMethod with a name matching this value.
1663/// It contains additional information specific to the PaymentMethod type.
1664#[derive(Clone, Eq, PartialEq)]
1665#[non_exhaustive]
1666pub enum CreateSetupIntentPaymentMethodDataType {
1667    AcssDebit,
1668    Affirm,
1669    AfterpayClearpay,
1670    Alipay,
1671    Alma,
1672    AmazonPay,
1673    AuBecsDebit,
1674    BacsDebit,
1675    Bancontact,
1676    Billie,
1677    Blik,
1678    Boleto,
1679    Cashapp,
1680    Crypto,
1681    CustomerBalance,
1682    Eps,
1683    Fpx,
1684    Giropay,
1685    Grabpay,
1686    Ideal,
1687    KakaoPay,
1688    Klarna,
1689    Konbini,
1690    KrCard,
1691    Link,
1692    MbWay,
1693    Mobilepay,
1694    Multibanco,
1695    NaverPay,
1696    NzBankAccount,
1697    Oxxo,
1698    P24,
1699    PayByBank,
1700    Payco,
1701    Paynow,
1702    Paypal,
1703    Pix,
1704    Promptpay,
1705    RevolutPay,
1706    SamsungPay,
1707    Satispay,
1708    SepaDebit,
1709    Sofort,
1710    Swish,
1711    Twint,
1712    UsBankAccount,
1713    WechatPay,
1714    Zip,
1715    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1716    Unknown(String),
1717}
1718impl CreateSetupIntentPaymentMethodDataType {
1719    pub fn as_str(&self) -> &str {
1720        use CreateSetupIntentPaymentMethodDataType::*;
1721        match self {
1722            AcssDebit => "acss_debit",
1723            Affirm => "affirm",
1724            AfterpayClearpay => "afterpay_clearpay",
1725            Alipay => "alipay",
1726            Alma => "alma",
1727            AmazonPay => "amazon_pay",
1728            AuBecsDebit => "au_becs_debit",
1729            BacsDebit => "bacs_debit",
1730            Bancontact => "bancontact",
1731            Billie => "billie",
1732            Blik => "blik",
1733            Boleto => "boleto",
1734            Cashapp => "cashapp",
1735            Crypto => "crypto",
1736            CustomerBalance => "customer_balance",
1737            Eps => "eps",
1738            Fpx => "fpx",
1739            Giropay => "giropay",
1740            Grabpay => "grabpay",
1741            Ideal => "ideal",
1742            KakaoPay => "kakao_pay",
1743            Klarna => "klarna",
1744            Konbini => "konbini",
1745            KrCard => "kr_card",
1746            Link => "link",
1747            MbWay => "mb_way",
1748            Mobilepay => "mobilepay",
1749            Multibanco => "multibanco",
1750            NaverPay => "naver_pay",
1751            NzBankAccount => "nz_bank_account",
1752            Oxxo => "oxxo",
1753            P24 => "p24",
1754            PayByBank => "pay_by_bank",
1755            Payco => "payco",
1756            Paynow => "paynow",
1757            Paypal => "paypal",
1758            Pix => "pix",
1759            Promptpay => "promptpay",
1760            RevolutPay => "revolut_pay",
1761            SamsungPay => "samsung_pay",
1762            Satispay => "satispay",
1763            SepaDebit => "sepa_debit",
1764            Sofort => "sofort",
1765            Swish => "swish",
1766            Twint => "twint",
1767            UsBankAccount => "us_bank_account",
1768            WechatPay => "wechat_pay",
1769            Zip => "zip",
1770            Unknown(v) => v,
1771        }
1772    }
1773}
1774
1775impl std::str::FromStr for CreateSetupIntentPaymentMethodDataType {
1776    type Err = std::convert::Infallible;
1777    fn from_str(s: &str) -> Result<Self, Self::Err> {
1778        use CreateSetupIntentPaymentMethodDataType::*;
1779        match s {
1780            "acss_debit" => Ok(AcssDebit),
1781            "affirm" => Ok(Affirm),
1782            "afterpay_clearpay" => Ok(AfterpayClearpay),
1783            "alipay" => Ok(Alipay),
1784            "alma" => Ok(Alma),
1785            "amazon_pay" => Ok(AmazonPay),
1786            "au_becs_debit" => Ok(AuBecsDebit),
1787            "bacs_debit" => Ok(BacsDebit),
1788            "bancontact" => Ok(Bancontact),
1789            "billie" => Ok(Billie),
1790            "blik" => Ok(Blik),
1791            "boleto" => Ok(Boleto),
1792            "cashapp" => Ok(Cashapp),
1793            "crypto" => Ok(Crypto),
1794            "customer_balance" => Ok(CustomerBalance),
1795            "eps" => Ok(Eps),
1796            "fpx" => Ok(Fpx),
1797            "giropay" => Ok(Giropay),
1798            "grabpay" => Ok(Grabpay),
1799            "ideal" => Ok(Ideal),
1800            "kakao_pay" => Ok(KakaoPay),
1801            "klarna" => Ok(Klarna),
1802            "konbini" => Ok(Konbini),
1803            "kr_card" => Ok(KrCard),
1804            "link" => Ok(Link),
1805            "mb_way" => Ok(MbWay),
1806            "mobilepay" => Ok(Mobilepay),
1807            "multibanco" => Ok(Multibanco),
1808            "naver_pay" => Ok(NaverPay),
1809            "nz_bank_account" => Ok(NzBankAccount),
1810            "oxxo" => Ok(Oxxo),
1811            "p24" => Ok(P24),
1812            "pay_by_bank" => Ok(PayByBank),
1813            "payco" => Ok(Payco),
1814            "paynow" => Ok(Paynow),
1815            "paypal" => Ok(Paypal),
1816            "pix" => Ok(Pix),
1817            "promptpay" => Ok(Promptpay),
1818            "revolut_pay" => Ok(RevolutPay),
1819            "samsung_pay" => Ok(SamsungPay),
1820            "satispay" => Ok(Satispay),
1821            "sepa_debit" => Ok(SepaDebit),
1822            "sofort" => Ok(Sofort),
1823            "swish" => Ok(Swish),
1824            "twint" => Ok(Twint),
1825            "us_bank_account" => Ok(UsBankAccount),
1826            "wechat_pay" => Ok(WechatPay),
1827            "zip" => Ok(Zip),
1828            v => Ok(Unknown(v.to_owned())),
1829        }
1830    }
1831}
1832impl std::fmt::Display for CreateSetupIntentPaymentMethodDataType {
1833    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1834        f.write_str(self.as_str())
1835    }
1836}
1837
1838impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataType {
1839    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1840        f.write_str(self.as_str())
1841    }
1842}
1843impl serde::Serialize for CreateSetupIntentPaymentMethodDataType {
1844    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1845    where
1846        S: serde::Serializer,
1847    {
1848        serializer.serialize_str(self.as_str())
1849    }
1850}
1851#[cfg(feature = "deserialize")]
1852impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataType {
1853    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1854        use std::str::FromStr;
1855        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1856        Ok(Self::from_str(&s).unwrap())
1857    }
1858}
1859/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
1860#[derive(Clone, Debug, serde::Serialize)]
1861pub struct CreateSetupIntentPaymentMethodDataUsBankAccount {
1862    /// Account holder type: individual or company.
1863    #[serde(skip_serializing_if = "Option::is_none")]
1864    pub account_holder_type:
1865        Option<CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType>,
1866    /// Account number of the bank account.
1867    #[serde(skip_serializing_if = "Option::is_none")]
1868    pub account_number: Option<String>,
1869    /// Account type: checkings or savings. Defaults to checking if omitted.
1870    #[serde(skip_serializing_if = "Option::is_none")]
1871    pub account_type: Option<CreateSetupIntentPaymentMethodDataUsBankAccountAccountType>,
1872    /// The ID of a Financial Connections Account to use as a payment method.
1873    #[serde(skip_serializing_if = "Option::is_none")]
1874    pub financial_connections_account: Option<String>,
1875    /// Routing number of the bank account.
1876    #[serde(skip_serializing_if = "Option::is_none")]
1877    pub routing_number: Option<String>,
1878}
1879impl CreateSetupIntentPaymentMethodDataUsBankAccount {
1880    pub fn new() -> Self {
1881        Self {
1882            account_holder_type: None,
1883            account_number: None,
1884            account_type: None,
1885            financial_connections_account: None,
1886            routing_number: None,
1887        }
1888    }
1889}
1890impl Default for CreateSetupIntentPaymentMethodDataUsBankAccount {
1891    fn default() -> Self {
1892        Self::new()
1893    }
1894}
1895/// Account holder type: individual or company.
1896#[derive(Copy, Clone, Eq, PartialEq)]
1897pub enum CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
1898    Company,
1899    Individual,
1900}
1901impl CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
1902    pub fn as_str(self) -> &'static str {
1903        use CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
1904        match self {
1905            Company => "company",
1906            Individual => "individual",
1907        }
1908    }
1909}
1910
1911impl std::str::FromStr for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
1912    type Err = stripe_types::StripeParseError;
1913    fn from_str(s: &str) -> Result<Self, Self::Err> {
1914        use CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
1915        match s {
1916            "company" => Ok(Company),
1917            "individual" => Ok(Individual),
1918            _ => Err(stripe_types::StripeParseError),
1919        }
1920    }
1921}
1922impl std::fmt::Display for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
1923    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1924        f.write_str(self.as_str())
1925    }
1926}
1927
1928impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
1929    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1930        f.write_str(self.as_str())
1931    }
1932}
1933impl serde::Serialize for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
1934    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1935    where
1936        S: serde::Serializer,
1937    {
1938        serializer.serialize_str(self.as_str())
1939    }
1940}
1941#[cfg(feature = "deserialize")]
1942impl<'de> serde::Deserialize<'de>
1943    for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType
1944{
1945    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1946        use std::str::FromStr;
1947        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1948        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType"))
1949    }
1950}
1951/// Account type: checkings or savings. Defaults to checking if omitted.
1952#[derive(Copy, Clone, Eq, PartialEq)]
1953pub enum CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
1954    Checking,
1955    Savings,
1956}
1957impl CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
1958    pub fn as_str(self) -> &'static str {
1959        use CreateSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
1960        match self {
1961            Checking => "checking",
1962            Savings => "savings",
1963        }
1964    }
1965}
1966
1967impl std::str::FromStr for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
1968    type Err = stripe_types::StripeParseError;
1969    fn from_str(s: &str) -> Result<Self, Self::Err> {
1970        use CreateSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
1971        match s {
1972            "checking" => Ok(Checking),
1973            "savings" => Ok(Savings),
1974            _ => Err(stripe_types::StripeParseError),
1975        }
1976    }
1977}
1978impl std::fmt::Display for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
1979    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1980        f.write_str(self.as_str())
1981    }
1982}
1983
1984impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
1985    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1986        f.write_str(self.as_str())
1987    }
1988}
1989impl serde::Serialize for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
1990    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1991    where
1992        S: serde::Serializer,
1993    {
1994        serializer.serialize_str(self.as_str())
1995    }
1996}
1997#[cfg(feature = "deserialize")]
1998impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
1999    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2000        use std::str::FromStr;
2001        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2002        Self::from_str(&s).map_err(|_| {
2003            serde::de::Error::custom(
2004                "Unknown value for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType",
2005            )
2006        })
2007    }
2008}
2009/// Payment method-specific configuration for this SetupIntent.
2010#[derive(Clone, Debug, serde::Serialize)]
2011pub struct CreateSetupIntentPaymentMethodOptions {
2012    /// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options.
2013    #[serde(skip_serializing_if = "Option::is_none")]
2014    pub acss_debit: Option<CreateSetupIntentPaymentMethodOptionsAcssDebit>,
2015    /// If this is a `amazon_pay` SetupIntent, this sub-hash contains details about the AmazonPay payment method options.
2016    #[serde(skip_serializing_if = "Option::is_none")]
2017    #[serde(with = "stripe_types::with_serde_json_opt")]
2018    pub amazon_pay: Option<miniserde::json::Value>,
2019    /// If this is a `bacs_debit` SetupIntent, this sub-hash contains details about the Bacs Debit payment method options.
2020    #[serde(skip_serializing_if = "Option::is_none")]
2021    pub bacs_debit: Option<CreateSetupIntentPaymentMethodOptionsBacsDebit>,
2022    /// Configuration for any card setup attempted on this SetupIntent.
2023    #[serde(skip_serializing_if = "Option::is_none")]
2024    pub card: Option<CreateSetupIntentPaymentMethodOptionsCard>,
2025    /// If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options.
2026    #[serde(skip_serializing_if = "Option::is_none")]
2027    #[serde(with = "stripe_types::with_serde_json_opt")]
2028    pub card_present: Option<miniserde::json::Value>,
2029    /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options.
2030    #[serde(skip_serializing_if = "Option::is_none")]
2031    pub klarna: Option<CreateSetupIntentPaymentMethodOptionsKlarna>,
2032    /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
2033    #[serde(skip_serializing_if = "Option::is_none")]
2034    pub link: Option<SetupIntentPaymentMethodOptionsParam>,
2035    /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
2036    #[serde(skip_serializing_if = "Option::is_none")]
2037    pub paypal: Option<PaymentMethodOptionsParam>,
2038    /// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options.
2039    #[serde(skip_serializing_if = "Option::is_none")]
2040    pub sepa_debit: Option<CreateSetupIntentPaymentMethodOptionsSepaDebit>,
2041    /// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options.
2042    #[serde(skip_serializing_if = "Option::is_none")]
2043    pub us_bank_account: Option<CreateSetupIntentPaymentMethodOptionsUsBankAccount>,
2044}
2045impl CreateSetupIntentPaymentMethodOptions {
2046    pub fn new() -> Self {
2047        Self {
2048            acss_debit: None,
2049            amazon_pay: None,
2050            bacs_debit: None,
2051            card: None,
2052            card_present: None,
2053            klarna: None,
2054            link: None,
2055            paypal: None,
2056            sepa_debit: None,
2057            us_bank_account: None,
2058        }
2059    }
2060}
2061impl Default for CreateSetupIntentPaymentMethodOptions {
2062    fn default() -> Self {
2063        Self::new()
2064    }
2065}
2066/// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options.
2067#[derive(Clone, Debug, serde::Serialize)]
2068pub struct CreateSetupIntentPaymentMethodOptionsAcssDebit {
2069    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
2070    /// Must be a [supported currency](https://stripe.com/docs/currencies).
2071    #[serde(skip_serializing_if = "Option::is_none")]
2072    pub currency: Option<CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency>,
2073    /// Additional fields for Mandate creation
2074    #[serde(skip_serializing_if = "Option::is_none")]
2075    pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions>,
2076    /// Bank account verification method.
2077    #[serde(skip_serializing_if = "Option::is_none")]
2078    pub verification_method:
2079        Option<CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
2080}
2081impl CreateSetupIntentPaymentMethodOptionsAcssDebit {
2082    pub fn new() -> Self {
2083        Self { currency: None, mandate_options: None, verification_method: None }
2084    }
2085}
2086impl Default for CreateSetupIntentPaymentMethodOptionsAcssDebit {
2087    fn default() -> Self {
2088        Self::new()
2089    }
2090}
2091/// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
2092/// Must be a [supported currency](https://stripe.com/docs/currencies).
2093#[derive(Copy, Clone, Eq, PartialEq)]
2094pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2095    Cad,
2096    Usd,
2097}
2098impl CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2099    pub fn as_str(self) -> &'static str {
2100        use CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
2101        match self {
2102            Cad => "cad",
2103            Usd => "usd",
2104        }
2105    }
2106}
2107
2108impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2109    type Err = stripe_types::StripeParseError;
2110    fn from_str(s: &str) -> Result<Self, Self::Err> {
2111        use CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
2112        match s {
2113            "cad" => Ok(Cad),
2114            "usd" => Ok(Usd),
2115            _ => Err(stripe_types::StripeParseError),
2116        }
2117    }
2118}
2119impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2120    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2121        f.write_str(self.as_str())
2122    }
2123}
2124
2125impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2126    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2127        f.write_str(self.as_str())
2128    }
2129}
2130impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2131    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2132    where
2133        S: serde::Serializer,
2134    {
2135        serializer.serialize_str(self.as_str())
2136    }
2137}
2138#[cfg(feature = "deserialize")]
2139impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
2140    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2141        use std::str::FromStr;
2142        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2143        Self::from_str(&s).map_err(|_| {
2144            serde::de::Error::custom(
2145                "Unknown value for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency",
2146            )
2147        })
2148    }
2149}
2150/// Additional fields for Mandate creation
2151#[derive(Clone, Debug, serde::Serialize)]
2152pub struct CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
2153    /// A URL for custom mandate text to render during confirmation step.
2154    /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,.
2155    /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent.
2156    #[serde(skip_serializing_if = "Option::is_none")]
2157    pub custom_mandate_url: Option<String>,
2158    /// List of Stripe products where this mandate can be selected automatically.
2159    #[serde(skip_serializing_if = "Option::is_none")]
2160    pub default_for:
2161        Option<Vec<CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor>>,
2162    /// Description of the mandate interval.
2163    /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'.
2164    #[serde(skip_serializing_if = "Option::is_none")]
2165    pub interval_description: Option<String>,
2166    /// Payment schedule for the mandate.
2167    #[serde(skip_serializing_if = "Option::is_none")]
2168    pub payment_schedule:
2169        Option<CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
2170    /// Transaction type of the mandate.
2171    #[serde(skip_serializing_if = "Option::is_none")]
2172    pub transaction_type:
2173        Option<CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
2174}
2175impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
2176    pub fn new() -> Self {
2177        Self {
2178            custom_mandate_url: None,
2179            default_for: None,
2180            interval_description: None,
2181            payment_schedule: None,
2182            transaction_type: None,
2183        }
2184    }
2185}
2186impl Default for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
2187    fn default() -> Self {
2188        Self::new()
2189    }
2190}
2191/// List of Stripe products where this mandate can be selected automatically.
2192#[derive(Copy, Clone, Eq, PartialEq)]
2193pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2194    Invoice,
2195    Subscription,
2196}
2197impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2198    pub fn as_str(self) -> &'static str {
2199        use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
2200        match self {
2201            Invoice => "invoice",
2202            Subscription => "subscription",
2203        }
2204    }
2205}
2206
2207impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2208    type Err = stripe_types::StripeParseError;
2209    fn from_str(s: &str) -> Result<Self, Self::Err> {
2210        use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
2211        match s {
2212            "invoice" => Ok(Invoice),
2213            "subscription" => Ok(Subscription),
2214            _ => Err(stripe_types::StripeParseError),
2215        }
2216    }
2217}
2218impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2219    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2220        f.write_str(self.as_str())
2221    }
2222}
2223
2224impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2225    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2226        f.write_str(self.as_str())
2227    }
2228}
2229impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
2230    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2231    where
2232        S: serde::Serializer,
2233    {
2234        serializer.serialize_str(self.as_str())
2235    }
2236}
2237#[cfg(feature = "deserialize")]
2238impl<'de> serde::Deserialize<'de>
2239    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
2240{
2241    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2242        use std::str::FromStr;
2243        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2244        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor"))
2245    }
2246}
2247/// Payment schedule for the mandate.
2248#[derive(Copy, Clone, Eq, PartialEq)]
2249pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
2250    Combined,
2251    Interval,
2252    Sporadic,
2253}
2254impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
2255    pub fn as_str(self) -> &'static str {
2256        use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
2257        match self {
2258            Combined => "combined",
2259            Interval => "interval",
2260            Sporadic => "sporadic",
2261        }
2262    }
2263}
2264
2265impl std::str::FromStr
2266    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2267{
2268    type Err = stripe_types::StripeParseError;
2269    fn from_str(s: &str) -> Result<Self, Self::Err> {
2270        use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
2271        match s {
2272            "combined" => Ok(Combined),
2273            "interval" => Ok(Interval),
2274            "sporadic" => Ok(Sporadic),
2275            _ => Err(stripe_types::StripeParseError),
2276        }
2277    }
2278}
2279impl std::fmt::Display
2280    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2281{
2282    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2283        f.write_str(self.as_str())
2284    }
2285}
2286
2287impl std::fmt::Debug
2288    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2289{
2290    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2291        f.write_str(self.as_str())
2292    }
2293}
2294impl serde::Serialize
2295    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2296{
2297    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2298    where
2299        S: serde::Serializer,
2300    {
2301        serializer.serialize_str(self.as_str())
2302    }
2303}
2304#[cfg(feature = "deserialize")]
2305impl<'de> serde::Deserialize<'de>
2306    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2307{
2308    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2309        use std::str::FromStr;
2310        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2311        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"))
2312    }
2313}
2314/// Transaction type of the mandate.
2315#[derive(Copy, Clone, Eq, PartialEq)]
2316pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
2317    Business,
2318    Personal,
2319}
2320impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
2321    pub fn as_str(self) -> &'static str {
2322        use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
2323        match self {
2324            Business => "business",
2325            Personal => "personal",
2326        }
2327    }
2328}
2329
2330impl std::str::FromStr
2331    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2332{
2333    type Err = stripe_types::StripeParseError;
2334    fn from_str(s: &str) -> Result<Self, Self::Err> {
2335        use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
2336        match s {
2337            "business" => Ok(Business),
2338            "personal" => Ok(Personal),
2339            _ => Err(stripe_types::StripeParseError),
2340        }
2341    }
2342}
2343impl std::fmt::Display
2344    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2345{
2346    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2347        f.write_str(self.as_str())
2348    }
2349}
2350
2351impl std::fmt::Debug
2352    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2353{
2354    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2355        f.write_str(self.as_str())
2356    }
2357}
2358impl serde::Serialize
2359    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2360{
2361    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2362    where
2363        S: serde::Serializer,
2364    {
2365        serializer.serialize_str(self.as_str())
2366    }
2367}
2368#[cfg(feature = "deserialize")]
2369impl<'de> serde::Deserialize<'de>
2370    for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2371{
2372    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2373        use std::str::FromStr;
2374        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2375        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"))
2376    }
2377}
2378/// Bank account verification method.
2379#[derive(Copy, Clone, Eq, PartialEq)]
2380pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2381    Automatic,
2382    Instant,
2383    Microdeposits,
2384}
2385impl CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2386    pub fn as_str(self) -> &'static str {
2387        use CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
2388        match self {
2389            Automatic => "automatic",
2390            Instant => "instant",
2391            Microdeposits => "microdeposits",
2392        }
2393    }
2394}
2395
2396impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2397    type Err = stripe_types::StripeParseError;
2398    fn from_str(s: &str) -> Result<Self, Self::Err> {
2399        use CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
2400        match s {
2401            "automatic" => Ok(Automatic),
2402            "instant" => Ok(Instant),
2403            "microdeposits" => Ok(Microdeposits),
2404            _ => Err(stripe_types::StripeParseError),
2405        }
2406    }
2407}
2408impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2409    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2410        f.write_str(self.as_str())
2411    }
2412}
2413
2414impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2415    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2416        f.write_str(self.as_str())
2417    }
2418}
2419impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2420    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2421    where
2422        S: serde::Serializer,
2423    {
2424        serializer.serialize_str(self.as_str())
2425    }
2426}
2427#[cfg(feature = "deserialize")]
2428impl<'de> serde::Deserialize<'de>
2429    for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod
2430{
2431    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2432        use std::str::FromStr;
2433        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2434        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod"))
2435    }
2436}
2437/// If this is a `bacs_debit` SetupIntent, this sub-hash contains details about the Bacs Debit payment method options.
2438#[derive(Clone, Debug, serde::Serialize)]
2439pub struct CreateSetupIntentPaymentMethodOptionsBacsDebit {
2440    /// Additional fields for Mandate creation
2441    #[serde(skip_serializing_if = "Option::is_none")]
2442    pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
2443}
2444impl CreateSetupIntentPaymentMethodOptionsBacsDebit {
2445    pub fn new() -> Self {
2446        Self { mandate_options: None }
2447    }
2448}
2449impl Default for CreateSetupIntentPaymentMethodOptionsBacsDebit {
2450    fn default() -> Self {
2451        Self::new()
2452    }
2453}
2454/// Configuration for any card setup attempted on this SetupIntent.
2455#[derive(Clone, Debug, serde::Serialize)]
2456pub struct CreateSetupIntentPaymentMethodOptionsCard {
2457    /// Configuration options for setting up an eMandate for cards issued in India.
2458    #[serde(skip_serializing_if = "Option::is_none")]
2459    pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsCardMandateOptions>,
2460    /// When specified, this parameter signals that a card has been collected
2461    /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This
2462    /// parameter can only be provided during confirmation.
2463    #[serde(skip_serializing_if = "Option::is_none")]
2464    pub moto: Option<bool>,
2465    /// Selected network to process this SetupIntent on.
2466    /// Depends on the available networks of the card attached to the SetupIntent.
2467    /// Can be only set confirm-time.
2468    #[serde(skip_serializing_if = "Option::is_none")]
2469    pub network: Option<CreateSetupIntentPaymentMethodOptionsCardNetwork>,
2470    /// 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).
2471    /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
2472    /// If not provided, this value defaults to `automatic`.
2473    /// 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.
2474    #[serde(skip_serializing_if = "Option::is_none")]
2475    pub request_three_d_secure:
2476        Option<CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure>,
2477    /// If 3D Secure authentication was performed with a third-party provider,
2478    /// the authentication details to use for this setup.
2479    #[serde(skip_serializing_if = "Option::is_none")]
2480    pub three_d_secure: Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecure>,
2481}
2482impl CreateSetupIntentPaymentMethodOptionsCard {
2483    pub fn new() -> Self {
2484        Self {
2485            mandate_options: None,
2486            moto: None,
2487            network: None,
2488            request_three_d_secure: None,
2489            three_d_secure: None,
2490        }
2491    }
2492}
2493impl Default for CreateSetupIntentPaymentMethodOptionsCard {
2494    fn default() -> Self {
2495        Self::new()
2496    }
2497}
2498/// Configuration options for setting up an eMandate for cards issued in India.
2499#[derive(Clone, Debug, serde::Serialize)]
2500pub struct CreateSetupIntentPaymentMethodOptionsCardMandateOptions {
2501    /// Amount to be charged for future payments.
2502    pub amount: i64,
2503    /// One of `fixed` or `maximum`.
2504    /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
2505    /// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
2506    pub amount_type: CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType,
2507    /// Currency in which future payments will be charged.
2508    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
2509    /// Must be a [supported currency](https://stripe.com/docs/currencies).
2510    pub currency: stripe_types::Currency,
2511    /// A description of the mandate or subscription that is meant to be displayed to the customer.
2512    #[serde(skip_serializing_if = "Option::is_none")]
2513    pub description: Option<String>,
2514    /// End date of the mandate or subscription.
2515    /// If not provided, the mandate will be active until canceled.
2516    /// If provided, end date should be after start date.
2517    #[serde(skip_serializing_if = "Option::is_none")]
2518    pub end_date: Option<stripe_types::Timestamp>,
2519    /// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
2520    pub interval: CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval,
2521    /// The number of intervals between payments.
2522    /// For example, `interval=month` and `interval_count=3` indicates one payment every three months.
2523    /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).
2524    /// This parameter is optional when `interval=sporadic`.
2525    #[serde(skip_serializing_if = "Option::is_none")]
2526    pub interval_count: Option<u64>,
2527    /// Unique identifier for the mandate or subscription.
2528    pub reference: String,
2529    /// Start date of the mandate or subscription. Start date should not be lesser than yesterday.
2530    pub start_date: stripe_types::Timestamp,
2531    /// Specifies the type of mandates supported. Possible values are `india`.
2532    #[serde(skip_serializing_if = "Option::is_none")]
2533    pub supported_types:
2534        Option<Vec<CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
2535}
2536impl CreateSetupIntentPaymentMethodOptionsCardMandateOptions {
2537    pub fn new(
2538        amount: impl Into<i64>,
2539        amount_type: impl Into<CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
2540        currency: impl Into<stripe_types::Currency>,
2541        interval: impl Into<CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval>,
2542        reference: impl Into<String>,
2543        start_date: impl Into<stripe_types::Timestamp>,
2544    ) -> Self {
2545        Self {
2546            amount: amount.into(),
2547            amount_type: amount_type.into(),
2548            currency: currency.into(),
2549            description: None,
2550            end_date: None,
2551            interval: interval.into(),
2552            interval_count: None,
2553            reference: reference.into(),
2554            start_date: start_date.into(),
2555            supported_types: None,
2556        }
2557    }
2558}
2559/// One of `fixed` or `maximum`.
2560/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
2561/// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
2562#[derive(Copy, Clone, Eq, PartialEq)]
2563pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
2564    Fixed,
2565    Maximum,
2566}
2567impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
2568    pub fn as_str(self) -> &'static str {
2569        use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
2570        match self {
2571            Fixed => "fixed",
2572            Maximum => "maximum",
2573        }
2574    }
2575}
2576
2577impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
2578    type Err = stripe_types::StripeParseError;
2579    fn from_str(s: &str) -> Result<Self, Self::Err> {
2580        use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
2581        match s {
2582            "fixed" => Ok(Fixed),
2583            "maximum" => Ok(Maximum),
2584            _ => Err(stripe_types::StripeParseError),
2585        }
2586    }
2587}
2588impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
2589    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2590        f.write_str(self.as_str())
2591    }
2592}
2593
2594impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
2595    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2596        f.write_str(self.as_str())
2597    }
2598}
2599impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
2600    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2601    where
2602        S: serde::Serializer,
2603    {
2604        serializer.serialize_str(self.as_str())
2605    }
2606}
2607#[cfg(feature = "deserialize")]
2608impl<'de> serde::Deserialize<'de>
2609    for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType
2610{
2611    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2612        use std::str::FromStr;
2613        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2614        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType"))
2615    }
2616}
2617/// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
2618#[derive(Copy, Clone, Eq, PartialEq)]
2619pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
2620    Day,
2621    Month,
2622    Sporadic,
2623    Week,
2624    Year,
2625}
2626impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
2627    pub fn as_str(self) -> &'static str {
2628        use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
2629        match self {
2630            Day => "day",
2631            Month => "month",
2632            Sporadic => "sporadic",
2633            Week => "week",
2634            Year => "year",
2635        }
2636    }
2637}
2638
2639impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
2640    type Err = stripe_types::StripeParseError;
2641    fn from_str(s: &str) -> Result<Self, Self::Err> {
2642        use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
2643        match s {
2644            "day" => Ok(Day),
2645            "month" => Ok(Month),
2646            "sporadic" => Ok(Sporadic),
2647            "week" => Ok(Week),
2648            "year" => Ok(Year),
2649            _ => Err(stripe_types::StripeParseError),
2650        }
2651    }
2652}
2653impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
2654    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2655        f.write_str(self.as_str())
2656    }
2657}
2658
2659impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
2660    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2661        f.write_str(self.as_str())
2662    }
2663}
2664impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
2665    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2666    where
2667        S: serde::Serializer,
2668    {
2669        serializer.serialize_str(self.as_str())
2670    }
2671}
2672#[cfg(feature = "deserialize")]
2673impl<'de> serde::Deserialize<'de>
2674    for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval
2675{
2676    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2677        use std::str::FromStr;
2678        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2679        Self::from_str(&s).map_err(|_| {
2680            serde::de::Error::custom(
2681                "Unknown value for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval",
2682            )
2683        })
2684    }
2685}
2686/// Specifies the type of mandates supported. Possible values are `india`.
2687#[derive(Copy, Clone, Eq, PartialEq)]
2688pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
2689    India,
2690}
2691impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
2692    pub fn as_str(self) -> &'static str {
2693        use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
2694        match self {
2695            India => "india",
2696        }
2697    }
2698}
2699
2700impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
2701    type Err = stripe_types::StripeParseError;
2702    fn from_str(s: &str) -> Result<Self, Self::Err> {
2703        use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
2704        match s {
2705            "india" => Ok(India),
2706            _ => Err(stripe_types::StripeParseError),
2707        }
2708    }
2709}
2710impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
2711    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2712        f.write_str(self.as_str())
2713    }
2714}
2715
2716impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
2717    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2718        f.write_str(self.as_str())
2719    }
2720}
2721impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
2722    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2723    where
2724        S: serde::Serializer,
2725    {
2726        serializer.serialize_str(self.as_str())
2727    }
2728}
2729#[cfg(feature = "deserialize")]
2730impl<'de> serde::Deserialize<'de>
2731    for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
2732{
2733    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2734        use std::str::FromStr;
2735        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2736        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"))
2737    }
2738}
2739/// Selected network to process this SetupIntent on.
2740/// Depends on the available networks of the card attached to the SetupIntent.
2741/// Can be only set confirm-time.
2742#[derive(Copy, Clone, Eq, PartialEq)]
2743pub enum CreateSetupIntentPaymentMethodOptionsCardNetwork {
2744    Amex,
2745    CartesBancaires,
2746    Diners,
2747    Discover,
2748    EftposAu,
2749    Girocard,
2750    Interac,
2751    Jcb,
2752    Link,
2753    Mastercard,
2754    Unionpay,
2755    Unknown,
2756    Visa,
2757}
2758impl CreateSetupIntentPaymentMethodOptionsCardNetwork {
2759    pub fn as_str(self) -> &'static str {
2760        use CreateSetupIntentPaymentMethodOptionsCardNetwork::*;
2761        match self {
2762            Amex => "amex",
2763            CartesBancaires => "cartes_bancaires",
2764            Diners => "diners",
2765            Discover => "discover",
2766            EftposAu => "eftpos_au",
2767            Girocard => "girocard",
2768            Interac => "interac",
2769            Jcb => "jcb",
2770            Link => "link",
2771            Mastercard => "mastercard",
2772            Unionpay => "unionpay",
2773            Unknown => "unknown",
2774            Visa => "visa",
2775        }
2776    }
2777}
2778
2779impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardNetwork {
2780    type Err = stripe_types::StripeParseError;
2781    fn from_str(s: &str) -> Result<Self, Self::Err> {
2782        use CreateSetupIntentPaymentMethodOptionsCardNetwork::*;
2783        match s {
2784            "amex" => Ok(Amex),
2785            "cartes_bancaires" => Ok(CartesBancaires),
2786            "diners" => Ok(Diners),
2787            "discover" => Ok(Discover),
2788            "eftpos_au" => Ok(EftposAu),
2789            "girocard" => Ok(Girocard),
2790            "interac" => Ok(Interac),
2791            "jcb" => Ok(Jcb),
2792            "link" => Ok(Link),
2793            "mastercard" => Ok(Mastercard),
2794            "unionpay" => Ok(Unionpay),
2795            "unknown" => Ok(Unknown),
2796            "visa" => Ok(Visa),
2797            _ => Err(stripe_types::StripeParseError),
2798        }
2799    }
2800}
2801impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardNetwork {
2802    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2803        f.write_str(self.as_str())
2804    }
2805}
2806
2807impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardNetwork {
2808    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2809        f.write_str(self.as_str())
2810    }
2811}
2812impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardNetwork {
2813    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2814    where
2815        S: serde::Serializer,
2816    {
2817        serializer.serialize_str(self.as_str())
2818    }
2819}
2820#[cfg(feature = "deserialize")]
2821impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsCardNetwork {
2822    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2823        use std::str::FromStr;
2824        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2825        Self::from_str(&s).map_err(|_| {
2826            serde::de::Error::custom(
2827                "Unknown value for CreateSetupIntentPaymentMethodOptionsCardNetwork",
2828            )
2829        })
2830    }
2831}
2832/// 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).
2833/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
2834/// If not provided, this value defaults to `automatic`.
2835/// 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.
2836#[derive(Copy, Clone, Eq, PartialEq)]
2837pub enum CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
2838    Any,
2839    Automatic,
2840    Challenge,
2841}
2842impl CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
2843    pub fn as_str(self) -> &'static str {
2844        use CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
2845        match self {
2846            Any => "any",
2847            Automatic => "automatic",
2848            Challenge => "challenge",
2849        }
2850    }
2851}
2852
2853impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
2854    type Err = stripe_types::StripeParseError;
2855    fn from_str(s: &str) -> Result<Self, Self::Err> {
2856        use CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
2857        match s {
2858            "any" => Ok(Any),
2859            "automatic" => Ok(Automatic),
2860            "challenge" => Ok(Challenge),
2861            _ => Err(stripe_types::StripeParseError),
2862        }
2863    }
2864}
2865impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
2866    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2867        f.write_str(self.as_str())
2868    }
2869}
2870
2871impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
2872    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2873        f.write_str(self.as_str())
2874    }
2875}
2876impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
2877    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2878    where
2879        S: serde::Serializer,
2880    {
2881        serializer.serialize_str(self.as_str())
2882    }
2883}
2884#[cfg(feature = "deserialize")]
2885impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
2886    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2887        use std::str::FromStr;
2888        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2889        Self::from_str(&s).map_err(|_| {
2890            serde::de::Error::custom(
2891                "Unknown value for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure",
2892            )
2893        })
2894    }
2895}
2896/// If 3D Secure authentication was performed with a third-party provider,
2897/// the authentication details to use for this setup.
2898#[derive(Clone, Debug, serde::Serialize)]
2899pub struct CreateSetupIntentPaymentMethodOptionsCardThreeDSecure {
2900    /// The `transStatus` returned from the card Issuer’s ACS in the ARes.
2901    #[serde(skip_serializing_if = "Option::is_none")]
2902    pub ares_trans_status:
2903        Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
2904    /// The cryptogram, also known as the "authentication value" (AAV, CAVV or
2905    /// AEVV). This value is 20 bytes, base64-encoded into a 28-character string.
2906    /// (Most 3D Secure providers will return the base64-encoded version, which
2907    /// is what you should specify here.)
2908    #[serde(skip_serializing_if = "Option::is_none")]
2909    pub cryptogram: Option<String>,
2910    /// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
2911    /// provider and indicates what degree of authentication was performed.
2912    #[serde(skip_serializing_if = "Option::is_none")]
2913    pub electronic_commerce_indicator:
2914        Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
2915    /// Network specific 3DS fields. Network specific arguments require an
2916    /// explicit card brand choice. The parameter `payment_method_options.card.network``
2917    /// must be populated accordingly
2918    #[serde(skip_serializing_if = "Option::is_none")]
2919    pub network_options:
2920        Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
2921    /// The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the
2922    /// AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99.
2923    #[serde(skip_serializing_if = "Option::is_none")]
2924    pub requestor_challenge_indicator: Option<String>,
2925    /// For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server
2926    /// Transaction ID (dsTransID).
2927    #[serde(skip_serializing_if = "Option::is_none")]
2928    pub transaction_id: Option<String>,
2929    /// The version of 3D Secure that was performed.
2930    #[serde(skip_serializing_if = "Option::is_none")]
2931    pub version: Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion>,
2932}
2933impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecure {
2934    pub fn new() -> Self {
2935        Self {
2936            ares_trans_status: None,
2937            cryptogram: None,
2938            electronic_commerce_indicator: None,
2939            network_options: None,
2940            requestor_challenge_indicator: None,
2941            transaction_id: None,
2942            version: None,
2943        }
2944    }
2945}
2946impl Default for CreateSetupIntentPaymentMethodOptionsCardThreeDSecure {
2947    fn default() -> Self {
2948        Self::new()
2949    }
2950}
2951/// The `transStatus` returned from the card Issuer’s ACS in the ARes.
2952#[derive(Copy, Clone, Eq, PartialEq)]
2953pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
2954    A,
2955    C,
2956    I,
2957    N,
2958    R,
2959    U,
2960    Y,
2961}
2962impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
2963    pub fn as_str(self) -> &'static str {
2964        use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
2965        match self {
2966            A => "A",
2967            C => "C",
2968            I => "I",
2969            N => "N",
2970            R => "R",
2971            U => "U",
2972            Y => "Y",
2973        }
2974    }
2975}
2976
2977impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
2978    type Err = stripe_types::StripeParseError;
2979    fn from_str(s: &str) -> Result<Self, Self::Err> {
2980        use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
2981        match s {
2982            "A" => Ok(A),
2983            "C" => Ok(C),
2984            "I" => Ok(I),
2985            "N" => Ok(N),
2986            "R" => Ok(R),
2987            "U" => Ok(U),
2988            "Y" => Ok(Y),
2989            _ => Err(stripe_types::StripeParseError),
2990        }
2991    }
2992}
2993impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
2994    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2995        f.write_str(self.as_str())
2996    }
2997}
2998
2999impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
3000    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3001        f.write_str(self.as_str())
3002    }
3003}
3004impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
3005    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3006    where
3007        S: serde::Serializer,
3008    {
3009        serializer.serialize_str(self.as_str())
3010    }
3011}
3012#[cfg(feature = "deserialize")]
3013impl<'de> serde::Deserialize<'de>
3014    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
3015{
3016    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3017        use std::str::FromStr;
3018        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3019        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"))
3020    }
3021}
3022/// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
3023/// provider and indicates what degree of authentication was performed.
3024#[derive(Copy, Clone, Eq, PartialEq)]
3025pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
3026    V01,
3027    V02,
3028    V05,
3029    V06,
3030    V07,
3031}
3032impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
3033    pub fn as_str(self) -> &'static str {
3034        use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
3035        match self {
3036            V01 => "01",
3037            V02 => "02",
3038            V05 => "05",
3039            V06 => "06",
3040            V07 => "07",
3041        }
3042    }
3043}
3044
3045impl std::str::FromStr
3046    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
3047{
3048    type Err = stripe_types::StripeParseError;
3049    fn from_str(s: &str) -> Result<Self, Self::Err> {
3050        use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
3051        match s {
3052            "01" => Ok(V01),
3053            "02" => Ok(V02),
3054            "05" => Ok(V05),
3055            "06" => Ok(V06),
3056            "07" => Ok(V07),
3057            _ => Err(stripe_types::StripeParseError),
3058        }
3059    }
3060}
3061impl std::fmt::Display
3062    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
3063{
3064    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3065        f.write_str(self.as_str())
3066    }
3067}
3068
3069impl std::fmt::Debug
3070    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
3071{
3072    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3073        f.write_str(self.as_str())
3074    }
3075}
3076impl serde::Serialize
3077    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
3078{
3079    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3080    where
3081        S: serde::Serializer,
3082    {
3083        serializer.serialize_str(self.as_str())
3084    }
3085}
3086#[cfg(feature = "deserialize")]
3087impl<'de> serde::Deserialize<'de>
3088    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
3089{
3090    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3091        use std::str::FromStr;
3092        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3093        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"))
3094    }
3095}
3096/// Network specific 3DS fields. Network specific arguments require an
3097/// explicit card brand choice. The parameter `payment_method_options.card.network``
3098/// must be populated accordingly
3099#[derive(Clone, Debug, serde::Serialize)]
3100pub struct CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
3101    /// Cartes Bancaires-specific 3DS fields.
3102    #[serde(skip_serializing_if = "Option::is_none")]
3103    pub cartes_bancaires:
3104        Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires>,
3105}
3106impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
3107    pub fn new() -> Self {
3108        Self { cartes_bancaires: None }
3109    }
3110}
3111impl Default for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
3112    fn default() -> Self {
3113        Self::new()
3114    }
3115}
3116/// Cartes Bancaires-specific 3DS fields.
3117#[derive(Clone, Debug, serde::Serialize)]
3118pub struct CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
3119    /// The cryptogram calculation algorithm used by the card Issuer's ACS
3120    /// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
3121    /// messageExtension: CB-AVALGO
3122    pub cb_avalgo:
3123        CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
3124    /// The exemption indicator returned from Cartes Bancaires in the ARes.
3125    /// message extension: CB-EXEMPTION; string (4 characters)
3126    /// This is a 3 byte bitmap (low significant byte first and most significant
3127    /// bit first) that has been Base64 encoded
3128    #[serde(skip_serializing_if = "Option::is_none")]
3129    pub cb_exemption: Option<String>,
3130    /// The risk score returned from Cartes Bancaires in the ARes.
3131    /// message extension: CB-SCORE; numeric value 0-99
3132    #[serde(skip_serializing_if = "Option::is_none")]
3133    pub cb_score: Option<i64>,
3134}
3135impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
3136    pub fn new(
3137        cb_avalgo: impl Into<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
3138    ) -> Self {
3139        Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
3140    }
3141}
3142/// The cryptogram calculation algorithm used by the card Issuer's ACS
3143/// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
3144/// messageExtension: CB-AVALGO
3145#[derive(Copy, Clone, Eq, PartialEq)]
3146pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
3147{
3148    V0,
3149    V1,
3150    V2,
3151    V3,
3152    V4,
3153    A,
3154}
3155impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
3156    pub fn as_str(self) -> &'static str {
3157        use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
3158        match self {
3159            V0 => "0",
3160            V1 => "1",
3161            V2 => "2",
3162            V3 => "3",
3163            V4 => "4",
3164            A => "A",
3165        }
3166    }
3167}
3168
3169impl std::str::FromStr
3170    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
3171{
3172    type Err = stripe_types::StripeParseError;
3173    fn from_str(s: &str) -> Result<Self, Self::Err> {
3174        use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
3175        match s {
3176            "0" => Ok(V0),
3177            "1" => Ok(V1),
3178            "2" => Ok(V2),
3179            "3" => Ok(V3),
3180            "4" => Ok(V4),
3181            "A" => Ok(A),
3182            _ => Err(stripe_types::StripeParseError),
3183        }
3184    }
3185}
3186impl std::fmt::Display
3187    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
3188{
3189    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3190        f.write_str(self.as_str())
3191    }
3192}
3193
3194impl std::fmt::Debug
3195    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
3196{
3197    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3198        f.write_str(self.as_str())
3199    }
3200}
3201impl serde::Serialize
3202    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
3203{
3204    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3205    where
3206        S: serde::Serializer,
3207    {
3208        serializer.serialize_str(self.as_str())
3209    }
3210}
3211#[cfg(feature = "deserialize")]
3212impl<'de> serde::Deserialize<'de>
3213    for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
3214{
3215    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3216        use std::str::FromStr;
3217        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3218        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"))
3219    }
3220}
3221/// The version of 3D Secure that was performed.
3222#[derive(Copy, Clone, Eq, PartialEq)]
3223pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3224    V1_0_2,
3225    V2_1_0,
3226    V2_2_0,
3227}
3228impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3229    pub fn as_str(self) -> &'static str {
3230        use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
3231        match self {
3232            V1_0_2 => "1.0.2",
3233            V2_1_0 => "2.1.0",
3234            V2_2_0 => "2.2.0",
3235        }
3236    }
3237}
3238
3239impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3240    type Err = stripe_types::StripeParseError;
3241    fn from_str(s: &str) -> Result<Self, Self::Err> {
3242        use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
3243        match s {
3244            "1.0.2" => Ok(V1_0_2),
3245            "2.1.0" => Ok(V2_1_0),
3246            "2.2.0" => Ok(V2_2_0),
3247            _ => Err(stripe_types::StripeParseError),
3248        }
3249    }
3250}
3251impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3252    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3253        f.write_str(self.as_str())
3254    }
3255}
3256
3257impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3258    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3259        f.write_str(self.as_str())
3260    }
3261}
3262impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3263    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3264    where
3265        S: serde::Serializer,
3266    {
3267        serializer.serialize_str(self.as_str())
3268    }
3269}
3270#[cfg(feature = "deserialize")]
3271impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
3272    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3273        use std::str::FromStr;
3274        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3275        Self::from_str(&s).map_err(|_| {
3276            serde::de::Error::custom(
3277                "Unknown value for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion",
3278            )
3279        })
3280    }
3281}
3282/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options.
3283#[derive(Clone, Debug, serde::Serialize)]
3284pub struct CreateSetupIntentPaymentMethodOptionsKlarna {
3285    /// The currency of the SetupIntent. Three letter ISO currency code.
3286    #[serde(skip_serializing_if = "Option::is_none")]
3287    pub currency: Option<stripe_types::Currency>,
3288    /// On-demand details if setting up a payment method for on-demand payments.
3289    #[serde(skip_serializing_if = "Option::is_none")]
3290    pub on_demand: Option<CreateSetupIntentPaymentMethodOptionsKlarnaOnDemand>,
3291    /// Preferred language of the Klarna authorization page that the customer is redirected to
3292    #[serde(skip_serializing_if = "Option::is_none")]
3293    pub preferred_locale: Option<CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale>,
3294    /// Subscription details if setting up or charging a subscription
3295    #[serde(skip_serializing_if = "Option::is_none")]
3296    pub subscriptions: Option<Vec<CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptions>>,
3297}
3298impl CreateSetupIntentPaymentMethodOptionsKlarna {
3299    pub fn new() -> Self {
3300        Self { currency: None, on_demand: None, preferred_locale: None, subscriptions: None }
3301    }
3302}
3303impl Default for CreateSetupIntentPaymentMethodOptionsKlarna {
3304    fn default() -> Self {
3305        Self::new()
3306    }
3307}
3308/// On-demand details if setting up a payment method for on-demand payments.
3309#[derive(Copy, Clone, Debug, serde::Serialize)]
3310pub struct CreateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
3311    /// Your average amount value.
3312    /// You can use a value across your customer base, or segment based on customer type, country, etc.
3313    #[serde(skip_serializing_if = "Option::is_none")]
3314    pub average_amount: Option<i64>,
3315    /// The maximum value you may charge a customer per purchase.
3316    /// You can use a value across your customer base, or segment based on customer type, country, etc.
3317    #[serde(skip_serializing_if = "Option::is_none")]
3318    pub maximum_amount: Option<i64>,
3319    /// The lowest or minimum value you may charge a customer per purchase.
3320    /// You can use a value across your customer base, or segment based on customer type, country, etc.
3321    #[serde(skip_serializing_if = "Option::is_none")]
3322    pub minimum_amount: Option<i64>,
3323    /// Interval at which the customer is making purchases
3324    #[serde(skip_serializing_if = "Option::is_none")]
3325    pub purchase_interval:
3326        Option<CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
3327    /// The number of `purchase_interval` between charges
3328    #[serde(skip_serializing_if = "Option::is_none")]
3329    pub purchase_interval_count: Option<u64>,
3330}
3331impl CreateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
3332    pub fn new() -> Self {
3333        Self {
3334            average_amount: None,
3335            maximum_amount: None,
3336            minimum_amount: None,
3337            purchase_interval: None,
3338            purchase_interval_count: None,
3339        }
3340    }
3341}
3342impl Default for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
3343    fn default() -> Self {
3344        Self::new()
3345    }
3346}
3347/// Interval at which the customer is making purchases
3348#[derive(Copy, Clone, Eq, PartialEq)]
3349pub enum CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
3350    Day,
3351    Month,
3352    Week,
3353    Year,
3354}
3355impl CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
3356    pub fn as_str(self) -> &'static str {
3357        use CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
3358        match self {
3359            Day => "day",
3360            Month => "month",
3361            Week => "week",
3362            Year => "year",
3363        }
3364    }
3365}
3366
3367impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
3368    type Err = stripe_types::StripeParseError;
3369    fn from_str(s: &str) -> Result<Self, Self::Err> {
3370        use CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
3371        match s {
3372            "day" => Ok(Day),
3373            "month" => Ok(Month),
3374            "week" => Ok(Week),
3375            "year" => Ok(Year),
3376            _ => Err(stripe_types::StripeParseError),
3377        }
3378    }
3379}
3380impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
3381    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3382        f.write_str(self.as_str())
3383    }
3384}
3385
3386impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
3387    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3388        f.write_str(self.as_str())
3389    }
3390}
3391impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
3392    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3393    where
3394        S: serde::Serializer,
3395    {
3396        serializer.serialize_str(self.as_str())
3397    }
3398}
3399#[cfg(feature = "deserialize")]
3400impl<'de> serde::Deserialize<'de>
3401    for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
3402{
3403    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3404        use std::str::FromStr;
3405        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3406        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"))
3407    }
3408}
3409/// Preferred language of the Klarna authorization page that the customer is redirected to
3410#[derive(Clone, Eq, PartialEq)]
3411#[non_exhaustive]
3412pub enum CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3413    CsMinusCz,
3414    DaMinusDk,
3415    DeMinusAt,
3416    DeMinusCh,
3417    DeMinusDe,
3418    ElMinusGr,
3419    EnMinusAt,
3420    EnMinusAu,
3421    EnMinusBe,
3422    EnMinusCa,
3423    EnMinusCh,
3424    EnMinusCz,
3425    EnMinusDe,
3426    EnMinusDk,
3427    EnMinusEs,
3428    EnMinusFi,
3429    EnMinusFr,
3430    EnMinusGb,
3431    EnMinusGr,
3432    EnMinusIe,
3433    EnMinusIt,
3434    EnMinusNl,
3435    EnMinusNo,
3436    EnMinusNz,
3437    EnMinusPl,
3438    EnMinusPt,
3439    EnMinusRo,
3440    EnMinusSe,
3441    EnMinusUs,
3442    EsMinusEs,
3443    EsMinusUs,
3444    FiMinusFi,
3445    FrMinusBe,
3446    FrMinusCa,
3447    FrMinusCh,
3448    FrMinusFr,
3449    ItMinusCh,
3450    ItMinusIt,
3451    NbMinusNo,
3452    NlMinusBe,
3453    NlMinusNl,
3454    PlMinusPl,
3455    PtMinusPt,
3456    RoMinusRo,
3457    SvMinusFi,
3458    SvMinusSe,
3459    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3460    Unknown(String),
3461}
3462impl CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3463    pub fn as_str(&self) -> &str {
3464        use CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
3465        match self {
3466            CsMinusCz => "cs-CZ",
3467            DaMinusDk => "da-DK",
3468            DeMinusAt => "de-AT",
3469            DeMinusCh => "de-CH",
3470            DeMinusDe => "de-DE",
3471            ElMinusGr => "el-GR",
3472            EnMinusAt => "en-AT",
3473            EnMinusAu => "en-AU",
3474            EnMinusBe => "en-BE",
3475            EnMinusCa => "en-CA",
3476            EnMinusCh => "en-CH",
3477            EnMinusCz => "en-CZ",
3478            EnMinusDe => "en-DE",
3479            EnMinusDk => "en-DK",
3480            EnMinusEs => "en-ES",
3481            EnMinusFi => "en-FI",
3482            EnMinusFr => "en-FR",
3483            EnMinusGb => "en-GB",
3484            EnMinusGr => "en-GR",
3485            EnMinusIe => "en-IE",
3486            EnMinusIt => "en-IT",
3487            EnMinusNl => "en-NL",
3488            EnMinusNo => "en-NO",
3489            EnMinusNz => "en-NZ",
3490            EnMinusPl => "en-PL",
3491            EnMinusPt => "en-PT",
3492            EnMinusRo => "en-RO",
3493            EnMinusSe => "en-SE",
3494            EnMinusUs => "en-US",
3495            EsMinusEs => "es-ES",
3496            EsMinusUs => "es-US",
3497            FiMinusFi => "fi-FI",
3498            FrMinusBe => "fr-BE",
3499            FrMinusCa => "fr-CA",
3500            FrMinusCh => "fr-CH",
3501            FrMinusFr => "fr-FR",
3502            ItMinusCh => "it-CH",
3503            ItMinusIt => "it-IT",
3504            NbMinusNo => "nb-NO",
3505            NlMinusBe => "nl-BE",
3506            NlMinusNl => "nl-NL",
3507            PlMinusPl => "pl-PL",
3508            PtMinusPt => "pt-PT",
3509            RoMinusRo => "ro-RO",
3510            SvMinusFi => "sv-FI",
3511            SvMinusSe => "sv-SE",
3512            Unknown(v) => v,
3513        }
3514    }
3515}
3516
3517impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3518    type Err = std::convert::Infallible;
3519    fn from_str(s: &str) -> Result<Self, Self::Err> {
3520        use CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
3521        match s {
3522            "cs-CZ" => Ok(CsMinusCz),
3523            "da-DK" => Ok(DaMinusDk),
3524            "de-AT" => Ok(DeMinusAt),
3525            "de-CH" => Ok(DeMinusCh),
3526            "de-DE" => Ok(DeMinusDe),
3527            "el-GR" => Ok(ElMinusGr),
3528            "en-AT" => Ok(EnMinusAt),
3529            "en-AU" => Ok(EnMinusAu),
3530            "en-BE" => Ok(EnMinusBe),
3531            "en-CA" => Ok(EnMinusCa),
3532            "en-CH" => Ok(EnMinusCh),
3533            "en-CZ" => Ok(EnMinusCz),
3534            "en-DE" => Ok(EnMinusDe),
3535            "en-DK" => Ok(EnMinusDk),
3536            "en-ES" => Ok(EnMinusEs),
3537            "en-FI" => Ok(EnMinusFi),
3538            "en-FR" => Ok(EnMinusFr),
3539            "en-GB" => Ok(EnMinusGb),
3540            "en-GR" => Ok(EnMinusGr),
3541            "en-IE" => Ok(EnMinusIe),
3542            "en-IT" => Ok(EnMinusIt),
3543            "en-NL" => Ok(EnMinusNl),
3544            "en-NO" => Ok(EnMinusNo),
3545            "en-NZ" => Ok(EnMinusNz),
3546            "en-PL" => Ok(EnMinusPl),
3547            "en-PT" => Ok(EnMinusPt),
3548            "en-RO" => Ok(EnMinusRo),
3549            "en-SE" => Ok(EnMinusSe),
3550            "en-US" => Ok(EnMinusUs),
3551            "es-ES" => Ok(EsMinusEs),
3552            "es-US" => Ok(EsMinusUs),
3553            "fi-FI" => Ok(FiMinusFi),
3554            "fr-BE" => Ok(FrMinusBe),
3555            "fr-CA" => Ok(FrMinusCa),
3556            "fr-CH" => Ok(FrMinusCh),
3557            "fr-FR" => Ok(FrMinusFr),
3558            "it-CH" => Ok(ItMinusCh),
3559            "it-IT" => Ok(ItMinusIt),
3560            "nb-NO" => Ok(NbMinusNo),
3561            "nl-BE" => Ok(NlMinusBe),
3562            "nl-NL" => Ok(NlMinusNl),
3563            "pl-PL" => Ok(PlMinusPl),
3564            "pt-PT" => Ok(PtMinusPt),
3565            "ro-RO" => Ok(RoMinusRo),
3566            "sv-FI" => Ok(SvMinusFi),
3567            "sv-SE" => Ok(SvMinusSe),
3568            v => Ok(Unknown(v.to_owned())),
3569        }
3570    }
3571}
3572impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3573    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3574        f.write_str(self.as_str())
3575    }
3576}
3577
3578impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3579    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3580        f.write_str(self.as_str())
3581    }
3582}
3583impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3584    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3585    where
3586        S: serde::Serializer,
3587    {
3588        serializer.serialize_str(self.as_str())
3589    }
3590}
3591#[cfg(feature = "deserialize")]
3592impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
3593    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3594        use std::str::FromStr;
3595        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3596        Ok(Self::from_str(&s).unwrap())
3597    }
3598}
3599/// Subscription details if setting up or charging a subscription
3600#[derive(Clone, Debug, serde::Serialize)]
3601pub struct CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
3602    /// Unit of time between subscription charges.
3603    pub interval: CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
3604    /// The number of intervals (specified in the `interval` attribute) between subscription charges.
3605    /// For example, `interval=month` and `interval_count=3` charges every 3 months.
3606    #[serde(skip_serializing_if = "Option::is_none")]
3607    pub interval_count: Option<u64>,
3608    /// Name for subscription.
3609    #[serde(skip_serializing_if = "Option::is_none")]
3610    pub name: Option<String>,
3611    /// Describes the upcoming charge for this subscription.
3612    pub next_billing: SubscriptionNextBillingParam,
3613    /// A non-customer-facing reference to correlate subscription charges in the Klarna app.
3614    /// Use a value that persists across subscription charges.
3615    pub reference: String,
3616}
3617impl CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
3618    pub fn new(
3619        interval: impl Into<CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
3620        next_billing: impl Into<SubscriptionNextBillingParam>,
3621        reference: impl Into<String>,
3622    ) -> Self {
3623        Self {
3624            interval: interval.into(),
3625            interval_count: None,
3626            name: None,
3627            next_billing: next_billing.into(),
3628            reference: reference.into(),
3629        }
3630    }
3631}
3632/// Unit of time between subscription charges.
3633#[derive(Copy, Clone, Eq, PartialEq)]
3634pub enum CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
3635    Day,
3636    Month,
3637    Week,
3638    Year,
3639}
3640impl CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
3641    pub fn as_str(self) -> &'static str {
3642        use CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
3643        match self {
3644            Day => "day",
3645            Month => "month",
3646            Week => "week",
3647            Year => "year",
3648        }
3649    }
3650}
3651
3652impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
3653    type Err = stripe_types::StripeParseError;
3654    fn from_str(s: &str) -> Result<Self, Self::Err> {
3655        use CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
3656        match s {
3657            "day" => Ok(Day),
3658            "month" => Ok(Month),
3659            "week" => Ok(Week),
3660            "year" => Ok(Year),
3661            _ => Err(stripe_types::StripeParseError),
3662        }
3663    }
3664}
3665impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
3666    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3667        f.write_str(self.as_str())
3668    }
3669}
3670
3671impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
3672    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3673        f.write_str(self.as_str())
3674    }
3675}
3676impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
3677    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3678    where
3679        S: serde::Serializer,
3680    {
3681        serializer.serialize_str(self.as_str())
3682    }
3683}
3684#[cfg(feature = "deserialize")]
3685impl<'de> serde::Deserialize<'de>
3686    for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
3687{
3688    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3689        use std::str::FromStr;
3690        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3691        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"))
3692    }
3693}
3694/// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options.
3695#[derive(Clone, Debug, serde::Serialize)]
3696pub struct CreateSetupIntentPaymentMethodOptionsSepaDebit {
3697    /// Additional fields for Mandate creation
3698    #[serde(skip_serializing_if = "Option::is_none")]
3699    pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions>,
3700}
3701impl CreateSetupIntentPaymentMethodOptionsSepaDebit {
3702    pub fn new() -> Self {
3703        Self { mandate_options: None }
3704    }
3705}
3706impl Default for CreateSetupIntentPaymentMethodOptionsSepaDebit {
3707    fn default() -> Self {
3708        Self::new()
3709    }
3710}
3711/// Additional fields for Mandate creation
3712#[derive(Clone, Debug, serde::Serialize)]
3713pub struct CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
3714    /// Prefix used to generate the Mandate reference.
3715    /// Must be at most 12 characters long.
3716    /// Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'.
3717    /// Cannot begin with 'STRIPE'.
3718    #[serde(skip_serializing_if = "Option::is_none")]
3719    pub reference_prefix: Option<String>,
3720}
3721impl CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
3722    pub fn new() -> Self {
3723        Self { reference_prefix: None }
3724    }
3725}
3726impl Default for CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
3727    fn default() -> Self {
3728        Self::new()
3729    }
3730}
3731/// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options.
3732#[derive(Clone, Debug, serde::Serialize)]
3733pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccount {
3734    /// Additional fields for Financial Connections Session creation
3735    #[serde(skip_serializing_if = "Option::is_none")]
3736    pub financial_connections:
3737        Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
3738    /// Additional fields for Mandate creation
3739    #[serde(skip_serializing_if = "Option::is_none")]
3740    pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
3741    /// Additional fields for network related functions
3742    #[serde(skip_serializing_if = "Option::is_none")]
3743    pub networks: Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks>,
3744    /// Bank account verification method.
3745    #[serde(skip_serializing_if = "Option::is_none")]
3746    pub verification_method:
3747        Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
3748}
3749impl CreateSetupIntentPaymentMethodOptionsUsBankAccount {
3750    pub fn new() -> Self {
3751        Self {
3752            financial_connections: None,
3753            mandate_options: None,
3754            networks: None,
3755            verification_method: None,
3756        }
3757    }
3758}
3759impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccount {
3760    fn default() -> Self {
3761        Self::new()
3762    }
3763}
3764/// Additional fields for Financial Connections Session creation
3765#[derive(Clone, Debug, serde::Serialize)]
3766pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
3767    /// Provide filters for the linked accounts that the customer can select for the payment method.
3768    #[serde(skip_serializing_if = "Option::is_none")]
3769    pub filters:
3770        Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
3771    /// The list of permissions to request.
3772    /// If this parameter is passed, the `payment_method` permission must be included.
3773    /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
3774    #[serde(skip_serializing_if = "Option::is_none")]
3775    pub permissions: Option<
3776        Vec<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
3777    >,
3778    /// List of data features that you would like to retrieve upon account creation.
3779    #[serde(skip_serializing_if = "Option::is_none")]
3780    pub prefetch:
3781        Option<Vec<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>>,
3782    /// For webview integrations only.
3783    /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.
3784    #[serde(skip_serializing_if = "Option::is_none")]
3785    pub return_url: Option<String>,
3786}
3787impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
3788    pub fn new() -> Self {
3789        Self { filters: None, permissions: None, prefetch: None, return_url: None }
3790    }
3791}
3792impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
3793    fn default() -> Self {
3794        Self::new()
3795    }
3796}
3797/// Provide filters for the linked accounts that the customer can select for the payment method.
3798#[derive(Clone, Debug, serde::Serialize)]
3799pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
3800        /// The account subcategories to use to filter for selectable accounts.
3801    /// Valid subcategories are `checking` and `savings`.
3802#[serde(skip_serializing_if = "Option::is_none")]
3803pub account_subcategories: Option<Vec<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
3804
3805}
3806impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
3807    pub fn new() -> Self {
3808        Self { account_subcategories: None }
3809    }
3810}
3811impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
3812    fn default() -> Self {
3813        Self::new()
3814    }
3815}
3816/// The account subcategories to use to filter for selectable accounts.
3817/// Valid subcategories are `checking` and `savings`.
3818#[derive(Copy, Clone, Eq, PartialEq)]
3819pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
3820{
3821    Checking,
3822    Savings,
3823}
3824impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
3825    pub fn as_str(self) -> &'static str {
3826        use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
3827        match self {
3828Checking => "checking",
3829Savings => "savings",
3830
3831        }
3832    }
3833}
3834
3835impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
3836    type Err = stripe_types::StripeParseError;
3837    fn from_str(s: &str) -> Result<Self, Self::Err> {
3838        use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
3839        match s {
3840    "checking" => Ok(Checking),
3841"savings" => Ok(Savings),
3842_ => Err(stripe_types::StripeParseError)
3843
3844        }
3845    }
3846}
3847impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
3848    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3849        f.write_str(self.as_str())
3850    }
3851}
3852
3853impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
3854    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3855        f.write_str(self.as_str())
3856    }
3857}
3858impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
3859    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
3860        serializer.serialize_str(self.as_str())
3861    }
3862}
3863#[cfg(feature = "deserialize")]
3864impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
3865    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3866        use std::str::FromStr;
3867        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3868        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"))
3869    }
3870}
3871/// The list of permissions to request.
3872/// If this parameter is passed, the `payment_method` permission must be included.
3873/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
3874#[derive(Copy, Clone, Eq, PartialEq)]
3875pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
3876    Balances,
3877    Ownership,
3878    PaymentMethod,
3879    Transactions,
3880}
3881impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
3882    pub fn as_str(self) -> &'static str {
3883        use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
3884        match self {
3885            Balances => "balances",
3886            Ownership => "ownership",
3887            PaymentMethod => "payment_method",
3888            Transactions => "transactions",
3889        }
3890    }
3891}
3892
3893impl std::str::FromStr
3894    for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
3895{
3896    type Err = stripe_types::StripeParseError;
3897    fn from_str(s: &str) -> Result<Self, Self::Err> {
3898        use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
3899        match s {
3900            "balances" => Ok(Balances),
3901            "ownership" => Ok(Ownership),
3902            "payment_method" => Ok(PaymentMethod),
3903            "transactions" => Ok(Transactions),
3904            _ => Err(stripe_types::StripeParseError),
3905        }
3906    }
3907}
3908impl std::fmt::Display
3909    for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
3910{
3911    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3912        f.write_str(self.as_str())
3913    }
3914}
3915
3916impl std::fmt::Debug
3917    for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
3918{
3919    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3920        f.write_str(self.as_str())
3921    }
3922}
3923impl serde::Serialize
3924    for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
3925{
3926    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3927    where
3928        S: serde::Serializer,
3929    {
3930        serializer.serialize_str(self.as_str())
3931    }
3932}
3933#[cfg(feature = "deserialize")]
3934impl<'de> serde::Deserialize<'de>
3935    for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
3936{
3937    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3938        use std::str::FromStr;
3939        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3940        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"))
3941    }
3942}
3943/// List of data features that you would like to retrieve upon account creation.
3944#[derive(Copy, Clone, Eq, PartialEq)]
3945pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
3946    Balances,
3947    Ownership,
3948    Transactions,
3949}
3950impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
3951    pub fn as_str(self) -> &'static str {
3952        use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
3953        match self {
3954            Balances => "balances",
3955            Ownership => "ownership",
3956            Transactions => "transactions",
3957        }
3958    }
3959}
3960
3961impl std::str::FromStr
3962    for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
3963{
3964    type Err = stripe_types::StripeParseError;
3965    fn from_str(s: &str) -> Result<Self, Self::Err> {
3966        use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
3967        match s {
3968            "balances" => Ok(Balances),
3969            "ownership" => Ok(Ownership),
3970            "transactions" => Ok(Transactions),
3971            _ => Err(stripe_types::StripeParseError),
3972        }
3973    }
3974}
3975impl std::fmt::Display
3976    for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
3977{
3978    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3979        f.write_str(self.as_str())
3980    }
3981}
3982
3983impl std::fmt::Debug
3984    for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
3985{
3986    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3987        f.write_str(self.as_str())
3988    }
3989}
3990impl serde::Serialize
3991    for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
3992{
3993    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3994    where
3995        S: serde::Serializer,
3996    {
3997        serializer.serialize_str(self.as_str())
3998    }
3999}
4000#[cfg(feature = "deserialize")]
4001impl<'de> serde::Deserialize<'de>
4002    for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
4003{
4004    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4005        use std::str::FromStr;
4006        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4007        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"))
4008    }
4009}
4010/// Additional fields for Mandate creation
4011#[derive(Copy, Clone, Debug, serde::Serialize)]
4012pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
4013    /// The method used to collect offline mandate customer acceptance.
4014    #[serde(skip_serializing_if = "Option::is_none")]
4015    pub collection_method:
4016        Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
4017}
4018impl CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
4019    pub fn new() -> Self {
4020        Self { collection_method: None }
4021    }
4022}
4023impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
4024    fn default() -> Self {
4025        Self::new()
4026    }
4027}
4028/// The method used to collect offline mandate customer acceptance.
4029#[derive(Copy, Clone, Eq, PartialEq)]
4030pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
4031    Paper,
4032}
4033impl CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
4034    pub fn as_str(self) -> &'static str {
4035        use CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
4036        match self {
4037            Paper => "paper",
4038        }
4039    }
4040}
4041
4042impl std::str::FromStr
4043    for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
4044{
4045    type Err = stripe_types::StripeParseError;
4046    fn from_str(s: &str) -> Result<Self, Self::Err> {
4047        use CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
4048        match s {
4049            "paper" => Ok(Paper),
4050            _ => Err(stripe_types::StripeParseError),
4051        }
4052    }
4053}
4054impl std::fmt::Display
4055    for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
4056{
4057    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4058        f.write_str(self.as_str())
4059    }
4060}
4061
4062impl std::fmt::Debug
4063    for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
4064{
4065    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4066        f.write_str(self.as_str())
4067    }
4068}
4069impl serde::Serialize
4070    for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
4071{
4072    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4073    where
4074        S: serde::Serializer,
4075    {
4076        serializer.serialize_str(self.as_str())
4077    }
4078}
4079#[cfg(feature = "deserialize")]
4080impl<'de> serde::Deserialize<'de>
4081    for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
4082{
4083    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4084        use std::str::FromStr;
4085        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4086        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"))
4087    }
4088}
4089/// Additional fields for network related functions
4090#[derive(Clone, Debug, serde::Serialize)]
4091pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
4092    /// Triggers validations to run across the selected networks
4093    #[serde(skip_serializing_if = "Option::is_none")]
4094    pub requested: Option<Vec<CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
4095}
4096impl CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
4097    pub fn new() -> Self {
4098        Self { requested: None }
4099    }
4100}
4101impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
4102    fn default() -> Self {
4103        Self::new()
4104    }
4105}
4106/// Triggers validations to run across the selected networks
4107#[derive(Copy, Clone, Eq, PartialEq)]
4108pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
4109    Ach,
4110    UsDomesticWire,
4111}
4112impl CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
4113    pub fn as_str(self) -> &'static str {
4114        use CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
4115        match self {
4116            Ach => "ach",
4117            UsDomesticWire => "us_domestic_wire",
4118        }
4119    }
4120}
4121
4122impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
4123    type Err = stripe_types::StripeParseError;
4124    fn from_str(s: &str) -> Result<Self, Self::Err> {
4125        use CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
4126        match s {
4127            "ach" => Ok(Ach),
4128            "us_domestic_wire" => Ok(UsDomesticWire),
4129            _ => Err(stripe_types::StripeParseError),
4130        }
4131    }
4132}
4133impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
4134    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4135        f.write_str(self.as_str())
4136    }
4137}
4138
4139impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
4140    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4141        f.write_str(self.as_str())
4142    }
4143}
4144impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
4145    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4146    where
4147        S: serde::Serializer,
4148    {
4149        serializer.serialize_str(self.as_str())
4150    }
4151}
4152#[cfg(feature = "deserialize")]
4153impl<'de> serde::Deserialize<'de>
4154    for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested
4155{
4156    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4157        use std::str::FromStr;
4158        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4159        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested"))
4160    }
4161}
4162/// Bank account verification method.
4163#[derive(Copy, Clone, Eq, PartialEq)]
4164pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
4165    Automatic,
4166    Instant,
4167    Microdeposits,
4168}
4169impl CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
4170    pub fn as_str(self) -> &'static str {
4171        use CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
4172        match self {
4173            Automatic => "automatic",
4174            Instant => "instant",
4175            Microdeposits => "microdeposits",
4176        }
4177    }
4178}
4179
4180impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
4181    type Err = stripe_types::StripeParseError;
4182    fn from_str(s: &str) -> Result<Self, Self::Err> {
4183        use CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
4184        match s {
4185            "automatic" => Ok(Automatic),
4186            "instant" => Ok(Instant),
4187            "microdeposits" => Ok(Microdeposits),
4188            _ => Err(stripe_types::StripeParseError),
4189        }
4190    }
4191}
4192impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
4193    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4194        f.write_str(self.as_str())
4195    }
4196}
4197
4198impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
4199    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4200        f.write_str(self.as_str())
4201    }
4202}
4203impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
4204    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4205    where
4206        S: serde::Serializer,
4207    {
4208        serializer.serialize_str(self.as_str())
4209    }
4210}
4211#[cfg(feature = "deserialize")]
4212impl<'de> serde::Deserialize<'de>
4213    for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod
4214{
4215    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4216        use std::str::FromStr;
4217        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4218        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod"))
4219    }
4220}
4221/// If you populate this hash, this SetupIntent generates a `single_use` mandate after successful completion.
4222///
4223/// 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`.
4224#[derive(Clone, Debug, serde::Serialize)]
4225pub struct CreateSetupIntentSingleUse {
4226    /// Amount the customer is granting permission to collect later.
4227    /// 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).
4228    /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts).
4229    /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
4230    pub amount: i64,
4231    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
4232    /// Must be a [supported currency](https://stripe.com/docs/currencies).
4233    pub currency: stripe_types::Currency,
4234}
4235impl CreateSetupIntentSingleUse {
4236    pub fn new(amount: impl Into<i64>, currency: impl Into<stripe_types::Currency>) -> Self {
4237        Self { amount: amount.into(), currency: currency.into() }
4238    }
4239}
4240/// Indicates how the payment method is intended to be used in the future.
4241/// If not provided, this value defaults to `off_session`.
4242#[derive(Copy, Clone, Eq, PartialEq)]
4243pub enum CreateSetupIntentUsage {
4244    OffSession,
4245    OnSession,
4246}
4247impl CreateSetupIntentUsage {
4248    pub fn as_str(self) -> &'static str {
4249        use CreateSetupIntentUsage::*;
4250        match self {
4251            OffSession => "off_session",
4252            OnSession => "on_session",
4253        }
4254    }
4255}
4256
4257impl std::str::FromStr for CreateSetupIntentUsage {
4258    type Err = stripe_types::StripeParseError;
4259    fn from_str(s: &str) -> Result<Self, Self::Err> {
4260        use CreateSetupIntentUsage::*;
4261        match s {
4262            "off_session" => Ok(OffSession),
4263            "on_session" => Ok(OnSession),
4264            _ => Err(stripe_types::StripeParseError),
4265        }
4266    }
4267}
4268impl std::fmt::Display for CreateSetupIntentUsage {
4269    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4270        f.write_str(self.as_str())
4271    }
4272}
4273
4274impl std::fmt::Debug for CreateSetupIntentUsage {
4275    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4276        f.write_str(self.as_str())
4277    }
4278}
4279impl serde::Serialize for CreateSetupIntentUsage {
4280    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4281    where
4282        S: serde::Serializer,
4283    {
4284        serializer.serialize_str(self.as_str())
4285    }
4286}
4287#[cfg(feature = "deserialize")]
4288impl<'de> serde::Deserialize<'de> for CreateSetupIntentUsage {
4289    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4290        use std::str::FromStr;
4291        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4292        Self::from_str(&s)
4293            .map_err(|_| serde::de::Error::custom("Unknown value for CreateSetupIntentUsage"))
4294    }
4295}
4296/// Creates a SetupIntent object.
4297///
4298/// After you create the SetupIntent, attach a payment method and [confirm](https://stripe.com/docs/api/setup_intents/confirm).
4299/// it to collect any required permissions to charge the payment method later.
4300#[derive(Clone, Debug, serde::Serialize)]
4301pub struct CreateSetupIntent {
4302    inner: CreateSetupIntentBuilder,
4303}
4304impl CreateSetupIntent {
4305    /// Construct a new `CreateSetupIntent`.
4306    pub fn new() -> Self {
4307        Self { inner: CreateSetupIntentBuilder::new() }
4308    }
4309    /// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.
4310    ///
4311    /// It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers.
4312    /// 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.
4313    pub fn attach_to_self(mut self, attach_to_self: impl Into<bool>) -> Self {
4314        self.inner.attach_to_self = Some(attach_to_self.into());
4315        self
4316    }
4317    /// When you enable this parameter, this SetupIntent accepts payment methods that you enable in the Dashboard and that are compatible with its other parameters.
4318    pub fn automatic_payment_methods(
4319        mut self,
4320        automatic_payment_methods: impl Into<CreateSetupIntentAutomaticPaymentMethods>,
4321    ) -> Self {
4322        self.inner.automatic_payment_methods = Some(automatic_payment_methods.into());
4323        self
4324    }
4325    /// Set to `true` to attempt to confirm this SetupIntent immediately.
4326    /// This parameter defaults to `false`.
4327    /// If a card is the attached payment method, you can provide a `return_url` in case further authentication is necessary.
4328    pub fn confirm(mut self, confirm: impl Into<bool>) -> Self {
4329        self.inner.confirm = Some(confirm.into());
4330        self
4331    }
4332    /// ID of the ConfirmationToken used to confirm this SetupIntent.
4333    ///
4334    /// 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.
4335    pub fn confirmation_token(mut self, confirmation_token: impl Into<String>) -> Self {
4336        self.inner.confirmation_token = Some(confirmation_token.into());
4337        self
4338    }
4339    /// ID of the Customer this SetupIntent belongs to, if one exists.
4340    ///
4341    /// If present, the SetupIntent's payment method will be attached to the Customer on successful setup.
4342    /// Payment methods attached to other Customers cannot be used with this SetupIntent.
4343    pub fn customer(mut self, customer: impl Into<String>) -> Self {
4344        self.inner.customer = Some(customer.into());
4345        self
4346    }
4347    /// An arbitrary string attached to the object. Often useful for displaying to users.
4348    pub fn description(mut self, description: impl Into<String>) -> Self {
4349        self.inner.description = Some(description.into());
4350        self
4351    }
4352    /// The list of payment method types to exclude from use with this SetupIntent.
4353    pub fn excluded_payment_method_types(
4354        mut self,
4355        excluded_payment_method_types: impl Into<
4356            Vec<stripe_shared::SetupIntentExcludedPaymentMethodTypes>,
4357        >,
4358    ) -> Self {
4359        self.inner.excluded_payment_method_types = Some(excluded_payment_method_types.into());
4360        self
4361    }
4362    /// Specifies which fields in the response should be expanded.
4363    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
4364        self.inner.expand = Some(expand.into());
4365        self
4366    }
4367    /// Indicates the directions of money movement for which this payment method is intended to be used.
4368    ///
4369    /// Include `inbound` if you intend to use the payment method as the origin to pull funds from.
4370    /// Include `outbound` if you intend to use the payment method as the destination to send funds to.
4371    /// You can include both if you intend to use the payment method for both purposes.
4372    pub fn flow_directions(
4373        mut self,
4374        flow_directions: impl Into<Vec<stripe_shared::SetupIntentFlowDirections>>,
4375    ) -> Self {
4376        self.inner.flow_directions = Some(flow_directions.into());
4377        self
4378    }
4379    /// This hash contains details about the mandate to create.
4380    /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm).
4381    pub fn mandate_data(mut self, mandate_data: impl Into<CreateSetupIntentMandateData>) -> Self {
4382        self.inner.mandate_data = Some(mandate_data.into());
4383        self
4384    }
4385    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
4386    /// This can be useful for storing additional information about the object in a structured format.
4387    /// Individual keys can be unset by posting an empty value to them.
4388    /// All keys can be unset by posting an empty value to `metadata`.
4389    pub fn metadata(
4390        mut self,
4391        metadata: impl Into<std::collections::HashMap<String, String>>,
4392    ) -> Self {
4393        self.inner.metadata = Some(metadata.into());
4394        self
4395    }
4396    /// The Stripe account ID created for this SetupIntent.
4397    pub fn on_behalf_of(mut self, on_behalf_of: impl Into<String>) -> Self {
4398        self.inner.on_behalf_of = Some(on_behalf_of.into());
4399        self
4400    }
4401    /// ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent.
4402    pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
4403        self.inner.payment_method = Some(payment_method.into());
4404        self
4405    }
4406    /// The ID of the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) to use with this SetupIntent.
4407    pub fn payment_method_configuration(
4408        mut self,
4409        payment_method_configuration: impl Into<String>,
4410    ) -> Self {
4411        self.inner.payment_method_configuration = Some(payment_method_configuration.into());
4412        self
4413    }
4414    /// 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).
4415    /// value in the SetupIntent.
4416    pub fn payment_method_data(
4417        mut self,
4418        payment_method_data: impl Into<CreateSetupIntentPaymentMethodData>,
4419    ) -> Self {
4420        self.inner.payment_method_data = Some(payment_method_data.into());
4421        self
4422    }
4423    /// Payment method-specific configuration for this SetupIntent.
4424    pub fn payment_method_options(
4425        mut self,
4426        payment_method_options: impl Into<CreateSetupIntentPaymentMethodOptions>,
4427    ) -> Self {
4428        self.inner.payment_method_options = Some(payment_method_options.into());
4429        self
4430    }
4431    /// The list of payment method types (for example, card) that this SetupIntent can use.
4432    /// 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).
4433    /// A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type).
4434    pub fn payment_method_types(mut self, payment_method_types: impl Into<Vec<String>>) -> Self {
4435        self.inner.payment_method_types = Some(payment_method_types.into());
4436        self
4437    }
4438    /// The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site.
4439    /// To redirect to a mobile application, you can alternatively supply an application URI scheme.
4440    /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm).
4441    pub fn return_url(mut self, return_url: impl Into<String>) -> Self {
4442        self.inner.return_url = Some(return_url.into());
4443        self
4444    }
4445    /// If you populate this hash, this SetupIntent generates a `single_use` mandate after successful completion.
4446    ///
4447    /// 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`.
4448    pub fn single_use(mut self, single_use: impl Into<CreateSetupIntentSingleUse>) -> Self {
4449        self.inner.single_use = Some(single_use.into());
4450        self
4451    }
4452    /// Indicates how the payment method is intended to be used in the future.
4453    /// If not provided, this value defaults to `off_session`.
4454    pub fn usage(mut self, usage: impl Into<CreateSetupIntentUsage>) -> Self {
4455        self.inner.usage = Some(usage.into());
4456        self
4457    }
4458    /// Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions.
4459    pub fn use_stripe_sdk(mut self, use_stripe_sdk: impl Into<bool>) -> Self {
4460        self.inner.use_stripe_sdk = Some(use_stripe_sdk.into());
4461        self
4462    }
4463}
4464impl Default for CreateSetupIntent {
4465    fn default() -> Self {
4466        Self::new()
4467    }
4468}
4469impl CreateSetupIntent {
4470    /// Send the request and return the deserialized response.
4471    pub async fn send<C: StripeClient>(
4472        &self,
4473        client: &C,
4474    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
4475        self.customize().send(client).await
4476    }
4477
4478    /// Send the request and return the deserialized response, blocking until completion.
4479    pub fn send_blocking<C: StripeBlockingClient>(
4480        &self,
4481        client: &C,
4482    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
4483        self.customize().send_blocking(client)
4484    }
4485}
4486
4487impl StripeRequest for CreateSetupIntent {
4488    type Output = stripe_shared::SetupIntent;
4489
4490    fn build(&self) -> RequestBuilder {
4491        RequestBuilder::new(StripeMethod::Post, "/setup_intents").form(&self.inner)
4492    }
4493}
4494#[derive(Clone, Debug, serde::Serialize)]
4495struct UpdateSetupIntentBuilder {
4496    #[serde(skip_serializing_if = "Option::is_none")]
4497    attach_to_self: Option<bool>,
4498    #[serde(skip_serializing_if = "Option::is_none")]
4499    customer: Option<String>,
4500    #[serde(skip_serializing_if = "Option::is_none")]
4501    description: Option<String>,
4502    #[serde(skip_serializing_if = "Option::is_none")]
4503    excluded_payment_method_types:
4504        Option<Vec<stripe_shared::SetupIntentExcludedPaymentMethodTypes>>,
4505    #[serde(skip_serializing_if = "Option::is_none")]
4506    expand: Option<Vec<String>>,
4507    #[serde(skip_serializing_if = "Option::is_none")]
4508    flow_directions: Option<Vec<stripe_shared::SetupIntentFlowDirections>>,
4509    #[serde(skip_serializing_if = "Option::is_none")]
4510    metadata: Option<std::collections::HashMap<String, String>>,
4511    #[serde(skip_serializing_if = "Option::is_none")]
4512    payment_method: Option<String>,
4513    #[serde(skip_serializing_if = "Option::is_none")]
4514    payment_method_configuration: Option<String>,
4515    #[serde(skip_serializing_if = "Option::is_none")]
4516    payment_method_data: Option<UpdateSetupIntentPaymentMethodData>,
4517    #[serde(skip_serializing_if = "Option::is_none")]
4518    payment_method_options: Option<UpdateSetupIntentPaymentMethodOptions>,
4519    #[serde(skip_serializing_if = "Option::is_none")]
4520    payment_method_types: Option<Vec<String>>,
4521}
4522impl UpdateSetupIntentBuilder {
4523    fn new() -> Self {
4524        Self {
4525            attach_to_self: None,
4526            customer: None,
4527            description: None,
4528            excluded_payment_method_types: None,
4529            expand: None,
4530            flow_directions: None,
4531            metadata: None,
4532            payment_method: None,
4533            payment_method_configuration: None,
4534            payment_method_data: None,
4535            payment_method_options: None,
4536            payment_method_types: None,
4537        }
4538    }
4539}
4540/// 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).
4541/// value in the SetupIntent.
4542#[derive(Clone, Debug, serde::Serialize)]
4543pub struct UpdateSetupIntentPaymentMethodData {
4544    /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
4545    #[serde(skip_serializing_if = "Option::is_none")]
4546    pub acss_debit: Option<PaymentMethodParam>,
4547    /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
4548    #[serde(skip_serializing_if = "Option::is_none")]
4549    #[serde(with = "stripe_types::with_serde_json_opt")]
4550    pub affirm: Option<miniserde::json::Value>,
4551    /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
4552    #[serde(skip_serializing_if = "Option::is_none")]
4553    #[serde(with = "stripe_types::with_serde_json_opt")]
4554    pub afterpay_clearpay: Option<miniserde::json::Value>,
4555    /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
4556    #[serde(skip_serializing_if = "Option::is_none")]
4557    #[serde(with = "stripe_types::with_serde_json_opt")]
4558    pub alipay: Option<miniserde::json::Value>,
4559    /// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
4560    /// 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.
4561    /// The field defaults to `unspecified`.
4562    #[serde(skip_serializing_if = "Option::is_none")]
4563    pub allow_redisplay: Option<UpdateSetupIntentPaymentMethodDataAllowRedisplay>,
4564    /// If this is a Alma PaymentMethod, this hash contains details about the Alma payment method.
4565    #[serde(skip_serializing_if = "Option::is_none")]
4566    #[serde(with = "stripe_types::with_serde_json_opt")]
4567    pub alma: Option<miniserde::json::Value>,
4568    /// If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method.
4569    #[serde(skip_serializing_if = "Option::is_none")]
4570    #[serde(with = "stripe_types::with_serde_json_opt")]
4571    pub amazon_pay: Option<miniserde::json::Value>,
4572    /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
4573    #[serde(skip_serializing_if = "Option::is_none")]
4574    pub au_becs_debit: Option<UpdateSetupIntentPaymentMethodDataAuBecsDebit>,
4575    /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
4576    #[serde(skip_serializing_if = "Option::is_none")]
4577    pub bacs_debit: Option<UpdateSetupIntentPaymentMethodDataBacsDebit>,
4578    /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
4579    #[serde(skip_serializing_if = "Option::is_none")]
4580    #[serde(with = "stripe_types::with_serde_json_opt")]
4581    pub bancontact: Option<miniserde::json::Value>,
4582    /// If this is a `billie` PaymentMethod, this hash contains details about the Billie payment method.
4583    #[serde(skip_serializing_if = "Option::is_none")]
4584    #[serde(with = "stripe_types::with_serde_json_opt")]
4585    pub billie: Option<miniserde::json::Value>,
4586    /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
4587    #[serde(skip_serializing_if = "Option::is_none")]
4588    pub billing_details: Option<BillingDetailsInnerParams>,
4589    /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
4590    #[serde(skip_serializing_if = "Option::is_none")]
4591    #[serde(with = "stripe_types::with_serde_json_opt")]
4592    pub blik: Option<miniserde::json::Value>,
4593    /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
4594    #[serde(skip_serializing_if = "Option::is_none")]
4595    pub boleto: Option<UpdateSetupIntentPaymentMethodDataBoleto>,
4596    /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
4597    #[serde(skip_serializing_if = "Option::is_none")]
4598    #[serde(with = "stripe_types::with_serde_json_opt")]
4599    pub cashapp: Option<miniserde::json::Value>,
4600    /// If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method.
4601    #[serde(skip_serializing_if = "Option::is_none")]
4602    #[serde(with = "stripe_types::with_serde_json_opt")]
4603    pub crypto: Option<miniserde::json::Value>,
4604    /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
4605    #[serde(skip_serializing_if = "Option::is_none")]
4606    #[serde(with = "stripe_types::with_serde_json_opt")]
4607    pub customer_balance: Option<miniserde::json::Value>,
4608    /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
4609    #[serde(skip_serializing_if = "Option::is_none")]
4610    pub eps: Option<UpdateSetupIntentPaymentMethodDataEps>,
4611    /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
4612    #[serde(skip_serializing_if = "Option::is_none")]
4613    pub fpx: Option<UpdateSetupIntentPaymentMethodDataFpx>,
4614    /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
4615    #[serde(skip_serializing_if = "Option::is_none")]
4616    #[serde(with = "stripe_types::with_serde_json_opt")]
4617    pub giropay: Option<miniserde::json::Value>,
4618    /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
4619    #[serde(skip_serializing_if = "Option::is_none")]
4620    #[serde(with = "stripe_types::with_serde_json_opt")]
4621    pub grabpay: Option<miniserde::json::Value>,
4622    /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
4623    #[serde(skip_serializing_if = "Option::is_none")]
4624    pub ideal: Option<UpdateSetupIntentPaymentMethodDataIdeal>,
4625    /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
4626    #[serde(skip_serializing_if = "Option::is_none")]
4627    #[serde(with = "stripe_types::with_serde_json_opt")]
4628    pub interac_present: Option<miniserde::json::Value>,
4629    /// If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method.
4630    #[serde(skip_serializing_if = "Option::is_none")]
4631    #[serde(with = "stripe_types::with_serde_json_opt")]
4632    pub kakao_pay: Option<miniserde::json::Value>,
4633    /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
4634    #[serde(skip_serializing_if = "Option::is_none")]
4635    pub klarna: Option<UpdateSetupIntentPaymentMethodDataKlarna>,
4636    /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
4637    #[serde(skip_serializing_if = "Option::is_none")]
4638    #[serde(with = "stripe_types::with_serde_json_opt")]
4639    pub konbini: Option<miniserde::json::Value>,
4640    /// If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method.
4641    #[serde(skip_serializing_if = "Option::is_none")]
4642    #[serde(with = "stripe_types::with_serde_json_opt")]
4643    pub kr_card: Option<miniserde::json::Value>,
4644    /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
4645    #[serde(skip_serializing_if = "Option::is_none")]
4646    #[serde(with = "stripe_types::with_serde_json_opt")]
4647    pub link: Option<miniserde::json::Value>,
4648    /// If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method.
4649    #[serde(skip_serializing_if = "Option::is_none")]
4650    #[serde(with = "stripe_types::with_serde_json_opt")]
4651    pub mb_way: Option<miniserde::json::Value>,
4652    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
4653    /// This can be useful for storing additional information about the object in a structured format.
4654    /// Individual keys can be unset by posting an empty value to them.
4655    /// All keys can be unset by posting an empty value to `metadata`.
4656    #[serde(skip_serializing_if = "Option::is_none")]
4657    pub metadata: Option<std::collections::HashMap<String, String>>,
4658    /// If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
4659    #[serde(skip_serializing_if = "Option::is_none")]
4660    #[serde(with = "stripe_types::with_serde_json_opt")]
4661    pub mobilepay: Option<miniserde::json::Value>,
4662    /// If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method.
4663    #[serde(skip_serializing_if = "Option::is_none")]
4664    #[serde(with = "stripe_types::with_serde_json_opt")]
4665    pub multibanco: Option<miniserde::json::Value>,
4666    /// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
4667    #[serde(skip_serializing_if = "Option::is_none")]
4668    pub naver_pay: Option<UpdateSetupIntentPaymentMethodDataNaverPay>,
4669    /// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
4670    #[serde(skip_serializing_if = "Option::is_none")]
4671    pub nz_bank_account: Option<UpdateSetupIntentPaymentMethodDataNzBankAccount>,
4672    /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
4673    #[serde(skip_serializing_if = "Option::is_none")]
4674    #[serde(with = "stripe_types::with_serde_json_opt")]
4675    pub oxxo: Option<miniserde::json::Value>,
4676    /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
4677    #[serde(skip_serializing_if = "Option::is_none")]
4678    pub p24: Option<UpdateSetupIntentPaymentMethodDataP24>,
4679    /// If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method.
4680    #[serde(skip_serializing_if = "Option::is_none")]
4681    #[serde(with = "stripe_types::with_serde_json_opt")]
4682    pub pay_by_bank: Option<miniserde::json::Value>,
4683    /// If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method.
4684    #[serde(skip_serializing_if = "Option::is_none")]
4685    #[serde(with = "stripe_types::with_serde_json_opt")]
4686    pub payco: Option<miniserde::json::Value>,
4687    /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
4688    #[serde(skip_serializing_if = "Option::is_none")]
4689    #[serde(with = "stripe_types::with_serde_json_opt")]
4690    pub paynow: Option<miniserde::json::Value>,
4691    /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
4692    #[serde(skip_serializing_if = "Option::is_none")]
4693    #[serde(with = "stripe_types::with_serde_json_opt")]
4694    pub paypal: Option<miniserde::json::Value>,
4695    /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
4696    #[serde(skip_serializing_if = "Option::is_none")]
4697    #[serde(with = "stripe_types::with_serde_json_opt")]
4698    pub pix: Option<miniserde::json::Value>,
4699    /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
4700    #[serde(skip_serializing_if = "Option::is_none")]
4701    #[serde(with = "stripe_types::with_serde_json_opt")]
4702    pub promptpay: Option<miniserde::json::Value>,
4703    /// Options to configure Radar.
4704    /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
4705    #[serde(skip_serializing_if = "Option::is_none")]
4706    pub radar_options: Option<RadarOptionsWithHiddenOptions>,
4707    /// If this is a `revolut_pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
4708    #[serde(skip_serializing_if = "Option::is_none")]
4709    #[serde(with = "stripe_types::with_serde_json_opt")]
4710    pub revolut_pay: Option<miniserde::json::Value>,
4711    /// If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method.
4712    #[serde(skip_serializing_if = "Option::is_none")]
4713    #[serde(with = "stripe_types::with_serde_json_opt")]
4714    pub samsung_pay: Option<miniserde::json::Value>,
4715    /// If this is a `satispay` PaymentMethod, this hash contains details about the Satispay payment method.
4716    #[serde(skip_serializing_if = "Option::is_none")]
4717    #[serde(with = "stripe_types::with_serde_json_opt")]
4718    pub satispay: Option<miniserde::json::Value>,
4719    /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
4720    #[serde(skip_serializing_if = "Option::is_none")]
4721    pub sepa_debit: Option<UpdateSetupIntentPaymentMethodDataSepaDebit>,
4722    /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
4723    #[serde(skip_serializing_if = "Option::is_none")]
4724    pub sofort: Option<UpdateSetupIntentPaymentMethodDataSofort>,
4725    /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
4726    #[serde(skip_serializing_if = "Option::is_none")]
4727    #[serde(with = "stripe_types::with_serde_json_opt")]
4728    pub swish: Option<miniserde::json::Value>,
4729    /// If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method.
4730    #[serde(skip_serializing_if = "Option::is_none")]
4731    #[serde(with = "stripe_types::with_serde_json_opt")]
4732    pub twint: Option<miniserde::json::Value>,
4733    /// The type of the PaymentMethod.
4734    /// An additional hash is included on the PaymentMethod with a name matching this value.
4735    /// It contains additional information specific to the PaymentMethod type.
4736    #[serde(rename = "type")]
4737    pub type_: UpdateSetupIntentPaymentMethodDataType,
4738    /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
4739    #[serde(skip_serializing_if = "Option::is_none")]
4740    pub us_bank_account: Option<UpdateSetupIntentPaymentMethodDataUsBankAccount>,
4741    /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
4742    #[serde(skip_serializing_if = "Option::is_none")]
4743    #[serde(with = "stripe_types::with_serde_json_opt")]
4744    pub wechat_pay: Option<miniserde::json::Value>,
4745    /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
4746    #[serde(skip_serializing_if = "Option::is_none")]
4747    #[serde(with = "stripe_types::with_serde_json_opt")]
4748    pub zip: Option<miniserde::json::Value>,
4749}
4750impl UpdateSetupIntentPaymentMethodData {
4751    pub fn new(type_: impl Into<UpdateSetupIntentPaymentMethodDataType>) -> Self {
4752        Self {
4753            acss_debit: None,
4754            affirm: None,
4755            afterpay_clearpay: None,
4756            alipay: None,
4757            allow_redisplay: None,
4758            alma: None,
4759            amazon_pay: None,
4760            au_becs_debit: None,
4761            bacs_debit: None,
4762            bancontact: None,
4763            billie: None,
4764            billing_details: None,
4765            blik: None,
4766            boleto: None,
4767            cashapp: None,
4768            crypto: None,
4769            customer_balance: None,
4770            eps: None,
4771            fpx: None,
4772            giropay: None,
4773            grabpay: None,
4774            ideal: None,
4775            interac_present: None,
4776            kakao_pay: None,
4777            klarna: None,
4778            konbini: None,
4779            kr_card: None,
4780            link: None,
4781            mb_way: None,
4782            metadata: None,
4783            mobilepay: None,
4784            multibanco: None,
4785            naver_pay: None,
4786            nz_bank_account: None,
4787            oxxo: None,
4788            p24: None,
4789            pay_by_bank: None,
4790            payco: None,
4791            paynow: None,
4792            paypal: None,
4793            pix: None,
4794            promptpay: None,
4795            radar_options: None,
4796            revolut_pay: None,
4797            samsung_pay: None,
4798            satispay: None,
4799            sepa_debit: None,
4800            sofort: None,
4801            swish: None,
4802            twint: None,
4803            type_: type_.into(),
4804            us_bank_account: None,
4805            wechat_pay: None,
4806            zip: None,
4807        }
4808    }
4809}
4810/// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
4811/// 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.
4812/// The field defaults to `unspecified`.
4813#[derive(Copy, Clone, Eq, PartialEq)]
4814pub enum UpdateSetupIntentPaymentMethodDataAllowRedisplay {
4815    Always,
4816    Limited,
4817    Unspecified,
4818}
4819impl UpdateSetupIntentPaymentMethodDataAllowRedisplay {
4820    pub fn as_str(self) -> &'static str {
4821        use UpdateSetupIntentPaymentMethodDataAllowRedisplay::*;
4822        match self {
4823            Always => "always",
4824            Limited => "limited",
4825            Unspecified => "unspecified",
4826        }
4827    }
4828}
4829
4830impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
4831    type Err = stripe_types::StripeParseError;
4832    fn from_str(s: &str) -> Result<Self, Self::Err> {
4833        use UpdateSetupIntentPaymentMethodDataAllowRedisplay::*;
4834        match s {
4835            "always" => Ok(Always),
4836            "limited" => Ok(Limited),
4837            "unspecified" => Ok(Unspecified),
4838            _ => Err(stripe_types::StripeParseError),
4839        }
4840    }
4841}
4842impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
4843    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4844        f.write_str(self.as_str())
4845    }
4846}
4847
4848impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
4849    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4850        f.write_str(self.as_str())
4851    }
4852}
4853impl serde::Serialize for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
4854    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4855    where
4856        S: serde::Serializer,
4857    {
4858        serializer.serialize_str(self.as_str())
4859    }
4860}
4861#[cfg(feature = "deserialize")]
4862impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
4863    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4864        use std::str::FromStr;
4865        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4866        Self::from_str(&s).map_err(|_| {
4867            serde::de::Error::custom(
4868                "Unknown value for UpdateSetupIntentPaymentMethodDataAllowRedisplay",
4869            )
4870        })
4871    }
4872}
4873/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
4874#[derive(Clone, Debug, serde::Serialize)]
4875pub struct UpdateSetupIntentPaymentMethodDataAuBecsDebit {
4876    /// The account number for the bank account.
4877    pub account_number: String,
4878    /// Bank-State-Branch number of the bank account.
4879    pub bsb_number: String,
4880}
4881impl UpdateSetupIntentPaymentMethodDataAuBecsDebit {
4882    pub fn new(account_number: impl Into<String>, bsb_number: impl Into<String>) -> Self {
4883        Self { account_number: account_number.into(), bsb_number: bsb_number.into() }
4884    }
4885}
4886/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
4887#[derive(Clone, Debug, serde::Serialize)]
4888pub struct UpdateSetupIntentPaymentMethodDataBacsDebit {
4889    /// Account number of the bank account that the funds will be debited from.
4890    #[serde(skip_serializing_if = "Option::is_none")]
4891    pub account_number: Option<String>,
4892    /// Sort code of the bank account. (e.g., `10-20-30`)
4893    #[serde(skip_serializing_if = "Option::is_none")]
4894    pub sort_code: Option<String>,
4895}
4896impl UpdateSetupIntentPaymentMethodDataBacsDebit {
4897    pub fn new() -> Self {
4898        Self { account_number: None, sort_code: None }
4899    }
4900}
4901impl Default for UpdateSetupIntentPaymentMethodDataBacsDebit {
4902    fn default() -> Self {
4903        Self::new()
4904    }
4905}
4906/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
4907#[derive(Clone, Debug, serde::Serialize)]
4908pub struct UpdateSetupIntentPaymentMethodDataBoleto {
4909    /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)
4910    pub tax_id: String,
4911}
4912impl UpdateSetupIntentPaymentMethodDataBoleto {
4913    pub fn new(tax_id: impl Into<String>) -> Self {
4914        Self { tax_id: tax_id.into() }
4915    }
4916}
4917/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
4918#[derive(Clone, Debug, serde::Serialize)]
4919pub struct UpdateSetupIntentPaymentMethodDataEps {
4920    /// The customer's bank.
4921    #[serde(skip_serializing_if = "Option::is_none")]
4922    pub bank: Option<UpdateSetupIntentPaymentMethodDataEpsBank>,
4923}
4924impl UpdateSetupIntentPaymentMethodDataEps {
4925    pub fn new() -> Self {
4926        Self { bank: None }
4927    }
4928}
4929impl Default for UpdateSetupIntentPaymentMethodDataEps {
4930    fn default() -> Self {
4931        Self::new()
4932    }
4933}
4934/// The customer's bank.
4935#[derive(Clone, Eq, PartialEq)]
4936#[non_exhaustive]
4937pub enum UpdateSetupIntentPaymentMethodDataEpsBank {
4938    ArzteUndApothekerBank,
4939    AustrianAnadiBankAg,
4940    BankAustria,
4941    BankhausCarlSpangler,
4942    BankhausSchelhammerUndSchatteraAg,
4943    BawagPskAg,
4944    BksBankAg,
4945    BrullKallmusBankAg,
4946    BtvVierLanderBank,
4947    CapitalBankGraweGruppeAg,
4948    DeutscheBankAg,
4949    Dolomitenbank,
4950    EasybankAg,
4951    ErsteBankUndSparkassen,
4952    HypoAlpeadriabankInternationalAg,
4953    HypoBankBurgenlandAktiengesellschaft,
4954    HypoNoeLbFurNiederosterreichUWien,
4955    HypoOberosterreichSalzburgSteiermark,
4956    HypoTirolBankAg,
4957    HypoVorarlbergBankAg,
4958    MarchfelderBank,
4959    OberbankAg,
4960    RaiffeisenBankengruppeOsterreich,
4961    SchoellerbankAg,
4962    SpardaBankWien,
4963    VolksbankGruppe,
4964    VolkskreditbankAg,
4965    VrBankBraunau,
4966    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4967    Unknown(String),
4968}
4969impl UpdateSetupIntentPaymentMethodDataEpsBank {
4970    pub fn as_str(&self) -> &str {
4971        use UpdateSetupIntentPaymentMethodDataEpsBank::*;
4972        match self {
4973            ArzteUndApothekerBank => "arzte_und_apotheker_bank",
4974            AustrianAnadiBankAg => "austrian_anadi_bank_ag",
4975            BankAustria => "bank_austria",
4976            BankhausCarlSpangler => "bankhaus_carl_spangler",
4977            BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag",
4978            BawagPskAg => "bawag_psk_ag",
4979            BksBankAg => "bks_bank_ag",
4980            BrullKallmusBankAg => "brull_kallmus_bank_ag",
4981            BtvVierLanderBank => "btv_vier_lander_bank",
4982            CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
4983            DeutscheBankAg => "deutsche_bank_ag",
4984            Dolomitenbank => "dolomitenbank",
4985            EasybankAg => "easybank_ag",
4986            ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
4987            HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag",
4988            HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft",
4989            HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien",
4990            HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark",
4991            HypoTirolBankAg => "hypo_tirol_bank_ag",
4992            HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
4993            MarchfelderBank => "marchfelder_bank",
4994            OberbankAg => "oberbank_ag",
4995            RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich",
4996            SchoellerbankAg => "schoellerbank_ag",
4997            SpardaBankWien => "sparda_bank_wien",
4998            VolksbankGruppe => "volksbank_gruppe",
4999            VolkskreditbankAg => "volkskreditbank_ag",
5000            VrBankBraunau => "vr_bank_braunau",
5001            Unknown(v) => v,
5002        }
5003    }
5004}
5005
5006impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataEpsBank {
5007    type Err = std::convert::Infallible;
5008    fn from_str(s: &str) -> Result<Self, Self::Err> {
5009        use UpdateSetupIntentPaymentMethodDataEpsBank::*;
5010        match s {
5011            "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank),
5012            "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg),
5013            "bank_austria" => Ok(BankAustria),
5014            "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler),
5015            "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg),
5016            "bawag_psk_ag" => Ok(BawagPskAg),
5017            "bks_bank_ag" => Ok(BksBankAg),
5018            "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg),
5019            "btv_vier_lander_bank" => Ok(BtvVierLanderBank),
5020            "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg),
5021            "deutsche_bank_ag" => Ok(DeutscheBankAg),
5022            "dolomitenbank" => Ok(Dolomitenbank),
5023            "easybank_ag" => Ok(EasybankAg),
5024            "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen),
5025            "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg),
5026            "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft),
5027            "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien),
5028            "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark),
5029            "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg),
5030            "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg),
5031            "marchfelder_bank" => Ok(MarchfelderBank),
5032            "oberbank_ag" => Ok(OberbankAg),
5033            "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich),
5034            "schoellerbank_ag" => Ok(SchoellerbankAg),
5035            "sparda_bank_wien" => Ok(SpardaBankWien),
5036            "volksbank_gruppe" => Ok(VolksbankGruppe),
5037            "volkskreditbank_ag" => Ok(VolkskreditbankAg),
5038            "vr_bank_braunau" => Ok(VrBankBraunau),
5039            v => Ok(Unknown(v.to_owned())),
5040        }
5041    }
5042}
5043impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataEpsBank {
5044    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5045        f.write_str(self.as_str())
5046    }
5047}
5048
5049impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataEpsBank {
5050    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5051        f.write_str(self.as_str())
5052    }
5053}
5054impl serde::Serialize for UpdateSetupIntentPaymentMethodDataEpsBank {
5055    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5056    where
5057        S: serde::Serializer,
5058    {
5059        serializer.serialize_str(self.as_str())
5060    }
5061}
5062#[cfg(feature = "deserialize")]
5063impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataEpsBank {
5064    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5065        use std::str::FromStr;
5066        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5067        Ok(Self::from_str(&s).unwrap())
5068    }
5069}
5070/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
5071#[derive(Clone, Debug, serde::Serialize)]
5072pub struct UpdateSetupIntentPaymentMethodDataFpx {
5073    /// Account holder type for FPX transaction
5074    #[serde(skip_serializing_if = "Option::is_none")]
5075    pub account_holder_type: Option<UpdateSetupIntentPaymentMethodDataFpxAccountHolderType>,
5076    /// The customer's bank.
5077    pub bank: UpdateSetupIntentPaymentMethodDataFpxBank,
5078}
5079impl UpdateSetupIntentPaymentMethodDataFpx {
5080    pub fn new(bank: impl Into<UpdateSetupIntentPaymentMethodDataFpxBank>) -> Self {
5081        Self { account_holder_type: None, bank: bank.into() }
5082    }
5083}
5084/// Account holder type for FPX transaction
5085#[derive(Copy, Clone, Eq, PartialEq)]
5086pub enum UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5087    Company,
5088    Individual,
5089}
5090impl UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5091    pub fn as_str(self) -> &'static str {
5092        use UpdateSetupIntentPaymentMethodDataFpxAccountHolderType::*;
5093        match self {
5094            Company => "company",
5095            Individual => "individual",
5096        }
5097    }
5098}
5099
5100impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5101    type Err = stripe_types::StripeParseError;
5102    fn from_str(s: &str) -> Result<Self, Self::Err> {
5103        use UpdateSetupIntentPaymentMethodDataFpxAccountHolderType::*;
5104        match s {
5105            "company" => Ok(Company),
5106            "individual" => Ok(Individual),
5107            _ => Err(stripe_types::StripeParseError),
5108        }
5109    }
5110}
5111impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5112    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5113        f.write_str(self.as_str())
5114    }
5115}
5116
5117impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5118    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5119        f.write_str(self.as_str())
5120    }
5121}
5122impl serde::Serialize for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5123    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5124    where
5125        S: serde::Serializer,
5126    {
5127        serializer.serialize_str(self.as_str())
5128    }
5129}
5130#[cfg(feature = "deserialize")]
5131impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
5132    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5133        use std::str::FromStr;
5134        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5135        Self::from_str(&s).map_err(|_| {
5136            serde::de::Error::custom(
5137                "Unknown value for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType",
5138            )
5139        })
5140    }
5141}
5142/// The customer's bank.
5143#[derive(Clone, Eq, PartialEq)]
5144#[non_exhaustive]
5145pub enum UpdateSetupIntentPaymentMethodDataFpxBank {
5146    AffinBank,
5147    Agrobank,
5148    AllianceBank,
5149    Ambank,
5150    BankIslam,
5151    BankMuamalat,
5152    BankOfChina,
5153    BankRakyat,
5154    Bsn,
5155    Cimb,
5156    DeutscheBank,
5157    HongLeongBank,
5158    Hsbc,
5159    Kfh,
5160    Maybank2e,
5161    Maybank2u,
5162    Ocbc,
5163    PbEnterprise,
5164    PublicBank,
5165    Rhb,
5166    StandardChartered,
5167    Uob,
5168    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5169    Unknown(String),
5170}
5171impl UpdateSetupIntentPaymentMethodDataFpxBank {
5172    pub fn as_str(&self) -> &str {
5173        use UpdateSetupIntentPaymentMethodDataFpxBank::*;
5174        match self {
5175            AffinBank => "affin_bank",
5176            Agrobank => "agrobank",
5177            AllianceBank => "alliance_bank",
5178            Ambank => "ambank",
5179            BankIslam => "bank_islam",
5180            BankMuamalat => "bank_muamalat",
5181            BankOfChina => "bank_of_china",
5182            BankRakyat => "bank_rakyat",
5183            Bsn => "bsn",
5184            Cimb => "cimb",
5185            DeutscheBank => "deutsche_bank",
5186            HongLeongBank => "hong_leong_bank",
5187            Hsbc => "hsbc",
5188            Kfh => "kfh",
5189            Maybank2e => "maybank2e",
5190            Maybank2u => "maybank2u",
5191            Ocbc => "ocbc",
5192            PbEnterprise => "pb_enterprise",
5193            PublicBank => "public_bank",
5194            Rhb => "rhb",
5195            StandardChartered => "standard_chartered",
5196            Uob => "uob",
5197            Unknown(v) => v,
5198        }
5199    }
5200}
5201
5202impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataFpxBank {
5203    type Err = std::convert::Infallible;
5204    fn from_str(s: &str) -> Result<Self, Self::Err> {
5205        use UpdateSetupIntentPaymentMethodDataFpxBank::*;
5206        match s {
5207            "affin_bank" => Ok(AffinBank),
5208            "agrobank" => Ok(Agrobank),
5209            "alliance_bank" => Ok(AllianceBank),
5210            "ambank" => Ok(Ambank),
5211            "bank_islam" => Ok(BankIslam),
5212            "bank_muamalat" => Ok(BankMuamalat),
5213            "bank_of_china" => Ok(BankOfChina),
5214            "bank_rakyat" => Ok(BankRakyat),
5215            "bsn" => Ok(Bsn),
5216            "cimb" => Ok(Cimb),
5217            "deutsche_bank" => Ok(DeutscheBank),
5218            "hong_leong_bank" => Ok(HongLeongBank),
5219            "hsbc" => Ok(Hsbc),
5220            "kfh" => Ok(Kfh),
5221            "maybank2e" => Ok(Maybank2e),
5222            "maybank2u" => Ok(Maybank2u),
5223            "ocbc" => Ok(Ocbc),
5224            "pb_enterprise" => Ok(PbEnterprise),
5225            "public_bank" => Ok(PublicBank),
5226            "rhb" => Ok(Rhb),
5227            "standard_chartered" => Ok(StandardChartered),
5228            "uob" => Ok(Uob),
5229            v => Ok(Unknown(v.to_owned())),
5230        }
5231    }
5232}
5233impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataFpxBank {
5234    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5235        f.write_str(self.as_str())
5236    }
5237}
5238
5239impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataFpxBank {
5240    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5241        f.write_str(self.as_str())
5242    }
5243}
5244impl serde::Serialize for UpdateSetupIntentPaymentMethodDataFpxBank {
5245    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5246    where
5247        S: serde::Serializer,
5248    {
5249        serializer.serialize_str(self.as_str())
5250    }
5251}
5252#[cfg(feature = "deserialize")]
5253impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataFpxBank {
5254    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5255        use std::str::FromStr;
5256        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5257        Ok(Self::from_str(&s).unwrap())
5258    }
5259}
5260/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
5261#[derive(Clone, Debug, serde::Serialize)]
5262pub struct UpdateSetupIntentPaymentMethodDataIdeal {
5263    /// The customer's bank.
5264    /// Only use this parameter for existing customers.
5265    /// Don't use it for new customers.
5266    #[serde(skip_serializing_if = "Option::is_none")]
5267    pub bank: Option<UpdateSetupIntentPaymentMethodDataIdealBank>,
5268}
5269impl UpdateSetupIntentPaymentMethodDataIdeal {
5270    pub fn new() -> Self {
5271        Self { bank: None }
5272    }
5273}
5274impl Default for UpdateSetupIntentPaymentMethodDataIdeal {
5275    fn default() -> Self {
5276        Self::new()
5277    }
5278}
5279/// The customer's bank.
5280/// Only use this parameter for existing customers.
5281/// Don't use it for new customers.
5282#[derive(Clone, Eq, PartialEq)]
5283#[non_exhaustive]
5284pub enum UpdateSetupIntentPaymentMethodDataIdealBank {
5285    AbnAmro,
5286    AsnBank,
5287    Bunq,
5288    Buut,
5289    Handelsbanken,
5290    Ing,
5291    Knab,
5292    Moneyou,
5293    N26,
5294    Nn,
5295    Rabobank,
5296    Regiobank,
5297    Revolut,
5298    SnsBank,
5299    TriodosBank,
5300    VanLanschot,
5301    Yoursafe,
5302    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5303    Unknown(String),
5304}
5305impl UpdateSetupIntentPaymentMethodDataIdealBank {
5306    pub fn as_str(&self) -> &str {
5307        use UpdateSetupIntentPaymentMethodDataIdealBank::*;
5308        match self {
5309            AbnAmro => "abn_amro",
5310            AsnBank => "asn_bank",
5311            Bunq => "bunq",
5312            Buut => "buut",
5313            Handelsbanken => "handelsbanken",
5314            Ing => "ing",
5315            Knab => "knab",
5316            Moneyou => "moneyou",
5317            N26 => "n26",
5318            Nn => "nn",
5319            Rabobank => "rabobank",
5320            Regiobank => "regiobank",
5321            Revolut => "revolut",
5322            SnsBank => "sns_bank",
5323            TriodosBank => "triodos_bank",
5324            VanLanschot => "van_lanschot",
5325            Yoursafe => "yoursafe",
5326            Unknown(v) => v,
5327        }
5328    }
5329}
5330
5331impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataIdealBank {
5332    type Err = std::convert::Infallible;
5333    fn from_str(s: &str) -> Result<Self, Self::Err> {
5334        use UpdateSetupIntentPaymentMethodDataIdealBank::*;
5335        match s {
5336            "abn_amro" => Ok(AbnAmro),
5337            "asn_bank" => Ok(AsnBank),
5338            "bunq" => Ok(Bunq),
5339            "buut" => Ok(Buut),
5340            "handelsbanken" => Ok(Handelsbanken),
5341            "ing" => Ok(Ing),
5342            "knab" => Ok(Knab),
5343            "moneyou" => Ok(Moneyou),
5344            "n26" => Ok(N26),
5345            "nn" => Ok(Nn),
5346            "rabobank" => Ok(Rabobank),
5347            "regiobank" => Ok(Regiobank),
5348            "revolut" => Ok(Revolut),
5349            "sns_bank" => Ok(SnsBank),
5350            "triodos_bank" => Ok(TriodosBank),
5351            "van_lanschot" => Ok(VanLanschot),
5352            "yoursafe" => Ok(Yoursafe),
5353            v => Ok(Unknown(v.to_owned())),
5354        }
5355    }
5356}
5357impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataIdealBank {
5358    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5359        f.write_str(self.as_str())
5360    }
5361}
5362
5363impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataIdealBank {
5364    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5365        f.write_str(self.as_str())
5366    }
5367}
5368impl serde::Serialize for UpdateSetupIntentPaymentMethodDataIdealBank {
5369    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5370    where
5371        S: serde::Serializer,
5372    {
5373        serializer.serialize_str(self.as_str())
5374    }
5375}
5376#[cfg(feature = "deserialize")]
5377impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataIdealBank {
5378    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5379        use std::str::FromStr;
5380        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5381        Ok(Self::from_str(&s).unwrap())
5382    }
5383}
5384/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
5385#[derive(Copy, Clone, Debug, serde::Serialize)]
5386pub struct UpdateSetupIntentPaymentMethodDataKlarna {
5387    /// Customer's date of birth
5388    #[serde(skip_serializing_if = "Option::is_none")]
5389    pub dob: Option<DateOfBirth>,
5390}
5391impl UpdateSetupIntentPaymentMethodDataKlarna {
5392    pub fn new() -> Self {
5393        Self { dob: None }
5394    }
5395}
5396impl Default for UpdateSetupIntentPaymentMethodDataKlarna {
5397    fn default() -> Self {
5398        Self::new()
5399    }
5400}
5401/// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
5402#[derive(Copy, Clone, Debug, serde::Serialize)]
5403pub struct UpdateSetupIntentPaymentMethodDataNaverPay {
5404    /// Whether to use Naver Pay points or a card to fund this transaction.
5405    /// If not provided, this defaults to `card`.
5406    #[serde(skip_serializing_if = "Option::is_none")]
5407    pub funding: Option<UpdateSetupIntentPaymentMethodDataNaverPayFunding>,
5408}
5409impl UpdateSetupIntentPaymentMethodDataNaverPay {
5410    pub fn new() -> Self {
5411        Self { funding: None }
5412    }
5413}
5414impl Default for UpdateSetupIntentPaymentMethodDataNaverPay {
5415    fn default() -> Self {
5416        Self::new()
5417    }
5418}
5419/// Whether to use Naver Pay points or a card to fund this transaction.
5420/// If not provided, this defaults to `card`.
5421#[derive(Copy, Clone, Eq, PartialEq)]
5422pub enum UpdateSetupIntentPaymentMethodDataNaverPayFunding {
5423    Card,
5424    Points,
5425}
5426impl UpdateSetupIntentPaymentMethodDataNaverPayFunding {
5427    pub fn as_str(self) -> &'static str {
5428        use UpdateSetupIntentPaymentMethodDataNaverPayFunding::*;
5429        match self {
5430            Card => "card",
5431            Points => "points",
5432        }
5433    }
5434}
5435
5436impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
5437    type Err = stripe_types::StripeParseError;
5438    fn from_str(s: &str) -> Result<Self, Self::Err> {
5439        use UpdateSetupIntentPaymentMethodDataNaverPayFunding::*;
5440        match s {
5441            "card" => Ok(Card),
5442            "points" => Ok(Points),
5443            _ => Err(stripe_types::StripeParseError),
5444        }
5445    }
5446}
5447impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
5448    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5449        f.write_str(self.as_str())
5450    }
5451}
5452
5453impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
5454    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5455        f.write_str(self.as_str())
5456    }
5457}
5458impl serde::Serialize for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
5459    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5460    where
5461        S: serde::Serializer,
5462    {
5463        serializer.serialize_str(self.as_str())
5464    }
5465}
5466#[cfg(feature = "deserialize")]
5467impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
5468    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5469        use std::str::FromStr;
5470        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5471        Self::from_str(&s).map_err(|_| {
5472            serde::de::Error::custom(
5473                "Unknown value for UpdateSetupIntentPaymentMethodDataNaverPayFunding",
5474            )
5475        })
5476    }
5477}
5478/// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
5479#[derive(Clone, Debug, serde::Serialize)]
5480pub struct UpdateSetupIntentPaymentMethodDataNzBankAccount {
5481    /// The name on the bank account.
5482    /// Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod’s billing details.
5483    #[serde(skip_serializing_if = "Option::is_none")]
5484    pub account_holder_name: Option<String>,
5485    /// The account number for the bank account.
5486    pub account_number: String,
5487    /// The numeric code for the bank account's bank.
5488    pub bank_code: String,
5489    /// The numeric code for the bank account's bank branch.
5490    pub branch_code: String,
5491    #[serde(skip_serializing_if = "Option::is_none")]
5492    pub reference: Option<String>,
5493    /// The suffix of the bank account number.
5494    pub suffix: String,
5495}
5496impl UpdateSetupIntentPaymentMethodDataNzBankAccount {
5497    pub fn new(
5498        account_number: impl Into<String>,
5499        bank_code: impl Into<String>,
5500        branch_code: impl Into<String>,
5501        suffix: impl Into<String>,
5502    ) -> Self {
5503        Self {
5504            account_holder_name: None,
5505            account_number: account_number.into(),
5506            bank_code: bank_code.into(),
5507            branch_code: branch_code.into(),
5508            reference: None,
5509            suffix: suffix.into(),
5510        }
5511    }
5512}
5513/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
5514#[derive(Clone, Debug, serde::Serialize)]
5515pub struct UpdateSetupIntentPaymentMethodDataP24 {
5516    /// The customer's bank.
5517    #[serde(skip_serializing_if = "Option::is_none")]
5518    pub bank: Option<UpdateSetupIntentPaymentMethodDataP24Bank>,
5519}
5520impl UpdateSetupIntentPaymentMethodDataP24 {
5521    pub fn new() -> Self {
5522        Self { bank: None }
5523    }
5524}
5525impl Default for UpdateSetupIntentPaymentMethodDataP24 {
5526    fn default() -> Self {
5527        Self::new()
5528    }
5529}
5530/// The customer's bank.
5531#[derive(Clone, Eq, PartialEq)]
5532#[non_exhaustive]
5533pub enum UpdateSetupIntentPaymentMethodDataP24Bank {
5534    AliorBank,
5535    BankMillennium,
5536    BankNowyBfgSa,
5537    BankPekaoSa,
5538    BankiSpbdzielcze,
5539    Blik,
5540    BnpParibas,
5541    Boz,
5542    CitiHandlowy,
5543    CreditAgricole,
5544    Envelobank,
5545    EtransferPocztowy24,
5546    GetinBank,
5547    Ideabank,
5548    Ing,
5549    Inteligo,
5550    MbankMtransfer,
5551    NestPrzelew,
5552    NoblePay,
5553    PbacZIpko,
5554    PlusBank,
5555    SantanderPrzelew24,
5556    TmobileUsbugiBankowe,
5557    ToyotaBank,
5558    Velobank,
5559    VolkswagenBank,
5560    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5561    Unknown(String),
5562}
5563impl UpdateSetupIntentPaymentMethodDataP24Bank {
5564    pub fn as_str(&self) -> &str {
5565        use UpdateSetupIntentPaymentMethodDataP24Bank::*;
5566        match self {
5567            AliorBank => "alior_bank",
5568            BankMillennium => "bank_millennium",
5569            BankNowyBfgSa => "bank_nowy_bfg_sa",
5570            BankPekaoSa => "bank_pekao_sa",
5571            BankiSpbdzielcze => "banki_spbdzielcze",
5572            Blik => "blik",
5573            BnpParibas => "bnp_paribas",
5574            Boz => "boz",
5575            CitiHandlowy => "citi_handlowy",
5576            CreditAgricole => "credit_agricole",
5577            Envelobank => "envelobank",
5578            EtransferPocztowy24 => "etransfer_pocztowy24",
5579            GetinBank => "getin_bank",
5580            Ideabank => "ideabank",
5581            Ing => "ing",
5582            Inteligo => "inteligo",
5583            MbankMtransfer => "mbank_mtransfer",
5584            NestPrzelew => "nest_przelew",
5585            NoblePay => "noble_pay",
5586            PbacZIpko => "pbac_z_ipko",
5587            PlusBank => "plus_bank",
5588            SantanderPrzelew24 => "santander_przelew24",
5589            TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
5590            ToyotaBank => "toyota_bank",
5591            Velobank => "velobank",
5592            VolkswagenBank => "volkswagen_bank",
5593            Unknown(v) => v,
5594        }
5595    }
5596}
5597
5598impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataP24Bank {
5599    type Err = std::convert::Infallible;
5600    fn from_str(s: &str) -> Result<Self, Self::Err> {
5601        use UpdateSetupIntentPaymentMethodDataP24Bank::*;
5602        match s {
5603            "alior_bank" => Ok(AliorBank),
5604            "bank_millennium" => Ok(BankMillennium),
5605            "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa),
5606            "bank_pekao_sa" => Ok(BankPekaoSa),
5607            "banki_spbdzielcze" => Ok(BankiSpbdzielcze),
5608            "blik" => Ok(Blik),
5609            "bnp_paribas" => Ok(BnpParibas),
5610            "boz" => Ok(Boz),
5611            "citi_handlowy" => Ok(CitiHandlowy),
5612            "credit_agricole" => Ok(CreditAgricole),
5613            "envelobank" => Ok(Envelobank),
5614            "etransfer_pocztowy24" => Ok(EtransferPocztowy24),
5615            "getin_bank" => Ok(GetinBank),
5616            "ideabank" => Ok(Ideabank),
5617            "ing" => Ok(Ing),
5618            "inteligo" => Ok(Inteligo),
5619            "mbank_mtransfer" => Ok(MbankMtransfer),
5620            "nest_przelew" => Ok(NestPrzelew),
5621            "noble_pay" => Ok(NoblePay),
5622            "pbac_z_ipko" => Ok(PbacZIpko),
5623            "plus_bank" => Ok(PlusBank),
5624            "santander_przelew24" => Ok(SantanderPrzelew24),
5625            "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe),
5626            "toyota_bank" => Ok(ToyotaBank),
5627            "velobank" => Ok(Velobank),
5628            "volkswagen_bank" => Ok(VolkswagenBank),
5629            v => Ok(Unknown(v.to_owned())),
5630        }
5631    }
5632}
5633impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataP24Bank {
5634    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5635        f.write_str(self.as_str())
5636    }
5637}
5638
5639impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataP24Bank {
5640    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5641        f.write_str(self.as_str())
5642    }
5643}
5644impl serde::Serialize for UpdateSetupIntentPaymentMethodDataP24Bank {
5645    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5646    where
5647        S: serde::Serializer,
5648    {
5649        serializer.serialize_str(self.as_str())
5650    }
5651}
5652#[cfg(feature = "deserialize")]
5653impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataP24Bank {
5654    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5655        use std::str::FromStr;
5656        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5657        Ok(Self::from_str(&s).unwrap())
5658    }
5659}
5660/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
5661#[derive(Clone, Debug, serde::Serialize)]
5662pub struct UpdateSetupIntentPaymentMethodDataSepaDebit {
5663    /// IBAN of the bank account.
5664    pub iban: String,
5665}
5666impl UpdateSetupIntentPaymentMethodDataSepaDebit {
5667    pub fn new(iban: impl Into<String>) -> Self {
5668        Self { iban: iban.into() }
5669    }
5670}
5671/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
5672#[derive(Copy, Clone, Debug, serde::Serialize)]
5673pub struct UpdateSetupIntentPaymentMethodDataSofort {
5674    /// Two-letter ISO code representing the country the bank account is located in.
5675    pub country: UpdateSetupIntentPaymentMethodDataSofortCountry,
5676}
5677impl UpdateSetupIntentPaymentMethodDataSofort {
5678    pub fn new(country: impl Into<UpdateSetupIntentPaymentMethodDataSofortCountry>) -> Self {
5679        Self { country: country.into() }
5680    }
5681}
5682/// Two-letter ISO code representing the country the bank account is located in.
5683#[derive(Copy, Clone, Eq, PartialEq)]
5684pub enum UpdateSetupIntentPaymentMethodDataSofortCountry {
5685    At,
5686    Be,
5687    De,
5688    Es,
5689    It,
5690    Nl,
5691}
5692impl UpdateSetupIntentPaymentMethodDataSofortCountry {
5693    pub fn as_str(self) -> &'static str {
5694        use UpdateSetupIntentPaymentMethodDataSofortCountry::*;
5695        match self {
5696            At => "AT",
5697            Be => "BE",
5698            De => "DE",
5699            Es => "ES",
5700            It => "IT",
5701            Nl => "NL",
5702        }
5703    }
5704}
5705
5706impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataSofortCountry {
5707    type Err = stripe_types::StripeParseError;
5708    fn from_str(s: &str) -> Result<Self, Self::Err> {
5709        use UpdateSetupIntentPaymentMethodDataSofortCountry::*;
5710        match s {
5711            "AT" => Ok(At),
5712            "BE" => Ok(Be),
5713            "DE" => Ok(De),
5714            "ES" => Ok(Es),
5715            "IT" => Ok(It),
5716            "NL" => Ok(Nl),
5717            _ => Err(stripe_types::StripeParseError),
5718        }
5719    }
5720}
5721impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataSofortCountry {
5722    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5723        f.write_str(self.as_str())
5724    }
5725}
5726
5727impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataSofortCountry {
5728    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5729        f.write_str(self.as_str())
5730    }
5731}
5732impl serde::Serialize for UpdateSetupIntentPaymentMethodDataSofortCountry {
5733    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5734    where
5735        S: serde::Serializer,
5736    {
5737        serializer.serialize_str(self.as_str())
5738    }
5739}
5740#[cfg(feature = "deserialize")]
5741impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataSofortCountry {
5742    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5743        use std::str::FromStr;
5744        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5745        Self::from_str(&s).map_err(|_| {
5746            serde::de::Error::custom(
5747                "Unknown value for UpdateSetupIntentPaymentMethodDataSofortCountry",
5748            )
5749        })
5750    }
5751}
5752/// The type of the PaymentMethod.
5753/// An additional hash is included on the PaymentMethod with a name matching this value.
5754/// It contains additional information specific to the PaymentMethod type.
5755#[derive(Clone, Eq, PartialEq)]
5756#[non_exhaustive]
5757pub enum UpdateSetupIntentPaymentMethodDataType {
5758    AcssDebit,
5759    Affirm,
5760    AfterpayClearpay,
5761    Alipay,
5762    Alma,
5763    AmazonPay,
5764    AuBecsDebit,
5765    BacsDebit,
5766    Bancontact,
5767    Billie,
5768    Blik,
5769    Boleto,
5770    Cashapp,
5771    Crypto,
5772    CustomerBalance,
5773    Eps,
5774    Fpx,
5775    Giropay,
5776    Grabpay,
5777    Ideal,
5778    KakaoPay,
5779    Klarna,
5780    Konbini,
5781    KrCard,
5782    Link,
5783    MbWay,
5784    Mobilepay,
5785    Multibanco,
5786    NaverPay,
5787    NzBankAccount,
5788    Oxxo,
5789    P24,
5790    PayByBank,
5791    Payco,
5792    Paynow,
5793    Paypal,
5794    Pix,
5795    Promptpay,
5796    RevolutPay,
5797    SamsungPay,
5798    Satispay,
5799    SepaDebit,
5800    Sofort,
5801    Swish,
5802    Twint,
5803    UsBankAccount,
5804    WechatPay,
5805    Zip,
5806    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5807    Unknown(String),
5808}
5809impl UpdateSetupIntentPaymentMethodDataType {
5810    pub fn as_str(&self) -> &str {
5811        use UpdateSetupIntentPaymentMethodDataType::*;
5812        match self {
5813            AcssDebit => "acss_debit",
5814            Affirm => "affirm",
5815            AfterpayClearpay => "afterpay_clearpay",
5816            Alipay => "alipay",
5817            Alma => "alma",
5818            AmazonPay => "amazon_pay",
5819            AuBecsDebit => "au_becs_debit",
5820            BacsDebit => "bacs_debit",
5821            Bancontact => "bancontact",
5822            Billie => "billie",
5823            Blik => "blik",
5824            Boleto => "boleto",
5825            Cashapp => "cashapp",
5826            Crypto => "crypto",
5827            CustomerBalance => "customer_balance",
5828            Eps => "eps",
5829            Fpx => "fpx",
5830            Giropay => "giropay",
5831            Grabpay => "grabpay",
5832            Ideal => "ideal",
5833            KakaoPay => "kakao_pay",
5834            Klarna => "klarna",
5835            Konbini => "konbini",
5836            KrCard => "kr_card",
5837            Link => "link",
5838            MbWay => "mb_way",
5839            Mobilepay => "mobilepay",
5840            Multibanco => "multibanco",
5841            NaverPay => "naver_pay",
5842            NzBankAccount => "nz_bank_account",
5843            Oxxo => "oxxo",
5844            P24 => "p24",
5845            PayByBank => "pay_by_bank",
5846            Payco => "payco",
5847            Paynow => "paynow",
5848            Paypal => "paypal",
5849            Pix => "pix",
5850            Promptpay => "promptpay",
5851            RevolutPay => "revolut_pay",
5852            SamsungPay => "samsung_pay",
5853            Satispay => "satispay",
5854            SepaDebit => "sepa_debit",
5855            Sofort => "sofort",
5856            Swish => "swish",
5857            Twint => "twint",
5858            UsBankAccount => "us_bank_account",
5859            WechatPay => "wechat_pay",
5860            Zip => "zip",
5861            Unknown(v) => v,
5862        }
5863    }
5864}
5865
5866impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataType {
5867    type Err = std::convert::Infallible;
5868    fn from_str(s: &str) -> Result<Self, Self::Err> {
5869        use UpdateSetupIntentPaymentMethodDataType::*;
5870        match s {
5871            "acss_debit" => Ok(AcssDebit),
5872            "affirm" => Ok(Affirm),
5873            "afterpay_clearpay" => Ok(AfterpayClearpay),
5874            "alipay" => Ok(Alipay),
5875            "alma" => Ok(Alma),
5876            "amazon_pay" => Ok(AmazonPay),
5877            "au_becs_debit" => Ok(AuBecsDebit),
5878            "bacs_debit" => Ok(BacsDebit),
5879            "bancontact" => Ok(Bancontact),
5880            "billie" => Ok(Billie),
5881            "blik" => Ok(Blik),
5882            "boleto" => Ok(Boleto),
5883            "cashapp" => Ok(Cashapp),
5884            "crypto" => Ok(Crypto),
5885            "customer_balance" => Ok(CustomerBalance),
5886            "eps" => Ok(Eps),
5887            "fpx" => Ok(Fpx),
5888            "giropay" => Ok(Giropay),
5889            "grabpay" => Ok(Grabpay),
5890            "ideal" => Ok(Ideal),
5891            "kakao_pay" => Ok(KakaoPay),
5892            "klarna" => Ok(Klarna),
5893            "konbini" => Ok(Konbini),
5894            "kr_card" => Ok(KrCard),
5895            "link" => Ok(Link),
5896            "mb_way" => Ok(MbWay),
5897            "mobilepay" => Ok(Mobilepay),
5898            "multibanco" => Ok(Multibanco),
5899            "naver_pay" => Ok(NaverPay),
5900            "nz_bank_account" => Ok(NzBankAccount),
5901            "oxxo" => Ok(Oxxo),
5902            "p24" => Ok(P24),
5903            "pay_by_bank" => Ok(PayByBank),
5904            "payco" => Ok(Payco),
5905            "paynow" => Ok(Paynow),
5906            "paypal" => Ok(Paypal),
5907            "pix" => Ok(Pix),
5908            "promptpay" => Ok(Promptpay),
5909            "revolut_pay" => Ok(RevolutPay),
5910            "samsung_pay" => Ok(SamsungPay),
5911            "satispay" => Ok(Satispay),
5912            "sepa_debit" => Ok(SepaDebit),
5913            "sofort" => Ok(Sofort),
5914            "swish" => Ok(Swish),
5915            "twint" => Ok(Twint),
5916            "us_bank_account" => Ok(UsBankAccount),
5917            "wechat_pay" => Ok(WechatPay),
5918            "zip" => Ok(Zip),
5919            v => Ok(Unknown(v.to_owned())),
5920        }
5921    }
5922}
5923impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataType {
5924    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5925        f.write_str(self.as_str())
5926    }
5927}
5928
5929impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataType {
5930    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5931        f.write_str(self.as_str())
5932    }
5933}
5934impl serde::Serialize for UpdateSetupIntentPaymentMethodDataType {
5935    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5936    where
5937        S: serde::Serializer,
5938    {
5939        serializer.serialize_str(self.as_str())
5940    }
5941}
5942#[cfg(feature = "deserialize")]
5943impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataType {
5944    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5945        use std::str::FromStr;
5946        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5947        Ok(Self::from_str(&s).unwrap())
5948    }
5949}
5950/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
5951#[derive(Clone, Debug, serde::Serialize)]
5952pub struct UpdateSetupIntentPaymentMethodDataUsBankAccount {
5953    /// Account holder type: individual or company.
5954    #[serde(skip_serializing_if = "Option::is_none")]
5955    pub account_holder_type:
5956        Option<UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType>,
5957    /// Account number of the bank account.
5958    #[serde(skip_serializing_if = "Option::is_none")]
5959    pub account_number: Option<String>,
5960    /// Account type: checkings or savings. Defaults to checking if omitted.
5961    #[serde(skip_serializing_if = "Option::is_none")]
5962    pub account_type: Option<UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType>,
5963    /// The ID of a Financial Connections Account to use as a payment method.
5964    #[serde(skip_serializing_if = "Option::is_none")]
5965    pub financial_connections_account: Option<String>,
5966    /// Routing number of the bank account.
5967    #[serde(skip_serializing_if = "Option::is_none")]
5968    pub routing_number: Option<String>,
5969}
5970impl UpdateSetupIntentPaymentMethodDataUsBankAccount {
5971    pub fn new() -> Self {
5972        Self {
5973            account_holder_type: None,
5974            account_number: None,
5975            account_type: None,
5976            financial_connections_account: None,
5977            routing_number: None,
5978        }
5979    }
5980}
5981impl Default for UpdateSetupIntentPaymentMethodDataUsBankAccount {
5982    fn default() -> Self {
5983        Self::new()
5984    }
5985}
5986/// Account holder type: individual or company.
5987#[derive(Copy, Clone, Eq, PartialEq)]
5988pub enum UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
5989    Company,
5990    Individual,
5991}
5992impl UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
5993    pub fn as_str(self) -> &'static str {
5994        use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
5995        match self {
5996            Company => "company",
5997            Individual => "individual",
5998        }
5999    }
6000}
6001
6002impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
6003    type Err = stripe_types::StripeParseError;
6004    fn from_str(s: &str) -> Result<Self, Self::Err> {
6005        use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
6006        match s {
6007            "company" => Ok(Company),
6008            "individual" => Ok(Individual),
6009            _ => Err(stripe_types::StripeParseError),
6010        }
6011    }
6012}
6013impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
6014    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6015        f.write_str(self.as_str())
6016    }
6017}
6018
6019impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
6020    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6021        f.write_str(self.as_str())
6022    }
6023}
6024impl serde::Serialize for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
6025    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6026    where
6027        S: serde::Serializer,
6028    {
6029        serializer.serialize_str(self.as_str())
6030    }
6031}
6032#[cfg(feature = "deserialize")]
6033impl<'de> serde::Deserialize<'de>
6034    for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType
6035{
6036    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6037        use std::str::FromStr;
6038        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6039        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType"))
6040    }
6041}
6042/// Account type: checkings or savings. Defaults to checking if omitted.
6043#[derive(Copy, Clone, Eq, PartialEq)]
6044pub enum UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6045    Checking,
6046    Savings,
6047}
6048impl UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6049    pub fn as_str(self) -> &'static str {
6050        use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
6051        match self {
6052            Checking => "checking",
6053            Savings => "savings",
6054        }
6055    }
6056}
6057
6058impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6059    type Err = stripe_types::StripeParseError;
6060    fn from_str(s: &str) -> Result<Self, Self::Err> {
6061        use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
6062        match s {
6063            "checking" => Ok(Checking),
6064            "savings" => Ok(Savings),
6065            _ => Err(stripe_types::StripeParseError),
6066        }
6067    }
6068}
6069impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6070    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6071        f.write_str(self.as_str())
6072    }
6073}
6074
6075impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6076    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6077        f.write_str(self.as_str())
6078    }
6079}
6080impl serde::Serialize for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6081    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6082    where
6083        S: serde::Serializer,
6084    {
6085        serializer.serialize_str(self.as_str())
6086    }
6087}
6088#[cfg(feature = "deserialize")]
6089impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
6090    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6091        use std::str::FromStr;
6092        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6093        Self::from_str(&s).map_err(|_| {
6094            serde::de::Error::custom(
6095                "Unknown value for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType",
6096            )
6097        })
6098    }
6099}
6100/// Payment method-specific configuration for this SetupIntent.
6101#[derive(Clone, Debug, serde::Serialize)]
6102pub struct UpdateSetupIntentPaymentMethodOptions {
6103    /// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options.
6104    #[serde(skip_serializing_if = "Option::is_none")]
6105    pub acss_debit: Option<UpdateSetupIntentPaymentMethodOptionsAcssDebit>,
6106    /// If this is a `amazon_pay` SetupIntent, this sub-hash contains details about the AmazonPay payment method options.
6107    #[serde(skip_serializing_if = "Option::is_none")]
6108    #[serde(with = "stripe_types::with_serde_json_opt")]
6109    pub amazon_pay: Option<miniserde::json::Value>,
6110    /// If this is a `bacs_debit` SetupIntent, this sub-hash contains details about the Bacs Debit payment method options.
6111    #[serde(skip_serializing_if = "Option::is_none")]
6112    pub bacs_debit: Option<UpdateSetupIntentPaymentMethodOptionsBacsDebit>,
6113    /// Configuration for any card setup attempted on this SetupIntent.
6114    #[serde(skip_serializing_if = "Option::is_none")]
6115    pub card: Option<UpdateSetupIntentPaymentMethodOptionsCard>,
6116    /// If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options.
6117    #[serde(skip_serializing_if = "Option::is_none")]
6118    #[serde(with = "stripe_types::with_serde_json_opt")]
6119    pub card_present: Option<miniserde::json::Value>,
6120    /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options.
6121    #[serde(skip_serializing_if = "Option::is_none")]
6122    pub klarna: Option<UpdateSetupIntentPaymentMethodOptionsKlarna>,
6123    /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
6124    #[serde(skip_serializing_if = "Option::is_none")]
6125    pub link: Option<SetupIntentPaymentMethodOptionsParam>,
6126    /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
6127    #[serde(skip_serializing_if = "Option::is_none")]
6128    pub paypal: Option<PaymentMethodOptionsParam>,
6129    /// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options.
6130    #[serde(skip_serializing_if = "Option::is_none")]
6131    pub sepa_debit: Option<UpdateSetupIntentPaymentMethodOptionsSepaDebit>,
6132    /// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options.
6133    #[serde(skip_serializing_if = "Option::is_none")]
6134    pub us_bank_account: Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccount>,
6135}
6136impl UpdateSetupIntentPaymentMethodOptions {
6137    pub fn new() -> Self {
6138        Self {
6139            acss_debit: None,
6140            amazon_pay: None,
6141            bacs_debit: None,
6142            card: None,
6143            card_present: None,
6144            klarna: None,
6145            link: None,
6146            paypal: None,
6147            sepa_debit: None,
6148            us_bank_account: None,
6149        }
6150    }
6151}
6152impl Default for UpdateSetupIntentPaymentMethodOptions {
6153    fn default() -> Self {
6154        Self::new()
6155    }
6156}
6157/// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options.
6158#[derive(Clone, Debug, serde::Serialize)]
6159pub struct UpdateSetupIntentPaymentMethodOptionsAcssDebit {
6160    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
6161    /// Must be a [supported currency](https://stripe.com/docs/currencies).
6162    #[serde(skip_serializing_if = "Option::is_none")]
6163    pub currency: Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency>,
6164    /// Additional fields for Mandate creation
6165    #[serde(skip_serializing_if = "Option::is_none")]
6166    pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions>,
6167    /// Bank account verification method.
6168    #[serde(skip_serializing_if = "Option::is_none")]
6169    pub verification_method:
6170        Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
6171}
6172impl UpdateSetupIntentPaymentMethodOptionsAcssDebit {
6173    pub fn new() -> Self {
6174        Self { currency: None, mandate_options: None, verification_method: None }
6175    }
6176}
6177impl Default for UpdateSetupIntentPaymentMethodOptionsAcssDebit {
6178    fn default() -> Self {
6179        Self::new()
6180    }
6181}
6182/// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
6183/// Must be a [supported currency](https://stripe.com/docs/currencies).
6184#[derive(Copy, Clone, Eq, PartialEq)]
6185pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
6186    Cad,
6187    Usd,
6188}
6189impl UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
6190    pub fn as_str(self) -> &'static str {
6191        use UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
6192        match self {
6193            Cad => "cad",
6194            Usd => "usd",
6195        }
6196    }
6197}
6198
6199impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
6200    type Err = stripe_types::StripeParseError;
6201    fn from_str(s: &str) -> Result<Self, Self::Err> {
6202        use UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
6203        match s {
6204            "cad" => Ok(Cad),
6205            "usd" => Ok(Usd),
6206            _ => Err(stripe_types::StripeParseError),
6207        }
6208    }
6209}
6210impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
6211    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6212        f.write_str(self.as_str())
6213    }
6214}
6215
6216impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
6217    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6218        f.write_str(self.as_str())
6219    }
6220}
6221impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
6222    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6223    where
6224        S: serde::Serializer,
6225    {
6226        serializer.serialize_str(self.as_str())
6227    }
6228}
6229#[cfg(feature = "deserialize")]
6230impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
6231    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6232        use std::str::FromStr;
6233        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6234        Self::from_str(&s).map_err(|_| {
6235            serde::de::Error::custom(
6236                "Unknown value for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency",
6237            )
6238        })
6239    }
6240}
6241/// Additional fields for Mandate creation
6242#[derive(Clone, Debug, serde::Serialize)]
6243pub struct UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
6244    /// A URL for custom mandate text to render during confirmation step.
6245    /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,.
6246    /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent.
6247    #[serde(skip_serializing_if = "Option::is_none")]
6248    pub custom_mandate_url: Option<String>,
6249    /// List of Stripe products where this mandate can be selected automatically.
6250    #[serde(skip_serializing_if = "Option::is_none")]
6251    pub default_for:
6252        Option<Vec<UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor>>,
6253    /// Description of the mandate interval.
6254    /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'.
6255    #[serde(skip_serializing_if = "Option::is_none")]
6256    pub interval_description: Option<String>,
6257    /// Payment schedule for the mandate.
6258    #[serde(skip_serializing_if = "Option::is_none")]
6259    pub payment_schedule:
6260        Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
6261    /// Transaction type of the mandate.
6262    #[serde(skip_serializing_if = "Option::is_none")]
6263    pub transaction_type:
6264        Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
6265}
6266impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
6267    pub fn new() -> Self {
6268        Self {
6269            custom_mandate_url: None,
6270            default_for: None,
6271            interval_description: None,
6272            payment_schedule: None,
6273            transaction_type: None,
6274        }
6275    }
6276}
6277impl Default for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
6278    fn default() -> Self {
6279        Self::new()
6280    }
6281}
6282/// List of Stripe products where this mandate can be selected automatically.
6283#[derive(Copy, Clone, Eq, PartialEq)]
6284pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
6285    Invoice,
6286    Subscription,
6287}
6288impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
6289    pub fn as_str(self) -> &'static str {
6290        use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
6291        match self {
6292            Invoice => "invoice",
6293            Subscription => "subscription",
6294        }
6295    }
6296}
6297
6298impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
6299    type Err = stripe_types::StripeParseError;
6300    fn from_str(s: &str) -> Result<Self, Self::Err> {
6301        use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
6302        match s {
6303            "invoice" => Ok(Invoice),
6304            "subscription" => Ok(Subscription),
6305            _ => Err(stripe_types::StripeParseError),
6306        }
6307    }
6308}
6309impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
6310    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6311        f.write_str(self.as_str())
6312    }
6313}
6314
6315impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
6316    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6317        f.write_str(self.as_str())
6318    }
6319}
6320impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
6321    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6322    where
6323        S: serde::Serializer,
6324    {
6325        serializer.serialize_str(self.as_str())
6326    }
6327}
6328#[cfg(feature = "deserialize")]
6329impl<'de> serde::Deserialize<'de>
6330    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
6331{
6332    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6333        use std::str::FromStr;
6334        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6335        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor"))
6336    }
6337}
6338/// Payment schedule for the mandate.
6339#[derive(Copy, Clone, Eq, PartialEq)]
6340pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
6341    Combined,
6342    Interval,
6343    Sporadic,
6344}
6345impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
6346    pub fn as_str(self) -> &'static str {
6347        use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
6348        match self {
6349            Combined => "combined",
6350            Interval => "interval",
6351            Sporadic => "sporadic",
6352        }
6353    }
6354}
6355
6356impl std::str::FromStr
6357    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
6358{
6359    type Err = stripe_types::StripeParseError;
6360    fn from_str(s: &str) -> Result<Self, Self::Err> {
6361        use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
6362        match s {
6363            "combined" => Ok(Combined),
6364            "interval" => Ok(Interval),
6365            "sporadic" => Ok(Sporadic),
6366            _ => Err(stripe_types::StripeParseError),
6367        }
6368    }
6369}
6370impl std::fmt::Display
6371    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
6372{
6373    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6374        f.write_str(self.as_str())
6375    }
6376}
6377
6378impl std::fmt::Debug
6379    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
6380{
6381    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6382        f.write_str(self.as_str())
6383    }
6384}
6385impl serde::Serialize
6386    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
6387{
6388    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6389    where
6390        S: serde::Serializer,
6391    {
6392        serializer.serialize_str(self.as_str())
6393    }
6394}
6395#[cfg(feature = "deserialize")]
6396impl<'de> serde::Deserialize<'de>
6397    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
6398{
6399    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6400        use std::str::FromStr;
6401        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6402        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"))
6403    }
6404}
6405/// Transaction type of the mandate.
6406#[derive(Copy, Clone, Eq, PartialEq)]
6407pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
6408    Business,
6409    Personal,
6410}
6411impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
6412    pub fn as_str(self) -> &'static str {
6413        use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
6414        match self {
6415            Business => "business",
6416            Personal => "personal",
6417        }
6418    }
6419}
6420
6421impl std::str::FromStr
6422    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
6423{
6424    type Err = stripe_types::StripeParseError;
6425    fn from_str(s: &str) -> Result<Self, Self::Err> {
6426        use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
6427        match s {
6428            "business" => Ok(Business),
6429            "personal" => Ok(Personal),
6430            _ => Err(stripe_types::StripeParseError),
6431        }
6432    }
6433}
6434impl std::fmt::Display
6435    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
6436{
6437    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6438        f.write_str(self.as_str())
6439    }
6440}
6441
6442impl std::fmt::Debug
6443    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
6444{
6445    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6446        f.write_str(self.as_str())
6447    }
6448}
6449impl serde::Serialize
6450    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
6451{
6452    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6453    where
6454        S: serde::Serializer,
6455    {
6456        serializer.serialize_str(self.as_str())
6457    }
6458}
6459#[cfg(feature = "deserialize")]
6460impl<'de> serde::Deserialize<'de>
6461    for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
6462{
6463    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6464        use std::str::FromStr;
6465        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6466        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"))
6467    }
6468}
6469/// Bank account verification method.
6470#[derive(Copy, Clone, Eq, PartialEq)]
6471pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
6472    Automatic,
6473    Instant,
6474    Microdeposits,
6475}
6476impl UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
6477    pub fn as_str(self) -> &'static str {
6478        use UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
6479        match self {
6480            Automatic => "automatic",
6481            Instant => "instant",
6482            Microdeposits => "microdeposits",
6483        }
6484    }
6485}
6486
6487impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
6488    type Err = stripe_types::StripeParseError;
6489    fn from_str(s: &str) -> Result<Self, Self::Err> {
6490        use UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
6491        match s {
6492            "automatic" => Ok(Automatic),
6493            "instant" => Ok(Instant),
6494            "microdeposits" => Ok(Microdeposits),
6495            _ => Err(stripe_types::StripeParseError),
6496        }
6497    }
6498}
6499impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
6500    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6501        f.write_str(self.as_str())
6502    }
6503}
6504
6505impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
6506    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6507        f.write_str(self.as_str())
6508    }
6509}
6510impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
6511    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6512    where
6513        S: serde::Serializer,
6514    {
6515        serializer.serialize_str(self.as_str())
6516    }
6517}
6518#[cfg(feature = "deserialize")]
6519impl<'de> serde::Deserialize<'de>
6520    for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod
6521{
6522    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6523        use std::str::FromStr;
6524        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6525        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod"))
6526    }
6527}
6528/// If this is a `bacs_debit` SetupIntent, this sub-hash contains details about the Bacs Debit payment method options.
6529#[derive(Clone, Debug, serde::Serialize)]
6530pub struct UpdateSetupIntentPaymentMethodOptionsBacsDebit {
6531    /// Additional fields for Mandate creation
6532    #[serde(skip_serializing_if = "Option::is_none")]
6533    pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
6534}
6535impl UpdateSetupIntentPaymentMethodOptionsBacsDebit {
6536    pub fn new() -> Self {
6537        Self { mandate_options: None }
6538    }
6539}
6540impl Default for UpdateSetupIntentPaymentMethodOptionsBacsDebit {
6541    fn default() -> Self {
6542        Self::new()
6543    }
6544}
6545/// Configuration for any card setup attempted on this SetupIntent.
6546#[derive(Clone, Debug, serde::Serialize)]
6547pub struct UpdateSetupIntentPaymentMethodOptionsCard {
6548    /// Configuration options for setting up an eMandate for cards issued in India.
6549    #[serde(skip_serializing_if = "Option::is_none")]
6550    pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsCardMandateOptions>,
6551    /// When specified, this parameter signals that a card has been collected
6552    /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This
6553    /// parameter can only be provided during confirmation.
6554    #[serde(skip_serializing_if = "Option::is_none")]
6555    pub moto: Option<bool>,
6556    /// Selected network to process this SetupIntent on.
6557    /// Depends on the available networks of the card attached to the SetupIntent.
6558    /// Can be only set confirm-time.
6559    #[serde(skip_serializing_if = "Option::is_none")]
6560    pub network: Option<UpdateSetupIntentPaymentMethodOptionsCardNetwork>,
6561    /// 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).
6562    /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
6563    /// If not provided, this value defaults to `automatic`.
6564    /// 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.
6565    #[serde(skip_serializing_if = "Option::is_none")]
6566    pub request_three_d_secure:
6567        Option<UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure>,
6568    /// If 3D Secure authentication was performed with a third-party provider,
6569    /// the authentication details to use for this setup.
6570    #[serde(skip_serializing_if = "Option::is_none")]
6571    pub three_d_secure: Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure>,
6572}
6573impl UpdateSetupIntentPaymentMethodOptionsCard {
6574    pub fn new() -> Self {
6575        Self {
6576            mandate_options: None,
6577            moto: None,
6578            network: None,
6579            request_three_d_secure: None,
6580            three_d_secure: None,
6581        }
6582    }
6583}
6584impl Default for UpdateSetupIntentPaymentMethodOptionsCard {
6585    fn default() -> Self {
6586        Self::new()
6587    }
6588}
6589/// Configuration options for setting up an eMandate for cards issued in India.
6590#[derive(Clone, Debug, serde::Serialize)]
6591pub struct UpdateSetupIntentPaymentMethodOptionsCardMandateOptions {
6592    /// Amount to be charged for future payments.
6593    pub amount: i64,
6594    /// One of `fixed` or `maximum`.
6595    /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
6596    /// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
6597    pub amount_type: UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType,
6598    /// Currency in which future payments will be charged.
6599    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
6600    /// Must be a [supported currency](https://stripe.com/docs/currencies).
6601    pub currency: stripe_types::Currency,
6602    /// A description of the mandate or subscription that is meant to be displayed to the customer.
6603    #[serde(skip_serializing_if = "Option::is_none")]
6604    pub description: Option<String>,
6605    /// End date of the mandate or subscription.
6606    /// If not provided, the mandate will be active until canceled.
6607    /// If provided, end date should be after start date.
6608    #[serde(skip_serializing_if = "Option::is_none")]
6609    pub end_date: Option<stripe_types::Timestamp>,
6610    /// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
6611    pub interval: UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval,
6612    /// The number of intervals between payments.
6613    /// For example, `interval=month` and `interval_count=3` indicates one payment every three months.
6614    /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).
6615    /// This parameter is optional when `interval=sporadic`.
6616    #[serde(skip_serializing_if = "Option::is_none")]
6617    pub interval_count: Option<u64>,
6618    /// Unique identifier for the mandate or subscription.
6619    pub reference: String,
6620    /// Start date of the mandate or subscription. Start date should not be lesser than yesterday.
6621    pub start_date: stripe_types::Timestamp,
6622    /// Specifies the type of mandates supported. Possible values are `india`.
6623    #[serde(skip_serializing_if = "Option::is_none")]
6624    pub supported_types:
6625        Option<Vec<UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
6626}
6627impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptions {
6628    pub fn new(
6629        amount: impl Into<i64>,
6630        amount_type: impl Into<UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
6631        currency: impl Into<stripe_types::Currency>,
6632        interval: impl Into<UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval>,
6633        reference: impl Into<String>,
6634        start_date: impl Into<stripe_types::Timestamp>,
6635    ) -> Self {
6636        Self {
6637            amount: amount.into(),
6638            amount_type: amount_type.into(),
6639            currency: currency.into(),
6640            description: None,
6641            end_date: None,
6642            interval: interval.into(),
6643            interval_count: None,
6644            reference: reference.into(),
6645            start_date: start_date.into(),
6646            supported_types: None,
6647        }
6648    }
6649}
6650/// One of `fixed` or `maximum`.
6651/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
6652/// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
6653#[derive(Copy, Clone, Eq, PartialEq)]
6654pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
6655    Fixed,
6656    Maximum,
6657}
6658impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
6659    pub fn as_str(self) -> &'static str {
6660        use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
6661        match self {
6662            Fixed => "fixed",
6663            Maximum => "maximum",
6664        }
6665    }
6666}
6667
6668impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
6669    type Err = stripe_types::StripeParseError;
6670    fn from_str(s: &str) -> Result<Self, Self::Err> {
6671        use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
6672        match s {
6673            "fixed" => Ok(Fixed),
6674            "maximum" => Ok(Maximum),
6675            _ => Err(stripe_types::StripeParseError),
6676        }
6677    }
6678}
6679impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
6680    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6681        f.write_str(self.as_str())
6682    }
6683}
6684
6685impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
6686    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6687        f.write_str(self.as_str())
6688    }
6689}
6690impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
6691    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6692    where
6693        S: serde::Serializer,
6694    {
6695        serializer.serialize_str(self.as_str())
6696    }
6697}
6698#[cfg(feature = "deserialize")]
6699impl<'de> serde::Deserialize<'de>
6700    for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType
6701{
6702    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6703        use std::str::FromStr;
6704        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6705        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType"))
6706    }
6707}
6708/// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
6709#[derive(Copy, Clone, Eq, PartialEq)]
6710pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
6711    Day,
6712    Month,
6713    Sporadic,
6714    Week,
6715    Year,
6716}
6717impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
6718    pub fn as_str(self) -> &'static str {
6719        use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
6720        match self {
6721            Day => "day",
6722            Month => "month",
6723            Sporadic => "sporadic",
6724            Week => "week",
6725            Year => "year",
6726        }
6727    }
6728}
6729
6730impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
6731    type Err = stripe_types::StripeParseError;
6732    fn from_str(s: &str) -> Result<Self, Self::Err> {
6733        use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
6734        match s {
6735            "day" => Ok(Day),
6736            "month" => Ok(Month),
6737            "sporadic" => Ok(Sporadic),
6738            "week" => Ok(Week),
6739            "year" => Ok(Year),
6740            _ => Err(stripe_types::StripeParseError),
6741        }
6742    }
6743}
6744impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
6745    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6746        f.write_str(self.as_str())
6747    }
6748}
6749
6750impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
6751    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6752        f.write_str(self.as_str())
6753    }
6754}
6755impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
6756    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6757    where
6758        S: serde::Serializer,
6759    {
6760        serializer.serialize_str(self.as_str())
6761    }
6762}
6763#[cfg(feature = "deserialize")]
6764impl<'de> serde::Deserialize<'de>
6765    for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval
6766{
6767    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6768        use std::str::FromStr;
6769        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6770        Self::from_str(&s).map_err(|_| {
6771            serde::de::Error::custom(
6772                "Unknown value for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval",
6773            )
6774        })
6775    }
6776}
6777/// Specifies the type of mandates supported. Possible values are `india`.
6778#[derive(Copy, Clone, Eq, PartialEq)]
6779pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
6780    India,
6781}
6782impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
6783    pub fn as_str(self) -> &'static str {
6784        use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
6785        match self {
6786            India => "india",
6787        }
6788    }
6789}
6790
6791impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
6792    type Err = stripe_types::StripeParseError;
6793    fn from_str(s: &str) -> Result<Self, Self::Err> {
6794        use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
6795        match s {
6796            "india" => Ok(India),
6797            _ => Err(stripe_types::StripeParseError),
6798        }
6799    }
6800}
6801impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
6802    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6803        f.write_str(self.as_str())
6804    }
6805}
6806
6807impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
6808    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6809        f.write_str(self.as_str())
6810    }
6811}
6812impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
6813    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6814    where
6815        S: serde::Serializer,
6816    {
6817        serializer.serialize_str(self.as_str())
6818    }
6819}
6820#[cfg(feature = "deserialize")]
6821impl<'de> serde::Deserialize<'de>
6822    for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
6823{
6824    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6825        use std::str::FromStr;
6826        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6827        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"))
6828    }
6829}
6830/// Selected network to process this SetupIntent on.
6831/// Depends on the available networks of the card attached to the SetupIntent.
6832/// Can be only set confirm-time.
6833#[derive(Copy, Clone, Eq, PartialEq)]
6834pub enum UpdateSetupIntentPaymentMethodOptionsCardNetwork {
6835    Amex,
6836    CartesBancaires,
6837    Diners,
6838    Discover,
6839    EftposAu,
6840    Girocard,
6841    Interac,
6842    Jcb,
6843    Link,
6844    Mastercard,
6845    Unionpay,
6846    Unknown,
6847    Visa,
6848}
6849impl UpdateSetupIntentPaymentMethodOptionsCardNetwork {
6850    pub fn as_str(self) -> &'static str {
6851        use UpdateSetupIntentPaymentMethodOptionsCardNetwork::*;
6852        match self {
6853            Amex => "amex",
6854            CartesBancaires => "cartes_bancaires",
6855            Diners => "diners",
6856            Discover => "discover",
6857            EftposAu => "eftpos_au",
6858            Girocard => "girocard",
6859            Interac => "interac",
6860            Jcb => "jcb",
6861            Link => "link",
6862            Mastercard => "mastercard",
6863            Unionpay => "unionpay",
6864            Unknown => "unknown",
6865            Visa => "visa",
6866        }
6867    }
6868}
6869
6870impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
6871    type Err = stripe_types::StripeParseError;
6872    fn from_str(s: &str) -> Result<Self, Self::Err> {
6873        use UpdateSetupIntentPaymentMethodOptionsCardNetwork::*;
6874        match s {
6875            "amex" => Ok(Amex),
6876            "cartes_bancaires" => Ok(CartesBancaires),
6877            "diners" => Ok(Diners),
6878            "discover" => Ok(Discover),
6879            "eftpos_au" => Ok(EftposAu),
6880            "girocard" => Ok(Girocard),
6881            "interac" => Ok(Interac),
6882            "jcb" => Ok(Jcb),
6883            "link" => Ok(Link),
6884            "mastercard" => Ok(Mastercard),
6885            "unionpay" => Ok(Unionpay),
6886            "unknown" => Ok(Unknown),
6887            "visa" => Ok(Visa),
6888            _ => Err(stripe_types::StripeParseError),
6889        }
6890    }
6891}
6892impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
6893    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6894        f.write_str(self.as_str())
6895    }
6896}
6897
6898impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
6899    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6900        f.write_str(self.as_str())
6901    }
6902}
6903impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
6904    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6905    where
6906        S: serde::Serializer,
6907    {
6908        serializer.serialize_str(self.as_str())
6909    }
6910}
6911#[cfg(feature = "deserialize")]
6912impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
6913    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6914        use std::str::FromStr;
6915        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6916        Self::from_str(&s).map_err(|_| {
6917            serde::de::Error::custom(
6918                "Unknown value for UpdateSetupIntentPaymentMethodOptionsCardNetwork",
6919            )
6920        })
6921    }
6922}
6923/// 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).
6924/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
6925/// If not provided, this value defaults to `automatic`.
6926/// 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.
6927#[derive(Copy, Clone, Eq, PartialEq)]
6928pub enum UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
6929    Any,
6930    Automatic,
6931    Challenge,
6932}
6933impl UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
6934    pub fn as_str(self) -> &'static str {
6935        use UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
6936        match self {
6937            Any => "any",
6938            Automatic => "automatic",
6939            Challenge => "challenge",
6940        }
6941    }
6942}
6943
6944impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
6945    type Err = stripe_types::StripeParseError;
6946    fn from_str(s: &str) -> Result<Self, Self::Err> {
6947        use UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
6948        match s {
6949            "any" => Ok(Any),
6950            "automatic" => Ok(Automatic),
6951            "challenge" => Ok(Challenge),
6952            _ => Err(stripe_types::StripeParseError),
6953        }
6954    }
6955}
6956impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
6957    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6958        f.write_str(self.as_str())
6959    }
6960}
6961
6962impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
6963    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6964        f.write_str(self.as_str())
6965    }
6966}
6967impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
6968    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6969    where
6970        S: serde::Serializer,
6971    {
6972        serializer.serialize_str(self.as_str())
6973    }
6974}
6975#[cfg(feature = "deserialize")]
6976impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
6977    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6978        use std::str::FromStr;
6979        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6980        Self::from_str(&s).map_err(|_| {
6981            serde::de::Error::custom(
6982                "Unknown value for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure",
6983            )
6984        })
6985    }
6986}
6987/// If 3D Secure authentication was performed with a third-party provider,
6988/// the authentication details to use for this setup.
6989#[derive(Clone, Debug, serde::Serialize)]
6990pub struct UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure {
6991    /// The `transStatus` returned from the card Issuer’s ACS in the ARes.
6992    #[serde(skip_serializing_if = "Option::is_none")]
6993    pub ares_trans_status:
6994        Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
6995    /// The cryptogram, also known as the "authentication value" (AAV, CAVV or
6996    /// AEVV). This value is 20 bytes, base64-encoded into a 28-character string.
6997    /// (Most 3D Secure providers will return the base64-encoded version, which
6998    /// is what you should specify here.)
6999    #[serde(skip_serializing_if = "Option::is_none")]
7000    pub cryptogram: Option<String>,
7001    /// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
7002    /// provider and indicates what degree of authentication was performed.
7003    #[serde(skip_serializing_if = "Option::is_none")]
7004    pub electronic_commerce_indicator:
7005        Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
7006    /// Network specific 3DS fields. Network specific arguments require an
7007    /// explicit card brand choice. The parameter `payment_method_options.card.network``
7008    /// must be populated accordingly
7009    #[serde(skip_serializing_if = "Option::is_none")]
7010    pub network_options:
7011        Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
7012    /// The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the
7013    /// AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99.
7014    #[serde(skip_serializing_if = "Option::is_none")]
7015    pub requestor_challenge_indicator: Option<String>,
7016    /// For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server
7017    /// Transaction ID (dsTransID).
7018    #[serde(skip_serializing_if = "Option::is_none")]
7019    pub transaction_id: Option<String>,
7020    /// The version of 3D Secure that was performed.
7021    #[serde(skip_serializing_if = "Option::is_none")]
7022    pub version: Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion>,
7023}
7024impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure {
7025    pub fn new() -> Self {
7026        Self {
7027            ares_trans_status: None,
7028            cryptogram: None,
7029            electronic_commerce_indicator: None,
7030            network_options: None,
7031            requestor_challenge_indicator: None,
7032            transaction_id: None,
7033            version: None,
7034        }
7035    }
7036}
7037impl Default for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure {
7038    fn default() -> Self {
7039        Self::new()
7040    }
7041}
7042/// The `transStatus` returned from the card Issuer’s ACS in the ARes.
7043#[derive(Copy, Clone, Eq, PartialEq)]
7044pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
7045    A,
7046    C,
7047    I,
7048    N,
7049    R,
7050    U,
7051    Y,
7052}
7053impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
7054    pub fn as_str(self) -> &'static str {
7055        use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
7056        match self {
7057            A => "A",
7058            C => "C",
7059            I => "I",
7060            N => "N",
7061            R => "R",
7062            U => "U",
7063            Y => "Y",
7064        }
7065    }
7066}
7067
7068impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
7069    type Err = stripe_types::StripeParseError;
7070    fn from_str(s: &str) -> Result<Self, Self::Err> {
7071        use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
7072        match s {
7073            "A" => Ok(A),
7074            "C" => Ok(C),
7075            "I" => Ok(I),
7076            "N" => Ok(N),
7077            "R" => Ok(R),
7078            "U" => Ok(U),
7079            "Y" => Ok(Y),
7080            _ => Err(stripe_types::StripeParseError),
7081        }
7082    }
7083}
7084impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
7085    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7086        f.write_str(self.as_str())
7087    }
7088}
7089
7090impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
7091    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7092        f.write_str(self.as_str())
7093    }
7094}
7095impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
7096    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7097    where
7098        S: serde::Serializer,
7099    {
7100        serializer.serialize_str(self.as_str())
7101    }
7102}
7103#[cfg(feature = "deserialize")]
7104impl<'de> serde::Deserialize<'de>
7105    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
7106{
7107    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7108        use std::str::FromStr;
7109        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7110        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"))
7111    }
7112}
7113/// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
7114/// provider and indicates what degree of authentication was performed.
7115#[derive(Copy, Clone, Eq, PartialEq)]
7116pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
7117    V01,
7118    V02,
7119    V05,
7120    V06,
7121    V07,
7122}
7123impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
7124    pub fn as_str(self) -> &'static str {
7125        use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
7126        match self {
7127            V01 => "01",
7128            V02 => "02",
7129            V05 => "05",
7130            V06 => "06",
7131            V07 => "07",
7132        }
7133    }
7134}
7135
7136impl std::str::FromStr
7137    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
7138{
7139    type Err = stripe_types::StripeParseError;
7140    fn from_str(s: &str) -> Result<Self, Self::Err> {
7141        use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
7142        match s {
7143            "01" => Ok(V01),
7144            "02" => Ok(V02),
7145            "05" => Ok(V05),
7146            "06" => Ok(V06),
7147            "07" => Ok(V07),
7148            _ => Err(stripe_types::StripeParseError),
7149        }
7150    }
7151}
7152impl std::fmt::Display
7153    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
7154{
7155    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7156        f.write_str(self.as_str())
7157    }
7158}
7159
7160impl std::fmt::Debug
7161    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
7162{
7163    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7164        f.write_str(self.as_str())
7165    }
7166}
7167impl serde::Serialize
7168    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
7169{
7170    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7171    where
7172        S: serde::Serializer,
7173    {
7174        serializer.serialize_str(self.as_str())
7175    }
7176}
7177#[cfg(feature = "deserialize")]
7178impl<'de> serde::Deserialize<'de>
7179    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
7180{
7181    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7182        use std::str::FromStr;
7183        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7184        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"))
7185    }
7186}
7187/// Network specific 3DS fields. Network specific arguments require an
7188/// explicit card brand choice. The parameter `payment_method_options.card.network``
7189/// must be populated accordingly
7190#[derive(Clone, Debug, serde::Serialize)]
7191pub struct UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
7192    /// Cartes Bancaires-specific 3DS fields.
7193    #[serde(skip_serializing_if = "Option::is_none")]
7194    pub cartes_bancaires:
7195        Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires>,
7196}
7197impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
7198    pub fn new() -> Self {
7199        Self { cartes_bancaires: None }
7200    }
7201}
7202impl Default for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
7203    fn default() -> Self {
7204        Self::new()
7205    }
7206}
7207/// Cartes Bancaires-specific 3DS fields.
7208#[derive(Clone, Debug, serde::Serialize)]
7209pub struct UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
7210    /// The cryptogram calculation algorithm used by the card Issuer's ACS
7211    /// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
7212    /// messageExtension: CB-AVALGO
7213    pub cb_avalgo:
7214        UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
7215    /// The exemption indicator returned from Cartes Bancaires in the ARes.
7216    /// message extension: CB-EXEMPTION; string (4 characters)
7217    /// This is a 3 byte bitmap (low significant byte first and most significant
7218    /// bit first) that has been Base64 encoded
7219    #[serde(skip_serializing_if = "Option::is_none")]
7220    pub cb_exemption: Option<String>,
7221    /// The risk score returned from Cartes Bancaires in the ARes.
7222    /// message extension: CB-SCORE; numeric value 0-99
7223    #[serde(skip_serializing_if = "Option::is_none")]
7224    pub cb_score: Option<i64>,
7225}
7226impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
7227    pub fn new(
7228        cb_avalgo: impl Into<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
7229    ) -> Self {
7230        Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
7231    }
7232}
7233/// The cryptogram calculation algorithm used by the card Issuer's ACS
7234/// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
7235/// messageExtension: CB-AVALGO
7236#[derive(Copy, Clone, Eq, PartialEq)]
7237pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
7238{
7239    V0,
7240    V1,
7241    V2,
7242    V3,
7243    V4,
7244    A,
7245}
7246impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
7247    pub fn as_str(self) -> &'static str {
7248        use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
7249        match self {
7250            V0 => "0",
7251            V1 => "1",
7252            V2 => "2",
7253            V3 => "3",
7254            V4 => "4",
7255            A => "A",
7256        }
7257    }
7258}
7259
7260impl std::str::FromStr
7261    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
7262{
7263    type Err = stripe_types::StripeParseError;
7264    fn from_str(s: &str) -> Result<Self, Self::Err> {
7265        use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
7266        match s {
7267            "0" => Ok(V0),
7268            "1" => Ok(V1),
7269            "2" => Ok(V2),
7270            "3" => Ok(V3),
7271            "4" => Ok(V4),
7272            "A" => Ok(A),
7273            _ => Err(stripe_types::StripeParseError),
7274        }
7275    }
7276}
7277impl std::fmt::Display
7278    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
7279{
7280    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7281        f.write_str(self.as_str())
7282    }
7283}
7284
7285impl std::fmt::Debug
7286    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
7287{
7288    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7289        f.write_str(self.as_str())
7290    }
7291}
7292impl serde::Serialize
7293    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
7294{
7295    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7296    where
7297        S: serde::Serializer,
7298    {
7299        serializer.serialize_str(self.as_str())
7300    }
7301}
7302#[cfg(feature = "deserialize")]
7303impl<'de> serde::Deserialize<'de>
7304    for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
7305{
7306    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7307        use std::str::FromStr;
7308        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7309        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"))
7310    }
7311}
7312/// The version of 3D Secure that was performed.
7313#[derive(Copy, Clone, Eq, PartialEq)]
7314pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
7315    V1_0_2,
7316    V2_1_0,
7317    V2_2_0,
7318}
7319impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
7320    pub fn as_str(self) -> &'static str {
7321        use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
7322        match self {
7323            V1_0_2 => "1.0.2",
7324            V2_1_0 => "2.1.0",
7325            V2_2_0 => "2.2.0",
7326        }
7327    }
7328}
7329
7330impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
7331    type Err = stripe_types::StripeParseError;
7332    fn from_str(s: &str) -> Result<Self, Self::Err> {
7333        use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
7334        match s {
7335            "1.0.2" => Ok(V1_0_2),
7336            "2.1.0" => Ok(V2_1_0),
7337            "2.2.0" => Ok(V2_2_0),
7338            _ => Err(stripe_types::StripeParseError),
7339        }
7340    }
7341}
7342impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
7343    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7344        f.write_str(self.as_str())
7345    }
7346}
7347
7348impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
7349    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7350        f.write_str(self.as_str())
7351    }
7352}
7353impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
7354    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7355    where
7356        S: serde::Serializer,
7357    {
7358        serializer.serialize_str(self.as_str())
7359    }
7360}
7361#[cfg(feature = "deserialize")]
7362impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
7363    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7364        use std::str::FromStr;
7365        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7366        Self::from_str(&s).map_err(|_| {
7367            serde::de::Error::custom(
7368                "Unknown value for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion",
7369            )
7370        })
7371    }
7372}
7373/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options.
7374#[derive(Clone, Debug, serde::Serialize)]
7375pub struct UpdateSetupIntentPaymentMethodOptionsKlarna {
7376    /// The currency of the SetupIntent. Three letter ISO currency code.
7377    #[serde(skip_serializing_if = "Option::is_none")]
7378    pub currency: Option<stripe_types::Currency>,
7379    /// On-demand details if setting up a payment method for on-demand payments.
7380    #[serde(skip_serializing_if = "Option::is_none")]
7381    pub on_demand: Option<UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemand>,
7382    /// Preferred language of the Klarna authorization page that the customer is redirected to
7383    #[serde(skip_serializing_if = "Option::is_none")]
7384    pub preferred_locale: Option<UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale>,
7385    /// Subscription details if setting up or charging a subscription
7386    #[serde(skip_serializing_if = "Option::is_none")]
7387    pub subscriptions: Option<Vec<UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptions>>,
7388}
7389impl UpdateSetupIntentPaymentMethodOptionsKlarna {
7390    pub fn new() -> Self {
7391        Self { currency: None, on_demand: None, preferred_locale: None, subscriptions: None }
7392    }
7393}
7394impl Default for UpdateSetupIntentPaymentMethodOptionsKlarna {
7395    fn default() -> Self {
7396        Self::new()
7397    }
7398}
7399/// On-demand details if setting up a payment method for on-demand payments.
7400#[derive(Copy, Clone, Debug, serde::Serialize)]
7401pub struct UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
7402    /// Your average amount value.
7403    /// You can use a value across your customer base, or segment based on customer type, country, etc.
7404    #[serde(skip_serializing_if = "Option::is_none")]
7405    pub average_amount: Option<i64>,
7406    /// The maximum value you may charge a customer per purchase.
7407    /// You can use a value across your customer base, or segment based on customer type, country, etc.
7408    #[serde(skip_serializing_if = "Option::is_none")]
7409    pub maximum_amount: Option<i64>,
7410    /// The lowest or minimum value you may charge a customer per purchase.
7411    /// You can use a value across your customer base, or segment based on customer type, country, etc.
7412    #[serde(skip_serializing_if = "Option::is_none")]
7413    pub minimum_amount: Option<i64>,
7414    /// Interval at which the customer is making purchases
7415    #[serde(skip_serializing_if = "Option::is_none")]
7416    pub purchase_interval:
7417        Option<UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
7418    /// The number of `purchase_interval` between charges
7419    #[serde(skip_serializing_if = "Option::is_none")]
7420    pub purchase_interval_count: Option<u64>,
7421}
7422impl UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
7423    pub fn new() -> Self {
7424        Self {
7425            average_amount: None,
7426            maximum_amount: None,
7427            minimum_amount: None,
7428            purchase_interval: None,
7429            purchase_interval_count: None,
7430        }
7431    }
7432}
7433impl Default for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
7434    fn default() -> Self {
7435        Self::new()
7436    }
7437}
7438/// Interval at which the customer is making purchases
7439#[derive(Copy, Clone, Eq, PartialEq)]
7440pub enum UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7441    Day,
7442    Month,
7443    Week,
7444    Year,
7445}
7446impl UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7447    pub fn as_str(self) -> &'static str {
7448        use UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
7449        match self {
7450            Day => "day",
7451            Month => "month",
7452            Week => "week",
7453            Year => "year",
7454        }
7455    }
7456}
7457
7458impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7459    type Err = stripe_types::StripeParseError;
7460    fn from_str(s: &str) -> Result<Self, Self::Err> {
7461        use UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
7462        match s {
7463            "day" => Ok(Day),
7464            "month" => Ok(Month),
7465            "week" => Ok(Week),
7466            "year" => Ok(Year),
7467            _ => Err(stripe_types::StripeParseError),
7468        }
7469    }
7470}
7471impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7472    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7473        f.write_str(self.as_str())
7474    }
7475}
7476
7477impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7478    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7479        f.write_str(self.as_str())
7480    }
7481}
7482impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7483    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7484    where
7485        S: serde::Serializer,
7486    {
7487        serializer.serialize_str(self.as_str())
7488    }
7489}
7490#[cfg(feature = "deserialize")]
7491impl<'de> serde::Deserialize<'de>
7492    for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
7493{
7494    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7495        use std::str::FromStr;
7496        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7497        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"))
7498    }
7499}
7500/// Preferred language of the Klarna authorization page that the customer is redirected to
7501#[derive(Clone, Eq, PartialEq)]
7502#[non_exhaustive]
7503pub enum UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
7504    CsMinusCz,
7505    DaMinusDk,
7506    DeMinusAt,
7507    DeMinusCh,
7508    DeMinusDe,
7509    ElMinusGr,
7510    EnMinusAt,
7511    EnMinusAu,
7512    EnMinusBe,
7513    EnMinusCa,
7514    EnMinusCh,
7515    EnMinusCz,
7516    EnMinusDe,
7517    EnMinusDk,
7518    EnMinusEs,
7519    EnMinusFi,
7520    EnMinusFr,
7521    EnMinusGb,
7522    EnMinusGr,
7523    EnMinusIe,
7524    EnMinusIt,
7525    EnMinusNl,
7526    EnMinusNo,
7527    EnMinusNz,
7528    EnMinusPl,
7529    EnMinusPt,
7530    EnMinusRo,
7531    EnMinusSe,
7532    EnMinusUs,
7533    EsMinusEs,
7534    EsMinusUs,
7535    FiMinusFi,
7536    FrMinusBe,
7537    FrMinusCa,
7538    FrMinusCh,
7539    FrMinusFr,
7540    ItMinusCh,
7541    ItMinusIt,
7542    NbMinusNo,
7543    NlMinusBe,
7544    NlMinusNl,
7545    PlMinusPl,
7546    PtMinusPt,
7547    RoMinusRo,
7548    SvMinusFi,
7549    SvMinusSe,
7550    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7551    Unknown(String),
7552}
7553impl UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
7554    pub fn as_str(&self) -> &str {
7555        use UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
7556        match self {
7557            CsMinusCz => "cs-CZ",
7558            DaMinusDk => "da-DK",
7559            DeMinusAt => "de-AT",
7560            DeMinusCh => "de-CH",
7561            DeMinusDe => "de-DE",
7562            ElMinusGr => "el-GR",
7563            EnMinusAt => "en-AT",
7564            EnMinusAu => "en-AU",
7565            EnMinusBe => "en-BE",
7566            EnMinusCa => "en-CA",
7567            EnMinusCh => "en-CH",
7568            EnMinusCz => "en-CZ",
7569            EnMinusDe => "en-DE",
7570            EnMinusDk => "en-DK",
7571            EnMinusEs => "en-ES",
7572            EnMinusFi => "en-FI",
7573            EnMinusFr => "en-FR",
7574            EnMinusGb => "en-GB",
7575            EnMinusGr => "en-GR",
7576            EnMinusIe => "en-IE",
7577            EnMinusIt => "en-IT",
7578            EnMinusNl => "en-NL",
7579            EnMinusNo => "en-NO",
7580            EnMinusNz => "en-NZ",
7581            EnMinusPl => "en-PL",
7582            EnMinusPt => "en-PT",
7583            EnMinusRo => "en-RO",
7584            EnMinusSe => "en-SE",
7585            EnMinusUs => "en-US",
7586            EsMinusEs => "es-ES",
7587            EsMinusUs => "es-US",
7588            FiMinusFi => "fi-FI",
7589            FrMinusBe => "fr-BE",
7590            FrMinusCa => "fr-CA",
7591            FrMinusCh => "fr-CH",
7592            FrMinusFr => "fr-FR",
7593            ItMinusCh => "it-CH",
7594            ItMinusIt => "it-IT",
7595            NbMinusNo => "nb-NO",
7596            NlMinusBe => "nl-BE",
7597            NlMinusNl => "nl-NL",
7598            PlMinusPl => "pl-PL",
7599            PtMinusPt => "pt-PT",
7600            RoMinusRo => "ro-RO",
7601            SvMinusFi => "sv-FI",
7602            SvMinusSe => "sv-SE",
7603            Unknown(v) => v,
7604        }
7605    }
7606}
7607
7608impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
7609    type Err = std::convert::Infallible;
7610    fn from_str(s: &str) -> Result<Self, Self::Err> {
7611        use UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
7612        match s {
7613            "cs-CZ" => Ok(CsMinusCz),
7614            "da-DK" => Ok(DaMinusDk),
7615            "de-AT" => Ok(DeMinusAt),
7616            "de-CH" => Ok(DeMinusCh),
7617            "de-DE" => Ok(DeMinusDe),
7618            "el-GR" => Ok(ElMinusGr),
7619            "en-AT" => Ok(EnMinusAt),
7620            "en-AU" => Ok(EnMinusAu),
7621            "en-BE" => Ok(EnMinusBe),
7622            "en-CA" => Ok(EnMinusCa),
7623            "en-CH" => Ok(EnMinusCh),
7624            "en-CZ" => Ok(EnMinusCz),
7625            "en-DE" => Ok(EnMinusDe),
7626            "en-DK" => Ok(EnMinusDk),
7627            "en-ES" => Ok(EnMinusEs),
7628            "en-FI" => Ok(EnMinusFi),
7629            "en-FR" => Ok(EnMinusFr),
7630            "en-GB" => Ok(EnMinusGb),
7631            "en-GR" => Ok(EnMinusGr),
7632            "en-IE" => Ok(EnMinusIe),
7633            "en-IT" => Ok(EnMinusIt),
7634            "en-NL" => Ok(EnMinusNl),
7635            "en-NO" => Ok(EnMinusNo),
7636            "en-NZ" => Ok(EnMinusNz),
7637            "en-PL" => Ok(EnMinusPl),
7638            "en-PT" => Ok(EnMinusPt),
7639            "en-RO" => Ok(EnMinusRo),
7640            "en-SE" => Ok(EnMinusSe),
7641            "en-US" => Ok(EnMinusUs),
7642            "es-ES" => Ok(EsMinusEs),
7643            "es-US" => Ok(EsMinusUs),
7644            "fi-FI" => Ok(FiMinusFi),
7645            "fr-BE" => Ok(FrMinusBe),
7646            "fr-CA" => Ok(FrMinusCa),
7647            "fr-CH" => Ok(FrMinusCh),
7648            "fr-FR" => Ok(FrMinusFr),
7649            "it-CH" => Ok(ItMinusCh),
7650            "it-IT" => Ok(ItMinusIt),
7651            "nb-NO" => Ok(NbMinusNo),
7652            "nl-BE" => Ok(NlMinusBe),
7653            "nl-NL" => Ok(NlMinusNl),
7654            "pl-PL" => Ok(PlMinusPl),
7655            "pt-PT" => Ok(PtMinusPt),
7656            "ro-RO" => Ok(RoMinusRo),
7657            "sv-FI" => Ok(SvMinusFi),
7658            "sv-SE" => Ok(SvMinusSe),
7659            v => Ok(Unknown(v.to_owned())),
7660        }
7661    }
7662}
7663impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
7664    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7665        f.write_str(self.as_str())
7666    }
7667}
7668
7669impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
7670    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7671        f.write_str(self.as_str())
7672    }
7673}
7674impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
7675    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7676    where
7677        S: serde::Serializer,
7678    {
7679        serializer.serialize_str(self.as_str())
7680    }
7681}
7682#[cfg(feature = "deserialize")]
7683impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
7684    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7685        use std::str::FromStr;
7686        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7687        Ok(Self::from_str(&s).unwrap())
7688    }
7689}
7690/// Subscription details if setting up or charging a subscription
7691#[derive(Clone, Debug, serde::Serialize)]
7692pub struct UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
7693    /// Unit of time between subscription charges.
7694    pub interval: UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
7695    /// The number of intervals (specified in the `interval` attribute) between subscription charges.
7696    /// For example, `interval=month` and `interval_count=3` charges every 3 months.
7697    #[serde(skip_serializing_if = "Option::is_none")]
7698    pub interval_count: Option<u64>,
7699    /// Name for subscription.
7700    #[serde(skip_serializing_if = "Option::is_none")]
7701    pub name: Option<String>,
7702    /// Describes the upcoming charge for this subscription.
7703    pub next_billing: SubscriptionNextBillingParam,
7704    /// A non-customer-facing reference to correlate subscription charges in the Klarna app.
7705    /// Use a value that persists across subscription charges.
7706    pub reference: String,
7707}
7708impl UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
7709    pub fn new(
7710        interval: impl Into<UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
7711        next_billing: impl Into<SubscriptionNextBillingParam>,
7712        reference: impl Into<String>,
7713    ) -> Self {
7714        Self {
7715            interval: interval.into(),
7716            interval_count: None,
7717            name: None,
7718            next_billing: next_billing.into(),
7719            reference: reference.into(),
7720        }
7721    }
7722}
7723/// Unit of time between subscription charges.
7724#[derive(Copy, Clone, Eq, PartialEq)]
7725pub enum UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7726    Day,
7727    Month,
7728    Week,
7729    Year,
7730}
7731impl UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7732    pub fn as_str(self) -> &'static str {
7733        use UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
7734        match self {
7735            Day => "day",
7736            Month => "month",
7737            Week => "week",
7738            Year => "year",
7739        }
7740    }
7741}
7742
7743impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7744    type Err = stripe_types::StripeParseError;
7745    fn from_str(s: &str) -> Result<Self, Self::Err> {
7746        use UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
7747        match s {
7748            "day" => Ok(Day),
7749            "month" => Ok(Month),
7750            "week" => Ok(Week),
7751            "year" => Ok(Year),
7752            _ => Err(stripe_types::StripeParseError),
7753        }
7754    }
7755}
7756impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7757    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7758        f.write_str(self.as_str())
7759    }
7760}
7761
7762impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7763    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7764        f.write_str(self.as_str())
7765    }
7766}
7767impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7768    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7769    where
7770        S: serde::Serializer,
7771    {
7772        serializer.serialize_str(self.as_str())
7773    }
7774}
7775#[cfg(feature = "deserialize")]
7776impl<'de> serde::Deserialize<'de>
7777    for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
7778{
7779    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7780        use std::str::FromStr;
7781        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7782        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"))
7783    }
7784}
7785/// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options.
7786#[derive(Clone, Debug, serde::Serialize)]
7787pub struct UpdateSetupIntentPaymentMethodOptionsSepaDebit {
7788    /// Additional fields for Mandate creation
7789    #[serde(skip_serializing_if = "Option::is_none")]
7790    pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions>,
7791}
7792impl UpdateSetupIntentPaymentMethodOptionsSepaDebit {
7793    pub fn new() -> Self {
7794        Self { mandate_options: None }
7795    }
7796}
7797impl Default for UpdateSetupIntentPaymentMethodOptionsSepaDebit {
7798    fn default() -> Self {
7799        Self::new()
7800    }
7801}
7802/// Additional fields for Mandate creation
7803#[derive(Clone, Debug, serde::Serialize)]
7804pub struct UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
7805    /// Prefix used to generate the Mandate reference.
7806    /// Must be at most 12 characters long.
7807    /// Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'.
7808    /// Cannot begin with 'STRIPE'.
7809    #[serde(skip_serializing_if = "Option::is_none")]
7810    pub reference_prefix: Option<String>,
7811}
7812impl UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
7813    pub fn new() -> Self {
7814        Self { reference_prefix: None }
7815    }
7816}
7817impl Default for UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
7818    fn default() -> Self {
7819        Self::new()
7820    }
7821}
7822/// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options.
7823#[derive(Clone, Debug, serde::Serialize)]
7824pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccount {
7825    /// Additional fields for Financial Connections Session creation
7826    #[serde(skip_serializing_if = "Option::is_none")]
7827    pub financial_connections:
7828        Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
7829    /// Additional fields for Mandate creation
7830    #[serde(skip_serializing_if = "Option::is_none")]
7831    pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
7832    /// Additional fields for network related functions
7833    #[serde(skip_serializing_if = "Option::is_none")]
7834    pub networks: Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks>,
7835    /// Bank account verification method.
7836    #[serde(skip_serializing_if = "Option::is_none")]
7837    pub verification_method:
7838        Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
7839}
7840impl UpdateSetupIntentPaymentMethodOptionsUsBankAccount {
7841    pub fn new() -> Self {
7842        Self {
7843            financial_connections: None,
7844            mandate_options: None,
7845            networks: None,
7846            verification_method: None,
7847        }
7848    }
7849}
7850impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccount {
7851    fn default() -> Self {
7852        Self::new()
7853    }
7854}
7855/// Additional fields for Financial Connections Session creation
7856#[derive(Clone, Debug, serde::Serialize)]
7857pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
7858    /// Provide filters for the linked accounts that the customer can select for the payment method.
7859    #[serde(skip_serializing_if = "Option::is_none")]
7860    pub filters:
7861        Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
7862    /// The list of permissions to request.
7863    /// If this parameter is passed, the `payment_method` permission must be included.
7864    /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
7865    #[serde(skip_serializing_if = "Option::is_none")]
7866    pub permissions: Option<
7867        Vec<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
7868    >,
7869    /// List of data features that you would like to retrieve upon account creation.
7870    #[serde(skip_serializing_if = "Option::is_none")]
7871    pub prefetch:
7872        Option<Vec<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>>,
7873    /// For webview integrations only.
7874    /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.
7875    #[serde(skip_serializing_if = "Option::is_none")]
7876    pub return_url: Option<String>,
7877}
7878impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
7879    pub fn new() -> Self {
7880        Self { filters: None, permissions: None, prefetch: None, return_url: None }
7881    }
7882}
7883impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
7884    fn default() -> Self {
7885        Self::new()
7886    }
7887}
7888/// Provide filters for the linked accounts that the customer can select for the payment method.
7889#[derive(Clone, Debug, serde::Serialize)]
7890pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
7891        /// The account subcategories to use to filter for selectable accounts.
7892    /// Valid subcategories are `checking` and `savings`.
7893#[serde(skip_serializing_if = "Option::is_none")]
7894pub account_subcategories: Option<Vec<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
7895
7896}
7897impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
7898    pub fn new() -> Self {
7899        Self { account_subcategories: None }
7900    }
7901}
7902impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
7903    fn default() -> Self {
7904        Self::new()
7905    }
7906}
7907/// The account subcategories to use to filter for selectable accounts.
7908/// Valid subcategories are `checking` and `savings`.
7909#[derive(Copy, Clone, Eq, PartialEq)]
7910pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
7911{
7912    Checking,
7913    Savings,
7914}
7915impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
7916    pub fn as_str(self) -> &'static str {
7917        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
7918        match self {
7919Checking => "checking",
7920Savings => "savings",
7921
7922        }
7923    }
7924}
7925
7926impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
7927    type Err = stripe_types::StripeParseError;
7928    fn from_str(s: &str) -> Result<Self, Self::Err> {
7929        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
7930        match s {
7931    "checking" => Ok(Checking),
7932"savings" => Ok(Savings),
7933_ => Err(stripe_types::StripeParseError)
7934
7935        }
7936    }
7937}
7938impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
7939    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7940        f.write_str(self.as_str())
7941    }
7942}
7943
7944impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
7945    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7946        f.write_str(self.as_str())
7947    }
7948}
7949impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
7950    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
7951        serializer.serialize_str(self.as_str())
7952    }
7953}
7954#[cfg(feature = "deserialize")]
7955impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
7956    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7957        use std::str::FromStr;
7958        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7959        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"))
7960    }
7961}
7962/// The list of permissions to request.
7963/// If this parameter is passed, the `payment_method` permission must be included.
7964/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
7965#[derive(Copy, Clone, Eq, PartialEq)]
7966pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
7967    Balances,
7968    Ownership,
7969    PaymentMethod,
7970    Transactions,
7971}
7972impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
7973    pub fn as_str(self) -> &'static str {
7974        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
7975        match self {
7976            Balances => "balances",
7977            Ownership => "ownership",
7978            PaymentMethod => "payment_method",
7979            Transactions => "transactions",
7980        }
7981    }
7982}
7983
7984impl std::str::FromStr
7985    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
7986{
7987    type Err = stripe_types::StripeParseError;
7988    fn from_str(s: &str) -> Result<Self, Self::Err> {
7989        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
7990        match s {
7991            "balances" => Ok(Balances),
7992            "ownership" => Ok(Ownership),
7993            "payment_method" => Ok(PaymentMethod),
7994            "transactions" => Ok(Transactions),
7995            _ => Err(stripe_types::StripeParseError),
7996        }
7997    }
7998}
7999impl std::fmt::Display
8000    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
8001{
8002    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8003        f.write_str(self.as_str())
8004    }
8005}
8006
8007impl std::fmt::Debug
8008    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
8009{
8010    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8011        f.write_str(self.as_str())
8012    }
8013}
8014impl serde::Serialize
8015    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
8016{
8017    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8018    where
8019        S: serde::Serializer,
8020    {
8021        serializer.serialize_str(self.as_str())
8022    }
8023}
8024#[cfg(feature = "deserialize")]
8025impl<'de> serde::Deserialize<'de>
8026    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
8027{
8028    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8029        use std::str::FromStr;
8030        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8031        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"))
8032    }
8033}
8034/// List of data features that you would like to retrieve upon account creation.
8035#[derive(Copy, Clone, Eq, PartialEq)]
8036pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
8037    Balances,
8038    Ownership,
8039    Transactions,
8040}
8041impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
8042    pub fn as_str(self) -> &'static str {
8043        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
8044        match self {
8045            Balances => "balances",
8046            Ownership => "ownership",
8047            Transactions => "transactions",
8048        }
8049    }
8050}
8051
8052impl std::str::FromStr
8053    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
8054{
8055    type Err = stripe_types::StripeParseError;
8056    fn from_str(s: &str) -> Result<Self, Self::Err> {
8057        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
8058        match s {
8059            "balances" => Ok(Balances),
8060            "ownership" => Ok(Ownership),
8061            "transactions" => Ok(Transactions),
8062            _ => Err(stripe_types::StripeParseError),
8063        }
8064    }
8065}
8066impl std::fmt::Display
8067    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
8068{
8069    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8070        f.write_str(self.as_str())
8071    }
8072}
8073
8074impl std::fmt::Debug
8075    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
8076{
8077    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8078        f.write_str(self.as_str())
8079    }
8080}
8081impl serde::Serialize
8082    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
8083{
8084    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8085    where
8086        S: serde::Serializer,
8087    {
8088        serializer.serialize_str(self.as_str())
8089    }
8090}
8091#[cfg(feature = "deserialize")]
8092impl<'de> serde::Deserialize<'de>
8093    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
8094{
8095    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8096        use std::str::FromStr;
8097        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8098        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"))
8099    }
8100}
8101/// Additional fields for Mandate creation
8102#[derive(Copy, Clone, Debug, serde::Serialize)]
8103pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
8104    /// The method used to collect offline mandate customer acceptance.
8105    #[serde(skip_serializing_if = "Option::is_none")]
8106    pub collection_method:
8107        Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
8108}
8109impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
8110    pub fn new() -> Self {
8111        Self { collection_method: None }
8112    }
8113}
8114impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
8115    fn default() -> Self {
8116        Self::new()
8117    }
8118}
8119/// The method used to collect offline mandate customer acceptance.
8120#[derive(Copy, Clone, Eq, PartialEq)]
8121pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
8122    Paper,
8123}
8124impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
8125    pub fn as_str(self) -> &'static str {
8126        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
8127        match self {
8128            Paper => "paper",
8129        }
8130    }
8131}
8132
8133impl std::str::FromStr
8134    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
8135{
8136    type Err = stripe_types::StripeParseError;
8137    fn from_str(s: &str) -> Result<Self, Self::Err> {
8138        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
8139        match s {
8140            "paper" => Ok(Paper),
8141            _ => Err(stripe_types::StripeParseError),
8142        }
8143    }
8144}
8145impl std::fmt::Display
8146    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
8147{
8148    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8149        f.write_str(self.as_str())
8150    }
8151}
8152
8153impl std::fmt::Debug
8154    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
8155{
8156    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8157        f.write_str(self.as_str())
8158    }
8159}
8160impl serde::Serialize
8161    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
8162{
8163    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8164    where
8165        S: serde::Serializer,
8166    {
8167        serializer.serialize_str(self.as_str())
8168    }
8169}
8170#[cfg(feature = "deserialize")]
8171impl<'de> serde::Deserialize<'de>
8172    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
8173{
8174    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8175        use std::str::FromStr;
8176        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8177        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"))
8178    }
8179}
8180/// Additional fields for network related functions
8181#[derive(Clone, Debug, serde::Serialize)]
8182pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
8183    /// Triggers validations to run across the selected networks
8184    #[serde(skip_serializing_if = "Option::is_none")]
8185    pub requested: Option<Vec<UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
8186}
8187impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
8188    pub fn new() -> Self {
8189        Self { requested: None }
8190    }
8191}
8192impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
8193    fn default() -> Self {
8194        Self::new()
8195    }
8196}
8197/// Triggers validations to run across the selected networks
8198#[derive(Copy, Clone, Eq, PartialEq)]
8199pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
8200    Ach,
8201    UsDomesticWire,
8202}
8203impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
8204    pub fn as_str(self) -> &'static str {
8205        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
8206        match self {
8207            Ach => "ach",
8208            UsDomesticWire => "us_domestic_wire",
8209        }
8210    }
8211}
8212
8213impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
8214    type Err = stripe_types::StripeParseError;
8215    fn from_str(s: &str) -> Result<Self, Self::Err> {
8216        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
8217        match s {
8218            "ach" => Ok(Ach),
8219            "us_domestic_wire" => Ok(UsDomesticWire),
8220            _ => Err(stripe_types::StripeParseError),
8221        }
8222    }
8223}
8224impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
8225    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8226        f.write_str(self.as_str())
8227    }
8228}
8229
8230impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
8231    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8232        f.write_str(self.as_str())
8233    }
8234}
8235impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
8236    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8237    where
8238        S: serde::Serializer,
8239    {
8240        serializer.serialize_str(self.as_str())
8241    }
8242}
8243#[cfg(feature = "deserialize")]
8244impl<'de> serde::Deserialize<'de>
8245    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested
8246{
8247    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8248        use std::str::FromStr;
8249        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8250        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested"))
8251    }
8252}
8253/// Bank account verification method.
8254#[derive(Copy, Clone, Eq, PartialEq)]
8255pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
8256    Automatic,
8257    Instant,
8258    Microdeposits,
8259}
8260impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
8261    pub fn as_str(self) -> &'static str {
8262        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
8263        match self {
8264            Automatic => "automatic",
8265            Instant => "instant",
8266            Microdeposits => "microdeposits",
8267        }
8268    }
8269}
8270
8271impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
8272    type Err = stripe_types::StripeParseError;
8273    fn from_str(s: &str) -> Result<Self, Self::Err> {
8274        use UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
8275        match s {
8276            "automatic" => Ok(Automatic),
8277            "instant" => Ok(Instant),
8278            "microdeposits" => Ok(Microdeposits),
8279            _ => Err(stripe_types::StripeParseError),
8280        }
8281    }
8282}
8283impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
8284    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8285        f.write_str(self.as_str())
8286    }
8287}
8288
8289impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
8290    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8291        f.write_str(self.as_str())
8292    }
8293}
8294impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
8295    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8296    where
8297        S: serde::Serializer,
8298    {
8299        serializer.serialize_str(self.as_str())
8300    }
8301}
8302#[cfg(feature = "deserialize")]
8303impl<'de> serde::Deserialize<'de>
8304    for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod
8305{
8306    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8307        use std::str::FromStr;
8308        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8309        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod"))
8310    }
8311}
8312/// Updates a SetupIntent object.
8313#[derive(Clone, Debug, serde::Serialize)]
8314pub struct UpdateSetupIntent {
8315    inner: UpdateSetupIntentBuilder,
8316    intent: stripe_shared::SetupIntentId,
8317}
8318impl UpdateSetupIntent {
8319    /// Construct a new `UpdateSetupIntent`.
8320    pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
8321        Self { intent: intent.into(), inner: UpdateSetupIntentBuilder::new() }
8322    }
8323    /// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.
8324    ///
8325    /// It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers.
8326    /// 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.
8327    pub fn attach_to_self(mut self, attach_to_self: impl Into<bool>) -> Self {
8328        self.inner.attach_to_self = Some(attach_to_self.into());
8329        self
8330    }
8331    /// ID of the Customer this SetupIntent belongs to, if one exists.
8332    ///
8333    /// If present, the SetupIntent's payment method will be attached to the Customer on successful setup.
8334    /// Payment methods attached to other Customers cannot be used with this SetupIntent.
8335    pub fn customer(mut self, customer: impl Into<String>) -> Self {
8336        self.inner.customer = Some(customer.into());
8337        self
8338    }
8339    /// An arbitrary string attached to the object. Often useful for displaying to users.
8340    pub fn description(mut self, description: impl Into<String>) -> Self {
8341        self.inner.description = Some(description.into());
8342        self
8343    }
8344    /// The list of payment method types to exclude from use with this SetupIntent.
8345    pub fn excluded_payment_method_types(
8346        mut self,
8347        excluded_payment_method_types: impl Into<
8348            Vec<stripe_shared::SetupIntentExcludedPaymentMethodTypes>,
8349        >,
8350    ) -> Self {
8351        self.inner.excluded_payment_method_types = Some(excluded_payment_method_types.into());
8352        self
8353    }
8354    /// Specifies which fields in the response should be expanded.
8355    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
8356        self.inner.expand = Some(expand.into());
8357        self
8358    }
8359    /// Indicates the directions of money movement for which this payment method is intended to be used.
8360    ///
8361    /// Include `inbound` if you intend to use the payment method as the origin to pull funds from.
8362    /// Include `outbound` if you intend to use the payment method as the destination to send funds to.
8363    /// You can include both if you intend to use the payment method for both purposes.
8364    pub fn flow_directions(
8365        mut self,
8366        flow_directions: impl Into<Vec<stripe_shared::SetupIntentFlowDirections>>,
8367    ) -> Self {
8368        self.inner.flow_directions = Some(flow_directions.into());
8369        self
8370    }
8371    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
8372    /// This can be useful for storing additional information about the object in a structured format.
8373    /// Individual keys can be unset by posting an empty value to them.
8374    /// All keys can be unset by posting an empty value to `metadata`.
8375    pub fn metadata(
8376        mut self,
8377        metadata: impl Into<std::collections::HashMap<String, String>>,
8378    ) -> Self {
8379        self.inner.metadata = Some(metadata.into());
8380        self
8381    }
8382    /// ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent.
8383    /// To unset this field to null, pass in an empty string.
8384    pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
8385        self.inner.payment_method = Some(payment_method.into());
8386        self
8387    }
8388    /// The ID of the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) to use with this SetupIntent.
8389    pub fn payment_method_configuration(
8390        mut self,
8391        payment_method_configuration: impl Into<String>,
8392    ) -> Self {
8393        self.inner.payment_method_configuration = Some(payment_method_configuration.into());
8394        self
8395    }
8396    /// 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).
8397    /// value in the SetupIntent.
8398    pub fn payment_method_data(
8399        mut self,
8400        payment_method_data: impl Into<UpdateSetupIntentPaymentMethodData>,
8401    ) -> Self {
8402        self.inner.payment_method_data = Some(payment_method_data.into());
8403        self
8404    }
8405    /// Payment method-specific configuration for this SetupIntent.
8406    pub fn payment_method_options(
8407        mut self,
8408        payment_method_options: impl Into<UpdateSetupIntentPaymentMethodOptions>,
8409    ) -> Self {
8410        self.inner.payment_method_options = Some(payment_method_options.into());
8411        self
8412    }
8413    /// The list of payment method types (for example, card) that this SetupIntent can set up.
8414    /// 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).
8415    /// A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type).
8416    pub fn payment_method_types(mut self, payment_method_types: impl Into<Vec<String>>) -> Self {
8417        self.inner.payment_method_types = Some(payment_method_types.into());
8418        self
8419    }
8420}
8421impl UpdateSetupIntent {
8422    /// Send the request and return the deserialized response.
8423    pub async fn send<C: StripeClient>(
8424        &self,
8425        client: &C,
8426    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
8427        self.customize().send(client).await
8428    }
8429
8430    /// Send the request and return the deserialized response, blocking until completion.
8431    pub fn send_blocking<C: StripeBlockingClient>(
8432        &self,
8433        client: &C,
8434    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
8435        self.customize().send_blocking(client)
8436    }
8437}
8438
8439impl StripeRequest for UpdateSetupIntent {
8440    type Output = stripe_shared::SetupIntent;
8441
8442    fn build(&self) -> RequestBuilder {
8443        let intent = &self.intent;
8444        RequestBuilder::new(StripeMethod::Post, format!("/setup_intents/{intent}"))
8445            .form(&self.inner)
8446    }
8447}
8448#[derive(Clone, Debug, serde::Serialize)]
8449struct CancelSetupIntentBuilder {
8450    #[serde(skip_serializing_if = "Option::is_none")]
8451    cancellation_reason: Option<stripe_shared::SetupIntentCancellationReason>,
8452    #[serde(skip_serializing_if = "Option::is_none")]
8453    expand: Option<Vec<String>>,
8454}
8455impl CancelSetupIntentBuilder {
8456    fn new() -> Self {
8457        Self { cancellation_reason: None, expand: None }
8458    }
8459}
8460/// You can cancel a SetupIntent object when it’s in one of these statuses: `requires_payment_method`, `requires_confirmation`, or `requires_action`.
8461///
8462///
8463/// After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error.
8464/// You can’t cancel the SetupIntent for a Checkout Session.
8465/// [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead.
8466#[derive(Clone, Debug, serde::Serialize)]
8467pub struct CancelSetupIntent {
8468    inner: CancelSetupIntentBuilder,
8469    intent: stripe_shared::SetupIntentId,
8470}
8471impl CancelSetupIntent {
8472    /// Construct a new `CancelSetupIntent`.
8473    pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
8474        Self { intent: intent.into(), inner: CancelSetupIntentBuilder::new() }
8475    }
8476    /// Reason for canceling this SetupIntent.
8477    /// Possible values are: `abandoned`, `requested_by_customer`, or `duplicate`.
8478    pub fn cancellation_reason(
8479        mut self,
8480        cancellation_reason: impl Into<stripe_shared::SetupIntentCancellationReason>,
8481    ) -> Self {
8482        self.inner.cancellation_reason = Some(cancellation_reason.into());
8483        self
8484    }
8485    /// Specifies which fields in the response should be expanded.
8486    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
8487        self.inner.expand = Some(expand.into());
8488        self
8489    }
8490}
8491impl CancelSetupIntent {
8492    /// Send the request and return the deserialized response.
8493    pub async fn send<C: StripeClient>(
8494        &self,
8495        client: &C,
8496    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
8497        self.customize().send(client).await
8498    }
8499
8500    /// Send the request and return the deserialized response, blocking until completion.
8501    pub fn send_blocking<C: StripeBlockingClient>(
8502        &self,
8503        client: &C,
8504    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
8505        self.customize().send_blocking(client)
8506    }
8507}
8508
8509impl StripeRequest for CancelSetupIntent {
8510    type Output = stripe_shared::SetupIntent;
8511
8512    fn build(&self) -> RequestBuilder {
8513        let intent = &self.intent;
8514        RequestBuilder::new(StripeMethod::Post, format!("/setup_intents/{intent}/cancel"))
8515            .form(&self.inner)
8516    }
8517}
8518#[derive(Clone, Debug, serde::Serialize)]
8519struct ConfirmSetupIntentBuilder {
8520    #[serde(skip_serializing_if = "Option::is_none")]
8521    confirmation_token: Option<String>,
8522    #[serde(skip_serializing_if = "Option::is_none")]
8523    expand: Option<Vec<String>>,
8524    #[serde(skip_serializing_if = "Option::is_none")]
8525    mandate_data: Option<ConfirmSetupIntentMandateData>,
8526    #[serde(skip_serializing_if = "Option::is_none")]
8527    payment_method: Option<String>,
8528    #[serde(skip_serializing_if = "Option::is_none")]
8529    payment_method_data: Option<ConfirmSetupIntentPaymentMethodData>,
8530    #[serde(skip_serializing_if = "Option::is_none")]
8531    payment_method_options: Option<ConfirmSetupIntentPaymentMethodOptions>,
8532    #[serde(skip_serializing_if = "Option::is_none")]
8533    return_url: Option<String>,
8534    #[serde(skip_serializing_if = "Option::is_none")]
8535    use_stripe_sdk: Option<bool>,
8536}
8537impl ConfirmSetupIntentBuilder {
8538    fn new() -> Self {
8539        Self {
8540            confirmation_token: None,
8541            expand: None,
8542            mandate_data: None,
8543            payment_method: None,
8544            payment_method_data: None,
8545            payment_method_options: None,
8546            return_url: None,
8547            use_stripe_sdk: None,
8548        }
8549    }
8550}
8551#[derive(Clone, Debug, serde::Serialize)]
8552#[serde(rename_all = "snake_case")]
8553pub enum ConfirmSetupIntentMandateData {
8554    #[serde(untagged)]
8555    SecretKeyParam(ConfirmSetupIntentSecretKeyParam),
8556    #[serde(untagged)]
8557    ClientKeyParam(ConfirmSetupIntentClientKeyParam),
8558}
8559#[derive(Clone, Debug, serde::Serialize)]
8560pub struct ConfirmSetupIntentSecretKeyParam {
8561    /// This hash contains details about the customer acceptance of the Mandate.
8562    pub customer_acceptance: ConfirmSetupIntentSecretKeyParamCustomerAcceptance,
8563}
8564impl ConfirmSetupIntentSecretKeyParam {
8565    pub fn new(
8566        customer_acceptance: impl Into<ConfirmSetupIntentSecretKeyParamCustomerAcceptance>,
8567    ) -> Self {
8568        Self { customer_acceptance: customer_acceptance.into() }
8569    }
8570}
8571/// This hash contains details about the customer acceptance of the Mandate.
8572#[derive(Clone, Debug, serde::Serialize)]
8573pub struct ConfirmSetupIntentSecretKeyParamCustomerAcceptance {
8574    /// The time at which the customer accepted the Mandate.
8575    #[serde(skip_serializing_if = "Option::is_none")]
8576    pub accepted_at: Option<stripe_types::Timestamp>,
8577    /// If this is a Mandate accepted offline, this hash contains details about the offline acceptance.
8578    #[serde(skip_serializing_if = "Option::is_none")]
8579    #[serde(with = "stripe_types::with_serde_json_opt")]
8580    pub offline: Option<miniserde::json::Value>,
8581    /// If this is a Mandate accepted online, this hash contains details about the online acceptance.
8582    #[serde(skip_serializing_if = "Option::is_none")]
8583    pub online: Option<OnlineParam>,
8584    /// The type of customer acceptance information included with the Mandate.
8585    /// One of `online` or `offline`.
8586    #[serde(rename = "type")]
8587    pub type_: ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType,
8588}
8589impl ConfirmSetupIntentSecretKeyParamCustomerAcceptance {
8590    pub fn new(type_: impl Into<ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType>) -> Self {
8591        Self { accepted_at: None, offline: None, online: None, type_: type_.into() }
8592    }
8593}
8594/// The type of customer acceptance information included with the Mandate.
8595/// One of `online` or `offline`.
8596#[derive(Copy, Clone, Eq, PartialEq)]
8597pub enum ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
8598    Offline,
8599    Online,
8600}
8601impl ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
8602    pub fn as_str(self) -> &'static str {
8603        use ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType::*;
8604        match self {
8605            Offline => "offline",
8606            Online => "online",
8607        }
8608    }
8609}
8610
8611impl std::str::FromStr for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
8612    type Err = stripe_types::StripeParseError;
8613    fn from_str(s: &str) -> Result<Self, Self::Err> {
8614        use ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType::*;
8615        match s {
8616            "offline" => Ok(Offline),
8617            "online" => Ok(Online),
8618            _ => Err(stripe_types::StripeParseError),
8619        }
8620    }
8621}
8622impl std::fmt::Display for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
8623    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8624        f.write_str(self.as_str())
8625    }
8626}
8627
8628impl std::fmt::Debug for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
8629    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8630        f.write_str(self.as_str())
8631    }
8632}
8633impl serde::Serialize for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
8634    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8635    where
8636        S: serde::Serializer,
8637    {
8638        serializer.serialize_str(self.as_str())
8639    }
8640}
8641#[cfg(feature = "deserialize")]
8642impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
8643    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8644        use std::str::FromStr;
8645        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8646        Self::from_str(&s).map_err(|_| {
8647            serde::de::Error::custom(
8648                "Unknown value for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType",
8649            )
8650        })
8651    }
8652}
8653#[derive(Clone, Debug, serde::Serialize)]
8654pub struct ConfirmSetupIntentClientKeyParam {
8655    /// This hash contains details about the customer acceptance of the Mandate.
8656    pub customer_acceptance: ConfirmSetupIntentClientKeyParamCustomerAcceptance,
8657}
8658impl ConfirmSetupIntentClientKeyParam {
8659    pub fn new(
8660        customer_acceptance: impl Into<ConfirmSetupIntentClientKeyParamCustomerAcceptance>,
8661    ) -> Self {
8662        Self { customer_acceptance: customer_acceptance.into() }
8663    }
8664}
8665/// This hash contains details about the customer acceptance of the Mandate.
8666#[derive(Clone, Debug, serde::Serialize)]
8667pub struct ConfirmSetupIntentClientKeyParamCustomerAcceptance {
8668    /// If this is a Mandate accepted online, this hash contains details about the online acceptance.
8669    pub online: ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline,
8670    /// The type of customer acceptance information included with the Mandate.
8671    #[serde(rename = "type")]
8672    pub type_: ConfirmSetupIntentClientKeyParamCustomerAcceptanceType,
8673}
8674impl ConfirmSetupIntentClientKeyParamCustomerAcceptance {
8675    pub fn new(
8676        online: impl Into<ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline>,
8677        type_: impl Into<ConfirmSetupIntentClientKeyParamCustomerAcceptanceType>,
8678    ) -> Self {
8679        Self { online: online.into(), type_: type_.into() }
8680    }
8681}
8682/// If this is a Mandate accepted online, this hash contains details about the online acceptance.
8683#[derive(Clone, Debug, serde::Serialize)]
8684pub struct ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline {
8685    /// The IP address from which the Mandate was accepted by the customer.
8686    #[serde(skip_serializing_if = "Option::is_none")]
8687    pub ip_address: Option<String>,
8688    /// The user agent of the browser from which the Mandate was accepted by the customer.
8689    #[serde(skip_serializing_if = "Option::is_none")]
8690    pub user_agent: Option<String>,
8691}
8692impl ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline {
8693    pub fn new() -> Self {
8694        Self { ip_address: None, user_agent: None }
8695    }
8696}
8697impl Default for ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline {
8698    fn default() -> Self {
8699        Self::new()
8700    }
8701}
8702/// The type of customer acceptance information included with the Mandate.
8703#[derive(Copy, Clone, Eq, PartialEq)]
8704pub enum ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
8705    Online,
8706}
8707impl ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
8708    pub fn as_str(self) -> &'static str {
8709        use ConfirmSetupIntentClientKeyParamCustomerAcceptanceType::*;
8710        match self {
8711            Online => "online",
8712        }
8713    }
8714}
8715
8716impl std::str::FromStr for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
8717    type Err = stripe_types::StripeParseError;
8718    fn from_str(s: &str) -> Result<Self, Self::Err> {
8719        use ConfirmSetupIntentClientKeyParamCustomerAcceptanceType::*;
8720        match s {
8721            "online" => Ok(Online),
8722            _ => Err(stripe_types::StripeParseError),
8723        }
8724    }
8725}
8726impl std::fmt::Display for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
8727    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8728        f.write_str(self.as_str())
8729    }
8730}
8731
8732impl std::fmt::Debug for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
8733    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8734        f.write_str(self.as_str())
8735    }
8736}
8737impl serde::Serialize for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
8738    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8739    where
8740        S: serde::Serializer,
8741    {
8742        serializer.serialize_str(self.as_str())
8743    }
8744}
8745#[cfg(feature = "deserialize")]
8746impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
8747    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8748        use std::str::FromStr;
8749        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8750        Self::from_str(&s).map_err(|_| {
8751            serde::de::Error::custom(
8752                "Unknown value for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType",
8753            )
8754        })
8755    }
8756}
8757/// 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).
8758/// value in the SetupIntent.
8759#[derive(Clone, Debug, serde::Serialize)]
8760pub struct ConfirmSetupIntentPaymentMethodData {
8761    /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
8762    #[serde(skip_serializing_if = "Option::is_none")]
8763    pub acss_debit: Option<PaymentMethodParam>,
8764    /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
8765    #[serde(skip_serializing_if = "Option::is_none")]
8766    #[serde(with = "stripe_types::with_serde_json_opt")]
8767    pub affirm: Option<miniserde::json::Value>,
8768    /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
8769    #[serde(skip_serializing_if = "Option::is_none")]
8770    #[serde(with = "stripe_types::with_serde_json_opt")]
8771    pub afterpay_clearpay: Option<miniserde::json::Value>,
8772    /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
8773    #[serde(skip_serializing_if = "Option::is_none")]
8774    #[serde(with = "stripe_types::with_serde_json_opt")]
8775    pub alipay: Option<miniserde::json::Value>,
8776    /// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
8777    /// 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.
8778    /// The field defaults to `unspecified`.
8779    #[serde(skip_serializing_if = "Option::is_none")]
8780    pub allow_redisplay: Option<ConfirmSetupIntentPaymentMethodDataAllowRedisplay>,
8781    /// If this is a Alma PaymentMethod, this hash contains details about the Alma payment method.
8782    #[serde(skip_serializing_if = "Option::is_none")]
8783    #[serde(with = "stripe_types::with_serde_json_opt")]
8784    pub alma: Option<miniserde::json::Value>,
8785    /// If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method.
8786    #[serde(skip_serializing_if = "Option::is_none")]
8787    #[serde(with = "stripe_types::with_serde_json_opt")]
8788    pub amazon_pay: Option<miniserde::json::Value>,
8789    /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
8790    #[serde(skip_serializing_if = "Option::is_none")]
8791    pub au_becs_debit: Option<ConfirmSetupIntentPaymentMethodDataAuBecsDebit>,
8792    /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
8793    #[serde(skip_serializing_if = "Option::is_none")]
8794    pub bacs_debit: Option<ConfirmSetupIntentPaymentMethodDataBacsDebit>,
8795    /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
8796    #[serde(skip_serializing_if = "Option::is_none")]
8797    #[serde(with = "stripe_types::with_serde_json_opt")]
8798    pub bancontact: Option<miniserde::json::Value>,
8799    /// If this is a `billie` PaymentMethod, this hash contains details about the Billie payment method.
8800    #[serde(skip_serializing_if = "Option::is_none")]
8801    #[serde(with = "stripe_types::with_serde_json_opt")]
8802    pub billie: Option<miniserde::json::Value>,
8803    /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
8804    #[serde(skip_serializing_if = "Option::is_none")]
8805    pub billing_details: Option<BillingDetailsInnerParams>,
8806    /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
8807    #[serde(skip_serializing_if = "Option::is_none")]
8808    #[serde(with = "stripe_types::with_serde_json_opt")]
8809    pub blik: Option<miniserde::json::Value>,
8810    /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
8811    #[serde(skip_serializing_if = "Option::is_none")]
8812    pub boleto: Option<ConfirmSetupIntentPaymentMethodDataBoleto>,
8813    /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
8814    #[serde(skip_serializing_if = "Option::is_none")]
8815    #[serde(with = "stripe_types::with_serde_json_opt")]
8816    pub cashapp: Option<miniserde::json::Value>,
8817    /// If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method.
8818    #[serde(skip_serializing_if = "Option::is_none")]
8819    #[serde(with = "stripe_types::with_serde_json_opt")]
8820    pub crypto: Option<miniserde::json::Value>,
8821    /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
8822    #[serde(skip_serializing_if = "Option::is_none")]
8823    #[serde(with = "stripe_types::with_serde_json_opt")]
8824    pub customer_balance: Option<miniserde::json::Value>,
8825    /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
8826    #[serde(skip_serializing_if = "Option::is_none")]
8827    pub eps: Option<ConfirmSetupIntentPaymentMethodDataEps>,
8828    /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
8829    #[serde(skip_serializing_if = "Option::is_none")]
8830    pub fpx: Option<ConfirmSetupIntentPaymentMethodDataFpx>,
8831    /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
8832    #[serde(skip_serializing_if = "Option::is_none")]
8833    #[serde(with = "stripe_types::with_serde_json_opt")]
8834    pub giropay: Option<miniserde::json::Value>,
8835    /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
8836    #[serde(skip_serializing_if = "Option::is_none")]
8837    #[serde(with = "stripe_types::with_serde_json_opt")]
8838    pub grabpay: Option<miniserde::json::Value>,
8839    /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
8840    #[serde(skip_serializing_if = "Option::is_none")]
8841    pub ideal: Option<ConfirmSetupIntentPaymentMethodDataIdeal>,
8842    /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
8843    #[serde(skip_serializing_if = "Option::is_none")]
8844    #[serde(with = "stripe_types::with_serde_json_opt")]
8845    pub interac_present: Option<miniserde::json::Value>,
8846    /// If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method.
8847    #[serde(skip_serializing_if = "Option::is_none")]
8848    #[serde(with = "stripe_types::with_serde_json_opt")]
8849    pub kakao_pay: Option<miniserde::json::Value>,
8850    /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
8851    #[serde(skip_serializing_if = "Option::is_none")]
8852    pub klarna: Option<ConfirmSetupIntentPaymentMethodDataKlarna>,
8853    /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
8854    #[serde(skip_serializing_if = "Option::is_none")]
8855    #[serde(with = "stripe_types::with_serde_json_opt")]
8856    pub konbini: Option<miniserde::json::Value>,
8857    /// If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method.
8858    #[serde(skip_serializing_if = "Option::is_none")]
8859    #[serde(with = "stripe_types::with_serde_json_opt")]
8860    pub kr_card: Option<miniserde::json::Value>,
8861    /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
8862    #[serde(skip_serializing_if = "Option::is_none")]
8863    #[serde(with = "stripe_types::with_serde_json_opt")]
8864    pub link: Option<miniserde::json::Value>,
8865    /// If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method.
8866    #[serde(skip_serializing_if = "Option::is_none")]
8867    #[serde(with = "stripe_types::with_serde_json_opt")]
8868    pub mb_way: Option<miniserde::json::Value>,
8869    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
8870    /// This can be useful for storing additional information about the object in a structured format.
8871    /// Individual keys can be unset by posting an empty value to them.
8872    /// All keys can be unset by posting an empty value to `metadata`.
8873    #[serde(skip_serializing_if = "Option::is_none")]
8874    pub metadata: Option<std::collections::HashMap<String, String>>,
8875    /// If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
8876    #[serde(skip_serializing_if = "Option::is_none")]
8877    #[serde(with = "stripe_types::with_serde_json_opt")]
8878    pub mobilepay: Option<miniserde::json::Value>,
8879    /// If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method.
8880    #[serde(skip_serializing_if = "Option::is_none")]
8881    #[serde(with = "stripe_types::with_serde_json_opt")]
8882    pub multibanco: Option<miniserde::json::Value>,
8883    /// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
8884    #[serde(skip_serializing_if = "Option::is_none")]
8885    pub naver_pay: Option<ConfirmSetupIntentPaymentMethodDataNaverPay>,
8886    /// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
8887    #[serde(skip_serializing_if = "Option::is_none")]
8888    pub nz_bank_account: Option<ConfirmSetupIntentPaymentMethodDataNzBankAccount>,
8889    /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
8890    #[serde(skip_serializing_if = "Option::is_none")]
8891    #[serde(with = "stripe_types::with_serde_json_opt")]
8892    pub oxxo: Option<miniserde::json::Value>,
8893    /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
8894    #[serde(skip_serializing_if = "Option::is_none")]
8895    pub p24: Option<ConfirmSetupIntentPaymentMethodDataP24>,
8896    /// If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method.
8897    #[serde(skip_serializing_if = "Option::is_none")]
8898    #[serde(with = "stripe_types::with_serde_json_opt")]
8899    pub pay_by_bank: Option<miniserde::json::Value>,
8900    /// If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method.
8901    #[serde(skip_serializing_if = "Option::is_none")]
8902    #[serde(with = "stripe_types::with_serde_json_opt")]
8903    pub payco: Option<miniserde::json::Value>,
8904    /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
8905    #[serde(skip_serializing_if = "Option::is_none")]
8906    #[serde(with = "stripe_types::with_serde_json_opt")]
8907    pub paynow: Option<miniserde::json::Value>,
8908    /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
8909    #[serde(skip_serializing_if = "Option::is_none")]
8910    #[serde(with = "stripe_types::with_serde_json_opt")]
8911    pub paypal: Option<miniserde::json::Value>,
8912    /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
8913    #[serde(skip_serializing_if = "Option::is_none")]
8914    #[serde(with = "stripe_types::with_serde_json_opt")]
8915    pub pix: Option<miniserde::json::Value>,
8916    /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
8917    #[serde(skip_serializing_if = "Option::is_none")]
8918    #[serde(with = "stripe_types::with_serde_json_opt")]
8919    pub promptpay: Option<miniserde::json::Value>,
8920    /// Options to configure Radar.
8921    /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
8922    #[serde(skip_serializing_if = "Option::is_none")]
8923    pub radar_options: Option<RadarOptionsWithHiddenOptions>,
8924    /// If this is a `revolut_pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
8925    #[serde(skip_serializing_if = "Option::is_none")]
8926    #[serde(with = "stripe_types::with_serde_json_opt")]
8927    pub revolut_pay: Option<miniserde::json::Value>,
8928    /// If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method.
8929    #[serde(skip_serializing_if = "Option::is_none")]
8930    #[serde(with = "stripe_types::with_serde_json_opt")]
8931    pub samsung_pay: Option<miniserde::json::Value>,
8932    /// If this is a `satispay` PaymentMethod, this hash contains details about the Satispay payment method.
8933    #[serde(skip_serializing_if = "Option::is_none")]
8934    #[serde(with = "stripe_types::with_serde_json_opt")]
8935    pub satispay: Option<miniserde::json::Value>,
8936    /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
8937    #[serde(skip_serializing_if = "Option::is_none")]
8938    pub sepa_debit: Option<ConfirmSetupIntentPaymentMethodDataSepaDebit>,
8939    /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
8940    #[serde(skip_serializing_if = "Option::is_none")]
8941    pub sofort: Option<ConfirmSetupIntentPaymentMethodDataSofort>,
8942    /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
8943    #[serde(skip_serializing_if = "Option::is_none")]
8944    #[serde(with = "stripe_types::with_serde_json_opt")]
8945    pub swish: Option<miniserde::json::Value>,
8946    /// If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method.
8947    #[serde(skip_serializing_if = "Option::is_none")]
8948    #[serde(with = "stripe_types::with_serde_json_opt")]
8949    pub twint: Option<miniserde::json::Value>,
8950    /// The type of the PaymentMethod.
8951    /// An additional hash is included on the PaymentMethod with a name matching this value.
8952    /// It contains additional information specific to the PaymentMethod type.
8953    #[serde(rename = "type")]
8954    pub type_: ConfirmSetupIntentPaymentMethodDataType,
8955    /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
8956    #[serde(skip_serializing_if = "Option::is_none")]
8957    pub us_bank_account: Option<ConfirmSetupIntentPaymentMethodDataUsBankAccount>,
8958    /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
8959    #[serde(skip_serializing_if = "Option::is_none")]
8960    #[serde(with = "stripe_types::with_serde_json_opt")]
8961    pub wechat_pay: Option<miniserde::json::Value>,
8962    /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
8963    #[serde(skip_serializing_if = "Option::is_none")]
8964    #[serde(with = "stripe_types::with_serde_json_opt")]
8965    pub zip: Option<miniserde::json::Value>,
8966}
8967impl ConfirmSetupIntentPaymentMethodData {
8968    pub fn new(type_: impl Into<ConfirmSetupIntentPaymentMethodDataType>) -> Self {
8969        Self {
8970            acss_debit: None,
8971            affirm: None,
8972            afterpay_clearpay: None,
8973            alipay: None,
8974            allow_redisplay: None,
8975            alma: None,
8976            amazon_pay: None,
8977            au_becs_debit: None,
8978            bacs_debit: None,
8979            bancontact: None,
8980            billie: None,
8981            billing_details: None,
8982            blik: None,
8983            boleto: None,
8984            cashapp: None,
8985            crypto: None,
8986            customer_balance: None,
8987            eps: None,
8988            fpx: None,
8989            giropay: None,
8990            grabpay: None,
8991            ideal: None,
8992            interac_present: None,
8993            kakao_pay: None,
8994            klarna: None,
8995            konbini: None,
8996            kr_card: None,
8997            link: None,
8998            mb_way: None,
8999            metadata: None,
9000            mobilepay: None,
9001            multibanco: None,
9002            naver_pay: None,
9003            nz_bank_account: None,
9004            oxxo: None,
9005            p24: None,
9006            pay_by_bank: None,
9007            payco: None,
9008            paynow: None,
9009            paypal: None,
9010            pix: None,
9011            promptpay: None,
9012            radar_options: None,
9013            revolut_pay: None,
9014            samsung_pay: None,
9015            satispay: None,
9016            sepa_debit: None,
9017            sofort: None,
9018            swish: None,
9019            twint: None,
9020            type_: type_.into(),
9021            us_bank_account: None,
9022            wechat_pay: None,
9023            zip: None,
9024        }
9025    }
9026}
9027/// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
9028/// 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.
9029/// The field defaults to `unspecified`.
9030#[derive(Copy, Clone, Eq, PartialEq)]
9031pub enum ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
9032    Always,
9033    Limited,
9034    Unspecified,
9035}
9036impl ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
9037    pub fn as_str(self) -> &'static str {
9038        use ConfirmSetupIntentPaymentMethodDataAllowRedisplay::*;
9039        match self {
9040            Always => "always",
9041            Limited => "limited",
9042            Unspecified => "unspecified",
9043        }
9044    }
9045}
9046
9047impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
9048    type Err = stripe_types::StripeParseError;
9049    fn from_str(s: &str) -> Result<Self, Self::Err> {
9050        use ConfirmSetupIntentPaymentMethodDataAllowRedisplay::*;
9051        match s {
9052            "always" => Ok(Always),
9053            "limited" => Ok(Limited),
9054            "unspecified" => Ok(Unspecified),
9055            _ => Err(stripe_types::StripeParseError),
9056        }
9057    }
9058}
9059impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
9060    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9061        f.write_str(self.as_str())
9062    }
9063}
9064
9065impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
9066    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9067        f.write_str(self.as_str())
9068    }
9069}
9070impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
9071    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9072    where
9073        S: serde::Serializer,
9074    {
9075        serializer.serialize_str(self.as_str())
9076    }
9077}
9078#[cfg(feature = "deserialize")]
9079impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
9080    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9081        use std::str::FromStr;
9082        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9083        Self::from_str(&s).map_err(|_| {
9084            serde::de::Error::custom(
9085                "Unknown value for ConfirmSetupIntentPaymentMethodDataAllowRedisplay",
9086            )
9087        })
9088    }
9089}
9090/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
9091#[derive(Clone, Debug, serde::Serialize)]
9092pub struct ConfirmSetupIntentPaymentMethodDataAuBecsDebit {
9093    /// The account number for the bank account.
9094    pub account_number: String,
9095    /// Bank-State-Branch number of the bank account.
9096    pub bsb_number: String,
9097}
9098impl ConfirmSetupIntentPaymentMethodDataAuBecsDebit {
9099    pub fn new(account_number: impl Into<String>, bsb_number: impl Into<String>) -> Self {
9100        Self { account_number: account_number.into(), bsb_number: bsb_number.into() }
9101    }
9102}
9103/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
9104#[derive(Clone, Debug, serde::Serialize)]
9105pub struct ConfirmSetupIntentPaymentMethodDataBacsDebit {
9106    /// Account number of the bank account that the funds will be debited from.
9107    #[serde(skip_serializing_if = "Option::is_none")]
9108    pub account_number: Option<String>,
9109    /// Sort code of the bank account. (e.g., `10-20-30`)
9110    #[serde(skip_serializing_if = "Option::is_none")]
9111    pub sort_code: Option<String>,
9112}
9113impl ConfirmSetupIntentPaymentMethodDataBacsDebit {
9114    pub fn new() -> Self {
9115        Self { account_number: None, sort_code: None }
9116    }
9117}
9118impl Default for ConfirmSetupIntentPaymentMethodDataBacsDebit {
9119    fn default() -> Self {
9120        Self::new()
9121    }
9122}
9123/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
9124#[derive(Clone, Debug, serde::Serialize)]
9125pub struct ConfirmSetupIntentPaymentMethodDataBoleto {
9126    /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)
9127    pub tax_id: String,
9128}
9129impl ConfirmSetupIntentPaymentMethodDataBoleto {
9130    pub fn new(tax_id: impl Into<String>) -> Self {
9131        Self { tax_id: tax_id.into() }
9132    }
9133}
9134/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
9135#[derive(Clone, Debug, serde::Serialize)]
9136pub struct ConfirmSetupIntentPaymentMethodDataEps {
9137    /// The customer's bank.
9138    #[serde(skip_serializing_if = "Option::is_none")]
9139    pub bank: Option<ConfirmSetupIntentPaymentMethodDataEpsBank>,
9140}
9141impl ConfirmSetupIntentPaymentMethodDataEps {
9142    pub fn new() -> Self {
9143        Self { bank: None }
9144    }
9145}
9146impl Default for ConfirmSetupIntentPaymentMethodDataEps {
9147    fn default() -> Self {
9148        Self::new()
9149    }
9150}
9151/// The customer's bank.
9152#[derive(Clone, Eq, PartialEq)]
9153#[non_exhaustive]
9154pub enum ConfirmSetupIntentPaymentMethodDataEpsBank {
9155    ArzteUndApothekerBank,
9156    AustrianAnadiBankAg,
9157    BankAustria,
9158    BankhausCarlSpangler,
9159    BankhausSchelhammerUndSchatteraAg,
9160    BawagPskAg,
9161    BksBankAg,
9162    BrullKallmusBankAg,
9163    BtvVierLanderBank,
9164    CapitalBankGraweGruppeAg,
9165    DeutscheBankAg,
9166    Dolomitenbank,
9167    EasybankAg,
9168    ErsteBankUndSparkassen,
9169    HypoAlpeadriabankInternationalAg,
9170    HypoBankBurgenlandAktiengesellschaft,
9171    HypoNoeLbFurNiederosterreichUWien,
9172    HypoOberosterreichSalzburgSteiermark,
9173    HypoTirolBankAg,
9174    HypoVorarlbergBankAg,
9175    MarchfelderBank,
9176    OberbankAg,
9177    RaiffeisenBankengruppeOsterreich,
9178    SchoellerbankAg,
9179    SpardaBankWien,
9180    VolksbankGruppe,
9181    VolkskreditbankAg,
9182    VrBankBraunau,
9183    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9184    Unknown(String),
9185}
9186impl ConfirmSetupIntentPaymentMethodDataEpsBank {
9187    pub fn as_str(&self) -> &str {
9188        use ConfirmSetupIntentPaymentMethodDataEpsBank::*;
9189        match self {
9190            ArzteUndApothekerBank => "arzte_und_apotheker_bank",
9191            AustrianAnadiBankAg => "austrian_anadi_bank_ag",
9192            BankAustria => "bank_austria",
9193            BankhausCarlSpangler => "bankhaus_carl_spangler",
9194            BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag",
9195            BawagPskAg => "bawag_psk_ag",
9196            BksBankAg => "bks_bank_ag",
9197            BrullKallmusBankAg => "brull_kallmus_bank_ag",
9198            BtvVierLanderBank => "btv_vier_lander_bank",
9199            CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
9200            DeutscheBankAg => "deutsche_bank_ag",
9201            Dolomitenbank => "dolomitenbank",
9202            EasybankAg => "easybank_ag",
9203            ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
9204            HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag",
9205            HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft",
9206            HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien",
9207            HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark",
9208            HypoTirolBankAg => "hypo_tirol_bank_ag",
9209            HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
9210            MarchfelderBank => "marchfelder_bank",
9211            OberbankAg => "oberbank_ag",
9212            RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich",
9213            SchoellerbankAg => "schoellerbank_ag",
9214            SpardaBankWien => "sparda_bank_wien",
9215            VolksbankGruppe => "volksbank_gruppe",
9216            VolkskreditbankAg => "volkskreditbank_ag",
9217            VrBankBraunau => "vr_bank_braunau",
9218            Unknown(v) => v,
9219        }
9220    }
9221}
9222
9223impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataEpsBank {
9224    type Err = std::convert::Infallible;
9225    fn from_str(s: &str) -> Result<Self, Self::Err> {
9226        use ConfirmSetupIntentPaymentMethodDataEpsBank::*;
9227        match s {
9228            "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank),
9229            "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg),
9230            "bank_austria" => Ok(BankAustria),
9231            "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler),
9232            "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg),
9233            "bawag_psk_ag" => Ok(BawagPskAg),
9234            "bks_bank_ag" => Ok(BksBankAg),
9235            "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg),
9236            "btv_vier_lander_bank" => Ok(BtvVierLanderBank),
9237            "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg),
9238            "deutsche_bank_ag" => Ok(DeutscheBankAg),
9239            "dolomitenbank" => Ok(Dolomitenbank),
9240            "easybank_ag" => Ok(EasybankAg),
9241            "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen),
9242            "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg),
9243            "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft),
9244            "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien),
9245            "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark),
9246            "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg),
9247            "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg),
9248            "marchfelder_bank" => Ok(MarchfelderBank),
9249            "oberbank_ag" => Ok(OberbankAg),
9250            "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich),
9251            "schoellerbank_ag" => Ok(SchoellerbankAg),
9252            "sparda_bank_wien" => Ok(SpardaBankWien),
9253            "volksbank_gruppe" => Ok(VolksbankGruppe),
9254            "volkskreditbank_ag" => Ok(VolkskreditbankAg),
9255            "vr_bank_braunau" => Ok(VrBankBraunau),
9256            v => Ok(Unknown(v.to_owned())),
9257        }
9258    }
9259}
9260impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataEpsBank {
9261    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9262        f.write_str(self.as_str())
9263    }
9264}
9265
9266impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataEpsBank {
9267    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9268        f.write_str(self.as_str())
9269    }
9270}
9271impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataEpsBank {
9272    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9273    where
9274        S: serde::Serializer,
9275    {
9276        serializer.serialize_str(self.as_str())
9277    }
9278}
9279#[cfg(feature = "deserialize")]
9280impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataEpsBank {
9281    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9282        use std::str::FromStr;
9283        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9284        Ok(Self::from_str(&s).unwrap())
9285    }
9286}
9287/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
9288#[derive(Clone, Debug, serde::Serialize)]
9289pub struct ConfirmSetupIntentPaymentMethodDataFpx {
9290    /// Account holder type for FPX transaction
9291    #[serde(skip_serializing_if = "Option::is_none")]
9292    pub account_holder_type: Option<ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType>,
9293    /// The customer's bank.
9294    pub bank: ConfirmSetupIntentPaymentMethodDataFpxBank,
9295}
9296impl ConfirmSetupIntentPaymentMethodDataFpx {
9297    pub fn new(bank: impl Into<ConfirmSetupIntentPaymentMethodDataFpxBank>) -> Self {
9298        Self { account_holder_type: None, bank: bank.into() }
9299    }
9300}
9301/// Account holder type for FPX transaction
9302#[derive(Copy, Clone, Eq, PartialEq)]
9303pub enum ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
9304    Company,
9305    Individual,
9306}
9307impl ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
9308    pub fn as_str(self) -> &'static str {
9309        use ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType::*;
9310        match self {
9311            Company => "company",
9312            Individual => "individual",
9313        }
9314    }
9315}
9316
9317impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
9318    type Err = stripe_types::StripeParseError;
9319    fn from_str(s: &str) -> Result<Self, Self::Err> {
9320        use ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType::*;
9321        match s {
9322            "company" => Ok(Company),
9323            "individual" => Ok(Individual),
9324            _ => Err(stripe_types::StripeParseError),
9325        }
9326    }
9327}
9328impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
9329    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9330        f.write_str(self.as_str())
9331    }
9332}
9333
9334impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
9335    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9336        f.write_str(self.as_str())
9337    }
9338}
9339impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
9340    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9341    where
9342        S: serde::Serializer,
9343    {
9344        serializer.serialize_str(self.as_str())
9345    }
9346}
9347#[cfg(feature = "deserialize")]
9348impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
9349    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9350        use std::str::FromStr;
9351        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9352        Self::from_str(&s).map_err(|_| {
9353            serde::de::Error::custom(
9354                "Unknown value for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType",
9355            )
9356        })
9357    }
9358}
9359/// The customer's bank.
9360#[derive(Clone, Eq, PartialEq)]
9361#[non_exhaustive]
9362pub enum ConfirmSetupIntentPaymentMethodDataFpxBank {
9363    AffinBank,
9364    Agrobank,
9365    AllianceBank,
9366    Ambank,
9367    BankIslam,
9368    BankMuamalat,
9369    BankOfChina,
9370    BankRakyat,
9371    Bsn,
9372    Cimb,
9373    DeutscheBank,
9374    HongLeongBank,
9375    Hsbc,
9376    Kfh,
9377    Maybank2e,
9378    Maybank2u,
9379    Ocbc,
9380    PbEnterprise,
9381    PublicBank,
9382    Rhb,
9383    StandardChartered,
9384    Uob,
9385    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9386    Unknown(String),
9387}
9388impl ConfirmSetupIntentPaymentMethodDataFpxBank {
9389    pub fn as_str(&self) -> &str {
9390        use ConfirmSetupIntentPaymentMethodDataFpxBank::*;
9391        match self {
9392            AffinBank => "affin_bank",
9393            Agrobank => "agrobank",
9394            AllianceBank => "alliance_bank",
9395            Ambank => "ambank",
9396            BankIslam => "bank_islam",
9397            BankMuamalat => "bank_muamalat",
9398            BankOfChina => "bank_of_china",
9399            BankRakyat => "bank_rakyat",
9400            Bsn => "bsn",
9401            Cimb => "cimb",
9402            DeutscheBank => "deutsche_bank",
9403            HongLeongBank => "hong_leong_bank",
9404            Hsbc => "hsbc",
9405            Kfh => "kfh",
9406            Maybank2e => "maybank2e",
9407            Maybank2u => "maybank2u",
9408            Ocbc => "ocbc",
9409            PbEnterprise => "pb_enterprise",
9410            PublicBank => "public_bank",
9411            Rhb => "rhb",
9412            StandardChartered => "standard_chartered",
9413            Uob => "uob",
9414            Unknown(v) => v,
9415        }
9416    }
9417}
9418
9419impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataFpxBank {
9420    type Err = std::convert::Infallible;
9421    fn from_str(s: &str) -> Result<Self, Self::Err> {
9422        use ConfirmSetupIntentPaymentMethodDataFpxBank::*;
9423        match s {
9424            "affin_bank" => Ok(AffinBank),
9425            "agrobank" => Ok(Agrobank),
9426            "alliance_bank" => Ok(AllianceBank),
9427            "ambank" => Ok(Ambank),
9428            "bank_islam" => Ok(BankIslam),
9429            "bank_muamalat" => Ok(BankMuamalat),
9430            "bank_of_china" => Ok(BankOfChina),
9431            "bank_rakyat" => Ok(BankRakyat),
9432            "bsn" => Ok(Bsn),
9433            "cimb" => Ok(Cimb),
9434            "deutsche_bank" => Ok(DeutscheBank),
9435            "hong_leong_bank" => Ok(HongLeongBank),
9436            "hsbc" => Ok(Hsbc),
9437            "kfh" => Ok(Kfh),
9438            "maybank2e" => Ok(Maybank2e),
9439            "maybank2u" => Ok(Maybank2u),
9440            "ocbc" => Ok(Ocbc),
9441            "pb_enterprise" => Ok(PbEnterprise),
9442            "public_bank" => Ok(PublicBank),
9443            "rhb" => Ok(Rhb),
9444            "standard_chartered" => Ok(StandardChartered),
9445            "uob" => Ok(Uob),
9446            v => Ok(Unknown(v.to_owned())),
9447        }
9448    }
9449}
9450impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataFpxBank {
9451    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9452        f.write_str(self.as_str())
9453    }
9454}
9455
9456impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataFpxBank {
9457    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9458        f.write_str(self.as_str())
9459    }
9460}
9461impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataFpxBank {
9462    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9463    where
9464        S: serde::Serializer,
9465    {
9466        serializer.serialize_str(self.as_str())
9467    }
9468}
9469#[cfg(feature = "deserialize")]
9470impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataFpxBank {
9471    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9472        use std::str::FromStr;
9473        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9474        Ok(Self::from_str(&s).unwrap())
9475    }
9476}
9477/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
9478#[derive(Clone, Debug, serde::Serialize)]
9479pub struct ConfirmSetupIntentPaymentMethodDataIdeal {
9480    /// The customer's bank.
9481    /// Only use this parameter for existing customers.
9482    /// Don't use it for new customers.
9483    #[serde(skip_serializing_if = "Option::is_none")]
9484    pub bank: Option<ConfirmSetupIntentPaymentMethodDataIdealBank>,
9485}
9486impl ConfirmSetupIntentPaymentMethodDataIdeal {
9487    pub fn new() -> Self {
9488        Self { bank: None }
9489    }
9490}
9491impl Default for ConfirmSetupIntentPaymentMethodDataIdeal {
9492    fn default() -> Self {
9493        Self::new()
9494    }
9495}
9496/// The customer's bank.
9497/// Only use this parameter for existing customers.
9498/// Don't use it for new customers.
9499#[derive(Clone, Eq, PartialEq)]
9500#[non_exhaustive]
9501pub enum ConfirmSetupIntentPaymentMethodDataIdealBank {
9502    AbnAmro,
9503    AsnBank,
9504    Bunq,
9505    Buut,
9506    Handelsbanken,
9507    Ing,
9508    Knab,
9509    Moneyou,
9510    N26,
9511    Nn,
9512    Rabobank,
9513    Regiobank,
9514    Revolut,
9515    SnsBank,
9516    TriodosBank,
9517    VanLanschot,
9518    Yoursafe,
9519    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9520    Unknown(String),
9521}
9522impl ConfirmSetupIntentPaymentMethodDataIdealBank {
9523    pub fn as_str(&self) -> &str {
9524        use ConfirmSetupIntentPaymentMethodDataIdealBank::*;
9525        match self {
9526            AbnAmro => "abn_amro",
9527            AsnBank => "asn_bank",
9528            Bunq => "bunq",
9529            Buut => "buut",
9530            Handelsbanken => "handelsbanken",
9531            Ing => "ing",
9532            Knab => "knab",
9533            Moneyou => "moneyou",
9534            N26 => "n26",
9535            Nn => "nn",
9536            Rabobank => "rabobank",
9537            Regiobank => "regiobank",
9538            Revolut => "revolut",
9539            SnsBank => "sns_bank",
9540            TriodosBank => "triodos_bank",
9541            VanLanschot => "van_lanschot",
9542            Yoursafe => "yoursafe",
9543            Unknown(v) => v,
9544        }
9545    }
9546}
9547
9548impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataIdealBank {
9549    type Err = std::convert::Infallible;
9550    fn from_str(s: &str) -> Result<Self, Self::Err> {
9551        use ConfirmSetupIntentPaymentMethodDataIdealBank::*;
9552        match s {
9553            "abn_amro" => Ok(AbnAmro),
9554            "asn_bank" => Ok(AsnBank),
9555            "bunq" => Ok(Bunq),
9556            "buut" => Ok(Buut),
9557            "handelsbanken" => Ok(Handelsbanken),
9558            "ing" => Ok(Ing),
9559            "knab" => Ok(Knab),
9560            "moneyou" => Ok(Moneyou),
9561            "n26" => Ok(N26),
9562            "nn" => Ok(Nn),
9563            "rabobank" => Ok(Rabobank),
9564            "regiobank" => Ok(Regiobank),
9565            "revolut" => Ok(Revolut),
9566            "sns_bank" => Ok(SnsBank),
9567            "triodos_bank" => Ok(TriodosBank),
9568            "van_lanschot" => Ok(VanLanschot),
9569            "yoursafe" => Ok(Yoursafe),
9570            v => Ok(Unknown(v.to_owned())),
9571        }
9572    }
9573}
9574impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataIdealBank {
9575    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9576        f.write_str(self.as_str())
9577    }
9578}
9579
9580impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataIdealBank {
9581    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9582        f.write_str(self.as_str())
9583    }
9584}
9585impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataIdealBank {
9586    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9587    where
9588        S: serde::Serializer,
9589    {
9590        serializer.serialize_str(self.as_str())
9591    }
9592}
9593#[cfg(feature = "deserialize")]
9594impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataIdealBank {
9595    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9596        use std::str::FromStr;
9597        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9598        Ok(Self::from_str(&s).unwrap())
9599    }
9600}
9601/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
9602#[derive(Copy, Clone, Debug, serde::Serialize)]
9603pub struct ConfirmSetupIntentPaymentMethodDataKlarna {
9604    /// Customer's date of birth
9605    #[serde(skip_serializing_if = "Option::is_none")]
9606    pub dob: Option<DateOfBirth>,
9607}
9608impl ConfirmSetupIntentPaymentMethodDataKlarna {
9609    pub fn new() -> Self {
9610        Self { dob: None }
9611    }
9612}
9613impl Default for ConfirmSetupIntentPaymentMethodDataKlarna {
9614    fn default() -> Self {
9615        Self::new()
9616    }
9617}
9618/// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
9619#[derive(Copy, Clone, Debug, serde::Serialize)]
9620pub struct ConfirmSetupIntentPaymentMethodDataNaverPay {
9621    /// Whether to use Naver Pay points or a card to fund this transaction.
9622    /// If not provided, this defaults to `card`.
9623    #[serde(skip_serializing_if = "Option::is_none")]
9624    pub funding: Option<ConfirmSetupIntentPaymentMethodDataNaverPayFunding>,
9625}
9626impl ConfirmSetupIntentPaymentMethodDataNaverPay {
9627    pub fn new() -> Self {
9628        Self { funding: None }
9629    }
9630}
9631impl Default for ConfirmSetupIntentPaymentMethodDataNaverPay {
9632    fn default() -> Self {
9633        Self::new()
9634    }
9635}
9636/// Whether to use Naver Pay points or a card to fund this transaction.
9637/// If not provided, this defaults to `card`.
9638#[derive(Copy, Clone, Eq, PartialEq)]
9639pub enum ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
9640    Card,
9641    Points,
9642}
9643impl ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
9644    pub fn as_str(self) -> &'static str {
9645        use ConfirmSetupIntentPaymentMethodDataNaverPayFunding::*;
9646        match self {
9647            Card => "card",
9648            Points => "points",
9649        }
9650    }
9651}
9652
9653impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
9654    type Err = stripe_types::StripeParseError;
9655    fn from_str(s: &str) -> Result<Self, Self::Err> {
9656        use ConfirmSetupIntentPaymentMethodDataNaverPayFunding::*;
9657        match s {
9658            "card" => Ok(Card),
9659            "points" => Ok(Points),
9660            _ => Err(stripe_types::StripeParseError),
9661        }
9662    }
9663}
9664impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
9665    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9666        f.write_str(self.as_str())
9667    }
9668}
9669
9670impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
9671    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9672        f.write_str(self.as_str())
9673    }
9674}
9675impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
9676    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9677    where
9678        S: serde::Serializer,
9679    {
9680        serializer.serialize_str(self.as_str())
9681    }
9682}
9683#[cfg(feature = "deserialize")]
9684impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
9685    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9686        use std::str::FromStr;
9687        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9688        Self::from_str(&s).map_err(|_| {
9689            serde::de::Error::custom(
9690                "Unknown value for ConfirmSetupIntentPaymentMethodDataNaverPayFunding",
9691            )
9692        })
9693    }
9694}
9695/// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
9696#[derive(Clone, Debug, serde::Serialize)]
9697pub struct ConfirmSetupIntentPaymentMethodDataNzBankAccount {
9698    /// The name on the bank account.
9699    /// Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod’s billing details.
9700    #[serde(skip_serializing_if = "Option::is_none")]
9701    pub account_holder_name: Option<String>,
9702    /// The account number for the bank account.
9703    pub account_number: String,
9704    /// The numeric code for the bank account's bank.
9705    pub bank_code: String,
9706    /// The numeric code for the bank account's bank branch.
9707    pub branch_code: String,
9708    #[serde(skip_serializing_if = "Option::is_none")]
9709    pub reference: Option<String>,
9710    /// The suffix of the bank account number.
9711    pub suffix: String,
9712}
9713impl ConfirmSetupIntentPaymentMethodDataNzBankAccount {
9714    pub fn new(
9715        account_number: impl Into<String>,
9716        bank_code: impl Into<String>,
9717        branch_code: impl Into<String>,
9718        suffix: impl Into<String>,
9719    ) -> Self {
9720        Self {
9721            account_holder_name: None,
9722            account_number: account_number.into(),
9723            bank_code: bank_code.into(),
9724            branch_code: branch_code.into(),
9725            reference: None,
9726            suffix: suffix.into(),
9727        }
9728    }
9729}
9730/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
9731#[derive(Clone, Debug, serde::Serialize)]
9732pub struct ConfirmSetupIntentPaymentMethodDataP24 {
9733    /// The customer's bank.
9734    #[serde(skip_serializing_if = "Option::is_none")]
9735    pub bank: Option<ConfirmSetupIntentPaymentMethodDataP24Bank>,
9736}
9737impl ConfirmSetupIntentPaymentMethodDataP24 {
9738    pub fn new() -> Self {
9739        Self { bank: None }
9740    }
9741}
9742impl Default for ConfirmSetupIntentPaymentMethodDataP24 {
9743    fn default() -> Self {
9744        Self::new()
9745    }
9746}
9747/// The customer's bank.
9748#[derive(Clone, Eq, PartialEq)]
9749#[non_exhaustive]
9750pub enum ConfirmSetupIntentPaymentMethodDataP24Bank {
9751    AliorBank,
9752    BankMillennium,
9753    BankNowyBfgSa,
9754    BankPekaoSa,
9755    BankiSpbdzielcze,
9756    Blik,
9757    BnpParibas,
9758    Boz,
9759    CitiHandlowy,
9760    CreditAgricole,
9761    Envelobank,
9762    EtransferPocztowy24,
9763    GetinBank,
9764    Ideabank,
9765    Ing,
9766    Inteligo,
9767    MbankMtransfer,
9768    NestPrzelew,
9769    NoblePay,
9770    PbacZIpko,
9771    PlusBank,
9772    SantanderPrzelew24,
9773    TmobileUsbugiBankowe,
9774    ToyotaBank,
9775    Velobank,
9776    VolkswagenBank,
9777    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9778    Unknown(String),
9779}
9780impl ConfirmSetupIntentPaymentMethodDataP24Bank {
9781    pub fn as_str(&self) -> &str {
9782        use ConfirmSetupIntentPaymentMethodDataP24Bank::*;
9783        match self {
9784            AliorBank => "alior_bank",
9785            BankMillennium => "bank_millennium",
9786            BankNowyBfgSa => "bank_nowy_bfg_sa",
9787            BankPekaoSa => "bank_pekao_sa",
9788            BankiSpbdzielcze => "banki_spbdzielcze",
9789            Blik => "blik",
9790            BnpParibas => "bnp_paribas",
9791            Boz => "boz",
9792            CitiHandlowy => "citi_handlowy",
9793            CreditAgricole => "credit_agricole",
9794            Envelobank => "envelobank",
9795            EtransferPocztowy24 => "etransfer_pocztowy24",
9796            GetinBank => "getin_bank",
9797            Ideabank => "ideabank",
9798            Ing => "ing",
9799            Inteligo => "inteligo",
9800            MbankMtransfer => "mbank_mtransfer",
9801            NestPrzelew => "nest_przelew",
9802            NoblePay => "noble_pay",
9803            PbacZIpko => "pbac_z_ipko",
9804            PlusBank => "plus_bank",
9805            SantanderPrzelew24 => "santander_przelew24",
9806            TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
9807            ToyotaBank => "toyota_bank",
9808            Velobank => "velobank",
9809            VolkswagenBank => "volkswagen_bank",
9810            Unknown(v) => v,
9811        }
9812    }
9813}
9814
9815impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataP24Bank {
9816    type Err = std::convert::Infallible;
9817    fn from_str(s: &str) -> Result<Self, Self::Err> {
9818        use ConfirmSetupIntentPaymentMethodDataP24Bank::*;
9819        match s {
9820            "alior_bank" => Ok(AliorBank),
9821            "bank_millennium" => Ok(BankMillennium),
9822            "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa),
9823            "bank_pekao_sa" => Ok(BankPekaoSa),
9824            "banki_spbdzielcze" => Ok(BankiSpbdzielcze),
9825            "blik" => Ok(Blik),
9826            "bnp_paribas" => Ok(BnpParibas),
9827            "boz" => Ok(Boz),
9828            "citi_handlowy" => Ok(CitiHandlowy),
9829            "credit_agricole" => Ok(CreditAgricole),
9830            "envelobank" => Ok(Envelobank),
9831            "etransfer_pocztowy24" => Ok(EtransferPocztowy24),
9832            "getin_bank" => Ok(GetinBank),
9833            "ideabank" => Ok(Ideabank),
9834            "ing" => Ok(Ing),
9835            "inteligo" => Ok(Inteligo),
9836            "mbank_mtransfer" => Ok(MbankMtransfer),
9837            "nest_przelew" => Ok(NestPrzelew),
9838            "noble_pay" => Ok(NoblePay),
9839            "pbac_z_ipko" => Ok(PbacZIpko),
9840            "plus_bank" => Ok(PlusBank),
9841            "santander_przelew24" => Ok(SantanderPrzelew24),
9842            "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe),
9843            "toyota_bank" => Ok(ToyotaBank),
9844            "velobank" => Ok(Velobank),
9845            "volkswagen_bank" => Ok(VolkswagenBank),
9846            v => Ok(Unknown(v.to_owned())),
9847        }
9848    }
9849}
9850impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataP24Bank {
9851    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9852        f.write_str(self.as_str())
9853    }
9854}
9855
9856impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataP24Bank {
9857    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9858        f.write_str(self.as_str())
9859    }
9860}
9861impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataP24Bank {
9862    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9863    where
9864        S: serde::Serializer,
9865    {
9866        serializer.serialize_str(self.as_str())
9867    }
9868}
9869#[cfg(feature = "deserialize")]
9870impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataP24Bank {
9871    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9872        use std::str::FromStr;
9873        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9874        Ok(Self::from_str(&s).unwrap())
9875    }
9876}
9877/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
9878#[derive(Clone, Debug, serde::Serialize)]
9879pub struct ConfirmSetupIntentPaymentMethodDataSepaDebit {
9880    /// IBAN of the bank account.
9881    pub iban: String,
9882}
9883impl ConfirmSetupIntentPaymentMethodDataSepaDebit {
9884    pub fn new(iban: impl Into<String>) -> Self {
9885        Self { iban: iban.into() }
9886    }
9887}
9888/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
9889#[derive(Copy, Clone, Debug, serde::Serialize)]
9890pub struct ConfirmSetupIntentPaymentMethodDataSofort {
9891    /// Two-letter ISO code representing the country the bank account is located in.
9892    pub country: ConfirmSetupIntentPaymentMethodDataSofortCountry,
9893}
9894impl ConfirmSetupIntentPaymentMethodDataSofort {
9895    pub fn new(country: impl Into<ConfirmSetupIntentPaymentMethodDataSofortCountry>) -> Self {
9896        Self { country: country.into() }
9897    }
9898}
9899/// Two-letter ISO code representing the country the bank account is located in.
9900#[derive(Copy, Clone, Eq, PartialEq)]
9901pub enum ConfirmSetupIntentPaymentMethodDataSofortCountry {
9902    At,
9903    Be,
9904    De,
9905    Es,
9906    It,
9907    Nl,
9908}
9909impl ConfirmSetupIntentPaymentMethodDataSofortCountry {
9910    pub fn as_str(self) -> &'static str {
9911        use ConfirmSetupIntentPaymentMethodDataSofortCountry::*;
9912        match self {
9913            At => "AT",
9914            Be => "BE",
9915            De => "DE",
9916            Es => "ES",
9917            It => "IT",
9918            Nl => "NL",
9919        }
9920    }
9921}
9922
9923impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataSofortCountry {
9924    type Err = stripe_types::StripeParseError;
9925    fn from_str(s: &str) -> Result<Self, Self::Err> {
9926        use ConfirmSetupIntentPaymentMethodDataSofortCountry::*;
9927        match s {
9928            "AT" => Ok(At),
9929            "BE" => Ok(Be),
9930            "DE" => Ok(De),
9931            "ES" => Ok(Es),
9932            "IT" => Ok(It),
9933            "NL" => Ok(Nl),
9934            _ => Err(stripe_types::StripeParseError),
9935        }
9936    }
9937}
9938impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataSofortCountry {
9939    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9940        f.write_str(self.as_str())
9941    }
9942}
9943
9944impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataSofortCountry {
9945    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9946        f.write_str(self.as_str())
9947    }
9948}
9949impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataSofortCountry {
9950    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9951    where
9952        S: serde::Serializer,
9953    {
9954        serializer.serialize_str(self.as_str())
9955    }
9956}
9957#[cfg(feature = "deserialize")]
9958impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataSofortCountry {
9959    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9960        use std::str::FromStr;
9961        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9962        Self::from_str(&s).map_err(|_| {
9963            serde::de::Error::custom(
9964                "Unknown value for ConfirmSetupIntentPaymentMethodDataSofortCountry",
9965            )
9966        })
9967    }
9968}
9969/// The type of the PaymentMethod.
9970/// An additional hash is included on the PaymentMethod with a name matching this value.
9971/// It contains additional information specific to the PaymentMethod type.
9972#[derive(Clone, Eq, PartialEq)]
9973#[non_exhaustive]
9974pub enum ConfirmSetupIntentPaymentMethodDataType {
9975    AcssDebit,
9976    Affirm,
9977    AfterpayClearpay,
9978    Alipay,
9979    Alma,
9980    AmazonPay,
9981    AuBecsDebit,
9982    BacsDebit,
9983    Bancontact,
9984    Billie,
9985    Blik,
9986    Boleto,
9987    Cashapp,
9988    Crypto,
9989    CustomerBalance,
9990    Eps,
9991    Fpx,
9992    Giropay,
9993    Grabpay,
9994    Ideal,
9995    KakaoPay,
9996    Klarna,
9997    Konbini,
9998    KrCard,
9999    Link,
10000    MbWay,
10001    Mobilepay,
10002    Multibanco,
10003    NaverPay,
10004    NzBankAccount,
10005    Oxxo,
10006    P24,
10007    PayByBank,
10008    Payco,
10009    Paynow,
10010    Paypal,
10011    Pix,
10012    Promptpay,
10013    RevolutPay,
10014    SamsungPay,
10015    Satispay,
10016    SepaDebit,
10017    Sofort,
10018    Swish,
10019    Twint,
10020    UsBankAccount,
10021    WechatPay,
10022    Zip,
10023    /// An unrecognized value from Stripe. Should not be used as a request parameter.
10024    Unknown(String),
10025}
10026impl ConfirmSetupIntentPaymentMethodDataType {
10027    pub fn as_str(&self) -> &str {
10028        use ConfirmSetupIntentPaymentMethodDataType::*;
10029        match self {
10030            AcssDebit => "acss_debit",
10031            Affirm => "affirm",
10032            AfterpayClearpay => "afterpay_clearpay",
10033            Alipay => "alipay",
10034            Alma => "alma",
10035            AmazonPay => "amazon_pay",
10036            AuBecsDebit => "au_becs_debit",
10037            BacsDebit => "bacs_debit",
10038            Bancontact => "bancontact",
10039            Billie => "billie",
10040            Blik => "blik",
10041            Boleto => "boleto",
10042            Cashapp => "cashapp",
10043            Crypto => "crypto",
10044            CustomerBalance => "customer_balance",
10045            Eps => "eps",
10046            Fpx => "fpx",
10047            Giropay => "giropay",
10048            Grabpay => "grabpay",
10049            Ideal => "ideal",
10050            KakaoPay => "kakao_pay",
10051            Klarna => "klarna",
10052            Konbini => "konbini",
10053            KrCard => "kr_card",
10054            Link => "link",
10055            MbWay => "mb_way",
10056            Mobilepay => "mobilepay",
10057            Multibanco => "multibanco",
10058            NaverPay => "naver_pay",
10059            NzBankAccount => "nz_bank_account",
10060            Oxxo => "oxxo",
10061            P24 => "p24",
10062            PayByBank => "pay_by_bank",
10063            Payco => "payco",
10064            Paynow => "paynow",
10065            Paypal => "paypal",
10066            Pix => "pix",
10067            Promptpay => "promptpay",
10068            RevolutPay => "revolut_pay",
10069            SamsungPay => "samsung_pay",
10070            Satispay => "satispay",
10071            SepaDebit => "sepa_debit",
10072            Sofort => "sofort",
10073            Swish => "swish",
10074            Twint => "twint",
10075            UsBankAccount => "us_bank_account",
10076            WechatPay => "wechat_pay",
10077            Zip => "zip",
10078            Unknown(v) => v,
10079        }
10080    }
10081}
10082
10083impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataType {
10084    type Err = std::convert::Infallible;
10085    fn from_str(s: &str) -> Result<Self, Self::Err> {
10086        use ConfirmSetupIntentPaymentMethodDataType::*;
10087        match s {
10088            "acss_debit" => Ok(AcssDebit),
10089            "affirm" => Ok(Affirm),
10090            "afterpay_clearpay" => Ok(AfterpayClearpay),
10091            "alipay" => Ok(Alipay),
10092            "alma" => Ok(Alma),
10093            "amazon_pay" => Ok(AmazonPay),
10094            "au_becs_debit" => Ok(AuBecsDebit),
10095            "bacs_debit" => Ok(BacsDebit),
10096            "bancontact" => Ok(Bancontact),
10097            "billie" => Ok(Billie),
10098            "blik" => Ok(Blik),
10099            "boleto" => Ok(Boleto),
10100            "cashapp" => Ok(Cashapp),
10101            "crypto" => Ok(Crypto),
10102            "customer_balance" => Ok(CustomerBalance),
10103            "eps" => Ok(Eps),
10104            "fpx" => Ok(Fpx),
10105            "giropay" => Ok(Giropay),
10106            "grabpay" => Ok(Grabpay),
10107            "ideal" => Ok(Ideal),
10108            "kakao_pay" => Ok(KakaoPay),
10109            "klarna" => Ok(Klarna),
10110            "konbini" => Ok(Konbini),
10111            "kr_card" => Ok(KrCard),
10112            "link" => Ok(Link),
10113            "mb_way" => Ok(MbWay),
10114            "mobilepay" => Ok(Mobilepay),
10115            "multibanco" => Ok(Multibanco),
10116            "naver_pay" => Ok(NaverPay),
10117            "nz_bank_account" => Ok(NzBankAccount),
10118            "oxxo" => Ok(Oxxo),
10119            "p24" => Ok(P24),
10120            "pay_by_bank" => Ok(PayByBank),
10121            "payco" => Ok(Payco),
10122            "paynow" => Ok(Paynow),
10123            "paypal" => Ok(Paypal),
10124            "pix" => Ok(Pix),
10125            "promptpay" => Ok(Promptpay),
10126            "revolut_pay" => Ok(RevolutPay),
10127            "samsung_pay" => Ok(SamsungPay),
10128            "satispay" => Ok(Satispay),
10129            "sepa_debit" => Ok(SepaDebit),
10130            "sofort" => Ok(Sofort),
10131            "swish" => Ok(Swish),
10132            "twint" => Ok(Twint),
10133            "us_bank_account" => Ok(UsBankAccount),
10134            "wechat_pay" => Ok(WechatPay),
10135            "zip" => Ok(Zip),
10136            v => Ok(Unknown(v.to_owned())),
10137        }
10138    }
10139}
10140impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataType {
10141    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10142        f.write_str(self.as_str())
10143    }
10144}
10145
10146impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataType {
10147    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10148        f.write_str(self.as_str())
10149    }
10150}
10151impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataType {
10152    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10153    where
10154        S: serde::Serializer,
10155    {
10156        serializer.serialize_str(self.as_str())
10157    }
10158}
10159#[cfg(feature = "deserialize")]
10160impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataType {
10161    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10162        use std::str::FromStr;
10163        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10164        Ok(Self::from_str(&s).unwrap())
10165    }
10166}
10167/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
10168#[derive(Clone, Debug, serde::Serialize)]
10169pub struct ConfirmSetupIntentPaymentMethodDataUsBankAccount {
10170    /// Account holder type: individual or company.
10171    #[serde(skip_serializing_if = "Option::is_none")]
10172    pub account_holder_type:
10173        Option<ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType>,
10174    /// Account number of the bank account.
10175    #[serde(skip_serializing_if = "Option::is_none")]
10176    pub account_number: Option<String>,
10177    /// Account type: checkings or savings. Defaults to checking if omitted.
10178    #[serde(skip_serializing_if = "Option::is_none")]
10179    pub account_type: Option<ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType>,
10180    /// The ID of a Financial Connections Account to use as a payment method.
10181    #[serde(skip_serializing_if = "Option::is_none")]
10182    pub financial_connections_account: Option<String>,
10183    /// Routing number of the bank account.
10184    #[serde(skip_serializing_if = "Option::is_none")]
10185    pub routing_number: Option<String>,
10186}
10187impl ConfirmSetupIntentPaymentMethodDataUsBankAccount {
10188    pub fn new() -> Self {
10189        Self {
10190            account_holder_type: None,
10191            account_number: None,
10192            account_type: None,
10193            financial_connections_account: None,
10194            routing_number: None,
10195        }
10196    }
10197}
10198impl Default for ConfirmSetupIntentPaymentMethodDataUsBankAccount {
10199    fn default() -> Self {
10200        Self::new()
10201    }
10202}
10203/// Account holder type: individual or company.
10204#[derive(Copy, Clone, Eq, PartialEq)]
10205pub enum ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
10206    Company,
10207    Individual,
10208}
10209impl ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
10210    pub fn as_str(self) -> &'static str {
10211        use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
10212        match self {
10213            Company => "company",
10214            Individual => "individual",
10215        }
10216    }
10217}
10218
10219impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
10220    type Err = stripe_types::StripeParseError;
10221    fn from_str(s: &str) -> Result<Self, Self::Err> {
10222        use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
10223        match s {
10224            "company" => Ok(Company),
10225            "individual" => Ok(Individual),
10226            _ => Err(stripe_types::StripeParseError),
10227        }
10228    }
10229}
10230impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
10231    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10232        f.write_str(self.as_str())
10233    }
10234}
10235
10236impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
10237    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10238        f.write_str(self.as_str())
10239    }
10240}
10241impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
10242    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10243    where
10244        S: serde::Serializer,
10245    {
10246        serializer.serialize_str(self.as_str())
10247    }
10248}
10249#[cfg(feature = "deserialize")]
10250impl<'de> serde::Deserialize<'de>
10251    for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType
10252{
10253    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10254        use std::str::FromStr;
10255        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10256        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType"))
10257    }
10258}
10259/// Account type: checkings or savings. Defaults to checking if omitted.
10260#[derive(Copy, Clone, Eq, PartialEq)]
10261pub enum ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
10262    Checking,
10263    Savings,
10264}
10265impl ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
10266    pub fn as_str(self) -> &'static str {
10267        use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
10268        match self {
10269            Checking => "checking",
10270            Savings => "savings",
10271        }
10272    }
10273}
10274
10275impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
10276    type Err = stripe_types::StripeParseError;
10277    fn from_str(s: &str) -> Result<Self, Self::Err> {
10278        use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
10279        match s {
10280            "checking" => Ok(Checking),
10281            "savings" => Ok(Savings),
10282            _ => Err(stripe_types::StripeParseError),
10283        }
10284    }
10285}
10286impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
10287    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10288        f.write_str(self.as_str())
10289    }
10290}
10291
10292impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
10293    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10294        f.write_str(self.as_str())
10295    }
10296}
10297impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
10298    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10299    where
10300        S: serde::Serializer,
10301    {
10302        serializer.serialize_str(self.as_str())
10303    }
10304}
10305#[cfg(feature = "deserialize")]
10306impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
10307    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10308        use std::str::FromStr;
10309        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10310        Self::from_str(&s).map_err(|_| {
10311            serde::de::Error::custom(
10312                "Unknown value for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType",
10313            )
10314        })
10315    }
10316}
10317/// Payment method-specific configuration for this SetupIntent.
10318#[derive(Clone, Debug, serde::Serialize)]
10319pub struct ConfirmSetupIntentPaymentMethodOptions {
10320    /// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options.
10321    #[serde(skip_serializing_if = "Option::is_none")]
10322    pub acss_debit: Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebit>,
10323    /// If this is a `amazon_pay` SetupIntent, this sub-hash contains details about the AmazonPay payment method options.
10324    #[serde(skip_serializing_if = "Option::is_none")]
10325    #[serde(with = "stripe_types::with_serde_json_opt")]
10326    pub amazon_pay: Option<miniserde::json::Value>,
10327    /// If this is a `bacs_debit` SetupIntent, this sub-hash contains details about the Bacs Debit payment method options.
10328    #[serde(skip_serializing_if = "Option::is_none")]
10329    pub bacs_debit: Option<ConfirmSetupIntentPaymentMethodOptionsBacsDebit>,
10330    /// Configuration for any card setup attempted on this SetupIntent.
10331    #[serde(skip_serializing_if = "Option::is_none")]
10332    pub card: Option<ConfirmSetupIntentPaymentMethodOptionsCard>,
10333    /// If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options.
10334    #[serde(skip_serializing_if = "Option::is_none")]
10335    #[serde(with = "stripe_types::with_serde_json_opt")]
10336    pub card_present: Option<miniserde::json::Value>,
10337    /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options.
10338    #[serde(skip_serializing_if = "Option::is_none")]
10339    pub klarna: Option<ConfirmSetupIntentPaymentMethodOptionsKlarna>,
10340    /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
10341    #[serde(skip_serializing_if = "Option::is_none")]
10342    pub link: Option<SetupIntentPaymentMethodOptionsParam>,
10343    /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
10344    #[serde(skip_serializing_if = "Option::is_none")]
10345    pub paypal: Option<PaymentMethodOptionsParam>,
10346    /// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options.
10347    #[serde(skip_serializing_if = "Option::is_none")]
10348    pub sepa_debit: Option<ConfirmSetupIntentPaymentMethodOptionsSepaDebit>,
10349    /// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options.
10350    #[serde(skip_serializing_if = "Option::is_none")]
10351    pub us_bank_account: Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccount>,
10352}
10353impl ConfirmSetupIntentPaymentMethodOptions {
10354    pub fn new() -> Self {
10355        Self {
10356            acss_debit: None,
10357            amazon_pay: None,
10358            bacs_debit: None,
10359            card: None,
10360            card_present: None,
10361            klarna: None,
10362            link: None,
10363            paypal: None,
10364            sepa_debit: None,
10365            us_bank_account: None,
10366        }
10367    }
10368}
10369impl Default for ConfirmSetupIntentPaymentMethodOptions {
10370    fn default() -> Self {
10371        Self::new()
10372    }
10373}
10374/// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options.
10375#[derive(Clone, Debug, serde::Serialize)]
10376pub struct ConfirmSetupIntentPaymentMethodOptionsAcssDebit {
10377    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
10378    /// Must be a [supported currency](https://stripe.com/docs/currencies).
10379    #[serde(skip_serializing_if = "Option::is_none")]
10380    pub currency: Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency>,
10381    /// Additional fields for Mandate creation
10382    #[serde(skip_serializing_if = "Option::is_none")]
10383    pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions>,
10384    /// Bank account verification method.
10385    #[serde(skip_serializing_if = "Option::is_none")]
10386    pub verification_method:
10387        Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
10388}
10389impl ConfirmSetupIntentPaymentMethodOptionsAcssDebit {
10390    pub fn new() -> Self {
10391        Self { currency: None, mandate_options: None, verification_method: None }
10392    }
10393}
10394impl Default for ConfirmSetupIntentPaymentMethodOptionsAcssDebit {
10395    fn default() -> Self {
10396        Self::new()
10397    }
10398}
10399/// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
10400/// Must be a [supported currency](https://stripe.com/docs/currencies).
10401#[derive(Copy, Clone, Eq, PartialEq)]
10402pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
10403    Cad,
10404    Usd,
10405}
10406impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
10407    pub fn as_str(self) -> &'static str {
10408        use ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
10409        match self {
10410            Cad => "cad",
10411            Usd => "usd",
10412        }
10413    }
10414}
10415
10416impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
10417    type Err = stripe_types::StripeParseError;
10418    fn from_str(s: &str) -> Result<Self, Self::Err> {
10419        use ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
10420        match s {
10421            "cad" => Ok(Cad),
10422            "usd" => Ok(Usd),
10423            _ => Err(stripe_types::StripeParseError),
10424        }
10425    }
10426}
10427impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
10428    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10429        f.write_str(self.as_str())
10430    }
10431}
10432
10433impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
10434    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10435        f.write_str(self.as_str())
10436    }
10437}
10438impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
10439    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10440    where
10441        S: serde::Serializer,
10442    {
10443        serializer.serialize_str(self.as_str())
10444    }
10445}
10446#[cfg(feature = "deserialize")]
10447impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
10448    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10449        use std::str::FromStr;
10450        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10451        Self::from_str(&s).map_err(|_| {
10452            serde::de::Error::custom(
10453                "Unknown value for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency",
10454            )
10455        })
10456    }
10457}
10458/// Additional fields for Mandate creation
10459#[derive(Clone, Debug, serde::Serialize)]
10460pub struct ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
10461    /// A URL for custom mandate text to render during confirmation step.
10462    /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,.
10463    /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent.
10464    #[serde(skip_serializing_if = "Option::is_none")]
10465    pub custom_mandate_url: Option<String>,
10466    /// List of Stripe products where this mandate can be selected automatically.
10467    #[serde(skip_serializing_if = "Option::is_none")]
10468    pub default_for:
10469        Option<Vec<ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor>>,
10470    /// Description of the mandate interval.
10471    /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'.
10472    #[serde(skip_serializing_if = "Option::is_none")]
10473    pub interval_description: Option<String>,
10474    /// Payment schedule for the mandate.
10475    #[serde(skip_serializing_if = "Option::is_none")]
10476    pub payment_schedule:
10477        Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
10478    /// Transaction type of the mandate.
10479    #[serde(skip_serializing_if = "Option::is_none")]
10480    pub transaction_type:
10481        Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
10482}
10483impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
10484    pub fn new() -> Self {
10485        Self {
10486            custom_mandate_url: None,
10487            default_for: None,
10488            interval_description: None,
10489            payment_schedule: None,
10490            transaction_type: None,
10491        }
10492    }
10493}
10494impl Default for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
10495    fn default() -> Self {
10496        Self::new()
10497    }
10498}
10499/// List of Stripe products where this mandate can be selected automatically.
10500#[derive(Copy, Clone, Eq, PartialEq)]
10501pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
10502    Invoice,
10503    Subscription,
10504}
10505impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
10506    pub fn as_str(self) -> &'static str {
10507        use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
10508        match self {
10509            Invoice => "invoice",
10510            Subscription => "subscription",
10511        }
10512    }
10513}
10514
10515impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
10516    type Err = stripe_types::StripeParseError;
10517    fn from_str(s: &str) -> Result<Self, Self::Err> {
10518        use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
10519        match s {
10520            "invoice" => Ok(Invoice),
10521            "subscription" => Ok(Subscription),
10522            _ => Err(stripe_types::StripeParseError),
10523        }
10524    }
10525}
10526impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
10527    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10528        f.write_str(self.as_str())
10529    }
10530}
10531
10532impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
10533    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10534        f.write_str(self.as_str())
10535    }
10536}
10537impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
10538    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10539    where
10540        S: serde::Serializer,
10541    {
10542        serializer.serialize_str(self.as_str())
10543    }
10544}
10545#[cfg(feature = "deserialize")]
10546impl<'de> serde::Deserialize<'de>
10547    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
10548{
10549    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10550        use std::str::FromStr;
10551        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10552        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor"))
10553    }
10554}
10555/// Payment schedule for the mandate.
10556#[derive(Copy, Clone, Eq, PartialEq)]
10557pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
10558    Combined,
10559    Interval,
10560    Sporadic,
10561}
10562impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
10563    pub fn as_str(self) -> &'static str {
10564        use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
10565        match self {
10566            Combined => "combined",
10567            Interval => "interval",
10568            Sporadic => "sporadic",
10569        }
10570    }
10571}
10572
10573impl std::str::FromStr
10574    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
10575{
10576    type Err = stripe_types::StripeParseError;
10577    fn from_str(s: &str) -> Result<Self, Self::Err> {
10578        use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
10579        match s {
10580            "combined" => Ok(Combined),
10581            "interval" => Ok(Interval),
10582            "sporadic" => Ok(Sporadic),
10583            _ => Err(stripe_types::StripeParseError),
10584        }
10585    }
10586}
10587impl std::fmt::Display
10588    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
10589{
10590    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10591        f.write_str(self.as_str())
10592    }
10593}
10594
10595impl std::fmt::Debug
10596    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
10597{
10598    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10599        f.write_str(self.as_str())
10600    }
10601}
10602impl serde::Serialize
10603    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
10604{
10605    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10606    where
10607        S: serde::Serializer,
10608    {
10609        serializer.serialize_str(self.as_str())
10610    }
10611}
10612#[cfg(feature = "deserialize")]
10613impl<'de> serde::Deserialize<'de>
10614    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
10615{
10616    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10617        use std::str::FromStr;
10618        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10619        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"))
10620    }
10621}
10622/// Transaction type of the mandate.
10623#[derive(Copy, Clone, Eq, PartialEq)]
10624pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
10625    Business,
10626    Personal,
10627}
10628impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
10629    pub fn as_str(self) -> &'static str {
10630        use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
10631        match self {
10632            Business => "business",
10633            Personal => "personal",
10634        }
10635    }
10636}
10637
10638impl std::str::FromStr
10639    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
10640{
10641    type Err = stripe_types::StripeParseError;
10642    fn from_str(s: &str) -> Result<Self, Self::Err> {
10643        use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
10644        match s {
10645            "business" => Ok(Business),
10646            "personal" => Ok(Personal),
10647            _ => Err(stripe_types::StripeParseError),
10648        }
10649    }
10650}
10651impl std::fmt::Display
10652    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
10653{
10654    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10655        f.write_str(self.as_str())
10656    }
10657}
10658
10659impl std::fmt::Debug
10660    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
10661{
10662    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10663        f.write_str(self.as_str())
10664    }
10665}
10666impl serde::Serialize
10667    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
10668{
10669    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10670    where
10671        S: serde::Serializer,
10672    {
10673        serializer.serialize_str(self.as_str())
10674    }
10675}
10676#[cfg(feature = "deserialize")]
10677impl<'de> serde::Deserialize<'de>
10678    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
10679{
10680    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10681        use std::str::FromStr;
10682        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10683        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"))
10684    }
10685}
10686/// Bank account verification method.
10687#[derive(Copy, Clone, Eq, PartialEq)]
10688pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
10689    Automatic,
10690    Instant,
10691    Microdeposits,
10692}
10693impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
10694    pub fn as_str(self) -> &'static str {
10695        use ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
10696        match self {
10697            Automatic => "automatic",
10698            Instant => "instant",
10699            Microdeposits => "microdeposits",
10700        }
10701    }
10702}
10703
10704impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
10705    type Err = stripe_types::StripeParseError;
10706    fn from_str(s: &str) -> Result<Self, Self::Err> {
10707        use ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
10708        match s {
10709            "automatic" => Ok(Automatic),
10710            "instant" => Ok(Instant),
10711            "microdeposits" => Ok(Microdeposits),
10712            _ => Err(stripe_types::StripeParseError),
10713        }
10714    }
10715}
10716impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
10717    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10718        f.write_str(self.as_str())
10719    }
10720}
10721
10722impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
10723    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10724        f.write_str(self.as_str())
10725    }
10726}
10727impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
10728    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10729    where
10730        S: serde::Serializer,
10731    {
10732        serializer.serialize_str(self.as_str())
10733    }
10734}
10735#[cfg(feature = "deserialize")]
10736impl<'de> serde::Deserialize<'de>
10737    for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod
10738{
10739    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10740        use std::str::FromStr;
10741        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10742        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod"))
10743    }
10744}
10745/// If this is a `bacs_debit` SetupIntent, this sub-hash contains details about the Bacs Debit payment method options.
10746#[derive(Clone, Debug, serde::Serialize)]
10747pub struct ConfirmSetupIntentPaymentMethodOptionsBacsDebit {
10748    /// Additional fields for Mandate creation
10749    #[serde(skip_serializing_if = "Option::is_none")]
10750    pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
10751}
10752impl ConfirmSetupIntentPaymentMethodOptionsBacsDebit {
10753    pub fn new() -> Self {
10754        Self { mandate_options: None }
10755    }
10756}
10757impl Default for ConfirmSetupIntentPaymentMethodOptionsBacsDebit {
10758    fn default() -> Self {
10759        Self::new()
10760    }
10761}
10762/// Configuration for any card setup attempted on this SetupIntent.
10763#[derive(Clone, Debug, serde::Serialize)]
10764pub struct ConfirmSetupIntentPaymentMethodOptionsCard {
10765    /// Configuration options for setting up an eMandate for cards issued in India.
10766    #[serde(skip_serializing_if = "Option::is_none")]
10767    pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsCardMandateOptions>,
10768    /// When specified, this parameter signals that a card has been collected
10769    /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This
10770    /// parameter can only be provided during confirmation.
10771    #[serde(skip_serializing_if = "Option::is_none")]
10772    pub moto: Option<bool>,
10773    /// Selected network to process this SetupIntent on.
10774    /// Depends on the available networks of the card attached to the SetupIntent.
10775    /// Can be only set confirm-time.
10776    #[serde(skip_serializing_if = "Option::is_none")]
10777    pub network: Option<ConfirmSetupIntentPaymentMethodOptionsCardNetwork>,
10778    /// 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).
10779    /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
10780    /// If not provided, this value defaults to `automatic`.
10781    /// 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.
10782    #[serde(skip_serializing_if = "Option::is_none")]
10783    pub request_three_d_secure:
10784        Option<ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure>,
10785    /// If 3D Secure authentication was performed with a third-party provider,
10786    /// the authentication details to use for this setup.
10787    #[serde(skip_serializing_if = "Option::is_none")]
10788    pub three_d_secure: Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure>,
10789}
10790impl ConfirmSetupIntentPaymentMethodOptionsCard {
10791    pub fn new() -> Self {
10792        Self {
10793            mandate_options: None,
10794            moto: None,
10795            network: None,
10796            request_three_d_secure: None,
10797            three_d_secure: None,
10798        }
10799    }
10800}
10801impl Default for ConfirmSetupIntentPaymentMethodOptionsCard {
10802    fn default() -> Self {
10803        Self::new()
10804    }
10805}
10806/// Configuration options for setting up an eMandate for cards issued in India.
10807#[derive(Clone, Debug, serde::Serialize)]
10808pub struct ConfirmSetupIntentPaymentMethodOptionsCardMandateOptions {
10809    /// Amount to be charged for future payments.
10810    pub amount: i64,
10811    /// One of `fixed` or `maximum`.
10812    /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
10813    /// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
10814    pub amount_type: ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType,
10815    /// Currency in which future payments will be charged.
10816    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
10817    /// Must be a [supported currency](https://stripe.com/docs/currencies).
10818    pub currency: stripe_types::Currency,
10819    /// A description of the mandate or subscription that is meant to be displayed to the customer.
10820    #[serde(skip_serializing_if = "Option::is_none")]
10821    pub description: Option<String>,
10822    /// End date of the mandate or subscription.
10823    /// If not provided, the mandate will be active until canceled.
10824    /// If provided, end date should be after start date.
10825    #[serde(skip_serializing_if = "Option::is_none")]
10826    pub end_date: Option<stripe_types::Timestamp>,
10827    /// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
10828    pub interval: ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval,
10829    /// The number of intervals between payments.
10830    /// For example, `interval=month` and `interval_count=3` indicates one payment every three months.
10831    /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).
10832    /// This parameter is optional when `interval=sporadic`.
10833    #[serde(skip_serializing_if = "Option::is_none")]
10834    pub interval_count: Option<u64>,
10835    /// Unique identifier for the mandate or subscription.
10836    pub reference: String,
10837    /// Start date of the mandate or subscription. Start date should not be lesser than yesterday.
10838    pub start_date: stripe_types::Timestamp,
10839    /// Specifies the type of mandates supported. Possible values are `india`.
10840    #[serde(skip_serializing_if = "Option::is_none")]
10841    pub supported_types:
10842        Option<Vec<ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
10843}
10844impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptions {
10845    pub fn new(
10846        amount: impl Into<i64>,
10847        amount_type: impl Into<ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
10848        currency: impl Into<stripe_types::Currency>,
10849        interval: impl Into<ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval>,
10850        reference: impl Into<String>,
10851        start_date: impl Into<stripe_types::Timestamp>,
10852    ) -> Self {
10853        Self {
10854            amount: amount.into(),
10855            amount_type: amount_type.into(),
10856            currency: currency.into(),
10857            description: None,
10858            end_date: None,
10859            interval: interval.into(),
10860            interval_count: None,
10861            reference: reference.into(),
10862            start_date: start_date.into(),
10863            supported_types: None,
10864        }
10865    }
10866}
10867/// One of `fixed` or `maximum`.
10868/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
10869/// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
10870#[derive(Copy, Clone, Eq, PartialEq)]
10871pub enum ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
10872    Fixed,
10873    Maximum,
10874}
10875impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
10876    pub fn as_str(self) -> &'static str {
10877        use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
10878        match self {
10879            Fixed => "fixed",
10880            Maximum => "maximum",
10881        }
10882    }
10883}
10884
10885impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
10886    type Err = stripe_types::StripeParseError;
10887    fn from_str(s: &str) -> Result<Self, Self::Err> {
10888        use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
10889        match s {
10890            "fixed" => Ok(Fixed),
10891            "maximum" => Ok(Maximum),
10892            _ => Err(stripe_types::StripeParseError),
10893        }
10894    }
10895}
10896impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
10897    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10898        f.write_str(self.as_str())
10899    }
10900}
10901
10902impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
10903    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10904        f.write_str(self.as_str())
10905    }
10906}
10907impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
10908    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10909    where
10910        S: serde::Serializer,
10911    {
10912        serializer.serialize_str(self.as_str())
10913    }
10914}
10915#[cfg(feature = "deserialize")]
10916impl<'de> serde::Deserialize<'de>
10917    for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType
10918{
10919    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10920        use std::str::FromStr;
10921        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10922        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType"))
10923    }
10924}
10925/// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
10926#[derive(Copy, Clone, Eq, PartialEq)]
10927pub enum ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
10928    Day,
10929    Month,
10930    Sporadic,
10931    Week,
10932    Year,
10933}
10934impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
10935    pub fn as_str(self) -> &'static str {
10936        use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
10937        match self {
10938            Day => "day",
10939            Month => "month",
10940            Sporadic => "sporadic",
10941            Week => "week",
10942            Year => "year",
10943        }
10944    }
10945}
10946
10947impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
10948    type Err = stripe_types::StripeParseError;
10949    fn from_str(s: &str) -> Result<Self, Self::Err> {
10950        use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
10951        match s {
10952            "day" => Ok(Day),
10953            "month" => Ok(Month),
10954            "sporadic" => Ok(Sporadic),
10955            "week" => Ok(Week),
10956            "year" => Ok(Year),
10957            _ => Err(stripe_types::StripeParseError),
10958        }
10959    }
10960}
10961impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
10962    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10963        f.write_str(self.as_str())
10964    }
10965}
10966
10967impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
10968    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10969        f.write_str(self.as_str())
10970    }
10971}
10972impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
10973    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10974    where
10975        S: serde::Serializer,
10976    {
10977        serializer.serialize_str(self.as_str())
10978    }
10979}
10980#[cfg(feature = "deserialize")]
10981impl<'de> serde::Deserialize<'de>
10982    for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval
10983{
10984    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10985        use std::str::FromStr;
10986        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10987        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval"))
10988    }
10989}
10990/// Specifies the type of mandates supported. Possible values are `india`.
10991#[derive(Copy, Clone, Eq, PartialEq)]
10992pub enum ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
10993    India,
10994}
10995impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
10996    pub fn as_str(self) -> &'static str {
10997        use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
10998        match self {
10999            India => "india",
11000        }
11001    }
11002}
11003
11004impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
11005    type Err = stripe_types::StripeParseError;
11006    fn from_str(s: &str) -> Result<Self, Self::Err> {
11007        use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
11008        match s {
11009            "india" => Ok(India),
11010            _ => Err(stripe_types::StripeParseError),
11011        }
11012    }
11013}
11014impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
11015    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11016        f.write_str(self.as_str())
11017    }
11018}
11019
11020impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
11021    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11022        f.write_str(self.as_str())
11023    }
11024}
11025impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
11026    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11027    where
11028        S: serde::Serializer,
11029    {
11030        serializer.serialize_str(self.as_str())
11031    }
11032}
11033#[cfg(feature = "deserialize")]
11034impl<'de> serde::Deserialize<'de>
11035    for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
11036{
11037    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11038        use std::str::FromStr;
11039        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11040        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"))
11041    }
11042}
11043/// Selected network to process this SetupIntent on.
11044/// Depends on the available networks of the card attached to the SetupIntent.
11045/// Can be only set confirm-time.
11046#[derive(Copy, Clone, Eq, PartialEq)]
11047pub enum ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
11048    Amex,
11049    CartesBancaires,
11050    Diners,
11051    Discover,
11052    EftposAu,
11053    Girocard,
11054    Interac,
11055    Jcb,
11056    Link,
11057    Mastercard,
11058    Unionpay,
11059    Unknown,
11060    Visa,
11061}
11062impl ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
11063    pub fn as_str(self) -> &'static str {
11064        use ConfirmSetupIntentPaymentMethodOptionsCardNetwork::*;
11065        match self {
11066            Amex => "amex",
11067            CartesBancaires => "cartes_bancaires",
11068            Diners => "diners",
11069            Discover => "discover",
11070            EftposAu => "eftpos_au",
11071            Girocard => "girocard",
11072            Interac => "interac",
11073            Jcb => "jcb",
11074            Link => "link",
11075            Mastercard => "mastercard",
11076            Unionpay => "unionpay",
11077            Unknown => "unknown",
11078            Visa => "visa",
11079        }
11080    }
11081}
11082
11083impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
11084    type Err = stripe_types::StripeParseError;
11085    fn from_str(s: &str) -> Result<Self, Self::Err> {
11086        use ConfirmSetupIntentPaymentMethodOptionsCardNetwork::*;
11087        match s {
11088            "amex" => Ok(Amex),
11089            "cartes_bancaires" => Ok(CartesBancaires),
11090            "diners" => Ok(Diners),
11091            "discover" => Ok(Discover),
11092            "eftpos_au" => Ok(EftposAu),
11093            "girocard" => Ok(Girocard),
11094            "interac" => Ok(Interac),
11095            "jcb" => Ok(Jcb),
11096            "link" => Ok(Link),
11097            "mastercard" => Ok(Mastercard),
11098            "unionpay" => Ok(Unionpay),
11099            "unknown" => Ok(Unknown),
11100            "visa" => Ok(Visa),
11101            _ => Err(stripe_types::StripeParseError),
11102        }
11103    }
11104}
11105impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
11106    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11107        f.write_str(self.as_str())
11108    }
11109}
11110
11111impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
11112    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11113        f.write_str(self.as_str())
11114    }
11115}
11116impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
11117    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11118    where
11119        S: serde::Serializer,
11120    {
11121        serializer.serialize_str(self.as_str())
11122    }
11123}
11124#[cfg(feature = "deserialize")]
11125impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
11126    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11127        use std::str::FromStr;
11128        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11129        Self::from_str(&s).map_err(|_| {
11130            serde::de::Error::custom(
11131                "Unknown value for ConfirmSetupIntentPaymentMethodOptionsCardNetwork",
11132            )
11133        })
11134    }
11135}
11136/// 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).
11137/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
11138/// If not provided, this value defaults to `automatic`.
11139/// 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.
11140#[derive(Copy, Clone, Eq, PartialEq)]
11141pub enum ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
11142    Any,
11143    Automatic,
11144    Challenge,
11145}
11146impl ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
11147    pub fn as_str(self) -> &'static str {
11148        use ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
11149        match self {
11150            Any => "any",
11151            Automatic => "automatic",
11152            Challenge => "challenge",
11153        }
11154    }
11155}
11156
11157impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
11158    type Err = stripe_types::StripeParseError;
11159    fn from_str(s: &str) -> Result<Self, Self::Err> {
11160        use ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
11161        match s {
11162            "any" => Ok(Any),
11163            "automatic" => Ok(Automatic),
11164            "challenge" => Ok(Challenge),
11165            _ => Err(stripe_types::StripeParseError),
11166        }
11167    }
11168}
11169impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
11170    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11171        f.write_str(self.as_str())
11172    }
11173}
11174
11175impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
11176    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11177        f.write_str(self.as_str())
11178    }
11179}
11180impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
11181    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11182    where
11183        S: serde::Serializer,
11184    {
11185        serializer.serialize_str(self.as_str())
11186    }
11187}
11188#[cfg(feature = "deserialize")]
11189impl<'de> serde::Deserialize<'de>
11190    for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure
11191{
11192    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11193        use std::str::FromStr;
11194        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11195        Self::from_str(&s).map_err(|_| {
11196            serde::de::Error::custom(
11197                "Unknown value for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure",
11198            )
11199        })
11200    }
11201}
11202/// If 3D Secure authentication was performed with a third-party provider,
11203/// the authentication details to use for this setup.
11204#[derive(Clone, Debug, serde::Serialize)]
11205pub struct ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure {
11206    /// The `transStatus` returned from the card Issuer’s ACS in the ARes.
11207    #[serde(skip_serializing_if = "Option::is_none")]
11208    pub ares_trans_status:
11209        Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
11210    /// The cryptogram, also known as the "authentication value" (AAV, CAVV or
11211    /// AEVV). This value is 20 bytes, base64-encoded into a 28-character string.
11212    /// (Most 3D Secure providers will return the base64-encoded version, which
11213    /// is what you should specify here.)
11214    #[serde(skip_serializing_if = "Option::is_none")]
11215    pub cryptogram: Option<String>,
11216    /// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
11217    /// provider and indicates what degree of authentication was performed.
11218    #[serde(skip_serializing_if = "Option::is_none")]
11219    pub electronic_commerce_indicator:
11220        Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
11221    /// Network specific 3DS fields. Network specific arguments require an
11222    /// explicit card brand choice. The parameter `payment_method_options.card.network``
11223    /// must be populated accordingly
11224    #[serde(skip_serializing_if = "Option::is_none")]
11225    pub network_options:
11226        Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
11227    /// The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the
11228    /// AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99.
11229    #[serde(skip_serializing_if = "Option::is_none")]
11230    pub requestor_challenge_indicator: Option<String>,
11231    /// For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server
11232    /// Transaction ID (dsTransID).
11233    #[serde(skip_serializing_if = "Option::is_none")]
11234    pub transaction_id: Option<String>,
11235    /// The version of 3D Secure that was performed.
11236    #[serde(skip_serializing_if = "Option::is_none")]
11237    pub version: Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion>,
11238}
11239impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure {
11240    pub fn new() -> Self {
11241        Self {
11242            ares_trans_status: None,
11243            cryptogram: None,
11244            electronic_commerce_indicator: None,
11245            network_options: None,
11246            requestor_challenge_indicator: None,
11247            transaction_id: None,
11248            version: None,
11249        }
11250    }
11251}
11252impl Default for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure {
11253    fn default() -> Self {
11254        Self::new()
11255    }
11256}
11257/// The `transStatus` returned from the card Issuer’s ACS in the ARes.
11258#[derive(Copy, Clone, Eq, PartialEq)]
11259pub enum ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
11260    A,
11261    C,
11262    I,
11263    N,
11264    R,
11265    U,
11266    Y,
11267}
11268impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
11269    pub fn as_str(self) -> &'static str {
11270        use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
11271        match self {
11272            A => "A",
11273            C => "C",
11274            I => "I",
11275            N => "N",
11276            R => "R",
11277            U => "U",
11278            Y => "Y",
11279        }
11280    }
11281}
11282
11283impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
11284    type Err = stripe_types::StripeParseError;
11285    fn from_str(s: &str) -> Result<Self, Self::Err> {
11286        use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
11287        match s {
11288            "A" => Ok(A),
11289            "C" => Ok(C),
11290            "I" => Ok(I),
11291            "N" => Ok(N),
11292            "R" => Ok(R),
11293            "U" => Ok(U),
11294            "Y" => Ok(Y),
11295            _ => Err(stripe_types::StripeParseError),
11296        }
11297    }
11298}
11299impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
11300    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11301        f.write_str(self.as_str())
11302    }
11303}
11304
11305impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
11306    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11307        f.write_str(self.as_str())
11308    }
11309}
11310impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
11311    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11312    where
11313        S: serde::Serializer,
11314    {
11315        serializer.serialize_str(self.as_str())
11316    }
11317}
11318#[cfg(feature = "deserialize")]
11319impl<'de> serde::Deserialize<'de>
11320    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
11321{
11322    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11323        use std::str::FromStr;
11324        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11325        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"))
11326    }
11327}
11328/// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
11329/// provider and indicates what degree of authentication was performed.
11330#[derive(Copy, Clone, Eq, PartialEq)]
11331pub enum ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
11332    V01,
11333    V02,
11334    V05,
11335    V06,
11336    V07,
11337}
11338impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
11339    pub fn as_str(self) -> &'static str {
11340        use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
11341        match self {
11342            V01 => "01",
11343            V02 => "02",
11344            V05 => "05",
11345            V06 => "06",
11346            V07 => "07",
11347        }
11348    }
11349}
11350
11351impl std::str::FromStr
11352    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
11353{
11354    type Err = stripe_types::StripeParseError;
11355    fn from_str(s: &str) -> Result<Self, Self::Err> {
11356        use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
11357        match s {
11358            "01" => Ok(V01),
11359            "02" => Ok(V02),
11360            "05" => Ok(V05),
11361            "06" => Ok(V06),
11362            "07" => Ok(V07),
11363            _ => Err(stripe_types::StripeParseError),
11364        }
11365    }
11366}
11367impl std::fmt::Display
11368    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
11369{
11370    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11371        f.write_str(self.as_str())
11372    }
11373}
11374
11375impl std::fmt::Debug
11376    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
11377{
11378    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11379        f.write_str(self.as_str())
11380    }
11381}
11382impl serde::Serialize
11383    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
11384{
11385    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11386    where
11387        S: serde::Serializer,
11388    {
11389        serializer.serialize_str(self.as_str())
11390    }
11391}
11392#[cfg(feature = "deserialize")]
11393impl<'de> serde::Deserialize<'de>
11394    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
11395{
11396    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11397        use std::str::FromStr;
11398        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11399        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"))
11400    }
11401}
11402/// Network specific 3DS fields. Network specific arguments require an
11403/// explicit card brand choice. The parameter `payment_method_options.card.network``
11404/// must be populated accordingly
11405#[derive(Clone, Debug, serde::Serialize)]
11406pub struct ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
11407    /// Cartes Bancaires-specific 3DS fields.
11408    #[serde(skip_serializing_if = "Option::is_none")]
11409    pub cartes_bancaires:
11410        Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires>,
11411}
11412impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
11413    pub fn new() -> Self {
11414        Self { cartes_bancaires: None }
11415    }
11416}
11417impl Default for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
11418    fn default() -> Self {
11419        Self::new()
11420    }
11421}
11422/// Cartes Bancaires-specific 3DS fields.
11423#[derive(Clone, Debug, serde::Serialize)]
11424pub struct ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
11425    /// The cryptogram calculation algorithm used by the card Issuer's ACS
11426    /// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
11427    /// messageExtension: CB-AVALGO
11428    pub cb_avalgo:
11429        ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
11430    /// The exemption indicator returned from Cartes Bancaires in the ARes.
11431    /// message extension: CB-EXEMPTION; string (4 characters)
11432    /// This is a 3 byte bitmap (low significant byte first and most significant
11433    /// bit first) that has been Base64 encoded
11434    #[serde(skip_serializing_if = "Option::is_none")]
11435    pub cb_exemption: Option<String>,
11436    /// The risk score returned from Cartes Bancaires in the ARes.
11437    /// message extension: CB-SCORE; numeric value 0-99
11438    #[serde(skip_serializing_if = "Option::is_none")]
11439    pub cb_score: Option<i64>,
11440}
11441impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
11442    pub fn new(
11443        cb_avalgo: impl Into<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
11444    ) -> Self {
11445        Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
11446    }
11447}
11448/// The cryptogram calculation algorithm used by the card Issuer's ACS
11449/// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
11450/// messageExtension: CB-AVALGO
11451#[derive(Copy, Clone, Eq, PartialEq)]
11452pub enum ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
11453{
11454    V0,
11455    V1,
11456    V2,
11457    V3,
11458    V4,
11459    A,
11460}
11461impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
11462    pub fn as_str(self) -> &'static str {
11463        use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
11464        match self {
11465            V0 => "0",
11466            V1 => "1",
11467            V2 => "2",
11468            V3 => "3",
11469            V4 => "4",
11470            A => "A",
11471        }
11472    }
11473}
11474
11475impl std::str::FromStr
11476    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
11477{
11478    type Err = stripe_types::StripeParseError;
11479    fn from_str(s: &str) -> Result<Self, Self::Err> {
11480        use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
11481        match s {
11482            "0" => Ok(V0),
11483            "1" => Ok(V1),
11484            "2" => Ok(V2),
11485            "3" => Ok(V3),
11486            "4" => Ok(V4),
11487            "A" => Ok(A),
11488            _ => Err(stripe_types::StripeParseError),
11489        }
11490    }
11491}
11492impl std::fmt::Display
11493    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
11494{
11495    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11496        f.write_str(self.as_str())
11497    }
11498}
11499
11500impl std::fmt::Debug
11501    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
11502{
11503    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11504        f.write_str(self.as_str())
11505    }
11506}
11507impl serde::Serialize
11508    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
11509{
11510    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11511    where
11512        S: serde::Serializer,
11513    {
11514        serializer.serialize_str(self.as_str())
11515    }
11516}
11517#[cfg(feature = "deserialize")]
11518impl<'de> serde::Deserialize<'de>
11519    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
11520{
11521    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11522        use std::str::FromStr;
11523        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11524        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"))
11525    }
11526}
11527/// The version of 3D Secure that was performed.
11528#[derive(Copy, Clone, Eq, PartialEq)]
11529pub enum ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
11530    V1_0_2,
11531    V2_1_0,
11532    V2_2_0,
11533}
11534impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
11535    pub fn as_str(self) -> &'static str {
11536        use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
11537        match self {
11538            V1_0_2 => "1.0.2",
11539            V2_1_0 => "2.1.0",
11540            V2_2_0 => "2.2.0",
11541        }
11542    }
11543}
11544
11545impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
11546    type Err = stripe_types::StripeParseError;
11547    fn from_str(s: &str) -> Result<Self, Self::Err> {
11548        use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
11549        match s {
11550            "1.0.2" => Ok(V1_0_2),
11551            "2.1.0" => Ok(V2_1_0),
11552            "2.2.0" => Ok(V2_2_0),
11553            _ => Err(stripe_types::StripeParseError),
11554        }
11555    }
11556}
11557impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
11558    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11559        f.write_str(self.as_str())
11560    }
11561}
11562
11563impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
11564    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11565        f.write_str(self.as_str())
11566    }
11567}
11568impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
11569    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11570    where
11571        S: serde::Serializer,
11572    {
11573        serializer.serialize_str(self.as_str())
11574    }
11575}
11576#[cfg(feature = "deserialize")]
11577impl<'de> serde::Deserialize<'de>
11578    for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion
11579{
11580    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11581        use std::str::FromStr;
11582        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11583        Self::from_str(&s).map_err(|_| {
11584            serde::de::Error::custom(
11585                "Unknown value for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion",
11586            )
11587        })
11588    }
11589}
11590/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options.
11591#[derive(Clone, Debug, serde::Serialize)]
11592pub struct ConfirmSetupIntentPaymentMethodOptionsKlarna {
11593    /// The currency of the SetupIntent. Three letter ISO currency code.
11594    #[serde(skip_serializing_if = "Option::is_none")]
11595    pub currency: Option<stripe_types::Currency>,
11596    /// On-demand details if setting up a payment method for on-demand payments.
11597    #[serde(skip_serializing_if = "Option::is_none")]
11598    pub on_demand: Option<ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemand>,
11599    /// Preferred language of the Klarna authorization page that the customer is redirected to
11600    #[serde(skip_serializing_if = "Option::is_none")]
11601    pub preferred_locale: Option<ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale>,
11602    /// Subscription details if setting up or charging a subscription
11603    #[serde(skip_serializing_if = "Option::is_none")]
11604    pub subscriptions: Option<Vec<ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptions>>,
11605}
11606impl ConfirmSetupIntentPaymentMethodOptionsKlarna {
11607    pub fn new() -> Self {
11608        Self { currency: None, on_demand: None, preferred_locale: None, subscriptions: None }
11609    }
11610}
11611impl Default for ConfirmSetupIntentPaymentMethodOptionsKlarna {
11612    fn default() -> Self {
11613        Self::new()
11614    }
11615}
11616/// On-demand details if setting up a payment method for on-demand payments.
11617#[derive(Copy, Clone, Debug, serde::Serialize)]
11618pub struct ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemand {
11619    /// Your average amount value.
11620    /// You can use a value across your customer base, or segment based on customer type, country, etc.
11621    #[serde(skip_serializing_if = "Option::is_none")]
11622    pub average_amount: Option<i64>,
11623    /// The maximum value you may charge a customer per purchase.
11624    /// You can use a value across your customer base, or segment based on customer type, country, etc.
11625    #[serde(skip_serializing_if = "Option::is_none")]
11626    pub maximum_amount: Option<i64>,
11627    /// The lowest or minimum value you may charge a customer per purchase.
11628    /// You can use a value across your customer base, or segment based on customer type, country, etc.
11629    #[serde(skip_serializing_if = "Option::is_none")]
11630    pub minimum_amount: Option<i64>,
11631    /// Interval at which the customer is making purchases
11632    #[serde(skip_serializing_if = "Option::is_none")]
11633    pub purchase_interval:
11634        Option<ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
11635    /// The number of `purchase_interval` between charges
11636    #[serde(skip_serializing_if = "Option::is_none")]
11637    pub purchase_interval_count: Option<u64>,
11638}
11639impl ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemand {
11640    pub fn new() -> Self {
11641        Self {
11642            average_amount: None,
11643            maximum_amount: None,
11644            minimum_amount: None,
11645            purchase_interval: None,
11646            purchase_interval_count: None,
11647        }
11648    }
11649}
11650impl Default for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemand {
11651    fn default() -> Self {
11652        Self::new()
11653    }
11654}
11655/// Interval at which the customer is making purchases
11656#[derive(Copy, Clone, Eq, PartialEq)]
11657pub enum ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
11658    Day,
11659    Month,
11660    Week,
11661    Year,
11662}
11663impl ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
11664    pub fn as_str(self) -> &'static str {
11665        use ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
11666        match self {
11667            Day => "day",
11668            Month => "month",
11669            Week => "week",
11670            Year => "year",
11671        }
11672    }
11673}
11674
11675impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
11676    type Err = stripe_types::StripeParseError;
11677    fn from_str(s: &str) -> Result<Self, Self::Err> {
11678        use ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
11679        match s {
11680            "day" => Ok(Day),
11681            "month" => Ok(Month),
11682            "week" => Ok(Week),
11683            "year" => Ok(Year),
11684            _ => Err(stripe_types::StripeParseError),
11685        }
11686    }
11687}
11688impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
11689    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11690        f.write_str(self.as_str())
11691    }
11692}
11693
11694impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
11695    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11696        f.write_str(self.as_str())
11697    }
11698}
11699impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
11700    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11701    where
11702        S: serde::Serializer,
11703    {
11704        serializer.serialize_str(self.as_str())
11705    }
11706}
11707#[cfg(feature = "deserialize")]
11708impl<'de> serde::Deserialize<'de>
11709    for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
11710{
11711    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11712        use std::str::FromStr;
11713        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11714        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"))
11715    }
11716}
11717/// Preferred language of the Klarna authorization page that the customer is redirected to
11718#[derive(Clone, Eq, PartialEq)]
11719#[non_exhaustive]
11720pub enum ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
11721    CsMinusCz,
11722    DaMinusDk,
11723    DeMinusAt,
11724    DeMinusCh,
11725    DeMinusDe,
11726    ElMinusGr,
11727    EnMinusAt,
11728    EnMinusAu,
11729    EnMinusBe,
11730    EnMinusCa,
11731    EnMinusCh,
11732    EnMinusCz,
11733    EnMinusDe,
11734    EnMinusDk,
11735    EnMinusEs,
11736    EnMinusFi,
11737    EnMinusFr,
11738    EnMinusGb,
11739    EnMinusGr,
11740    EnMinusIe,
11741    EnMinusIt,
11742    EnMinusNl,
11743    EnMinusNo,
11744    EnMinusNz,
11745    EnMinusPl,
11746    EnMinusPt,
11747    EnMinusRo,
11748    EnMinusSe,
11749    EnMinusUs,
11750    EsMinusEs,
11751    EsMinusUs,
11752    FiMinusFi,
11753    FrMinusBe,
11754    FrMinusCa,
11755    FrMinusCh,
11756    FrMinusFr,
11757    ItMinusCh,
11758    ItMinusIt,
11759    NbMinusNo,
11760    NlMinusBe,
11761    NlMinusNl,
11762    PlMinusPl,
11763    PtMinusPt,
11764    RoMinusRo,
11765    SvMinusFi,
11766    SvMinusSe,
11767    /// An unrecognized value from Stripe. Should not be used as a request parameter.
11768    Unknown(String),
11769}
11770impl ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
11771    pub fn as_str(&self) -> &str {
11772        use ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
11773        match self {
11774            CsMinusCz => "cs-CZ",
11775            DaMinusDk => "da-DK",
11776            DeMinusAt => "de-AT",
11777            DeMinusCh => "de-CH",
11778            DeMinusDe => "de-DE",
11779            ElMinusGr => "el-GR",
11780            EnMinusAt => "en-AT",
11781            EnMinusAu => "en-AU",
11782            EnMinusBe => "en-BE",
11783            EnMinusCa => "en-CA",
11784            EnMinusCh => "en-CH",
11785            EnMinusCz => "en-CZ",
11786            EnMinusDe => "en-DE",
11787            EnMinusDk => "en-DK",
11788            EnMinusEs => "en-ES",
11789            EnMinusFi => "en-FI",
11790            EnMinusFr => "en-FR",
11791            EnMinusGb => "en-GB",
11792            EnMinusGr => "en-GR",
11793            EnMinusIe => "en-IE",
11794            EnMinusIt => "en-IT",
11795            EnMinusNl => "en-NL",
11796            EnMinusNo => "en-NO",
11797            EnMinusNz => "en-NZ",
11798            EnMinusPl => "en-PL",
11799            EnMinusPt => "en-PT",
11800            EnMinusRo => "en-RO",
11801            EnMinusSe => "en-SE",
11802            EnMinusUs => "en-US",
11803            EsMinusEs => "es-ES",
11804            EsMinusUs => "es-US",
11805            FiMinusFi => "fi-FI",
11806            FrMinusBe => "fr-BE",
11807            FrMinusCa => "fr-CA",
11808            FrMinusCh => "fr-CH",
11809            FrMinusFr => "fr-FR",
11810            ItMinusCh => "it-CH",
11811            ItMinusIt => "it-IT",
11812            NbMinusNo => "nb-NO",
11813            NlMinusBe => "nl-BE",
11814            NlMinusNl => "nl-NL",
11815            PlMinusPl => "pl-PL",
11816            PtMinusPt => "pt-PT",
11817            RoMinusRo => "ro-RO",
11818            SvMinusFi => "sv-FI",
11819            SvMinusSe => "sv-SE",
11820            Unknown(v) => v,
11821        }
11822    }
11823}
11824
11825impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
11826    type Err = std::convert::Infallible;
11827    fn from_str(s: &str) -> Result<Self, Self::Err> {
11828        use ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
11829        match s {
11830            "cs-CZ" => Ok(CsMinusCz),
11831            "da-DK" => Ok(DaMinusDk),
11832            "de-AT" => Ok(DeMinusAt),
11833            "de-CH" => Ok(DeMinusCh),
11834            "de-DE" => Ok(DeMinusDe),
11835            "el-GR" => Ok(ElMinusGr),
11836            "en-AT" => Ok(EnMinusAt),
11837            "en-AU" => Ok(EnMinusAu),
11838            "en-BE" => Ok(EnMinusBe),
11839            "en-CA" => Ok(EnMinusCa),
11840            "en-CH" => Ok(EnMinusCh),
11841            "en-CZ" => Ok(EnMinusCz),
11842            "en-DE" => Ok(EnMinusDe),
11843            "en-DK" => Ok(EnMinusDk),
11844            "en-ES" => Ok(EnMinusEs),
11845            "en-FI" => Ok(EnMinusFi),
11846            "en-FR" => Ok(EnMinusFr),
11847            "en-GB" => Ok(EnMinusGb),
11848            "en-GR" => Ok(EnMinusGr),
11849            "en-IE" => Ok(EnMinusIe),
11850            "en-IT" => Ok(EnMinusIt),
11851            "en-NL" => Ok(EnMinusNl),
11852            "en-NO" => Ok(EnMinusNo),
11853            "en-NZ" => Ok(EnMinusNz),
11854            "en-PL" => Ok(EnMinusPl),
11855            "en-PT" => Ok(EnMinusPt),
11856            "en-RO" => Ok(EnMinusRo),
11857            "en-SE" => Ok(EnMinusSe),
11858            "en-US" => Ok(EnMinusUs),
11859            "es-ES" => Ok(EsMinusEs),
11860            "es-US" => Ok(EsMinusUs),
11861            "fi-FI" => Ok(FiMinusFi),
11862            "fr-BE" => Ok(FrMinusBe),
11863            "fr-CA" => Ok(FrMinusCa),
11864            "fr-CH" => Ok(FrMinusCh),
11865            "fr-FR" => Ok(FrMinusFr),
11866            "it-CH" => Ok(ItMinusCh),
11867            "it-IT" => Ok(ItMinusIt),
11868            "nb-NO" => Ok(NbMinusNo),
11869            "nl-BE" => Ok(NlMinusBe),
11870            "nl-NL" => Ok(NlMinusNl),
11871            "pl-PL" => Ok(PlMinusPl),
11872            "pt-PT" => Ok(PtMinusPt),
11873            "ro-RO" => Ok(RoMinusRo),
11874            "sv-FI" => Ok(SvMinusFi),
11875            "sv-SE" => Ok(SvMinusSe),
11876            v => Ok(Unknown(v.to_owned())),
11877        }
11878    }
11879}
11880impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
11881    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11882        f.write_str(self.as_str())
11883    }
11884}
11885
11886impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
11887    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11888        f.write_str(self.as_str())
11889    }
11890}
11891impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
11892    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11893    where
11894        S: serde::Serializer,
11895    {
11896        serializer.serialize_str(self.as_str())
11897    }
11898}
11899#[cfg(feature = "deserialize")]
11900impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
11901    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11902        use std::str::FromStr;
11903        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11904        Ok(Self::from_str(&s).unwrap())
11905    }
11906}
11907/// Subscription details if setting up or charging a subscription
11908#[derive(Clone, Debug, serde::Serialize)]
11909pub struct ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
11910    /// Unit of time between subscription charges.
11911    pub interval: ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
11912    /// The number of intervals (specified in the `interval` attribute) between subscription charges.
11913    /// For example, `interval=month` and `interval_count=3` charges every 3 months.
11914    #[serde(skip_serializing_if = "Option::is_none")]
11915    pub interval_count: Option<u64>,
11916    /// Name for subscription.
11917    #[serde(skip_serializing_if = "Option::is_none")]
11918    pub name: Option<String>,
11919    /// Describes the upcoming charge for this subscription.
11920    pub next_billing: SubscriptionNextBillingParam,
11921    /// A non-customer-facing reference to correlate subscription charges in the Klarna app.
11922    /// Use a value that persists across subscription charges.
11923    pub reference: String,
11924}
11925impl ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
11926    pub fn new(
11927        interval: impl Into<ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
11928        next_billing: impl Into<SubscriptionNextBillingParam>,
11929        reference: impl Into<String>,
11930    ) -> Self {
11931        Self {
11932            interval: interval.into(),
11933            interval_count: None,
11934            name: None,
11935            next_billing: next_billing.into(),
11936            reference: reference.into(),
11937        }
11938    }
11939}
11940/// Unit of time between subscription charges.
11941#[derive(Copy, Clone, Eq, PartialEq)]
11942pub enum ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
11943    Day,
11944    Month,
11945    Week,
11946    Year,
11947}
11948impl ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
11949    pub fn as_str(self) -> &'static str {
11950        use ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
11951        match self {
11952            Day => "day",
11953            Month => "month",
11954            Week => "week",
11955            Year => "year",
11956        }
11957    }
11958}
11959
11960impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
11961    type Err = stripe_types::StripeParseError;
11962    fn from_str(s: &str) -> Result<Self, Self::Err> {
11963        use ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
11964        match s {
11965            "day" => Ok(Day),
11966            "month" => Ok(Month),
11967            "week" => Ok(Week),
11968            "year" => Ok(Year),
11969            _ => Err(stripe_types::StripeParseError),
11970        }
11971    }
11972}
11973impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
11974    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11975        f.write_str(self.as_str())
11976    }
11977}
11978
11979impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
11980    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11981        f.write_str(self.as_str())
11982    }
11983}
11984impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
11985    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11986    where
11987        S: serde::Serializer,
11988    {
11989        serializer.serialize_str(self.as_str())
11990    }
11991}
11992#[cfg(feature = "deserialize")]
11993impl<'de> serde::Deserialize<'de>
11994    for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
11995{
11996    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11997        use std::str::FromStr;
11998        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11999        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"))
12000    }
12001}
12002/// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options.
12003#[derive(Clone, Debug, serde::Serialize)]
12004pub struct ConfirmSetupIntentPaymentMethodOptionsSepaDebit {
12005    /// Additional fields for Mandate creation
12006    #[serde(skip_serializing_if = "Option::is_none")]
12007    pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsSepaDebitMandateOptions>,
12008}
12009impl ConfirmSetupIntentPaymentMethodOptionsSepaDebit {
12010    pub fn new() -> Self {
12011        Self { mandate_options: None }
12012    }
12013}
12014impl Default for ConfirmSetupIntentPaymentMethodOptionsSepaDebit {
12015    fn default() -> Self {
12016        Self::new()
12017    }
12018}
12019/// Additional fields for Mandate creation
12020#[derive(Clone, Debug, serde::Serialize)]
12021pub struct ConfirmSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
12022    /// Prefix used to generate the Mandate reference.
12023    /// Must be at most 12 characters long.
12024    /// Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'.
12025    /// Cannot begin with 'STRIPE'.
12026    #[serde(skip_serializing_if = "Option::is_none")]
12027    pub reference_prefix: Option<String>,
12028}
12029impl ConfirmSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
12030    pub fn new() -> Self {
12031        Self { reference_prefix: None }
12032    }
12033}
12034impl Default for ConfirmSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
12035    fn default() -> Self {
12036        Self::new()
12037    }
12038}
12039/// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options.
12040#[derive(Clone, Debug, serde::Serialize)]
12041pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccount {
12042    /// Additional fields for Financial Connections Session creation
12043    #[serde(skip_serializing_if = "Option::is_none")]
12044    pub financial_connections:
12045        Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
12046    /// Additional fields for Mandate creation
12047    #[serde(skip_serializing_if = "Option::is_none")]
12048    pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
12049    /// Additional fields for network related functions
12050    #[serde(skip_serializing_if = "Option::is_none")]
12051    pub networks: Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks>,
12052    /// Bank account verification method.
12053    #[serde(skip_serializing_if = "Option::is_none")]
12054    pub verification_method:
12055        Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
12056}
12057impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccount {
12058    pub fn new() -> Self {
12059        Self {
12060            financial_connections: None,
12061            mandate_options: None,
12062            networks: None,
12063            verification_method: None,
12064        }
12065    }
12066}
12067impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccount {
12068    fn default() -> Self {
12069        Self::new()
12070    }
12071}
12072/// Additional fields for Financial Connections Session creation
12073#[derive(Clone, Debug, serde::Serialize)]
12074pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
12075    /// Provide filters for the linked accounts that the customer can select for the payment method.
12076    #[serde(skip_serializing_if = "Option::is_none")]
12077    pub filters:
12078        Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
12079    /// The list of permissions to request.
12080    /// If this parameter is passed, the `payment_method` permission must be included.
12081    /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
12082    #[serde(skip_serializing_if = "Option::is_none")]
12083    pub permissions: Option<
12084        Vec<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
12085    >,
12086    /// List of data features that you would like to retrieve upon account creation.
12087    #[serde(skip_serializing_if = "Option::is_none")]
12088    pub prefetch: Option<
12089        Vec<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>,
12090    >,
12091    /// For webview integrations only.
12092    /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.
12093    #[serde(skip_serializing_if = "Option::is_none")]
12094    pub return_url: Option<String>,
12095}
12096impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
12097    pub fn new() -> Self {
12098        Self { filters: None, permissions: None, prefetch: None, return_url: None }
12099    }
12100}
12101impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
12102    fn default() -> Self {
12103        Self::new()
12104    }
12105}
12106/// Provide filters for the linked accounts that the customer can select for the payment method.
12107#[derive(Clone, Debug, serde::Serialize)]
12108pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
12109        /// The account subcategories to use to filter for selectable accounts.
12110    /// Valid subcategories are `checking` and `savings`.
12111#[serde(skip_serializing_if = "Option::is_none")]
12112pub account_subcategories: Option<Vec<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
12113
12114}
12115impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
12116    pub fn new() -> Self {
12117        Self { account_subcategories: None }
12118    }
12119}
12120impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
12121    fn default() -> Self {
12122        Self::new()
12123    }
12124}
12125/// The account subcategories to use to filter for selectable accounts.
12126/// Valid subcategories are `checking` and `savings`.
12127#[derive(Copy, Clone, Eq, PartialEq)]
12128pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
12129{
12130    Checking,
12131    Savings,
12132}
12133impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
12134    pub fn as_str(self) -> &'static str {
12135        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
12136        match self {
12137Checking => "checking",
12138Savings => "savings",
12139
12140        }
12141    }
12142}
12143
12144impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
12145    type Err = stripe_types::StripeParseError;
12146    fn from_str(s: &str) -> Result<Self, Self::Err> {
12147        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
12148        match s {
12149    "checking" => Ok(Checking),
12150"savings" => Ok(Savings),
12151_ => Err(stripe_types::StripeParseError)
12152
12153        }
12154    }
12155}
12156impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
12157    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12158        f.write_str(self.as_str())
12159    }
12160}
12161
12162impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
12163    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12164        f.write_str(self.as_str())
12165    }
12166}
12167impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
12168    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
12169        serializer.serialize_str(self.as_str())
12170    }
12171}
12172#[cfg(feature = "deserialize")]
12173impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
12174    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12175        use std::str::FromStr;
12176        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12177        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"))
12178    }
12179}
12180/// The list of permissions to request.
12181/// If this parameter is passed, the `payment_method` permission must be included.
12182/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
12183#[derive(Copy, Clone, Eq, PartialEq)]
12184pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
12185    Balances,
12186    Ownership,
12187    PaymentMethod,
12188    Transactions,
12189}
12190impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
12191    pub fn as_str(self) -> &'static str {
12192        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
12193        match self {
12194            Balances => "balances",
12195            Ownership => "ownership",
12196            PaymentMethod => "payment_method",
12197            Transactions => "transactions",
12198        }
12199    }
12200}
12201
12202impl std::str::FromStr
12203    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
12204{
12205    type Err = stripe_types::StripeParseError;
12206    fn from_str(s: &str) -> Result<Self, Self::Err> {
12207        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
12208        match s {
12209            "balances" => Ok(Balances),
12210            "ownership" => Ok(Ownership),
12211            "payment_method" => Ok(PaymentMethod),
12212            "transactions" => Ok(Transactions),
12213            _ => Err(stripe_types::StripeParseError),
12214        }
12215    }
12216}
12217impl std::fmt::Display
12218    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
12219{
12220    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12221        f.write_str(self.as_str())
12222    }
12223}
12224
12225impl std::fmt::Debug
12226    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
12227{
12228    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12229        f.write_str(self.as_str())
12230    }
12231}
12232impl serde::Serialize
12233    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
12234{
12235    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12236    where
12237        S: serde::Serializer,
12238    {
12239        serializer.serialize_str(self.as_str())
12240    }
12241}
12242#[cfg(feature = "deserialize")]
12243impl<'de> serde::Deserialize<'de>
12244    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
12245{
12246    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12247        use std::str::FromStr;
12248        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12249        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"))
12250    }
12251}
12252/// List of data features that you would like to retrieve upon account creation.
12253#[derive(Copy, Clone, Eq, PartialEq)]
12254pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
12255    Balances,
12256    Ownership,
12257    Transactions,
12258}
12259impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
12260    pub fn as_str(self) -> &'static str {
12261        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
12262        match self {
12263            Balances => "balances",
12264            Ownership => "ownership",
12265            Transactions => "transactions",
12266        }
12267    }
12268}
12269
12270impl std::str::FromStr
12271    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
12272{
12273    type Err = stripe_types::StripeParseError;
12274    fn from_str(s: &str) -> Result<Self, Self::Err> {
12275        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
12276        match s {
12277            "balances" => Ok(Balances),
12278            "ownership" => Ok(Ownership),
12279            "transactions" => Ok(Transactions),
12280            _ => Err(stripe_types::StripeParseError),
12281        }
12282    }
12283}
12284impl std::fmt::Display
12285    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
12286{
12287    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12288        f.write_str(self.as_str())
12289    }
12290}
12291
12292impl std::fmt::Debug
12293    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
12294{
12295    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12296        f.write_str(self.as_str())
12297    }
12298}
12299impl serde::Serialize
12300    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
12301{
12302    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12303    where
12304        S: serde::Serializer,
12305    {
12306        serializer.serialize_str(self.as_str())
12307    }
12308}
12309#[cfg(feature = "deserialize")]
12310impl<'de> serde::Deserialize<'de>
12311    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
12312{
12313    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12314        use std::str::FromStr;
12315        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12316        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"))
12317    }
12318}
12319/// Additional fields for Mandate creation
12320#[derive(Copy, Clone, Debug, serde::Serialize)]
12321pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
12322    /// The method used to collect offline mandate customer acceptance.
12323    #[serde(skip_serializing_if = "Option::is_none")]
12324    pub collection_method:
12325        Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
12326}
12327impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
12328    pub fn new() -> Self {
12329        Self { collection_method: None }
12330    }
12331}
12332impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
12333    fn default() -> Self {
12334        Self::new()
12335    }
12336}
12337/// The method used to collect offline mandate customer acceptance.
12338#[derive(Copy, Clone, Eq, PartialEq)]
12339pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
12340    Paper,
12341}
12342impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
12343    pub fn as_str(self) -> &'static str {
12344        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
12345        match self {
12346            Paper => "paper",
12347        }
12348    }
12349}
12350
12351impl std::str::FromStr
12352    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
12353{
12354    type Err = stripe_types::StripeParseError;
12355    fn from_str(s: &str) -> Result<Self, Self::Err> {
12356        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
12357        match s {
12358            "paper" => Ok(Paper),
12359            _ => Err(stripe_types::StripeParseError),
12360        }
12361    }
12362}
12363impl std::fmt::Display
12364    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
12365{
12366    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12367        f.write_str(self.as_str())
12368    }
12369}
12370
12371impl std::fmt::Debug
12372    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
12373{
12374    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12375        f.write_str(self.as_str())
12376    }
12377}
12378impl serde::Serialize
12379    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
12380{
12381    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12382    where
12383        S: serde::Serializer,
12384    {
12385        serializer.serialize_str(self.as_str())
12386    }
12387}
12388#[cfg(feature = "deserialize")]
12389impl<'de> serde::Deserialize<'de>
12390    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
12391{
12392    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12393        use std::str::FromStr;
12394        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12395        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"))
12396    }
12397}
12398/// Additional fields for network related functions
12399#[derive(Clone, Debug, serde::Serialize)]
12400pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
12401    /// Triggers validations to run across the selected networks
12402    #[serde(skip_serializing_if = "Option::is_none")]
12403    pub requested:
12404        Option<Vec<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
12405}
12406impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
12407    pub fn new() -> Self {
12408        Self { requested: None }
12409    }
12410}
12411impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
12412    fn default() -> Self {
12413        Self::new()
12414    }
12415}
12416/// Triggers validations to run across the selected networks
12417#[derive(Copy, Clone, Eq, PartialEq)]
12418pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
12419    Ach,
12420    UsDomesticWire,
12421}
12422impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
12423    pub fn as_str(self) -> &'static str {
12424        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
12425        match self {
12426            Ach => "ach",
12427            UsDomesticWire => "us_domestic_wire",
12428        }
12429    }
12430}
12431
12432impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
12433    type Err = stripe_types::StripeParseError;
12434    fn from_str(s: &str) -> Result<Self, Self::Err> {
12435        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
12436        match s {
12437            "ach" => Ok(Ach),
12438            "us_domestic_wire" => Ok(UsDomesticWire),
12439            _ => Err(stripe_types::StripeParseError),
12440        }
12441    }
12442}
12443impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
12444    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12445        f.write_str(self.as_str())
12446    }
12447}
12448
12449impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
12450    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12451        f.write_str(self.as_str())
12452    }
12453}
12454impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
12455    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12456    where
12457        S: serde::Serializer,
12458    {
12459        serializer.serialize_str(self.as_str())
12460    }
12461}
12462#[cfg(feature = "deserialize")]
12463impl<'de> serde::Deserialize<'de>
12464    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested
12465{
12466    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12467        use std::str::FromStr;
12468        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12469        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested"))
12470    }
12471}
12472/// Bank account verification method.
12473#[derive(Copy, Clone, Eq, PartialEq)]
12474pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
12475    Automatic,
12476    Instant,
12477    Microdeposits,
12478}
12479impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
12480    pub fn as_str(self) -> &'static str {
12481        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
12482        match self {
12483            Automatic => "automatic",
12484            Instant => "instant",
12485            Microdeposits => "microdeposits",
12486        }
12487    }
12488}
12489
12490impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
12491    type Err = stripe_types::StripeParseError;
12492    fn from_str(s: &str) -> Result<Self, Self::Err> {
12493        use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
12494        match s {
12495            "automatic" => Ok(Automatic),
12496            "instant" => Ok(Instant),
12497            "microdeposits" => Ok(Microdeposits),
12498            _ => Err(stripe_types::StripeParseError),
12499        }
12500    }
12501}
12502impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
12503    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12504        f.write_str(self.as_str())
12505    }
12506}
12507
12508impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
12509    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12510        f.write_str(self.as_str())
12511    }
12512}
12513impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
12514    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12515    where
12516        S: serde::Serializer,
12517    {
12518        serializer.serialize_str(self.as_str())
12519    }
12520}
12521#[cfg(feature = "deserialize")]
12522impl<'de> serde::Deserialize<'de>
12523    for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod
12524{
12525    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12526        use std::str::FromStr;
12527        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12528        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod"))
12529    }
12530}
12531/// Confirm that your customer intends to set up the current or
12532/// provided payment method. For example, you would confirm a SetupIntent
12533/// when a customer hits the “Save” button on a payment method management
12534/// page on your website.
12535///
12536/// If the selected payment method does not require any additional
12537/// steps from the customer, the SetupIntent will transition to the
12538/// `succeeded` status.
12539///
12540/// Otherwise, it will transition to the `requires_action` status and
12541/// suggest additional actions via `next_action`. If setup fails,
12542/// the SetupIntent will transition to the
12543/// `requires_payment_method` status or the `canceled` status if the
12544/// confirmation limit is reached.
12545#[derive(Clone, Debug, serde::Serialize)]
12546pub struct ConfirmSetupIntent {
12547    inner: ConfirmSetupIntentBuilder,
12548    intent: stripe_shared::SetupIntentId,
12549}
12550impl ConfirmSetupIntent {
12551    /// Construct a new `ConfirmSetupIntent`.
12552    pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
12553        Self { intent: intent.into(), inner: ConfirmSetupIntentBuilder::new() }
12554    }
12555    /// ID of the ConfirmationToken used to confirm this SetupIntent.
12556    ///
12557    /// 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.
12558    pub fn confirmation_token(mut self, confirmation_token: impl Into<String>) -> Self {
12559        self.inner.confirmation_token = Some(confirmation_token.into());
12560        self
12561    }
12562    /// Specifies which fields in the response should be expanded.
12563    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
12564        self.inner.expand = Some(expand.into());
12565        self
12566    }
12567    pub fn mandate_data(mut self, mandate_data: impl Into<ConfirmSetupIntentMandateData>) -> Self {
12568        self.inner.mandate_data = Some(mandate_data.into());
12569        self
12570    }
12571    /// ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent.
12572    pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
12573        self.inner.payment_method = Some(payment_method.into());
12574        self
12575    }
12576    /// 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).
12577    /// value in the SetupIntent.
12578    pub fn payment_method_data(
12579        mut self,
12580        payment_method_data: impl Into<ConfirmSetupIntentPaymentMethodData>,
12581    ) -> Self {
12582        self.inner.payment_method_data = Some(payment_method_data.into());
12583        self
12584    }
12585    /// Payment method-specific configuration for this SetupIntent.
12586    pub fn payment_method_options(
12587        mut self,
12588        payment_method_options: impl Into<ConfirmSetupIntentPaymentMethodOptions>,
12589    ) -> Self {
12590        self.inner.payment_method_options = Some(payment_method_options.into());
12591        self
12592    }
12593    /// The URL to redirect your customer back to after they authenticate on the payment method's app or site.
12594    /// If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme.
12595    /// This parameter is only used for cards and other redirect-based payment methods.
12596    pub fn return_url(mut self, return_url: impl Into<String>) -> Self {
12597        self.inner.return_url = Some(return_url.into());
12598        self
12599    }
12600    /// Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions.
12601    pub fn use_stripe_sdk(mut self, use_stripe_sdk: impl Into<bool>) -> Self {
12602        self.inner.use_stripe_sdk = Some(use_stripe_sdk.into());
12603        self
12604    }
12605}
12606impl ConfirmSetupIntent {
12607    /// Send the request and return the deserialized response.
12608    pub async fn send<C: StripeClient>(
12609        &self,
12610        client: &C,
12611    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
12612        self.customize().send(client).await
12613    }
12614
12615    /// Send the request and return the deserialized response, blocking until completion.
12616    pub fn send_blocking<C: StripeBlockingClient>(
12617        &self,
12618        client: &C,
12619    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
12620        self.customize().send_blocking(client)
12621    }
12622}
12623
12624impl StripeRequest for ConfirmSetupIntent {
12625    type Output = stripe_shared::SetupIntent;
12626
12627    fn build(&self) -> RequestBuilder {
12628        let intent = &self.intent;
12629        RequestBuilder::new(StripeMethod::Post, format!("/setup_intents/{intent}/confirm"))
12630            .form(&self.inner)
12631    }
12632}
12633#[derive(Clone, Debug, serde::Serialize)]
12634struct VerifyMicrodepositsSetupIntentBuilder {
12635    #[serde(skip_serializing_if = "Option::is_none")]
12636    amounts: Option<Vec<i64>>,
12637    #[serde(skip_serializing_if = "Option::is_none")]
12638    descriptor_code: Option<String>,
12639    #[serde(skip_serializing_if = "Option::is_none")]
12640    expand: Option<Vec<String>>,
12641}
12642impl VerifyMicrodepositsSetupIntentBuilder {
12643    fn new() -> Self {
12644        Self { amounts: None, descriptor_code: None, expand: None }
12645    }
12646}
12647/// Verifies microdeposits on a SetupIntent object.
12648#[derive(Clone, Debug, serde::Serialize)]
12649pub struct VerifyMicrodepositsSetupIntent {
12650    inner: VerifyMicrodepositsSetupIntentBuilder,
12651    intent: stripe_shared::SetupIntentId,
12652}
12653impl VerifyMicrodepositsSetupIntent {
12654    /// Construct a new `VerifyMicrodepositsSetupIntent`.
12655    pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
12656        Self { intent: intent.into(), inner: VerifyMicrodepositsSetupIntentBuilder::new() }
12657    }
12658    /// Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account.
12659    pub fn amounts(mut self, amounts: impl Into<Vec<i64>>) -> Self {
12660        self.inner.amounts = Some(amounts.into());
12661        self
12662    }
12663    /// A six-character code starting with SM present in the microdeposit sent to the bank account.
12664    pub fn descriptor_code(mut self, descriptor_code: impl Into<String>) -> Self {
12665        self.inner.descriptor_code = Some(descriptor_code.into());
12666        self
12667    }
12668    /// Specifies which fields in the response should be expanded.
12669    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
12670        self.inner.expand = Some(expand.into());
12671        self
12672    }
12673}
12674impl VerifyMicrodepositsSetupIntent {
12675    /// Send the request and return the deserialized response.
12676    pub async fn send<C: StripeClient>(
12677        &self,
12678        client: &C,
12679    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
12680        self.customize().send(client).await
12681    }
12682
12683    /// Send the request and return the deserialized response, blocking until completion.
12684    pub fn send_blocking<C: StripeBlockingClient>(
12685        &self,
12686        client: &C,
12687    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
12688        self.customize().send_blocking(client)
12689    }
12690}
12691
12692impl StripeRequest for VerifyMicrodepositsSetupIntent {
12693    type Output = stripe_shared::SetupIntent;
12694
12695    fn build(&self) -> RequestBuilder {
12696        let intent = &self.intent;
12697        RequestBuilder::new(
12698            StripeMethod::Post,
12699            format!("/setup_intents/{intent}/verify_microdeposits"),
12700        )
12701        .form(&self.inner)
12702    }
12703}
12704
12705#[derive(Clone, Debug, serde::Serialize)]
12706pub struct OnlineParam {
12707    /// The IP address from which the Mandate was accepted by the customer.
12708    pub ip_address: String,
12709    /// The user agent of the browser from which the Mandate was accepted by the customer.
12710    pub user_agent: String,
12711}
12712impl OnlineParam {
12713    pub fn new(ip_address: impl Into<String>, user_agent: impl Into<String>) -> Self {
12714        Self { ip_address: ip_address.into(), user_agent: user_agent.into() }
12715    }
12716}
12717#[derive(Clone, Debug, serde::Serialize)]
12718pub struct PaymentMethodParam {
12719    /// Customer's bank account number.
12720    pub account_number: String,
12721    /// Institution number of the customer's bank.
12722    pub institution_number: String,
12723    /// Transit number of the customer's bank.
12724    pub transit_number: String,
12725}
12726impl PaymentMethodParam {
12727    pub fn new(
12728        account_number: impl Into<String>,
12729        institution_number: impl Into<String>,
12730        transit_number: impl Into<String>,
12731    ) -> Self {
12732        Self {
12733            account_number: account_number.into(),
12734            institution_number: institution_number.into(),
12735            transit_number: transit_number.into(),
12736        }
12737    }
12738}
12739#[derive(Clone, Debug, serde::Serialize)]
12740pub struct BillingDetailsAddress {
12741    /// City, district, suburb, town, or village.
12742    #[serde(skip_serializing_if = "Option::is_none")]
12743    pub city: Option<String>,
12744    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
12745    #[serde(skip_serializing_if = "Option::is_none")]
12746    pub country: Option<String>,
12747    /// Address line 1, such as the street, PO Box, or company name.
12748    #[serde(skip_serializing_if = "Option::is_none")]
12749    pub line1: Option<String>,
12750    /// Address line 2, such as the apartment, suite, unit, or building.
12751    #[serde(skip_serializing_if = "Option::is_none")]
12752    pub line2: Option<String>,
12753    /// ZIP or postal code.
12754    #[serde(skip_serializing_if = "Option::is_none")]
12755    pub postal_code: Option<String>,
12756    /// State, county, province, or region.
12757    #[serde(skip_serializing_if = "Option::is_none")]
12758    pub state: Option<String>,
12759}
12760impl BillingDetailsAddress {
12761    pub fn new() -> Self {
12762        Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
12763    }
12764}
12765impl Default for BillingDetailsAddress {
12766    fn default() -> Self {
12767        Self::new()
12768    }
12769}
12770#[derive(Copy, Clone, Debug, serde::Serialize)]
12771pub struct DateOfBirth {
12772    /// The day of birth, between 1 and 31.
12773    pub day: i64,
12774    /// The month of birth, between 1 and 12.
12775    pub month: i64,
12776    /// The four-digit year of birth.
12777    pub year: i64,
12778}
12779impl DateOfBirth {
12780    pub fn new(day: impl Into<i64>, month: impl Into<i64>, year: impl Into<i64>) -> Self {
12781        Self { day: day.into(), month: month.into(), year: year.into() }
12782    }
12783}
12784#[derive(Clone, Debug, serde::Serialize)]
12785pub struct RadarOptionsWithHiddenOptions {
12786    /// 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.
12787    #[serde(skip_serializing_if = "Option::is_none")]
12788    pub session: Option<String>,
12789}
12790impl RadarOptionsWithHiddenOptions {
12791    pub fn new() -> Self {
12792        Self { session: None }
12793    }
12794}
12795impl Default for RadarOptionsWithHiddenOptions {
12796    fn default() -> Self {
12797        Self::new()
12798    }
12799}
12800#[derive(Clone, Debug, serde::Serialize)]
12801pub struct PaymentMethodOptionsMandateOptionsParam {
12802    /// Prefix used to generate the Mandate reference.
12803    /// Must be at most 12 characters long.
12804    /// Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'.
12805    /// Cannot begin with 'DDIC' or 'STRIPE'.
12806    #[serde(skip_serializing_if = "Option::is_none")]
12807    pub reference_prefix: Option<String>,
12808}
12809impl PaymentMethodOptionsMandateOptionsParam {
12810    pub fn new() -> Self {
12811        Self { reference_prefix: None }
12812    }
12813}
12814impl Default for PaymentMethodOptionsMandateOptionsParam {
12815    fn default() -> Self {
12816        Self::new()
12817    }
12818}
12819#[derive(Clone, Debug, serde::Serialize)]
12820pub struct SubscriptionNextBillingParam {
12821    /// The amount of the next charge for the subscription.
12822    pub amount: i64,
12823    /// The date of the next charge for the subscription in YYYY-MM-DD format.
12824    pub date: String,
12825}
12826impl SubscriptionNextBillingParam {
12827    pub fn new(amount: impl Into<i64>, date: impl Into<String>) -> Self {
12828        Self { amount: amount.into(), date: date.into() }
12829    }
12830}
12831#[derive(Clone, Debug, serde::Serialize)]
12832pub struct SetupIntentPaymentMethodOptionsParam {
12833    /// \[Deprecated\] This is a legacy parameter that no longer has any function.
12834    #[serde(skip_serializing_if = "Option::is_none")]
12835    pub persistent_token: Option<String>,
12836}
12837impl SetupIntentPaymentMethodOptionsParam {
12838    pub fn new() -> Self {
12839        Self { persistent_token: None }
12840    }
12841}
12842impl Default for SetupIntentPaymentMethodOptionsParam {
12843    fn default() -> Self {
12844        Self::new()
12845    }
12846}
12847#[derive(Clone, Debug, serde::Serialize)]
12848pub struct PaymentMethodOptionsParam {
12849    /// The PayPal Billing Agreement ID (BAID).
12850    /// This is an ID generated by PayPal which represents the mandate between the merchant and the customer.
12851    #[serde(skip_serializing_if = "Option::is_none")]
12852    pub billing_agreement_id: Option<String>,
12853}
12854impl PaymentMethodOptionsParam {
12855    pub fn new() -> Self {
12856        Self { billing_agreement_id: None }
12857    }
12858}
12859impl Default for PaymentMethodOptionsParam {
12860    fn default() -> Self {
12861        Self::new()
12862    }
12863}
12864#[derive(Clone, Debug, serde::Serialize)]
12865pub struct BillingDetailsInnerParams {
12866    /// Billing address.
12867    #[serde(skip_serializing_if = "Option::is_none")]
12868    pub address: Option<BillingDetailsAddress>,
12869    /// Email address.
12870    #[serde(skip_serializing_if = "Option::is_none")]
12871    pub email: Option<String>,
12872    /// Full name.
12873    #[serde(skip_serializing_if = "Option::is_none")]
12874    pub name: Option<String>,
12875    /// Billing phone number (including extension).
12876    #[serde(skip_serializing_if = "Option::is_none")]
12877    pub phone: Option<String>,
12878    /// Taxpayer identification number.
12879    /// Used only for transactions between LATAM buyers and non-LATAM sellers.
12880    #[serde(skip_serializing_if = "Option::is_none")]
12881    pub tax_id: Option<String>,
12882}
12883impl BillingDetailsInnerParams {
12884    pub fn new() -> Self {
12885        Self { address: None, email: None, name: None, phone: None, tax_id: None }
12886    }
12887}
12888impl Default for BillingDetailsInnerParams {
12889    fn default() -> Self {
12890        Self::new()
12891    }
12892}